diff --git a/5.2674d4ca6f38b573a20c.js b/5.2674d4ca6f38b573a20c.js new file mode 100644 index 00000000..ab2e34c6 --- /dev/null +++ b/5.2674d4ca6f38b573a20c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"7CyS":function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o}));var n=i("Womt"),s=i("VwSi");const r=30;function o(t,e){const i=e.interpolation===s.a.Spline?n.InterpolateSmooth:n.InterpolateLinear,o=[];return e.motion_data.forEach((e,a)=>{const _=t.get_bone(a);_&&e.tracks.forEach(({type:t,keyframes:e})=>{const u=[],h=[];for(const i of e)if(u.push(i.frame/r),t===s.b.Rotation){const t=_.evaluation_flags.zxy_rotation_order?"ZXY":"ZYX",e=(new n.Quaternion).setFromEuler(new n.Euler(i.value.x,i.value.y,i.value.z,t));h.push(e.x,e.y,e.z,e.w)}else h.push(i.value.x,i.value.y,i.value.z);if(t===s.b.Rotation)o.push(new n.QuaternionKeyframeTrack(`.bones[${a}].quaternion`,u,h,i));else{const e=t===s.b.Position?`.bones[${a}].position`:`.bones[${a}].scale`;o.push(new n.VectorKeyframeTrack(e,u,h,i))}})}),new n.AnimationClip("Animation",(e.frame_count-1)/r,o).optimize()}},"9Ykw":function(t,e,i){"use strict";function n(t){const e=[];for(;t.bytes_left;){const i=t.u32(),n=t.u32();if(n>t.bytes_left)break;e.push({type:i,data:t.take(n)})}return e}i.d(e,"a",(function(){return n}))},"9dYx":function(t,e,i){"use strict";var n=i("bcBH");class s{constructor(t,e){this._position=0,this.endianness=t,this.offset=e}get position(){return this._position}get endianness(){return this.little_endian?n.a.Little:n.a.Big}set endianness(t){this.little_endian=t===n.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const e=[];for(let i=0;ithis.size-this.position)throw new Error(`${t} ${e} is out of bounds.`)}check_offset(t,e){if(t<0||t+e>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}i.d(e,"a",(function(){return r}));class r extends s{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_i32_array(t){return this.write_i32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const e=t.size-t.position;return this.ensure_size(e),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,e),e),this._position+=e,this}write_string_ascii(t,e){return this.write_string_ascii_at(this.position,t,e),this._position+=e,this}write_string_utf16(t,e){return this.write_string_utf16_at(this.position,t,e),this._position+=e,this}write_u8_at(t,e){return this.ensure_size(1,t),this.dv.setUint8(t,e),this}write_u16_at(t,e){return this.ensure_size(2,t),this.dv.setUint16(t,e,this.little_endian),this}write_u32_at(t,e){return this.ensure_size(4,t),this.dv.setUint32(t,e,this.little_endian),this}write_i8_at(t,e){return this.ensure_size(1,t),this.dv.setInt8(t,e),this}write_i16_at(t,e){return this.ensure_size(2,t),this.dv.setInt16(t,e,this.little_endian),this}write_i32_at(t,e){return this.ensure_size(4,t),this.dv.setInt32(t,e,this.little_endian),this}write_f32_at(t,e){return this.ensure_size(4,t),this.dv.setFloat32(t,e,this.little_endian),this}write_u8_array_at(t,e){return this.ensure_size(e.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(e)),this}write_u16_array_at(t,e){this.ensure_size(2*e.length,t);const i=e.length;for(let n=0;ni)throw new Error(`${t} Bytes required but only ${i} available.`)}}},NRxM:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i("9dYx");class s extends n.a{constructor(t,e,i=0,n=t.byteLength-i){super(e,i),this._size=n,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const e=this.offset+this.position,i=new s(this.backing_buffer,this.endianness,e,t);return this._position+=t,i}}},"Sa3/":function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{_(n.next(t))}catch(t){r(t)}}function a(t){try{_(n.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}_((n=n.apply(t,e||[])).next())}))};function s(t){return n(this,void 0,void 0,(function*(){return new Promise((e,i)=>{const n=new FileReader;n.addEventListener("loadend",()=>{n.result instanceof ArrayBuffer?e(n.result):i(new Error("Couldn't read file."))}),n.readAsArrayBuffer(t)})}))}},VwSi:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a}));var n=i("kwt4");const s=1296321870;var r,o;function a(t,e){return t.u32()===s?function(t,e){const i=t.u32();return _(t.take(i),e)}(t,e):(t.seek_start(0),function(t,e){t.seek_end(16);const i=t.u32();t.seek_start(i);const n=t.u32();return t.seek_start(n),function(t,e){t.seek(4);const i=t.u32();return t.seek_start(i),_(t,e)}(t,e)}(t,e))}function _(t,e){let i=t.u32();const n=t.u32(),s=t.u16(),r=t.u16(),a=(192&r)>>6,_=15&r,c=[];for(let r=0;r=i)return t.seek_start(r),c(t,e);o=n}return s}function c(t,e){const i=[];for(let s=0;s>>14,super_sample:0!=(64&e),texture_id:8191&e})}else 17<=a&&a<=31?(l=2+2*t.u16(),n.push({type:o.Material,type_id:a})):32<=a&&a<=50?(l=2+4*t.u16(),n.push({type:o.Vertex,type_id:a,vertices:u(t,a,c)})):56<=a&&a<=58?(l=2+2*t.u16(),n.push({type:o.Volume,type_id:a})):64<=a&&a<=75?(l=2+2*t.u16(),n.push({type:o.Strip,type_id:a,triangle_strips:h(t,a,c)})):255===a?(l=i?2:0,n.push({type:o.End,type_id:a}),s=!1):(l=2+2*t.u16(),n.push({type:o.Unknown,type_id:a}),r.warn(`Unknown chunk type ${a} at offset ${f}.`));t.seek_start(f+l)}return n}function u(t,e,i){if(e<32||e>50)return r.warn(`Unknown vertex chunk type ${e}.`),[];const n=3&i,s=0!=(128&i),o=t.u16(),a=t.u16(),_=[];for(let i=0;i=42&&(44===e?(r.index=o+t.u16(),r.bone_weight=t.u16()/255):t.seek(4));else if(48<=e&&e<=50){const i=t.u32();r.normal={x:(i>>20&1023)/1023,y:(i>>10&1023)/1023,z:(1023&i)/1023},e>=49&&t.seek(4)}_.push(r)}return _}function h(t,e,i){const n={ignore_light:0!=(1&i),ignore_specular:0!=(2&i),ignore_ambient:0!=(4&i),use_alpha:0!=(8&i),double_side:0!=(16&i),flat_shading:0!=(32&i),environment_mapping:0!=(64&i)},s=t.u16(),r=s>>>14,o=16383&s;let a=!1,_=!1,u=!1,h=!1;switch(e){case 64:break;case 65:case 66:a=!0;break;case 67:u=!0;break;case 68:case 69:a=!0,u=!0;break;case 70:_=!0;break;case 71:case 72:a=!0,_=!0;break;case 73:break;case 74:case 75:h=!0;break;default:throw new Error(`Unexpected chunk type ID: ${e}.`)}const c=[];for(let e=0;e=2&&t.seek(2*r)}c.push(Object.assign(Object.assign({},n),{clockwise_winding:i,has_tex_coords:a,has_normal:u,vertices:o}))}return c}!function(t){t[t.Unknown=0]="Unknown",t[t.Null=1]="Null",t[t.Bits=2]="Bits",t[t.CachePolygonList=3]="CachePolygonList",t[t.DrawPolygonList=4]="DrawPolygonList",t[t.Tiny=5]="Tiny",t[t.Material=6]="Material",t[t.Vertex=7]="Vertex",t[t.Volume=8]="Volume",t[t.Strip=9]="Strip",t[t.End=10]="End"}(o||(o={}));const c=s.c.get("core/data_formats/parsing/ninja/xj");function f(t){t.seek(4);const e=t.u32(),i=t.u32(),n=t.u32(),s=t.u32(),r=t.u32(),o=t.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:t.vec3_f32(),collision_sphere_radius:t.f32()};return i>=1&&(i>1&&c.warn(`Vertex info count of ${i} was larger than expected.`),a.vertices.push(...function(t,e){t.seek_start(e);const i=t.u16();t.seek(2);const n=t.u32(),s=t.u32(),r=t.u32(),o=[];for(let e=0;et.type===w),r=[];for(const t of s)r.push(...x(t.data,e,i));return r}function x(t,e,i){const n=t.u32(),s=0!=(1&n),r=0!=(2&n),o=0!=(4&n),a=0!=(8&n),_=0!=(16&n),u=0!=(32&n),h=0!=(64&n),c=0!=(128&n),f=t.u32(),l=t.vec3_f32(),d={x:t.i32()*p,y:t.i32()*p,z:t.i32()*p},w=t.vec3_f32(),m=t.u32(),y=t.u32();let k,b,g;return f&&(t.seek_start(f),k=e(t,i)),m?(t.seek_start(m),b=x(t,e,i)):b=[],y?(t.seek_start(y),g=x(t,e,i)):g=[],[new v({no_translate:s,no_rotate:r,no_scale:o,hidden:a,break_child_trace:_,zxy_rotation_order:u,skip:h,shape_skip:c},k,l,d,w,b),...g]}},tyuj:function(t,e,i){"use strict";i.r(e);var n=i("NRxM"),s=i("bcBH"),r=i("VwSi"),o=i("kwt4");class a{constructor(t,e,i,n){this.name=t,this.head_style_count=e,this.hair_styles_count=i,this.hair_styles_with_accessory=n}}class _{constructor(t,e){this.id=t,this.name=e}}var u=i("Sa3/"),h=i("ouMO"),c=i("7CyS"),f=i("yub1"),l=i("kcKQ"),d=i("rwco");i.d(e,"Model3DStore",(function(){return m}));var p=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{_(n.next(t))}catch(t){r(t)}}function a(t){try{_(n.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}_((n=n.apply(t,e||[])).next())}))};const w=d.c.get("viewer/stores/ModelStore");class m extends l.a{constructor(t){super(),this.asset_loader=t,this._current_model=Object(h.e)(void 0),this._current_nj_data=Object(h.e)(void 0),this._current_xvm=Object(h.e)(void 0),this._show_skeleton=Object(h.e)(!1),this._current_animation=Object(h.e)(void 0),this._current_nj_motion=Object(h.e)(void 0),this._animation_playing=Object(h.e)(!0),this._animation_frame_rate=Object(h.e)(c.a),this._animation_frame=Object(h.e)(0),this.models=[new a("HUmar",1,10,new Set([6])),new a("HUnewearl",1,10,new Set),new a("HUcast",5,0,new Set),new a("HUcaseal",5,0,new Set),new a("RAmar",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("RAmarl",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("RAcast",5,0,new Set),new a("RAcaseal",5,0,new Set),new a("FOmar",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("FOmarl",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("FOnewm",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("FOnewearl",1,10,new Set([0,1,2,3,4,5,6,7,8,9]))],this.animations=new Array(572).fill(void 0).map((t,e)=>new _(e,`Animation ${e+1}`)),this.current_model=this._current_model,this.current_nj_data=this._current_nj_data,this.current_xvm=this._current_xvm,this.show_skeleton=this._show_skeleton,this.current_animation=this._current_animation,this.current_nj_motion=this._current_nj_motion,this.animation_playing=this._animation_playing,this.animation_frame_rate=this._animation_frame_rate,this.animation_frame=this._animation_frame,this.animation_frame_count=this.current_nj_motion.map(t=>t?t.frame_count:0),this.set_current_model=t=>{this._current_model.val=t},this.clear_current_model=()=>{this._current_model.val=void 0},this.set_show_skeleton=t=>{this._show_skeleton.val=t},this.set_current_animation=t=>{this._current_animation.val=t},this.clear_current_animation=()=>{this._current_animation.val=void 0},this.set_animation_playing=t=>{this._animation_playing.val=t},this.set_animation_frame_rate=t=>{this._animation_frame_rate.val=t},this.set_animation_frame=t=>{this._animation_frame.val=t},this.load_file=t=>p(this,void 0,void 0,(function*(){try{const e=yield Object(u.a)(t),i=new n.a(e,s.a.Little);if(t.name.endsWith(".nj")){this.clear_current_model();const t=Object(o.c)(i)[0];this.set_current_nj_data({nj_object:t,bone_count:t.bone_count(),has_skeleton:!0})}else if(t.name.endsWith(".xj")){this.clear_current_model();const t=Object(o.d)(i)[0];this.set_current_nj_data({nj_object:t,bone_count:0,has_skeleton:!1})}else if(t.name.endsWith(".njm")){this.clear_current_animation(),this._current_nj_motion.val=void 0;const t=this.current_nj_data.val;t&&(this.set_animation_playing(!0),this._current_nj_motion.val=Object(r.c)(i,t.bone_count))}else t.name.endsWith(".xvm")?this.current_model&&(this._current_xvm.val=Object(f.a)(i)):w.error(`Unknown file extension in filename "${t.name}".`)}catch(t){w.error("Couldn't read file.",t)}})),this.load_model=t=>p(this,void 0,void 0,(function*(){if(this.clear_current_animation(),t)try{const e=yield this.asset_loader.load_geometry(t);this.set_current_nj_data({nj_object:e,bone_count:t?64:e.bone_count(),has_skeleton:!0})}catch(e){w.error(`Couldn't load model for ${t.name}.`),this._current_nj_data.val=void 0}else this._current_nj_data.val=void 0})),this.load_animation=t=>p(this,void 0,void 0,(function*(){const e=this.current_nj_data.val;if(e&&t)try{this._current_nj_motion.val=yield this.asset_loader.load_animation(t.id,e.bone_count),this.set_animation_playing(!0)}catch(e){w.error(`Couldn't load animation "${t.name}".`),this._current_nj_motion.val=void 0}else this._current_nj_motion.val=void 0})),this.disposables(this.current_model.observe(({value:t})=>this.load_model(t)),this.current_animation.observe(({value:t})=>this.load_animation(t)))}set_current_nj_data(t){this._current_xvm.val=void 0,this._current_nj_data.val=t}}},yub1:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n=i("9Ykw");const s=i("rwco").c.get("core/data_formats/parsing/ninja/texture"),r=1213027928,o=1414682200;function a(t){const e=Object(n.a)(t),i=e.find(t=>t.type===r),a=i&&function(t){return{texture_count:t.u16()}}(i.data),_=e.filter(t=>t.type===o).map(t=>(function(t){const e=t.u32(),i=t.u32(),n=t.u32(),s=t.u16(),r=t.u16(),o=t.u32();return t.seek(36),{id:n,format:[e,i],width:s,height:r,size:o,data:t.array_buffer(o)}})(t.data));return a&&a.texture_count!==_.length&&s.warn(`Found ${_.length} textures instead of ${a.texture_count} as defined in the header.`),{textures:_}}}}]); \ No newline at end of file diff --git a/5.c5f1d0dc4080120d4a74.js b/5.c5f1d0dc4080120d4a74.js deleted file mode 100644 index 4fe8406f..00000000 --- a/5.c5f1d0dc4080120d4a74.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{"7CyS":function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o}));var n=i("Womt"),s=i("VwSi");const r=30;function o(t,e){const i=e.interpolation===s.a.Spline?n.InterpolateSmooth:n.InterpolateLinear,o=[];return e.motion_data.forEach((e,a)=>{const _=t.get_bone(a);_&&e.tracks.forEach(({type:t,keyframes:e})=>{const u=[],h=[];for(const i of e)if(u.push(i.frame/r),t===s.b.Rotation){const t=_.evaluation_flags.zxy_rotation_order?"ZXY":"ZYX",e=(new n.Quaternion).setFromEuler(new n.Euler(i.value.x,i.value.y,i.value.z,t));h.push(e.x,e.y,e.z,e.w)}else h.push(i.value.x,i.value.y,i.value.z);if(t===s.b.Rotation)o.push(new n.QuaternionKeyframeTrack(`.bones[${a}].quaternion`,u,h,i));else{const e=t===s.b.Position?`.bones[${a}].position`:`.bones[${a}].scale`;o.push(new n.VectorKeyframeTrack(e,u,h,i))}})}),new n.AnimationClip("Animation",(e.frame_count-1)/r,o).optimize()}},"9Ykw":function(t,e,i){"use strict";function n(t){const e=[];for(;t.bytes_left;){const i=t.u32(),n=t.u32();if(n>t.bytes_left)break;e.push({type:i,data:t.take(n)})}return e}i.d(e,"a",(function(){return n}))},"9dYx":function(t,e,i){"use strict";var n=i("bcBH");class s{constructor(t,e){this._position=0,this.endianness=t,this.offset=e}get position(){return this._position}get endianness(){return this.little_endian?n.a.Little:n.a.Big}set endianness(t){this.little_endian=t===n.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const e=[];for(let i=0;ithis.size-this.position)throw new Error(`${t} ${e} is out of bounds.`)}check_offset(t,e){if(t<0||t+e>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}i.d(e,"a",(function(){return r}));class r extends s{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const e=t.size-t.position;return this.ensure_size(e),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,e),e),this._position+=e,this}write_string_ascii(t,e){return this.write_string_ascii_at(this.position,t,e),this._position+=e,this}write_string_utf16(t,e){return this.write_string_utf16_at(this.position,t,e),this._position+=e,this}write_u8_at(t,e){return this.ensure_size(1,t),this.dv.setUint8(t,e),this}write_u16_at(t,e){return this.ensure_size(2,t),this.dv.setUint16(t,e,this.little_endian),this}write_u32_at(t,e){return this.ensure_size(4,t),this.dv.setUint32(t,e,this.little_endian),this}write_i8_at(t,e){return this.ensure_size(1,t),this.dv.setInt8(t,e),this}write_i16_at(t,e){return this.ensure_size(2,t),this.dv.setInt16(t,e,this.little_endian),this}write_i32_at(t,e){return this.ensure_size(4,t),this.dv.setInt32(t,e,this.little_endian),this}write_f32_at(t,e){return this.ensure_size(4,t),this.dv.setFloat32(t,e,this.little_endian),this}write_u8_array_at(t,e){return this.ensure_size(e.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(e)),this}write_u16_array_at(t,e){this.ensure_size(2*e.length,t);const i=e.length;for(let n=0;ni)throw new Error(`${t} Bytes required but only ${i} available.`)}}},NRxM:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i("9dYx");class s extends n.a{constructor(t,e,i=0,n=t.byteLength-i){super(e,i),this._size=n,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const e=this.offset+this.position,i=new s(this.backing_buffer,this.endianness,e,t);return this._position+=t,i}}},"Sa3/":function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{_(n.next(t))}catch(t){r(t)}}function a(t){try{_(n.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}_((n=n.apply(t,e||[])).next())}))};function s(t){return n(this,void 0,void 0,(function*(){return new Promise((e,i)=>{const n=new FileReader;n.addEventListener("loadend",()=>{n.result instanceof ArrayBuffer?e(n.result):i(new Error("Couldn't read file."))}),n.readAsArrayBuffer(t)})}))}},VwSi:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a}));var n=i("kwt4");const s=1296321870;var r,o;function a(t,e){return t.u32()===s?function(t,e){const i=t.u32();return _(t.take(i),e)}(t,e):(t.seek_start(0),function(t,e){t.seek_end(16);const i=t.u32();t.seek_start(i);const n=t.u32();return t.seek_start(n),function(t,e){t.seek(4);const i=t.u32();return t.seek_start(i),_(t,e)}(t,e)}(t,e))}function _(t,e){let i=t.u32();const n=t.u32(),s=t.u16(),r=t.u16(),a=(192&r)>>6,_=15&r,c=[];for(let r=0;r=i)return t.seek_start(r),c(t,e);o=n}return s}function c(t,e){const i=[];for(let s=0;s>>14,super_sample:0!=(64&e),texture_id:8191&e})}else 17<=a&&a<=31?(l=2+2*t.u16(),n.push({type:o.Material,type_id:a})):32<=a&&a<=50?(l=2+4*t.u16(),n.push({type:o.Vertex,type_id:a,vertices:u(t,a,c)})):56<=a&&a<=58?(l=2+2*t.u16(),n.push({type:o.Volume,type_id:a})):64<=a&&a<=75?(l=2+2*t.u16(),n.push({type:o.Strip,type_id:a,triangle_strips:h(t,a,c)})):255===a?(l=i?2:0,n.push({type:o.End,type_id:a}),s=!1):(l=2+2*t.u16(),n.push({type:o.Unknown,type_id:a}),r.warn(`Unknown chunk type ${a} at offset ${f}.`));t.seek_start(f+l)}return n}function u(t,e,i){if(e<32||e>50)return r.warn(`Unknown vertex chunk type ${e}.`),[];const n=3&i,s=0!=(128&i),o=t.u16(),a=t.u16(),_=[];for(let i=0;i=42&&(44===e?(r.index=o+t.u16(),r.bone_weight=t.u16()/255):t.seek(4));else if(48<=e&&e<=50){const i=t.u32();r.normal={x:(i>>20&1023)/1023,y:(i>>10&1023)/1023,z:(1023&i)/1023},e>=49&&t.seek(4)}_.push(r)}return _}function h(t,e,i){const n={ignore_light:0!=(1&i),ignore_specular:0!=(2&i),ignore_ambient:0!=(4&i),use_alpha:0!=(8&i),double_side:0!=(16&i),flat_shading:0!=(32&i),environment_mapping:0!=(64&i)},s=t.u16(),r=s>>>14,o=16383&s;let a=!1,_=!1,u=!1,h=!1;switch(e){case 64:break;case 65:case 66:a=!0;break;case 67:u=!0;break;case 68:case 69:a=!0,u=!0;break;case 70:_=!0;break;case 71:case 72:a=!0,_=!0;break;case 73:break;case 74:case 75:h=!0;break;default:throw new Error(`Unexpected chunk type ID: ${e}.`)}const c=[];for(let e=0;e=2&&t.seek(2*r)}c.push(Object.assign(Object.assign({},n),{clockwise_winding:i,has_tex_coords:a,has_normal:u,vertices:o}))}return c}!function(t){t[t.Unknown=0]="Unknown",t[t.Null=1]="Null",t[t.Bits=2]="Bits",t[t.CachePolygonList=3]="CachePolygonList",t[t.DrawPolygonList=4]="DrawPolygonList",t[t.Tiny=5]="Tiny",t[t.Material=6]="Material",t[t.Vertex=7]="Vertex",t[t.Volume=8]="Volume",t[t.Strip=9]="Strip",t[t.End=10]="End"}(o||(o={}));const c=s.c.get("core/data_formats/parsing/ninja/xj");function f(t){t.seek(4);const e=t.u32(),i=t.u32(),n=t.u32(),s=t.u32(),r=t.u32(),o=t.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:t.vec3_f32(),collision_sphere_radius:t.f32()};return i>=1&&(i>1&&c.warn(`Vertex info count of ${i} was larger than expected.`),a.vertices.push(...function(t,e){t.seek_start(e);const i=t.u16();t.seek(2);const n=t.u32(),s=t.u32(),r=t.u32(),o=[];for(let e=0;et.type===w),r=[];for(const t of s)r.push(...x(t.data,e,i));return r}function x(t,e,i){const n=t.u32(),s=0!=(1&n),r=0!=(2&n),o=0!=(4&n),a=0!=(8&n),_=0!=(16&n),u=0!=(32&n),h=0!=(64&n),c=0!=(128&n),f=t.u32(),l=t.vec3_f32(),d={x:t.i32()*p,y:t.i32()*p,z:t.i32()*p},w=t.vec3_f32(),m=t.u32(),y=t.u32();let k,b,g;return f&&(t.seek_start(f),k=e(t,i)),m?(t.seek_start(m),b=x(t,e,i)):b=[],y?(t.seek_start(y),g=x(t,e,i)):g=[],[new v({no_translate:s,no_rotate:r,no_scale:o,hidden:a,break_child_trace:_,zxy_rotation_order:u,skip:h,shape_skip:c},k,l,d,w,b),...g]}},tyuj:function(t,e,i){"use strict";i.r(e);var n=i("NRxM"),s=i("bcBH"),r=i("VwSi"),o=i("kwt4");class a{constructor(t,e,i,n){this.name=t,this.head_style_count=e,this.hair_styles_count=i,this.hair_styles_with_accessory=n}}class _{constructor(t,e){this.id=t,this.name=e}}var u=i("Sa3/"),h=i("ouMO"),c=i("7CyS"),f=i("yub1"),l=i("kcKQ"),d=i("rwco");i.d(e,"Model3DStore",(function(){return m}));var p=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{_(n.next(t))}catch(t){r(t)}}function a(t){try{_(n.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}_((n=n.apply(t,e||[])).next())}))};const w=d.c.get("viewer/stores/ModelStore");class m extends l.a{constructor(t){super(),this.asset_loader=t,this._current_model=Object(h.e)(void 0),this._current_nj_data=Object(h.e)(void 0),this._current_xvm=Object(h.e)(void 0),this._show_skeleton=Object(h.e)(!1),this._current_animation=Object(h.e)(void 0),this._current_nj_motion=Object(h.e)(void 0),this._animation_playing=Object(h.e)(!0),this._animation_frame_rate=Object(h.e)(c.a),this._animation_frame=Object(h.e)(0),this.models=[new a("HUmar",1,10,new Set([6])),new a("HUnewearl",1,10,new Set),new a("HUcast",5,0,new Set),new a("HUcaseal",5,0,new Set),new a("RAmar",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("RAmarl",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("RAcast",5,0,new Set),new a("RAcaseal",5,0,new Set),new a("FOmar",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("FOmarl",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("FOnewm",1,10,new Set([0,1,2,3,4,5,6,7,8,9])),new a("FOnewearl",1,10,new Set([0,1,2,3,4,5,6,7,8,9]))],this.animations=new Array(572).fill(void 0).map((t,e)=>new _(e,`Animation ${e+1}`)),this.current_model=this._current_model,this.current_nj_data=this._current_nj_data,this.current_xvm=this._current_xvm,this.show_skeleton=this._show_skeleton,this.current_animation=this._current_animation,this.current_nj_motion=this._current_nj_motion,this.animation_playing=this._animation_playing,this.animation_frame_rate=this._animation_frame_rate,this.animation_frame=this._animation_frame,this.animation_frame_count=this.current_nj_motion.map(t=>t?t.frame_count:0),this.set_current_model=t=>{this._current_model.val=t},this.clear_current_model=()=>{this._current_model.val=void 0},this.set_show_skeleton=t=>{this._show_skeleton.val=t},this.set_current_animation=t=>{this._current_animation.val=t},this.clear_current_animation=()=>{this._current_animation.val=void 0},this.set_animation_playing=t=>{this._animation_playing.val=t},this.set_animation_frame_rate=t=>{this._animation_frame_rate.val=t},this.set_animation_frame=t=>{this._animation_frame.val=t},this.load_file=t=>p(this,void 0,void 0,(function*(){try{const e=yield Object(u.a)(t),i=new n.a(e,s.a.Little);if(t.name.endsWith(".nj")){this.clear_current_model();const t=Object(o.c)(i)[0];this.set_current_nj_data({nj_object:t,bone_count:t.bone_count(),has_skeleton:!0})}else if(t.name.endsWith(".xj")){this.clear_current_model();const t=Object(o.d)(i)[0];this.set_current_nj_data({nj_object:t,bone_count:0,has_skeleton:!1})}else if(t.name.endsWith(".njm")){this.clear_current_animation(),this._current_nj_motion.val=void 0;const t=this.current_nj_data.val;t&&(this.set_animation_playing(!0),this._current_nj_motion.val=Object(r.c)(i,t.bone_count))}else t.name.endsWith(".xvm")?this.current_model&&(this._current_xvm.val=Object(f.a)(i)):w.error(`Unknown file extension in filename "${t.name}".`)}catch(t){w.error("Couldn't read file.",t)}})),this.load_model=t=>p(this,void 0,void 0,(function*(){if(this.clear_current_animation(),t)try{const e=yield this.asset_loader.load_geometry(t);this.set_current_nj_data({nj_object:e,bone_count:t?64:e.bone_count(),has_skeleton:!0})}catch(e){w.error(`Couldn't load model for ${t.name}.`),this._current_nj_data.val=void 0}else this._current_nj_data.val=void 0})),this.load_animation=t=>p(this,void 0,void 0,(function*(){const e=this.current_nj_data.val;if(e&&t)try{this._current_nj_motion.val=yield this.asset_loader.load_animation(t.id,e.bone_count),this.set_animation_playing(!0)}catch(e){w.error(`Couldn't load animation "${t.name}".`),this._current_nj_motion.val=void 0}else this._current_nj_motion.val=void 0})),this.disposables(this.current_model.observe(({value:t})=>this.load_model(t)),this.current_animation.observe(({value:t})=>this.load_animation(t)))}set_current_nj_data(t){this._current_xvm.val=void 0,this._current_nj_data.val=t}}},yub1:function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n=i("9Ykw");const s=i("rwco").c.get("core/data_formats/parsing/ninja/texture"),r=1213027928,o=1414682200;function a(t){const e=Object(n.a)(t),i=e.find(t=>t.type===r),a=i&&function(t){return{texture_count:t.u16()}}(i.data),_=e.filter(t=>t.type===o).map(t=>(function(t){const e=t.u32(),i=t.u32(),n=t.u32(),s=t.u16(),r=t.u16(),o=t.u32();return t.seek(36),{id:n,format:[e,i],width:s,height:r,size:o,data:t.array_buffer(o)}})(t.data));return a&&a.texture_count!==_.length&&s.warn(`Found ${_.length} textures instead of ${a.texture_count} as defined in the header.`),{textures:_}}}}]); \ No newline at end of file diff --git a/6.6b6a991f832defca3ce3.js b/6.6b6a991f832defca3ce3.js new file mode 100644 index 00000000..c3856ef6 --- /dev/null +++ b/6.6b6a991f832defca3ce3.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{"4/Uj":function(t,i,e){"use strict";e.r(i);var s=e("ouMO"),r=e("yub1"),n=e("Sa3/"),o=e("NRxM"),h=e("bcBH"),u=e("kcKQ"),a=e("rwco"),_=e("wtpc"),f=e("iR5r");const c=a.c.get("core/data_formats/parsing/afs"),d=5457473;e.d(i,"TextureStore",(function(){return w}));var l=function(t,i,e,s){return new(e||(e=Promise))((function(r,n){function o(t){try{u(s.next(t))}catch(t){n(t)}}function h(t){try{u(s.throw(t))}catch(t){n(t)}}function u(t){var i;t.done?r(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,h)}u((s=s.apply(t,i||[])).next())}))};const p=a.c.get("viewer/stores/TextureStore");class w extends u.a{constructor(){super(...arguments),this._textures=Object(s.c)(),this.textures=this._textures,this.load_file=t=>l(this,void 0,void 0,(function*(){try{const i=Object(_.f)(t.name).toLowerCase(),e=yield Object(n.a)(t);if("xvm"===i){const t=Object(r.a)(new o.a(e,h.a.Little));this._textures.splice(0,1/0,...t.textures.map(t=>{let i=void 0;try{i=Object(f.b)(t)}catch(t){p.error("Couldn't convert XVR texture.",t)}return{texture:i,width:t.width,height:t.height}}))}else if("afs"===i){const t=function(t){if(t.u32()!==d)return c.error("Not an AFS archive."),[];const i=t.u16();t.seek(2);const e=[];for(let s=0;st.bytes_left)break;i.push({type:e,data:t.take(s)})}return i}e.d(i,"a",(function(){return s}))},"9dYx":function(t,i,e){"use strict";var s=e("bcBH");class r{constructor(t,i){this._position=0,this.endianness=t,this.offset=i}get position(){return this._position}get endianness(){return this.little_endian?s.a.Little:s.a.Big}set endianness(t){this.little_endian=t===s.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const i=[];for(let e=0;ethis.size-this.position)throw new Error(`${t} ${i} is out of bounds.`)}check_offset(t,i){if(t<0||t+i>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}e.d(i,"a",(function(){return n}));class n extends r{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_i32_array(t){return this.write_i32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const i=t.size-t.position;return this.ensure_size(i),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,i),i),this._position+=i,this}write_string_ascii(t,i){return this.write_string_ascii_at(this.position,t,i),this._position+=i,this}write_string_utf16(t,i){return this.write_string_utf16_at(this.position,t,i),this._position+=i,this}write_u8_at(t,i){return this.ensure_size(1,t),this.dv.setUint8(t,i),this}write_u16_at(t,i){return this.ensure_size(2,t),this.dv.setUint16(t,i,this.little_endian),this}write_u32_at(t,i){return this.ensure_size(4,t),this.dv.setUint32(t,i,this.little_endian),this}write_i8_at(t,i){return this.ensure_size(1,t),this.dv.setInt8(t,i),this}write_i16_at(t,i){return this.ensure_size(2,t),this.dv.setInt16(t,i,this.little_endian),this}write_i32_at(t,i){return this.ensure_size(4,t),this.dv.setInt32(t,i,this.little_endian),this}write_f32_at(t,i){return this.ensure_size(4,t),this.dv.setFloat32(t,i,this.little_endian),this}write_u8_array_at(t,i){return this.ensure_size(i.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(i)),this}write_u16_array_at(t,i){this.ensure_size(2*i.length,t);const e=i.length;for(let s=0;se)throw new Error(`${t} Bytes required but only ${e} available.`)}}},NRxM:function(t,i,e){"use strict";e.d(i,"a",(function(){return r}));var s=e("9dYx");class r extends s.a{constructor(t,i,e=0,s=t.byteLength-e){super(i,e),this._size=s,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const i=this.offset+this.position,e=new r(this.backing_buffer,this.endianness,i,t);return this._position+=t,e}}},"Sa3/":function(t,i,e){"use strict";e.d(i,"a",(function(){return r}));var s=function(t,i,e,s){return new(e||(e=Promise))((function(r,n){function o(t){try{u(s.next(t))}catch(t){n(t)}}function h(t){try{u(s.throw(t))}catch(t){n(t)}}function u(t){var i;t.done?r(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,h)}u((s=s.apply(t,i||[])).next())}))};function r(t){return s(this,void 0,void 0,(function*(){return new Promise((i,e)=>{const s=new FileReader;s.addEventListener("loadend",()=>{s.result instanceof ArrayBuffer?i(s.result):e(new Error("Couldn't read file."))}),s.readAsArrayBuffer(t)})}))}},bcBH:function(t,i,e){"use strict";var s;e.d(i,"a",(function(){return s})),function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(s||(s={}))},iR5r:function(t,i,e){"use strict";e.d(i,"a",(function(){return r})),e.d(i,"b",(function(){return n}));var s=e("Womt");function r(t){return t.textures.map(n)}function n(t){let i,e;switch(t.format[1]){case 6:i=s.RGBA_S3TC_DXT1_Format,e=t.width*t.height/2;break;case 7:i=s.RGBA_S3TC_DXT3_Format,e=t.width*t.height;break;default:throw new Error(`Format ${t.format.join(", ")} not supported.`)}const r=new s.CompressedTexture([{data:new Uint8Array(t.data,0,e),width:t.width,height:t.height}],t.width,t.height,i);return r.minFilter=s.LinearFilter,r.wrapS=s.MirroredRepeatWrapping,r.wrapT=s.MirroredRepeatWrapping,r.needsUpdate=!0,r}},yub1:function(t,i,e){"use strict";e.d(i,"a",(function(){return h}));var s=e("9Ykw");const r=e("rwco").c.get("core/data_formats/parsing/ninja/texture"),n=1213027928,o=1414682200;function h(t){const i=Object(s.a)(t),e=i.find(t=>t.type===n),h=e&&function(t){return{texture_count:t.u16()}}(e.data),u=i.filter(t=>t.type===o).map(t=>(function(t){const i=t.u32(),e=t.u32(),s=t.u32(),r=t.u16(),n=t.u16(),o=t.u32();return t.seek(36),{id:s,format:[i,e],width:r,height:n,size:o,data:t.array_buffer(o)}})(t.data));return h&&h.texture_count!==u.length&&r.warn(`Found ${u.length} textures instead of ${h.texture_count} as defined in the header.`),{textures:u}}}}]); \ No newline at end of file diff --git a/6.738b142371f43141510b.js b/6.738b142371f43141510b.js deleted file mode 100644 index 7027dd0f..00000000 --- a/6.738b142371f43141510b.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{"4/Uj":function(t,i,e){"use strict";e.r(i);var s=e("ouMO"),n=e("yub1"),r=e("Sa3/"),o=e("NRxM"),h=e("bcBH"),u=e("kcKQ"),a=e("rwco"),_=e("wtpc"),f=e("iR5r");const c=a.c.get("core/data_formats/parsing/afs"),d=5457473;e.d(i,"TextureStore",(function(){return w}));var l=function(t,i,e,s){return new(e||(e=Promise))((function(n,r){function o(t){try{u(s.next(t))}catch(t){r(t)}}function h(t){try{u(s.throw(t))}catch(t){r(t)}}function u(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,h)}u((s=s.apply(t,i||[])).next())}))};const p=a.c.get("viewer/stores/TextureStore");class w extends u.a{constructor(){super(...arguments),this._textures=Object(s.c)(),this.textures=this._textures,this.load_file=t=>l(this,void 0,void 0,(function*(){try{const i=Object(_.f)(t.name).toLowerCase(),e=yield Object(r.a)(t);if("xvm"===i){const t=Object(n.a)(new o.a(e,h.a.Little));this._textures.splice(0,1/0,...t.textures.map(t=>{let i=void 0;try{i=Object(f.b)(t)}catch(t){p.error("Couldn't convert XVR texture.",t)}return{texture:i,width:t.width,height:t.height}}))}else if("afs"===i){const t=function(t){if(t.u32()!==d)return c.error("Not an AFS archive."),[];const i=t.u16();t.seek(2);const e=[];for(let s=0;st.bytes_left)break;i.push({type:e,data:t.take(s)})}return i}e.d(i,"a",(function(){return s}))},"9dYx":function(t,i,e){"use strict";var s=e("bcBH");class n{constructor(t,i){this._position=0,this.endianness=t,this.offset=i}get position(){return this._position}get endianness(){return this.little_endian?s.a.Little:s.a.Big}set endianness(t){this.little_endian=t===s.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const i=[];for(let e=0;ethis.size-this.position)throw new Error(`${t} ${i} is out of bounds.`)}check_offset(t,i){if(t<0||t+i>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}e.d(i,"a",(function(){return r}));class r extends n{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const i=t.size-t.position;return this.ensure_size(i),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,i),i),this._position+=i,this}write_string_ascii(t,i){return this.write_string_ascii_at(this.position,t,i),this._position+=i,this}write_string_utf16(t,i){return this.write_string_utf16_at(this.position,t,i),this._position+=i,this}write_u8_at(t,i){return this.ensure_size(1,t),this.dv.setUint8(t,i),this}write_u16_at(t,i){return this.ensure_size(2,t),this.dv.setUint16(t,i,this.little_endian),this}write_u32_at(t,i){return this.ensure_size(4,t),this.dv.setUint32(t,i,this.little_endian),this}write_i8_at(t,i){return this.ensure_size(1,t),this.dv.setInt8(t,i),this}write_i16_at(t,i){return this.ensure_size(2,t),this.dv.setInt16(t,i,this.little_endian),this}write_i32_at(t,i){return this.ensure_size(4,t),this.dv.setInt32(t,i,this.little_endian),this}write_f32_at(t,i){return this.ensure_size(4,t),this.dv.setFloat32(t,i,this.little_endian),this}write_u8_array_at(t,i){return this.ensure_size(i.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(i)),this}write_u16_array_at(t,i){this.ensure_size(2*i.length,t);const e=i.length;for(let s=0;se)throw new Error(`${t} Bytes required but only ${e} available.`)}}},NRxM:function(t,i,e){"use strict";e.d(i,"a",(function(){return n}));var s=e("9dYx");class n extends s.a{constructor(t,i,e=0,s=t.byteLength-e){super(i,e),this._size=s,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const i=this.offset+this.position,e=new n(this.backing_buffer,this.endianness,i,t);return this._position+=t,e}}},"Sa3/":function(t,i,e){"use strict";e.d(i,"a",(function(){return n}));var s=function(t,i,e,s){return new(e||(e=Promise))((function(n,r){function o(t){try{u(s.next(t))}catch(t){r(t)}}function h(t){try{u(s.throw(t))}catch(t){r(t)}}function u(t){var i;t.done?n(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(o,h)}u((s=s.apply(t,i||[])).next())}))};function n(t){return s(this,void 0,void 0,(function*(){return new Promise((i,e)=>{const s=new FileReader;s.addEventListener("loadend",()=>{s.result instanceof ArrayBuffer?i(s.result):e(new Error("Couldn't read file."))}),s.readAsArrayBuffer(t)})}))}},bcBH:function(t,i,e){"use strict";var s;e.d(i,"a",(function(){return s})),function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(s||(s={}))},iR5r:function(t,i,e){"use strict";e.d(i,"a",(function(){return n})),e.d(i,"b",(function(){return r}));var s=e("Womt");function n(t){return t.textures.map(r)}function r(t){let i,e;switch(t.format[1]){case 6:i=s.RGBA_S3TC_DXT1_Format,e=t.width*t.height/2;break;case 7:i=s.RGBA_S3TC_DXT3_Format,e=t.width*t.height;break;default:throw new Error(`Format ${t.format.join(", ")} not supported.`)}const n=new s.CompressedTexture([{data:new Uint8Array(t.data,0,e),width:t.width,height:t.height}],t.width,t.height,i);return n.minFilter=s.LinearFilter,n.wrapS=s.MirroredRepeatWrapping,n.wrapT=s.MirroredRepeatWrapping,n.needsUpdate=!0,n}},yub1:function(t,i,e){"use strict";e.d(i,"a",(function(){return h}));var s=e("9Ykw");const n=e("rwco").c.get("core/data_formats/parsing/ninja/texture"),r=1213027928,o=1414682200;function h(t){const i=Object(s.a)(t),e=i.find(t=>t.type===r),h=e&&function(t){return{texture_count:t.u16()}}(e.data),u=i.filter(t=>t.type===o).map(t=>(function(t){const i=t.u32(),e=t.u32(),s=t.u32(),n=t.u16(),r=t.u16(),o=t.u32();return t.seek(36),{id:s,format:[i,e],width:n,height:r,size:o,data:t.array_buffer(o)}})(t.data));return h&&h.texture_count!==u.length&&n.warn(`Found ${u.length} textures instead of ${h.texture_count} as defined in the header.`),{textures:u}}}}]); \ No newline at end of file diff --git a/7.6a53f5186d902ff2e986.js b/7.6a53f5186d902ff2e986.js deleted file mode 100644 index 75d4fc8a..00000000 --- a/7.6a53f5186d902ff2e986.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{"4aaK":function(e,t,i){"use strict";i.r(t);var o=i("nN8q"),s=i("xGNL"),n=i.n(s),r=i("xs7i"),a=i("PE7g"),d=i("Tpfs"),c=i("0Xme");class l extends c.a{constructor(e="",t){if(super(e,"core_TextInput","text","core_TextInput_inner",t),this.preferred_label_position="left",t){const{max_length:e}=t;this.set_attr("maxLength",e)}this.set_value(e),this.finalize_construction()}get_value(){return this.input_element.value}set_value(e){this.input_element.value=e}}var _=i("sDu+"),u=(i("C5oP"),i("4VsB")),v=i("FXpb");class h extends _.a{constructor(e="",t){super(t),this.element=Object(v.i)({className:"core_TextArea"}),this.preferred_label_position="left",this.text_element=Object(v.v)({className:"core_TextArea_inner"}),this._value=new u.a(this,"",this.set_value),t&&(null!=t.max_length&&(this.text_element.maxLength=t.max_length),null!=t.font_family&&(this.text_element.style.fontFamily=t.font_family),null!=t.rows&&(this.text_element.rows=t.rows),null!=t.cols&&(this.text_element.cols=t.cols)),this.value=this._value,this.set_value(e),this.text_element.onchange=()=>this._value.set_val(this.text_element.value,{silent:!1}),this.element.append(this.text_element),this.finalize_construction()}set_value(e){this.text_element.value=e}}i("ObFr");var p=i("TRid"),g=i("7ZX1");i("7YJZ");class b extends p.a{constructor(e){super(),this.element=Object(v.i)({className:"quest_editor_UnavailableView"}),this.label=this.disposable(new g.a(e,{enabled:!1})),this.element.append(this.label.element),this.finalize_construction()}}class f extends o.a{constructor(e){super(),this.element=Object(v.i)({className:"quest_editor_QuestInfoView",tabIndex:-1}),this.table_element=Object(v.s)(),this.id_input=this.disposable(new a.a(0,{min:0,step:1})),this.name_input=this.disposable(new l("",{max_length:32})),this.short_description_input=this.disposable(new h("",{max_length:128,font_family:'"Courier New", monospace',cols:25,rows:5})),this.long_description_input=this.disposable(new h("",{max_length:288,font_family:'"Courier New", monospace',cols:25,rows:10})),this.unavailable_view=new b("No quest loaded."),this.quest_disposer=this.disposable(new d.a);const t=e.current_quest;this.table_element.append(Object(v.z)(Object(v.x)("Episode:"),this.episode_element=Object(v.u)()),Object(v.z)(Object(v.x)("ID:"),Object(v.u)(this.id_input.element)),Object(v.z)(Object(v.x)("Name:"),Object(v.u)(this.name_input.element)),Object(v.z)(Object(v.x)({colSpan:2},"Short description:")),Object(v.z)(Object(v.u)({colSpan:2},this.short_description_input.element)),Object(v.z)(Object(v.x)({colSpan:2},"Long description:")),Object(v.z)(Object(v.u)({colSpan:2},this.long_description_input.element))),this.bind_hidden(this.table_element,e.unavailable),this.element.append(this.table_element,this.unavailable_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(this.unavailable_view.visible.bind_to(e.unavailable),t.observe(({value:t})=>{this.quest_disposer.dispose_all(),this.episode_element.textContent=t?r.b[t.episode]:"",t&&this.quest_disposer.add_all(this.id_input.value.bind_to(t.id),this.id_input.value.observe(({value:t})=>e.set_id(t)),this.name_input.value.bind_to(t.name),this.name_input.value.observe(({value:t})=>e.set_name(t)),this.short_description_input.value.bind_to(t.short_description),this.short_description_input.value.observe(({value:t})=>e.set_short_description(t)),this.long_description_input.value.bind_to(t.long_description),this.long_description_input.value.observe(({value:t})=>e.set_long_description(t)),this.enabled.bind_to(e.enabled))})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.id_input.enabled.val=e,this.name_input.enabled.val=e,this.short_description_input.enabled.val=e,this.long_description_input.enabled.val=e}}i("88+i"),i("UrNz"),i("5sDa");class m extends o.a{constructor(e){super(),this.element=Object(v.i)({className:"quest_editor_NpcCountsView"}),this.table_element=Object(v.s)(),this.unavailable_view=new b("No quest loaded."),this.element.append(this.table_element,this.unavailable_view.element),this.disposables(Object(v.c)(this.table_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),e.npc_counts.observe(({value:e})=>this.update_view(e),{call_now:!0})),this.finalize_construction()}update_view(e){const t=document.createDocumentFragment();for(const{name:i,count:o}of e)t.append(Object(v.z)(Object(v.x)(i+":"),Object(v.u)(String(o))));this.table_element.innerHTML="",this.table_element.append(t)}}var w,k=i("Ftn7"),y=i("Womt"),R=i("Eqai"),I=i("sZ1+");!function(e){e[e.Unknown=1e3]="Unknown",e[e.PlayerSet=1001]="PlayerSet",e[e.Particle=1002]="Particle",e[e.Teleporter=1003]="Teleporter",e[e.Warp=1004]="Warp",e[e.LightCollision=1005]="LightCollision",e[e.Item=1006]="Item",e[e.EnvSound=1007]="EnvSound",e[e.FogCollision=1008]="FogCollision",e[e.EventCollision=1009]="EventCollision",e[e.CharaCollision=1010]="CharaCollision",e[e.ElementalTrap=1011]="ElementalTrap",e[e.StatusTrap=1012]="StatusTrap",e[e.HealTrap=1013]="HealTrap",e[e.LargeElementalTrap=1014]="LargeElementalTrap",e[e.ObjRoomID=1015]="ObjRoomID",e[e.Sensor=1016]="Sensor",e[e.UnknownItem16=1017]="UnknownItem16",e[e.LensFlare=1018]="LensFlare",e[e.ScriptCollision=1019]="ScriptCollision",e[e.HealRing=1020]="HealRing",e[e.MapCollision=1021]="MapCollision",e[e.ScriptCollisionA=1022]="ScriptCollisionA",e[e.ItemLight=1023]="ItemLight",e[e.RadarCollision=1024]="RadarCollision",e[e.FogCollisionSW=1025]="FogCollisionSW",e[e.BossTeleporter=1026]="BossTeleporter",e[e.ImageBoard=1027]="ImageBoard",e[e.QuestWarp=1028]="QuestWarp",e[e.Epilogue=1029]="Epilogue",e[e.UnknownItem29=1030]="UnknownItem29",e[e.UnknownItem30=1031]="UnknownItem30",e[e.UnknownItem31=1032]="UnknownItem31",e[e.BoxDetectObject=1033]="BoxDetectObject",e[e.SymbolChatObject=1034]="SymbolChatObject",e[e.TouchPlateObject=1035]="TouchPlateObject",e[e.TargetableObject=1036]="TargetableObject",e[e.EffectObject=1037]="EffectObject",e[e.CountDownObject=1038]="CountDownObject",e[e.UnknownItem38=1039]="UnknownItem38",e[e.UnknownItem39=1040]="UnknownItem39",e[e.UnknownItem40=1041]="UnknownItem40",e[e.UnknownItem41=1042]="UnknownItem41",e[e.MenuActivation=1043]="MenuActivation",e[e.TelepipeLocation=1044]="TelepipeLocation",e[e.BGMCollision=1045]="BGMCollision",e[e.MainRagolTeleporter=1046]="MainRagolTeleporter",e[e.LobbyTeleporter=1047]="LobbyTeleporter",e[e.PrincipalWarp=1048]="PrincipalWarp",e[e.ShopDoor=1049]="ShopDoor",e[e.HuntersGuildDoor=1050]="HuntersGuildDoor",e[e.TeleporterDoor=1051]="TeleporterDoor",e[e.MedicalCenterDoor=1052]="MedicalCenterDoor",e[e.Elevator=1053]="Elevator",e[e.EasterEgg=1054]="EasterEgg",e[e.ValentinesHeart=1055]="ValentinesHeart",e[e.ChristmasTree=1056]="ChristmasTree",e[e.ChristmasWreath=1057]="ChristmasWreath",e[e.HalloweenPumpkin=1058]="HalloweenPumpkin",e[e.TwentyFirstCentury=1059]="TwentyFirstCentury",e[e.Sonic=1060]="Sonic",e[e.WelcomeBoard=1061]="WelcomeBoard",e[e.Firework=1062]="Firework",e[e.LobbyScreenDoor=1063]="LobbyScreenDoor",e[e.MainRagolTeleporterBattleInNextArea=1064]="MainRagolTeleporterBattleInNextArea",e[e.LabTeleporterDoor=1065]="LabTeleporterDoor",e[e.Pioneer2InvisibleTouchplate=1066]="Pioneer2InvisibleTouchplate",e[e.ForestDoor=1067]="ForestDoor",e[e.ForestSwitch=1068]="ForestSwitch",e[e.LaserFence=1069]="LaserFence",e[e.LaserSquareFence=1070]="LaserSquareFence",e[e.ForestLaserFenceSwitch=1071]="ForestLaserFenceSwitch",e[e.LightRays=1072]="LightRays",e[e.BlueButterfly=1073]="BlueButterfly",e[e.Probe=1074]="Probe",e[e.RandomTypeBox1=1075]="RandomTypeBox1",e[e.ForestWeatherStation=1076]="ForestWeatherStation",e[e.Battery=1077]="Battery",e[e.ForestConsole=1078]="ForestConsole",e[e.BlackSlidingDoor=1079]="BlackSlidingDoor",e[e.RicoMessagePod=1080]="RicoMessagePod",e[e.EnergyBarrier=1081]="EnergyBarrier",e[e.ForestRisingBridge=1082]="ForestRisingBridge",e[e.SwitchNoneDoor=1083]="SwitchNoneDoor",e[e.EnemyBoxGrey=1084]="EnemyBoxGrey",e[e.FixedTypeBox=1085]="FixedTypeBox",e[e.EnemyBoxBrown=1086]="EnemyBoxBrown",e[e.EmptyTypeBox=1087]="EmptyTypeBox",e[e.LaserFenceEx=1088]="LaserFenceEx",e[e.LaserSquareFenceEx=1089]="LaserSquareFenceEx",e[e.FloorPanel1=1090]="FloorPanel1",e[e.Caves4ButtonDoor=1091]="Caves4ButtonDoor",e[e.CavesNormalDoor=1092]="CavesNormalDoor",e[e.CavesSmashingPillar=1093]="CavesSmashingPillar",e[e.CavesSign1=1094]="CavesSign1",e[e.CavesSign2=1095]="CavesSign2",e[e.CavesSign3=1096]="CavesSign3",e[e.HexagonalTank=1097]="HexagonalTank",e[e.BrownPlatform=1098]="BrownPlatform",e[e.WarningLightObject=1099]="WarningLightObject",e[e.Rainbow=1100]="Rainbow",e[e.FloatingJellyfish=1101]="FloatingJellyfish",e[e.FloatingDragonfly=1102]="FloatingDragonfly",e[e.CavesSwitchDoor=1103]="CavesSwitchDoor",e[e.RobotRechargeStation=1104]="RobotRechargeStation",e[e.CavesCakeShop=1105]="CavesCakeShop",e[e.Caves1SmallRedRock=1106]="Caves1SmallRedRock",e[e.Caves1MediumRedRock=1107]="Caves1MediumRedRock",e[e.Caves1LargeRedRock=1108]="Caves1LargeRedRock",e[e.Caves2SmallRock1=1109]="Caves2SmallRock1",e[e.Caves2MediumRock1=1110]="Caves2MediumRock1",e[e.Caves2LargeRock1=1111]="Caves2LargeRock1",e[e.Caves2SmallRock2=1112]="Caves2SmallRock2",e[e.Caves2MediumRock2=1113]="Caves2MediumRock2",e[e.Caves2LargeRock2=1114]="Caves2LargeRock2",e[e.Caves3SmallRock=1115]="Caves3SmallRock",e[e.Caves3MediumRock=1116]="Caves3MediumRock",e[e.Caves3LargeRock=1117]="Caves3LargeRock",e[e.FloorPanel2=1118]="FloorPanel2",e[e.DestructableRockCaves1=1119]="DestructableRockCaves1",e[e.DestructableRockCaves2=1120]="DestructableRockCaves2",e[e.DestructableRockCaves3=1121]="DestructableRockCaves3",e[e.MinesDoor=1122]="MinesDoor",e[e.FloorPanel3=1123]="FloorPanel3",e[e.MinesSwitchDoor=1124]="MinesSwitchDoor",e[e.LargeCryoTube=1125]="LargeCryoTube",e[e.ComputerLikeCalus=1126]="ComputerLikeCalus",e[e.GreenScreenOpeningAndClosing=1127]="GreenScreenOpeningAndClosing",e[e.FloatingRobot=1128]="FloatingRobot",e[e.FloatingBlueLight=1129]="FloatingBlueLight",e[e.SelfDestructingObject1=1130]="SelfDestructingObject1",e[e.SelfDestructingObject2=1131]="SelfDestructingObject2",e[e.SelfDestructingObject3=1132]="SelfDestructingObject3",e[e.SparkMachine=1133]="SparkMachine",e[e.MinesLargeFlashingCrate=1134]="MinesLargeFlashingCrate",e[e.RuinsSeal=1135]="RuinsSeal",e[e.RuinsTeleporter=1136]="RuinsTeleporter",e[e.RuinsWarpSiteToSite=1137]="RuinsWarpSiteToSite",e[e.RuinsSwitch=1138]="RuinsSwitch",e[e.FloorPanel4=1139]="FloorPanel4",e[e.Ruins1Door=1140]="Ruins1Door",e[e.Ruins3Door=1141]="Ruins3Door",e[e.Ruins2Door=1142]="Ruins2Door",e[e.Ruins11ButtonDoor=1143]="Ruins11ButtonDoor",e[e.Ruins21ButtonDoor=1144]="Ruins21ButtonDoor",e[e.Ruins31ButtonDoor=1145]="Ruins31ButtonDoor",e[e.Ruins4ButtonDoor=1146]="Ruins4ButtonDoor",e[e.Ruins2ButtonDoor=1147]="Ruins2ButtonDoor",e[e.RuinsSensor=1148]="RuinsSensor",e[e.RuinsFenceSwitch=1149]="RuinsFenceSwitch",e[e.RuinsLaserFence4x2=1150]="RuinsLaserFence4x2",e[e.RuinsLaserFence6x2=1151]="RuinsLaserFence6x2",e[e.RuinsLaserFence4x4=1152]="RuinsLaserFence4x4",e[e.RuinsLaserFence6x4=1153]="RuinsLaserFence6x4",e[e.RuinsPoisonBlob=1154]="RuinsPoisonBlob",e[e.RuinsPillarTrap=1155]="RuinsPillarTrap",e[e.PopupTrapNoTech=1156]="PopupTrapNoTech",e[e.RuinsCrystal=1157]="RuinsCrystal",e[e.Monument=1158]="Monument",e[e.RuinsRock1=1159]="RuinsRock1",e[e.RuinsRock2=1160]="RuinsRock2",e[e.RuinsRock3=1161]="RuinsRock3",e[e.RuinsRock4=1162]="RuinsRock4",e[e.RuinsRock5=1163]="RuinsRock5",e[e.RuinsRock6=1164]="RuinsRock6",e[e.RuinsRock7=1165]="RuinsRock7",e[e.Poison=1166]="Poison",e[e.FixedBoxTypeRuins=1167]="FixedBoxTypeRuins",e[e.RandomBoxTypeRuins=1168]="RandomBoxTypeRuins",e[e.EnemyTypeBoxYellow=1169]="EnemyTypeBoxYellow",e[e.EnemyTypeBoxBlue=1170]="EnemyTypeBoxBlue",e[e.EmptyTypeBoxBlue=1171]="EmptyTypeBoxBlue",e[e.DestructableRock=1172]="DestructableRock",e[e.PopupTrapsTechs=1173]="PopupTrapsTechs",e[e.FlyingWhiteBird=1174]="FlyingWhiteBird",e[e.Tower=1175]="Tower",e[e.FloatingRocks=1176]="FloatingRocks",e[e.FloatingSoul=1177]="FloatingSoul",e[e.Butterfly=1178]="Butterfly",e[e.LobbyGameMenu=1179]="LobbyGameMenu",e[e.LobbyWarpObject=1180]="LobbyWarpObject",e[e.Lobby1EventObjectDefaultTree=1181]="Lobby1EventObjectDefaultTree",e[e.UnknownItem387=1182]="UnknownItem387",e[e.UnknownItem388=1183]="UnknownItem388",e[e.UnknownItem389=1184]="UnknownItem389",e[e.LobbyEventObjectStaticPumpkin=1185]="LobbyEventObjectStaticPumpkin",e[e.LobbyEventObject3ChristmasWindows=1186]="LobbyEventObject3ChristmasWindows",e[e.LobbyEventObjectRedAndWhiteCurtain=1187]="LobbyEventObjectRedAndWhiteCurtain",e[e.UnknownItem393=1188]="UnknownItem393",e[e.UnknownItem394=1189]="UnknownItem394",e[e.LobbyFishTank=1190]="LobbyFishTank",e[e.LobbyEventObjectButterflies=1191]="LobbyEventObjectButterflies",e[e.UnknownItem400=1192]="UnknownItem400",e[e.GreyWallLow=1193]="GreyWallLow",e[e.SpaceshipDoor=1194]="SpaceshipDoor",e[e.GreyWallHigh=1195]="GreyWallHigh",e[e.TempleNormalDoor=1196]="TempleNormalDoor",e[e.BreakableWallWallButUnbreakable=1197]="BreakableWallWallButUnbreakable",e[e.BrokenCylinderAndRubble=1198]="BrokenCylinderAndRubble",e[e.ThreeBrokenWallPiecesOnFloor=1199]="ThreeBrokenWallPiecesOnFloor",e[e.HighBrickCylinder=1200]="HighBrickCylinder",e[e.LyingCylinder=1201]="LyingCylinder",e[e.BrickConeWithFlatTop=1202]="BrickConeWithFlatTop",e[e.BreakableTempleWall=1203]="BreakableTempleWall",e[e.TempleMapDetect=1204]="TempleMapDetect",e[e.SmallBrownBrickRisingBridge=1205]="SmallBrownBrickRisingBridge",e[e.LongRisingBridgeWithPinkHighEdges=1206]="LongRisingBridgeWithPinkHighEdges",e[e.FourSwitchTempleDoor=1207]="FourSwitchTempleDoor",e[e.FourButtonSpaceshipDoor=1208]="FourButtonSpaceshipDoor",e[e.ItemBoxCca=1209]="ItemBoxCca",e[e.TeleporterEp2=1210]="TeleporterEp2",e[e.CCADoor=1211]="CCADoor",e[e.SpecialBoxCCA=1212]="SpecialBoxCCA",e[e.BigCCADoor=1213]="BigCCADoor",e[e.BigCCADoorSwitch=1214]="BigCCADoorSwitch",e[e.LittleRock=1215]="LittleRock",e[e.Little3StoneWall=1216]="Little3StoneWall",e[e.Medium3StoneWall=1217]="Medium3StoneWall",e[e.SpiderPlant=1218]="SpiderPlant",e[e.CCAAreaTeleporter=1219]="CCAAreaTeleporter",e[e.UnknownItem523=1220]="UnknownItem523",e[e.WhiteBird=1221]="WhiteBird",e[e.OrangeBird=1222]="OrangeBird",e[e.Saw=1223]="Saw",e[e.LaserDetect=1224]="LaserDetect",e[e.UnknownItem529=1225]="UnknownItem529",e[e.UnknownItem530=1226]="UnknownItem530",e[e.Seagull=1227]="Seagull",e[e.Fish=1228]="Fish",e[e.SeabedDoorWithBlueEdges=1229]="SeabedDoorWithBlueEdges",e[e.SeabedDoorAlwaysOpenNonTriggerable=1230]="SeabedDoorAlwaysOpenNonTriggerable",e[e.LittleCryotube=1231]="LittleCryotube",e[e.WideGlassWallBreakable=1232]="WideGlassWallBreakable",e[e.BlueFloatingRobot=1233]="BlueFloatingRobot",e[e.RedFloatingRobot=1234]="RedFloatingRobot",e[e.Dolphin=1235]="Dolphin",e[e.CaptureTrap=1236]="CaptureTrap",e[e.VRLink=1237]="VRLink",e[e.UnknownItem576=1238]="UnknownItem576",e[e.WarpInBarbaRayRoom=1239]="WarpInBarbaRayRoom",e[e.UnknownItem672=1240]="UnknownItem672",e[e.GeeNest=1241]="GeeNest",e[e.LabComputerConsole=1242]="LabComputerConsole",e[e.LabComputerConsoleGreenScreen=1243]="LabComputerConsoleGreenScreen",e[e.ChairYellowPillow=1244]="ChairYellowPillow",e[e.OrangeWallWithHoleInMiddle=1245]="OrangeWallWithHoleInMiddle",e[e.GreyWallWithHoleInMiddle=1246]="GreyWallWithHoleInMiddle",e[e.LongTable=1247]="LongTable",e[e.GBAStation=1248]="GBAStation",e[e.TalkLinkToSupport=1249]="TalkLinkToSupport",e[e.InstaWarp=1250]="InstaWarp",e[e.LabInvisibleObject=1251]="LabInvisibleObject",e[e.LabGlassWindowDoor=1252]="LabGlassWindowDoor",e[e.UnknownItem700=1253]="UnknownItem700",e[e.LabCeilingWarp=1254]="LabCeilingWarp",e[e.Ep4LightSource=1255]="Ep4LightSource",e[e.Cacti=1256]="Cacti",e[e.BigBrownRock=1257]="BigBrownRock",e[e.BreakableBrownRock=1258]="BreakableBrownRock",e[e.UnknownItem832=1259]="UnknownItem832",e[e.UnknownItem833=1260]="UnknownItem833",e[e.PoisonPlant=1261]="PoisonPlant",e[e.UnknownItem897=1262]="UnknownItem897",e[e.UnknownItem898=1263]="UnknownItem898",e[e.OozingDesertPlant=1264]="OozingDesertPlant",e[e.UnknownItem901=1265]="UnknownItem901",e[e.BigBlackRocks=1266]="BigBlackRocks",e[e.UnknownItem903=1267]="UnknownItem903",e[e.UnknownItem904=1268]="UnknownItem904",e[e.UnknownItem905=1269]="UnknownItem905",e[e.UnknownItem906=1270]="UnknownItem906",e[e.FallingRock=1271]="FallingRock",e[e.DesertPlantHasCollision=1272]="DesertPlantHasCollision",e[e.DesertFixedTypeBoxBreakableCrystals=1273]="DesertFixedTypeBoxBreakableCrystals",e[e.UnknownItem910=1274]="UnknownItem910",e[e.BeeHive=1275]="BeeHive",e[e.UnknownItem912=1276]="UnknownItem912",e[e.Heat=1277]="Heat",e[e.TopOfSaintMillionEgg=1278]="TopOfSaintMillionEgg",e[e.UnknownItem961=1279]="UnknownItem961"}(w||(w={}));const j=[];function x(e){return T[e]}const T=[];function S(e,t,i,o){j.push(e);const s=[];for(const[e,t]of o)s[e]=t;T[e]=Object.freeze({name:i,area_ids:s,pso_id:t})}function C(e){var t;return null!=(t=I.c[e])?t:w[e]}function O(e){return null!=I.c[e]}function L(e){var t;return null!=(t=Object(I.d)(e))?t:x(e)}var P;S(w.Unknown,void 0,"Unknown",[]),S(w.PlayerSet,0,"Player Set",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Particle,1,"Particle",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Teleporter,2,"Teleporter",[[r.b.I,[0,1,2,3,4,5,6,7,11,12,13,14]],[r.b.II,[0,1,2,3,4,12,13,14,15]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Warp,3,"Warp",[[r.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LightCollision,4,"Light Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,15,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Item,5,"Item",[]),S(w.EnvSound,6,"Env Sound",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.FogCollision,7,"Fog Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.EventCollision,8,"Event Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.CharaCollision,9,"Chara Collision",[[r.b.I,[0,1,2,3,4,5,8,9,10]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ElementalTrap,10,"Elemental Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.StatusTrap,11,"Status Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.HealTrap,12,"Heal Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.LargeElementalTrap,13,"Large Elemental Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.ObjRoomID,14,"Obj Room ID",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Sensor,15,"Sensor",[[r.b.I,[1,2,4,5,6,7]]]),S(w.UnknownItem16,16,"Unknown Item (16)",[]),S(w.LensFlare,17,"Lens Flare",[[r.b.I,[1,2,3,4,8,14]]]),S(w.ScriptCollision,18,"Script Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.HealRing,19,"Heal Ring",[[r.b.I,[1,2,3,4,5,6,7,8,9,10]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MapCollision,20,"Map Collision",[[r.b.I,[0,1,2,3,4,5,8,9,10,16,17]],[r.b.II,[0,5,6,7,8,9,10,11,16,17]],[r.b.IV,[0]]]),S(w.ScriptCollisionA,21,"Script Collision A",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.ItemLight,22,"Item Light",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.RadarCollision,23,"Radar Collision",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FogCollisionSW,24,"Fog Collision SW",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BossTeleporter,25,"Boss Teleporter",[[r.b.I,[0,2,5,7,10]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[5,6,7,8,0]]]),S(w.ImageBoard,26,"Image Board",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.QuestWarp,27,"Quest Warp",[[r.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[r.b.IV,[9]]]),S(w.Epilogue,28,"Epilogue",[[r.b.I,[14]],[r.b.II,[13]],[r.b.IV,[9]]]),S(w.UnknownItem29,29,"Unknown Item (29)",[[r.b.I,[1]]]),S(w.UnknownItem30,30,"Unknown Item (30)",[[r.b.I,[1,2,17]],[r.b.II,[1,2,14]],[r.b.IV,[1,2,3,4,5]]]),S(w.UnknownItem31,31,"Unknown Item (31)",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BoxDetectObject,32,"Box Detect Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.SymbolChatObject,33,"Symbol Chat Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.TouchPlateObject,34,"Touch plate Object",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.TargetableObject,35,"Targetable Object",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EffectObject,36,"Effect object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[0]]]),S(w.CountDownObject,37,"Count Down Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem38,38,"Unknown Item (38)",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem39,39,"Unknown Item (39)",[[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem40,40,"Unknown Item (40)",[[r.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem41,41,"Unknown Item (41)",[[r.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.MenuActivation,64,"Menu activation",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.TelepipeLocation,65,"Telepipe Location",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.BGMCollision,66,"BGM Collision",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.MainRagolTeleporter,67,"Main Ragol Teleporter",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.LobbyTeleporter,68,"Lobby Teleporter",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.PrincipalWarp,69,"Principal warp",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ShopDoor,70,"Shop Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.HuntersGuildDoor,71,"Hunter's Guild Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.TeleporterDoor,72,"Teleporter Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.MedicalCenterDoor,73,"Medical Center Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.Elevator,74,"Elevator",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.EasterEgg,75,"Easter Egg",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ValentinesHeart,76,"Valentines Heart",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ChristmasTree,77,"Christmas Tree",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ChristmasWreath,78,"Christmas Wreath",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.HalloweenPumpkin,79,"Halloween Pumpkin",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.TwentyFirstCentury,80,"21st Century",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.Sonic,81,"Sonic",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.WelcomeBoard,82,"Welcome Board",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.Firework,83,"Firework",[[r.b.I,[0]],[r.b.II,[0,16]],[r.b.IV,[0]]]),S(w.LobbyScreenDoor,84,"Lobby Screen Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.MainRagolTeleporterBattleInNextArea,85,"Main Ragol Teleporter (Battle in next area?)",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.LabTeleporterDoor,86,"Lab Teleporter Door",[[r.b.II,[0]]]),S(w.Pioneer2InvisibleTouchplate,87,"Pioneer 2 Invisible Touchplate",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ForestDoor,128,"Forest Door",[[r.b.I,[1,2]]]),S(w.ForestSwitch,129,"Forest Switch",[[r.b.I,[1,2,3,4,5]],[r.b.II,[1,2,3,4]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFence,130,"Laser Fence",[[r.b.I,[1,2,3,4,5,6,7,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFence,131,"Laser Square Fence",[[r.b.I,[1,2,3,4,5,6,7,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestLaserFenceSwitch,132,"Forest Laser Fence Switch",[[r.b.I,[1,2,3,4,5,6,7,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LightRays,133,"Light rays",[[r.b.I,[1,2]],[r.b.II,[5,6,7,8,9]],[r.b.IV,[6,7,8]]]),S(w.BlueButterfly,134,"Blue Butterfly",[[r.b.I,[1,2]],[r.b.IV,[6,7,8]]]),S(w.Probe,135,"Probe",[[r.b.I,[1,2]]]),S(w.RandomTypeBox1,136,"Random Type Box 1",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.II,[10,11,13]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestWeatherStation,137,"Forest Weather Station",[[r.b.I,[1,2]]]),S(w.Battery,138,"Battery",[]),S(w.ForestConsole,139,"Forest Console",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BlackSlidingDoor,140,"Black Sliding Door",[[r.b.I,[1,2,3]]]),S(w.RicoMessagePod,141,"Rico Message Pod",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,13]]]),S(w.EnergyBarrier,142,"Energy Barrier",[[r.b.I,[1,2,4,5,6,7]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestRisingBridge,143,"Forest Rising Bridge",[[r.b.I,[1,2]]]),S(w.SwitchNoneDoor,144,"Switch (none door)",[[r.b.I,[1,2,6,7,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EnemyBoxGrey,145,"Enemy Box (Grey)",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.II,[10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedTypeBox,146,"Fixed Type Box",[[r.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[r.b.II,[10,11,13]],[r.b.IV,[1,2,3,4,6,7,8,9]]]),S(w.EnemyBoxBrown,147,"Enemy Box (Brown)",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.II,[10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EmptyTypeBox,149,"Empty Type Box",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFenceEx,150,"Laser Fence Ex",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFenceEx,151,"Laser Square Fence Ex",[]),S(w.FloorPanel1,192,"Floor Panel 1",[[r.b.I,[3,4,5,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves4ButtonDoor,193,"Caves 4 Button door",[[r.b.I,[3,4,5]]]),S(w.CavesNormalDoor,194,"Caves Normal door",[[r.b.I,[3,4,5]]]),S(w.CavesSmashingPillar,195,"Caves Smashing Pillar",[[r.b.I,[3,4,5]],[r.b.II,[1,2,3,4,17]]]),S(w.CavesSign1,196,"Caves Sign 1",[[r.b.I,[4,5]]]),S(w.CavesSign2,197,"Caves Sign 2",[[r.b.I,[4,5]]]),S(w.CavesSign3,198,"Caves Sign 3",[[r.b.I,[4,5]]]),S(w.HexagonalTank,199,"Hexagonal Tank",[[r.b.I,[4,5]]]),S(w.BrownPlatform,200,"Brown Platform",[[r.b.I,[4,5]]]),S(w.WarningLightObject,201,"Warning Light Object",[[r.b.I,[4,5]],[r.b.IV,[5]]]),S(w.Rainbow,203,"Rainbow",[[r.b.I,[4]]]),S(w.FloatingJellyfish,204,"Floating Jellyfish",[[r.b.I,[4]],[r.b.II,[10,11]]]),S(w.FloatingDragonfly,205,"Floating Dragonfly",[[r.b.I,[4,16]],[r.b.II,[3,4]],[r.b.IV,[6,7,8]]]),S(w.CavesSwitchDoor,206,"Caves Switch Door",[[r.b.I,[3,4,5]]]),S(w.RobotRechargeStation,207,"Robot Recharge Station",[[r.b.I,[3,4,5,6,7]],[r.b.II,[17]]]),S(w.CavesCakeShop,208,"Caves Cake Shop",[[r.b.I,[5]]]),S(w.Caves1SmallRedRock,209,"Caves 1 Small Red Rock",[[r.b.I,[3]]]),S(w.Caves1MediumRedRock,210,"Caves 1 Medium Red Rock",[[r.b.I,[3]]]),S(w.Caves1LargeRedRock,211,"Caves 1 Large Red Rock",[[r.b.I,[3]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves2SmallRock1,212,"Caves 2 Small Rock 1",[[r.b.I,[4]]]),S(w.Caves2MediumRock1,213,"Caves 2 Medium Rock 1",[[r.b.I,[4]]]),S(w.Caves2LargeRock1,214,"Caves 2 Large Rock 1",[[r.b.I,[4]]]),S(w.Caves2SmallRock2,215,"Caves 2 Small Rock 2",[[r.b.I,[4]]]),S(w.Caves2MediumRock2,216,"Caves 2 Medium Rock 2",[[r.b.I,[4]]]),S(w.Caves2LargeRock2,217,"Caves 2 Large Rock 2",[[r.b.I,[4]]]),S(w.Caves3SmallRock,218,"Caves 3 Small Rock",[[r.b.I,[5]]]),S(w.Caves3MediumRock,219,"Caves 3 Medium Rock",[[r.b.I,[5]]]),S(w.Caves3LargeRock,220,"Caves 3 Large Rock",[[r.b.I,[5]]]),S(w.FloorPanel2,222,"Floor Panel 2",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.DestructableRockCaves1,223,"Destructable Rock (Caves 1)",[[r.b.I,[3]]]),S(w.DestructableRockCaves2,224,"Destructable Rock (Caves 2)",[[r.b.I,[4]]]),S(w.DestructableRockCaves3,225,"Destructable Rock (Caves 3)",[[r.b.I,[5]]]),S(w.MinesDoor,256,"Mines Door",[[r.b.I,[6,7]]]),S(w.FloorPanel3,257,"Floor Panel 3",[[r.b.I,[1,2,6,7,16,17]],[r.b.II,[1,2,3,4]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MinesSwitchDoor,258,"Mines Switch Door",[[r.b.I,[6,7]],[r.b.IV,[6,7,8]]]),S(w.LargeCryoTube,259,"Large Cryo-Tube",[[r.b.I,[6,7]],[r.b.II,[17]]]),S(w.ComputerLikeCalus,260,"Computer (like calus)",[[r.b.I,[6,7]],[r.b.II,[17]]]),S(w.GreenScreenOpeningAndClosing,261,"Green Screen opening and closing",[[r.b.I,[6,7]],[r.b.II,[17]]]),S(w.FloatingRobot,262,"Floating Robot",[[r.b.I,[6,7]]]),S(w.FloatingBlueLight,263,"Floating Blue Light",[[r.b.I,[6,7]]]),S(w.SelfDestructingObject1,264,"Self Destructing Object 1",[[r.b.I,[6,7]]]),S(w.SelfDestructingObject2,265,"Self Destructing Object 2",[[r.b.I,[6,7]]]),S(w.SelfDestructingObject3,266,"Self Destructing Object 3",[[r.b.I,[6,7]]]),S(w.SparkMachine,267,"Spark Machine",[[r.b.I,[6,7]]]),S(w.MinesLargeFlashingCrate,268,"Mines Large Flashing Crate",[[r.b.I,[6,7]]]),S(w.RuinsSeal,304,"Ruins Seal",[[r.b.I,[13]]]),S(w.RuinsTeleporter,320,"Ruins Teleporter",[[r.b.I,[8,9,10]]]),S(w.RuinsWarpSiteToSite,321,"Ruins Warp (Site to site)",[[r.b.I,[8,9,10]]]),S(w.RuinsSwitch,322,"Ruins Switch",[[r.b.I,[8,9,10]]]),S(w.FloorPanel4,323,"Floor Panel 4",[[r.b.I,[8,9,10]]]),S(w.Ruins1Door,324,"Ruins 1 Door",[[r.b.I,[8]]]),S(w.Ruins3Door,325,"Ruins 3 Door",[[r.b.I,[10]]]),S(w.Ruins2Door,326,"Ruins 2 Door",[[r.b.I,[9]]]),S(w.Ruins11ButtonDoor,327,"Ruins 1-1 Button Door",[[r.b.I,[8]]]),S(w.Ruins21ButtonDoor,328,"Ruins 2-1 Button Door",[[r.b.I,[9]]]),S(w.Ruins31ButtonDoor,329,"Ruins 3-1 Button Door",[[r.b.I,[10]]]),S(w.Ruins4ButtonDoor,330,"Ruins 4-Button Door",[[r.b.I,[8,9,10]]]),S(w.Ruins2ButtonDoor,331,"Ruins 2-Button Door",[[r.b.I,[8,9,10]]]),S(w.RuinsSensor,332,"Ruins Sensor",[[r.b.I,[8,9,10]]]),S(w.RuinsFenceSwitch,333,"Ruins Fence Switch",[[r.b.I,[8,9,10]]]),S(w.RuinsLaserFence4x2,334,"Ruins Laser Fence 4x2",[[r.b.I,[8,9,10]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence6x2,335,"Ruins Laser Fence 6x2",[[r.b.I,[8,9,10]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence4x4,336,"Ruins Laser Fence 4x4",[[r.b.I,[8,9,10]]]),S(w.RuinsLaserFence6x4,337,"Ruins Laser Fence 6x4",[[r.b.I,[8,9,10]]]),S(w.RuinsPoisonBlob,338,"Ruins poison Blob",[[r.b.I,[8,9,10]],[r.b.II,[5,6,7,8,9]],[r.b.IV,[6,7,8]]]),S(w.RuinsPillarTrap,339,"Ruins Pillar Trap",[[r.b.I,[8,9,10]],[r.b.II,[1,2,3,4]]]),S(w.PopupTrapNoTech,340,"Popup Trap (No Tech)",[[r.b.I,[8,9,10]]]),S(w.RuinsCrystal,341,"Ruins Crystal",[[r.b.I,[8,9,10]]]),S(w.Monument,342,"Monument",[[r.b.I,[2,4,7]]]),S(w.RuinsRock1,345,"Ruins Rock 1",[[r.b.I,[8,9,10]]]),S(w.RuinsRock2,346,"Ruins Rock 2",[[r.b.I,[8,9,10]]]),S(w.RuinsRock3,347,"Ruins Rock 3",[[r.b.I,[8,9,10]]]),S(w.RuinsRock4,348,"Ruins Rock 4",[[r.b.I,[8,9,10]]]),S(w.RuinsRock5,349,"Ruins Rock 5",[[r.b.I,[8,9,10]]]),S(w.RuinsRock6,350,"Ruins Rock 6",[[r.b.I,[8,9,10]]]),S(w.RuinsRock7,351,"Ruins Rock 7",[[r.b.I,[8,9,10]]]),S(w.Poison,352,"Poison",[[r.b.I,[8,9,10,13]],[r.b.II,[3,4,10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedBoxTypeRuins,353,"Fixed Box Type (Ruins)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4,14,15]]]),S(w.RandomBoxTypeRuins,354,"Random Box Type (Ruins)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4,14,15]]]),S(w.EnemyTypeBoxYellow,355,"Enemy Type Box (Yellow)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4]]]),S(w.EnemyTypeBoxBlue,356,"Enemy Type Box (Blue)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4]]]),S(w.EmptyTypeBoxBlue,357,"Empty Type Box (Blue)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4]]]),S(w.DestructableRock,358,"Destructable Rock",[[r.b.I,[8,9,10]]]),S(w.PopupTrapsTechs,359,"Popup Traps (techs)",[[r.b.I,[6,7,8,9,10]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]]]),S(w.FlyingWhiteBird,368,"Flying White Bird",[[r.b.I,[14,16]],[r.b.II,[3,4]]]),S(w.Tower,369,"Tower",[[r.b.I,[14]]]),S(w.FloatingRocks,370,"Floating Rocks",[[r.b.I,[14]]]),S(w.FloatingSoul,371,"Floating Soul",[[r.b.I,[14]]]),S(w.Butterfly,372,"Butterfly",[[r.b.I,[14]]]),S(w.LobbyGameMenu,384,"Lobby Game menu",[[r.b.I,[15]]]),S(w.LobbyWarpObject,385,"Lobby Warp Object",[[r.b.I,[15]]]),S(w.Lobby1EventObjectDefaultTree,386,"Lobby 1 Event Object (Default Tree)",[[r.b.I,[15]]]),S(w.UnknownItem387,387,"Unknown Item (387)",[[r.b.I,[15]]]),S(w.UnknownItem388,388,"Unknown Item (388)",[[r.b.I,[15]]]),S(w.UnknownItem389,389,"Unknown Item (389)",[[r.b.I,[15]]]),S(w.LobbyEventObjectStaticPumpkin,390,"Lobby Event Object (Static Pumpkin)",[[r.b.I,[15]]]),S(w.LobbyEventObject3ChristmasWindows,391,"Lobby Event Object (3 Christmas Windows)",[[r.b.I,[15]]]),S(w.LobbyEventObjectRedAndWhiteCurtain,392,"Lobby Event Object (Red and White Curtain)",[[r.b.I,[15]]]),S(w.UnknownItem393,393,"Unknown Item (393)",[[r.b.I,[15]]]),S(w.UnknownItem394,394,"Unknown Item (394)",[[r.b.I,[15]]]),S(w.LobbyFishTank,395,"Lobby Fish Tank",[[r.b.I,[15]]]),S(w.LobbyEventObjectButterflies,396,"Lobby Event Object (Butterflies)",[[r.b.I,[15]]]),S(w.UnknownItem400,400,"Unknown Item (400)",[[r.b.I,[16]],[r.b.II,[3,4]]]),S(w.GreyWallLow,401,"grey wall low",[[r.b.I,[16]],[r.b.II,[3,4,17]]]),S(w.SpaceshipDoor,402,"Spaceship Door",[[r.b.I,[16]],[r.b.II,[3,4]]]),S(w.GreyWallHigh,403,"grey wall high",[[r.b.I,[16]],[r.b.II,[3,4,17]]]),S(w.TempleNormalDoor,416,"Temple Normal Door",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BreakableWallWallButUnbreakable,417,'"breakable wall wall, but unbreakable"',[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BrokenCylinderAndRubble,418,"Broken cylinder and rubble",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.ThreeBrokenWallPiecesOnFloor,419,"3 broken wall pieces on floor",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.HighBrickCylinder,420,"high brick cylinder",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.LyingCylinder,421,"lying cylinder",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BrickConeWithFlatTop,422,"brick cone with flat top",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BreakableTempleWall,423,"breakable temple wall",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.TempleMapDetect,424,"Temple Map Detect",[[r.b.I,[17]],[r.b.II,[1,2,14]],[r.b.IV,[1,2,3,4,5]]]),S(w.SmallBrownBrickRisingBridge,425,"small brown brick rising bridge",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.LongRisingBridgeWithPinkHighEdges,426,"long rising bridge (with pink high edges)",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.FourSwitchTempleDoor,427,"4 switch temple door",[[r.b.II,[1,2]]]),S(w.FourButtonSpaceshipDoor,448,"4 button spaceship door",[[r.b.II,[3,4]]]),S(w.ItemBoxCca,512,"item box cca",[[r.b.II,[5,6,7,8,9,12,16,17]],[r.b.IV,[5]]]),S(w.TeleporterEp2,513,"Teleporter (Ep 2)",[[r.b.II,[5,6,7,8,9,10,11,12,13,16,17]]]),S(w.CCADoor,514,"CCA Door",[[r.b.II,[5,6,7,8,9,16,17]]]),S(w.SpecialBoxCCA,515,"Special Box CCA",[[r.b.II,[5,6,7,8,9,12,16,17]],[r.b.IV,[1,2,3,4,5]]]),S(w.BigCCADoor,516,"Big CCA Door",[[r.b.II,[5]]]),S(w.BigCCADoorSwitch,517,"Big CCA Door Switch",[[r.b.II,[5,6,7,8,9,16,17]]]),S(w.LittleRock,518,"Little Rock",[[r.b.II,[5,6,7,8,9,16]]]),S(w.Little3StoneWall,519,"Little 3 Stone Wall",[[r.b.II,[5,6,7,8,9,16]]]),S(w.Medium3StoneWall,520,"Medium 3 stone wall",[[r.b.II,[5,6,7,8,9,16]]]),S(w.SpiderPlant,521,"Spider Plant",[[r.b.II,[5,6,7,8,9,16]]]),S(w.CCAAreaTeleporter,522,"CCA Area Teleporter",[[r.b.II,[5,6,7,8,9,16,17]]]),S(w.UnknownItem523,523,"Unknown Item (523)",[[r.b.II,[5,12]]]),S(w.WhiteBird,524,"White Bird",[[r.b.II,[6,7,9,16,17]],[r.b.IV,[6,7,8]]]),S(w.OrangeBird,525,"Orange Bird",[[r.b.II,[6,7,9,17]]]),S(w.Saw,527,"Saw",[[r.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.LaserDetect,528,"Laser Detect",[[r.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.UnknownItem529,529,"Unknown Item (529)",[[r.b.II,[5,6,7]],[r.b.IV,[6,7,8]]]),S(w.UnknownItem530,530,"Unknown Item (530)",[[r.b.II,[5,6,7,8,9,17]]]),S(w.Seagull,531,"Seagull",[[r.b.II,[6,7,8,9,16]],[r.b.IV,[6,7,8]]]),S(w.Fish,544,"Fish",[[r.b.I,[15]],[r.b.II,[6,9,10,11,16]]]),S(w.SeabedDoorWithBlueEdges,545,"Seabed Door (with blue edges)",[[r.b.II,[10,11]]]),S(w.SeabedDoorAlwaysOpenNonTriggerable,546,"Seabed door (always open, non-triggerable)",[[r.b.II,[10,11]]]),S(w.LittleCryotube,547,"Little Cryotube",[[r.b.II,[10,11,17]]]),S(w.WideGlassWallBreakable,548,"Wide Glass Wall (breakable)",[[r.b.II,[10,11]]]),S(w.BlueFloatingRobot,549,"Blue floating robot",[[r.b.II,[10,11]]]),S(w.RedFloatingRobot,550,"Red floating robot",[[r.b.II,[10,11]]]),S(w.Dolphin,551,"Dolphin",[[r.b.II,[10,11]]]),S(w.CaptureTrap,552,"Capture Trap",[[r.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.VRLink,553,"VR link",[[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]]]),S(w.UnknownItem576,576,"Unknown Item (576)",[[r.b.II,[12]]]),S(w.WarpInBarbaRayRoom,640,"Warp in Barba Ray Room",[[r.b.II,[14]]]),S(w.UnknownItem672,672,"Unknown Item (672)",[[r.b.II,[15]]]),S(w.GeeNest,688,"Gee Nest",[[r.b.I,[8,9,10]],[r.b.II,[5,6,7,8,9,16,17]],[r.b.IV,[6,7,8]]]),S(w.LabComputerConsole,689,"Lab Computer Console",[[r.b.II,[0]]]),S(w.LabComputerConsoleGreenScreen,690,"Lab Computer Console (Green Screen)",[[r.b.II,[0]]]),S(w.ChairYellowPillow,691,"Chair, Yellow Pillow",[[r.b.II,[0]]]),S(w.OrangeWallWithHoleInMiddle,692,"orange wall with hole in middle",[[r.b.II,[0]]]),S(w.GreyWallWithHoleInMiddle,693,"grey wall with hole in middle",[[r.b.II,[0]]]),S(w.LongTable,694,"long table",[[r.b.II,[0]]]),S(w.GBAStation,695,"GBA Station",[]),S(w.TalkLinkToSupport,696,"Talk (link to support)",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.InstaWarp,697,"insta-warp",[[r.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LabInvisibleObject,698,"Lab Invisible Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.LabGlassWindowDoor,699,"Lab Glass window Door",[[r.b.II,[0]]]),S(w.UnknownItem700,700,"Unknown Item (700)",[[r.b.II,[13]]]),S(w.LabCeilingWarp,701,"Lab Ceiling Warp",[[r.b.II,[0]]]),S(w.Ep4LightSource,768,"Ep4 Light Source",[[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Cacti,769,"cacti",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BigBrownRock,770,"Big Brown Rock",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BreakableBrownRock,771,"Breakable Brown Rock",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem832,832,"Unknown Item (832)",[]),S(w.UnknownItem833,833,"Unknown Item (833)",[]),S(w.PoisonPlant,896,"Poison Plant",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem897,897,"Unknown Item (897)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem898,898,"Unknown Item (898)",[[r.b.IV,[6,7,8]]]),S(w.OozingDesertPlant,899,"Oozing Desert Plant",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem901,901,"Unknown Item (901)",[[r.b.IV,[6,7,8]]]),S(w.BigBlackRocks,902,"big black rocks",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem903,903,"Unknown Item (903)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem904,904,"Unknown Item (904)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem905,905,"Unknown Item (905)",[]),S(w.UnknownItem906,906,"Unknown Item (906)",[]),S(w.FallingRock,907,"Falling Rock",[[r.b.IV,[6,7,8]]]),S(w.DesertPlantHasCollision,908,"Desert Plant (has collision)",[[r.b.IV,[6,7,8]]]),S(w.DesertFixedTypeBoxBreakableCrystals,909,"Desert Fixed Type Box (Breakable Crystals)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem910,910,"Unknown Item (910)",[]),S(w.BeeHive,911,"Bee Hive",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem912,912,"Unknown Item (912)",[[r.b.IV,[6,7,8]]]),S(w.Heat,913,"Heat",[[r.b.IV,[6,7,8]]]),S(w.TopOfSaintMillionEgg,960,"Top of saint million egg",[[r.b.IV,[9]]]),S(w.UnknownItem961,961,"Unknown Item (961)",[[r.b.IV,[9]]]),Object.freeze(j),Object.freeze(T),function(e){e[e.Normal=0]="Normal",e[e.Hovered=1]="Hovered",e[e.Selected=2]="Selected"}(P||(P={}));const D=[];D[P.Normal]=16776960,D[P.Hovered]=16768831,D[P.Selected]=16755200;const B=[];function E(e,t,i){const o=new y.MeshLambertMaterial({color:O(e)?B[P.Normal]:D[P.Normal],side:y.DoubleSide}),s=Object(R.a)(t,i.length?i.map(t=>new y.MeshBasicMaterial({map:t,side:y.DoubleSide,transparent:e!==I.c.PofuillySlime&&e!==I.c.PouillySlime,alphaTest:.01})):o,o);return s.name=C(e),s}B[P.Normal]=16711680,B[P.Hovered]=16727903,B[P.Selected]=16711764;var M=i("ouMO");const W=180/Math.PI,q=1/W;function F(e){return e*W}function z(e){return e*q}function V(e,t){return(e%t+t)%t}var U=i("wtpc");function $(e,t,i){return new y.Euler(e,t,i,"ZXY")}function N(e){return(new y.Euler).setFromQuaternion(e,"ZXY")}const A=new y.Quaternion,H=new y.Quaternion;class G{constructor(e,t,i,o,s){this._section=Object(M.e)(void 0),Object(U.e)(e,"type"),Object(U.j)(t,"area_id"),Object(U.j)(i,"section_id"),Object(U.e)(o,"position"),Object(U.e)(s,"rotation"),this.type=e,this.area_id=t,this.section=this._section,this._section_id=Object(M.e)(i),this.section_id=this._section_id,this._position=Object(M.e)(o),this.position=this._position,this._world_position=Object(M.e)(o),this.world_position=this._world_position,this._rotation=Object(M.e)(s),this.rotation=this._rotation,this._world_rotation=Object(M.e)(s),this.world_rotation=this._world_rotation}set_section(e){if(e.area_variant.area.id!==this.area_id)throw new Error("Quest entities can't be moved across areas.");return this._section.val=e,this._section_id.val=e.id,this.set_position(this.position.val),this.set_rotation(this.rotation.val),this}set_position(e){this._position.val=e;const t=this.section.val;return this._world_position.val=t?e.clone().applyEuler(t.rotation).add(t.position):e,this}set_world_position(e){this._world_position.val=e;const t=this.section.val;return this._position.val=t?e.clone().sub(t.position).applyEuler(t.inverse_rotation):e,this}set_rotation(e){Y(e),this._rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),this._world_rotation.val=Y(N(A.multiply(H)))):this._world_rotation.val=e,this}set_world_rotation(e){Y(e),this._world_rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),H.inverse(),this._rotation.val=Y(N(A.multiply(H)))):this._rotation.val=e,this}}function Y(e){return e.set(V(e.x,2*Math.PI),V(e.y,2*Math.PI),V(e.z,2*Math.PI))}class K extends G{constructor(e,t,i,o,s,n,r,a,d,c,l,_,u){var v,h,p,g,b,f;Object(U.j)(t,"pso_type_id"),Object(U.i)(i,"npc_id"),Object(U.k)(s,"pso_wave2"),Object(U.j)(n,"script_label"),Object(U.j)(r,"pso_roaming"),Object(U.e)(_,"scale"),Object(U.e)(u,"unknown"),Object(U.c)(2===u.length,()=>`unknown should be of length 2, was ${u.length}.`),Object(U.c)(10===u[0].length,()=>`unknown[0] should be of length 10, was ${u[0].length}`),Object(U.c)(4===u[1].length,()=>`unknown[1] should be of length 4, was ${u[1].length}`),super(e,a,d,c,l),this.pso_type_id=t,this.npc_id=i,this._wave=Object(M.e)(o),this.wave=this._wave;const m=null===(h=null===(v=o)||void 0===v?void 0:v.id)||void 0===h?void 0:h.val,w=null===(g=null===(p=o)||void 0===p?void 0:p.section_id)||void 0===g?void 0:g.val,k=null===(f=null===(b=o)||void 0===b?void 0:b.area_id)||void 0===f?void 0:f.val;this._pso_wave2=s,this.pso_wave2=this.wave.flat_map(e=>null==e?Object(M.e)(null==m?this._pso_wave2:0):m===e.id.val&&w===e.section_id.val&&k===e.area_id.val?e.id.map(e=>m===e?this._pso_wave2:e):e.id),this.script_label=n,this.pso_roaming=r,this.unknown=u,this.scale=_}set_wave(e){return this._wave.val=e,this}}class Q extends k.a{constructor(e,t){super(e),this._collision_geometry=new y.Object3D,this._render_geometry=new y.Object3D,this._entity_models=new y.Object3D,this.disposer=new d.a,this.entity_to_mesh=new Map,this.camera=new y.PerspectiveCamera(60,1,10,1e4),this.disposer.add(t(this))}get debug(){return super.debug}set debug(e){this.debug!==e&&(super.debug=e,this._render_geometry.visible=e,this.schedule_render())}get collision_geometry(){return this._collision_geometry}set collision_geometry(e){this.scene.remove(this.collision_geometry),this._collision_geometry=e,this.scene.add(e)}set render_geometry(e){this.scene.remove(this._render_geometry),this._render_geometry=e,e.visible=this.debug,this.scene.add(e)}get entity_models(){return this._entity_models}init_camera_controls(){super.init_camera_controls()}dispose(){super.dispose(),this.disposer.dispose()}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}reset_entity_models(){this.scene.remove(this._entity_models),this._entity_models=new y.Group,this.scene.add(this._entity_models),this.entity_to_mesh.clear(),this.schedule_render()}add_entity_model(e){const t=e.userData.entity;this._entity_models.add(e),this.entity_to_mesh.set(t,e),t===this.selected_entity&&this.mark_selected(e),this.schedule_render()}remove_entity_model(e){const t=this.entity_to_mesh.get(e);t&&(this.entity_to_mesh.delete(e),this._entity_models.remove(t),this.schedule_render())}get_entity_mesh(e){return this.entity_to_mesh.get(e)}mark_selected(e){e===this.hovered_mesh&&(this.hovered_mesh=void 0),e!==this.selected_mesh&&(this.selected_mesh&&Z(this.selected_mesh,P.Normal),Z(e,P.Selected),this.schedule_render()),this.selected_mesh=e}mark_hovered(e){this.selected_mesh&&e===this.selected_mesh||(e!==this.hovered_mesh&&(this.hovered_mesh&&Z(this.hovered_mesh,P.Normal),e&&Z(e,P.Hovered),this.schedule_render()),this.hovered_mesh=e)}unmark_selected(){this.selected_mesh&&(Z(this.selected_mesh,P.Normal),this.schedule_render()),this.selected_mesh=void 0}}function Z(e,t){const i=e.userData.entity instanceof K?B[t]:D[t];if(e)if(Array.isArray(e.material))for(const o of e.material)t===P.Normal&&o.map?o.color.set(16777215):o.color.set(i);else e.material.color.set(i)}var J=i("oxtq"),X=i("rwco"),ee=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const te=X.c.get("quest_editor/rendering/QuestModelManager"),ie=Object.freeze(new y.Vector3(0,800,700)),oe=Object.freeze(new y.Vector3(0,0,0)),se=new y.Object3D;class ne{constructor(e,t,i,o){this.renderer=t,this.area_asset_loader=i,this.entity_asset_loader=o,this.disposer=new d.a,this.quest_disposer=this.disposer.add(new d.a),this.area_variant_changed=()=>ee(this,void 0,void 0,(function*(){const{episode:e,area_variant:t,npcs:i,objects:o}=this.get_area_variant_details();yield this.area_model_manager.load(e,t),this.quest_disposer.dispose_all(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models(),this.quest_disposer.add_all(i.observe_list(this.npcs_changed,{call_now:!0}),o.observe_list(this.objects_changed,{call_now:!0}))})),this.npcs_changed=e=>{e.type===J.a.ListChange&&(this.npc_model_manager.remove(e.removed),this.npc_model_manager.add(e.inserted))},this.objects_changed=e=>{e.type===J.a.ListChange&&(this.object_model_manager.remove(e.removed),this.object_model_manager.add(e.inserted))},this.area_model_manager=new re(this.renderer,i),this.npc_model_manager=new ae(e,this.renderer,o),this.object_model_manager=new ae(e,this.renderer,o)}dispose(){this.disposer.dispose(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models()}}class re{constructor(e,t){this.renderer=e,this.area_asset_loader=t,this.raycaster=new y.Raycaster,this.origin=new y.Vector3,this.down=Object.freeze(new y.Vector3(0,-1,0)),this.up=Object.freeze(new y.Vector3(0,1,0))}load(e,t){return ee(this,void 0,void 0,(function*(){if(this.area_variant=t,null==e||null==t)return this.renderer.collision_geometry=se,void(this.renderer.render_geometry=se);try{const i=yield this.area_asset_loader.load_collision_geometry(e,t);if(this.should_cancel(t))return;const o=yield this.area_asset_loader.load_render_geometry(e,t);if(this.should_cancel(t))return;this.add_sections_to_collision_geometry(i,o),this.renderer.collision_geometry=i,this.renderer.render_geometry=o,this.renderer.reset_camera(ie,oe)}catch(e){te.error(`Couldn't load models for area ${t.area.id}, variant ${t.id}.`,e),this.renderer.collision_geometry=se,this.renderer.render_geometry=se}}))}should_cancel(e){return this.area_variant!==e}add_sections_to_collision_geometry(e,t){for(const i of e.children){i.geometry.boundingBox.getCenter(this.origin),this.raycaster.set(this.origin,this.down);const e=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);this.raycaster.set(this.origin,this.up);const o=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);let s;if(s=e&&o?e.distance<=o.distance?e:o:e||o,s){const e=i.userData,t=s.object.userData;e.section=t.section}}}}class ae{constructor(e,t,i){this.current_wave=e,this.renderer=t,this.entity_asset_loader=i,this.queue=[],this.loaded_entities=[],this.loading=!1}add(e){return ee(this,void 0,void 0,(function*(){if(this.queue.push(...e),!this.loading)try{for(this.loading=!0;this.queue.length;){const e=this.queue[0];try{yield this.load(e)}catch(t){te.error(`Couldn't load model for entity ${C(e.type)}.`,t)}finally{const t=this.queue.indexOf(e);-1!==t&&this.queue.splice(t,1)}}}finally{this.loading=!1}}))}remove(e){for(const t of e){const e=this.queue.indexOf(t);-1!==e&&this.queue.splice(e,1);const i=this.loaded_entities.findIndex(e=>e.entity===t);if(-1!==i){const e=this.loaded_entities.splice(i,1)[0];this.renderer.remove_entity_model(e.entity),e.disposer.dispose()}}}remove_all(){for(const{disposer:e}of this.loaded_entities)e.dispose();this.loaded_entities.splice(0,1/0),this.queue.splice(0,1/0)}load(e){return ee(this,void 0,void 0,(function*(){const t=yield this.entity_asset_loader.load_geometry(e.type);if(!this.queue.includes(e))return;const i=yield this.entity_asset_loader.load_textures(e.type);if(!this.queue.includes(e))return;const o=function(e,t,i){const o=E(e.type,t,i);return o.userData.entity=e,o.position.copy(e.world_position.val),o.rotation.copy(e.world_rotation.val),o}(e,t,i);this.update_entity_geometry(e,o)}))}update_entity_geometry(e,t){this.renderer.add_entity_model(t);const i=new d.a(e.world_position.observe(({value:e})=>{t.position.copy(e),this.renderer.schedule_render()}),e.world_rotation.observe(({value:e})=>{t.rotation.copy(e),this.renderer.schedule_render()}));e instanceof K&&i.add(Object(M.d)((e,t)=>null==e||e===t,this.current_wave,e.wave).observe(({value:e})=>{t.visible=e,this.renderer.schedule_render()},{call_now:!0})),this.loaded_entities.push({entity:e,disposer:i})}}class de extends ne{constructor(e,t,i,o,s,n){super(i,o,s,n),this.current_quest=e,this.current_area=t,this.disposer.add_all(e.observe(this.area_variant_changed),t.observe(this.area_variant_changed))}get_area_variant_details(){var e;const t=this.current_quest.val,i=this.current_area.val;let o,s,n;return t&&i?(o=t.area_variants.val.find(e=>e.area.id===i.id)||i.area_variants[0],s=t.npcs.filtered(e=>e.area_id===i.id),n=t.objects.filtered(e=>e.area_id===i.id)):(s=Object(M.c)(),n=Object(M.c)()),{episode:null===(e=t)||void 0===e?void 0:e.episode,area_variant:o,npcs:s,objects:n}}}var ce=i("KUR2"),le=i("4SjJ");class _e extends o.a{constructor(e,t,i,o){super(),this.element=Object(v.i)({className:i,tabIndex:-1}),this.renderer=o,this.renderer_view=this.disposable(new ce.a(this.renderer)),this.element.append(this.renderer_view.element),this.renderer_view.start_rendering(),this.disposables(e.tool.observe(({value:e})=>{e===le.b.QuestEditor?this.renderer_view.start_rendering():this.renderer_view.stop_rendering()}),t.debug.observe(({value:e})=>this.renderer.debug=e)),this.finalize_construction()}resize(e,t){return super.resize(e,t),this.renderer_view.resize(e,t),this}}let ue=void 0;const ve=new Map,he=new y.Vector2(0,0);let pe=0;function ge(e,t,i){function o(e){ue&&i(Object.assign(Object.assign({},ue),{event:e}))}ve.set(i,o),e.addEventListener(t,o)}function be(e,t,i){const o=ve.get(i);o&&(ve.delete(i),e.removeEventListener(t,o))}function fe(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"),ue&&(ue.drag_element.style.transform=`translate(${e.clientX-he.x}px, ${e.clientY-he.y}px)`)}function me(){ue&&(ue.drag_element.remove(),ue=void 0)}class we extends G{constructor(e,t,i,o,s,n,r,a,d){super(e,o,s,n,r),this.id=t,this.group_id=i,this.properties=a,this.unknown=d}}class ke{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Create ${L(i.type).name}`}undo(){this.quest.remove_entity(this.entity)}redo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}}class ye{constructor(e,t,i,o,s){this.quest_editor_store=e,this.entity=t,this.old_rotation=i,this.new_rotation=o,this.world=s,this.description=`Rotate ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.old_rotation):this.entity.set_rotation(this.old_rotation)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.new_rotation):this.entity.set_rotation(this.new_rotation)}}class Re{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Delete ${L(i.type).name}`,this.redo()}undo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}redo(){this.quest.remove_entity(this.entity)}}class Ie{constructor(e,t,i,o,s,n,r){this.quest_editor_store=e,this.entity=t,this.old_section=i,this.new_section=o,this.old_position=s,this.new_position=n,this.world=r,this.description=`Move ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.old_section&&this.entity.set_section(this.old_section),this.world?this.entity.set_world_position(this.old_position):this.entity.set_position(this.old_position)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.new_section&&this.entity.set_section(this.new_section),this.world?this.entity.set_world_position(this.new_position):this.entity.set_position(this.new_position)}}const je=Object.freeze(new y.Vector3(0,0,0)),xe=Object.freeze(new y.Vector3(0,1,0)),Te=Object.freeze(new y.Vector3(0,-1,0)),Se=2*Math.PI,Ce=new y.Raycaster;class Oe{constructor(e,t){this.quest_editor_store=e,this.renderer=t,this.disposer=new d.a,this.pointer_position=new y.Vector2(0,0),this.pointer_device_position=new y.Vector2(0,0),this.last_pointer_position=new y.Vector2(0,0),this.moved_since_last_pointer_down=!1,this._enabled=!0,this.dispose=()=>{this.renderer.canvas_element.removeEventListener("keydown",this.keydown),this.renderer.canvas_element.removeEventListener("mousedown",this.mousedown),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup),this.renderer.canvas_element.removeEventListener("mouseleave",this.mouseleave),be(this.renderer.canvas_element,"dragenter",this.dragenter),be(this.renderer.canvas_element,"dragover",this.dragover),be(this.renderer.canvas_element,"dragleave",this.dragleave),be(this.renderer.canvas_element,"drop",this.drop),this.disposer.dispose()},this.selected_entity_changed=({value:e})=>{if(this.state.cancel(),e){const t=this.renderer.get_entity_mesh(e);t?this.renderer.mark_selected(t):this.renderer.unmark_selected()}else this.renderer.unmark_selected()},this.keydown=e=>{this.state=this.state.process_event({type:Le.KeyDown,key:e.key})},this.mousedown=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseDown,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.addEventListener("mousemove",this.mousemove),document.addEventListener("mouseup",this.mouseup)},this.mousemove=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseMove,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.mouseup=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseUp,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.addEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup)},this.mouseleave=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseLeave,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.dragenter=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Le.EntityDragEnter,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragover=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Le.EntityDragOver,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragleave=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Le.EntityDragLeave,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.drop=e=>{this.process_mouse_event(e.event),this.renderer.canvas_element.focus(),this.state=this.state.process_event({type:Le.EntityDrop})},this.mark_hovered=e=>{this.renderer.mark_hovered(e)},this.disposer.add(e.selected_entity.observe(this.selected_entity_changed)),t.canvas_element.addEventListener("keydown",this.keydown),t.canvas_element.addEventListener("mousedown",this.mousedown),t.canvas_element.addEventListener("mousemove",this.mousemove),t.canvas_element.addEventListener("mouseleave",this.mouseleave),ge(t.canvas_element,"dragenter",this.dragenter),ge(t.canvas_element,"dragover",this.dragover),ge(t.canvas_element,"dragleave",this.dragleave),ge(t.canvas_element,"drop",this.drop),this.state=new Pe(this.quest_editor_store,t,this._enabled)}set enabled(e){this._enabled=e,this.state.cancel(),this.state=new Pe(this.quest_editor_store,this.renderer,this._enabled)}process_mouse_event(e){const{left:t,top:i}=this.renderer.canvas_element.getBoundingClientRect();this.pointer_position.set(e.clientX-t,e.clientY-i),this.pointer_device_position.copy(this.pointer_position),this.renderer.pointer_pos_to_device_coords(this.pointer_device_position),"mousedown"===e.type?this.moved_since_last_pointer_down=!1:"mousemove"!==e.type&&"mouseup"!==e.type||this.pointer_position.equals(this.last_pointer_position)||(this.moved_since_last_pointer_down=!0),this.last_pointer_position.copy(this.pointer_position)}}var Le;!function(e){e[e.KeyDown=0]="KeyDown",e[e.MouseDown=1]="MouseDown",e[e.MouseMove=2]="MouseMove",e[e.MouseUp=3]="MouseUp",e[e.MouseLeave=4]="MouseLeave",e[e.EntityDragEnter=5]="EntityDragEnter",e[e.EntityDragOver=6]="EntityDragOver",e[e.EntityDragLeave=7]="EntityDragLeave",e[e.EntityDrop=8]="EntityDrop"}(Le||(Le={}));class Pe{constructor(e,t,i){this.quest_editor_store=e,this.renderer=t,this.enabled=i}process_event(e){switch(e.type){case Le.KeyDown:if(this.enabled){const t=this.quest_editor_store.selected_entity.val;if(t&&"Delete"===e.key){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new Re(this.quest_editor_store,e,t))}}return this;case Le.MouseDown:{const t=this.pick_entity(e.pointer_device_position);if(t)if(1===e.buttons){if(this.quest_editor_store.set_selected_entity(t.entity),this.enabled)return new De(this.quest_editor_store,this.renderer,t.entity,t.drag_adjust,t.grab_offset)}else if(2===e.buttons&&(this.quest_editor_store.set_selected_entity(t.entity),this.enabled))return new Be(this.quest_editor_store,this.renderer,t.entity,t.mesh,t.grab_offset);return this}case Le.MouseMove:{const t=this.pick_entity(e.pointer_device_position);return e.mark_hovered(t&&t.mesh),this}case Le.MouseUp:return e.moved_since_last_pointer_down||this.pick_entity(e.pointer_device_position)||this.quest_editor_store.set_selected_entity(void 0),this;case Le.MouseLeave:return e.mark_hovered(void 0),this;case Le.EntityDragEnter:if(this.enabled){const t=this.quest_editor_store.current_area.val,i=this.quest_editor_store.current_quest.val;return t&&i?new Ee(this.quest_editor_store,this.renderer,e,i,t):this}return this;default:return this}}cancel(){}pick_entity(e){Ce.setFromCamera(e,this.renderer.camera);const[t]=Ce.intersectObjects(this.renderer.entity_models.children);if(!t)return;const i=t.object.userData.entity,o=t.object.position.clone().sub(t.point),s=o.clone();Ce.set(t.object.position,Te);const[n]=Ce.intersectObjects(this.renderer.collision_geometry.children,!0);return n&&(s.y-=n.distance),{mesh:t.object,entity:i,grab_offset:o,drag_adjust:s}}}class De{constructor(e,t,i,o,s){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.drag_adjust=o,this.grab_offset=s,this.cancelled=!1,this.initial_section=i.section.val,this.initial_position=i.world_position.val,this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Le.MouseMove:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&Me(this.renderer,this.entity,this.drag_adjust,this.grab_offset,e.pointer_device_position,e.shift_key),this);case Le.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new Ie(this.quest_editor_store,this.entity,this.initial_section,this.entity.section.val,this.initial_position,this.entity.world_position.val,!0)).redo(),new Pe(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.initial_section&&this.entity.set_section(this.initial_section),this.entity.set_world_position(this.initial_position)}}class Be{constructor(e,t,i,o,s){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.mesh=o,this.cancelled=!1,this.initial_rotation=i.world_rotation.val,this.grab_point=i.world_position.val.clone().sub(s),this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Le.MouseMove:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&Fe(this.renderer,this.entity,this.mesh.quaternion,this.initial_rotation,this.grab_point,e.pointer_device_position),this);case Le.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new ye(this.quest_editor_store,this.entity,this.initial_rotation,this.entity.world_rotation.val,!0)),new Pe(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.entity.set_world_rotation(this.initial_rotation)}}class Ee{constructor(e,t,i,o,s){if(this.quest_editor_store=e,this.drag_adjust=new y.Vector3(0,0,0),this.cancelled=!1,this.renderer=t,i.drag_element.style.display="none",i.data_transfer&&(i.data_transfer.dropEffect="copy"),O(i.entity_type)){const t=Object(I.d)(i.entity_type);this.entity=new K(i.entity_type,t.pso_type_id,0,e.selected_wave.val,0,0,t.pso_roaming,s.id,0,new y.Vector3(0,0,0),$(0,0,0),new y.Vector3(1,1,1),[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0]])}else this.entity=new we(i.entity_type,0,0,s.id,0,new y.Vector3(0,0,0),$(0,0,0),new Map,[[0,0,0,0,0,0],[0,0]]);We(this.renderer,this.entity,this.drag_adjust,je,i.pointer_device_position),o.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}process_event(e){switch(e.type){case Le.EntityDragOver:return this.cancelled?(e.drag_element.style.display="flex",e.data_transfer&&(e.data_transfer.dropEffect="none"),new Pe(this.quest_editor_store,this.renderer,!0)):(e.stop_propagation(),e.prevent_default(),e.data_transfer&&(e.data_transfer.dropEffect="copy"),Me(this.renderer,this.entity,this.drag_adjust,je,e.pointer_device_position,e.shift_key),this);case Le.EntityDragLeave:{e.drag_element.style.display="flex";const t=this.quest_editor_store.current_quest.val;return t&&t.remove_entity(this.entity),new Pe(this.quest_editor_store,this.renderer,!0)}case Le.EntityDrop:if(!this.cancelled){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new ke(this.quest_editor_store,e,this.entity))}return new Pe(this.quest_editor_store,this.renderer,!0);default:return this}}cancel(){this.cancelled=!0;const e=this.quest_editor_store.current_quest.val;e&&e.remove_entity(this.entity)}}function Me(e,t,i,o,s,n){n?qe(e,t,i,o,s):We(e,t,i,o,s)}const We=(()=>{const e=new y.Plane,t=new y.Vector3;return(i,o,s,n,r)=>{const{intersection:a,section:d}=function(e,t,i){Ce.setFromCamera(t,e.camera),Ce.ray.origin.add(i);const o=Ce.intersectObjects(e.collision_geometry.children,!0);for(const e of o)if(e.face.normal.y>.75)return{intersection:e,section:e.object.userData.section};return{}}(i,r,s);if(a){if(d){const e=o.world_rotation.val;o.set_section(d),o.set_world_rotation(e)}o.set_world_position(new y.Vector3(a.point.x,a.point.y+n.y-s.y,a.point.z))}else Ce.setFromCamera(r,i.camera),e.set(xe,-o.world_position.val.y+n.y),Ce.ray.intersectPlane(e,t)&&o.set_world_position(new y.Vector3(t.x+n.x,o.world_position.val.y,t.z+n.z))}})(),qe=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3;return(s,n,r,a,d)=>{if(Ce.setFromCamera(d,s.camera),s.camera.getWorldDirection(e),e.negate(),e.y=0,e.normalize(),o.set(n.world_position.val.x,n.world_position.val.y,n.world_position.val.z),o.sub(a),t.setFromNormalAndCoplanarPoint(e,o),Ce.ray.intersectPlane(t,i)){const e=i.y+a.y,t=e-n.world_position.val.y;r.y-=t,n.set_world_position(new y.Vector3(n.world_position.val.x,e,n.world_position.val.z))}}})(),Fe=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3,s=new y.Vector3,n=new y.Vector3;return(r,a,d,c,l,_)=>{if(e.copy(xe),e.applyQuaternion(d),t.setFromNormalAndCoplanarPoint(e,l),Ce.setFromCamera(_,r.camera),Ce.ray.intersectPlane(t,i)){t.projectPoint(a.world_position.val,o),s.subVectors(o,l),n.subVectors(o,i);const r=s.dot(n),d=e.dot(s.cross(n)),_=Math.atan2(d,r);a.set_world_rotation(new y.Euler(c.x,(c.y+_)%Se,c.z,"ZXY"))}}})();class ze extends _e{constructor(e,t,i,o,s){super(e,t,"quest_editor_QuestEditorRendererView",new Q(s,e=>new de(t.current_quest,t.current_area,t.selected_wave,e,i,o))),this.element.addEventListener("focus",()=>t.undo.make_current(),!0),this.entity_controls=this.disposable(new Oe(t,this.renderer)),this.disposables(t.selected_entity.observe(({value:e})=>this.renderer.selected_entity=e),t.quest_runner.running.observe(({value:e})=>this.entity_controls.enabled=!e,{call_now:!0})),this.renderer.init_camera_controls(),this.finalize_construction()}}var Ve=i("wsa1"),Ue=i("w6HN"),$e=i("oyid");class Ne extends Ue.a{constructor(e){const t=new $e.a(!0,{label:"Inline args mode",tooltip:e.has_issues.map(e=>{let t="Transform arg_push* opcodes to be inline with the opcode the arguments are given to.";return e&&(t+="\nThis mode cannot be toggled because there are issues in the script."),t})});super(t),this.disposables(t.checked.bind_to(e.inline_args_mode),t.checked.observe(({value:t})=>e.set_inline_args_mode(t)),t.enabled.bind_to(e.has_issues.map(e=>!e))),this.finalize_construction()}}var Ae=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))},He=Ve.editor.ScrollType;class Ge{constructor(e){this.editor=e,this.history=[],this.history_index=-1,this.capture_history=!0,this.disposer=new d.a,this.did_change_cursor_position=e=>{this.capture_history&&(this.history.splice(this.history_index+1,1/0),"api"===e.source||-1===this.history_index||Math.abs(e.position.lineNumber-this.history[this.history_index].lineNumber)>=10?(this.history.push(e.position),this.history_index++):this.history[this.history_index]=e.position)},this.back=()=>Ae(this,void 0,void 0,(function*(){this.history_index>0&&this.set_position(this.history[--this.history_index])})),this.forward=()=>Ae(this,void 0,void 0,(function*(){this.history_index+1{this.capture_history=!1,this.editor.setPosition(e),this.editor.revealPositionInCenterIfOutsideViewport(e,He.Immediate),this.capture_history=!0},this.mouse_up=e=>{const t=e.event.browserEvent.button,i=e.event.browserEvent.buttons;3===t?(0===i&&(e.event.preventDefault(),this.back()),this.editor.focus()):4===t&&(0===i&&(e.event.preventDefault(),this.forward()),this.editor.focus())},this.disposer.add_all(this.editor.onDidChangeCursorPosition(this.did_change_cursor_position),this.editor.addAction({id:"phantasmal.action.back",label:"Back",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.LeftArrow],run:this.back}),this.editor.addAction({id:"phantasmal.action.forward",label:"Forward",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.RightArrow],run:this.forward}),this.editor.onMouseUp(this.mouse_up))}dispose(){this.disposer.dispose()}reset(){this.history.splice(0,1/0),this.history_index=-1}}i("/NSH");Ve.editor.defineTheme("phantasmal-world",{base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"e0e0e0",background:"#181818"},{token:"tag",foreground:"99bbff"},{token:"keyword",foreground:"d0a0ff",fontStyle:"bold"},{token:"predefined",foreground:"bbffbb"},{token:"number",foreground:"ffffaa"},{token:"number.hex",foreground:"ffffaa"},{token:"string",foreground:"88ffff"},{token:"string.escape",foreground:"8888ff"}],colors:{"editor.background":"#181818","editor.lineHighlightBackground":"#202020"}});const Ye=Ve.editor.createModel("","psoasm");class Ke extends o.a{constructor(e,t,i){super(),this.asm_editor_store=i,this.breakpoint_decoration_ids=[],this.element=Object(v.i)(),this.tool_bar_view=this.disposable(new Ne(i)),this.element.append(this.tool_bar_view.element),this.editor=this.disposable(Ve.editor.create(this.element,{theme:"phantasmal-world",scrollBeyondLastLine:!1,autoIndent:"full",fontSize:13,wordWrap:"on",wrappingIndent:"indent",renderIndentGuides:!1,folding:!1,glyphMargin:e.feature_active("vm")})),this.history=this.disposable(new Ge(this.editor)),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyCode.KEY_Z,()=>{}),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_Z,()=>{});const o=this.editor.getAction("editor.action.quickCommand");this.disposables(this.editor.addAction({id:"editor.action.quickCommand",label:"Command Palette",keybindings:[Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_P],run:()=>o.run()})),this.disposables(i.did_undo.observe(({value:e})=>{this.editor.trigger(e,"undo",void 0)}),i.did_redo.observe(({value:e})=>{this.editor.trigger(e,"redo",void 0)}),i.model.observe(({value:e})=>{this.editor.updateOptions({readOnly:!this.enabled.val||!e}),this.editor.setModel(e||Ye),this.history.reset(),this.breakpoint_decoration_ids=[],this.execloc_decoration_id="",t.clear_breakpoints()},{call_now:!0}),i.breakpoints.observe_list(e=>{var t;if(e.type===J.a.ListChange){for(const t of e.removed){const e=this.editor.getLineDecorations(t.line_no);if(e)for(const t of e){const e=this.breakpoint_decoration_ids.indexOf(t.id);if(e>-1){this.editor.deltaDecorations([t.id],[]),this.breakpoint_decoration_ids.splice(e,1);break}}}for(const i of e.inserted){(null===(t=this.editor.getLineDecorations(i.line_no))||void 0===t?void 0:t.some(e=>this.breakpoint_decoration_ids.includes(e.id)))||this.breakpoint_decoration_ids.push(this.editor.deltaDecorations([],[{range:new Ve.Range(i.line_no,0,i.line_no,0),options:{glyphMarginClassName:"quest_editor_AsmEditorView_breakpoint-enabled",glyphMarginHoverMessage:{value:"Breakpoint"}}}])[0])}}}),i.pause_location.observe(e=>{const t=this.old_pause_location,i=e.value;if(this.old_pause_location=i,void 0!==t&&void 0!==this.execloc_decoration_id){this.editor.getLineDecorations(t)&&this.editor.deltaDecorations([this.execloc_decoration_id],[])}void 0!==i&&(this.execloc_decoration_id=this.editor.deltaDecorations([],[{range:new Ve.Range(i,0,i,0),options:{className:"quest_editor_AsmEditorView_execution-location",isWholeLine:!0}}])[0],this.editor.revealLineInCenterIfOutsideViewport(i))}),this.editor.onDidFocusEditorWidget(()=>i.undo.make_current()),this.editor.onMouseDown(e=>{switch(e.target.type){case Ve.editor.MouseTargetType.GUTTER_GLYPH_MARGIN:{const i=e.target.position;if(!i)return;t.toggle_breakpoint(i.lineNumber)}}}),this.enabled.bind_to(t.running.map(e=>!e))),this.finalize_construction()}focus(){this.editor.focus()}resize(e,t){const i=Math.max(0,t-this.tool_bar_view.height);return this.editor.layout({width:e,height:i}),this}set_enabled(e){super.set_enabled(e),this.tool_bar_view.enabled.val=e,this.editor.updateOptions({readOnly:!e||!this.asm_editor_store.model.val})}}i("egRq");class Qe extends o.a{constructor(e){super(),this.ctrl=e,this.element=Object(v.i)({className:"quest_editor_EntityInfoView",tabIndex:-1}),this.no_entity_view=new b("No entity selected."),this.table_element=Object(v.s)(),this.pos_x_element=this.disposable(new a.a(0,{round_to:3})),this.pos_y_element=this.disposable(new a.a(0,{round_to:3})),this.pos_z_element=this.disposable(new a.a(0,{round_to:3})),this.rot_x_element=this.disposable(new a.a(0,{round_to:3})),this.rot_y_element=this.disposable(new a.a(0,{round_to:3})),this.rot_z_element=this.disposable(new a.a(0,{round_to:3}));const t="quest_editor_EntityInfoView_coord";this.table_element.append(Object(v.z)(Object(v.x)("Type:"),this.type_element=Object(v.u)()),Object(v.z)(Object(v.x)("Name:"),this.name_element=Object(v.u)()),Object(v.z)(Object(v.x)("Section:"),this.section_id_element=Object(v.u)()),this.wave_row_element=Object(v.z)(Object(v.x)("Wave:"),this.wave_element=Object(v.u)()),Object(v.z)(Object(v.x)({colSpan:2},"Position:")),Object(v.z)(Object(v.x)({className:t},"X:"),Object(v.u)(this.pos_x_element.element)),Object(v.z)(Object(v.x)({className:t},"Y:"),Object(v.u)(this.pos_y_element.element)),Object(v.z)(Object(v.x)({className:t},"Z:"),Object(v.u)(this.pos_z_element.element)),Object(v.z)(Object(v.x)({colSpan:2},"Rotation:")),Object(v.z)(Object(v.x)({className:t},"X:"),Object(v.u)(this.rot_x_element.element)),Object(v.z)(Object(v.x)({className:t},"Y:"),Object(v.u)(this.rot_y_element.element)),Object(v.z)(Object(v.x)({className:t},"Z:"),Object(v.u)(this.rot_z_element.element))),this.element.append(this.table_element,this.no_entity_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(Object(v.c)(this.table_element,"hidden",e.unavailable),this.no_entity_view.visible.bind_to(e.unavailable),Object(v.c)(this.type_element,"textContent",e.type),Object(v.c)(this.name_element,"textContent",e.name),Object(v.c)(this.section_id_element,"textContent",e.section_id),Object(v.c)(this.wave_element,"textContent",e.wave),Object(v.c)(this.wave_row_element,"hidden",e.wave_hidden),e.position.observe(({value:{x:e,y:t,z:i}})=>{this.pos_x_element.value.val=e,this.pos_y_element.value.val=t,this.pos_z_element.value.val=i},{call_now:!0}),e.rotation.observe(({value:{x:e,y:t,z:i}})=>{this.rot_x_element.value.val=F(e),this.rot_y_element.value.val=F(t),this.rot_z_element.value.val=F(i)},{call_now:!0}),this.pos_x_element.value.observe(({value:t})=>e.set_pos_x(t)),this.pos_y_element.value.observe(({value:t})=>e.set_pos_y(t)),this.pos_z_element.value.observe(({value:t})=>e.set_pos_z(t)),this.rot_x_element.value.observe(({value:t})=>e.set_rot_x(t)),this.rot_y_element.value.observe(({value:t})=>e.set_rot_y(t)),this.rot_z_element.value.observe(({value:t})=>e.set_rot_z(t)),this.enabled.bind_to(e.enabled)),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.pos_x_element.enabled.val=e,this.pos_y_element.enabled.val=e,this.pos_z_element.enabled.val=e,this.rot_x_element.enabled.val=e,this.rot_y_element.enabled.val=e,this.rot_z_element.enabled.val=e}}i("ZZ0G");class Ze extends o.a{constructor(e,t,i){super(),this.entity_image_renderer=t,this.entities=Object(M.c)(),this.create_entity_element=(e,t)=>{const i=Object(v.i)({className:"quest_editor_EntityListView_entity",data:{index:t.toString()}});i.draggable=!0;const o=Object(v.l)({width:100,height:100});o.style.visibility="hidden",o.style.pointerEvents="none",i.append(o),this.entity_image_renderer.render(e).then(e=>{o.src=e,o.style.visibility="visible"});const s=Object(v.r)(L(e).name);return i.append(s),i};const o=Object(v.i)({className:"quest_editor_EntityListView_entity_list"});this.element=Object(v.i)({className:`${i} quest_editor_EntityListView`,tabIndex:-1},o),this.disposables(Object(v.d)(o,this.entities,this.create_entity_element),function(e,t){function i(e){if(e.target instanceof HTMLElement){const i=t(e.target);i?(he.set(e.offsetX,e.offsetY),ue={drag_element:i[0],entity_type:i[1]},ue.drag_element.style.position="fixed",ue.drag_element.style.pointerEvents="none",ue.drag_element.style.zIndex="500",ue.drag_element.style.top="0",ue.drag_element.style.left="0",ue.drag_element.style.transform=`translate(${e.clientX-he.x}px, ${e.clientY-he.y}px)`,document.body.append(ue.drag_element),e.dataTransfer&&(e.dataTransfer.effectAllowed="copy",e.dataTransfer.setDragImage(Object(v.i)(),0,0),e.dataTransfer.setData("phantasmal-entity",L(ue.entity_type).name))):e.preventDefault()}}return e.addEventListener("dragstart",i),1==++pe&&(document.addEventListener("dragover",fe),document.addEventListener("dragend",me)),{dispose(){e.removeEventListener("dragstart",i),0==--pe&&(document.removeEventListener("dragover",fe),document.removeEventListener("dragend",me))}}}(o,e=>{if(!this.enabled.val)return;let t=e;do{const i=e.dataset.index;if(null!=i)return[t.querySelector("img").cloneNode(!0),this.entities.get(parseInt(i,10))];t=t.parentElement}while(t&&t!==o)}),this.enabled.bind_to(e.quest_runner.running.map(e=>!e)))}}class Je extends Ze{constructor(e,t){super(e,t,"quest_editor_NpcListView"),this.quest_editor_store=e,this.filter_npcs=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:r.b.I,o=t?t.id:0;this.entities.val=I.b.filter(e=>{const t=Object(I.d)(e);return(null==t.episode||t.episode===i)&&t.area_ids.includes(o)})},this.disposables(e.current_quest.observe(this.filter_npcs),e.current_area.observe(this.filter_npcs)),this.filter_npcs(),this.finalize_construction()}}class Xe extends Ze{constructor(e,t){super(e,t,"quest_editor_ObjectListView"),this.quest_editor_store=e,this.filter_objects=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:r.b.I,o=t?t.id:0;this.entities.val=j.filter(e=>{const t=x(e);if(null==t.area_ids)return!0;const s=t.area_ids[i];return s&&s.includes(o)})},this.disposables(e.current_quest.observe(this.filter_objects),e.current_area.observe(this.filter_objects)),this.filter_objects(),this.finalize_construction()}}i("RL+K");var et,tt=i("KVVN");!function(e){e[e.NodeAdded=0]="NodeAdded",e[e.NodeRemoved=1]="NodeRemoved",e[e.EdgeAdded=2]="EdgeAdded",e[e.EdgeRemoved=3]="EdgeRemoved"}(et||(et={}));class it{constructor(e){this.area_id=e,this._connected_sub_graphs=Object(M.c)(),this.meta=new Map,this.emitter=Object(M.a)(),this.events=[],this.connected_sub_graphs=this._connected_sub_graphs,Object(U.k)(e,"area_id")}observe(e){return this.emitter.observe(e)}get_index(e){return this.meta.get(e).index}get_sub_graph(e){return this.meta.get(e).sub_graph}get_children(e){return this.meta.get(e).children}get_parents(e){return this.meta.get(e).parents}add_event(e,t,i){this.remove_event(e);const o=this.events.length,s=Object(M.c)(void 0,e);this.meta.set(e,{index:o,sub_graph:s,children:[],parents:[]}),this.events.push(e),this._connected_sub_graphs.push(s);for(const i of t)this.add_edge(i,e);for(const t of i)this.add_edge(e,t);this.emit({type:et.NodeAdded,event:e})}insert_event(e,t,i,o){this.remove_event(t);const s=Object(M.c)(void 0,t);this.meta.set(t,{index:e,sub_graph:s,parents:[],children:[]}),this.events.splice(e,0,t);for(let t=e+1;ti.index);)e++;i.sub_graph=s,s.splice(e,0,t),e++}this._connected_sub_graphs.remove(n),n.clear()}this.emit({type:et.EdgeAdded,parent:e,child:t})}remove_edge(e,t){this.internal_remove_edge(e,this.meta.get(e),t,this.meta.get(t))}internal_remove_edge(e,t,i,o){if(t&&o){const s=t.children.indexOf(i);-1!==s&&t.children.splice(s,1);const n=o.parents.indexOf(e);-1!==n&&o.parents.splice(n,1);const r=new Set;if(!this.connected(e,i,r)){const e=Object(M.c)(void 0,...r);e.sort((e,t)=>this.meta.get(e).index-this.meta.get(t).index);for(const i of e)t.sub_graph.remove(i);this.insert_sub_graph(this.meta.get(e.get(0)).index,e),o.sub_graph=e}this.emit({type:et.EdgeRemoved,parent:e,child:i})}}connected(e,t,i){if(e===t)return!0;if(i.has(t))return!1;i.add(t);const o=this.meta.get(t);if(o){for(const t of o.children)if(this.connected(e,t,i))return!0;for(const t of o.parents)if(this.connected(e,t,i))return!0}return!1}insert_sub_graph(e,t){let i=0;for(;ie)break;i++}this._connected_sub_graphs.splice(i,0,t)}emit(e){this.emitter.emit({value:e})}}i("xqR9");var ot,st=i("uiJh");!function(e){e[e.SpawnNpcs=0]="SpawnNpcs",e[e.Unlock=1]="Unlock",e[e.Lock=2]="Lock"}(ot||(ot={}));const nt=Object(st.a)(ot);class rt{constructor(e,t){this.type=ot.SpawnNpcs,Object(U.k)(e,"section_id"),Object(U.k)(t,"appear_flag"),this.section_id=e,this.appear_flag=t}}class at{constructor(e){this.type=ot.Unlock,Object(U.k)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(U.k)(e,"door_id"),this._door_id.val=e}}class dt{constructor(e){this.type=ot.Lock,Object(U.k)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(U.k)(e,"door_id"),this._door_id.val=e}}i("CCCE");var ct=i("LSoc"),lt=i("QmPX");class _t extends lt.a{constructor(e){super(e),this.element=Object(v.i)({className:"core_DropDown"}),this.button_mousedown=()=>{this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0},this.button_mouseup=()=>{this.just_opened?this.menu.focus():this.menu.visible.val=!1,this.just_opened=!1},this.button_keydown=({value:e})=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0,this.menu.focus(),this.menu.hover_next())},this.button=this.disposable(new tt.a({text:e.text,icon_left:e&&e.icon_left,icon_right:v.a.TriangleDown})),this.menu=this.disposable(new ct.a({items:e.items,to_label:e.to_label,related_element:this.element})),this.element.append(this.button.element,this.menu.element),this._chosen=Object(M.a)(),this.chosen=this._chosen,this.just_opened=!1,this.disposables(Object(v.h)(this.button.element,"mousedown",this.button_mousedown,{capture:!0}),this.button.mouseup.observe(this.button_mouseup),this.button.keydown.observe(this.button_keydown),this.menu.selected.observe(({value:e})=>{void 0!==e&&(this._chosen.emit({value:e}),this.menu.selected.val=void 0)})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.button.enabled.val=e}}class ut extends p.a{constructor(e,t){super(),this.ctrl=e,this.event=t,this.inputs_enabled=Object(M.e)(!0),this.create_action_element=e=>{const t=new d.a;let i,o;if(e.type===ot.SpawnNpcs)i="Spawn:",o=Object(v.i)(Object(v.i)(t.add(new a.a(e.section_id,{min:0,step:1,enabled:!1})).element),Object(v.i)(t.add(new a.a(e.appear_flag,{min:0,step:1,enabled:!1})).element));else{i=e.type===ot.Unlock?"Unlock:":"Lock:";const s=t.add(new a.a(e.door_id.val,{min:0,step:1,enabled:this.inputs_enabled}));o=s.element,t.add_all(s.value.bind_to(e.door_id),s.value.observe(({value:t})=>e.set_door_id(t)))}const s=t.add(new tt.a({icon_left:v.a.Remove}));return t.add_all(s.click.observe(()=>this.ctrl.remove_action(this.event,e))),[Object(v.z)(Object(v.x)(i),Object(v.u)(o),Object(v.u)(s.element)),t]};const i=document.createTextNode(t.wave.id.val.toString());this.delay_input=this.disposable(new a.a(t.delay.val,{min:0,step:1,enabled:this.inputs_enabled}));const o=Object(v.s)({className:"quest_editor_EventView_actions"}),s=this.disposable(new _t({text:"Add action",items:nt,to_label(e){switch(e){case ot.SpawnNpcs:return"Spawn NPCs";case ot.Unlock:return"Unlock door";case ot.Lock:return"Lock door"}}}));this.element=Object(v.i)({tabIndex:0},Object(v.s)(Object(v.z)(Object(v.x)("ID:"),Object(v.u)(t.id.toString())),Object(v.z)(Object(v.x)("Section:"),Object(v.u)(t.section_id.toString())),Object(v.z)(Object(v.x)("Wave:"),Object(v.u)(i)),Object(v.z)(Object(v.x)("Delay:"),Object(v.u)(this.delay_input.element)),Object(v.z)(Object(v.x)({colSpan:2},"Actions:")),Object(v.z)(Object(v.u)({colSpan:2},o)),Object(v.z)(Object(v.u)({colSpan:2},s.element)))),this.disposables(Object(v.c)(this.element,"className",e.is_selected(t).map(e=>`quest_editor_EventView ${e?"selected":""}`)),t.wave.id.observe(({value:e})=>i.data=e.toString()),Object(v.h)(this.element,"focus",()=>{e.set_selected_wave(t.wave)}),Object(v.h)(this.element,"click",i=>{i.stopPropagation(),e.set_selected_wave(t.wave)}),Object(v.h)(this.element,"keyup",i=>{"Delete"===i.key&&e.remove_event(t)}),this.delay_input.value.bind_to(t.delay),this.delay_input.value.observe(i=>e.set_delay(t,i.value)),Object(v.d)(o,t.actions,this.create_action_element),s.chosen.observe(({value:i})=>e.add_action(t,i))),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.inputs_enabled.val=e}}i("CGbB");const vt=X.c.get("quest_editor/gui/EventSubGraphView"),ht=8,pt=20;class gt extends p.a{constructor(e,t,i,o){super(),this.ctrl=e,this.dag=t,this.sub_graph=i,this.max_edge_depth=o,this.event_gui_data=new Map,this.event_container_element=Object(v.i)({className:"quest_editor_EventSubGraphView_event_container"}),this.edge_container_element=Object(v.i)({className:"quest_editor_EventSubGraphView_edge_container"}),this.element=Object(v.i)({className:"quest_editor_EventSubGraphView"},this.edge_container_element,this.event_container_element),this.update_edges=()=>{if(this.edge_container_element.innerHTML="",0===this.sub_graph.length.val)return;const e=Array(this.sub_graph.length.val-1);for(let t=0;ts,h=Math.min(s,a),p=Math.max(s,a);e:for(;;){for(let t=u?h:Math.max(0,h-1);t{const i=new d.a,o=i.add(new ut(this.ctrl,e));return this.event_gui_data.set(e,{event_view:o,position:t}),i.add({dispose:()=>this.event_gui_data.delete(e)}),[o.element,i]},this.after_events_changed=e=>{e.type===J.a.ListChange&&(this.sub_graph.val.forEach((e,t)=>{this.event_gui_data.get(e).position=t}),this.update_edges())},this.disposables(o.observe(({value:e})=>{this.element.style.marginLeft=`${ht*e}px`},{call_now:!0}),Object(v.d)(this.event_container_element,i,this.create_event_element,{after:this.after_events_changed}),t.observe(({value:e})=>{e.type!==et.EdgeAdded&&e.type!==et.EdgeRemoved||this.update_edges()})),this.finalize_construction()}set_enabled(e){super.set_enabled(e);for(const{event_view:t}of this.event_gui_data.values())t.enabled.val=e}}class bt extends o.a{constructor(e){super(),this.ctrl=e,this.sub_graph_views=new Map,this.unavailable_view=new b("No quest loaded."),this.max_edge_depth=Object(M.e)(0),this.create_sub_graph_element=e=>{let t=this.sub_graph_views.get(e);return t||(t=new gt(this.ctrl,this.ctrl.event_dag.val,e,this.max_edge_depth),this.sub_graph_views.set(e,t)),t.element},this.update_edges=()=>{for(const e of this.sub_graph_views.values())e.element.parentNode&&e.update_edges()},this.after_event_dags_changed=e=>{var t;if(e.type===J.a.ListChange)for(const i of e.inserted)null===(t=this.sub_graph_views.get(i))||void 0===t||t.update_edges()},this.element=Object(v.i)({className:"quest_editor_EventsView",tabIndex:-1},this.container_element=Object(v.i)({className:"quest_editor_EventsView_container"},this.disposable(new Ue.a(this.add_event_button=new tt.a({text:"Add event"}))).element,this.dag_container_element=Object(v.i)({className:"quest_editor_EventsView_sub_graph_container"})),this.unavailable_view.element),this.disposables(Object(v.c)(this.container_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),this.enabled.bind_to(e.enabled),this.add_event_button.click.observe(e.add_event),Object(v.d)(this.dag_container_element,e.event_sub_graphs,this.create_sub_graph_element,{after:this.after_event_dags_changed}),Object(v.h)(this.element,"focus",()=>{e.focused()}),Object(v.h)(this.element,"click",()=>{e.set_selected_wave(void 0)})),this.finalize_construction()}dispose(){super.dispose();for(const e of this.sub_graph_views.values())e.dispose();this.sub_graph_views.clear()}resize(e,t){return super.resize(e,t),this.update_edges(),this}focus(){super.focus(),this.update_edges()}set_enabled(e){super.set_enabled(e);for(const t of this.sub_graph_views.values())t.element.parentNode&&(t.enabled.val=e)}}var ft;!function(e){e[e.Any=0]="Any",e[e.Byte=1]="Byte",e[e.Word=2]="Word",e[e.DWord=3]="DWord",e[e.Float=4]="Float",e[e.Label=5]="Label",e[e.ILabel=6]="ILabel",e[e.DLabel=7]="DLabel",e[e.SLabel=8]="SLabel",e[e.String=9]="String",e[e.ILabelVar=10]="ILabelVar",e[e.RegRef=11]="RegRef",e[e.RegTupRef=12]="RegTupRef",e[e.RegRefVar=13]="RegRefVar",e[e.Pointer=14]="Pointer"}(ft||(ft={}));const mt={kind:ft.Any},wt={kind:ft.Byte},kt={kind:ft.Word},yt={kind:ft.DWord},Rt={kind:ft.Float},It={kind:ft.Label},jt={kind:ft.ILabel},xt={kind:ft.DLabel},Tt={kind:ft.SLabel},St={kind:ft.String},Ct={kind:ft.ILabelVar},Ot={kind:ft.RegRef},Lt={kind:ft.RegRefVar},Pt={kind:ft.Pointer},Dt=-Math.pow(2,31),Bt=Math.pow(2,31)-1;Math.pow(2,32);var Et,Mt;function Wt(e,t,i){return{type:e,doc:t,access:i}}!function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(Et||(Et={})),function(e){e[e.Push=0]="Push",e[e.Pop=1]="Pop"}(Mt||(Mt={}));const qt=[],Ft=new Map;function zt(e,t,i,o,s){return{code:e,mnemonic:t,doc:i,size:e<256?1:2,params:o,stack:s}}const Vt=qt[0]=zt(0,"nop","No operation, does nothing.",[],void 0),Ut=qt[1]=zt(1,"ret","Returns control to caller.",[],void 0),$t=qt[2]=zt(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),Nt=qt[3]=zt(3,"exit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),At=qt[4]=zt(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[Wt(jt,void 0,void 0)],void 0),Ht=qt[5]=zt(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),Gt=qt[6]=zt(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),Yt=qt[7]=zt(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[Wt(jt,void 0,void 0)],void 0),Kt=qt[8]=zt(8,"let","Sets the first register's value to second one's value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),Qt=qt[9]=zt(9,"leti","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),Zt=qt[10]=zt(10,"letb","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(wt,void 0,void 0)],void 0),Jt=qt[11]=zt(11,"letw","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0),Wt(kt,void 0,void 0)],void 0),Xt=qt[12]=zt(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),ei=(qt[13]=zt(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt(It,void 0,void 0)],void 0),qt[14]=zt(14,"unknown_0e",void 0,[],void 0),qt[15]=zt(15,"unknown_0f",void 0,[],void 0),qt[16]=zt(16,"set","Sets a register to 1.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ti=qt[17]=zt(17,"clear","Sets a register to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),ii=qt[18]=zt(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.ReadWrite)]},void 0,void 0)],void 0),oi=(qt[19]=zt(19,"gset",void 0,[Wt(kt,void 0,void 0)],void 0),qt[20]=zt(20,"gclear",void 0,[Wt(kt,void 0,void 0)],void 0),qt[21]=zt(21,"grev",void 0,[Wt(kt,void 0,void 0)],void 0),qt[22]=zt(22,"glet",void 0,[Wt(kt,void 0,void 0)],void 0),qt[23]=zt(23,"gget","Sets a register to value of the given flag.",[Wt(kt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[24]=zt(24,"add",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),si=qt[25]=zt(25,"addi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ni=qt[26]=zt(26,"sub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ri=qt[27]=zt(27,"subi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ai=qt[28]=zt(28,"mul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),di=qt[29]=zt(29,"muli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ci=qt[30]=zt(30,"div",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),li=qt[31]=zt(31,"divi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),_i=qt[32]=zt(32,"and",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ui=qt[33]=zt(33,"andi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),vi=qt[34]=zt(34,"or",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),hi=qt[35]=zt(35,"ori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),pi=qt[36]=zt(36,"xor",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),gi=qt[37]=zt(37,"xori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),bi=qt[38]=zt(38,"mod",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),fi=qt[39]=zt(39,"modi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),mi=qt[40]=zt(40,"jmp",void 0,[Wt(jt,void 0,void 0)],void 0),wi=qt[41]=zt(41,"call",void 0,[Wt(jt,void 0,void 0)],void 0),ki=qt[42]=zt(42,"jmp_on",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),yi=qt[43]=zt(43,"jmp_off",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),Ri=qt[44]=zt(44,"jmp_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ii=qt[45]=zt(45,"jmpi_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),ji=qt[46]=zt(46,"jmp_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),xi=qt[47]=zt(47,"jmpi_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ti=qt[48]=zt(48,"ujmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Si=qt[49]=zt(49,"ujmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ci=qt[50]=zt(50,"jmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Oi=qt[51]=zt(51,"jmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Li=qt[52]=zt(52,"ujmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Pi=qt[53]=zt(53,"ujmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Di=qt[54]=zt(54,"jmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Bi=qt[55]=zt(55,"jmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ei=qt[56]=zt(56,"ujmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Mi=qt[57]=zt(57,"ujmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Wi=qt[58]=zt(58,"jmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),qi=qt[59]=zt(59,"jmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Fi=qt[60]=zt(60,"ujmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),zi=qt[61]=zt(61,"ujmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Vi=qt[62]=zt(62,"jmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ui=qt[63]=zt(63,"jmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),$i=qt[64]=zt(64,"switch_jmp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),Ni=qt[65]=zt(65,"switch_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),Ai=qt[66]=zt(66,"stack_push",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),Hi=qt[67]=zt(67,"stack_pop",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),Gi=qt[68]=zt(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[Wt(Ot,void 0,Et.Read),Wt(yt,void 0,void 0)],void 0),Yi=qt[69]=zt(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[Wt(Ot,void 0,Et.Write),Wt(yt,void 0,void 0)],void 0),Ki=(qt[70]=zt(70,"unknown_46",void 0,[],void 0),qt[71]=zt(71,"unknown_47",void 0,[],void 0),qt[72]=zt(72,"arg_pushr","Pushes the value of the given register onto the stack.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push)),Qi=qt[73]=zt(73,"arg_pushl","Pushes the given value onto the stack.",[Wt(yt,void 0,void 0)],Mt.Push),Zi=qt[74]=zt(74,"arg_pushb","Pushes the given value onto the stack.",[Wt(wt,void 0,void 0)],Mt.Push),Ji=qt[75]=zt(75,"arg_pushw","Pushes the given value onto the stack.",[Wt(kt,void 0,void 0)],Mt.Push),Xi=qt[76]=zt(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push),eo=qt[77]=zt(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[Wt(It,void 0,void 0)],Mt.Push),to=qt[78]=zt(78,"arg_pushs","Pushes the given value onto the stack.",[Wt(St,void 0,void 0)],Mt.Push),io=(qt[79]=zt(79,"unknown_4f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[80]=zt(80,"message",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[81]=zt(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop)),oo=(qt[82]=zt(82,"fadein",void 0,[],void 0),qt[83]=zt(83,"fadeout",void 0,[],void 0),qt[84]=zt(84,"se",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[85]=zt(85,"bgm",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[86]=zt(86,"unknown_56",void 0,[],void 0),qt[87]=zt(87,"unknown_57",void 0,[],void 0),qt[88]=zt(88,"enable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[89]=zt(89,"disable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[90]=zt(90,"window_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop)),so=qt[91]=zt(91,"add_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),no=(qt[92]=zt(92,"mesend",void 0,[],void 0),qt[93]=zt(93,"gettime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ro=qt[94]=zt(94,"winend",void 0,[],void 0),ao=(qt[95]=zt(95,"unknown_5f",void 0,[],void 0),qt[96]=zt(96,"npc_crt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[97]=zt(97,"npc_stop",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[98]=zt(98,"npc_play",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[99]=zt(99,"npc_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[100]=zt(100,"npc_nont",void 0,[],void 0),qt[101]=zt(101,"npc_talk",void 0,[],void 0),qt[102]=zt(102,"npc_crp_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(jt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[103]=zt(103,"unknown_67",void 0,[],void 0),qt[104]=zt(104,"create_pipe",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[105]=zt(105,"p_hpstat_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[106]=zt(106,"p_dead_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0)],Mt.Pop)),co=(qt[107]=zt(107,"p_disablewarp",void 0,[],void 0),qt[108]=zt(108,"p_enablewarp",void 0,[],void 0),qt[109]=zt(109,"p_move_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[110]=zt(110,"p_look",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[111]=zt(111,"unknown_6f",void 0,[],void 0),qt[112]=zt(112,"p_action_disable",void 0,[],void 0),qt[113]=zt(113,"p_action_enable",void 0,[],void 0),qt[114]=zt(114,"disable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[115]=zt(115,"enable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[116]=zt(116,"p_noncol",void 0,[],void 0),qt[117]=zt(117,"p_col",void 0,[],void 0),qt[118]=zt(118,"p_setpos","Sets a player's position.",[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Y-axis rotation.",Et.Read)]},void 0,void 0)],Mt.Pop),qt[119]=zt(119,"p_return_guild",void 0,[],void 0),qt[120]=zt(120,"p_talk_guild",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[121]=zt(121,"npc_talk_pl_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[122]=zt(122,"npc_talk_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[123]=zt(123,"npc_crtpk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[124]=zt(124,"npc_crppk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[125]=zt(125,"npc_crptalk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[126]=zt(126,"p_look_at_v1",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[127]=zt(127,"npc_crp_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[128]=zt(128,"cam_quake",void 0,[],void 0),qt[129]=zt(129,"cam_adj",void 0,[],void 0),qt[130]=zt(130,"cam_zmin",void 0,[],void 0),qt[131]=zt(131,"cam_zmout",void 0,[],void 0),qt[132]=zt(132,"cam_pan_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[133]=zt(133,"game_lev_super",void 0,[],void 0),qt[134]=zt(134,"game_lev_reset",void 0,[],void 0),qt[135]=zt(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[136]=zt(136,"if_zone_clear",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),lo=(qt[137]=zt(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[138]=zt(138,"unhide_obj",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[139]=zt(139,"unhide_ene",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[140]=zt(140,"at_coords_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[141]=zt(141,"at_coords_talk",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[142]=zt(142,"col_npcin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[143]=zt(143,"col_npcinr",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[144]=zt(144,"switch_on",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[145]=zt(145,"switch_off",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[146]=zt(146,"playbgm_epi",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[147]=zt(147,"set_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[148]=zt(148,"set_obj_param","Creates a targetable object.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Collision radius.",Et.Read),Wt(jt,"Function label.",Et.Read),Wt(yt,"Vertical position of the cursor.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},"Object handle.",void 0)],void 0),qt[149]=zt(149,"set_floor_handler",void 0,[Wt(yt,"Floor number.",void 0),Wt(jt,"Handler function label.",void 0)],Mt.Pop)),_o=(qt[150]=zt(150,"clr_floor_handler",void 0,[Wt(yt,"Floor number.",void 0)],Mt.Pop),qt[151]=zt(151,"col_plinaw",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[152]=zt(152,"hud_hide",void 0,[],void 0),qt[153]=zt(153,"hud_show",void 0,[],void 0),qt[154]=zt(154,"cine_enable",void 0,[],void 0),qt[155]=zt(155,"cine_disable",void 0,[],void 0),qt[156]=zt(156,"unknown_9c",void 0,[],void 0),qt[157]=zt(157,"unknown_9d",void 0,[],void 0),qt[158]=zt(158,"unknown_9e",void 0,[],void 0),qt[159]=zt(159,"unknown_9f",void 0,[],void 0),qt[160]=zt(160,"unknown_a0",void 0,[],void 0),qt[161]=zt(161,"set_qt_failure",void 0,[Wt(jt,void 0,void 0)],void 0),qt[162]=zt(162,"set_qt_success",void 0,[Wt(jt,void 0,void 0)],void 0),qt[163]=zt(163,"clr_qt_failure",void 0,[],void 0),qt[164]=zt(164,"clr_qt_success",void 0,[],void 0),qt[165]=zt(165,"set_qt_cancel",void 0,[Wt(jt,void 0,void 0)],void 0),qt[166]=zt(166,"clr_qt_cancel",void 0,[],void 0),qt[167]=zt(167,"unknown_a7",void 0,[],void 0),qt[168]=zt(168,"pl_walk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[169]=zt(169,"unknown_a9",void 0,[],void 0),qt[170]=zt(170,"unknown_aa",void 0,[],void 0),qt[171]=zt(171,"unknown_ab",void 0,[],void 0),qt[172]=zt(172,"unknown_ac",void 0,[],void 0),qt[173]=zt(173,"unknown_ad",void 0,[],void 0),qt[174]=zt(174,"unknown_ae",void 0,[],void 0),qt[175]=zt(175,"unknown_af",void 0,[],void 0),qt[176]=zt(176,"pl_add_meseta",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[177]=zt(177,"thread_stg",void 0,[Wt(jt,void 0,void 0)],void 0)),uo=(qt[178]=zt(178,"del_obj_param",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},"Object handle.",void 0)],void 0),qt[179]=zt(179,"item_create",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[180]=zt(180,"item_create2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[181]=zt(181,"item_delete",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[182]=zt(182,"item_delete2","Deletes an item from the player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[183]=zt(183,"item_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[184]=zt(184,"setevt",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[185]=zt(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),vo=(qt[186]=zt(186,"set_qt_exit",void 0,[Wt(jt,void 0,void 0)],void 0),qt[187]=zt(187,"clr_qt_exit",void 0,[],void 0),qt[188]=zt(188,"unknown_bc",void 0,[],void 0),qt[189]=zt(189,"unknown_bd",void 0,[],void 0),qt[190]=zt(190,"unknown_be",void 0,[],void 0),qt[191]=zt(191,"unknown_bf",void 0,[],void 0),qt[192]=zt(192,"particle_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[193]=zt(193,"npc_text",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[194]=zt(194,"npc_chkwarp",void 0,[],void 0),qt[195]=zt(195,"pl_pkoff",void 0,[],void 0),qt[196]=zt(196,"map_designate",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[197]=zt(197,"masterkey_on",void 0,[],void 0),qt[198]=zt(198,"masterkey_off",void 0,[],void 0),qt[199]=zt(199,"window_time",void 0,[],void 0),qt[200]=zt(200,"winend_time",void 0,[],void 0),qt[201]=zt(201,"winset_time",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[202]=zt(202,"getmtime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[203]=zt(203,"set_quest_board_handler",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[204]=zt(204,"clear_quest_board_handler",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[205]=zt(205,"particle_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[206]=zt(206,"npc_crptalk_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[207]=zt(207,"npc_lang_clean",void 0,[],void 0),qt[208]=zt(208,"pl_pkon",void 0,[],void 0),qt[209]=zt(209,"pl_chk_item2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[210]=zt(210,"enable_mainmenu",void 0,[],void 0),qt[211]=zt(211,"disable_mainmenu",void 0,[],void 0),qt[212]=zt(212,"start_battlebgm",void 0,[],void 0),qt[213]=zt(213,"end_battlebgm",void 0,[],void 0),qt[214]=zt(214,"disp_msg_qb",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[215]=zt(215,"close_msg_qb",void 0,[],void 0),qt[216]=zt(216,"set_eventflag_v3",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[217]=zt(217,"sync_leti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0)),ho=(qt[218]=zt(218,"set_returnhunter",void 0,[],void 0),qt[219]=zt(219,"set_returncity",void 0,[],void 0),qt[220]=zt(220,"load_pvr",void 0,[],void 0),qt[221]=zt(221,"load_midi",void 0,[],void 0),qt[222]=zt(222,"unknown_de",void 0,[],void 0),qt[223]=zt(223,"npc_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[224]=zt(224,"pad_dragon",void 0,[],void 0),qt[225]=zt(225,"clear_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[226]=zt(226,"pcam_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[227]=zt(227,"start_setevt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[228]=zt(228,"warp_on",void 0,[],void 0),qt[229]=zt(229,"warp_off",void 0,[],void 0),qt[230]=zt(230,"get_slotnumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),po=(qt[231]=zt(231,"get_servernumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[232]=zt(232,"set_eventflag2",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[233]=zt(233,"res",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[234]=zt(234,"unknown_ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),qt[235]=zt(235,"enable_bgmctrl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[236]=zt(236,"sw_send",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[237]=zt(237,"create_bgmctrl",void 0,[],void 0),qt[238]=zt(238,"pl_add_meseta2",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[239]=zt(239,"sync_register",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[240]=zt(240,"send_regwork",void 0,[],void 0),qt[241]=zt(241,"leti_fixed_camera_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[242]=zt(242,"default_camera_pos1",void 0,[],void 0),qt[243]=zt(243,"unknown_f3",void 0,[],void 0),qt[244]=zt(244,"unknown_f4",void 0,[],void 0),qt[245]=zt(245,"unknown_f5",void 0,[],void 0),qt[246]=zt(246,"unknown_f6",void 0,[],void 0),qt[247]=zt(247,"unknown_f7",void 0,[],void 0),qt[248]=zt(248,"unknown_f8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[249]=zt(249,"unknown_f9",void 0,[],void 0),qt[250]=zt(250,"get_gc_number",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[251]=zt(251,"unknown_fb",void 0,[Wt(kt,void 0,void 0)],void 0),qt[252]=zt(252,"unknown_fc",void 0,[],void 0),qt[253]=zt(253,"unknown_fd",void 0,[],void 0),qt[254]=zt(254,"unknown_fe",void 0,[],void 0),qt[255]=zt(255,"unknown_ff",void 0,[],void 0),qt[63488]=zt(63488,"unknown_f800",void 0,[],void 0),qt[63489]=zt(63489,"set_chat_callback",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63490]=zt(63490,"unknown_f802",void 0,[],void 0),qt[63491]=zt(63491,"unknown_f803",void 0,[],void 0),qt[63492]=zt(63492,"unknown_f804",void 0,[],void 0),qt[63493]=zt(63493,"unknown_f805",void 0,[],void 0),qt[63494]=zt(63494,"unknown_f806",void 0,[],void 0),qt[63495]=zt(63495,"unknown_f807",void 0,[],void 0),qt[63496]=zt(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63497]=zt(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63498]=zt(63498,"get_coord_of_player","Retrieves a player's position.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Write),Wt(yt,"Y coordinate.",Et.Write),Wt(yt,"Z coordinate.",Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63499]=zt(63499,"enable_map",void 0,[],void 0),qt[63500]=zt(63500,"disable_map",void 0,[],void 0),qt[63501]=zt(63501,"map_designate_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63502]=zt(63502,"unknown_f80e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63503]=zt(63503,"unknown_f80f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63504]=zt(63504,"ba_initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63505]=zt(63505,"set_ba_rules",void 0,[],void 0),qt[63506]=zt(63506,"unknown_f812",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63507]=zt(63507,"unknown_f813",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63508]=zt(63508,"unknown_f814",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63509]=zt(63509,"unknown_f815",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63510]=zt(63510,"unknown_f816",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63511]=zt(63511,"unknown_f817",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63512]=zt(63512,"unknown_f818",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63513]=zt(63513,"unknown_f819",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63514]=zt(63514,"unknown_f81a",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63515]=zt(63515,"unknown_f81b",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63516]=zt(63516,"ba_disp_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63517]=zt(63517,"death_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63518]=zt(63518,"death_tech_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63519]=zt(63519,"unknown_f81f",void 0,[],void 0),qt[63520]=zt(63520,"cmode_stage",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63521]=zt(63521,"unknown_f821",void 0,[],void 0),qt[63522]=zt(63522,"unknown_f822",void 0,[],void 0),qt[63523]=zt(63523,"unknown_f823",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63524]=zt(63524,"unknown_f824",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63525]=zt(63525,"exp_multiplication",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63526]=zt(63526,"exp_division",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63527]=zt(63527,"get_user_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63528]=zt(63528,"go_floor","Sends a player to the given floor.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read)]},void 0,void 0)],void 0),qt[63529]=zt(63529,"unknown_f829",void 0,[],void 0),qt[63530]=zt(63530,"unknown_f82a",void 0,[],void 0),qt[63531]=zt(63531,"unlock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63532]=zt(63532,"lock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63533]=zt(63533,"if_switch_not_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63534]=zt(63534,"if_switch_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read),Wt(yt,"Switch ID.",Et.Read),Wt(yt,"Will be set to 1 if the switch is pressed, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63535]=zt(63535,"unknown_f82f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63536]=zt(63536,"control_dragon",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63537]=zt(63537,"release_dragon",void 0,[],void 0),qt[63538]=zt(63538,"unknown_f832",void 0,[],void 0),qt[63539]=zt(63539,"unknown_f833",void 0,[],void 0),qt[63540]=zt(63540,"unknown_f834",void 0,[],void 0),qt[63541]=zt(63541,"unknown_f835",void 0,[],void 0),qt[63542]=zt(63542,"unknown_f836",void 0,[],void 0),qt[63543]=zt(63543,"unknown_f837",void 0,[],void 0),qt[63544]=zt(63544,"shrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63545]=zt(63545,"unshrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63546]=zt(63546,"unknown_f83a",void 0,[],void 0),qt[63547]=zt(63547,"unknown_f83b",void 0,[],void 0),qt[63548]=zt(63548,"display_clock2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63549]=zt(63549,"unknown_f83d",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63550]=zt(63550,"delete_area_title",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63551]=zt(63551,"unknown_f83f",void 0,[],void 0),qt[63552]=zt(63552,"load_npc_data",void 0,[],void 0),qt[63553]=zt(63553,"get_npc_data",void 0,[Wt(xt,void 0,void 0)],void 0),qt[63554]=zt(63554,"unknown_f842",void 0,[],void 0),qt[63555]=zt(63555,"unknown_f843",void 0,[],void 0),qt[63556]=zt(63556,"unknown_f844",void 0,[],void 0),qt[63557]=zt(63557,"unknown_f845",void 0,[],void 0),qt[63558]=zt(63558,"unknown_f846",void 0,[],void 0),qt[63559]=zt(63559,"unknown_f847",void 0,[],void 0),qt[63560]=zt(63560,"give_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63561]=zt(63561,"take_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63562]=zt(63562,"unk_score_f84a",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63563]=zt(63563,"unk_score_f84b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63564]=zt(63564,"kill_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63565]=zt(63565,"death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63566]=zt(63566,"unk_score_f84e",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63567]=zt(63567,"enemy_death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63568]=zt(63568,"meseta_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63569]=zt(63569,"unknown_f851",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63570]=zt(63570,"unknown_f852",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63571]=zt(63571,"reverse_warps",void 0,[],void 0),qt[63572]=zt(63572,"unreverse_warps",void 0,[],void 0),qt[63573]=zt(63573,"set_ult_map",void 0,[],void 0),qt[63574]=zt(63574,"unset_ult_map",void 0,[],void 0),qt[63575]=zt(63575,"set_area_title",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63576]=zt(63576,"unknown_f858",void 0,[],void 0),qt[63577]=zt(63577,"unknown_f859",void 0,[],void 0),qt[63578]=zt(63578,"equip_item",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63579]=zt(63579,"unequip_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63580]=zt(63580,"unknown_f85c",void 0,[],void 0),qt[63581]=zt(63581,"unknown_f85d",void 0,[],void 0),qt[63582]=zt(63582,"unknown_f85e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63583]=zt(63583,"unknown_f85f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63584]=zt(63584,"unknown_f860",void 0,[],void 0),qt[63585]=zt(63585,"unknown_f861",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63586]=zt(63586,"unknown_f862",void 0,[],void 0),qt[63587]=zt(63587,"unknown_f863",void 0,[],void 0),qt[63588]=zt(63588,"cmode_rank",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63589]=zt(63589,"award_item_name",void 0,[],void 0),qt[63590]=zt(63590,"award_item_select",void 0,[],void 0),qt[63591]=zt(63591,"award_item_give_to",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63592]=zt(63592,"unknown_f868",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63593]=zt(63593,"unknown_f869",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63594]=zt(63594,"item_create_cmode",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63595]=zt(63595,"unknown_f86b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63596]=zt(63596,"award_item_ok",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63597]=zt(63597,"unknown_f86d",void 0,[],void 0),qt[63598]=zt(63598,"unknown_f86e",void 0,[],void 0),qt[63599]=zt(63599,"ba_set_lives",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63600]=zt(63600,"ba_set_tech_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63601]=zt(63601,"ba_set_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63602]=zt(63602,"ba_set_time_limit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63603]=zt(63603,"boss_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63604]=zt(63604,"unknown_f874",void 0,[],void 0),qt[63605]=zt(63605,"unknown_f875",void 0,[],void 0),qt[63606]=zt(63606,"unknown_f876",void 0,[],void 0),qt[63607]=zt(63607,"enable_techs","Enables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63608]=zt(63608,"disable_techs","Disables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63609]=zt(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player gender.",Et.Write)]},void 0,void 0)],void 0),qt[63610]=zt(63610,"get_chara_class","Retrieves the player's race and character class.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player race. 0 If human, 1 if newman, 2 if cast.",Et.Write),Wt(yt,"Player class. 0 If hunter, 1 if ranger, 2 if force.",Et.Write)]},void 0,void 0)],void 0),qt[63611]=zt(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,"Amount of meseta to take.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Will be set to 1 if the meseta was taken, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63612]=zt(63612,"unknown_f87c",void 0,[],void 0),qt[63613]=zt(63613,"unknown_f87d",void 0,[],void 0),qt[63614]=zt(63614,"unknown_f87e",void 0,[],void 0),qt[63615]=zt(63615,"read_guildcard_flag",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63616]=zt(63616,"unknown_f880",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63617]=zt(63617,"get_pl_name","Sets the value of to the given player's name.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63618]=zt(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63619]=zt(63619,"unknown_f883",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63620]=zt(63620,"unknown_f884",void 0,[],void 0),qt[63621]=zt(63621,"unknown_f885",void 0,[],void 0),qt[63622]=zt(63622,"unknown_f886",void 0,[],void 0),qt[63623]=zt(63623,"unknown_f887",void 0,[],void 0),qt[63624]=zt(63624,"unknown_f888",void 0,[],void 0),qt[63625]=zt(63625,"unknown_f889",void 0,[],void 0),qt[63626]=zt(63626,"get_player_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63627]=zt(63627,"send_mail",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63628]=zt(63628,"online_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63629]=zt(63629,"chl_set_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63630]=zt(63630,"chl_get_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63631]=zt(63631,"unknown_f88f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63632]=zt(63632,"unknown_f890",void 0,[],void 0),qt[63633]=zt(63633,"load_enemy_data",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63634]=zt(63634,"get_physical_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63635]=zt(63635,"get_attack_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63636]=zt(63636,"get_resist_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63637]=zt(63637,"get_movement_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63638]=zt(63638,"unknown_f896",void 0,[],void 0),qt[63639]=zt(63639,"unknown_f897",void 0,[],void 0),qt[63640]=zt(63640,"shift_left",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),go=qt[63641]=zt(63641,"shift_right",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),bo=qt[63642]=zt(63642,"get_random",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),fo=(qt[63643]=zt(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),qt[63644]=zt(63644,"disp_chl_retry_menu",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63645]=zt(63645,"chl_reverser",void 0,[],void 0),qt[63646]=zt(63646,"unknown_f89e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63647]=zt(63647,"unknown_f89f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63648]=zt(63648,"unknown_f8a0",void 0,[],void 0),qt[63649]=zt(63649,"unknown_f8a1",void 0,[],void 0),qt[63650]=zt(63650,"unknown_f8a2",void 0,[],void 0),qt[63651]=zt(63651,"unknown_f8a3",void 0,[],void 0),qt[63652]=zt(63652,"unknown_f8a4",void 0,[],void 0),qt[63653]=zt(63653,"unknown_f8a5",void 0,[],void 0),qt[63654]=zt(63654,"unknown_f8a6",void 0,[],void 0),qt[63655]=zt(63655,"unknown_f8a7",void 0,[],void 0),qt[63656]=zt(63656,"unknown_f8a8",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63657]=zt(63657,"unknown_f8a9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63658]=zt(63658,"unknown_f8aa",void 0,[],void 0),qt[63659]=zt(63659,"unknown_f8ab",void 0,[],void 0),qt[63660]=zt(63660,"unknown_f8ac",void 0,[],void 0),qt[63661]=zt(63661,"get_number_of_player2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63662]=zt(63662,"unknown_f8ae",void 0,[],void 0),qt[63663]=zt(63663,"unknown_f8af",void 0,[],void 0),qt[63664]=zt(63664,"unknown_f8b0",void 0,[],void 0),qt[63665]=zt(63665,"unknown_f8b1",void 0,[],void 0),qt[63666]=zt(63666,"unknown_f8b2",void 0,[],void 0),qt[63667]=zt(63667,"unknown_f8b3",void 0,[],void 0),qt[63668]=zt(63668,"unknown_f8b4",void 0,[],void 0),qt[63669]=zt(63669,"unknown_f8b5",void 0,[],void 0),qt[63670]=zt(63670,"unknown_f8b6",void 0,[],void 0),qt[63671]=zt(63671,"unknown_f8b7",void 0,[],void 0),qt[63672]=zt(63672,"unknown_f8b8",void 0,[],void 0),qt[63673]=zt(63673,"chl_recovery",void 0,[],void 0),qt[63674]=zt(63674,"unknown_f8ba",void 0,[],void 0),qt[63675]=zt(63675,"unknown_f8bb",void 0,[],void 0),qt[63676]=zt(63676,"set_episode",void 0,[Wt(yt,void 0,void 0)],void 0)),mo=(qt[63677]=zt(63677,"unknown_f8bd",void 0,[],void 0),qt[63678]=zt(63678,"unknown_f8be",void 0,[],void 0),qt[63679]=zt(63679,"unknown_f8bf",void 0,[],void 0),qt[63680]=zt(63680,"file_dl_req",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63681]=zt(63681,"get_dl_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63682]=zt(63682,"gba_unknown4",void 0,[],void 0),qt[63683]=zt(63683,"get_gba_state",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63684]=zt(63684,"unknown_f8c4",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63685]=zt(63685,"unknown_f8c5",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63686]=zt(63686,"qexit",void 0,[],void 0),qt[63687]=zt(63687,"use_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Animation ID.",Et.Read),Wt(yt,"Animation duration in number of frames.",Et.Read)]},void 0,void 0)],void 0),qt[63688]=zt(63688,"stop_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63689]=zt(63689,"run_to_coord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63690]=zt(63690,"set_slot_invincible",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63691]=zt(63691,"unknown_f8cb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63692]=zt(63692,"set_slot_poison",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63693]=zt(63693,"set_slot_paralyze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63694]=zt(63694,"set_slot_shock",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63695]=zt(63695,"set_slot_freeze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63696]=zt(63696,"set_slot_slow",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63697]=zt(63697,"set_slot_confuse",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63698]=zt(63698,"set_slot_shifta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63699]=zt(63699,"set_slot_deband",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63700]=zt(63700,"set_slot_jellen",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63701]=zt(63701,"set_slot_zalure",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63702]=zt(63702,"fleti_fixed_camera",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63703]=zt(63703,"fleti_locked_camera",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63704]=zt(63704,"default_camera_pos2",void 0,[],void 0),qt[63705]=zt(63705,"set_motion_blur",void 0,[],void 0),qt[63706]=zt(63706,"set_screen_bw",void 0,[],void 0),qt[63707]=zt(63707,"unknown_f8db",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63708]=zt(63708,"npc_action_string",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Tt,void 0,void 0)],void 0),qt[63709]=zt(63709,"get_pad_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63710]=zt(63710,"get_button_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63711]=zt(63711,"freeze_enemies",void 0,[],void 0),qt[63712]=zt(63712,"unfreeze_enemies",void 0,[],void 0),qt[63713]=zt(63713,"freeze_everything",void 0,[],void 0),qt[63714]=zt(63714,"unfreeze_everything",void 0,[],void 0),qt[63715]=zt(63715,"restore_hp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63716]=zt(63716,"restore_tp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63717]=zt(63717,"close_chat_bubble",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63718]=zt(63718,"move_coords_object",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63719]=zt(63719,"at_coords_call_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63720]=zt(63720,"unknown_f8e8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63721]=zt(63721,"unknown_f8e9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63722]=zt(63722,"unknown_f8ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63723]=zt(63723,"unknown_f8eb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63724]=zt(63724,"unknown_f8ec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63725]=zt(63725,"animation_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63726]=zt(63726,"call_image_data",void 0,[Wt(yt,void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63727]=zt(63727,"unknown_f8ef",void 0,[],void 0),qt[63728]=zt(63728,"turn_off_bgm_p2",void 0,[],void 0),qt[63729]=zt(63729,"turn_on_bgm_p2",void 0,[],void 0),qt[63730]=zt(63730,"load_unk_data",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(xt,void 0,void 0)],Mt.Pop),qt[63731]=zt(63731,"particle2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63732]=zt(63732,"unknown_f8f4",void 0,[],void 0),qt[63733]=zt(63733,"unknown_f8f5",void 0,[],void 0),qt[63734]=zt(63734,"unknown_f8f6",void 0,[],void 0),qt[63735]=zt(63735,"unknown_f8f7",void 0,[],void 0),qt[63736]=zt(63736,"unknown_f8f8",void 0,[],void 0),qt[63737]=zt(63737,"unknown_f8f9",void 0,[],void 0),qt[63738]=zt(63738,"unknown_f8fa",void 0,[],void 0),qt[63739]=zt(63739,"unknown_f8fb",void 0,[],void 0),qt[63740]=zt(63740,"unknown_f8fc",void 0,[],void 0),qt[63741]=zt(63741,"unknown_f8fd",void 0,[],void 0),qt[63742]=zt(63742,"unknown_f8fe",void 0,[],void 0),qt[63743]=zt(63743,"unknown_f8ff",void 0,[],void 0),qt[63744]=zt(63744,"unknown_f900",void 0,[],void 0),qt[63745]=zt(63745,"dec2float",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63746]=zt(63746,"float2dec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63747]=zt(63747,"flet",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),wo=qt[63748]=zt(63748,"fleti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),ko=(qt[63749]=zt(63749,"unknown_f905",void 0,[],void 0),qt[63750]=zt(63750,"unknown_f906",void 0,[],void 0),qt[63751]=zt(63751,"unknown_f907",void 0,[],void 0),qt[63752]=zt(63752,"fadd",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),yo=qt[63753]=zt(63753,"faddi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Ro=qt[63754]=zt(63754,"fsub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),Io=qt[63755]=zt(63755,"fsubi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),jo=qt[63756]=zt(63756,"fmul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),xo=qt[63757]=zt(63757,"fmuli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),To=qt[63758]=zt(63758,"fdiv",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),So=qt[63759]=zt(63759,"fdivi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Co=(qt[63760]=zt(63760,"get_unknown_count",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63761]=zt(63761,"get_stackable_item_count",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63762]=zt(63762,"freeze_and_hide_equip",void 0,[],void 0),qt[63763]=zt(63763,"thaw_and_show_equip",void 0,[],void 0),qt[63764]=zt(63764,"set_palettex_callback",void 0,[Wt(yt,"Player slot.",void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63765]=zt(63765,"activate_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63766]=zt(63766,"enable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63767]=zt(63767,"restore_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63768]=zt(63768,"disable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63769]=zt(63769,"get_palettex_activated",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63770]=zt(63770,"get_unknown_palettex_status",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63771]=zt(63771,"disable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63772]=zt(63772,"enable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63773]=zt(63773,"get_time_played",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63774]=zt(63774,"get_guildcard_total",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63775]=zt(63775,"get_slot_meseta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63776]=zt(63776,"get_player_level",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63777]=zt(63777,"get_section_id",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63778]=zt(63778,"get_player_hp",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Maximum HP.",Et.Write),Wt(yt,"Current HP.",Et.Write),Wt(yt,"Maximum TP.",Et.Write),Wt(yt,"Current TP.",Et.Write)]},void 0,void 0)],Mt.Pop),qt[63779]=zt(63779,"get_floor_number",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63780]=zt(63780,"get_coord_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63781]=zt(63781,"read_global_flag",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63782]=zt(63782,"write_global_flag",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63783]=zt(63783,"unknown_f927",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63784]=zt(63784,"floor_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63785]=zt(63785,"read_disk_file",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63786]=zt(63786,"open_pack_select",void 0,[],void 0),qt[63787]=zt(63787,"item_select",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63788]=zt(63788,"get_item_id",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63789]=zt(63789,"color_change",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63790]=zt(63790,"send_statistic",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63791]=zt(63791,"unknown_f92f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63792]=zt(63792,"chat_box",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63793]=zt(63793,"chat_bubble",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63794]=zt(63794,"unknown_f932",void 0,[],void 0),qt[63795]=zt(63795,"unknown_f933",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63796]=zt(63796,"scroll_text",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63797]=zt(63797,"gba_unknown1",void 0,[],void 0),qt[63798]=zt(63798,"gba_unknown2",void 0,[],void 0),qt[63799]=zt(63799,"gba_unknown3",void 0,[],void 0),qt[63800]=zt(63800,"add_damage_to",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63801]=zt(63801,"item_delete3",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63802]=zt(63802,"get_item_info",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63803]=zt(63803,"item_packing1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63804]=zt(63804,"item_packing2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63805]=zt(63805,"get_lang_setting",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63806]=zt(63806,"prepare_statistic",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63807]=zt(63807,"keyword_detect",void 0,[],void 0),qt[63808]=zt(63808,"keyword",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63809]=zt(63809,"get_guildcard_num",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63810]=zt(63810,"unknown_f942",void 0,[],void 0),qt[63811]=zt(63811,"unknown_f943",void 0,[],void 0),qt[63812]=zt(63812,"get_wrap_status",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63813]=zt(63813,"initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63814]=zt(63814,"sin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63815]=zt(63815,"cos",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63816]=zt(63816,"unknown_f948",void 0,[],void 0),qt[63817]=zt(63817,"unknown_f949",void 0,[],void 0),qt[63818]=zt(63818,"boss_is_dead2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63819]=zt(63819,"unknown_f94b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63820]=zt(63820,"unknown_f94c",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63821]=zt(63821,"is_there_cardbattle",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63822]=zt(63822,"unknown_f94e",void 0,[],void 0),qt[63823]=zt(63823,"unknown_f94f",void 0,[],void 0),qt[63824]=zt(63824,"bb_p2_menu",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63825]=zt(63825,"bb_map_designate",void 0,[Wt(wt,void 0,void 0),Wt(kt,void 0,void 0),Wt(wt,void 0,void 0),Wt(wt,void 0,void 0)],void 0));qt[63826]=zt(63826,"bb_get_number_in_pack",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63827]=zt(63827,"bb_swap_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63828]=zt(63828,"bb_check_wrap",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63829]=zt(63829,"bb_exchange_pd_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63830]=zt(63830,"bb_exchange_pd_srank",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63831]=zt(63831,"bb_exchange_pd_special",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63832]=zt(63832,"bb_exchange_pd_percent",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63833]=zt(63833,"unknown_f959",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63834]=zt(63834,"unknown_f95a",void 0,[],void 0),qt[63835]=zt(63835,"unknown_f95b",void 0,[],void 0),qt[63836]=zt(63836,"bb_exchange_slt",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63837]=zt(63837,"bb_exchange_pc",void 0,[],void 0),qt[63838]=zt(63838,"bb_box_create_bp",void 0,[Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63839]=zt(63839,"bb_exchange_pt",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63840]=zt(63840,"unknown_f960",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63841]=zt(63841,"unknown_f961",void 0,[],void 0),qt[63842]=zt(63842,"unknown_f962",void 0,[],void 0),qt[63843]=zt(63843,"unknown_f963",void 0,[],void 0),qt[63844]=zt(63844,"unknown_f964",void 0,[],void 0),qt[63845]=zt(63845,"unknown_f965",void 0,[],void 0),qt[63846]=zt(63846,"unknown_f966",void 0,[],void 0),qt[63847]=zt(63847,"unknown_f967",void 0,[],void 0),qt[63848]=zt(63848,"unknown_f968",void 0,[],void 0),qt[63849]=zt(63849,"unknown_f969",void 0,[],void 0),qt[63850]=zt(63850,"unknown_f96a",void 0,[],void 0),qt[63851]=zt(63851,"unknown_f96b",void 0,[],void 0),qt[63852]=zt(63852,"unknown_f96c",void 0,[],void 0),qt[63853]=zt(63853,"unknown_f96d",void 0,[],void 0),qt[63854]=zt(63854,"unknown_f96e",void 0,[],void 0),qt[63855]=zt(63855,"unknown_f96f",void 0,[],void 0),qt[63856]=zt(63856,"unknown_f970",void 0,[],void 0),qt[63857]=zt(63857,"unknown_f971",void 0,[],void 0),qt[63858]=zt(63858,"unknown_f972",void 0,[],void 0),qt[63859]=zt(63859,"unknown_f973",void 0,[],void 0),qt[63860]=zt(63860,"unknown_f974",void 0,[],void 0),qt[63861]=zt(63861,"unknown_f975",void 0,[],void 0),qt[63862]=zt(63862,"unknown_f976",void 0,[],void 0),qt[63863]=zt(63863,"unknown_f977",void 0,[],void 0),qt[63864]=zt(63864,"unknown_f978",void 0,[],void 0),qt[63865]=zt(63865,"unknown_f979",void 0,[],void 0),qt[63866]=zt(63866,"unknown_f97a",void 0,[],void 0),qt[63867]=zt(63867,"unknown_f97b",void 0,[],void 0),qt[63868]=zt(63868,"unknown_f97c",void 0,[],void 0),qt[63869]=zt(63869,"unknown_f97d",void 0,[],void 0),qt[63870]=zt(63870,"unknown_f97e",void 0,[],void 0),qt[63871]=zt(63871,"unknown_f97f",void 0,[],void 0),qt[63872]=zt(63872,"unknown_f980",void 0,[],void 0),qt[63873]=zt(63873,"unknown_f981",void 0,[],void 0),qt[63874]=zt(63874,"unknown_f982",void 0,[],void 0),qt[63875]=zt(63875,"unknown_f983",void 0,[],void 0),qt[63876]=zt(63876,"unknown_f984",void 0,[],void 0),qt[63877]=zt(63877,"unknown_f985",void 0,[],void 0),qt[63878]=zt(63878,"unknown_f986",void 0,[],void 0),qt[63879]=zt(63879,"unknown_f987",void 0,[],void 0),qt[63880]=zt(63880,"unknown_f988",void 0,[],void 0),qt[63881]=zt(63881,"unknown_f989",void 0,[],void 0),qt[63882]=zt(63882,"unknown_f98a",void 0,[],void 0),qt[63883]=zt(63883,"unknown_f98b",void 0,[],void 0),qt[63884]=zt(63884,"unknown_f98c",void 0,[],void 0),qt[63885]=zt(63885,"unknown_f98d",void 0,[],void 0),qt[63886]=zt(63886,"unknown_f98e",void 0,[],void 0),qt[63887]=zt(63887,"unknown_f98f",void 0,[],void 0),qt[63888]=zt(63888,"unknown_f990",void 0,[],void 0),qt[63889]=zt(63889,"unknown_f991",void 0,[],void 0),qt[63890]=zt(63890,"unknown_f992",void 0,[],void 0),qt[63891]=zt(63891,"unknown_f993",void 0,[],void 0),qt[63892]=zt(63892,"unknown_f994",void 0,[],void 0),qt[63893]=zt(63893,"unknown_f995",void 0,[],void 0),qt[63894]=zt(63894,"unknown_f996",void 0,[],void 0),qt[63895]=zt(63895,"unknown_f997",void 0,[],void 0),qt[63896]=zt(63896,"unknown_f998",void 0,[],void 0),qt[63897]=zt(63897,"unknown_f999",void 0,[],void 0),qt[63898]=zt(63898,"unknown_f99a",void 0,[],void 0),qt[63899]=zt(63899,"unknown_f99b",void 0,[],void 0),qt[63900]=zt(63900,"unknown_f99c",void 0,[],void 0),qt[63901]=zt(63901,"unknown_f99d",void 0,[],void 0),qt[63902]=zt(63902,"unknown_f99e",void 0,[],void 0),qt[63903]=zt(63903,"unknown_f99f",void 0,[],void 0),qt[63904]=zt(63904,"unknown_f9a0",void 0,[],void 0),qt[63905]=zt(63905,"unknown_f9a1",void 0,[],void 0),qt[63906]=zt(63906,"unknown_f9a2",void 0,[],void 0),qt[63907]=zt(63907,"unknown_f9a3",void 0,[],void 0),qt[63908]=zt(63908,"unknown_f9a4",void 0,[],void 0),qt[63909]=zt(63909,"unknown_f9a5",void 0,[],void 0),qt[63910]=zt(63910,"unknown_f9a6",void 0,[],void 0),qt[63911]=zt(63911,"unknown_f9a7",void 0,[],void 0),qt[63912]=zt(63912,"unknown_f9a8",void 0,[],void 0),qt[63913]=zt(63913,"unknown_f9a9",void 0,[],void 0),qt[63914]=zt(63914,"unknown_f9aa",void 0,[],void 0),qt[63915]=zt(63915,"unknown_f9ab",void 0,[],void 0),qt[63916]=zt(63916,"unknown_f9ac",void 0,[],void 0),qt[63917]=zt(63917,"unknown_f9ad",void 0,[],void 0),qt[63918]=zt(63918,"unknown_f9ae",void 0,[],void 0),qt[63919]=zt(63919,"unknown_f9af",void 0,[],void 0),qt[63920]=zt(63920,"unknown_f9b0",void 0,[],void 0),qt[63921]=zt(63921,"unknown_f9b1",void 0,[],void 0),qt[63922]=zt(63922,"unknown_f9b2",void 0,[],void 0),qt[63923]=zt(63923,"unknown_f9b3",void 0,[],void 0),qt[63924]=zt(63924,"unknown_f9b4",void 0,[],void 0),qt[63925]=zt(63925,"unknown_f9b5",void 0,[],void 0),qt[63926]=zt(63926,"unknown_f9b6",void 0,[],void 0),qt[63927]=zt(63927,"unknown_f9b7",void 0,[],void 0),qt[63928]=zt(63928,"unknown_f9b8",void 0,[],void 0),qt[63929]=zt(63929,"unknown_f9b9",void 0,[],void 0),qt[63930]=zt(63930,"unknown_f9ba",void 0,[],void 0),qt[63931]=zt(63931,"unknown_f9bb",void 0,[],void 0),qt[63932]=zt(63932,"unknown_f9bc",void 0,[],void 0),qt[63933]=zt(63933,"unknown_f9bd",void 0,[],void 0),qt[63934]=zt(63934,"unknown_f9be",void 0,[],void 0),qt[63935]=zt(63935,"unknown_f9bf",void 0,[],void 0),qt[63936]=zt(63936,"unknown_f9c0",void 0,[],void 0),qt[63937]=zt(63937,"unknown_f9c1",void 0,[],void 0),qt[63938]=zt(63938,"unknown_f9c2",void 0,[],void 0),qt[63939]=zt(63939,"unknown_f9c3",void 0,[],void 0),qt[63940]=zt(63940,"unknown_f9c4",void 0,[],void 0),qt[63941]=zt(63941,"unknown_f9c5",void 0,[],void 0),qt[63942]=zt(63942,"unknown_f9c6",void 0,[],void 0),qt[63943]=zt(63943,"unknown_f9c7",void 0,[],void 0),qt[63944]=zt(63944,"unknown_f9c8",void 0,[],void 0),qt[63945]=zt(63945,"unknown_f9c9",void 0,[],void 0),qt[63946]=zt(63946,"unknown_f9ca",void 0,[],void 0),qt[63947]=zt(63947,"unknown_f9cb",void 0,[],void 0),qt[63948]=zt(63948,"unknown_f9cc",void 0,[],void 0),qt[63949]=zt(63949,"unknown_f9cd",void 0,[],void 0),qt[63950]=zt(63950,"unknown_f9ce",void 0,[],void 0),qt[63951]=zt(63951,"unknown_f9cf",void 0,[],void 0),qt[63952]=zt(63952,"unknown_f9d0",void 0,[],void 0),qt[63953]=zt(63953,"unknown_f9d1",void 0,[],void 0),qt[63954]=zt(63954,"unknown_f9d2",void 0,[],void 0),qt[63955]=zt(63955,"unknown_f9d3",void 0,[],void 0),qt[63956]=zt(63956,"unknown_f9d4",void 0,[],void 0),qt[63957]=zt(63957,"unknown_f9d5",void 0,[],void 0),qt[63958]=zt(63958,"unknown_f9d6",void 0,[],void 0),qt[63959]=zt(63959,"unknown_f9d7",void 0,[],void 0),qt[63960]=zt(63960,"unknown_f9d8",void 0,[],void 0),qt[63961]=zt(63961,"unknown_f9d9",void 0,[],void 0),qt[63962]=zt(63962,"unknown_f9da",void 0,[],void 0),qt[63963]=zt(63963,"unknown_f9db",void 0,[],void 0),qt[63964]=zt(63964,"unknown_f9dc",void 0,[],void 0),qt[63965]=zt(63965,"unknown_f9dd",void 0,[],void 0),qt[63966]=zt(63966,"unknown_f9de",void 0,[],void 0),qt[63967]=zt(63967,"unknown_f9df",void 0,[],void 0),qt[63968]=zt(63968,"unknown_f9e0",void 0,[],void 0),qt[63969]=zt(63969,"unknown_f9e1",void 0,[],void 0),qt[63970]=zt(63970,"unknown_f9e2",void 0,[],void 0),qt[63971]=zt(63971,"unknown_f9e3",void 0,[],void 0),qt[63972]=zt(63972,"unknown_f9e4",void 0,[],void 0),qt[63973]=zt(63973,"unknown_f9e5",void 0,[],void 0),qt[63974]=zt(63974,"unknown_f9e6",void 0,[],void 0),qt[63975]=zt(63975,"unknown_f9e7",void 0,[],void 0),qt[63976]=zt(63976,"unknown_f9e8",void 0,[],void 0),qt[63977]=zt(63977,"unknown_f9e9",void 0,[],void 0),qt[63978]=zt(63978,"unknown_f9ea",void 0,[],void 0),qt[63979]=zt(63979,"unknown_f9eb",void 0,[],void 0),qt[63980]=zt(63980,"unknown_f9ec",void 0,[],void 0),qt[63981]=zt(63981,"unknown_f9ed",void 0,[],void 0),qt[63982]=zt(63982,"unknown_f9ee",void 0,[],void 0),qt[63983]=zt(63983,"unknown_f9ef",void 0,[],void 0),qt[63984]=zt(63984,"unknown_f9f0",void 0,[],void 0),qt[63985]=zt(63985,"unknown_f9f1",void 0,[],void 0),qt[63986]=zt(63986,"unknown_f9f2",void 0,[],void 0),qt[63987]=zt(63987,"unknown_f9f3",void 0,[],void 0),qt[63988]=zt(63988,"unknown_f9f4",void 0,[],void 0),qt[63989]=zt(63989,"unknown_f9f5",void 0,[],void 0),qt[63990]=zt(63990,"unknown_f9f6",void 0,[],void 0),qt[63991]=zt(63991,"unknown_f9f7",void 0,[],void 0),qt[63992]=zt(63992,"unknown_f9f8",void 0,[],void 0),qt[63993]=zt(63993,"unknown_f9f9",void 0,[],void 0),qt[63994]=zt(63994,"unknown_f9fa",void 0,[],void 0),qt[63995]=zt(63995,"unknown_f9fb",void 0,[],void 0),qt[63996]=zt(63996,"unknown_f9fc",void 0,[],void 0),qt[63997]=zt(63997,"unknown_f9fd",void 0,[],void 0),qt[63998]=zt(63998,"unknown_f9fe",void 0,[],void 0),qt[63999]=zt(63999,"unknown_f9ff",void 0,[],void 0);function Oo(e,t,i){const o=Math.min(e.params.length,t.length),s=[];let n=0;for(let i=0;iObject.assign({},e))};switch(e.type){case Po.Instructions:return{type:Po.Instructions,labels:t,instructions:e.instructions.map(e=>(function(e){return{opcode:e.opcode,args:e.args.map(e=>Object.assign({},e)),arg_size:e.arg_size,size:e.size,param_to_args:e.param_to_args.map(e=>e.map(e=>Object.assign({},e))),asm:e.asm}})(e)),asm:i};case Po.Data:return{type:Po.Data,labels:t,data:e.data.slice(0),asm:i};case Po.String:return{type:Po.String,labels:t,value:e.value,asm:i}}}qt.forEach(e=>{Ft.set(e.mnemonic,e)}),function(e){e[e.Instructions=0]="Instructions",e[e.Data=1]="Data",e[e.String=2]="String"}(Po||(Po={}));const Bo={add:(e,t)=>e+t,sub:(e,t)=>e-t,mul:(e,t)=>e*t,div:(e,t)=>e/t,idiv:(e,t)=>Math.floor(e/t),mod:(e,t)=>e%t,and:(e,t)=>e&t,or:(e,t)=>e|t,xor:(e,t)=>e^t,shl:(e,t)=>e<e>>>t};function Eo(e,t,i){if(e(t,i))return i}function Mo(e){return e.slice(1)}const Wo=X.c.get("quest_editor/scripting/vm/io");class qo{bb_map_designate(e,t){Wo.warn(`bb_map_designate(${e}, ${t})`)}set_floor_handler(e,t){Wo.warn(`set_floor_handler(${e}, ${t})`)}window_msg(e){Wo.warn(`window_msg("${e}")`)}message(e){Wo.warn(`message("${e}")`)}add_msg(e){Wo.warn(`add_msg("${e}")`)}winend(){Wo.warn("winend")}p_dead_v3(e){return Wo.warn(`p_dead_v3(${e})`),!1}mesend(){Wo.warn("mesend")}list(e){Wo.warn(`list([${e.map(e=>`"${e}"`).join(", ")}])`)}warning(e,t){var i;Wo.warn(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}error(e,t){var i;Wo.error(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}srcloc_to_string(e){return e?` [${e.line_no}:${e.col}]`:" "}}var Fo=i("bcBH");class zo{constructor(e=Math.floor(performance.now())){this.holdrand=e}next(){const e=214013*this.holdrand+2531011>>>0;return this.holdrand=e,e>>>16&32767}}var Vo=i("NRxM");class Uo extends Vo.a{constructor(e,t){super(new ArrayBuffer(e),t)}zero(){new Uint32Array(this.backing_buffer).fill(0)}}class $o{constructor(e,t,i){Object(U.c)(e>=0,"seg_idx should be greater or equal to 0."),Object(U.c)(e=0,"inst_idx should be greater or equal to 0."),Object(U.c)(t=Ao)throw new Error("Argument stack: Stack overflow");this.arg_stack.write_u32_at(this.arg_stack_counter*No,e),this.arg_stack_types[this.arg_stack_counter]=t,this.arg_stack_counter++}fetch_args(e){const t=e.instruction;if(t.opcode.stack!==Mt.Pop)return[];const i=[];t.opcode.params.length!==this.arg_stack_counter&&this.io.warning("Argument stack: Argument count mismatch.",e);for(let o=0;o0&&i.push(this.arg_stack.u8_at(n));break;default:throw new Error(`Argument stack: Unhandled parameter kind: ${ft[s.type.kind]}.`)}}return this.arg_stack_counter=0,i}check_arg_type(e,t,i){let o;switch(e){case ft.Any:o=!0;break;case ft.Byte:case ft.Word:case ft.DWord:case ft.Float:case ft.String:case ft.Pointer:o=t===e;break;case ft.Label:case ft.ILabel:case ft.ILabelVar:case ft.DLabel:case ft.SLabel:o=t===ft.Word;break;case ft.RegRef:case ft.RegTupRef:case ft.RegRefVar:o=t===ft.Byte}o||this.io.warning(`Argument stack: Argument type mismatch, expected ${ft[e]} but received ${ft[t]}.`,i)}}Yo.next_id=0;const Ko=256,Qo=4,Zo=16,Jo=11085568,Xo=1024,es=0,ts="\n",is=X.c.get("quest_editor/scripting/vm/VirtualMachine");var os;!function(e){e[e.Suspended=0]="Suspended",e[e.Paused=1]="Paused",e[e.WaitingVsync=2]="WaitingVsync",e[e.WaitingInput=3]="WaitingInput",e[e.WaitingSelection=4]="WaitingSelection",e[e.Halted=5]="Halted"}(os||(os={}));class ss{constructor(e=new qo,t=new zo){this.io=e,this.random=t,this.episode=r.b.I,this._object_code=[],this.label_to_seg_idx=new Map,this.registers=new Uo(Ko*Qo,Fo.a.Little),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.breakpoints=[],this.paused=!1,this.unsupported_opcodes_logged=new Set}get object_code(){return this._object_code}get halted(){return this._halted}set step_mode(e){if(null!=e){const t=this.current_thread();t&&(t.step_mode=e)}}load_object_code(e,t){this.halt(),is.debug("Starting."),this._object_code=e,this.episode=t,this.label_to_seg_idx.clear();let i=0;for(const e of this._object_code){for(const t of e.labels)this.label_to_seg_idx.set(t,i);i++}this._halted=!1}start_thread(e,t){const i=this.get_segment_index_by_label(e),o=this._object_code[i];if(o.type!==Po.Instructions)throw new Error(`Label ${e} points to a ${Po[o.type]} segment, expecting ${Po[Po.Instructions]}.`);this.threads.push(new Yo(this.io,new $o(i,0,this.object_code),t))}execute(){var e,t,i;if(this._halted)return os.Halted;let o;try{let s=0;for(;s++<1e4;){if(this.threads.length>=1&&this.thread_idx>=this.threads.length)return os.WaitingVsync;const s=this.current_thread();if(!s)return os.Suspended;const n=s.current_stack_frame();o=n.instruction_pointer;const r=o.instruction;if(!this.paused)switch(s.step_mode){case Ho.BreakPoint:if(-1!==this.breakpoints.findIndex(e=>e.equals(o)))return this.paused=!0,os.Paused;break;case Ho.Over:if(s.step_frame&&n.idx<=s.step_frame.idx&&(null===(e=r.asm)||void 0===e?void 0:e.mnemonic))return this.paused=!0,os.Paused;break;case Ho.In:if(null===(t=r.asm)||void 0===t?void 0:t.mnemonic)return this.paused=!0,os.Paused;break;case Ho.Out:if(s.step_frame&&n.idx=this.threads.length&&(this.thread_idx=0)}halt(){this._halted||(is.debug("Halting."),this.registers.zero(),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.paused=!1,this.breakpoints.splice(0,1/0),this.unsupported_opcodes_logged.clear())}get_current_stack_frame(){var e;return null===(e=this.current_thread())||void 0===e?void 0:e.current_stack_frame()}get_instruction_pointer(){var e;return null===(e=this.get_current_stack_frame())||void 0===e?void 0:e.instruction_pointer}get_segment_index_by_label(e){if(!this.label_to_seg_idx.has(e))throw new Error(`Invalid argument: No such label ${e}.`);return this.label_to_seg_idx.get(e)}list_select(e){if(!this.list_open)throw new Error("list_select may not be called if there is no list open");this.set_register_unsigned(this.selection_reg,e)}set_breakpoint(e){-1===this.breakpoints.findIndex(t=>t.equals(e))&&this.breakpoints.push(e)}remove_breakpoint(e){const t=this.breakpoints.findIndex(t=>t.equals(e));-1!==t&&this.breakpoints.splice(t,1)}current_thread(){return this.threads[this.thread_idx]}terminate_thread(e){this.threads.splice(e,1),this.thread_idx>=e&&this.thread_idx>0&&this.thread_idx--}advance(e){const t=e.current_stack_frame();if(!t)return;const i=t.instruction_pointer.next();i?e.set_current_instruction_pointer(i):(e.pop_call_stack(),this.terminate_thread(this.thread_idx))}execute_instruction(e,t){const i=t.instruction;let o=void 0,s=!0;const n=i.args.map(e=>e.value),[a,d,c,l]=n;this.list_open&&(this.list_open=!1);const _=e.fetch_args(t);switch(i.opcode.code){case Vt.code:break;case Ut.code:this.pop_call_stack(this.thread_idx);break;case $t.code:o=os.WaitingVsync,this.advance(e),this.thread_idx++,s=!1;break;case Nt.code:this.halt();break;case At.code:this.start_thread(a);break;case Kt.code:this.set_register_signed(a,this.get_register_signed(d));break;case Qt.code:this.set_register_signed(a,d);break;case Zt.code:this.set_register_byte(a,d);break;case Jt.code:this.set_register_word(a,d);break;case Xt.code:this.set_register_unsigned(a,this.get_register_address(a));break;case mo.code:this.set_register_float(a,this.get_register_float(d));break;case wo.code:this.set_register_float(a,d);break;case ei.code:this.set_register_signed(a,1);break;case ti.code:this.set_register_signed(a,0);break;case ii.code:this.set_register_signed(a,0===this.get_register_signed(a)?1:0);break;case wi.code:this.push_call_stack(e,a),s=!1;break;case mi.code:this.jump_to_label(e,a),s=!1;break;case Ki.code:e.push_arg(this.get_register_signed(a),ft.DWord);break;case Qi.code:e.push_arg(i.args[0].value,ft.DWord);break;case Zi.code:e.push_arg(i.args[0].value,ft.Byte);break;case Ji.code:e.push_arg(i.args[0].value,ft.Word);break;case Xi.code:e.push_arg(this.get_register_address(i.args[0].value),ft.DWord);break;case to.code:if("string"==typeof a){const t=this.parse_template_string(a);this.string_arg_store=t.slice(0,Xo/2),e.push_arg(Jo,ft.String)}break;case oi.code:this.do_integer_op_with_register(a,d,Bo.add);break;case si.code:this.do_integer_op_with_literal(a,d,Bo.add);break;case ni.code:this.do_integer_op_with_register(a,d,Bo.sub);break;case ri.code:this.do_integer_op_with_literal(a,d,Bo.sub);break;case ai.code:this.do_integer_op_with_register(a,d,Bo.mul);break;case di.code:this.do_integer_op_with_literal(a,d,Bo.mul);break;case ci.code:this.do_integer_op_with_register(a,d,Bo.idiv);break;case li.code:this.do_integer_op_with_literal(a,d,Bo.idiv);break;case bi.code:this.do_integer_op_with_register(a,d,Bo.mod);break;case fi.code:this.do_integer_op_with_literal(a,d,Bo.mod);break;case ko.code:this.do_float_op_with_register(a,d,Bo.add);break;case yo.code:this.do_float_op_with_literal(a,Math.fround(d),Bo.add);break;case Ro.code:this.do_float_op_with_register(a,d,Bo.sub);break;case Io.code:this.do_float_op_with_literal(a,Math.fround(d),Bo.sub);break;case jo.code:this.do_float_op_with_register(a,d,Bo.mul);break;case xo.code:this.do_float_op_with_literal(a,Math.fround(d),Bo.mul);break;case To.code:this.do_float_op_with_register(a,d,Bo.div);break;case So.code:this.do_float_op_with_literal(a,Math.fround(d),Bo.div);break;case _i.code:this.do_integer_op_with_register(a,d,Bo.and);break;case ui.code:this.do_integer_op_with_literal(a,d,Bo.and);break;case vi.code:this.do_integer_op_with_register(a,d,Bo.or);break;case hi.code:this.do_integer_op_with_literal(a,d,Bo.or);break;case pi.code:this.do_integer_op_with_register(a,d,Bo.xor);break;case gi.code:this.do_integer_op_with_literal(a,d,Bo.xor);break;case po.code:this.do_integer_op_with_register(a,d,Bo.shl);break;case go.code:this.do_integer_op_with_register(a,d,Bo.shr);break;case ki.code:this.conditional_jump(e,a,(e,t)=>e===t,1,...Mo(n).map(e=>this.get_register_signed(e))),s=!1;break;case yi.code:this.conditional_jump(e,a,(e,t)=>e===t,0,...Mo(n).map(e=>this.get_register_signed(e))),s=!1;break;case Ri.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e===t,a,d),s=!1;break;case Ii.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e===t,a,d),s=!1;break;case ji.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e!==t,a,d),s=!1;break;case xi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e!==t,a,d),s=!1;break;case Ti.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),s=!1;break;case Si.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),s=!1;break;case Ci.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),s=!1;break;case Oi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),s=!1;break;case Li.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>eeeee>=t,a,d),s=!1;break;case Mi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),s=!1;break;case Wi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>=t,a,d),s=!1;break;case qi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),s=!1;break;case Fi.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),s=!1;break;case zi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Vi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Ui.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Ai.code:this.push_variable_stack(e,a,1);break;case Hi.code:this.pop_variable_stack(e,a,1);break;case Gi.code:this.push_variable_stack(e,a,d);break;case Yi.code:this.pop_variable_stack(e,a,d);break;case io.code:if(!this.window_msg_open){const e=this.deref_string(_[1]).split(ts);o=os.WaitingSelection,this.list_open=!0,this.selection_reg=_[0],this.io.list(e)}break;case oo.code:if(!this.window_msg_open){const e=this.deref_string(_[0]);o=os.WaitingInput,this.window_msg_open=!0,this.io.window_msg(e)}break;case so.code:if(this.window_msg_open){const e=this.deref_string(_[0]);o=os.WaitingInput,this.io.add_msg(e)}break;case no.code:this.set_register_unsigned(a,Math.floor(Date.now()/1e3));break;case ro.code:this.window_msg_open&&(this.window_msg_open=!1,this.io.winend());break;case ao.code:this.set_register_signed(_[0],this.io.p_dead_v3(_[1])?1:0);break;case lo.code:this.io.set_floor_handler(_[0],_[1]);break;case _o.code:this.start_thread(a);break;case bo.code:{const e=this.get_register_signed(a),t=this.get_register_signed(a+1),i=this.random.next();let o=Math.floor(Math.fround(i/32768)*t);e>=o&&(o=e),this.set_register_signed(d,o)}break;case fo.code:if(this.set_episode_called){this.io.warning("Calling set_episode more than once is not supported.",t);break}if(this.set_episode_called=!0,!this._object_code[t.seg_idx].labels.includes(es)){this.io.warning(`Calling set_episode outside of segment ${es} is not supported.`,t);break}if(function(e){switch(e){case r.b.I:return 0;case r.b.II:return 1;case r.b.IV:return 2}}(this.episode)!==a){this.io.warning("Calling set_episode with an argument that does notmatch the quest's designated episode is not supported.",t);break}break;case Co.code:this.io.bb_map_designate(a,d,c,l);break;default:this.unsupported_opcodes_logged.has(i.opcode.code)||(this.unsupported_opcodes_logged.add(i.opcode.code),this.io.warning("Unsupported instruction.",t))}return s&&this.advance(e),o}get_register_signed(e){return this.registers.i32_at(Qo*e)}set_register_signed(e,t){this.registers.write_i32_at(Qo*e,t)}get_register_unsigned(e){return this.registers.u32_at(Qo*e)}set_register_unsigned(e,t){this.registers.write_u32_at(Qo*e,t)}get_register_word(e){return this.registers.u16_at(Qo*e)}set_register_word(e,t){this.registers.write_u16_at(Qo*e,t)}get_register_byte(e){return this.registers.u8_at(Qo*e)}set_register_byte(e,t){this.registers.write_u8_at(Qo*e,t)}get_register_float(e){return this.registers.f32_at(Qo*e)}set_register_float(e,t){this.registers.write_f32_at(Qo*e,t)}do_integer_op_with_register(e,t,i){this.do_integer_op_with_literal(e,this.get_register_signed(t),i)}do_integer_op_with_literal(e,t,i){if((i===Bo.div||i===Bo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_signed(e,i(this.get_register_signed(e),t))}do_float_op_with_register(e,t,i){this.do_float_op_with_literal(e,this.get_register_float(t),i)}do_float_op_with_literal(e,t,i){if((i===Bo.div||i===Bo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_float(e,i(this.get_register_float(e),t))}push_call_stack(e,t){const i=this.get_segment_index_by_label(t),o=this._object_code[i];if(o.type!==Po.Instructions)throw new Error(`Label ${t} points to a ${Po[o.type]} segment, expecting ${Po[Po.Instructions]}.`);e.push_frame(new $o(i,0,this.object_code))}pop_call_stack(e){this.threads[e].pop_call_stack(),0===this.threads[e].call_stack.length&&this.terminate_thread(e)}jump_to_label(e,t){e.set_current_instruction_pointer(new $o(this.get_segment_index_by_label(t),0,this.object_code))}signed_cond_jump_with_register(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_signed(o),this.get_register_signed(s))}signed_cond_jump_with_literal(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_signed(o),s)}unsigned_cond_jump_with_register(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_unsigned(o),this.get_register_unsigned(s))}unsigned_cond_jump_with_literal(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_unsigned(o),s)}conditional_jump(e,t,i,...o){const s=Eo.bind(null,i);var n;void 0!==function(e,t,i){let o=t;for(const t of i){const i=e(o,t);if(void 0===i)return;o=i}return o}(s,(n=o)[0],n.slice(1))?this.jump_to_label(e,t):this.advance(e)}push_variable_stack(e,t,i){const o=t+i;if(o>Ko)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length+i>Zo)throw new Error("Variable stack: Stack overflow");for(let i=t;iKo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length=t;i--)this.set_register_unsigned(i,e.variable_stack.pop())}get_register_address(e){return e*Qo}deref_string(e){if(e===Jo)return this.string_arg_store;if(e>0&&e``],[/^r([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_unsigned(t).toString()}],[/^f([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_float(t).toFixed(6)}]];let o=!1,s=-1,n=0,r=e.length;for(;n"===a){o=!1;const a=n,d=e.slice(s+1,a);let c=void 0;for(const[e,t]of i){const i=e.exec(d);if(i&&void 0!==i[1]){c=t(i[1]);break}}if(void 0===c&&(c=t[d]),void 0===c)c="";else if("function"==typeof c){const e=c();t[d]=e,c=e}e=e.slice(0,s)+c+e.slice(a+1);const l=c.length-(d.length+2);n+=l,r+=l}else"<"===a&&(o=!0,s=n);n++}return o&&(e=e.slice(0,s)),e}}i("PNEq");var ns,rs=i("sv1z");!function(e){e[e.Signed=0]="Signed",e[e.Unsigned=1]="Unsigned",e[e.Word=2]="Word",e[e.Byte=3]="Byte",e[e.Float=4]="Float"}(ns||(ns={}));class as extends o.a{constructor(e){super(),this.quest_runner=e,this.type_select=this.disposable(new rs.a({label:"Display type:",tooltip:"Select which data type register values should be displayed as.",items:[ns.Signed,ns.Unsigned,ns.Word,ns.Byte,ns.Float],to_label:e=>ns[e]})),this.register_getter=this.get_register_getter(ns.Signed),this.hex_checkbox=this.disposable(new $e.a(!1,{label:"Hex",tooltip:"Display register values in hexadecimal."})),this.settings_bar=this.disposable(new Ue.a(this.type_select,this.hex_checkbox)),this.list_element=Object(v.i)({className:"quest_editor_RegistersView_list"}),this.container_element=Object(v.i)({className:"quest_editor_RegistersView_container"},this.list_element),this.element=Object(v.i)({className:"quest_editor_RegistersView"},this.settings_bar.element,this.container_element),this.type_select.selected.val=ns.Signed;const t=Array(Ko);for(let e=0;e!this.quest_runner.paused.val||!this.quest_runner.running.val;this.update(i(),this.hex_checkbox.checked.val),this.disposables(this.quest_runner.running.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.quest_runner.paused.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.type_select.selected.observe(({value:e})=>{null!=e&&(this.register_getter=this.get_register_getter(e),this.update(i(),this.hex_checkbox.checked.val))}),this.hex_checkbox.checked.observe(e=>this.update(i(),e.value))),this.finalize_construction()}get_register_getter(e){let t;switch(e){case ns.Signed:t=this.quest_runner.vm.get_register_signed;break;case ns.Unsigned:t=this.quest_runner.vm.get_register_unsigned;break;case ns.Word:t=this.quest_runner.vm.get_register_word;break;case ns.Byte:t=this.quest_runner.vm.get_register_byte;break;case ns.Float:t=this.quest_runner.vm.get_register_float}return t.bind(this.quest_runner.vm)}update(e,t){if(e){const e="??";for(let t=0;t{this.buffer_log_entry(e,t)},this.level=this._level,this.log=this._log.filtered(this.level.map(e=>t=>t.level>=e))}get_logger(e){const t=X.c.get(e);return t.handler=this.handler,t}dispose(){this.disposer.dispose()}set_level(e){this._level.val=e}buffer_log_entry(e,t){this.log_buffer.push(e),this.logger_name_buffer.push(t),this.add_buffered_log_entries()}add_buffered_log_entries(){null==this.adding_log_entries&&(this.adding_log_entries=requestAnimationFrame(()=>{if(this.log_buffer.length>500){const e=this.log_buffer.length-500;this.log_buffer.splice(250,e,{time:new Date,message:`...dropped ${e} messages...`,level:X.a.Warn,logger:ds}),this.logger_name_buffer.splice(250,e,"quest_editor/stores/LogStore")}const e=Math.min(200,this.log_buffer.length),t=this.log_buffer.splice(0,e),i=this.logger_name_buffer.splice(0,e);this._log.push(...t);for(let o=0;o2e3&&this._log.splice(0,1e3),this.adding_log_entries=void 0,this.log_buffer.length&&this.add_buffered_log_entries()}))}},ls=5;class _s extends o.a{constructor(){super(),this.element=Object(v.i)({className:"quest_editor_LogView",tabIndex:-1}),this.should_scroll_to_bottom=!0,this.scrolled=()=>{this.should_scroll_to_bottom=this.list_container.scrollTop>=this.list_container.scrollHeight-this.list_container.offsetHeight-ls},this.scroll_to_bottom=()=>{this.should_scroll_to_bottom&&this.list_container.scrollTo({top:this.list_container.scrollHeight,left:0,behavior:"auto"})},this.create_message_element=({time:e,level:t,message:i})=>Object(v.i)({className:["quest_editor_LogView_message","quest_editor_LogView_"+X.a[t]+"_message"].join(" ")},Object(v.i)({className:"quest_editor_LogView_message_timestamp"},Object(X.d)(e)),Object(v.i)({className:"quest_editor_LogView_message_level"},"["+X.a[t]+"]"),Object(v.i)({className:"quest_editor_LogView_message_contents"},i)),this.list_container=Object(v.i)({className:"quest_editor_LogView_list_container"}),this.list_element=Object(v.i)({className:"quest_editor_LogView_message_list"}),this.level_filter=this.disposable(new rs.a({class:"quest_editor_LogView_level_filter",label:"Level:",items:X.b,to_label:e=>X.a[e]})),this.settings_bar=this.disposable(new Ue.a({class:"quest_editor_LogView_settings"},this.level_filter)),this.list_container.addEventListener("scroll",this.scrolled),this.disposables(Object(v.d)(this.list_element,cs.log,this.create_message_element,{after:this.scroll_to_bottom}),this.level_filter.selected.observe(({value:e})=>null!=e&&cs.set_level(e)),cs.level.observe(({value:e})=>{this.level_filter.selected.val=e},{call_now:!0})),this.list_container.appendChild(this.list_element),this.element.appendChild(this.settings_bar.element),this.element.appendChild(this.list_container),this.finalize_construction()}}class us extends ne{constructor(e,t,i,o){super(Object(M.e)(void 0),t,i,o),this.quest_runner=e,this.disposer.add_all(this.quest_runner.game_state.current_area_variant.observe(this.area_variant_changed,{call_now:!0}))}get_area_variant_details(){const e=this.quest_runner.game_state;return{episode:e.episode,area_variant:e.current_area_variant.val,npcs:e.npcs,objects:e.objects}}}class vs extends _e{constructor(e,t,i,o,s){super(e,t,"quest_editor_QuestRunnerRendererView",new Q(s,e=>new us(t.quest_runner,e,i,o))),this.renderer.init_camera_controls(),this.finalize_construction()}}i("PJoW");class hs extends o.a{constructor(e){super(),this.element=Object(v.i)({className:"core_ErrorView"},this.disposable(new b(e)).element),this.finalize_construction()}}var ps=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const gs=X.c.get("quest_editor/gui/QuestEditorView"),bs={settings:{showPopoutIcon:!1,showMaximiseIcon:!0,showCloseIcon:!0},dimensions:{headerHeight:24},labels:{close:"Close",maximise:"Maximise",minimise:"Minimise",popout:"Open in new window"}};class fs extends o.a{constructor(e,t,i,o,s,n,r,a,d,c,l,_,u,h){super(),this.gui_store=e,this.quest_editor_ui_persister=i,this.tool_bar=o,this.element=Object(v.i)({className:"quest_editor_QuestEditorView"}),this.layout_element=Object(v.i)({className:"quest_editor_gl_container"}),this.sub_views=new Map,this.view_map=new Map([[f,{name:"quest_info",create:s}],[m,{name:"npc_counts",create:n}],[ze,{name:"quest_renderer",create:r}],[Ke,{name:"asm_editor",create:a}],[Qe,{name:"entity_info",create:d}],[Je,{name:"npc_list_view",create:c}],[Xe,{name:"object_list_view",create:l}],[bt,{name:"events_view",create:_}]]),e.feature_active("vm")&&(this.view_map.set(vs,{name:"quest_runner",create:u}),this.view_map.set(_s,{name:"log_view",create:()=>new _s}),this.view_map.set(as,{name:"registers_view",create:h})),this.element.append(this.tool_bar.element,this.layout_element),this.layout=this.init_golden_layout(),this.layout.then(e=>this.loaded_layout=e),this.disposables(e.on_global_keydown(le.b.QuestEditor,"Ctrl-Alt-D",()=>t.debug.val=!t.debug.val),t.quest_runner.running.observe(({value:e})=>ps(this,void 0,void 0,(function*(){const i=yield this.layout;if(t.quest_runner.running.val===e){const t=i.root.getItemsById(this.view_map.get(vs).name);if(e){if(0===t.length){i.root.getItemsById(this.view_map.get(ze).name)[0].parent.addChild({id:this.view_map.get(vs).name,title:"Debug 3D View",type:"component",componentName:this.view_map.get(vs).name,isClosable:!1})}}else for(const e of t)e.remove()}})))),this.finalize_construction()}resize(e,t){super.resize(e,t);const i=Math.max(0,t-this.tool_bar.height);return this.layout_element.style.width=`${e}px`,this.layout_element.style.height=`${i}px`,this.layout.then(t=>t.updateSize(e,i)),this}dispose(){super.dispose(),this.layout.then(e=>e.destroy());for(const e of this.sub_views.values())e.dispose();this.sub_views.clear()}init_golden_layout(){return ps(this,void 0,void 0,(function*(){const e=this.get_default_layout_content();try{const t=yield this.quest_editor_ui_persister.load_layout_config(e);if(t){const e=this.attempt_gl_init(Object.assign(Object.assign({},bs),{content:t}));return gs.info("Instantiated golden layout with persisted layout."),e}}catch(e){gs.warn("Couldn't instantiate golden layout with persisted layout.",e)}return gs.info("Instantiating golden layout with default layout."),this.attempt_gl_init(Object.assign(Object.assign({},bs),{content:e}))}))}attempt_gl_init(e){const t=new n.a(e,this.layout_element),i=this.sub_views;try{for(const{name:e,create:o}of this.view_map.values())t.registerComponent(e,(function(t){let s;try{s=o()}catch(t){gs.error(`Couldn't instantiate "${e}".`,t),s=new hs("Something went wrong while creating this window.")}t.on("close",()=>s.dispose()),t.on("resize",()=>s.resize(t.width,t.height-4)),s.resize(t.width,t.height),i.set(e,s),t.getElement().append(s.element)}));return t.on("stateChanged",()=>{this.quest_editor_ui_persister.persist_layout_config(t.toConfig().content)}),t.on("stackCreated",e=>{e.on("activeContentItemChanged",e=>{if("componentName"in e.config){const t=this.sub_views.get(e.config.componentName);t&&t.focus()}})}),t.init(),t}catch(e){throw t.destroy(),e}}get_default_layout_content(){return[{type:"row",content:[{type:"column",width:2,content:[{type:"stack",content:[{title:"Info",type:"component",componentName:this.view_map.get(f).name,isClosable:!1},{title:"NPC Counts",type:"component",componentName:this.view_map.get(m).name,isClosable:!1}]},{title:"Entity",type:"component",componentName:this.view_map.get(Qe).name,isClosable:!1}]},{type:"stack",width:9,content:[{id:this.view_map.get(ze).name,title:"3D View",type:"component",componentName:this.view_map.get(ze).name,isClosable:!1},{title:"Script",type:"component",componentName:this.view_map.get(Ke).name,isClosable:!1},...this.gui_store.feature_active("vm")?[{title:"Debug Log",type:"component",componentName:this.view_map.get(_s).name,isClosable:!1},{title:"Registers",type:"component",componentName:this.view_map.get(as).name,isClosable:!1}]:[]]},{type:"stack",width:2,content:[{title:"NPCs",type:"component",componentName:this.view_map.get(Je).name,isClosable:!1},{title:"Objects",type:"component",componentName:this.view_map.get(Xe).name,isClosable:!1},{title:"Events",type:"component",componentName:this.view_map.get(bt).name,isClosable:!1}]}]}]}}const ms={can_redo:Object(M.e)(!1),can_undo:Object(M.e)(!1),first_redo:Object(M.e)(void 0),first_undo:Object(M.e)(void 0),make_current(){ws.current.val=this},redo:()=>!1,reset(){},undo:()=>!1};const ws=new class{constructor(){this.current=Object(M.e)(ms),this.can_undo=this.current.flat_map(e=>e.can_undo),this.can_redo=this.current.flat_map(e=>e.can_redo),this.first_undo=this.current.flat_map(e=>e.first_undo),this.first_redo=this.current.flat_map(e=>e.first_redo)}undo(){return this.current.val.undo()}redo(){return this.current.val.redo()}make_noop_current(){ws.current.val=ms}},ks=X.c.get("core/undo/UndoStack");class ys{constructor(){this.stack=Object(M.c)(),this.index=Object(M.e)(0),this.can_undo=this.index.map(e=>e>0),this.can_redo=Object(M.d)((e,t)=>te?this.stack.get(this.index.val-1):void 0),this.first_redo=this.can_redo.map(e=>e?this.stack.get(this.index.val):void 0),this.undoing_or_redoing=!1}make_current(){ws.current.val=this}push(e){return this.undoing_or_redoing||(this.stack.splice(this.index.val,1/0,e),this.index.update(e=>e+1)),e}pop(){return this.index.update(e=>e-1),this.stack.splice(this.index.val,1)[0]}undo(){if(this.can_undo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.index.update(e=>e-1),this.stack.get(this.index.val).undo()}catch(e){ks.warn("Error while undoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}redo(){if(this.can_redo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.stack.get(this.index.val).redo(),this.index.update(e=>e+1)}catch(e){ks.warn("Error while redoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}reset(){this.stack.clear(),this.index.val=0}}class Rs{constructor(e){this._breakpoints=[],this.breakpoints=this._breakpoints,this.vm=e}resume(){this.vm.step_mode=Ho.BreakPoint}step_over(){this.vm.step_mode=Ho.Over}step_in(){this.vm.step_mode=Ho.In}step_out(){this.vm.step_mode=Ho.Out}set_breakpoint(e){return-1===this._breakpoints.findIndex(t=>t.line_no===e)&&(this._breakpoints.push(new Is(e,void 0,this.vm)),!0)}remove_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);return-1!=t&&(this._breakpoints.splice(t,1)[0].deactivate(),!0)}toggle_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);-1==t?this._breakpoints.push(new Is(e,void 0,this.vm)):this._breakpoints.splice(t,1)[0].deactivate()}clear_breakpoints(){for(const e of this._breakpoints.splice(0,1/0))e.deactivate()}activate_breakpoints(){for(const e of this._breakpoints)e.activate()}deactivate_breakpoints(){for(const e of this._breakpoints)e.deactivate()}}class Is{constructor(e,t,i){this.line_no=e,this.ptr=t,this.vm=i,null==t?this.activate():this.vm.set_breakpoint(t)}get active(){return null!=this.ptr}activate(){this.ptr=this.line_no_to_inst_pointer(this.line_no),this.ptr&&this.vm.set_breakpoint(this.ptr)}deactivate(){this.ptr&&this.vm.remove_breakpoint(this.ptr)}line_no_to_inst_pointer(e){var t,i;if(!this.vm.halted)for(let o=0;oe!==js.Stopped),this.paused=this._state.map(e=>e===js.Paused),this.breakpoints=this._breakpoints,this.pause_location=this._pause_location,this.execution_loop=()=>{var e,t;let i;switch(this.animation_frame=void 0,this.vm.vsync(),this.vm.execute()){case os.Suspended:this._state.val=js.Running;break;case os.Paused:this._state.val=js.Paused,i=null===(t=null===(e=this.vm.get_instruction_pointer())||void 0===e?void 0:e.source_location)||void 0===t?void 0:t.line_no;break;case os.WaitingVsync:case os.WaitingInput:this._state.val=js.Running,this.schedule_frame();break;case os.WaitingSelection:this.vm.list_select(0),this._state.val=js.Running,this.schedule_frame();break;case os.Halted:this.stop()}this._pause_location.val=i,this.startup&&this._state.val===js.Running&&(this.startup=!1,this.run_floor_handler(this._game_state.area_variants.get(this.initial_area_id)||this.area_store.get_variant(this._game_state.episode,this.initial_area_id,0)))},this.create_vm_io=()=>{function e(e,t){const i=[e];if(t){const{instruction:e,source_location:o}=t;i.push(` [${e.opcode.mnemonic}`),o&&i.push(` ${o.line_no}:${o.col}`),i.push("]")}return i.join("")}return{bb_map_designate:(e,t,i)=>{this._game_state.area_variants.set(e,this.area_store.get_variant(this._game_state.episode,e,i))},set_floor_handler:(e,t)=>{this._game_state.floor_handlers.set(e,t)},window_msg:e=>{this.logger.info(`window_msg "${e}"`)},message:e=>{this.logger.info(`message "${e}"`)},add_msg:e=>{this.logger.info(`add_msg "${e}"`)},winend:()=>{},p_dead_v3:()=>!1,mesend:()=>{},list:e=>{this.logger.info(`list "[${e}]"`)},warning:(t,i)=>{this.logger.warn(e(t,i))},error:(t,i)=>{this.logger.error(e(t.message,i))}}},this.vm=new ss(this.create_vm_io()),this.debugger=new Rs(this.vm)}get game_state(){return this._game_state}run(e){this.stop(),this.logger.info("Starting debugger."),this.startup=!0,this.initial_area_id=0,this.npcs.splice(0,this.npcs.length,...e.npcs.val),this.objects.splice(0,this.objects.length,...e.objects.val),this._game_state=new xs(e.episode),this.vm.load_object_code(e.object_code.map(Do),this.game_state.episode),this.vm.start_thread(0),this.debugger.activate_breakpoints(),this._state.val=js.Running,this.schedule_frame()}resume(){this.debugger.resume(),this.schedule_frame()}step_over(){this.debugger.step_over(),this.schedule_frame()}step_into(){this.debugger.step_in(),this.schedule_frame()}step_out(){this.debugger.step_out(),this.schedule_frame()}stop(){this.running.val&&(this.logger.info("Stopping debugger."),null!=this.animation_frame&&(cancelAnimationFrame(this.animation_frame),this.animation_frame=void 0),this.vm.halt(),this.debugger.deactivate_breakpoints(),this._state.val=js.Stopped,this._pause_location.val=void 0,this.npcs.splice(0,this.npcs.length),this.objects.splice(0,this.objects.length),this._game_state=new xs(r.b.I))}set_breakpoint(e){const t=this.debugger.set_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}remove_breakpoint(e){const t=this.debugger.remove_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}toggle_breakpoint(e){this.debugger.toggle_breakpoint(e),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}clear_breakpoints(){this.debugger.clear_breakpoints(),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}schedule_frame(){null==this.animation_frame&&(this.animation_frame=requestAnimationFrame(this.execution_loop))}run_floor_handler(e){const t=e.area.id;this._game_state.current_area_variant.val=e,this._game_state.objects.push(...this.objects.filter(e=>e.area_id===t));const i=this._game_state.floor_handlers.get(t);null==i?this.logger.debug(`No floor handler registered for floor ${t}.`):(this.vm.start_thread(i),this.schedule_frame())}}var Ss=i("kcKQ"),Cs=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Os=X.c.get("quest_editor/gui/QuestEditorStore");class Ls extends Ss.a{constructor(e,t){super(),this.area_store=t,this._current_quest=Object(M.e)(void 0),this._current_area=Object(M.e)(void 0),this._selected_wave=Object(M.e)(void 0),this._selected_entity=Object(M.e)(void 0),this.debug=Object(M.e)(!1),this.undo=new ys,this.current_quest=this._current_quest,this.current_area=this._current_area,this.selected_wave=this._selected_wave,this.selected_entity=this._selected_entity,this.set_current_area=e=>{var t,i;e&&e.id!==(null===(i=null===(t=this.selected_wave.val)||void 0===t?void 0:t.area_id)||void 0===i?void 0:i.val)&&this.set_selected_wave(void 0),this._selected_entity.val=void 0,this._current_area.val=e},this.set_selected_wave=e=>{if(e){const t=this.selected_entity.val;t&&t instanceof K&&t.wave.val!==e&&this.set_selected_entity(void 0)}this._selected_wave.val=e},this.set_selected_entity=e=>{e&&this.current_quest.val&&(this._current_area.val=this.area_store.get_area(this.current_quest.val.episode,e.area_id)),this._selected_entity.val=e},this.set_section_on_quest_entity=(e,t)=>{const i=t.find(t=>t.id===e.section_id.val);i?e.set_section(i):Os.warn(`Section ${e.section_id.val} not found.`)},this.quest_runner=new Ts(t),this.disposables(e.tool.observe(({value:e})=>{e===le.b.QuestEditor&&this.undo.make_current()},{call_now:!0}),this.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof K&&!e.includes(t)&&this.set_selected_entity(void 0)}),this.current_quest.flat_map(e=>e?e.objects:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof we&&!e.includes(t)&&this.set_selected_entity(void 0)}),Object(v.h)(window,"beforeunload",e=>{this.quest_runner.stop(),this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}dispose(){this.quest_runner.stop(),super.dispose()}set_current_quest(e){return Cs(this,void 0,void 0,(function*(){if(this.undo.reset(),this.quest_runner.stop(),this._current_area.val=void 0,this._selected_entity.val=void 0,this._current_quest.val=e,e){this._current_area.val=this.area_store.get_area(e.episode,0);for(const t of e.area_variants.val){const i=yield this.area_store.get_area_sections(e.episode,t);t.set_sections(i);for(const o of e.objects.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){Os.error(e)}for(const o of e.npcs.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){Os.error(e)}}}}))}}var Ps,Ds,Bs=i("NUmZ"),Es=i.n(Bs);!function(e){e[e.NewAssembly=0]="NewAssembly",e[e.AssemblyChange=1]="AssemblyChange",e[e.SignatureHelp=2]="SignatureHelp",e[e.Definition=3]="Definition",e[e.SettingsChange=4]="SettingsChange"}(Ps||(Ps={})),function(e){e[e.NewObjectCode=0]="NewObjectCode",e[e.SignatureHelp=1]="SignatureHelp",e[e.Definition=2]="Definition"}(Ds||(Ds={}));const Ms=new DataView(new ArrayBuffer(4));function Ws(e){return Ms.setInt32(0,e),Ms.getFloat32(0)}function qs(e){return Ms.setFloat32(0,e),Ms.getInt32(0)}const Fs=X.c.get("quest_editor/scripting/disassembly");function zs(e,t){const i=[],o=Math.min(e.length,t.length);for(let s=0;snull!=e).map(e=>({label:e.mnemonic,kind:$s.Function,insertText:e.mnemonic})),As=[{label:".code",kind:$s.Keyword,insertText:"code"},{label:".data",kind:$s.Keyword,insertText:"data"},{label:".string",kind:$s.Keyword,insertText:"string"}];class Hs{constructor(e,t,i){this.can_undo=Object(M.e)(!1),this.can_redo=Object(M.e)(!1),this.action=Object(M.e)({description:e,undo:t,redo:i}),this.first_undo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_undo),this.first_redo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_redo)}make_current(){ws.current.val=this}undo(){return!!this.can_undo&&(this.action.val.undo(),!0)}redo(){return!!this.can_redo&&(this.action.val.redo(),!0)}reset(){this.can_undo.val=!1,this.can_redo.val=!1}}var Gs=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Ys=new class{constructor(){this._issues=Object(M.e)({warnings:[],errors:[]}),this.issues=this._issues,this.worker=new Es.a,this.promises=new Map,this.message_id=0,this.process_worker_message=e=>{const t=e.data;switch(t.type){case Ds.NewObjectCode:this.quest&&(this.quest.object_code.splice(0,this.quest.object_code.length,...t.object_code),this.quest.set_map_designations(t.map_designations),this._issues.val={warnings:t.warnings,errors:t.errors});break;case Ds.SignatureHelp:{const e=this.promises.get(t.id);if(e)if(this.promises.delete(t.id),t.opcode){let i=t.opcode.mnemonic+" ";const o=[];let s=!0;for(const e of t.opcode.params){let t;switch(s?s=!1:i+=", ",e.type.kind){case ft.ILabel:t="FuncLabel";break;case ft.DLabel:t="DataLabel";break;case ft.SLabel:t="StringLabel";break;case ft.ILabelVar:t="...FuncLabel";break;case ft.RegRef:case ft.RegTupRef:t="Register";break;case ft.RegRefVar:t="...Register";break;default:t=ft[e.type.kind]}o.push({label:[i.length,i.length+t.length],documentation:e.doc}),i+=t}const n={signatures:[{label:i,documentation:t.opcode.doc,parameters:o}],activeSignature:0,activeParameter:t.active_param};e.resolve(n)}else e.resolve(void 0)}break;case Ds.Definition:{const e=this.promises.get(t.id);if(e){this.promises.delete(t.id);const i=[];null!=t.line_no&&i.push({uri:e.uri,range:{startLineNumber:t.line_no,startColumn:t.col,endLineNumber:t.line_no,endColumn:t.col+t.len}}),e.resolve(i)}}}},this.worker.onmessage=this.process_worker_message}disassemble(e,t){this.quest=e;const i=function(e,t=!1){Fs.trace("disassemble start");const i=[],o=[];let s=void 0;for(const r of e){let e;switch(r.type){case Po.Instructions:e=".code";break;case Po.Data:e=".data";break;case Po.String:e=".string"}s!==r.type&&(s=r.type,i.length&&i.push(""),i.push(e,""));for(const e of r.labels)i.push(`${e}:`);if(r.type===Po.Data){const e=new Uint8Array(r.data);let t=" ";for(let o=0;o4&&i.push(t)}else if(r.type===Po.String)i.push(" "+(n=r.value,JSON.stringify(n.replace(//g,"\n"))));else{let e=!1;for(const s of r.instructions)if(s.opcode.code===Ht.code?e=!0:s.opcode.code===Gt.code&&(e=!1),t||e||s.opcode.stack!==Mt.Push){let e=[];s.opcode.stack===Mt.Pop?t||(e=Vs(s.opcode.params,o.splice(Math.max(0,o.length-s.opcode.params.length),s.opcode.params.length),!0)):e=Vs(s.opcode.params,zs(s.opcode.params,s.args),!1),i.push(" "+s.opcode.mnemonic+(e.length?" "+e.join(", "):""))}else o.push(...zs(s.opcode.params,s.args))}}var n;return i.length&&i.push(""),Fs.trace(`disassemble end, line count: ${i.length}`),i}(e.object_code,t),o={type:Ps.NewAssembly,assembly:i};return this.worker.postMessage(o),i}update_assembly(e){const t={type:Ps.AssemblyChange,changes:e.map(e=>({start_line_no:e.range.startLineNumber,start_col:e.range.startColumn,end_line_no:e.range.endLineNumber,end_col:e.range.endColumn,new_text:e.text}))};this.worker.postMessage(t)}provide_completion_items(e){return{suggestions:/^\s*([a-z][a-z0-9_=<>!]*)?$/.test(e)?Ns:/^\s*\.[a-z]+$/.test(e)?As:[],incomplete:!1}}provide_signature_help(e,t,i){return Us(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Signature help provision",e,e=>({type:Ps.SignatureHelp,id:e,line_no:t,col:i}))}))}provide_definition(e,t,i){return Us(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Definition provision",e,e=>({type:Ps.Definition,id:e,line_no:t,col:i}))}))}update_settings(e){const t={type:Ps.SettingsChange,settings:e};this.worker.postMessage(t)}dispose(){this.worker.terminate()}send_and_await_response(e,t,i){return Us(this,void 0,void 0,(function*(){const o=this.message_id++;return new Promise((s,n)=>{this.promises.set(o,{uri:t,resolve:s,reject:n});const r=i(o);this.worker.postMessage(r),setTimeout(()=>{this.promises.delete(o)&&n(new Error(`${e} timed out.`))},5e3)})}))}};Ve.languages.register({id:"psoasm"}),Ve.languages.setMonarchTokensProvider("psoasm",{defaultToken:"invalid",tokenizer:{root:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/r\d+/,"predefined"],[/[^\s]+:/,"tag"],[/0x[0-9a-fA-F]+/,"number.hex"],[/-?\d+(\.\d+)?(e-?\d+)?/,"number.float"],[/-?[0-9]+/,"number"],[/\.[^\s]+/,"keyword"],[/[a-z][a-z0-9_=<>!]*/,"identifier"],[/[ \t\r\n]+/,"white"],[/\/\/.*$/,"comment"],[/,/,"delimiter"]],string:[[/[^\\"]+/,"string"],[/\\(?:[n\\"])/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}}),Ve.languages.registerCompletionItemProvider("psoasm",{provideCompletionItems(e,t){const i=e.getValueInRange({startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:1,endColumn:t.column});return Ys.provide_completion_items(i)}}),Ve.languages.registerSignatureHelpProvider("psoasm",{signatureHelpTriggerCharacters:[" ",","],signatureHelpRetriggerCharacters:[", "],provideSignatureHelp(e,t){return Gs(this,void 0,void 0,(function*(){const i=yield Ys.provide_signature_help(e.uri,t.lineNumber,t.column);return i&&{value:i,dispose(){}}}))}}),Ve.languages.setLanguageConfiguration("psoasm",{indentationRules:{increaseIndentPattern:/^\s*\d+:/,decreaseIndentPattern:/^\s*(\d+|\.)/},autoClosingPairs:[{open:'"',close:'"'}],surroundingPairs:[{open:'"',close:'"'}],comments:{lineComment:"//"}}),Ve.languages.registerDefinitionProvider("psoasm",{provideDefinition:(e,t)=>Ys.provide_definition(e.uri,t.lineNumber,t.column)});class Ks extends Ss.a{constructor(e){super(),this.quest_editor_store=e,this.model_disposer=this.disposable(new d.a),this._model=Object(M.e)(void 0),this._did_undo=Object(M.a)(),this._did_redo=Object(M.a)(),this._inline_args_mode=Object(M.e)(!0),this.model=this._model,this.did_undo=this._did_undo,this.did_redo=this._did_redo,this.undo=new Hs("Text edits",()=>this._did_undo.emit({value:"asm undo"}),()=>this._did_redo.emit({value:"asm undo"})),this.inline_args_mode=this._inline_args_mode,this.has_issues=Ys.issues.map(e=>e.warnings.length+e.errors.length>0),this.set_inline_args_mode=e=>{this.has_issues.val||(this._inline_args_mode.val=e,Ys.update_settings({manual_stack:!this.inline_args_mode.val}),this.update_model())},this.quest_changed=()=>{this.update_model()},this.breakpoints=e.quest_runner.breakpoints,this.pause_location=e.quest_runner.pause_location,this.disposables(e.current_quest.observe(this.quest_changed,{call_now:!0}),Ys.issues.observe(({value:e})=>this.update_model_markers(e),{call_now:!0}),Object(v.h)(window,"beforeunload",e=>{this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}setup_editor_model_features(e){const t=e.getAlternativeVersionId();let i=t,o=t;this.model_disposer.add(e.onDidChangeContent(s=>{const n=e.getAlternativeVersionId();no&&(o=i)),this.undo.can_undo.val=!0),i=n,Ys.update_assembly(s.changes),this.update_breakpoints(s.changes)}))}update_model_markers({warnings:e,errors:t}){const i=this.model.val;i&&Ve.editor.setModelMarkers(i,"psoasm",e.map(e=>({severity:Ve.MarkerSeverity.Hint,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length,tags:[Ve.MarkerTag.Unnecessary]})).concat(t.map(e=>({severity:Ve.MarkerSeverity.Error,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length}))))}update_model(){this.undo.reset(),this.model_disposer.dispose_all();const e=this.quest_editor_store.current_quest.val;if(e){const t=!this.inline_args_mode.val,i=Ys.disassemble(e,t),o=this.model_disposer.add(Ve.editor.createModel(i.join("\n"),"psoasm"));this.setup_editor_model_features(o),this._model.val=o}else this._model.val=void 0}update_breakpoints(e){for(const t of e){const e=[];if(""===t.text){const i=t.range.endLineNumber-t.range.startLineNumber;if(i>0){for(let o=t.range.startLineNumber+1;o<=t.range.endLineNumber;o++){const t=Math.max(o-i,1);this.quest_editor_store.quest_runner.remove_breakpoint(o)&&e.push(t)}for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no-i))}}else{const i=t.text.split("\n").length-1;if(i>0)for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no+i))}for(const t of e)this.quest_editor_store.quest_runner.set_breakpoint(t)}}}class Qs{constructor(e,t,i,o){if(!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);if(!t)throw new Error("name is required.");if(!o)throw new Error("area_variants is required.");this.id=e,this.name=t,this.order=i,this.area_variants=o}}class Zs{constructor(e,t){if(this._sections=Object(M.c)(),this.sections=this._sections,!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);this.id=e,this.area=t}set_sections(e){return this._sections.val=e,this}}function Js(e){return Xs[e]}const Xs=[];function en(e,t,i,o){const s={id:e,name:t,order:i,area_variants:[]};for(let e=0;ethis.areas[e],this.get_area=(e,t)=>{const i=this.areas[e].find(e=>e.id===t);if(!i)throw new Error(`Area id ${t} for episode ${e} is invalid.`);return i},this.get_variant=(e,t,i)=>{const o=this.get_area(e,t).area_variants[i];if(!o)throw new Error(`Area variant id ${i} for area ${t} of episode ${r.b[e]} is invalid.`);return o},this.get_area_sections=(e,t)=>this.area_asset_loader.load_sections(e,t);for(const e of r.a)this.areas[e]=Js(e).map(e=>{const t=new Qs(e.id,e.name,e.order,[]);for(const i of e.area_variants)t.area_variants.push(new Zs(i.id,t));return t})}}function sn(e,t){e.seek_end(32);const i=e.u32(),o=e.u32();e.seek(8);const s=e.u32();return e.seek_start(i),{data_offset:s,index:t?function(e,t){const i=e.u16_array(t),o=[];let s=0;for(const t of i){s+=4*t,e.seek_start(s-4);const i=e.u32(),n=e.u32();o.push({offset:n,size:i})}return o}(e,o):[]}}var nn=i("kwt4");function rn(e,t,i){const o=[];for(let s=0;s=0){const e=new ln(n.id,Object(_n.a)(n.position),$(n.rotation.x,n.rotation.y,n.rotation.z),t);i.push(e),r.userData.section=e}}return[i,o]}class pn{constructor(e){this.http_client=e,this.disposer=new d.a,this.render_object_cache=this.disposer.add(new an),this.collision_object_cache=this.disposer.add(new an),this.area_sections_cache=this.disposer.add(new an)}dispose(){this.disposer.dispose()}load_sections(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.area_sections_cache.get_or_set(i,()=>this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>hn(e,t)[0]))}load_render_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>hn(e,t)[1])}load_collision_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.collision_object_cache.get_or_set(i,()=>this.get_area_asset(e,t,"collision").then(e=>(function(e){const{data_offset:t}=sn(e,!1);e.seek_start(t);const i=e.u32();e.seek_start(i);const o={meshes:[]};for(;e.bytes_left;){const t=e.position,i=e.u32();if(0===i)break;const s={vertices:[],triangles:[]};o.meshes.push(s),e.seek_start(i);const n=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();e.seek_start(r);for(let t=0;t(function(e){const t=new y.Group;for(const i of e.meshes){const e=new y.Geometry;for(const{x:t,y:o,z:s}of i.vertices)e.vertices.push(new y.Vector3(t,o,s));for(const{indices:t,flags:o,normal:s}of i.triangles){const i=16&o,n=1&o,r=64&o?3:i?2:n?1:0;0!==r&&e.faces.push(new y.Face3(t[0],t[1],t[2],new y.Vector3(s.x,s.y,s.z),void 0,r))}if(e.faces.length){e.computeBoundingBox(),e.computeBoundingSphere();const i=new y.Mesh(e,un);i.renderOrder=1,t.add(i);const o=new y.Mesh(e,vn);o.renderOrder=2,t.add(o)}}return t})(e))}load_render_object(e,t){return this.get_area_asset(e,t,"render").then(e=>(function(e){const t=[];e.seek_end(16);const{data_offset:i}=sn(e,!1);e.seek_start(i),e.seek(8);const o=e.u32();e.seek(4);const s=e.u32();for(let i=0;it.push({args:i,resolve:e,reject:o}));return 1===t.length&&function(){bn(this,void 0,void 0,(function*(){for(;t.length;){const{args:i,resolve:o,reject:s}=t[0];try{o(yield e(...i))}catch(e){s(e)}finally{t.shift()}}}))}(),o}}var mn=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const wn=new y.HemisphereLight(16777215,5263440,1.2),kn=new y.Scene,yn=new y.PerspectiveCamera(30,1,10,1e3),Rn=new y.Vector3(1,1,2).normalize(),In=1.3/Math.tan(yn.fov/180*Math.PI/2);class jn{constructor(e,t){this.entity_asset_loader=e,this.cache=new an,this.render_to_image=fn(e=>this.entity_asset_loader.load_geometry(e).then(t=>this.entity_asset_loader.load_textures(e).then(i=>{kn.remove(...kn.children),kn.add(wn);const o=E(e,t,i);kn.add(o);const s=o.geometry.boundingSphere;return yn.position.copy(Rn),yn.position.multiplyScalar(s.radius*In),yn.lookAt(s.center),this.renderer.render(kn,yn),this.renderer.domElement.toDataURL()}))),this.renderer=t(),this.renderer.setSize(100,100)}dispose(){this.renderer.dispose(),this.cache.dispose()}render(e){return mn(this,void 0,void 0,(function*(){return this.cache.get_or_set(e,()=>this.render_to_image(e))}))}}var xn=i("yub1"),Tn=i("iR5r"),Sn=i("4eU9");const Cn=X.c.get("quest_editor/loading/EntityAssetLoader"),On=new y.CylinderBufferGeometry(3,3,20);On.translate(0,10,0),On.computeBoundingBox(),On.computeBoundingSphere();const Ln=Sn.a.resolve(On),Pn=[],Dn=Sn.a.resolve(Pn);class Bn{constructor(e){this.http_client=e,this.disposer=new d.a,this.geom_cache=this.disposer.add(new an),this.tex_cache=this.disposer.add(new an),this.warm_up_caches()}dispose(){this.disposer.dispose()}load_geometry(e){return this.geom_cache.get_or_set(e,()=>this.load_data(e,En.Geometry).then(({url:t,data:i})=>{const o=new Vo.a(i,Fo.a.Little),s=t.endsWith(".nj")?Object(nn.c)(o):Object(nn.d)(o);return s.length?Object(cn.a)(s[0]):(Cn.warn(`Couldn't parse ${t} for ${C(e)}.`),On)}).catch(t=>(Cn.warn(`Couldn't load geometry file for ${C(e)}.`,t),On)))}load_textures(e){return this.tex_cache.get_or_set(e,()=>this.load_data(e,En.Texture).then(({data:e})=>{const t=new Vo.a(e,Fo.a.Little),i=Object(xn.a)(t);return Object(Tn.a)(i)}).catch(t=>(Cn.warn(`Couldn't load texture file for ${C(e)}.`,t),Pn)))}load_data(e,t){const i=function e(t,i){if(O(t))switch(t){case I.c.Dubswitch:return`/npcs/${I.c[t]}.${i===En.Geometry?"xj":"xvm"}`;case I.c.Hildebear2:return e(I.c.Hildebear,i);case I.c.Hildeblue2:return e(I.c.Hildeblue,i);case I.c.RagRappy2:return e(I.c.RagRappy,i);case I.c.Monest2:return e(I.c.Monest,i);case I.c.Mothmant2:return e(I.c.Mothmant,i);case I.c.PoisonLily2:return e(I.c.PoisonLily,i);case I.c.NarLily2:return e(I.c.NarLily,i);case I.c.GrassAssassin2:return e(I.c.GrassAssassin,i);case I.c.Dimenian2:return e(I.c.Dimenian,i);case I.c.LaDimenian2:return e(I.c.LaDimenian,i);case I.c.SoDimenian2:return e(I.c.SoDimenian,i);case I.c.DarkBelra2:return e(I.c.DarkBelra,i);case I.c.SavageWolf2:return e(I.c.SavageWolf,i);case I.c.BarbarousWolf2:return e(I.c.BarbarousWolf,i);case I.c.PanArms2:return e(I.c.PanArms,i);case I.c.Dubchic2:return e(I.c.Dubchic,i);case I.c.Gilchic2:return e(I.c.Gilchic,i);case I.c.Garanz2:return e(I.c.Garanz,i);case I.c.Dubswitch2:return e(I.c.Dubswitch,i);case I.c.Delsaber2:return e(I.c.Delsaber,i);case I.c.ChaosSorcerer2:return e(I.c.ChaosSorcerer,i);default:return`/npcs/${I.c[t]}.${i===En.Geometry?"nj":"xvm"}`}else{if(i!==En.Geometry)return`/objects/${x(t).pso_id}.xvm`;switch(t){case w.EasterEgg:case w.ChristmasTree:case w.ChristmasWreath:case w.TwentyFirstCentury:case w.Sonic:case w.WelcomeBoard:case w.FloatingJellyfish:case w.RuinsSeal:case w.Dolphin:case w.Cacti:case w.BigBrownRock:case w.PoisonPlant:case w.BigBlackRocks:case w.FallingRock:case w.DesertFixedTypeBoxBreakableCrystals:case w.BeeHive:return`/objects/${x(t).pso_id}.nj`;default:return`/objects/${x(t).pso_id}.xj`}}}(e,t);return this.http_client.get(i).array_buffer().then(e=>({url:i,data:e}))}warm_up_caches(){for(const e of[I.c.Unknown,I.c.Migium,I.c.Hidoom,I.c.DeathGunner,I.c.StRappy,I.c.HalloRappy,I.c.EggRappy,I.c.Migium2,I.c.Hidoom2,I.c.Recon,w.Unknown,w.PlayerSet,w.Particle,w.LightCollision,w.EnvSound,w.FogCollision,w.EventCollision,w.CharaCollision,w.ObjRoomID,w.LensFlare,w.ScriptCollision,w.MapCollision,w.ScriptCollisionA,w.ItemLight,w.RadarCollision,w.FogCollisionSW,w.ImageBoard,w.UnknownItem29,w.UnknownItem30,w.UnknownItem31,w.MenuActivation,w.BoxDetectObject,w.SymbolChatObject,w.TouchPlateObject,w.TargetableObject,w.EffectObject,w.CountDownObject,w.UnknownItem38,w.UnknownItem39,w.UnknownItem40,w.UnknownItem41,w.TelepipeLocation,w.BGMCollision,w.Pioneer2InvisibleTouchplate,w.TempleMapDetect,w.Firework,w.MainRagolTeleporterBattleInNextArea,w.Rainbow,w.FloatingBlueLight,w.PopupTrapNoTech,w.Poison,w.EnemyTypeBoxYellow,w.EnemyTypeBoxBlue,w.EmptyTypeBoxBlue,w.FloatingRocks,w.FloatingSoul,w.Butterfly,w.UnknownItem400,w.CCAAreaTeleporter,w.UnknownItem523,w.WhiteBird,w.OrangeBird,w.UnknownItem529,w.UnknownItem530,w.Seagull,w.UnknownItem576,w.WarpInBarbaRayRoom,w.UnknownItem672,w.InstaWarp,w.LabInvisibleObject,w.UnknownItem700])this.geom_cache.set(e,Ln),this.tex_cache.set(e,Dn)}}var En;!function(e){e[e.Geometry=0]="Geometry",e[e.Texture=1]="Texture"}(En||(En={}));var Mn=i("I7a6"),Wn=i("LvDl"),qn=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Fn="QuestEditorUiPersister.layout_config";class zn extends Mn.a{constructor(){super(...arguments),this.persist_layout_config=Object(Wn.throttle)(e=>{this.persist(Fn,this.to_persisted_item_config(e))},500,{leading:!1,trailing:!0})}load_layout_config(e){return qn(this,void 0,void 0,(function*(){const t=yield this.load(Fn);if(t){const i=this.extract_components(e),o=this.sanitized_layout_config(this.from_persisted_item_config(t),i);if(o)return o}}))}sanitized_layout_config(e,t){const i=new Set,o=e.map(e=>this.sanitize_layout_child(e,t,i));if(i.size===t.size)return o.filter(e=>e)}sanitize_layout_child(e,t,i){if(!e)return;switch(e.type){case"component":{if(!("componentName"in e))return;const o=t.get(e.componentName);if(!o)return;i.add(e.componentName),e.id=o.id,e.title=o.title}break;case"stack":if(null==e.content||0===e.content.length)return}e.content&&(e.content=e.content.map(e=>this.sanitize_layout_child(e,t,i)).filter(e=>e));const o=e;return null!=o.activeItemIndex&&(null==o.content||o.activeItemIndex>=o.content.length)&&(o.activeItemIndex=void 0),e}extract_components(e,t=new Map){for(const i of e)"componentName"in i&&t.set(i.componentName,i),i.content&&this.extract_components(i.content,t);return t}to_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.to_persisted_item_config(e.content)}))}from_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.from_persisted_item_config(e.content),isClosable:"component"!==e.type&&void 0}))}}var Vn=i("6cU9");class Un extends Ue.a{constructor(e){const t=new _t({text:"New quest",icon_left:v.a.NewFile,items:[r.b.I],to_label:e=>`Episode ${r.b[e]}`}),i=new Vn.a("Open file...",{icon_left:v.a.File,accept:".bin, .dat, .qst",multiple:!0,tooltip:"Open a quest file (Ctrl-O)"}),o=new tt.a({text:"Save as...",icon_left:v.a.Save,tooltip:"Save this quest to new file (Ctrl-Shift-S)"}),s=new tt.a({text:"Undo",icon_left:v.a.Undo,tooltip:ws.first_undo.map(e=>(e?`Undo "${e.description}"`:"Nothing to undo")+" (Ctrl-Z)")}),n=new tt.a({text:"Redo",icon_left:v.a.Redo,tooltip:ws.first_redo.map(e=>(e?`Redo "${e.description}"`:"Nothing to redo")+" (Ctrl-Shift-Z)")}),a=new rs.a({items:e.areas,to_label:({label:e})=>e}),d=new tt.a({text:"Debug",icon_left:v.a.Play,tooltip:"Debug the current quest in a virtual machine (F5)"}),c=new tt.a({text:"Continue",icon_left:v.a.SquareArrowRight,tooltip:"Resume execution (F6)"}),l=new tt.a({text:"Step over",icon_left:v.a.LongArrowRight,tooltip:"Execute the next line and step over any function calls (F8)"}),_=new tt.a({text:"Step into",icon_left:v.a.LevelDown,tooltip:"Execute the next line and step inside any function calls (F7)"}),u=new tt.a({text:"Step out",icon_left:v.a.LevelUp,tooltip:"Execute until outside of current call frame (Shift-F8)"}),h=new tt.a({text:"Stop",icon_left:v.a.Stop,tooltip:"Stop execution (Shift-F5)"}),p=[t,i,o,s,n,a];e.vm_feature_active&&p.push(d,c,l,_,u,h),super(...p),this.disposables(t.chosen.observe(({value:t})=>e.create_new_quest(t)),i.files.observe(({value:t})=>e.open_files(t)),o.click.observe(e.save_as),o.enabled.bind_to(e.can_save),s.click.observe(()=>ws.undo()),s.enabled.bind_to(e.can_undo),n.click.observe(()=>ws.redo()),n.enabled.bind_to(e.can_redo),a.selected.bind_to(e.current_area),a.selected.observe(({value:t})=>e.set_area(t)),a.enabled.bind_to(e.can_select_area),d.click.observe(e.debug),d.enabled.bind_to(e.can_debug),c.click.observe(e.resume),c.enabled.bind_to(e.can_step),l.click.observe(e.step_over),l.enabled.bind_to(e.can_step),_.click.observe(e.step_in),_.enabled.bind_to(e.can_step),u.click.observe(e.step_out),u.enabled.bind_to(e.can_step),h.click.observe(e.stop),h.enabled.bind_to(e.can_stop)),this.finalize_construction()}}class $n{constructor(){this.disposer=new d.a}dispose(){this.disposer.dispose()}disposable(e){return this.disposer.add(e)}disposables(...e){this.disposer.add_all(...e)}}const Nn=X.c.get("quest_editor/model/QuestModel");class An{constructor(e,t,i,o,s,n,a,d,c,l,_,u,v,h){this.area_store=e,this._id=Object(M.e)(0),this._language=Object(M.e)(0),this._name=Object(M.e)(""),this._short_description=Object(M.e)(""),this._long_description=Object(M.e)(""),this._area_variants=Object(M.c)(),this.id=this._id,this.language=this._language,this.name=this._name,this.short_description=this._short_description,this.long_description=this._long_description,this.area_variants=this._area_variants,this.update_area_variants=()=>{const e=new Map;for(const t of this.entities_per_area.val.keys())try{e.set(t,this.area_store.get_variant(this.episode,t,0))}catch(e){Nn.warn(e)}for(const[t,i]of this.map_designations.val)try{e.set(t,this.area_store.get_variant(this.episode,t,i))}catch(e){Nn.warn(e)}this._area_variants.val=[...e.values()]},Object(r.c)(a),Object(U.e)(d,"map_designations"),Object(U.h)(c,"objs"),Object(U.h)(l,"npcs"),Object(U.e)(_,"event_dags"),Object(U.h)(u,"dat_unknowns"),Object(U.h)(v,"object_code"),Object(U.h)(h,"shop_items"),this.set_id(t),this.set_language(i),this.set_name(o),this.set_short_description(s),this.set_long_description(n),this.episode=a,this._map_designations=Object(M.e)(d),this.map_designations=this._map_designations,this._objects=Object(M.c)(void 0,...c),this.objects=this._objects,this._npcs=Object(M.c)(void 0,...l),this.npcs=this._npcs,this.event_dags=_,this.dat_unknowns=u,this.object_code=v,this.shop_items=h,this.entities_per_area=Object(M.d)((e,t)=>{const i=new Map;for(const t of e)i.set(t.area_id,(i.get(t.area_id)||0)+1);for(const e of t)i.set(e.area_id,(i.get(e.area_id)||0)+1);return i},this.npcs,this.objects),this.entities_per_area.observe(this.update_area_variants,{call_now:!0}),this.map_designations.observe(this.update_area_variants,{call_now:!0})}set_id(e){return Object(U.c)(e>=0,`id should be greater than or equal to 0, was ${e}.`),this._id.val=e,this}set_language(e){return Object(U.c)(e>=0,`language should be greater than or equal to 0, was ${e}.`),this._language.val=e,this}set_name(e){return Object(U.c)(e.length<=32,`name can't be longer than 32 characters, got "${e}".`),this._name.val=e,this}set_short_description(e){return Object(U.c)(e.length<=128,`short_description can't be longer than 128 characters, got "${e}".`),this._short_description.val=e,this}set_long_description(e){return Object(U.c)(e.length<=288,`long_description can't be longer than 288 characters, got "${e}".`),this._long_description.val=e,this}set_map_designations(e){return this._map_designations.val=e,this}add_entity(e){if(e instanceof we)this.add_object(e);else{if(!(e instanceof K))throw new Error(`${C(e.type)} not supported.`);this.add_npc(e)}}add_object(e){this._objects.push(e)}add_npc(e){this._npcs.push(e)}remove_entity(e){if(e instanceof we)this._objects.remove(e);else{if(!(e instanceof K))throw new Error(`${C(e.type)} not supported.`);this._npcs.remove(e)}}insert_event(e,t,i,o){const s=t.wave.area_id.val;let n=this.event_dags.get(s);n||(n=new it(s),this.event_dags.set(s,n)),n.insert_event(e,t,i,o)}get_event_dag_or_create(e){let t=this.event_dags.get(e);return t||(t=new it(e),this.event_dags.set(e,t)),t}add_event(e,t,i){const o=e.wave.area_id.val;let s=this.event_dags.get(o);s||(s=new it(o),this.event_dags.set(o,s)),s.add_event(e,t,i)}remove_event(e,t){for(const e of this.npcs)e.wave.val===t.wave&&e.set_wave(void 0);e.remove_event(t)}}var Hn;!function(e){e[e.Int=0]="Int",e[e.Float=1]="Float",e[e.InvalidNumber=2]="InvalidNumber",e[e.Register=3]="Register",e[e.Label=4]="Label",e[e.CodeSection=5]="CodeSection",e[e.DataSection=6]="DataSection",e[e.StringSection=7]="StringSection",e[e.InvalidSection=8]="InvalidSection",e[e.String=9]="String",e[e.UnterminatedString=10]="UnterminatedString",e[e.Ident=11]="Ident",e[e.InvalidIdent=12]="InvalidIdent",e[e.ArgSeparator=13]="ArgSeparator"}(Hn||(Hn={}));class Gn{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(e){this.line=e,this.index=0,this._mark=0;const t=[];for(;this.has_next();){const e=this.peek();let i;if("/"===e){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(e)?this.skip():(/[-\d]/.test(e)?i=this.tokenize_number_or_label():","===e?(i={type:Hn.ArgSeparator,col:this.col,len:1},this.skip()):i="."===e?this.tokenize_section():'"'===e?this.tokenize_string():"r"===e?this.tokenize_register_or_ident():this.tokenize_ident(),t.push(i))}return t}has_next(){return this.index!]*$/.test(t)?Hn.Ident:Hn.InvalidIdent;return i===Hn.Ident?{type:i,col:e,len:this.marked_len(),value:t}:{type:i,col:e,len:this.marked_len()}}}const Yn=X.c.get("quest_editor/scripting/assembly");class Kn{constructor(e,t){this.assembly=e,this.manual_stack=t,this.lexer=new Gn,this.section=Po.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=Po.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const e of this.assembly){if(this.tokens=this.lexer.tokenize_line(e),this.tokens.length>0){const e=this.tokens.shift();let t=!1;switch(e.type){case Hn.Label:this.parse_label(e),t=!0;break;case Hn.CodeSection:case Hn.DataSection:case Hn.StringSection:this.parse_section(e);break;case Hn.Int:this.section===Po.Data?this.parse_bytes(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Hn.String:this.section===Po.String?this.parse_string(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Hn.Ident:this.section===Po.Instructions?this.parse_instruction(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Hn.InvalidSection:this.add_error({col:e.col,length:e.len,message:"Invalid section type."});break;case Hn.InvalidIdent:this.add_error({col:e.col,length:e.len,message:"Invalid identifier."});break;default:this.add_error({col:e.col,length:e.len,message:"Unexpected token."})}this.prev_line_had_label=t}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(e,t,i,o,s,n){if(this.segment)this.segment.type===Po.Instructions?this.segment.instructions.push(Oo(e,t,{mnemonic:o&&{line_no:this.line_no,col:o.col,len:o.len},args:s.map(e=>({line_no:this.line_no,col:e.col,len:e.len})),stack_args:n.map((e,t)=>({line_no:this.line_no,col:e.col,len:e.len,value:i[t].value}))})):Yn.error(`Line ${this.line_no}: Expected instructions segment.`);else{const e={labels:[],type:Po.Instructions,instructions:[],asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_bytes(e){if(this.segment)if(this.segment.type===Po.Data){const t=new ArrayBuffer(this.segment.data.byteLength+e.length),i=new Uint8Array(t);i.set(new Uint8Array(this.segment.data)),i.set(new Uint8Array(e),this.segment.data.byteLength),this.segment.data=t}else Yn.error(`Line ${this.line_no}: Expected data segment.`);else{const t={labels:[],type:Po.Data,data:new Uint8Array(e).buffer,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_string(e){if(this.segment)this.segment.type===Po.String?this.segment.value+=e:Yn.error(`Line ${this.line_no}: Expected string segment.`);else{const t={labels:[],type:Po.String,value:e,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_error({col:e,length:t,message:i}){this.errors.push({line_no:this.line_no,col:e,length:t,message:i})}add_warning({col:e,length:t,message:i}){this.warnings.push({line_no:this.line_no,col:e,length:t,message:i})}parse_label({col:e,len:t,value:i}){this.labels.has(i)&&this.add_error({col:e,length:t,message:"Duplicate label."}),this.labels.add(i);const o=this.tokens.shift(),s={line_no:this.line_no,col:e,len:t};if(this.prev_line_had_label){const e=this.object_code[this.object_code.length-1];e.labels.push(i),e.asm.labels.push(s)}switch(this.section){case Po.Instructions:this.prev_line_had_label||(this.segment={type:Po.Instructions,labels:[i],instructions:[],asm:{labels:[s]}},this.object_code.push(this.segment)),o&&(o.type===Hn.Ident?this.parse_instruction(o):this.add_error({col:o.col,length:o.len,message:"Expected opcode mnemonic."}));break;case Po.Data:this.prev_line_had_label||(this.segment={type:Po.Data,labels:[i],data:new ArrayBuffer(0),asm:{labels:[s]}},this.object_code.push(this.segment)),o&&(o.type===Hn.Int?this.parse_bytes(o):this.add_error({col:o.col,length:o.len,message:"Expected bytes."}));break;case Po.String:this.prev_line_had_label||(this.segment={type:Po.String,labels:[i],value:"",asm:{labels:[s]}},this.object_code.push(this.segment)),o&&(o.type===Hn.String?this.parse_string(o):this.add_error({col:o.col,length:o.len,message:"Expected a string."}))}}parse_section({type:e,col:t,len:i}){let o;switch(e){case Hn.CodeSection:o=Po.Instructions;break;case Hn.DataSection:o=Po.Data;break;case Hn.StringSection:o=Po.String}this.section!==o||this.first_section_marker||this.add_warning({col:t,length:i,message:"Unnecessary section marker."}),this.section=o,this.first_section_marker=!1;const s=this.tokens.shift();s&&this.add_error({col:s.col,length:s.len,message:"Unexpected token."})}parse_instruction(e){const{col:t,len:i,value:o}=e,s=Ft.get(o);if(s){const i=-1!==s.params.findIndex(e=>e.type.kind===ft.ILabelVar||e.type.kind===ft.RegRefVar),o=this.manual_stack&&s.stack===Mt.Pop?0:s.params.length;let n=0;for(const e of this.tokens)e.type!==Hn.ArgSeparator&&n++;const r=this.tokens[this.tokens.length-1],a=r?r.col+r.len-t:0,d=[],c=[];if(!i&&n!==o)return void this.add_error({col:t,length:a,message:`Expected ${o} argument${1===o?"":"s"}, got ${n}.`});if(i&&nd?this.add_error({col:s,length:n,message:`${r}-Bit integer can't be greater than ${d}.`}):i.push([{value:o,size:e},t])}parse_register(e,t){const{col:i,len:o,value:s}=e;s>255?this.add_error({col:i,length:o,message:"Invalid register reference, expected r0-r255."}):t.push([{value:s,size:1},e])}parse_bytes(e){const t=[];let i=e,o=0;for(;i.type===Hn.Int&&(i.value<0?this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be less than 0."}):i.value>255&&this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be greater than 255."}),t.push(i.value),o"))}}function Qn(e,t){if(t===r.b.II)throw new Error("Episode II not yet supported.");if(t===r.b.IV)throw new Error("Episode IV not yet supported.");return new An(e,0,0,"Untitled","Created with phantasmal.world.","Created with phantasmal.world.",t,(new Map).set(0,0),[new we(w.MenuActivation,16384,0,0,10,new y.Vector3(-16.313568115234375,3,-579.5118408203125),$(.0009587526218325454,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365279104]]),[[2,0,0,0,0,0],[0,0]]),new we(w.MenuActivation,16385,0,0,10,new y.Vector3(-393.07318115234375,10,-12.964752197265625),$(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279264]]),[[2,0,1,0,0,0],[0,0]]),new we(w.MenuActivation,16386,0,0,10,new y.Vector3(-458.60699462890625,10,-51.270660400390625),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365279424]]),[[2,0,2,0,0,0],[0,0]]),new we(w.MenuActivation,16387,0,0,10,new y.Vector3(-430.19696044921875,10,-24.490447998046875),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365279584]]),[[2,0,3,0,0,0],[0,0]]),new we(w.PlayerSet,16388,0,0,10,new y.Vector3(.995330810546875,0,-37.0010986328125),$(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279744]]),[[2,0,4,0,0,0],[0,0]]),new we(w.PlayerSet,16389,0,0,10,new y.Vector3(3.0009307861328125,0,-23.99688720703125),$(0,4.859725289544806,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279904]]),[[2,0,5,0,0,0],[0,0]]),new we(w.PlayerSet,16390,0,0,10,new y.Vector3(2.0015106201171875,0,-50.00386047363281),$(0,4.565196484117848,0),new Map([["property_0",2.000002384185791],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365280064]]),[[2,0,6,0,0,0],[0,0]]),new we(w.PlayerSet,16391,0,0,10,new y.Vector3(4.9973907470703125,0,-61.99664306640625),$(0,4.368843947166543,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",65536],["property_4",10],["property_5",0],["property_6",2365280224]]),[[2,0,7,0,0,0],[0,0]]),new we(w.MainRagolTeleporter,18264,0,0,10,new y.Vector3(132.00314331054688,1.000000238418579,-265.002197265625),$(0,.49088134237826325,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365227216]]),[[0,0,87,7,0,0],[0,0]]),new we(w.PrincipalWarp,16393,0,0,10,new y.Vector3(-228,0,-2020.99951171875),$(0,2.9452880542695796,0),new Map([["property_0",-10.000004768371582],["property_1",0],["property_2",-30.000030517578125],["property_3",0],["property_4",65536],["property_5",65536],["property_6",2365280688]]),[[2,0,9,0,0,0],[0,0]]),new we(w.MenuActivation,16394,0,0,10,new y.Vector3(-41.000030517578125,0,42.37322998046875),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",4],["property_4",0],["property_5",0],["property_6",2365280992]]),[[2,0,10,0,0,0],[1,0]]),new we(w.MenuActivation,16395,0,0,10,new y.Vector3(-479.21673583984375,8.781256675720215,-322.465576171875),$(6.28328118244177,.0009587526218325454,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",5],["property_4",0],["property_5",0],["property_6",2365281152]]),[[2,0,11,0,0,0],[0,0]]),new we(w.PrincipalWarp,16396,0,0,10,new y.Vector3(-228,0,-351.0015869140625),$(0,0,0),new Map([["property_0",10.000006675720215],["property_1",0],["property_2",-1760.0010986328125],["property_3",32768],["property_4",0],["property_5",0],["property_6",2365281312]]),[[2,0,12,0,0,0],[0,0]]),new we(w.TelepipeLocation,16397,0,0,10,new y.Vector3(-561.88232421875,0,-406.8829345703125),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365281616]]),[[2,0,13,0,0,0],[0,0]]),new we(w.TelepipeLocation,16398,0,0,10,new y.Vector3(-547.8557739257812,0,-444.8822326660156),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365281808]]),[[2,0,14,0,0,0],[0,0]]),new we(w.TelepipeLocation,16399,0,0,10,new y.Vector3(-486.441650390625,0,-497.4501647949219),$(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365282e3]]),[[2,0,15,0,0,0],[0,0]]),new we(w.TelepipeLocation,16400,0,0,10,new y.Vector3(-522.4052734375,0,-474.1882629394531),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365282192]]),[[2,0,16,0,0,0],[0,0]]),new we(w.MedicalCenterDoor,16401,0,0,10,new y.Vector3(-34.49853515625,0,-384.4951171875),$(0,5.497871034636549,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282384]]),[[2,0,17,0,0,0],[0,0]]),new we(w.ShopDoor,16402,0,0,10,new y.Vector3(-393.0031433105469,0,-143.49981689453125),$(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282640]]),[[2,0,18,0,0,0],[0,0]]),new we(w.MenuActivation,16403,0,0,10,new y.Vector3(-355.17462158203125,0,-43.15193176269531),$(0,0,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",6],["property_4",0],["property_5",0],["property_6",2365282896]]),[[2,0,19,0,0,0],[0,0]]),new we(w.HuntersGuildDoor,16404,0,0,10,new y.Vector3(-43.00239562988281,0,-118.00120544433594),$(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283056]]),[[2,0,20,0,0,0],[0,0]]),new we(w.TeleporterDoor,16405,0,0,10,new y.Vector3(26.000823974609375,0,-265.99810791015625),$(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283312]]),[[2,0,21,0,0,0],[0,0]]),new we(w.PlayerSet,16406,0,0,10,new y.Vector3(57.81005859375,0,-268.5472412109375),$(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283568]]),[[2,0,22,0,0,0],[0,0]]),new we(w.PlayerSet,16407,0,0,10,new y.Vector3(66.769287109375,0,-252.3748779296875),$(0,4.712460886831327,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283728]]),[[2,0,23,0,0,0],[0,0]]),new we(w.PlayerSet,16408,0,0,10,new y.Vector3(67.36819458007812,0,-284.9297180175781),$(0,4.712460886831327,0),new Map([["property_0",2.000000476837158],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283888]]),[[2,0,24,0,0,0],[0,0]]),new we(w.PlayerSet,16409,0,0,10,new y.Vector3(77.10488891601562,0,-269.2830505371094),$(0,4.712460886831327,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365284048]]),[[2,0,25,0,0,0],[0,0]])],[new K(I.c.GuildLady,29,1011.0010986328125,void 0,0,850,0,0,10,new y.Vector3(-49.0010986328125,0,50.996429443359375),$(0,2.3562304434156633,0),new y.Vector3(0,0,0),[[0,0,7,86,0,0,0,0,23,87],[128,238,223,176]]),new K(I.c.FemaleFat,4,1016.0010986328125,void 0,0,100,1,0,20,new y.Vector3(167.99769592285156,0,83.99686431884766),$(0,3.927050739026106,0),new y.Vector3(24.000009536743164,0,0),[[0,0,7,88,0,0,0,0,23,89],[128,238,232,48]]),new K(I.c.MaleDwarf,10,1015.0010986328125,void 0,0,90,1,0,20,new y.Vector3(156.0028839111328,0,-49.99967575073242),$(0,5.497871034636549,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,89,0,0,0,0,23,90],[128,238,236,176]]),new K(I.c.RedSoldier,26,1020.0010986328125,void 0,0,130,0,0,20,new y.Vector3(237.9988250732422,0,-14.0001220703125),$(0,5.497871034636549,0),new y.Vector3(0,0,0),[[0,0,7,90,0,0,0,0,23,91],[128,238,241,48]]),new K(I.c.BlueSoldier,25,1019.0010986328125,void 0,0,120,0,0,20,new y.Vector3(238.00379943847656,0,63.00413513183594),$(0,3.927050739026106,0),new y.Vector3(0,0,0),[[0,0,7,91,0,0,0,0,23,92],[128,238,245,176]]),new K(I.c.FemaleMacho,5,1014.0010986328125,void 0,0,80,1,0,20,new y.Vector3(-2.001882553100586,0,35.0036506652832),$(0,3.141640591220885,0),new y.Vector3(26.000009536743164,0,0),[[0,0,7,92,0,0,0,0,23,93],[128,238,250,48]]),new K(I.c.Scientist,30,1013.0010986328125,void 0,0,70,1,0,20,new y.Vector3(-147.0000457763672,0,-7.996537208557129),$(0,2.577127047485882,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,93,0,0,0,0,23,94],[128,238,254,176]]),new K(I.c.MaleOld,13,1012.0010986328125,void 0,0,60,1,0,20,new y.Vector3(-219.99710083007812,0,-100.0008316040039),$(0,0,0),new y.Vector3(30.000011444091797,0,0),[[0,0,7,94,0,0,0,0,23,95],[128,239,3,48]]),new K(I.c.GuildLady,29,1010.0010986328125,void 0,0,840,0,0,20,new y.Vector3(-262.5099792480469,0,-24.53999900817871),$(0,1.963525369513053,0),new y.Vector3(0,0,0),[[0,0,7,95,0,0,0,0,23,106],[128,239,100,192]]),new K(I.c.Tekker,28,1009,void 0,0,830,0,0,30,new y.Vector3(-43.70983123779297,2.5999999046325684,-52.78248596191406),$(0,.7854101478052212,0),new y.Vector3(0,0,0),[[0,0,7,97,0,0,0,0,23,98],[128,239,16,176]]),new K(I.c.MaleMacho,12,1006,void 0,0,800,0,0,30,new y.Vector3(.33990478515625,2.5999999046325684,-84.71995544433594),$(0,0,0),new y.Vector3(0,0,0),[[0,0,7,98,0,0,0,0,23,99],[128,239,21,48]]),new K(I.c.FemaleMacho,5,1008,void 0,0,820,0,0,30,new y.Vector3(43.87113952636719,2.5999996662139893,-74.80299377441406),new y.Euler(0,-.5645135437350027,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,99,0,0,0,0,23,100],[128,239,25,176]]),new K(I.c.MaleFat,11,1007.0010986328125,void 0,0,810,0,0,30,new y.Vector3(75.88380432128906,2.5999996662139893,-42.69328308105469),new y.Euler(0,-1.0308508189943528,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,100,0,0,0,0,23,101],[128,239,30,48]]),new K(I.c.FemaleTall,7,1021.0010986328125,void 0,0,140,1,0,30,new y.Vector3(16.003997802734375,0,5.995697021484375),new y.Euler(0,-1.1781152217078317,0,"ZXY"),new y.Vector3(22.000009536743164,0,0),[[0,0,7,101,0,0,0,0,23,102],[128,239,34,176]]),new K(I.c.Nurse,31,1017,void 0,0,860,0,0,40,new y.Vector3(.3097381591796875,3,-105.3865966796875),$(0,0,0),new y.Vector3(0,0,0),[[0,0,7,102,0,0,0,0,23,103],[128,239,39,48]]),new K(I.c.Nurse,31,1018.0010986328125,void 0,0,110,1,0,40,new y.Vector3(53.499176025390625,0,-26.496688842773438),$(0,5.497871034636549,0),new y.Vector3(18.000009536743164,0,0),[[0,0,7,103,0,0,0,0,23,104],[128,239,43,176]])],new Map,[],function(e,t=!1){Yn.trace("assemble start");const i=new Kn(e,t).assemble();return Yn.trace(`assemble end with ${i.warnings.length} warnings and ${i.errors.length} errors.`),i}(".code\n\n0:\n set_episode 0\n set_floor_handler 0, 150\n bb_map_designate 0, 0, 0, 0\n ret\n150:\n leti r60, 237\n leti r61, 0\n leti r62, 333\n leti r63, -15\n p_setpos 0, r60\n leti r60, 255\n leti r61, 0\n leti r62, 338\n leti r63, -43\n p_setpos 1, r60\n leti r60, 222\n leti r61, 0\n leti r62, 322\n leti r63, 25\n p_setpos 2, r60\n leti r60, 248\n leti r61, 0\n leti r62, 323\n leti r63, -20\n p_setpos 3, r60\n ret".split("\n")).object_code,[])}var Zn=i("Sa3/"),Jn=i("9dYx");class Xn extends Jn.a{constructor(e,t,i=0,o=e.size-i){if(i<0||i>e.size)throw new Error(`Offset ${i} is out of bounds.`);if(o<0||i+o>e.size)throw new Error(`Size ${o} is out of bounds.`);super(t,i),this.buffer=e,this._size=o}get size(){return this._size}set size(e){e>this._size?this.ensure_size(e-this.position):this._size=e}get backing_buffer(){return this.buffer.backing_buffer}get dv(){return this.buffer.view}take(e){this.check_size("size",e,e);const t=this.offset+this.position,i=new Xn(this.buffer,this.endianness,t,e);return this._position+=e,i}ensure_size(e,t=this.position){const i=t+e-this._size;i>0&&(this._size+=i,this.buffer.sizethis.capacity){let t=this.capacity||e;do{t*=2}while(t=s;t--){let s=e.position,n=t,r=0;for(;s+3=o&&(i=t,o=r,r>=255))break}o<3?t.add_u8(e.u8()):(t.copy(i-e.position,o),e.seek(o))}return t.finalize()}class ir{constructor(e,t){this.flags=0,this.flag_bits_left=0,this.flag_offset=0,this.output=new Xn(new er(e),t)}add_u8(e){this.write_control_bit(1),this.write_u8(e)}copy(e,t){e>-256&&t<=5?this.short_copy(e,t):this.long_copy(e,t)}finalize(){this.write_control_bit(0),this.write_control_bit(1),this.flags>>>=this.flag_bits_left;const e=this.output.position;return this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e),this.write_u8(0),this.write_u8(0),this.output.seek_start(0)}write_control_bit(e){if(0==this.flag_bits_left--){const e=this.output.position;this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e).write_u8(0),this.flag_offset=e,this.flag_bits_left=7}this.flags>>>=1,e&&(this.flags|=128)}write_u8(e){this.output.write_u8(e)}short_copy(e,t){t-=2,this.write_control_bit(0),this.write_control_bit(0),this.write_control_bit(t>>>1&1),this.write_control_bit(1&t),this.write_u8(255&e)}long_copy(e,t){t<=9?(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248|t-2&7),this.write_u8(e>>5&255)):(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248),this.write_u8(e>>5&255),this.write_u8(t-1))}}const or=X.c.get("core/data_formats/compression/prs/decompress");function sr(e){const t=new nr(e);for(;;)if(1===t.read_flag_bit())t.copy_u8();else{let e,i;if(0===t.read_flag_bit())e=t.read_flag_bit()<<1,e|=t.read_flag_bit(),e+=2,i=t.read_u8()-256;else{if(i=t.read_u16(),0===i)break;e=7&i,i>>>=3,0===e?(e=t.read_u8(),e+=1):e+=2,i-=8192}t.offset_copy(i,e)}return t.dst.seek_start(0)}class nr{constructor(e){this.src=e,this.dst=new Xn(new er(Math.floor(1.5*e.size)),e.endianness),this.flags=0,this.flag_bits_left=0}read_flag_bit(){0===this.flag_bits_left&&(this.flags=this.read_u8(),this.flag_bits_left=8);const e=1&this.flags;return this.flags>>>=1,this.flag_bits_left-=1,e}copy_u8(){this.dst.write_u8(this.read_u8())}read_u8(){return this.src.u8()}read_u16(){return this.src.u16()}offset_copy(e,t){(e<-8192||e>0)&&or.error(`offset was ${e}, should be between -8192 and 0.`),(t<1||t>256)&&or.error(`length was ${t}, should be between 1 and 256.`);const i=Math.min(-e,t);this.dst.seek(e);const o=this.dst.take(i);this.dst.seek(-e-i);for(let e=0;ee.value);break;case wi.code:case Yt.code:a=rr.Call,d=[r.args[0].value];break;case Ni.code:a=rr.Call,d=r.args.slice(1).map(e=>e.value);break;default:if(n===i-1){a=rr.None,d=[];break}continue}const c=new ar(t,o,n+1,a,d);for(let t=c.start;t{let e=0,t=NaN;return{next:()=>{let i=!0;return ethis.intervals[e].end?(e++,ee+t.end-t.start+1,0)}get(e){for(const{start:t,end:i}of this.intervals){const o=i-t+1;if(ethis.intervals[o].start;)e.end=this.intervals[o].end,o++;this.intervals.splice(t+1,o-t-1),e.end=Math.max(e.end,i.end),t++;continue e}t++}this.intervals.push(i)}return this}to_array(){const e=[];for(const{start:t,end:i}of this.intervals)for(let o=t;o<=i;o++)e.push(o);return e}}const ur=X.c.get("quest_editor/scripting/data_flow_analysis/register_value"),vr=Dt,hr=Bt;Math.pow(2,32);function pr(e,t,i){const o=e.get_block_for_instruction(t);return o?function e(t,i,o,s,n){if(++t.iterations>100)return ur.warn("Too many iterations."),(new _r).set_interval(vr,hr);for(let r=s-1;r>=o.start;r--){const s=o.segment.instructions[r],a=s.args;switch(s.opcode.code){case Kt.code:if(a[0].value===n)return e(t,new Set(i),o,r,a[1].value);break;case Qt.code:case Zt.code:case Jt.code:case vo.code:if(a[0].value===n)return(new _r).set_value(a[1].value);break;case ei.code:if(a[0].value===n)return(new _r).set_value(1);break;case ti.code:if(a[0].value===n)return(new _r).set_value(0);break;case ii.code:if(a[0].value===n){const s=e(t,new Set(i),o,r,n),a=s.size();return 0===a||1===a&&0===s.get(0)?(new _r).set_value(1):s.has(0)?(new _r).set_interval(0,1):(new _r).set_value(0)}break;case si.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_add(a[1].value)}break;case ri.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_sub(a[1].value)}break;case di.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_mul(a[1].value)}break;case li.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_div(a[1].value)}break;case co.code:if(a[0].value===n)return(new _r).set_interval(0,1);break;case uo.code:if(a[0].value===n)return(new _r).set_interval(0,2);break;case ho.code:if(a[0].value===n)return(new _r).set_interval(0,3);break;case bo.code:if(a[1].value===n){const s=e(t,new Set(i),o,r,a[0].value).min()||0,n=Math.max(e(t,new Set(i),o,r,a[0].value+1).max()||0,s+1);return(new _r).set_interval(s,n-1)}break;case Gi.code:case Yi.code:{const e=a[0].value,t=a[0].value+a[1].value;if(e<=n&&n100)return br.warn("Too many iterations."),(new _r).set_interval(fr,mr);for(let e=s-1;e>=o.start;e--){const i=o.segment.instructions[e];if(i.opcode.stack===Mt.Pop){n+=i.opcode.params.length;continue}const s=i.args;switch(i.opcode.code){case Ki.code:if(0===n)return pr(t.cfg,i,s[0].value);n--;break;case Qi.code:case Zi.code:case Ji.code:if(0===n)return(new _r).set_value(s[0].value);n--;break;case Xi.code:case eo.code:case to.code:if(0===n)return(new _r).set_interval(fr,mr);n--}}const r=new _r;i.add(o);for(const s of o.from){if(i.has(s)){r.set_interval(fr,mr);break}r.union(e(t,new Set(i),s,s.end,n))}return r}(new kr(e),new Set,o,o.index_of_instruction(t),i):new _r}class kr{constructor(e){this.cfg=e,this.iterations=0}}const yr=X.c.get("core/data_formats/parsing/quest/bin"),Rr=[];function Ir(e,t=[0],i=!1){const o=e.u32(),s=e.u32(),n=e.u32();e.seek(4);const r=4652!==o;let a,d;r?(d=e.u16(),a=e.u16()):(a=e.u32(),d=e.u32());const c=r?e.string_ascii(32,!0,!0):e.string_utf16(64,!0,!0),l=r?e.string_ascii(128,!0,!0):e.string_utf16(256,!0,!0),_=r?e.string_ascii(288,!0,!0):e.string_utf16(576,!0,!0);n!==e.size&&yr.warn(`Value ${n} in bin size field does not match actual size ${e.size}.`),e.seek(4);const u=e.u32_array(932),v=Math.floor((e.size-s)/4);e.seek_start(s);const h=e.i32_array(v),p=new xr(h);return{quest_id:a,language:d,quest_name:c,short_description:l,long_description:_,object_code:function(e,t,i,o,s){const n=new Map;!function(e,t,i,o,s,n){let r;do{r=o.size;for(const[r,a]of i)Sr(o,t,e,r,a,s,n);const a=[...o.entries()].filter(([,e])=>e.type===Po.Instructions).sort(([e],[t])=>e-t).map(([,e])=>e),d=dr.create(a);i=new Map;for(const e of a)for(const t of e.instructions)for(let e=0;er)}(e,t,i.reduce((e,t)=>e.set(t,Po.Instructions),new Map),n,o,s);const r=[];let a=0;for(;aa){s=e.offset;break}}if(e.seek_start(a),Cr(n,e,s,o||[]),i=n.get(a),s<=a){yr.error(`Next offset ${s} was smaller than or equal to current offset ${a}.`);break}if(!i){yr.error(`Couldn't create segment for offset ${a}.`);break}}switch(r.push(i),i.type){case Po.Instructions:for(const e of i.instructions)a+=e.size;break;case Po.Data:a+=i.data.byteLength;break;case Po.String:a+=4*Math.ceil((i.value.length+1)/2);break;default:throw new Error(`${Po[i.type]} not implemented.`)}}for(const{label:e,offset:i}of t.labels){const t=n.get(i);t?t.labels.includes(e)||(t.labels.push(e),t.labels.sort((e,t)=>e-t)):yr.warn(`Label ${e} with offset ${i} does not point to anything.`)}if(e.size!==a){const t=`Expected to parse ${e.size} bytes but parsed ${a} instead.`;if(!o)throw new Error(t);yr.error(t)}return r}(e.seek_start(o).take(s-o),p,t,i,r),shop_items:u}}function jr(e){const t=new er(4652+100*e.object_code.length),i=new Xn(t,Fo.a.Little);if(i.write_u32(4652),i.write_u32(0),i.write_u32(0),i.write_u32(4294967295),i.write_u32(e.quest_id),i.write_u32(e.language),i.write_string_utf16(e.quest_name,64),i.write_string_utf16(e.short_description,256),i.write_string_utf16(e.long_description,576),i.write_u32(0),e.shop_items.length>932)throw new Error(`shop_items can't be larger than 932, was ${e.shop_items.length}.`);i.write_u32_array(e.shop_items);for(let t=e.shop_items.length;t<932;t++)i.write_u32(0);for(;i.position<4652;)i.write_u8(0);const{size:o,label_offsets:s}=function(e,t){const i=e.position,o=[];for(const s of t){for(const t of s.labels)o[t]=e.position-i;if(s.type===Po.Instructions)for(const t of s.instructions){const i=t.opcode;if(2===i.size&&e.write_u8(i.code>>>8),e.write_u8(255&i.code),i.stack!==Mt.Pop)for(let o=0;o=0?e.write_u8(r.value):e.write_i8(r.value);break;case ft.Word:r.value>=0?e.write_u16(r.value):e.write_i16(r.value);break;case ft.DWord:r.value>=0?e.write_u32(r.value):e.write_i32(r.value);break;case ft.Float:e.write_f32(r.value);break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:e.write_u16(r.value);break;case ft.String:e.write_string_utf16(r.value,r.size);break;case ft.ILabelVar:e.write_u8(n.length),e.write_u16_array(n.map(e=>e.value));break;case ft.RegRef:case ft.RegTupRef:e.write_u8(r.value);break;case ft.RegRefVar:e.write_u8(n.length),e.write_u8_array(n.map(e=>e.value));break;default:throw new Error(`Parameter type ${ft[s.type.kind]} not implemented.`)}}}else if(s.type===Po.String){const t=4*Math.ceil((s.value.length+1)/2);e.write_string_utf16(s.value,t)}else e.write_cursor(new Vo.a(s.data,e.endianness))}return{size:e.position-i,label_offsets:o}}(i,e.object_code);for(let e=0;ee.offset-t.offset||e.label-t.label);for(let e=0;et.offset));e++)i=void 0;return{offset:t.offset,next:i}}}function Tr(e,t,i,o,s){if(i.opcode.stack===Mt.Pop){const n=wr(e,i,i.opcode.params.length-o-1);if(n.size()<=10)for(const e of n){const i=t.get(e);(null==i||Rr[s]>Rr[i])&&t.set(e,s)}}else{const e=i.args[o].value,n=t.get(e);(null==n||Rr[s]>Rr[n])&&t.set(e,s)}}function Sr(e,t,i,o,s,n,r){try{const a=t.get_info(o);if(null==a)return void yr.warn(`Label ${o} is not registered in the label table.`);const d=e.get(a.offset);let c;if(d){if(d.labels.includes(o)||(d.labels.push(o),d.labels.sort((e,t)=>e-t)),!(Rr[s]>Rr[d.type]))return;c=d.labels}else c=[o];const l=a.next?a.next.offset:i.size;switch(i.seek_start(a.offset),s){case Po.Instructions:!function(e,t,i,o,s,n,r,a){const d=[],c={type:Po.Instructions,labels:s,instructions:d,asm:{labels:[]}};e.set(i.position,c);for(;i.position=0;e--){const t=d[e].opcode;if(t.code===Ut.code||t.code===mi.code){o=!1;break}}o&&Sr(e,t,i,n,Po.Instructions,r,a)}}(e,t,i,l,c,a.next&&a.next.label,n,r);break;case Po.Data:Cr(e,i,l,c);break;case Po.String:!function(e,t,i,o,s){const n=t.position,r={type:Po.String,labels:o,value:s?t.string_ascii(i-n,!0,!0):t.string_utf16(i-n,!0,!0),asm:{labels:[]}};e.set(n,r)}(e,i,l,c,r);break;default:throw new Error(`Segment type ${Po[s]} not implemented.`)}}catch(e){if(!n)throw e;yr.error("Couldn't fully parse object code segment.",e)}}function Cr(e,t,i,o){const s=t.position,n={type:Po.Data,labels:o,data:t.array_buffer(i-s),asm:{labels:[]}};e.set(s,n)}function Or(e,t,i){const o=[];if(t.stack!==Mt.Pop)for(const s of t.params)switch(s.type.kind){case ft.Byte:o.push(Lo(e.u8(),1));break;case ft.Word:o.push(Lo(e.u16(),2));break;case ft.DWord:o.push(Lo(e.i32(),4));break;case ft.Float:o.push(Lo(e.f32(),4));break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:o.push(Lo(e.u16(),2));break;case ft.String:{const t=e.position,s=Math.min(4096,e.bytes_left);o.push(Lo(i?e.string_ascii(s,!0,!1):e.string_utf16(s,!0,!1),e.position-t))}break;case ft.ILabelVar:{const t=e.u8();o.push(...e.u16_array(t).map(e=>Lo(e,2)))}break;case ft.RegRef:case ft.RegTupRef:o.push(Lo(e.u8(),1));break;case ft.RegRefVar:{const t=e.u8();o.push(...e.u8_array(t).map(e=>Lo(e,1)))}break;default:throw new Error(`Parameter type ${ft[s.type.kind]} not implemented.`)}return o}const Lr=X.c.get("core/data_formats/parsing/quest/dat"),Pr=68,Dr=72;var Br,Er;function Mr({objs:e,npcs:t,events:i,unknowns:o}){const s=new er(e.length*(16+Pr)+t.length*(16+Dr)+o.reduce((e,t)=>e+t.total_size,0)),n=new Xn(s,Fo.a.Little);!function(e,t){const i=Object(Wn.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],s=o.length*Pr;e.write_u32(1),e.write_u32(s+16),e.write_u32(t),e.write_u32(s);for(const t of o)Object(U.c)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(U.c)(6===t.unknown[0].length,()=>`unknown[0] should be of length 6, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.id),e.write_u16(t.group_id),e.write_u16(t.section_id),Object(U.c)(2===t.unknown[1].length,()=>`unknown[1] should be of length 2, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1]),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),Object(U.c)(7===t.properties.length,()=>`properties should be of length 7, was ${t.properties.length}`),e.write_f32(t.properties[0]),e.write_f32(t.properties[1]),e.write_f32(t.properties[2]),e.write_u32(t.properties[3]),e.write_u32(t.properties[4]),e.write_u32(t.properties[5]),e.write_u32(t.properties[6])}}(n,e),function(e,t){const i=Object(Wn.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],s=o.length*Dr;e.write_u32(2),e.write_u32(s+16),e.write_u32(t),e.write_u32(s);for(const t of o)Object(U.c)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(U.c)(10===t.unknown[0].length,()=>`unknown[0] should be of length 10, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u32(t.wave2),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),e.write_vec3_f32(t.scale),e.write_f32(t.npc_id),e.write_f32(t.script_label),e.write_u32(t.roaming),Object(U.c)(4===t.unknown[1].length,()=>`unknown[1] should be of length 4, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1])}}(n,t),function(e,t){const i=Object(Wn.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t];e.write_u32(3);const s=e.position;e.write_u32(0),e.write_u32(t);const n=e.position;e.write_u32(0);const r=e.position,a=r+16+20*o.length;e.size=Math.max(a,e.size),e.write_u32(a-r),e.write_u32(16),e.write_u32(o.length),e.write_u32(0);let d=0;for(const t of o){e.write_u32(t.id),e.write_u32(65536),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u16(t.delay),e.write_u16(t.unknown),e.write_u32(d);const i=e.position;e.seek_start(a+d);for(const i of t.actions)switch(e.write_u8(i.type),i.type){case Br.SpawnNpcs:e.write_u16(i.section_id),e.write_u16(i.appear_flag);break;case Br.Unlock:case Br.Lock:e.write_u16(i.door_id);break;case Br.TriggerEvent:e.write_u32(i.event_id);break;default:throw new Error(`Unknown event action type ${i.type}.`)}e.write_u8(1),d=e.position-a,e.seek_start(i)}for(e.seek_start(a+d);(e.position-a)%4!=0;)e.write_u8(255);const c=e.position;e.seek_start(s),e.write_u32(c-r+16),e.seek_start(n),e.write_u32(c-r),e.seek_start(c)}}(n,i);for(const e of o)n.write_u32(e.entity_type),n.write_u32(e.total_size),n.write_u32(e.area_id),n.write_u32(e.entities_size),n.write_u8_array(e.data);return n.write_u32(0),n.write_u32(0),n.write_u32(0),n.write_u32(0),s}function Wr(e,t,i){const o=Math.floor(e.size/Pr);for(let s=0;s=l;){const r=e.position;let a;switch(t){case Er.DC:case Er.GC:e.seek(1),a=e.u8(),e.seek(2);break;case Er.PC:e.seek(3),a=e.u8();break;case Er.BB:e.seek(4),a=e.u32()}const d=e.string_ascii(16,!0,!0);let u=c.get(d);if(!u){const e=i.get(d);u={name:d,expected_size:null===(o=e)||void 0===o?void 0:o.size,cursor:new Xn(new er((n=null===(s=e)||void 0===s?void 0:s.size,null!=n?n:10240)),Fo.a.Little),chunk_nos:new Set},c.set(d,u)}u.chunk_nos.has(a)?Vr.warn(`File chunk number ${a} of file ${d} was already encountered, overwriting previous chunk.`):u.chunk_nos.add(a);let v=e.seek(Hr).u32();e.seek(-Hr-4),v>Hr&&(Vr.warn(`Data segment size of ${v} is larger than expected maximum size, reading just ${Hr} bytes.`),v=Hr);const h=e.take(v),p=a*Hr;if(u.cursor.size=Math.max(p+v,u.cursor.size),u.cursor.seek_start(p).write_cursor(h),e.seek(Hr+_-h.size),e.position!==r+l)throw new Error(`Read ${e.position-r} file chunk message bytes instead of expected ${l}.`)}e.bytes_left&&Vr.warn(`${e.bytes_left} Bytes left in file.`);for(const e of c.values()){e.cursor.seek_start(0),e.chunk_nos=new Set(Array.from(e.chunk_nos.values()).sort((e,t)=>e-t)),null!=e.expected_size&&e.cursor.size!==e.expected_size&&Vr.warn(`File ${e.name} has an actual size of ${e.cursor.size} instead of the expected size ${e.expected_size}.`);const t=Math.max(e.cursor.size,null!=(r=e.expected_size)?r:0),i=Math.ceil(t/Hr);for(let t=0;t[e.file_name,e])))}}function Yr(e){const t=e.files,i=t.map(e=>88+1056*Math.ceil(e.data.byteLength/1024)).reduce((e,t)=>e+t),o=new ArrayBuffer(i),s=new Vo.a(o,Fo.a.Little);if(function(e,t){for(const i of t){if(i.filename.length>15)throw new Error(`File ${i.filename} has a name longer than 15 characters.`);e.write_u16(88),e.write_u16(68),e.write_u16(i.id||0);for(let t=0;t<38;++t)e.write_u8(0);let t;if(e.write_string_ascii(i.filename,16),e.write_u32(i.data.byteLength),null==i.quest_name){const e=i.filename.lastIndexOf(".");t=-1===e?i.filename+"_j":i.filename.slice(0,e)+"_j"+i.filename.slice(e)}else t=i.quest_name;if(t.length>24)throw Error(`File ${i.filename} has a file_name_2 length (${t}) longer than 24 characters.`);e.write_string_ascii(t,24)}}(s,t),function(e,t){const i=t.map(e=>({no:0,data:new Vo.a(e.data,Fo.a.Little),name:e.filename}));let o=0;for(;o0}const Qr=X.c.get("core/data_formats/parsing/quest");function Zr(e,t,i=!1){const o=function(e){const t=[],i=[],o=[],s=[];for(;e.bytes_left;){const n=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();if(0===n)break;{if(d!==r-16)throw Error(`Malformed DAT file. Expected an entities size of ${r-16}, got ${d}.`);const c=e.take(d);1===n?Wr(c,a,t):2===n?qr(c,a,i):3===n?Fr(c,a,o):s.push({entity_type:n,total_size:r,area_id:a,entities_size:d,data:e.u8_array(d)}),c.bytes_left&&Lr.warn(`Read ${c.position} bytes instead of expected ${c.size} for entity type ${n}.`)}}return{objs:t,npcs:i,events:o,unknowns:s}}(sr(t)),s=o.objs.map(e=>{const t=function(e){switch(e){default:return w.Unknown;case 0:return w.PlayerSet;case 1:return w.Particle;case 2:return w.Teleporter;case 3:return w.Warp;case 4:return w.LightCollision;case 5:return w.Item;case 6:return w.EnvSound;case 7:return w.FogCollision;case 8:return w.EventCollision;case 9:return w.CharaCollision;case 10:return w.ElementalTrap;case 11:return w.StatusTrap;case 12:return w.HealTrap;case 13:return w.LargeElementalTrap;case 14:return w.ObjRoomID;case 15:return w.Sensor;case 16:return w.UnknownItem16;case 17:return w.LensFlare;case 18:return w.ScriptCollision;case 19:return w.HealRing;case 20:return w.MapCollision;case 21:return w.ScriptCollisionA;case 22:return w.ItemLight;case 23:return w.RadarCollision;case 24:return w.FogCollisionSW;case 25:return w.BossTeleporter;case 26:return w.ImageBoard;case 27:return w.QuestWarp;case 28:return w.Epilogue;case 29:return w.UnknownItem29;case 30:return w.UnknownItem30;case 31:return w.UnknownItem31;case 32:return w.BoxDetectObject;case 33:return w.SymbolChatObject;case 34:return w.TouchPlateObject;case 35:return w.TargetableObject;case 36:return w.EffectObject;case 37:return w.CountDownObject;case 38:return w.UnknownItem38;case 39:return w.UnknownItem39;case 40:return w.UnknownItem40;case 41:return w.UnknownItem41;case 64:return w.MenuActivation;case 65:return w.TelepipeLocation;case 66:return w.BGMCollision;case 67:return w.MainRagolTeleporter;case 68:return w.LobbyTeleporter;case 69:return w.PrincipalWarp;case 70:return w.ShopDoor;case 71:return w.HuntersGuildDoor;case 72:return w.TeleporterDoor;case 73:return w.MedicalCenterDoor;case 74:return w.Elevator;case 75:return w.EasterEgg;case 76:return w.ValentinesHeart;case 77:return w.ChristmasTree;case 78:return w.ChristmasWreath;case 79:return w.HalloweenPumpkin;case 80:return w.TwentyFirstCentury;case 81:return w.Sonic;case 82:return w.WelcomeBoard;case 83:return w.Firework;case 84:return w.LobbyScreenDoor;case 85:return w.MainRagolTeleporterBattleInNextArea;case 86:return w.LabTeleporterDoor;case 87:return w.Pioneer2InvisibleTouchplate;case 128:return w.ForestDoor;case 129:return w.ForestSwitch;case 130:return w.LaserFence;case 131:return w.LaserSquareFence;case 132:return w.ForestLaserFenceSwitch;case 133:return w.LightRays;case 134:return w.BlueButterfly;case 135:return w.Probe;case 136:return w.RandomTypeBox1;case 137:return w.ForestWeatherStation;case 138:return w.Battery;case 139:return w.ForestConsole;case 140:return w.BlackSlidingDoor;case 141:return w.RicoMessagePod;case 142:return w.EnergyBarrier;case 143:return w.ForestRisingBridge;case 144:return w.SwitchNoneDoor;case 145:return w.EnemyBoxGrey;case 146:return w.FixedTypeBox;case 147:return w.EnemyBoxBrown;case 149:return w.EmptyTypeBox;case 150:return w.LaserFenceEx;case 151:return w.LaserSquareFenceEx;case 192:return w.FloorPanel1;case 193:return w.Caves4ButtonDoor;case 194:return w.CavesNormalDoor;case 195:return w.CavesSmashingPillar;case 196:return w.CavesSign1;case 197:return w.CavesSign2;case 198:return w.CavesSign3;case 199:return w.HexagonalTank;case 200:return w.BrownPlatform;case 201:return w.WarningLightObject;case 203:return w.Rainbow;case 204:return w.FloatingJellyfish;case 205:return w.FloatingDragonfly;case 206:return w.CavesSwitchDoor;case 207:return w.RobotRechargeStation;case 208:return w.CavesCakeShop;case 209:return w.Caves1SmallRedRock;case 210:return w.Caves1MediumRedRock;case 211:return w.Caves1LargeRedRock;case 212:return w.Caves2SmallRock1;case 213:return w.Caves2MediumRock1;case 214:return w.Caves2LargeRock1;case 215:return w.Caves2SmallRock2;case 216:return w.Caves2MediumRock2;case 217:return w.Caves2LargeRock2;case 218:return w.Caves3SmallRock;case 219:return w.Caves3MediumRock;case 220:return w.Caves3LargeRock;case 222:return w.FloorPanel2;case 223:return w.DestructableRockCaves1;case 224:return w.DestructableRockCaves2;case 225:return w.DestructableRockCaves3;case 256:return w.MinesDoor;case 257:return w.FloorPanel3;case 258:return w.MinesSwitchDoor;case 259:return w.LargeCryoTube;case 260:return w.ComputerLikeCalus;case 261:return w.GreenScreenOpeningAndClosing;case 262:return w.FloatingRobot;case 263:return w.FloatingBlueLight;case 264:return w.SelfDestructingObject1;case 265:return w.SelfDestructingObject2;case 266:return w.SelfDestructingObject3;case 267:return w.SparkMachine;case 268:return w.MinesLargeFlashingCrate;case 304:return w.RuinsSeal;case 320:return w.RuinsTeleporter;case 321:return w.RuinsWarpSiteToSite;case 322:return w.RuinsSwitch;case 323:return w.FloorPanel4;case 324:return w.Ruins1Door;case 325:return w.Ruins3Door;case 326:return w.Ruins2Door;case 327:return w.Ruins11ButtonDoor;case 328:return w.Ruins21ButtonDoor;case 329:return w.Ruins31ButtonDoor;case 330:return w.Ruins4ButtonDoor;case 331:return w.Ruins2ButtonDoor;case 332:return w.RuinsSensor;case 333:return w.RuinsFenceSwitch;case 334:return w.RuinsLaserFence4x2;case 335:return w.RuinsLaserFence6x2;case 336:return w.RuinsLaserFence4x4;case 337:return w.RuinsLaserFence6x4;case 338:return w.RuinsPoisonBlob;case 339:return w.RuinsPillarTrap;case 340:return w.PopupTrapNoTech;case 341:return w.RuinsCrystal;case 342:return w.Monument;case 345:return w.RuinsRock1;case 346:return w.RuinsRock2;case 347:return w.RuinsRock3;case 348:return w.RuinsRock4;case 349:return w.RuinsRock5;case 350:return w.RuinsRock6;case 351:return w.RuinsRock7;case 352:return w.Poison;case 353:return w.FixedBoxTypeRuins;case 354:return w.RandomBoxTypeRuins;case 355:return w.EnemyTypeBoxYellow;case 356:return w.EnemyTypeBoxBlue;case 357:return w.EmptyTypeBoxBlue;case 358:return w.DestructableRock;case 359:return w.PopupTrapsTechs;case 368:return w.FlyingWhiteBird;case 369:return w.Tower;case 370:return w.FloatingRocks;case 371:return w.FloatingSoul;case 372:return w.Butterfly;case 384:return w.LobbyGameMenu;case 385:return w.LobbyWarpObject;case 386:return w.Lobby1EventObjectDefaultTree;case 387:return w.UnknownItem387;case 388:return w.UnknownItem388;case 389:return w.UnknownItem389;case 390:return w.LobbyEventObjectStaticPumpkin;case 391:return w.LobbyEventObject3ChristmasWindows;case 392:return w.LobbyEventObjectRedAndWhiteCurtain;case 393:return w.UnknownItem393;case 394:return w.UnknownItem394;case 395:return w.LobbyFishTank;case 396:return w.LobbyEventObjectButterflies;case 400:return w.UnknownItem400;case 401:return w.GreyWallLow;case 402:return w.SpaceshipDoor;case 403:return w.GreyWallHigh;case 416:return w.TempleNormalDoor;case 417:return w.BreakableWallWallButUnbreakable;case 418:return w.BrokenCylinderAndRubble;case 419:return w.ThreeBrokenWallPiecesOnFloor;case 420:return w.HighBrickCylinder;case 421:return w.LyingCylinder;case 422:return w.BrickConeWithFlatTop;case 423:return w.BreakableTempleWall;case 424:return w.TempleMapDetect;case 425:return w.SmallBrownBrickRisingBridge;case 426:return w.LongRisingBridgeWithPinkHighEdges;case 427:return w.FourSwitchTempleDoor;case 448:return w.FourButtonSpaceshipDoor;case 512:return w.ItemBoxCca;case 513:return w.TeleporterEp2;case 514:return w.CCADoor;case 515:return w.SpecialBoxCCA;case 516:return w.BigCCADoor;case 517:return w.BigCCADoorSwitch;case 518:return w.LittleRock;case 519:return w.Little3StoneWall;case 520:return w.Medium3StoneWall;case 521:return w.SpiderPlant;case 522:return w.CCAAreaTeleporter;case 523:return w.UnknownItem523;case 524:return w.WhiteBird;case 525:return w.OrangeBird;case 527:return w.Saw;case 528:return w.LaserDetect;case 529:return w.UnknownItem529;case 530:return w.UnknownItem530;case 531:return w.Seagull;case 544:return w.Fish;case 545:return w.SeabedDoorWithBlueEdges;case 546:return w.SeabedDoorAlwaysOpenNonTriggerable;case 547:return w.LittleCryotube;case 548:return w.WideGlassWallBreakable;case 549:return w.BlueFloatingRobot;case 550:return w.RedFloatingRobot;case 551:return w.Dolphin;case 552:return w.CaptureTrap;case 553:return w.VRLink;case 576:return w.UnknownItem576;case 640:return w.WarpInBarbaRayRoom;case 672:return w.UnknownItem672;case 688:return w.GeeNest;case 689:return w.LabComputerConsole;case 690:return w.LabComputerConsoleGreenScreen;case 691:return w.ChairYellowPillow;case 692:return w.OrangeWallWithHoleInMiddle;case 693:return w.GreyWallWithHoleInMiddle;case 694:return w.LongTable;case 695:return w.GBAStation;case 696:return w.TalkLinkToSupport;case 697:return w.InstaWarp;case 698:return w.LabInvisibleObject;case 699:return w.LabGlassWindowDoor;case 700:return w.UnknownItem700;case 701:return w.LabCeilingWarp;case 768:return w.Ep4LightSource;case 769:return w.Cacti;case 770:return w.BigBrownRock;case 771:return w.BreakableBrownRock;case 832:return w.UnknownItem832;case 833:return w.UnknownItem833;case 896:return w.PoisonPlant;case 897:return w.UnknownItem897;case 898:return w.UnknownItem898;case 899:return w.OozingDesertPlant;case 901:return w.UnknownItem901;case 902:return w.BigBlackRocks;case 903:return w.UnknownItem903;case 904:return w.UnknownItem904;case 905:return w.UnknownItem905;case 906:return w.UnknownItem906;case 907:return w.FallingRock;case 908:return w.DesertPlantHasCollision;case 909:return w.DesertFixedTypeBoxBreakableCrystals;case 910:return w.UnknownItem910;case 911:return w.BeeHive;case 912:return w.UnknownItem912;case 913:return w.Heat;case 960:return w.TopOfSaintMillionEgg;case 961:return w.UnknownItem961}}(e.type_id);return{type:t,id:e.id,group_id:e.group_id,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:new Map(e.properties.map((e,i)=>3!==i||t!==w.ScriptCollision&&t!==w.ForestConsole&&t!==w.TalkLinkToSupport?4===i&&t===w.RicoMessagePod?["script_label",e]:5===i&&t===w.RicoMessagePod?["script_label_2",e]:[`property_${i}`,e]:["script_label",e])),unknown:e.unknown}});const n=Ir(sr(e),function(e,t){const i=new Set([0]);for(const t of e){const e=t.properties.get("script_label");null!=e&&i.add(e);const o=t.properties.get("script_label_2");null!=o&&i.add(o)}for(const e of t)i.add(Math.round(e.script_label));return[...i]}(s,o.npcs),i);let a=r.b.I,d=new Map;if(n.object_code.length){let e;for(const t of n.object_code)if(t.type===Po.Instructions&&t.labels.includes(0)){e=t;break}e?(a=function(e){const t=e.find(e=>e.opcode.code===fo.code);if(!t)return Qr.debug("Function 0 has no set_episode instruction."),r.b.I;switch(t.args[0].value){default:case 0:return r.b.I;case 1:return r.b.II;case 2:return r.b.IV}}(e.instructions),d=function(e,t,i){const o=new Map;for(const e of i)e.opcode.code===Co.code&&o.set(e.args[0].value,e.args[2].value);return o}(0,0,e.instructions)):Qr.warn("No instruction for label 0 found.")}else Qr.warn("File contains no instruction labels.");return{id:n.quest_id,language:n.language,name:n.quest_name,short_description:n.short_description,long_description:n.long_description,episode:a,objects:s,npcs:Jr(a,o.npcs),events:o.events,dat_unknowns:o.unknowns,object_code:n.object_code,shop_items:n.shop_items,map_designations:d}}function Jr(e,t){return t.map(t=>({type:Xr(e,t),area_id:t.area_id,section_id:t.section_id,wave:t.wave,pso_wave2:t.wave2,position:t.position,rotation:t.rotation,scale:t.scale,unknown:t.unknown,pso_type_id:t.type_id,npc_id:t.npc_id,script_label:Math.round(t.script_label),pso_roaming:t.roaming}))}function Xr(e,{type_id:t,scale:i,roaming:o,area_id:s}){const n=Math.abs(i.y-1)>1e-5;switch(`${t}, ${o%3}, ${e}`){case"68, 0, 1":return I.c.Booma;case"68, 1, 1":return I.c.Gobooma;case"68, 2, 1":return I.c.Gigobooma;case"99, 0, 1":return I.c.EvilShark;case"99, 1, 1":return I.c.PalShark;case"99, 2, 1":return I.c.GuilShark;case"166, 0, 1":return I.c.Dimenian;case"166, 0, 2":return I.c.Dimenian2;case"166, 1, 1":return I.c.LaDimenian;case"166, 1, 2":return I.c.LaDimenian2;case"166, 2, 1":return I.c.SoDimenian;case"166, 2, 2":return I.c.SoDimenian2;case"214, 0, 2":return I.c.Mericarol;case"214, 1, 2":return I.c.Mericus;case"214, 2, 2":return I.c.Merikle;case"277, 0, 4":return I.c.Boota;case"277, 1, 4":return I.c.ZeBoota;case"277, 2, 4":return I.c.BaBoota;case"279, 0, 4":return I.c.Goran;case"279, 1, 4":return I.c.PyroGoran;case"279, 2, 4":return I.c.GoranDetonator}switch(`${t}, ${o%2}, ${e}`){case"64, 0, 1":return I.c.Hildebear;case"64, 0, 2":return I.c.Hildebear2;case"64, 1, 1":return I.c.Hildeblue;case"64, 1, 2":return I.c.Hildeblue2;case"65, 0, 1":return I.c.RagRappy;case"65, 0, 2":return I.c.RagRappy2;case"65, 0, 4":return I.c.SandRappy;case"65, 1, 1":return I.c.AlRappy;case"65, 1, 2":return I.c.LoveRappy;case"65, 1, 4":return I.c.DelRappy;case"128, 0, 1":return I.c.Dubchic;case"128, 0, 2":return I.c.Dubchic2;case"128, 1, 1":return I.c.Gilchic;case"128, 1, 2":return I.c.Gilchic2;case"212, 0, 2":return I.c.SinowBerill;case"212, 1, 2":return I.c.SinowSpigell;case"213, 0, 2":return I.c.Merillia;case"213, 1, 2":return I.c.Meriltas;case"215, 0, 2":return I.c.UlGibbon;case"215, 1, 2":return I.c.ZolGibbon;case"221, 0, 2":return I.c.Dolmolm;case"221, 1, 2":return I.c.Dolmdarl;case"224, 0, 2":return s>15?I.c.Epsilon:I.c.SinowZoa;case"224, 1, 2":return s>15?I.c.Epsilon:I.c.SinowZele;case"274, 0, 4":return I.c.MerissaA;case"274, 1, 4":return I.c.MerissaAA;case"276, 0, 4":return I.c.Zu;case"276, 1, 4":return I.c.Pazuzu;case"278, 0, 4":return I.c.Dorphon;case"278, 1, 4":return I.c.DorphonEclair;case"281, 0, 4":return n?I.c.SaintMilion:I.c.Kondrieu;case"281, 1, 4":return n?I.c.Shambertin:I.c.Kondrieu}switch(`${t}, ${e}`){case"66, 1":return I.c.Monest;case"66, 2":return I.c.Monest2;case"67, 1":return n?I.c.SavageWolf:I.c.BarbarousWolf;case"67, 2":return n?I.c.SavageWolf2:I.c.BarbarousWolf2;case"96, 1":return I.c.GrassAssassin;case"96, 2":return I.c.GrassAssassin2;case"97, 1":return s>15?I.c.DelLily:n?I.c.PoisonLily:I.c.NarLily;case"97, 2":return s>15?I.c.DelLily:n?I.c.PoisonLily2:I.c.NarLily2;case"98, 1":return I.c.NanoDragon;case"100, 1":return n?I.c.PofuillySlime:I.c.PouillySlime;case"101, 1":return I.c.PanArms;case"101, 2":return I.c.PanArms2;case"129, 1":return I.c.Garanz;case"129, 2":return I.c.Garanz2;case"130, 1":return n?I.c.SinowBeat:I.c.SinowGold;case"131, 1":return I.c.Canadine;case"132, 1":return I.c.Canane;case"133, 1":return I.c.Dubswitch;case"133, 2":return I.c.Dubswitch2;case"160, 1":return I.c.Delsaber;case"160, 2":return I.c.Delsaber2;case"161, 1":return I.c.ChaosSorcerer;case"161, 2":return I.c.ChaosSorcerer2;case"162, 1":return I.c.DarkGunner;case"164, 1":return I.c.ChaosBringer;case"165, 1":return I.c.DarkBelra;case"165, 2":return I.c.DarkBelra2;case"167, 1":return I.c.Bulclaw;case"168, 1":return I.c.Claw;case"192, 1":return I.c.Dragon;case"192, 2":return I.c.GalGryphon;case"193, 1":return I.c.DeRolLe;case"194, 1":return I.c.VolOptPart1;case"197, 1":return I.c.VolOptPart2;case"200, 1":return I.c.DarkFalz;case"202, 2":return I.c.OlgaFlow;case"203, 2":return I.c.BarbaRay;case"204, 2":return I.c.GolDragon;case"216, 2":return I.c.Gibbles;case"217, 2":return I.c.Gee;case"218, 2":return I.c.GiGue;case"219, 2":return I.c.Deldepth;case"220, 2":return I.c.Delbiter;case"222, 2":return I.c.Morfos;case"223, 2":return I.c.Recobox;case"225, 2":return I.c.IllGill;case"272, 4":return I.c.Astark;case"273, 4":return n?I.c.SatelliteLizard:I.c.Yowie;case"275, 4":return I.c.Girtablulu}switch(t){case 4:return I.c.FemaleFat;case 5:return I.c.FemaleMacho;case 7:return I.c.FemaleTall;case 10:return I.c.MaleDwarf;case 11:return I.c.MaleFat;case 12:return I.c.MaleMacho;case 13:return I.c.MaleOld;case 25:return I.c.BlueSoldier;case 26:return I.c.RedSoldier;case 27:return I.c.Principal;case 28:return I.c.Tekker;case 29:return I.c.GuildLady;case 30:return I.c.Scientist;case 31:return I.c.Nurse;case 32:return I.c.Irene;case 241:return I.c.ItemShop;case 254:return I.c.Nurse2}return I.c.Unknown}class ea{constructor(e,t,i,o,s){this._actions=Object(M.c)(),this.actions=this._actions,Object(U.k)(e,"id"),Object(U.k)(t,"section_id"),Object(U.e)(i,"wave"),Object(U.k)(o,"delay"),Object(U.j)(s,"unknown"),this.id=e,this.section_id=t,this.wave=i,this._delay=Object(M.e)(o),this.delay=this._delay,this.unknown=s}set_delay(e){Object(U.k)(e,"delay"),this._delay.val=e}add_action(e){this._actions.push(e)}remove_action(e){this._actions.remove(e)}}class ta{constructor(e,t,i){Object(U.k)(e,"id"),Object(U.k)(t,"area_id"),Object(U.k)(i,"section_id"),this._id=Object(M.e)(e),this.id=this._id,this._area_id=Object(M.e)(t),this.area_id=this._area_id,this._section_id=Object(M.e)(i),this.section_id=this._section_id}}const ia=X.c.get("quest_editor/stores/model_conversion");function oa(e,t){const i=new Map;return new An(e,t.id,t.language,t.name,t.short_description,t.long_description,t.episode,t.map_designations,t.objects.map(e=>new we(e.type,e.id,e.group_id,e.area_id,e.section_id,Object(_n.a)(e.position),$(e.rotation.x,e.rotation.y,e.rotation.z),e.properties,e.unknown)),t.npcs.map(e=>(function(e,t){const i=0===t.wave?void 0:sa(e,t.area_id,t.section_id,t.wave);return new K(t.type,t.pso_type_id,t.npc_id,i,t.pso_wave2,t.script_label,t.pso_roaming,t.area_id,t.section_id,Object(_n.a)(t.position),$(t.rotation.x,t.rotation.y,t.rotation.z),Object(_n.a)(t.scale),t.unknown)})(i,e)),function(e,t){const i=new Map;for(const o of t){const t=`${o.id}-${o.area_id}`;let s=i.get(t);if(s&&s.event){ia.warn(`Ignored duplicate event #${o.id} for area ${o.area_id}.`);continue}const n=sa(e,o.area_id,o.section_id,o.wave),r=new ea(o.id,o.section_id,n,o.delay,o.unknown);s?s.event=r:(s={event:r,area_id:o.area_id,parents:[],child_ids:[]},i.set(t,s));for(const e of o.actions)switch(e.type){case Br.SpawnNpcs:r.add_action(new rt(e.section_id,e.appear_flag));break;case Br.Unlock:r.add_action(new at(e.door_id));break;case Br.Lock:r.add_action(new dt(e.door_id));break;case Br.TriggerEvent:{s.child_ids.push(e.event_id);const t=`${e.event_id}-${o.area_id}`,n=i.get(t);n?n.parents.push(r):i.set(t,{area_id:o.area_id,parents:[r],child_ids:[]})}break;default:ia.warn(`Unknown event action type: ${e.type}.`)}}const o=new Map;for(const{area_id:e,event:t}of i.values())if(t){let i=o.get(e);i||(i=new it(e),o.set(e,i)),i.add_event(t,[],[])}for(const e of i.values())if(e.event)for(const t of e.child_ids){const s=i.get(`${t}-${e.area_id}`);s.event?o.get(e.area_id).add_edge(e.event,s.event):ia.warn(`Event ${e.event.id} calls nonexistent event ${t}.`)}return o}(i,t.events),t.dat_unknowns,t.object_code.slice(),t.shop_items)}function sa(e,t,i,o){const s=`${t}-${i}-${o}`;let n=e.get(s);return n||(n=new ta(o,t,i),e.set(s,n)),n}function na(e){const t=[];for(const i of e.values())for(const e of i.events){const o=e.actions.val.map(e=>{switch(e.type){case ot.SpawnNpcs:return{type:Br.SpawnNpcs,section_id:e.section_id,appear_flag:e.appear_flag};case ot.Unlock:return{type:Br.Unlock,door_id:e.door_id.val};case ot.Lock:return{type:Br.Lock,door_id:e.door_id.val}}});for(const t of i.get_children(e))o.push({type:Br.TriggerEvent,event_id:t.id});t.push({id:e.id,section_id:e.section_id,wave:e.wave.id.val,delay:e.delay.val,actions:o,area_id:i.area_id,unknown:e.unknown})}return t}var ra=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const aa=X.c.get("quest_editor/controllers/QuestEditorToolBarController");class da extends $n{constructor(e,t,i){super(),this.area_store=t,this.quest_editor_store=i,this.create_new_quest=e=>ra(this,void 0,void 0,(function*(){return this.quest_editor_store.set_current_quest(Qn(this.area_store,e))})),this.open_files=e=>ra(this,void 0,void 0,(function*(){try{let t;const i=e.find(e=>e.name.toLowerCase().endsWith(".qst"));if(i){const e=yield Object(Zn.a)(i);t=function(e,t=!1){const i=Gr(e);if(!i)return;let o,s;for(const e of i.files){const t=e.filename.trim().toLowerCase();t.endsWith(".dat")?o=e:t.endsWith(".bin")&&(s=e)}if(o){if(s)return Zr(new Vo.a(s.data,Fo.a.Little),new Vo.a(o.data,Fo.a.Little),t);Qr.error("File contains no BIN file.")}else Qr.error("File contains no DAT file.")}(new Vo.a(e,Fo.a.Little)),this.quest_filename=i.name}else{const i=e.find(e=>e.name.toLowerCase().endsWith(".bin")),o=e.find(e=>e.name.toLowerCase().endsWith(".dat"));if(i&&o){const e=yield Object(Zn.a)(i),s=yield Object(Zn.a)(o);t=Zr(new Vo.a(e,Fo.a.Little),new Vo.a(s,Fo.a.Little)),this.quest_filename=i.name||o.name}}t||aa.error("Couldn't parse quest file."),yield this.quest_editor_store.set_current_quest(t&&oa(this.area_store,t))}catch(e){aa.error("Couldn't read file.",e)}})),this.set_area=({area:e})=>{this.quest_editor_store.set_current_area(e)},this.save_as=()=>{const e=this.quest_editor_store.current_quest.val;if(!e)return;const t=this.quest_filename&&Object(U.d)(this.quest_filename);let i=prompt("File name:",t);if(!i)return;const o=function(e,t){const i=Mr({objs:(s=e.objects,s.map(e=>({type_id:x(e.type).pso_id,id:e.id,group_id:e.group_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:[...e.properties.values()],area_id:e.area_id,unknown:e.unknown}))),npcs:(o=e.npcs,o.map(e=>{const t=Object(I.d)(e.type),i=null==t.pso_type_id?e.pso_type_id:t.pso_type_id,o=null==t.pso_roaming?e.pso_roaming:t.pso_roaming,s=null==t.pso_regular||t.pso_regular,n=Ws(-8388609&qs(e.scale.y)|(s?0:8388608)),r={x:e.scale.x,y:n,z:e.scale.z};return{type_id:i,wave:e.wave,wave2:e.pso_wave2,section_id:e.section_id,position:e.position,rotation:e.rotation,scale:r,npc_id:e.npc_id,script_label:e.script_label,roaming:o,area_id:e.area_id,unknown:e.unknown}})),events:e.events,unknowns:e.dat_unknowns});var o,s;const n=jr({quest_id:e.id,language:e.language,quest_name:e.name,short_description:e.short_description,long_description:e.long_description,object_code:e.object_code,shop_items:e.shop_items}),r=t.lastIndexOf("."),a=-1===r?t.slice(0,11):t.slice(0,Math.min(11,r));return Yr({files:[{filename:a+".dat",id:e.id,data:tr(new Xn(i,Fo.a.Little)).array_buffer()},{filename:a+".bin",id:e.id,data:tr(new Vo.a(n,Fo.a.Little)).array_buffer()}]})}(function(e){return{id:e.id.val,language:e.language.val,name:e.name.val,short_description:e.short_description.val,long_description:e.long_description.val,episode:e.episode,objects:e.objects.val.map(e=>({type:e.type,area_id:e.area_id,section_id:e.section_id.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),unknown:e.unknown,id:e.id,group_id:e.group_id,properties:new Map(e.properties)})),npcs:e.npcs.val.map(e=>{var t,i;return{type:e.type,area_id:e.area_id,section_id:e.section_id.val,wave:(i=null===(t=e.wave.val)||void 0===t?void 0:t.id.val,null!=i?i:0),pso_wave2:e.pso_wave2.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),scale:e.scale.clone(),unknown:e.unknown,pso_type_id:e.pso_type_id,npc_id:e.npc_id,script_label:e.script_label,pso_roaming:e.pso_roaming}}),events:na(e.event_dags),dat_unknowns:e.dat_unknowns.map(e=>Object.assign({},e)),object_code:e.object_code.map(e=>Do(e)),shop_items:e.shop_items.slice(),map_designations:new Map(e.map_designations.val)}}(e),i);i.endsWith(".qst")||(i+=".qst");const s=document.createElement("a");s.href=URL.createObjectURL(new Blob([o],{type:"application/octet-stream"})),s.download=i,document.body.appendChild(s),s.click(),URL.revokeObjectURL(s.href),document.body.removeChild(s)},this.debug=()=>{const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.quest_runner.run(e)},this.resume=()=>{this.quest_editor_store.quest_runner.resume()},this.step_over=()=>{this.quest_editor_store.quest_runner.step_over()},this.step_in=()=>{this.quest_editor_store.quest_runner.step_into()},this.step_out=()=>{this.quest_editor_store.quest_runner.step_out()},this.stop=()=>{this.quest_editor_store.quest_runner.stop()},this.vm_feature_active=e.feature_active("vm"),this.areas=i.current_quest.flat_map(e=>{var i;return e?null===(i=e)||void 0===i?void 0:i.entities_per_area.flat_map(i=>Object(M.c)(void 0,...t.get_areas_for_episode(e.episode).map(e=>{const t=i.get(e.id);return{area:e,label:e.name+(t?` (${t})`:"")}}))):Object(M.c)()}),this.current_area=Object(M.d)((e,t)=>e.find(e=>e.area==t),this.areas,i.current_area);const o=i.current_quest.map(e=>null!=e);this.can_save=o,this.can_select_area=o,this.can_debug=o,this.can_undo=Object(M.d)((e,t)=>e&&!t,ws.can_undo,i.quest_runner.running),this.can_redo=Object(M.d)((e,t)=>e&&!t,ws.can_redo,i.quest_runner.running),this.can_step=i.quest_runner.paused,this.can_stop=i.quest_runner.running,this.disposables(i.current_quest.observe(()=>{this.quest_filename=void 0}),e.on_global_keydown(le.b.QuestEditor,"Ctrl-O",()=>{const e=Object(v.m)();e.type="file",e.multiple=!0,e.onchange=()=>{e.files&&e.files.length&&this.open_files(Array.prototype.slice.apply(e.files))},e.click()}),e.on_global_keydown(le.b.QuestEditor,"Ctrl-Shift-S",this.save_as),e.on_global_keydown(le.b.QuestEditor,"Ctrl-Z",()=>{ws.undo()}),e.on_global_keydown(le.b.QuestEditor,"Ctrl-Shift-Z",()=>{ws.redo()}),e.on_global_keydown(le.b.QuestEditor,"F5",this.debug),e.on_global_keydown(le.b.QuestEditor,"Shift-F5",this.stop),e.on_global_keydown(le.b.QuestEditor,"F6",this.resume),e.on_global_keydown(le.b.QuestEditor,"F8",this.step_over),e.on_global_keydown(le.b.QuestEditor,"F7",this.step_in),e.on_global_keydown(le.b.QuestEditor,"Shift-F8",this.step_out))}}class ca{constructor(e,t,i){this.quest=e,this.old=t,this.new=i}}class la extends ca{constructor(){super(...arguments),this.description="Edit ID"}undo(){this.quest.set_id(this.old)}redo(){this.quest.set_id(this.new)}}class _a extends ca{constructor(){super(...arguments),this.description="Edit name"}undo(){this.quest.set_name(this.old)}redo(){this.quest.set_name(this.new)}}class ua extends ca{constructor(){super(...arguments),this.description="Edit short description"}undo(){this.quest.set_short_description(this.old)}redo(){this.quest.set_short_description(this.new)}}class va extends ca{constructor(){super(...arguments),this.description="Edit long description"}undo(){this.quest.set_long_description(this.old)}redo(){this.quest.set_long_description(this.new)}}class ha extends $n{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.set_id=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new la(t,t.id.val,e)).redo()},this.set_name=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new _a(t,t.name.val,e)).redo()},this.set_short_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ua(t,t.short_description.val,e)).redo()},this.set_long_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new va(t,t.long_description.val,e)).redo()},this.current_quest=e.current_quest,this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=this.current_quest.map(e=>null==e)}}const pa=Object.freeze(new y.Vector3),ga=Object.freeze(new y.Euler);class ba extends $n{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()};const t=e.selected_entity;this.unavailable=t.map(e=>null==e),this.enabled=e.quest_runner.running.map(e=>!e),this.type=t.map(e=>e instanceof K?"NPC":"Object"),this.name=t.map(e=>null==e?"":L(e.type).name),this.section_id=t.flat_map(e=>null==e?Object(M.e)(""):e.section_id.map(e=>e.toString())),this.wave=t.flat_map(e=>e instanceof K?e.wave.flat_map(e=>{var t,i,o;return null!=(o=null===(i=null===(t=e)||void 0===t?void 0:t.id)||void 0===i?void 0:i.map(e=>e.toString()))?o:Object(M.e)("None")}):Object(M.e)("")),this.wave_hidden=t.map(e=>!(e instanceof K)),this.position=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.position)?i:Object(M.e)(pa)}),this.rotation=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.rotation)?i:Object(M.e)(ga)})}set_pos_x(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Ie(this.store,t,t.section.val,t.section.val,i,new y.Vector3(e,i.y,i.z),!1)).redo()}}set_pos_y(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Ie(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,e,i.z),!1)).redo()}}set_pos_z(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Ie(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,i.y,e),!1)).redo()}}set_rot_x(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ye(this.store,t,i,$(z(e),i.y,i.z),!1)).redo()}}set_rot_y(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ye(this.store,t,i,$(i.x,z(e),i.z),!1)).redo()}}set_rot_z(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ye(this.store,t,i,$(i.x,i.y,z(e)),!1)).redo()}}}class fa extends $n{constructor(e){super(),this.unavailable=e.current_quest.map(e=>null==e),this.npc_counts=e.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).map(this.update_view)}update_view(e){const t=new Map;for(const i of e)if(i.type!==I.c.VolOptPart2){const e=t.get(i.type)||0;t.set(i.type,e+1)}const i=8*(t.get(I.c.Canane)||0);return[...t].sort((e,t)=>e[0]-t[0]).map(([e,t])=>{const o=e===I.c.Canadine?i:0;return{name:Object(I.d)(e).name,count:t+o}})}}class ma{constructor(e,t,i){this.event=e,this.old_delay=t,this.new_delay=i,this.description=`Edit delay of event ${e.id}`}undo(){this.event.set_delay(this.old_delay)}redo(){this.event.set_delay(this.new_delay)}}class wa{constructor(e,t,i,o){this.store=e,this.quest=t,this.event_dag=i,this.event=o,this.new_edges=[],this.description=`Delete event ${o.id}`,this.parents=i.get_parents(o).slice(),this.children=i.get_children(o).slice();for(const e of this.parents){const t=i.get_children(e);for(const i of this.children)t.includes(i)||this.new_edges.push({parent:e,child:i})}this.npcs=t.npcs.val.filter(e=>e.wave.val===o.wave),this.event_index=i.get_index(o)}undo(){this.quest.insert_event(this.event_index,this.event,this.parents,this.children);for(const{parent:e,child:t}of this.new_edges)this.event_dag.remove_edge(e,t);for(const e of this.npcs)e.set_wave(this.event.wave)}redo(){this.store.selected_wave.val===this.event.wave&&this.store.set_selected_wave(void 0);for(const{parent:e,child:t}of this.new_edges)this.event_dag.add_edge(e,t);this.quest.remove_event(this.event_dag,this.event)}}class ka{constructor(e,t,i,o){this.quest=e,this.event_dag=t,this.event=i,this.parent_event=o,this.description=`Add event ${i.id}`}undo(){this.quest.remove_event(this.event_dag,this.event)}redo(){this.quest.add_event(this.event,this.parent_event?[this.parent_event]:[],[])}}class ya extends $n{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.add_event=()=>{var e,t,i,o,s;const n=this.store.current_quest.val,r=this.store.current_area.val;if(n&&r){const a=n.get_event_dag_or_create(r.id),d=a.events.find(e=>e.wave===this.store.selected_wave.val),c=null!=(s=null!=(t=null===(e=d)||void 0===e?void 0:e.section_id)?t:null===(o=null===(i=this.store.selected_entity.val)||void 0===i?void 0:i.section_id)||void 0===o?void 0:o.val)?s:1,l=[],_=[];for(const e of a.events)l.push(e.id),e.wave.section_id.val===c&&_.push(e.wave.id.val);l.sort((e,t)=>e-t),_.sort((e,t)=>e-t);let u,v=0;for(const e of _)if(++v!==e)break;if(v===_.length&&v++,d){let e=d;for(;;){const[t]=a.get_parents(e);if(!t)break;e=t}const t=a.get_sub_graph(e).length.val;u=`${e.id}${t}`}else u=`${c}${v}`;let h=parseInt(u,10),p=0;for(;p=l.indexOf(h,p),-1!==p;)h++;this.store.undo.push(new ka(n,a,new ea(h,c,new ta(v,r.id,c),30,0),d)).redo()}},this.remove_event=e=>{const t=this.store.current_quest.val,i=this.event_dag.val;t&&i&&this.store.undo.push(new wa(this.store,t,i,e)).redo()},this.set_selected_wave=e=>{this.store.set_selected_wave(e)},this.set_delay=(e,t)=>{this.store.undo.push(new ma(e,e.delay.val,t)).redo()},this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=e.current_quest.map(e=>null==e),this.event_dag=Object(M.d)((e,t)=>e&&t?e.event_dags.get(t.id):void 0,e.current_quest,e.current_area),this.event_sub_graphs=Object(M.b)(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.connected_sub_graphs)?i:Object(M.c)()},this.event_dag)}is_selected(e){return this.store.selected_wave.map(t=>e.wave===t)}add_action(e,t){let i;switch(t){case ot.SpawnNpcs:i=new rt(0,0);break;case ot.Unlock:i=new at(0);break;case ot.Lock:i=new dt(0)}e.add_action(i)}remove_action(e,t){e.remove_action(t)}}function Ra(e,t,i){const o=new d.a,s=o.add(new pn(e)),n=o.add(new Bn(e)),r=o.add(new on(s)),a=o.add(new Ls(t,r)),c=o.add(new Ks(a)),l=new zn,_=o.add(new jn(n,i));return{view:o.add(new fs(t,a,l,o.add(new Un(o.add(new da(t,r,a)))),()=>new f(o.add(new ha(a))),()=>new m(o.add(new fa(a))),()=>new ze(t,a,s,n,i()),()=>new Ke(t,a.quest_runner,c),()=>new Qe(o.add(new ba(a))),()=>new Je(a,_),()=>new Xe(a,_),()=>new bt(o.add(new ya(a))),()=>new vs(t,a,s,n,i()),()=>new as(a.quest_runner))),dispose(){o.dispose()}}}i.d(t,"initialize_quest_editor",(function(){return Ra}))},"9dYx":function(e,t,i){"use strict";var o=i("bcBH");class s{constructor(e,t){this._position=0,this.endianness=e,this.offset=t}get position(){return this._position}get endianness(){return this.little_endian?o.a.Little:o.a.Big}set endianness(e){this.little_endian=e===o.a.Little}get bytes_left(){return this.size-this.position}seek(e){return this.seek_start(this.position+e)}seek_start(e){if(e<0||e>this.size)throw new Error(`Offset ${e} is out of bounds.`);return this._position=e,this}seek_end(e){if(e<0||e>this.size)throw new Error(`Offset ${e} is out of bounds.`);return this._position=this.size-e,this}u8(){return this.u8_at(this._position++)}u8_at(e){return this.check_offset(e,1),this.dv.getUint8(this.offset+e)}u16(){const e=this.u16_at(this.position);return this._position+=2,e}u16_at(e){return this.check_offset(e,2),this.dv.getUint16(this.offset+e,this.little_endian)}u32(){const e=this.u32_at(this.position);return this._position+=4,e}u32_at(e){return this.check_offset(e,4),this.dv.getUint32(this.offset+e,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(e){return this.check_offset(e,1),this.dv.getInt8(this.offset+e)}i16(){const e=this.i16_at(this.position);return this._position+=2,e}i16_at(e){return this.check_offset(e,2),this.dv.getInt16(this.offset+e,this.little_endian)}i32(){const e=this.i32_at(this.position);return this._position+=4,e}i32_at(e){return this.check_offset(e,4),this.dv.getInt32(this.offset+e,this.little_endian)}f32(){const e=this.f32_at(this.position);return this._position+=4,e}f32_at(e){return this.check_offset(e,4),this.dv.getFloat32(this.offset+e,this.little_endian)}u8_array(e){this.check_size("n",e,e);const t=[];for(let i=0;ithis.size-this.position)throw new Error(`${e} ${t} is out of bounds.`)}check_offset(e,t){if(e<0||e+t>this.size)throw new Error(`Offset ${e} is out of bounds.`)}}i.d(t,"a",(function(){return n}));class n extends s{write_u8(e){return this.write_u8_at(this.position,e),this._position+=1,this}write_u16(e){return this.write_u16_at(this.position,e),this._position+=2,this}write_u32(e){return this.write_u32_at(this.position,e),this._position+=4,this}write_i8(e){return this.write_i8_at(this.position,e),this._position+=1,this}write_i16(e){return this.write_i16_at(this.position,e),this._position+=2,this}write_i32(e){return this.write_i32_at(this.position,e),this._position+=4,this}write_f32(e){return this.write_f32_at(this.position,e),this._position+=4,this}write_u8_array(e){return this.write_u8_array_at(this.position,e),this._position+=e.length,this}write_u16_array(e){return this.write_u16_array_at(this.position,e),this._position+=2*e.length,this}write_u32_array(e){return this.write_u32_array_at(this.position,e),this._position+=4*e.length,this}write_vec2_f32(e){return this.write_vec2_f32_at(this.position,e),this._position+=8,this}write_vec3_f32(e){return this.write_vec3_f32_at(this.position,e),this._position+=12,this}write_cursor(e){const t=e.size-e.position;return this.ensure_size(t),e.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,t),t),this._position+=t,this}write_string_ascii(e,t){return this.write_string_ascii_at(this.position,e,t),this._position+=t,this}write_string_utf16(e,t){return this.write_string_utf16_at(this.position,e,t),this._position+=t,this}write_u8_at(e,t){return this.ensure_size(1,e),this.dv.setUint8(e,t),this}write_u16_at(e,t){return this.ensure_size(2,e),this.dv.setUint16(e,t,this.little_endian),this}write_u32_at(e,t){return this.ensure_size(4,e),this.dv.setUint32(e,t,this.little_endian),this}write_i8_at(e,t){return this.ensure_size(1,e),this.dv.setInt8(e,t),this}write_i16_at(e,t){return this.ensure_size(2,e),this.dv.setInt16(e,t,this.little_endian),this}write_i32_at(e,t){return this.ensure_size(4,e),this.dv.setInt32(e,t,this.little_endian),this}write_f32_at(e,t){return this.ensure_size(4,e),this.dv.setFloat32(e,t,this.little_endian),this}write_u8_array_at(e,t){return this.ensure_size(t.length,e),new Uint8Array(this.backing_buffer,this.offset+e).set(new Uint8Array(t)),this}write_u16_array_at(e,t){this.ensure_size(2*t.length,e);const i=t.length;for(let o=0;oi)throw new Error(`${e} Bytes required but only ${i} available.`)}}},I7a6:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var o=i("nsCy"),s=i("rwco"),n=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const r=s.c.get("core/persistence/Persister");class a{persist_for_server(e,t,i){this.persist(this.server_key(e,t),i)}persist(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(t){r.error(`Couldn't persist ${e}.`,t)}}load_for_server(e,t){return n(this,void 0,void 0,(function*(){return this.load(this.server_key(e,t))}))}load(e){return n(this,void 0,void 0,(function*(){try{const t=localStorage.getItem(e);return t&&JSON.parse(t)}catch(t){return void r.error(`Couldn't load ${e}.`,t)}}))}server_key(e,t){let i=t+".";switch(e){case o.g.Ephinea:i+="Ephinea";break;default:throw new Error(`Server ${o.g[e]} not supported.`)}return i}}},NRxM:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var o=i("9dYx");class s extends o.a{constructor(e,t,i=0,o=e.byteLength-i){super(t,i),this._size=o,this.backing_buffer=e,this.dv=new DataView(e,0,e.byteLength)}get size(){return this._size}set size(e){if(e>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${e} is out of bounds.`);this._size=e}take(e){const t=this.offset+this.position,i=new s(this.backing_buffer,this.endianness,t,e);return this._position+=e,i}}},NUmZ:function(e,t,i){e.exports=function(){return new Worker(i.p+"8c50d8ef57594e0c97ab.worker.js")}},"Sa3/":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var o=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};function s(e){return o(this,void 0,void 0,(function*(){return new Promise((t,i)=>{const o=new FileReader;o.addEventListener("loadend",()=>{o.result instanceof ArrayBuffer?t(o.result):i(new Error("Couldn't read file."))}),o.readAsArrayBuffer(e)})}))}},bcBH:function(e,t,i){"use strict";var o;i.d(t,"a",(function(){return o})),function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"}(o||(o={}))},yub1:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var o=i("9Ykw");const s=i("rwco").c.get("core/data_formats/parsing/ninja/texture"),n=1213027928,r=1414682200;function a(e){const t=Object(o.a)(e),i=t.find(e=>e.type===n),a=i&&function(e){return{texture_count:e.u16()}}(i.data),d=t.filter(e=>e.type===r).map(e=>(function(e){const t=e.u32(),i=e.u32(),o=e.u32(),s=e.u16(),n=e.u16(),r=e.u32();return e.seek(36),{id:o,format:[t,i],width:s,height:n,size:r,data:e.array_buffer(r)}})(e.data));return a&&a.texture_count!==d.length&&s.warn(`Found ${d.length} textures instead of ${a.texture_count} as defined in the header.`),{textures:d}}}}]); \ No newline at end of file diff --git a/7.8d167ff95415c20eca6f.js b/7.8d167ff95415c20eca6f.js new file mode 100644 index 00000000..1e34a8e9 --- /dev/null +++ b/7.8d167ff95415c20eca6f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{"4aaK":function(e,t,i){"use strict";i.r(t);var o=i("nN8q"),s=i("xGNL"),n=i.n(s),r=i("xs7i"),a=i("PE7g"),d=i("Tpfs"),c=i("0Xme");class l extends c.a{constructor(e="",t){if(super(e,"core_TextInput","text","core_TextInput_inner",t),this.preferred_label_position="left",t){const{max_length:e}=t;this.set_attr("maxLength",e)}this.set_value(e),this.finalize_construction()}get_value(){return this.input_element.value}set_value(e){this.input_element.value=e}}var _=i("sDu+"),u=(i("C5oP"),i("4VsB")),v=i("FXpb");class h extends _.a{constructor(e="",t){super(t),this.element=Object(v.i)({className:"core_TextArea"}),this.preferred_label_position="left",this.text_element=Object(v.v)({className:"core_TextArea_inner"}),this._value=new u.a(this,"",this.set_value),t&&(null!=t.max_length&&(this.text_element.maxLength=t.max_length),null!=t.font_family&&(this.text_element.style.fontFamily=t.font_family),null!=t.rows&&(this.text_element.rows=t.rows),null!=t.cols&&(this.text_element.cols=t.cols)),this.value=this._value,this.set_value(e),this.text_element.onchange=()=>this._value.set_val(this.text_element.value,{silent:!1}),this.element.append(this.text_element),this.finalize_construction()}set_value(e){this.text_element.value=e}}i("ObFr");var p=i("TRid"),g=i("7ZX1");i("7YJZ");class b extends p.a{constructor(e){super(),this.element=Object(v.i)({className:"quest_editor_UnavailableView"}),this.label=this.disposable(new g.a(e,{enabled:!1})),this.element.append(this.label.element),this.finalize_construction()}}class f extends o.a{constructor(e){super(),this.element=Object(v.i)({className:"quest_editor_QuestInfoView",tabIndex:-1}),this.table_element=Object(v.s)(),this.id_input=this.disposable(new a.a(0,{min:0,step:1})),this.name_input=this.disposable(new l("",{max_length:32})),this.short_description_input=this.disposable(new h("",{max_length:128,font_family:'"Courier New", monospace',cols:25,rows:5})),this.long_description_input=this.disposable(new h("",{max_length:288,font_family:'"Courier New", monospace',cols:25,rows:10})),this.unavailable_view=new b("No quest loaded."),this.quest_disposer=this.disposable(new d.a);const t=e.current_quest;this.table_element.append(Object(v.z)(Object(v.x)("Episode:"),this.episode_element=Object(v.u)()),Object(v.z)(Object(v.x)("ID:"),Object(v.u)(this.id_input.element)),Object(v.z)(Object(v.x)("Name:"),Object(v.u)(this.name_input.element)),Object(v.z)(Object(v.x)({colSpan:2},"Short description:")),Object(v.z)(Object(v.u)({colSpan:2},this.short_description_input.element)),Object(v.z)(Object(v.x)({colSpan:2},"Long description:")),Object(v.z)(Object(v.u)({colSpan:2},this.long_description_input.element))),this.bind_hidden(this.table_element,e.unavailable),this.element.append(this.table_element,this.unavailable_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(this.unavailable_view.visible.bind_to(e.unavailable),t.observe(({value:t})=>{this.quest_disposer.dispose_all(),this.episode_element.textContent=t?r.b[t.episode]:"",t&&this.quest_disposer.add_all(this.id_input.value.bind_to(t.id),this.id_input.value.observe(({value:t})=>e.set_id(t)),this.name_input.value.bind_to(t.name),this.name_input.value.observe(({value:t})=>e.set_name(t)),this.short_description_input.value.bind_to(t.short_description),this.short_description_input.value.observe(({value:t})=>e.set_short_description(t)),this.long_description_input.value.bind_to(t.long_description),this.long_description_input.value.observe(({value:t})=>e.set_long_description(t)),this.enabled.bind_to(e.enabled))})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.id_input.enabled.val=e,this.name_input.enabled.val=e,this.short_description_input.enabled.val=e,this.long_description_input.enabled.val=e}}i("88+i"),i("UrNz"),i("5sDa");class m extends o.a{constructor(e){super(),this.element=Object(v.i)({className:"quest_editor_NpcCountsView"}),this.table_element=Object(v.s)(),this.unavailable_view=new b("No quest loaded."),this.element.append(this.table_element,this.unavailable_view.element),this.disposables(Object(v.c)(this.table_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),e.npc_counts.observe(({value:e})=>this.update_view(e),{call_now:!0})),this.finalize_construction()}update_view(e){const t=document.createDocumentFragment();for(const{name:i,count:o}of e)t.append(Object(v.z)(Object(v.x)(i+":"),Object(v.u)(String(o))));this.table_element.innerHTML="",this.table_element.append(t)}}var w,k=i("Ftn7"),y=i("Womt"),R=i("Eqai"),I=i("sZ1+");!function(e){e[e.Unknown=1e3]="Unknown",e[e.PlayerSet=1001]="PlayerSet",e[e.Particle=1002]="Particle",e[e.Teleporter=1003]="Teleporter",e[e.Warp=1004]="Warp",e[e.LightCollision=1005]="LightCollision",e[e.Item=1006]="Item",e[e.EnvSound=1007]="EnvSound",e[e.FogCollision=1008]="FogCollision",e[e.EventCollision=1009]="EventCollision",e[e.CharaCollision=1010]="CharaCollision",e[e.ElementalTrap=1011]="ElementalTrap",e[e.StatusTrap=1012]="StatusTrap",e[e.HealTrap=1013]="HealTrap",e[e.LargeElementalTrap=1014]="LargeElementalTrap",e[e.ObjRoomID=1015]="ObjRoomID",e[e.Sensor=1016]="Sensor",e[e.UnknownItem16=1017]="UnknownItem16",e[e.LensFlare=1018]="LensFlare",e[e.ScriptCollision=1019]="ScriptCollision",e[e.HealRing=1020]="HealRing",e[e.MapCollision=1021]="MapCollision",e[e.ScriptCollisionA=1022]="ScriptCollisionA",e[e.ItemLight=1023]="ItemLight",e[e.RadarCollision=1024]="RadarCollision",e[e.FogCollisionSW=1025]="FogCollisionSW",e[e.BossTeleporter=1026]="BossTeleporter",e[e.ImageBoard=1027]="ImageBoard",e[e.QuestWarp=1028]="QuestWarp",e[e.Epilogue=1029]="Epilogue",e[e.UnknownItem29=1030]="UnknownItem29",e[e.UnknownItem30=1031]="UnknownItem30",e[e.UnknownItem31=1032]="UnknownItem31",e[e.BoxDetectObject=1033]="BoxDetectObject",e[e.SymbolChatObject=1034]="SymbolChatObject",e[e.TouchPlateObject=1035]="TouchPlateObject",e[e.TargetableObject=1036]="TargetableObject",e[e.EffectObject=1037]="EffectObject",e[e.CountDownObject=1038]="CountDownObject",e[e.UnknownItem38=1039]="UnknownItem38",e[e.UnknownItem39=1040]="UnknownItem39",e[e.UnknownItem40=1041]="UnknownItem40",e[e.UnknownItem41=1042]="UnknownItem41",e[e.MenuActivation=1043]="MenuActivation",e[e.TelepipeLocation=1044]="TelepipeLocation",e[e.BGMCollision=1045]="BGMCollision",e[e.MainRagolTeleporter=1046]="MainRagolTeleporter",e[e.LobbyTeleporter=1047]="LobbyTeleporter",e[e.PrincipalWarp=1048]="PrincipalWarp",e[e.ShopDoor=1049]="ShopDoor",e[e.HuntersGuildDoor=1050]="HuntersGuildDoor",e[e.TeleporterDoor=1051]="TeleporterDoor",e[e.MedicalCenterDoor=1052]="MedicalCenterDoor",e[e.Elevator=1053]="Elevator",e[e.EasterEgg=1054]="EasterEgg",e[e.ValentinesHeart=1055]="ValentinesHeart",e[e.ChristmasTree=1056]="ChristmasTree",e[e.ChristmasWreath=1057]="ChristmasWreath",e[e.HalloweenPumpkin=1058]="HalloweenPumpkin",e[e.TwentyFirstCentury=1059]="TwentyFirstCentury",e[e.Sonic=1060]="Sonic",e[e.WelcomeBoard=1061]="WelcomeBoard",e[e.Firework=1062]="Firework",e[e.LobbyScreenDoor=1063]="LobbyScreenDoor",e[e.MainRagolTeleporterBattleInNextArea=1064]="MainRagolTeleporterBattleInNextArea",e[e.LabTeleporterDoor=1065]="LabTeleporterDoor",e[e.Pioneer2InvisibleTouchplate=1066]="Pioneer2InvisibleTouchplate",e[e.ForestDoor=1067]="ForestDoor",e[e.ForestSwitch=1068]="ForestSwitch",e[e.LaserFence=1069]="LaserFence",e[e.LaserSquareFence=1070]="LaserSquareFence",e[e.ForestLaserFenceSwitch=1071]="ForestLaserFenceSwitch",e[e.LightRays=1072]="LightRays",e[e.BlueButterfly=1073]="BlueButterfly",e[e.Probe=1074]="Probe",e[e.RandomTypeBox1=1075]="RandomTypeBox1",e[e.ForestWeatherStation=1076]="ForestWeatherStation",e[e.Battery=1077]="Battery",e[e.ForestConsole=1078]="ForestConsole",e[e.BlackSlidingDoor=1079]="BlackSlidingDoor",e[e.RicoMessagePod=1080]="RicoMessagePod",e[e.EnergyBarrier=1081]="EnergyBarrier",e[e.ForestRisingBridge=1082]="ForestRisingBridge",e[e.SwitchNoneDoor=1083]="SwitchNoneDoor",e[e.EnemyBoxGrey=1084]="EnemyBoxGrey",e[e.FixedTypeBox=1085]="FixedTypeBox",e[e.EnemyBoxBrown=1086]="EnemyBoxBrown",e[e.EmptyTypeBox=1087]="EmptyTypeBox",e[e.LaserFenceEx=1088]="LaserFenceEx",e[e.LaserSquareFenceEx=1089]="LaserSquareFenceEx",e[e.FloorPanel1=1090]="FloorPanel1",e[e.Caves4ButtonDoor=1091]="Caves4ButtonDoor",e[e.CavesNormalDoor=1092]="CavesNormalDoor",e[e.CavesSmashingPillar=1093]="CavesSmashingPillar",e[e.CavesSign1=1094]="CavesSign1",e[e.CavesSign2=1095]="CavesSign2",e[e.CavesSign3=1096]="CavesSign3",e[e.HexagonalTank=1097]="HexagonalTank",e[e.BrownPlatform=1098]="BrownPlatform",e[e.WarningLightObject=1099]="WarningLightObject",e[e.Rainbow=1100]="Rainbow",e[e.FloatingJellyfish=1101]="FloatingJellyfish",e[e.FloatingDragonfly=1102]="FloatingDragonfly",e[e.CavesSwitchDoor=1103]="CavesSwitchDoor",e[e.RobotRechargeStation=1104]="RobotRechargeStation",e[e.CavesCakeShop=1105]="CavesCakeShop",e[e.Caves1SmallRedRock=1106]="Caves1SmallRedRock",e[e.Caves1MediumRedRock=1107]="Caves1MediumRedRock",e[e.Caves1LargeRedRock=1108]="Caves1LargeRedRock",e[e.Caves2SmallRock1=1109]="Caves2SmallRock1",e[e.Caves2MediumRock1=1110]="Caves2MediumRock1",e[e.Caves2LargeRock1=1111]="Caves2LargeRock1",e[e.Caves2SmallRock2=1112]="Caves2SmallRock2",e[e.Caves2MediumRock2=1113]="Caves2MediumRock2",e[e.Caves2LargeRock2=1114]="Caves2LargeRock2",e[e.Caves3SmallRock=1115]="Caves3SmallRock",e[e.Caves3MediumRock=1116]="Caves3MediumRock",e[e.Caves3LargeRock=1117]="Caves3LargeRock",e[e.FloorPanel2=1118]="FloorPanel2",e[e.DestructableRockCaves1=1119]="DestructableRockCaves1",e[e.DestructableRockCaves2=1120]="DestructableRockCaves2",e[e.DestructableRockCaves3=1121]="DestructableRockCaves3",e[e.MinesDoor=1122]="MinesDoor",e[e.FloorPanel3=1123]="FloorPanel3",e[e.MinesSwitchDoor=1124]="MinesSwitchDoor",e[e.LargeCryoTube=1125]="LargeCryoTube",e[e.ComputerLikeCalus=1126]="ComputerLikeCalus",e[e.GreenScreenOpeningAndClosing=1127]="GreenScreenOpeningAndClosing",e[e.FloatingRobot=1128]="FloatingRobot",e[e.FloatingBlueLight=1129]="FloatingBlueLight",e[e.SelfDestructingObject1=1130]="SelfDestructingObject1",e[e.SelfDestructingObject2=1131]="SelfDestructingObject2",e[e.SelfDestructingObject3=1132]="SelfDestructingObject3",e[e.SparkMachine=1133]="SparkMachine",e[e.MinesLargeFlashingCrate=1134]="MinesLargeFlashingCrate",e[e.RuinsSeal=1135]="RuinsSeal",e[e.RuinsTeleporter=1136]="RuinsTeleporter",e[e.RuinsWarpSiteToSite=1137]="RuinsWarpSiteToSite",e[e.RuinsSwitch=1138]="RuinsSwitch",e[e.FloorPanel4=1139]="FloorPanel4",e[e.Ruins1Door=1140]="Ruins1Door",e[e.Ruins3Door=1141]="Ruins3Door",e[e.Ruins2Door=1142]="Ruins2Door",e[e.Ruins11ButtonDoor=1143]="Ruins11ButtonDoor",e[e.Ruins21ButtonDoor=1144]="Ruins21ButtonDoor",e[e.Ruins31ButtonDoor=1145]="Ruins31ButtonDoor",e[e.Ruins4ButtonDoor=1146]="Ruins4ButtonDoor",e[e.Ruins2ButtonDoor=1147]="Ruins2ButtonDoor",e[e.RuinsSensor=1148]="RuinsSensor",e[e.RuinsFenceSwitch=1149]="RuinsFenceSwitch",e[e.RuinsLaserFence4x2=1150]="RuinsLaserFence4x2",e[e.RuinsLaserFence6x2=1151]="RuinsLaserFence6x2",e[e.RuinsLaserFence4x4=1152]="RuinsLaserFence4x4",e[e.RuinsLaserFence6x4=1153]="RuinsLaserFence6x4",e[e.RuinsPoisonBlob=1154]="RuinsPoisonBlob",e[e.RuinsPillarTrap=1155]="RuinsPillarTrap",e[e.PopupTrapNoTech=1156]="PopupTrapNoTech",e[e.RuinsCrystal=1157]="RuinsCrystal",e[e.Monument=1158]="Monument",e[e.RuinsRock1=1159]="RuinsRock1",e[e.RuinsRock2=1160]="RuinsRock2",e[e.RuinsRock3=1161]="RuinsRock3",e[e.RuinsRock4=1162]="RuinsRock4",e[e.RuinsRock5=1163]="RuinsRock5",e[e.RuinsRock6=1164]="RuinsRock6",e[e.RuinsRock7=1165]="RuinsRock7",e[e.Poison=1166]="Poison",e[e.FixedBoxTypeRuins=1167]="FixedBoxTypeRuins",e[e.RandomBoxTypeRuins=1168]="RandomBoxTypeRuins",e[e.EnemyTypeBoxYellow=1169]="EnemyTypeBoxYellow",e[e.EnemyTypeBoxBlue=1170]="EnemyTypeBoxBlue",e[e.EmptyTypeBoxBlue=1171]="EmptyTypeBoxBlue",e[e.DestructableRock=1172]="DestructableRock",e[e.PopupTrapsTechs=1173]="PopupTrapsTechs",e[e.FlyingWhiteBird=1174]="FlyingWhiteBird",e[e.Tower=1175]="Tower",e[e.FloatingRocks=1176]="FloatingRocks",e[e.FloatingSoul=1177]="FloatingSoul",e[e.Butterfly=1178]="Butterfly",e[e.LobbyGameMenu=1179]="LobbyGameMenu",e[e.LobbyWarpObject=1180]="LobbyWarpObject",e[e.Lobby1EventObjectDefaultTree=1181]="Lobby1EventObjectDefaultTree",e[e.UnknownItem387=1182]="UnknownItem387",e[e.UnknownItem388=1183]="UnknownItem388",e[e.UnknownItem389=1184]="UnknownItem389",e[e.LobbyEventObjectStaticPumpkin=1185]="LobbyEventObjectStaticPumpkin",e[e.LobbyEventObject3ChristmasWindows=1186]="LobbyEventObject3ChristmasWindows",e[e.LobbyEventObjectRedAndWhiteCurtain=1187]="LobbyEventObjectRedAndWhiteCurtain",e[e.UnknownItem393=1188]="UnknownItem393",e[e.UnknownItem394=1189]="UnknownItem394",e[e.LobbyFishTank=1190]="LobbyFishTank",e[e.LobbyEventObjectButterflies=1191]="LobbyEventObjectButterflies",e[e.UnknownItem400=1192]="UnknownItem400",e[e.GreyWallLow=1193]="GreyWallLow",e[e.SpaceshipDoor=1194]="SpaceshipDoor",e[e.GreyWallHigh=1195]="GreyWallHigh",e[e.TempleNormalDoor=1196]="TempleNormalDoor",e[e.BreakableWallWallButUnbreakable=1197]="BreakableWallWallButUnbreakable",e[e.BrokenCylinderAndRubble=1198]="BrokenCylinderAndRubble",e[e.ThreeBrokenWallPiecesOnFloor=1199]="ThreeBrokenWallPiecesOnFloor",e[e.HighBrickCylinder=1200]="HighBrickCylinder",e[e.LyingCylinder=1201]="LyingCylinder",e[e.BrickConeWithFlatTop=1202]="BrickConeWithFlatTop",e[e.BreakableTempleWall=1203]="BreakableTempleWall",e[e.TempleMapDetect=1204]="TempleMapDetect",e[e.SmallBrownBrickRisingBridge=1205]="SmallBrownBrickRisingBridge",e[e.LongRisingBridgeWithPinkHighEdges=1206]="LongRisingBridgeWithPinkHighEdges",e[e.FourSwitchTempleDoor=1207]="FourSwitchTempleDoor",e[e.FourButtonSpaceshipDoor=1208]="FourButtonSpaceshipDoor",e[e.ItemBoxCca=1209]="ItemBoxCca",e[e.TeleporterEp2=1210]="TeleporterEp2",e[e.CCADoor=1211]="CCADoor",e[e.SpecialBoxCCA=1212]="SpecialBoxCCA",e[e.BigCCADoor=1213]="BigCCADoor",e[e.BigCCADoorSwitch=1214]="BigCCADoorSwitch",e[e.LittleRock=1215]="LittleRock",e[e.Little3StoneWall=1216]="Little3StoneWall",e[e.Medium3StoneWall=1217]="Medium3StoneWall",e[e.SpiderPlant=1218]="SpiderPlant",e[e.CCAAreaTeleporter=1219]="CCAAreaTeleporter",e[e.UnknownItem523=1220]="UnknownItem523",e[e.WhiteBird=1221]="WhiteBird",e[e.OrangeBird=1222]="OrangeBird",e[e.Saw=1223]="Saw",e[e.LaserDetect=1224]="LaserDetect",e[e.UnknownItem529=1225]="UnknownItem529",e[e.UnknownItem530=1226]="UnknownItem530",e[e.Seagull=1227]="Seagull",e[e.Fish=1228]="Fish",e[e.SeabedDoorWithBlueEdges=1229]="SeabedDoorWithBlueEdges",e[e.SeabedDoorAlwaysOpenNonTriggerable=1230]="SeabedDoorAlwaysOpenNonTriggerable",e[e.LittleCryotube=1231]="LittleCryotube",e[e.WideGlassWallBreakable=1232]="WideGlassWallBreakable",e[e.BlueFloatingRobot=1233]="BlueFloatingRobot",e[e.RedFloatingRobot=1234]="RedFloatingRobot",e[e.Dolphin=1235]="Dolphin",e[e.CaptureTrap=1236]="CaptureTrap",e[e.VRLink=1237]="VRLink",e[e.UnknownItem576=1238]="UnknownItem576",e[e.WarpInBarbaRayRoom=1239]="WarpInBarbaRayRoom",e[e.UnknownItem672=1240]="UnknownItem672",e[e.GeeNest=1241]="GeeNest",e[e.LabComputerConsole=1242]="LabComputerConsole",e[e.LabComputerConsoleGreenScreen=1243]="LabComputerConsoleGreenScreen",e[e.ChairYellowPillow=1244]="ChairYellowPillow",e[e.OrangeWallWithHoleInMiddle=1245]="OrangeWallWithHoleInMiddle",e[e.GreyWallWithHoleInMiddle=1246]="GreyWallWithHoleInMiddle",e[e.LongTable=1247]="LongTable",e[e.GBAStation=1248]="GBAStation",e[e.TalkLinkToSupport=1249]="TalkLinkToSupport",e[e.InstaWarp=1250]="InstaWarp",e[e.LabInvisibleObject=1251]="LabInvisibleObject",e[e.LabGlassWindowDoor=1252]="LabGlassWindowDoor",e[e.UnknownItem700=1253]="UnknownItem700",e[e.LabCeilingWarp=1254]="LabCeilingWarp",e[e.Ep4LightSource=1255]="Ep4LightSource",e[e.Cacti=1256]="Cacti",e[e.BigBrownRock=1257]="BigBrownRock",e[e.BreakableBrownRock=1258]="BreakableBrownRock",e[e.UnknownItem832=1259]="UnknownItem832",e[e.UnknownItem833=1260]="UnknownItem833",e[e.PoisonPlant=1261]="PoisonPlant",e[e.UnknownItem897=1262]="UnknownItem897",e[e.UnknownItem898=1263]="UnknownItem898",e[e.OozingDesertPlant=1264]="OozingDesertPlant",e[e.UnknownItem901=1265]="UnknownItem901",e[e.BigBlackRocks=1266]="BigBlackRocks",e[e.UnknownItem903=1267]="UnknownItem903",e[e.UnknownItem904=1268]="UnknownItem904",e[e.UnknownItem905=1269]="UnknownItem905",e[e.UnknownItem906=1270]="UnknownItem906",e[e.FallingRock=1271]="FallingRock",e[e.DesertPlantHasCollision=1272]="DesertPlantHasCollision",e[e.DesertFixedTypeBoxBreakableCrystals=1273]="DesertFixedTypeBoxBreakableCrystals",e[e.UnknownItem910=1274]="UnknownItem910",e[e.BeeHive=1275]="BeeHive",e[e.UnknownItem912=1276]="UnknownItem912",e[e.Heat=1277]="Heat",e[e.TopOfSaintMillionEgg=1278]="TopOfSaintMillionEgg",e[e.UnknownItem961=1279]="UnknownItem961"}(w||(w={}));const j=[];function x(e){return T[e]}const T=[];function S(e,t,i,o){j.push(e);const s=[];for(const[e,t]of o)s[e]=t;T[e]=Object.freeze({name:i,area_ids:s,pso_id:t})}function C(e){var t;return null!=(t=I.c[e])?t:w[e]}function O(e){return null!=I.c[e]}function L(e){var t;return null!=(t=Object(I.d)(e))?t:x(e)}var P;S(w.Unknown,void 0,"Unknown",[]),S(w.PlayerSet,0,"Player Set",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Particle,1,"Particle",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Teleporter,2,"Teleporter",[[r.b.I,[0,1,2,3,4,5,6,7,11,12,13,14]],[r.b.II,[0,1,2,3,4,12,13,14,15]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.Warp,3,"Warp",[[r.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LightCollision,4,"Light Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,15,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.Item,5,"Item",[]),S(w.EnvSound,6,"Env Sound",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.FogCollision,7,"Fog Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.EventCollision,8,"Event Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.CharaCollision,9,"Chara Collision",[[r.b.I,[0,1,2,3,4,5,8,9,10]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ElementalTrap,10,"Elemental Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.StatusTrap,11,"Status Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.HealTrap,12,"Heal Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.LargeElementalTrap,13,"Large Elemental Trap",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.ObjRoomID,14,"Obj Room ID",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Sensor,15,"Sensor",[[r.b.I,[1,2,4,5,6,7]]]),S(w.UnknownItem16,16,"Unknown Item (16)",[]),S(w.LensFlare,17,"Lens Flare",[[r.b.I,[1,2,3,4,8,14]]]),S(w.ScriptCollision,18,"Script Collision",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.HealRing,19,"Heal Ring",[[r.b.I,[1,2,3,4,5,6,7,8,9,10]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MapCollision,20,"Map Collision",[[r.b.I,[0,1,2,3,4,5,8,9,10,16,17]],[r.b.II,[0,5,6,7,8,9,10,11,16,17]],[r.b.IV,[0]]]),S(w.ScriptCollisionA,21,"Script Collision A",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.ItemLight,22,"Item Light",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.RadarCollision,23,"Radar Collision",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FogCollisionSW,24,"Fog Collision SW",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BossTeleporter,25,"Boss Teleporter",[[r.b.I,[0,2,5,7,10]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[5,6,7,8,0]]]),S(w.ImageBoard,26,"Image Board",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.QuestWarp,27,"Quest Warp",[[r.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[r.b.IV,[9]]]),S(w.Epilogue,28,"Epilogue",[[r.b.I,[14]],[r.b.II,[13]],[r.b.IV,[9]]]),S(w.UnknownItem29,29,"Unknown Item (29)",[[r.b.I,[1]]]),S(w.UnknownItem30,30,"Unknown Item (30)",[[r.b.I,[1,2,17]],[r.b.II,[1,2,14]],[r.b.IV,[1,2,3,4,5]]]),S(w.UnknownItem31,31,"Unknown Item (31)",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BoxDetectObject,32,"Box Detect Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.SymbolChatObject,33,"Symbol Chat Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.TouchPlateObject,34,"Touch plate Object",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.TargetableObject,35,"Targetable Object",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EffectObject,36,"Effect object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[0]]]),S(w.CountDownObject,37,"Count Down Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem38,38,"Unknown Item (38)",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem39,39,"Unknown Item (39)",[[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem40,40,"Unknown Item (40)",[[r.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.UnknownItem41,41,"Unknown Item (41)",[[r.b.I,[0,1,2,4,5,6,7,8,9,10,13,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,13,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.MenuActivation,64,"Menu activation",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.TelepipeLocation,65,"Telepipe Location",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.BGMCollision,66,"BGM Collision",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.MainRagolTeleporter,67,"Main Ragol Teleporter",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.LobbyTeleporter,68,"Lobby Teleporter",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.PrincipalWarp,69,"Principal warp",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ShopDoor,70,"Shop Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.HuntersGuildDoor,71,"Hunter's Guild Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.TeleporterDoor,72,"Teleporter Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.MedicalCenterDoor,73,"Medical Center Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.Elevator,74,"Elevator",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.EasterEgg,75,"Easter Egg",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ValentinesHeart,76,"Valentines Heart",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ChristmasTree,77,"Christmas Tree",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ChristmasWreath,78,"Christmas Wreath",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.HalloweenPumpkin,79,"Halloween Pumpkin",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.TwentyFirstCentury,80,"21st Century",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.Sonic,81,"Sonic",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.WelcomeBoard,82,"Welcome Board",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.Firework,83,"Firework",[[r.b.I,[0]],[r.b.II,[0,16]],[r.b.IV,[0]]]),S(w.LobbyScreenDoor,84,"Lobby Screen Door",[[r.b.I,[0]],[r.b.IV,[0]]]),S(w.MainRagolTeleporterBattleInNextArea,85,"Main Ragol Teleporter (Battle in next area?)",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.LabTeleporterDoor,86,"Lab Teleporter Door",[[r.b.II,[0]]]),S(w.Pioneer2InvisibleTouchplate,87,"Pioneer 2 Invisible Touchplate",[[r.b.I,[0]],[r.b.II,[0]],[r.b.IV,[0]]]),S(w.ForestDoor,128,"Forest Door",[[r.b.I,[1,2]]]),S(w.ForestSwitch,129,"Forest Switch",[[r.b.I,[1,2,3,4,5]],[r.b.II,[1,2,3,4]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFence,130,"Laser Fence",[[r.b.I,[1,2,3,4,5,6,7,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFence,131,"Laser Square Fence",[[r.b.I,[1,2,3,4,5,6,7,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestLaserFenceSwitch,132,"Forest Laser Fence Switch",[[r.b.I,[1,2,3,4,5,6,7,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LightRays,133,"Light rays",[[r.b.I,[1,2]],[r.b.II,[5,6,7,8,9]],[r.b.IV,[6,7,8]]]),S(w.BlueButterfly,134,"Blue Butterfly",[[r.b.I,[1,2]],[r.b.IV,[6,7,8]]]),S(w.Probe,135,"Probe",[[r.b.I,[1,2]]]),S(w.RandomTypeBox1,136,"Random Type Box 1",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.II,[10,11,13]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestWeatherStation,137,"Forest Weather Station",[[r.b.I,[1,2]]]),S(w.Battery,138,"Battery",[]),S(w.ForestConsole,139,"Forest Console",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BlackSlidingDoor,140,"Black Sliding Door",[[r.b.I,[1,2,3]]]),S(w.RicoMessagePod,141,"Rico Message Pod",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,13]]]),S(w.EnergyBarrier,142,"Energy Barrier",[[r.b.I,[1,2,4,5,6,7]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.ForestRisingBridge,143,"Forest Rising Bridge",[[r.b.I,[1,2]]]),S(w.SwitchNoneDoor,144,"Switch (none door)",[[r.b.I,[1,2,6,7,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EnemyBoxGrey,145,"Enemy Box (Grey)",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.II,[10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedTypeBox,146,"Fixed Type Box",[[r.b.I,[1,2,3,4,5,6,7,11,12,13,14]],[r.b.II,[10,11,13]],[r.b.IV,[1,2,3,4,6,7,8,9]]]),S(w.EnemyBoxBrown,147,"Enemy Box (Brown)",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.II,[10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.EmptyTypeBox,149,"Empty Type Box",[[r.b.I,[1,2,3,4,5,6,7]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserFenceEx,150,"Laser Fence Ex",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.LaserSquareFenceEx,151,"Laser Square Fence Ex",[]),S(w.FloorPanel1,192,"Floor Panel 1",[[r.b.I,[3,4,5,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves4ButtonDoor,193,"Caves 4 Button door",[[r.b.I,[3,4,5]]]),S(w.CavesNormalDoor,194,"Caves Normal door",[[r.b.I,[3,4,5]]]),S(w.CavesSmashingPillar,195,"Caves Smashing Pillar",[[r.b.I,[3,4,5]],[r.b.II,[1,2,3,4,17]]]),S(w.CavesSign1,196,"Caves Sign 1",[[r.b.I,[4,5]]]),S(w.CavesSign2,197,"Caves Sign 2",[[r.b.I,[4,5]]]),S(w.CavesSign3,198,"Caves Sign 3",[[r.b.I,[4,5]]]),S(w.HexagonalTank,199,"Hexagonal Tank",[[r.b.I,[4,5]]]),S(w.BrownPlatform,200,"Brown Platform",[[r.b.I,[4,5]]]),S(w.WarningLightObject,201,"Warning Light Object",[[r.b.I,[4,5]],[r.b.IV,[5]]]),S(w.Rainbow,203,"Rainbow",[[r.b.I,[4]]]),S(w.FloatingJellyfish,204,"Floating Jellyfish",[[r.b.I,[4]],[r.b.II,[10,11]]]),S(w.FloatingDragonfly,205,"Floating Dragonfly",[[r.b.I,[4,16]],[r.b.II,[3,4]],[r.b.IV,[6,7,8]]]),S(w.CavesSwitchDoor,206,"Caves Switch Door",[[r.b.I,[3,4,5]]]),S(w.RobotRechargeStation,207,"Robot Recharge Station",[[r.b.I,[3,4,5,6,7]],[r.b.II,[17]]]),S(w.CavesCakeShop,208,"Caves Cake Shop",[[r.b.I,[5]]]),S(w.Caves1SmallRedRock,209,"Caves 1 Small Red Rock",[[r.b.I,[3]]]),S(w.Caves1MediumRedRock,210,"Caves 1 Medium Red Rock",[[r.b.I,[3]]]),S(w.Caves1LargeRedRock,211,"Caves 1 Large Red Rock",[[r.b.I,[3]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.Caves2SmallRock1,212,"Caves 2 Small Rock 1",[[r.b.I,[4]]]),S(w.Caves2MediumRock1,213,"Caves 2 Medium Rock 1",[[r.b.I,[4]]]),S(w.Caves2LargeRock1,214,"Caves 2 Large Rock 1",[[r.b.I,[4]]]),S(w.Caves2SmallRock2,215,"Caves 2 Small Rock 2",[[r.b.I,[4]]]),S(w.Caves2MediumRock2,216,"Caves 2 Medium Rock 2",[[r.b.I,[4]]]),S(w.Caves2LargeRock2,217,"Caves 2 Large Rock 2",[[r.b.I,[4]]]),S(w.Caves3SmallRock,218,"Caves 3 Small Rock",[[r.b.I,[5]]]),S(w.Caves3MediumRock,219,"Caves 3 Medium Rock",[[r.b.I,[5]]]),S(w.Caves3LargeRock,220,"Caves 3 Large Rock",[[r.b.I,[5]]]),S(w.FloorPanel2,222,"Floor Panel 2",[[r.b.I,[1,2,3,4,5,6,7,8,9,10,16,17]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.DestructableRockCaves1,223,"Destructable Rock (Caves 1)",[[r.b.I,[3]]]),S(w.DestructableRockCaves2,224,"Destructable Rock (Caves 2)",[[r.b.I,[4]]]),S(w.DestructableRockCaves3,225,"Destructable Rock (Caves 3)",[[r.b.I,[5]]]),S(w.MinesDoor,256,"Mines Door",[[r.b.I,[6,7]]]),S(w.FloorPanel3,257,"Floor Panel 3",[[r.b.I,[1,2,6,7,16,17]],[r.b.II,[1,2,3,4]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.MinesSwitchDoor,258,"Mines Switch Door",[[r.b.I,[6,7]],[r.b.IV,[6,7,8]]]),S(w.LargeCryoTube,259,"Large Cryo-Tube",[[r.b.I,[6,7]],[r.b.II,[17]]]),S(w.ComputerLikeCalus,260,"Computer (like calus)",[[r.b.I,[6,7]],[r.b.II,[17]]]),S(w.GreenScreenOpeningAndClosing,261,"Green Screen opening and closing",[[r.b.I,[6,7]],[r.b.II,[17]]]),S(w.FloatingRobot,262,"Floating Robot",[[r.b.I,[6,7]]]),S(w.FloatingBlueLight,263,"Floating Blue Light",[[r.b.I,[6,7]]]),S(w.SelfDestructingObject1,264,"Self Destructing Object 1",[[r.b.I,[6,7]]]),S(w.SelfDestructingObject2,265,"Self Destructing Object 2",[[r.b.I,[6,7]]]),S(w.SelfDestructingObject3,266,"Self Destructing Object 3",[[r.b.I,[6,7]]]),S(w.SparkMachine,267,"Spark Machine",[[r.b.I,[6,7]]]),S(w.MinesLargeFlashingCrate,268,"Mines Large Flashing Crate",[[r.b.I,[6,7]]]),S(w.RuinsSeal,304,"Ruins Seal",[[r.b.I,[13]]]),S(w.RuinsTeleporter,320,"Ruins Teleporter",[[r.b.I,[8,9,10]]]),S(w.RuinsWarpSiteToSite,321,"Ruins Warp (Site to site)",[[r.b.I,[8,9,10]]]),S(w.RuinsSwitch,322,"Ruins Switch",[[r.b.I,[8,9,10]]]),S(w.FloorPanel4,323,"Floor Panel 4",[[r.b.I,[8,9,10]]]),S(w.Ruins1Door,324,"Ruins 1 Door",[[r.b.I,[8]]]),S(w.Ruins3Door,325,"Ruins 3 Door",[[r.b.I,[10]]]),S(w.Ruins2Door,326,"Ruins 2 Door",[[r.b.I,[9]]]),S(w.Ruins11ButtonDoor,327,"Ruins 1-1 Button Door",[[r.b.I,[8]]]),S(w.Ruins21ButtonDoor,328,"Ruins 2-1 Button Door",[[r.b.I,[9]]]),S(w.Ruins31ButtonDoor,329,"Ruins 3-1 Button Door",[[r.b.I,[10]]]),S(w.Ruins4ButtonDoor,330,"Ruins 4-Button Door",[[r.b.I,[8,9,10]]]),S(w.Ruins2ButtonDoor,331,"Ruins 2-Button Door",[[r.b.I,[8,9,10]]]),S(w.RuinsSensor,332,"Ruins Sensor",[[r.b.I,[8,9,10]]]),S(w.RuinsFenceSwitch,333,"Ruins Fence Switch",[[r.b.I,[8,9,10]]]),S(w.RuinsLaserFence4x2,334,"Ruins Laser Fence 4x2",[[r.b.I,[8,9,10]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence6x2,335,"Ruins Laser Fence 6x2",[[r.b.I,[8,9,10]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.RuinsLaserFence4x4,336,"Ruins Laser Fence 4x4",[[r.b.I,[8,9,10]]]),S(w.RuinsLaserFence6x4,337,"Ruins Laser Fence 6x4",[[r.b.I,[8,9,10]]]),S(w.RuinsPoisonBlob,338,"Ruins poison Blob",[[r.b.I,[8,9,10]],[r.b.II,[5,6,7,8,9]],[r.b.IV,[6,7,8]]]),S(w.RuinsPillarTrap,339,"Ruins Pillar Trap",[[r.b.I,[8,9,10]],[r.b.II,[1,2,3,4]]]),S(w.PopupTrapNoTech,340,"Popup Trap (No Tech)",[[r.b.I,[8,9,10]]]),S(w.RuinsCrystal,341,"Ruins Crystal",[[r.b.I,[8,9,10]]]),S(w.Monument,342,"Monument",[[r.b.I,[2,4,7]]]),S(w.RuinsRock1,345,"Ruins Rock 1",[[r.b.I,[8,9,10]]]),S(w.RuinsRock2,346,"Ruins Rock 2",[[r.b.I,[8,9,10]]]),S(w.RuinsRock3,347,"Ruins Rock 3",[[r.b.I,[8,9,10]]]),S(w.RuinsRock4,348,"Ruins Rock 4",[[r.b.I,[8,9,10]]]),S(w.RuinsRock5,349,"Ruins Rock 5",[[r.b.I,[8,9,10]]]),S(w.RuinsRock6,350,"Ruins Rock 6",[[r.b.I,[8,9,10]]]),S(w.RuinsRock7,351,"Ruins Rock 7",[[r.b.I,[8,9,10]]]),S(w.Poison,352,"Poison",[[r.b.I,[8,9,10,13]],[r.b.II,[3,4,10,11]],[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.FixedBoxTypeRuins,353,"Fixed Box Type (Ruins)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4,14,15]]]),S(w.RandomBoxTypeRuins,354,"Random Box Type (Ruins)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4,14,15]]]),S(w.EnemyTypeBoxYellow,355,"Enemy Type Box (Yellow)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4]]]),S(w.EnemyTypeBoxBlue,356,"Enemy Type Box (Blue)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4]]]),S(w.EmptyTypeBoxBlue,357,"Empty Type Box (Blue)",[[r.b.I,[8,9,10,16,17]],[r.b.II,[1,2,3,4]]]),S(w.DestructableRock,358,"Destructable Rock",[[r.b.I,[8,9,10]]]),S(w.PopupTrapsTechs,359,"Popup Traps (techs)",[[r.b.I,[6,7,8,9,10]],[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,16,17]]]),S(w.FlyingWhiteBird,368,"Flying White Bird",[[r.b.I,[14,16]],[r.b.II,[3,4]]]),S(w.Tower,369,"Tower",[[r.b.I,[14]]]),S(w.FloatingRocks,370,"Floating Rocks",[[r.b.I,[14]]]),S(w.FloatingSoul,371,"Floating Soul",[[r.b.I,[14]]]),S(w.Butterfly,372,"Butterfly",[[r.b.I,[14]]]),S(w.LobbyGameMenu,384,"Lobby Game menu",[[r.b.I,[15]]]),S(w.LobbyWarpObject,385,"Lobby Warp Object",[[r.b.I,[15]]]),S(w.Lobby1EventObjectDefaultTree,386,"Lobby 1 Event Object (Default Tree)",[[r.b.I,[15]]]),S(w.UnknownItem387,387,"Unknown Item (387)",[[r.b.I,[15]]]),S(w.UnknownItem388,388,"Unknown Item (388)",[[r.b.I,[15]]]),S(w.UnknownItem389,389,"Unknown Item (389)",[[r.b.I,[15]]]),S(w.LobbyEventObjectStaticPumpkin,390,"Lobby Event Object (Static Pumpkin)",[[r.b.I,[15]]]),S(w.LobbyEventObject3ChristmasWindows,391,"Lobby Event Object (3 Christmas Windows)",[[r.b.I,[15]]]),S(w.LobbyEventObjectRedAndWhiteCurtain,392,"Lobby Event Object (Red and White Curtain)",[[r.b.I,[15]]]),S(w.UnknownItem393,393,"Unknown Item (393)",[[r.b.I,[15]]]),S(w.UnknownItem394,394,"Unknown Item (394)",[[r.b.I,[15]]]),S(w.LobbyFishTank,395,"Lobby Fish Tank",[[r.b.I,[15]]]),S(w.LobbyEventObjectButterflies,396,"Lobby Event Object (Butterflies)",[[r.b.I,[15]]]),S(w.UnknownItem400,400,"Unknown Item (400)",[[r.b.I,[16]],[r.b.II,[3,4]]]),S(w.GreyWallLow,401,"grey wall low",[[r.b.I,[16]],[r.b.II,[3,4,17]]]),S(w.SpaceshipDoor,402,"Spaceship Door",[[r.b.I,[16]],[r.b.II,[3,4]]]),S(w.GreyWallHigh,403,"grey wall high",[[r.b.I,[16]],[r.b.II,[3,4,17]]]),S(w.TempleNormalDoor,416,"Temple Normal Door",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BreakableWallWallButUnbreakable,417,'"breakable wall wall, but unbreakable"',[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BrokenCylinderAndRubble,418,"Broken cylinder and rubble",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.ThreeBrokenWallPiecesOnFloor,419,"3 broken wall pieces on floor",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.HighBrickCylinder,420,"high brick cylinder",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.LyingCylinder,421,"lying cylinder",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BrickConeWithFlatTop,422,"brick cone with flat top",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.BreakableTempleWall,423,"breakable temple wall",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.TempleMapDetect,424,"Temple Map Detect",[[r.b.I,[17]],[r.b.II,[1,2,14]],[r.b.IV,[1,2,3,4,5]]]),S(w.SmallBrownBrickRisingBridge,425,"small brown brick rising bridge",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.LongRisingBridgeWithPinkHighEdges,426,"long rising bridge (with pink high edges)",[[r.b.I,[17]],[r.b.II,[1,2]]]),S(w.FourSwitchTempleDoor,427,"4 switch temple door",[[r.b.II,[1,2]]]),S(w.FourButtonSpaceshipDoor,448,"4 button spaceship door",[[r.b.II,[3,4]]]),S(w.ItemBoxCca,512,"item box cca",[[r.b.II,[5,6,7,8,9,12,16,17]],[r.b.IV,[5]]]),S(w.TeleporterEp2,513,"Teleporter (Ep 2)",[[r.b.II,[5,6,7,8,9,10,11,12,13,16,17]]]),S(w.CCADoor,514,"CCA Door",[[r.b.II,[5,6,7,8,9,16,17]]]),S(w.SpecialBoxCCA,515,"Special Box CCA",[[r.b.II,[5,6,7,8,9,12,16,17]],[r.b.IV,[1,2,3,4,5]]]),S(w.BigCCADoor,516,"Big CCA Door",[[r.b.II,[5]]]),S(w.BigCCADoorSwitch,517,"Big CCA Door Switch",[[r.b.II,[5,6,7,8,9,16,17]]]),S(w.LittleRock,518,"Little Rock",[[r.b.II,[5,6,7,8,9,16]]]),S(w.Little3StoneWall,519,"Little 3 Stone Wall",[[r.b.II,[5,6,7,8,9,16]]]),S(w.Medium3StoneWall,520,"Medium 3 stone wall",[[r.b.II,[5,6,7,8,9,16]]]),S(w.SpiderPlant,521,"Spider Plant",[[r.b.II,[5,6,7,8,9,16]]]),S(w.CCAAreaTeleporter,522,"CCA Area Teleporter",[[r.b.II,[5,6,7,8,9,16,17]]]),S(w.UnknownItem523,523,"Unknown Item (523)",[[r.b.II,[5,12]]]),S(w.WhiteBird,524,"White Bird",[[r.b.II,[6,7,9,16,17]],[r.b.IV,[6,7,8]]]),S(w.OrangeBird,525,"Orange Bird",[[r.b.II,[6,7,9,17]]]),S(w.Saw,527,"Saw",[[r.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.LaserDetect,528,"Laser Detect",[[r.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.UnknownItem529,529,"Unknown Item (529)",[[r.b.II,[5,6,7]],[r.b.IV,[6,7,8]]]),S(w.UnknownItem530,530,"Unknown Item (530)",[[r.b.II,[5,6,7,8,9,17]]]),S(w.Seagull,531,"Seagull",[[r.b.II,[6,7,8,9,16]],[r.b.IV,[6,7,8]]]),S(w.Fish,544,"Fish",[[r.b.I,[15]],[r.b.II,[6,9,10,11,16]]]),S(w.SeabedDoorWithBlueEdges,545,"Seabed Door (with blue edges)",[[r.b.II,[10,11]]]),S(w.SeabedDoorAlwaysOpenNonTriggerable,546,"Seabed door (always open, non-triggerable)",[[r.b.II,[10,11]]]),S(w.LittleCryotube,547,"Little Cryotube",[[r.b.II,[10,11,17]]]),S(w.WideGlassWallBreakable,548,"Wide Glass Wall (breakable)",[[r.b.II,[10,11]]]),S(w.BlueFloatingRobot,549,"Blue floating robot",[[r.b.II,[10,11]]]),S(w.RedFloatingRobot,550,"Red floating robot",[[r.b.II,[10,11]]]),S(w.Dolphin,551,"Dolphin",[[r.b.II,[10,11]]]),S(w.CaptureTrap,552,"Capture Trap",[[r.b.II,[5,6,7,8,9,10,11,16,17]]]),S(w.VRLink,553,"VR link",[[r.b.II,[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]]]),S(w.UnknownItem576,576,"Unknown Item (576)",[[r.b.II,[12]]]),S(w.WarpInBarbaRayRoom,640,"Warp in Barba Ray Room",[[r.b.II,[14]]]),S(w.UnknownItem672,672,"Unknown Item (672)",[[r.b.II,[15]]]),S(w.GeeNest,688,"Gee Nest",[[r.b.I,[8,9,10]],[r.b.II,[5,6,7,8,9,16,17]],[r.b.IV,[6,7,8]]]),S(w.LabComputerConsole,689,"Lab Computer Console",[[r.b.II,[0]]]),S(w.LabComputerConsoleGreenScreen,690,"Lab Computer Console (Green Screen)",[[r.b.II,[0]]]),S(w.ChairYellowPillow,691,"Chair, Yellow Pillow",[[r.b.II,[0]]]),S(w.OrangeWallWithHoleInMiddle,692,"orange wall with hole in middle",[[r.b.II,[0]]]),S(w.GreyWallWithHoleInMiddle,693,"grey wall with hole in middle",[[r.b.II,[0]]]),S(w.LongTable,694,"long table",[[r.b.II,[0]]]),S(w.GBAStation,695,"GBA Station",[]),S(w.TalkLinkToSupport,696,"Talk (link to support)",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.InstaWarp,697,"insta-warp",[[r.b.I,[0,1,2,3,4,5,6,7,11,12,13,14,16,17]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,9,0]]]),S(w.LabInvisibleObject,698,"Lab Invisible Object",[[r.b.I,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]],[r.b.II,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]],[r.b.IV,[1,2,3,4,5,6,7,8,0]]]),S(w.LabGlassWindowDoor,699,"Lab Glass window Door",[[r.b.II,[0]]]),S(w.UnknownItem700,700,"Unknown Item (700)",[[r.b.II,[13]]]),S(w.LabCeilingWarp,701,"Lab Ceiling Warp",[[r.b.II,[0]]]),S(w.Ep4LightSource,768,"Ep4 Light Source",[[r.b.IV,[1,2,3,4,5,6,7,8,9]]]),S(w.Cacti,769,"cacti",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BigBrownRock,770,"Big Brown Rock",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.BreakableBrownRock,771,"Breakable Brown Rock",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem832,832,"Unknown Item (832)",[]),S(w.UnknownItem833,833,"Unknown Item (833)",[]),S(w.PoisonPlant,896,"Poison Plant",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem897,897,"Unknown Item (897)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem898,898,"Unknown Item (898)",[[r.b.IV,[6,7,8]]]),S(w.OozingDesertPlant,899,"Oozing Desert Plant",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem901,901,"Unknown Item (901)",[[r.b.IV,[6,7,8]]]),S(w.BigBlackRocks,902,"big black rocks",[[r.b.IV,[1,2,3,4,5,6,7,8]]]),S(w.UnknownItem903,903,"Unknown Item (903)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem904,904,"Unknown Item (904)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem905,905,"Unknown Item (905)",[]),S(w.UnknownItem906,906,"Unknown Item (906)",[]),S(w.FallingRock,907,"Falling Rock",[[r.b.IV,[6,7,8]]]),S(w.DesertPlantHasCollision,908,"Desert Plant (has collision)",[[r.b.IV,[6,7,8]]]),S(w.DesertFixedTypeBoxBreakableCrystals,909,"Desert Fixed Type Box (Breakable Crystals)",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem910,910,"Unknown Item (910)",[]),S(w.BeeHive,911,"Bee Hive",[[r.b.IV,[6,7,8]]]),S(w.UnknownItem912,912,"Unknown Item (912)",[[r.b.IV,[6,7,8]]]),S(w.Heat,913,"Heat",[[r.b.IV,[6,7,8]]]),S(w.TopOfSaintMillionEgg,960,"Top of saint million egg",[[r.b.IV,[9]]]),S(w.UnknownItem961,961,"Unknown Item (961)",[[r.b.IV,[9]]]),Object.freeze(j),Object.freeze(T),function(e){e[e.Normal=0]="Normal",e[e.Hovered=1]="Hovered",e[e.Selected=2]="Selected"}(P||(P={}));const D=[];D[P.Normal]=16776960,D[P.Hovered]=16768831,D[P.Selected]=16755200;const B=[];function E(e,t,i){const o=new y.MeshLambertMaterial({color:O(e)?B[P.Normal]:D[P.Normal],side:y.DoubleSide}),s=Object(R.a)(t,i.length?i.map(t=>new y.MeshBasicMaterial({map:t,side:y.DoubleSide,transparent:e!==I.c.PofuillySlime&&e!==I.c.PouillySlime,alphaTest:.01})):o,o);return s.name=C(e),s}B[P.Normal]=16711680,B[P.Hovered]=16727903,B[P.Selected]=16711764;var M=i("ouMO");const W=180/Math.PI,q=1/W;function z(e){return e*W}function F(e){return e*q}function V(e,t){return(e%t+t)%t}var U=i("wtpc");function $(e,t,i){return new y.Euler(e,t,i,"ZXY")}function N(e){return(new y.Euler).setFromQuaternion(e,"ZXY")}const A=new y.Quaternion,H=new y.Quaternion;class G{constructor(e,t,i,o,s){this._section=Object(M.e)(void 0),Object(U.e)(e,"type"),Object(U.j)(t,"area_id"),Object(U.j)(i,"section_id"),Object(U.e)(o,"position"),Object(U.e)(s,"rotation"),this.type=e,this.area_id=t,this.section=this._section,this._section_id=Object(M.e)(i),this.section_id=this._section_id,this._position=Object(M.e)(o),this.position=this._position,this._world_position=Object(M.e)(o),this.world_position=this._world_position,this._rotation=Object(M.e)(s),this.rotation=this._rotation,this._world_rotation=Object(M.e)(s),this.world_rotation=this._world_rotation}set_section(e){if(e.area_variant.area.id!==this.area_id)throw new Error("Quest entities can't be moved across areas.");return this._section.val=e,this._section_id.val=e.id,this.set_position(this.position.val),this.set_rotation(this.rotation.val),this}set_position(e){this._position.val=e;const t=this.section.val;return this._world_position.val=t?e.clone().applyEuler(t.rotation).add(t.position):e,this}set_world_position(e){this._world_position.val=e;const t=this.section.val;return this._position.val=t?e.clone().sub(t.position).applyEuler(t.inverse_rotation):e,this}set_rotation(e){Y(e),this._rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),this._world_rotation.val=Y(N(A.multiply(H)))):this._world_rotation.val=e,this}set_world_rotation(e){Y(e),this._world_rotation.val=e;const t=this.section.val;return t?(A.setFromEuler(e),H.setFromEuler(t.rotation),H.inverse(),this._rotation.val=Y(N(A.multiply(H)))):this._rotation.val=e,this}}function Y(e){return e.set(V(e.x,2*Math.PI),V(e.y,2*Math.PI),V(e.z,2*Math.PI))}class K extends G{constructor(e,t,i,o,s,n,r,a,d,c,l,_,u){var v,h,p,g,b,f;Object(U.j)(t,"pso_type_id"),Object(U.i)(i,"npc_id"),Object(U.k)(s,"pso_wave2"),Object(U.j)(n,"script_label"),Object(U.j)(r,"pso_roaming"),Object(U.e)(_,"scale"),Object(U.e)(u,"unknown"),Object(U.c)(2===u.length,()=>`unknown should be of length 2, was ${u.length}.`),Object(U.c)(10===u[0].length,()=>`unknown[0] should be of length 10, was ${u[0].length}`),Object(U.c)(4===u[1].length,()=>`unknown[1] should be of length 4, was ${u[1].length}`),super(e,a,d,c,l),this.pso_type_id=t,this.npc_id=i,this._wave=Object(M.e)(o),this.wave=this._wave;const m=null===(h=null===(v=o)||void 0===v?void 0:v.id)||void 0===h?void 0:h.val,w=null===(g=null===(p=o)||void 0===p?void 0:p.section_id)||void 0===g?void 0:g.val,k=null===(f=null===(b=o)||void 0===b?void 0:b.area_id)||void 0===f?void 0:f.val;this._pso_wave2=s,this.pso_wave2=this.wave.flat_map(e=>null==e?Object(M.e)(null==m?this._pso_wave2:0):m===e.id.val&&w===e.section_id.val&&k===e.area_id.val?e.id.map(e=>m===e?this._pso_wave2:e):e.id),this.script_label=n,this.pso_roaming=r,this.unknown=u,this.scale=_}set_wave(e){return this._wave.val=e,this}}class Q extends k.a{constructor(e,t){super(e),this._collision_geometry=new y.Object3D,this._render_geometry=new y.Object3D,this._entity_models=new y.Object3D,this.disposer=new d.a,this.entity_to_mesh=new Map,this.camera=new y.PerspectiveCamera(60,1,10,1e4),this.disposer.add(t(this))}get debug(){return super.debug}set debug(e){this.debug!==e&&(super.debug=e,this._render_geometry.visible=e,this.schedule_render())}get collision_geometry(){return this._collision_geometry}set collision_geometry(e){this.scene.remove(this.collision_geometry),this._collision_geometry=e,this.scene.add(e)}set render_geometry(e){this.scene.remove(this._render_geometry),this._render_geometry=e,e.visible=this.debug,this.scene.add(e)}get entity_models(){return this._entity_models}init_camera_controls(){super.init_camera_controls()}dispose(){super.dispose(),this.disposer.dispose()}set_size(e,t){this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),super.set_size(e,t)}reset_entity_models(){this.scene.remove(this._entity_models),this._entity_models=new y.Group,this.scene.add(this._entity_models),this.entity_to_mesh.clear(),this.schedule_render()}add_entity_model(e){const t=e.userData.entity;this._entity_models.add(e),this.entity_to_mesh.set(t,e),t===this.selected_entity&&this.mark_selected(e),this.schedule_render()}remove_entity_model(e){const t=this.entity_to_mesh.get(e);t&&(this.entity_to_mesh.delete(e),this._entity_models.remove(t),this.schedule_render())}get_entity_mesh(e){return this.entity_to_mesh.get(e)}mark_selected(e){e===this.hovered_mesh&&(this.hovered_mesh=void 0),e!==this.selected_mesh&&(this.selected_mesh&&Z(this.selected_mesh,P.Normal),Z(e,P.Selected),this.schedule_render()),this.selected_mesh=e}mark_hovered(e){this.selected_mesh&&e===this.selected_mesh||(e!==this.hovered_mesh&&(this.hovered_mesh&&Z(this.hovered_mesh,P.Normal),e&&Z(e,P.Hovered),this.schedule_render()),this.hovered_mesh=e)}unmark_selected(){this.selected_mesh&&(Z(this.selected_mesh,P.Normal),this.schedule_render()),this.selected_mesh=void 0}}function Z(e,t){const i=e.userData.entity instanceof K?B[t]:D[t];if(e)if(Array.isArray(e.material))for(const o of e.material)t===P.Normal&&o.map?o.color.set(16777215):o.color.set(i);else e.material.color.set(i)}var J=i("oxtq"),X=i("rwco"),ee=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const te=X.c.get("quest_editor/rendering/QuestModelManager"),ie=Object.freeze(new y.Vector3(0,800,700)),oe=Object.freeze(new y.Vector3(0,0,0)),se=new y.Object3D;class ne{constructor(e,t,i,o){this.renderer=t,this.area_asset_loader=i,this.entity_asset_loader=o,this.disposer=new d.a,this.quest_disposer=this.disposer.add(new d.a),this.area_variant_changed=()=>ee(this,void 0,void 0,(function*(){const{episode:e,area_variant:t,npcs:i,objects:o}=this.get_area_variant_details();yield this.area_model_manager.load(e,t),this.quest_disposer.dispose_all(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models(),this.quest_disposer.add_all(i.observe_list(this.npcs_changed,{call_now:!0}),o.observe_list(this.objects_changed,{call_now:!0}))})),this.npcs_changed=e=>{e.type===J.a.ListChange&&(this.npc_model_manager.remove(e.removed),this.npc_model_manager.add(e.inserted))},this.objects_changed=e=>{e.type===J.a.ListChange&&(this.object_model_manager.remove(e.removed),this.object_model_manager.add(e.inserted))},this.area_model_manager=new re(this.renderer,i),this.npc_model_manager=new ae(e,this.renderer,o),this.object_model_manager=new ae(e,this.renderer,o)}dispose(){this.disposer.dispose(),this.npc_model_manager.remove_all(),this.object_model_manager.remove_all(),this.renderer.reset_entity_models()}}class re{constructor(e,t){this.renderer=e,this.area_asset_loader=t,this.raycaster=new y.Raycaster,this.origin=new y.Vector3,this.down=Object.freeze(new y.Vector3(0,-1,0)),this.up=Object.freeze(new y.Vector3(0,1,0))}load(e,t){return ee(this,void 0,void 0,(function*(){if(this.area_variant=t,null==e||null==t)return this.renderer.collision_geometry=se,void(this.renderer.render_geometry=se);try{const i=yield this.area_asset_loader.load_collision_geometry(e,t);if(this.should_cancel(t))return;const o=yield this.area_asset_loader.load_render_geometry(e,t);if(this.should_cancel(t))return;this.add_sections_to_collision_geometry(i,o),this.renderer.collision_geometry=i,this.renderer.render_geometry=o,this.renderer.reset_camera(ie,oe)}catch(e){te.error(`Couldn't load models for area ${t.area.id}, variant ${t.id}.`,e),this.renderer.collision_geometry=se,this.renderer.render_geometry=se}}))}should_cancel(e){return this.area_variant!==e}add_sections_to_collision_geometry(e,t){for(const i of e.children){i.geometry.boundingBox.getCenter(this.origin),this.raycaster.set(this.origin,this.down);const e=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);this.raycaster.set(this.origin,this.up);const o=this.raycaster.intersectObject(t,!0).find(e=>null!=e.object.userData.section);let s;if(s=e&&o?e.distance<=o.distance?e:o:e||o,s){const e=i.userData,t=s.object.userData;e.section=t.section}}}}class ae{constructor(e,t,i){this.current_wave=e,this.renderer=t,this.entity_asset_loader=i,this.queue=[],this.loaded_entities=[],this.loading=!1}add(e){return ee(this,void 0,void 0,(function*(){if(this.queue.push(...e),!this.loading)try{for(this.loading=!0;this.queue.length;){const e=this.queue[0];try{yield this.load(e)}catch(t){te.error(`Couldn't load model for entity ${C(e.type)}.`,t)}finally{const t=this.queue.indexOf(e);-1!==t&&this.queue.splice(t,1)}}}finally{this.loading=!1}}))}remove(e){for(const t of e){const e=this.queue.indexOf(t);-1!==e&&this.queue.splice(e,1);const i=this.loaded_entities.findIndex(e=>e.entity===t);if(-1!==i){const e=this.loaded_entities.splice(i,1)[0];this.renderer.remove_entity_model(e.entity),e.disposer.dispose()}}}remove_all(){for(const{disposer:e}of this.loaded_entities)e.dispose();this.loaded_entities.splice(0,1/0),this.queue.splice(0,1/0)}load(e){return ee(this,void 0,void 0,(function*(){const t=yield this.entity_asset_loader.load_geometry(e.type);if(!this.queue.includes(e))return;const i=yield this.entity_asset_loader.load_textures(e.type);if(!this.queue.includes(e))return;const o=function(e,t,i){const o=E(e.type,t,i);return o.userData.entity=e,o.position.copy(e.world_position.val),o.rotation.copy(e.world_rotation.val),o}(e,t,i);this.update_entity_geometry(e,o)}))}update_entity_geometry(e,t){this.renderer.add_entity_model(t);const i=new d.a(e.world_position.observe(({value:e})=>{t.position.copy(e),this.renderer.schedule_render()}),e.world_rotation.observe(({value:e})=>{t.rotation.copy(e),this.renderer.schedule_render()}));e instanceof K&&i.add(Object(M.d)((e,t)=>null==e||e===t,this.current_wave,e.wave).observe(({value:e})=>{t.visible=e,this.renderer.schedule_render()},{call_now:!0})),this.loaded_entities.push({entity:e,disposer:i})}}class de extends ne{constructor(e,t,i,o,s,n){super(i,o,s,n),this.current_quest=e,this.current_area=t,this.disposer.add_all(e.observe(this.area_variant_changed),t.observe(this.area_variant_changed))}get_area_variant_details(){var e;const t=this.current_quest.val,i=this.current_area.val;let o,s,n;return t&&i?(o=t.area_variants.val.find(e=>e.area.id===i.id)||i.area_variants[0],s=t.npcs.filtered(e=>e.area_id===i.id),n=t.objects.filtered(e=>e.area_id===i.id)):(s=Object(M.c)(),n=Object(M.c)()),{episode:null===(e=t)||void 0===e?void 0:e.episode,area_variant:o,npcs:s,objects:n}}}var ce=i("KUR2"),le=i("4SjJ");class _e extends o.a{constructor(e,t,i,o){super(),this.element=Object(v.i)({className:i,tabIndex:-1}),this.renderer=o,this.renderer_view=this.disposable(new ce.a(this.renderer)),this.element.append(this.renderer_view.element),this.renderer_view.start_rendering(),this.disposables(e.tool.observe(({value:e})=>{e===le.b.QuestEditor?this.renderer_view.start_rendering():this.renderer_view.stop_rendering()}),t.debug.observe(({value:e})=>this.renderer.debug=e)),this.finalize_construction()}resize(e,t){return super.resize(e,t),this.renderer_view.resize(e,t),this}}let ue=void 0;const ve=new Map,he=new y.Vector2(0,0);let pe=0;function ge(e,t,i){function o(e){ue&&i(Object.assign(Object.assign({},ue),{event:e}))}ve.set(i,o),e.addEventListener(t,o)}function be(e,t,i){const o=ve.get(i);o&&(ve.delete(i),e.removeEventListener(t,o))}function fe(e){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"),ue&&(ue.drag_element.style.transform=`translate(${e.clientX-he.x}px, ${e.clientY-he.y}px)`)}function me(){ue&&(ue.drag_element.remove(),ue=void 0)}class we extends G{constructor(e,t,i,o,s,n,r,a,d){super(e,o,s,n,r),this.id=t,this.group_id=i,this.properties=a,this.unknown=d}}class ke{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Create ${L(i.type).name}`}undo(){this.quest.remove_entity(this.entity)}redo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}}class ye{constructor(e,t,i,o,s){this.quest_editor_store=e,this.entity=t,this.old_rotation=i,this.new_rotation=o,this.world=s,this.description=`Rotate ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.old_rotation):this.entity.set_rotation(this.old_rotation)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.world?this.entity.set_world_rotation(this.new_rotation):this.entity.set_rotation(this.new_rotation)}}class Re{constructor(e,t,i){this.quest_editor_store=e,this.quest=t,this.entity=i,this.description=`Delete ${L(i.type).name}`,this.redo()}undo(){this.quest.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}redo(){this.quest.remove_entity(this.entity)}}class Ie{constructor(e,t,i,o,s,n,r){this.quest_editor_store=e,this.entity=t,this.old_section=i,this.new_section=o,this.old_position=s,this.new_position=n,this.world=r,this.description=`Move ${L(t.type).name}`}undo(){this.quest_editor_store.set_selected_entity(this.entity),this.old_section&&this.entity.set_section(this.old_section),this.world?this.entity.set_world_position(this.old_position):this.entity.set_position(this.old_position)}redo(){this.quest_editor_store.set_selected_entity(this.entity),this.new_section&&this.entity.set_section(this.new_section),this.world?this.entity.set_world_position(this.new_position):this.entity.set_position(this.new_position)}}const je=Object.freeze(new y.Vector3(0,0,0)),xe=Object.freeze(new y.Vector3(0,1,0)),Te=Object.freeze(new y.Vector3(0,-1,0)),Se=2*Math.PI,Ce=new y.Raycaster;class Oe{constructor(e,t){this.quest_editor_store=e,this.renderer=t,this.disposer=new d.a,this.pointer_position=new y.Vector2(0,0),this.pointer_device_position=new y.Vector2(0,0),this.last_pointer_position=new y.Vector2(0,0),this.moved_since_last_pointer_down=!1,this._enabled=!0,this.dispose=()=>{this.renderer.canvas_element.removeEventListener("keydown",this.keydown),this.renderer.canvas_element.removeEventListener("mousedown",this.mousedown),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup),this.renderer.canvas_element.removeEventListener("mouseleave",this.mouseleave),be(this.renderer.canvas_element,"dragenter",this.dragenter),be(this.renderer.canvas_element,"dragover",this.dragover),be(this.renderer.canvas_element,"dragleave",this.dragleave),be(this.renderer.canvas_element,"drop",this.drop),this.disposer.dispose()},this.selected_entity_changed=({value:e})=>{if(this.state.cancel(),e){const t=this.renderer.get_entity_mesh(e);t?this.renderer.mark_selected(t):this.renderer.unmark_selected()}else this.renderer.unmark_selected()},this.keydown=e=>{this.state=this.state.process_event({type:Le.KeyDown,key:e.key})},this.mousedown=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseDown,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.removeEventListener("mousemove",this.mousemove),document.addEventListener("mousemove",this.mousemove),document.addEventListener("mouseup",this.mouseup)},this.mousemove=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseMove,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.mouseup=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseUp,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered}),this.renderer.canvas_element.addEventListener("mousemove",this.mousemove),document.removeEventListener("mousemove",this.mousemove),document.removeEventListener("mouseup",this.mouseup)},this.mouseleave=e=>{this.process_mouse_event(e),this.state=this.state.process_event({type:Le.MouseLeave,buttons:e.buttons,shift_key:e.shiftKey,pointer_device_position:this.pointer_device_position,moved_since_last_pointer_down:this.moved_since_last_pointer_down,mark_hovered:this.mark_hovered})},this.dragenter=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Le.EntityDragEnter,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragover=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Le.EntityDragOver,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.dragleave=e=>{this.process_mouse_event(e.event),this.state=this.state.process_event({type:Le.EntityDragLeave,shift_key:e.event.shiftKey,pointer_device_position:this.pointer_device_position,entity_type:e.entity_type,drag_element:e.drag_element,data_transfer:e.event.dataTransfer,prevent_default:()=>e.event.preventDefault(),stop_propagation:()=>e.event.stopPropagation()})},this.drop=e=>{this.process_mouse_event(e.event),this.renderer.canvas_element.focus(),this.state=this.state.process_event({type:Le.EntityDrop})},this.mark_hovered=e=>{this.renderer.mark_hovered(e)},this.disposer.add(e.selected_entity.observe(this.selected_entity_changed)),t.canvas_element.addEventListener("keydown",this.keydown),t.canvas_element.addEventListener("mousedown",this.mousedown),t.canvas_element.addEventListener("mousemove",this.mousemove),t.canvas_element.addEventListener("mouseleave",this.mouseleave),ge(t.canvas_element,"dragenter",this.dragenter),ge(t.canvas_element,"dragover",this.dragover),ge(t.canvas_element,"dragleave",this.dragleave),ge(t.canvas_element,"drop",this.drop),this.state=new Pe(this.quest_editor_store,t,this._enabled)}set enabled(e){this._enabled=e,this.state.cancel(),this.state=new Pe(this.quest_editor_store,this.renderer,this._enabled)}process_mouse_event(e){const{left:t,top:i}=this.renderer.canvas_element.getBoundingClientRect();this.pointer_position.set(e.clientX-t,e.clientY-i),this.pointer_device_position.copy(this.pointer_position),this.renderer.pointer_pos_to_device_coords(this.pointer_device_position),"mousedown"===e.type?this.moved_since_last_pointer_down=!1:"mousemove"!==e.type&&"mouseup"!==e.type||this.pointer_position.equals(this.last_pointer_position)||(this.moved_since_last_pointer_down=!0),this.last_pointer_position.copy(this.pointer_position)}}var Le;!function(e){e[e.KeyDown=0]="KeyDown",e[e.MouseDown=1]="MouseDown",e[e.MouseMove=2]="MouseMove",e[e.MouseUp=3]="MouseUp",e[e.MouseLeave=4]="MouseLeave",e[e.EntityDragEnter=5]="EntityDragEnter",e[e.EntityDragOver=6]="EntityDragOver",e[e.EntityDragLeave=7]="EntityDragLeave",e[e.EntityDrop=8]="EntityDrop"}(Le||(Le={}));class Pe{constructor(e,t,i){this.quest_editor_store=e,this.renderer=t,this.enabled=i}process_event(e){switch(e.type){case Le.KeyDown:if(this.enabled){const t=this.quest_editor_store.selected_entity.val;if(t&&"Delete"===e.key){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new Re(this.quest_editor_store,e,t))}}return this;case Le.MouseDown:{const t=this.pick_entity(e.pointer_device_position);if(t)if(1===e.buttons){if(this.quest_editor_store.set_selected_entity(t.entity),this.enabled)return new De(this.quest_editor_store,this.renderer,t.entity,t.drag_adjust,t.grab_offset)}else if(2===e.buttons&&(this.quest_editor_store.set_selected_entity(t.entity),this.enabled))return new Be(this.quest_editor_store,this.renderer,t.entity,t.mesh,t.grab_offset);return this}case Le.MouseMove:{const t=this.pick_entity(e.pointer_device_position);return e.mark_hovered(t&&t.mesh),this}case Le.MouseUp:return e.moved_since_last_pointer_down||this.pick_entity(e.pointer_device_position)||this.quest_editor_store.set_selected_entity(void 0),this;case Le.MouseLeave:return e.mark_hovered(void 0),this;case Le.EntityDragEnter:if(this.enabled){const t=this.quest_editor_store.current_area.val,i=this.quest_editor_store.current_quest.val;return t&&i?new Ee(this.quest_editor_store,this.renderer,e,i,t):this}return this;default:return this}}cancel(){}pick_entity(e){Ce.setFromCamera(e,this.renderer.camera);const[t]=Ce.intersectObjects(this.renderer.entity_models.children);if(!t)return;const i=t.object.userData.entity,o=t.object.position.clone().sub(t.point),s=o.clone();Ce.set(t.object.position,Te);const[n]=Ce.intersectObjects(this.renderer.collision_geometry.children,!0);return n&&(s.y-=n.distance),{mesh:t.object,entity:i,grab_offset:o,drag_adjust:s}}}class De{constructor(e,t,i,o,s){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.drag_adjust=o,this.grab_offset=s,this.cancelled=!1,this.initial_section=i.section.val,this.initial_position=i.world_position.val,this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Le.MouseMove:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&Me(this.renderer,this.entity,this.drag_adjust,this.grab_offset,e.pointer_device_position,e.shift_key),this);case Le.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new Ie(this.quest_editor_store,this.entity,this.initial_section,this.entity.section.val,this.initial_position,this.entity.world_position.val,!0)).redo(),new Pe(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.initial_section&&this.entity.set_section(this.initial_section),this.entity.set_world_position(this.initial_position)}}class Be{constructor(e,t,i,o,s){this.quest_editor_store=e,this.renderer=t,this.entity=i,this.mesh=o,this.cancelled=!1,this.initial_rotation=i.world_rotation.val,this.grab_point=i.world_position.val.clone().sub(s),this.renderer.controls.enabled=!1}process_event(e){switch(e.type){case Le.MouseMove:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):(e.moved_since_last_pointer_down&&ze(this.renderer,this.entity,this.mesh.quaternion,this.initial_rotation,this.grab_point,e.pointer_device_position),this);case Le.MouseUp:return this.renderer.controls.enabled=!0,!this.cancelled&&e.moved_since_last_pointer_down&&this.quest_editor_store.undo.push(new ye(this.quest_editor_store,this.entity,this.initial_rotation,this.entity.world_rotation.val,!0)),new Pe(this.quest_editor_store,this.renderer,!0);default:return this.cancelled?new Pe(this.quest_editor_store,this.renderer,!0):this}}cancel(){this.cancelled=!0,this.renderer.controls.enabled=!0,this.entity.set_world_rotation(this.initial_rotation)}}class Ee{constructor(e,t,i,o,s){if(this.quest_editor_store=e,this.drag_adjust=new y.Vector3(0,0,0),this.cancelled=!1,this.renderer=t,i.drag_element.style.display="none",i.data_transfer&&(i.data_transfer.dropEffect="copy"),O(i.entity_type)){const t=Object(I.d)(i.entity_type);this.entity=new K(i.entity_type,t.pso_type_id,0,e.selected_wave.val,0,0,t.pso_roaming,s.id,0,new y.Vector3(0,0,0),$(0,0,0),new y.Vector3(1,1,1),[[0,0,0,0,0,0,0,0,0,0],[0,0,0,0]])}else this.entity=new we(i.entity_type,0,0,s.id,0,new y.Vector3(0,0,0),$(0,0,0),new Map,[[0,0,0,0,0,0],[0,0]]);We(this.renderer,this.entity,this.drag_adjust,je,i.pointer_device_position),o.add_entity(this.entity),this.quest_editor_store.set_selected_entity(this.entity)}process_event(e){switch(e.type){case Le.EntityDragOver:return this.cancelled?(e.drag_element.style.display="flex",e.data_transfer&&(e.data_transfer.dropEffect="none"),new Pe(this.quest_editor_store,this.renderer,!0)):(e.stop_propagation(),e.prevent_default(),e.data_transfer&&(e.data_transfer.dropEffect="copy"),Me(this.renderer,this.entity,this.drag_adjust,je,e.pointer_device_position,e.shift_key),this);case Le.EntityDragLeave:{e.drag_element.style.display="flex";const t=this.quest_editor_store.current_quest.val;return t&&t.remove_entity(this.entity),new Pe(this.quest_editor_store,this.renderer,!0)}case Le.EntityDrop:if(!this.cancelled){const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.undo.push(new ke(this.quest_editor_store,e,this.entity))}return new Pe(this.quest_editor_store,this.renderer,!0);default:return this}}cancel(){this.cancelled=!0;const e=this.quest_editor_store.current_quest.val;e&&e.remove_entity(this.entity)}}function Me(e,t,i,o,s,n){n?qe(e,t,i,o,s):We(e,t,i,o,s)}const We=(()=>{const e=new y.Plane,t=new y.Vector3;return(i,o,s,n,r)=>{const{intersection:a,section:d}=function(e,t,i){Ce.setFromCamera(t,e.camera),Ce.ray.origin.add(i);const o=Ce.intersectObjects(e.collision_geometry.children,!0);for(const e of o)if(e.face.normal.y>.75)return{intersection:e,section:e.object.userData.section};return{}}(i,r,s);if(a){if(d){const e=o.world_rotation.val;o.set_section(d),o.set_world_rotation(e)}o.set_world_position(new y.Vector3(a.point.x,a.point.y+n.y-s.y,a.point.z))}else Ce.setFromCamera(r,i.camera),e.set(xe,-o.world_position.val.y+n.y),Ce.ray.intersectPlane(e,t)&&o.set_world_position(new y.Vector3(t.x+n.x,o.world_position.val.y,t.z+n.z))}})(),qe=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3;return(s,n,r,a,d)=>{if(Ce.setFromCamera(d,s.camera),s.camera.getWorldDirection(e),e.negate(),e.y=0,e.normalize(),o.set(n.world_position.val.x,n.world_position.val.y,n.world_position.val.z),o.sub(a),t.setFromNormalAndCoplanarPoint(e,o),Ce.ray.intersectPlane(t,i)){const e=i.y+a.y,t=e-n.world_position.val.y;r.y-=t,n.set_world_position(new y.Vector3(n.world_position.val.x,e,n.world_position.val.z))}}})(),ze=(()=>{const e=new y.Vector3,t=new y.Plane,i=new y.Vector3,o=new y.Vector3,s=new y.Vector3,n=new y.Vector3;return(r,a,d,c,l,_)=>{if(e.copy(xe),e.applyQuaternion(d),t.setFromNormalAndCoplanarPoint(e,l),Ce.setFromCamera(_,r.camera),Ce.ray.intersectPlane(t,i)){t.projectPoint(a.world_position.val,o),s.subVectors(o,l),n.subVectors(o,i);const r=s.dot(n),d=e.dot(s.cross(n)),_=Math.atan2(d,r);a.set_world_rotation(new y.Euler(c.x,(c.y+_)%Se,c.z,"ZXY"))}}})();class Fe extends _e{constructor(e,t,i,o,s){super(e,t,"quest_editor_QuestEditorRendererView",new Q(s,e=>new de(t.current_quest,t.current_area,t.selected_wave,e,i,o))),this.element.addEventListener("focus",()=>t.undo.make_current(),!0),this.entity_controls=this.disposable(new Oe(t,this.renderer)),this.disposables(t.selected_entity.observe(({value:e})=>this.renderer.selected_entity=e),t.quest_runner.running.observe(({value:e})=>this.entity_controls.enabled=!e,{call_now:!0})),this.renderer.init_camera_controls(),this.finalize_construction()}}var Ve=i("wsa1"),Ue=i("w6HN"),$e=i("oyid");class Ne extends Ue.a{constructor(e){const t=new $e.a(!0,{label:"Inline args mode",tooltip:e.has_issues.map(e=>{let t="Transform arg_push* opcodes to be inline with the opcode the arguments are given to.";return e&&(t+="\nThis mode cannot be toggled because there are issues in the script."),t})});super(t),this.disposables(t.checked.bind_to(e.inline_args_mode),t.checked.observe(({value:t})=>e.set_inline_args_mode(t)),t.enabled.bind_to(e.has_issues.map(e=>!e))),this.finalize_construction()}}var Ae=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))},He=Ve.editor.ScrollType;class Ge{constructor(e){this.editor=e,this.history=[],this.history_index=-1,this.capture_history=!0,this.disposer=new d.a,this.did_change_cursor_position=e=>{this.capture_history&&(this.history.splice(this.history_index+1,1/0),"api"===e.source||-1===this.history_index||Math.abs(e.position.lineNumber-this.history[this.history_index].lineNumber)>=10?(this.history.push(e.position),this.history_index++):this.history[this.history_index]=e.position)},this.back=()=>Ae(this,void 0,void 0,(function*(){this.history_index>0&&this.set_position(this.history[--this.history_index])})),this.forward=()=>Ae(this,void 0,void 0,(function*(){this.history_index+1{this.capture_history=!1,this.editor.setPosition(e),this.editor.revealPositionInCenterIfOutsideViewport(e,He.Immediate),this.capture_history=!0},this.mouse_up=e=>{const t=e.event.browserEvent.button,i=e.event.browserEvent.buttons;3===t?(0===i&&(e.event.preventDefault(),this.back()),this.editor.focus()):4===t&&(0===i&&(e.event.preventDefault(),this.forward()),this.editor.focus())},this.disposer.add_all(this.editor.onDidChangeCursorPosition(this.did_change_cursor_position),this.editor.addAction({id:"phantasmal.action.back",label:"Back",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.LeftArrow],run:this.back}),this.editor.addAction({id:"phantasmal.action.forward",label:"Forward",keybindings:[Ve.KeyMod.Alt|Ve.KeyCode.RightArrow],run:this.forward}),this.editor.onMouseUp(this.mouse_up))}dispose(){this.disposer.dispose()}reset(){this.history.splice(0,1/0),this.history_index=-1}}i("/NSH");Ve.editor.defineTheme("phantasmal-world",{base:"vs-dark",inherit:!0,rules:[{token:"",foreground:"e0e0e0",background:"#181818"},{token:"tag",foreground:"99bbff"},{token:"keyword",foreground:"d0a0ff",fontStyle:"bold"},{token:"predefined",foreground:"bbffbb"},{token:"number",foreground:"ffffaa"},{token:"number.hex",foreground:"ffffaa"},{token:"string",foreground:"88ffff"},{token:"string.escape",foreground:"8888ff"}],colors:{"editor.background":"#181818","editor.lineHighlightBackground":"#202020"}});const Ye=Ve.editor.createModel("","psoasm");class Ke extends o.a{constructor(e,t,i){super(),this.asm_editor_store=i,this.breakpoint_decoration_ids=[],this.element=Object(v.i)(),this.tool_bar_view=this.disposable(new Ne(i)),this.element.append(this.tool_bar_view.element),this.editor=this.disposable(Ve.editor.create(this.element,{theme:"phantasmal-world",scrollBeyondLastLine:!1,autoIndent:"full",fontSize:13,wordWrap:"on",wrappingIndent:"indent",renderIndentGuides:!1,folding:!1,glyphMargin:e.feature_active("vm")})),this.history=this.disposable(new Ge(this.editor)),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyCode.KEY_Z,()=>{}),this.editor.addCommand(Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_Z,()=>{});const o=this.editor.getAction("editor.action.quickCommand");this.disposables(this.editor.addAction({id:"editor.action.quickCommand",label:"Command Palette",keybindings:[Ve.KeyMod.CtrlCmd|Ve.KeyMod.Shift|Ve.KeyCode.KEY_P],run:()=>o.run()})),this.disposables(i.did_undo.observe(({value:e})=>{this.editor.trigger(e,"undo",void 0)}),i.did_redo.observe(({value:e})=>{this.editor.trigger(e,"redo",void 0)}),i.model.observe(({value:e})=>{this.editor.updateOptions({readOnly:!this.enabled.val||!e}),this.editor.setModel(e||Ye),this.history.reset(),this.breakpoint_decoration_ids=[],this.execloc_decoration_id="",t.clear_breakpoints()},{call_now:!0}),i.breakpoints.observe_list(e=>{var t;if(e.type===J.a.ListChange){for(const t of e.removed){const e=this.editor.getLineDecorations(t.line_no);if(e)for(const t of e){const e=this.breakpoint_decoration_ids.indexOf(t.id);if(e>-1){this.editor.deltaDecorations([t.id],[]),this.breakpoint_decoration_ids.splice(e,1);break}}}for(const i of e.inserted){(null===(t=this.editor.getLineDecorations(i.line_no))||void 0===t?void 0:t.some(e=>this.breakpoint_decoration_ids.includes(e.id)))||this.breakpoint_decoration_ids.push(this.editor.deltaDecorations([],[{range:new Ve.Range(i.line_no,0,i.line_no,0),options:{glyphMarginClassName:"quest_editor_AsmEditorView_breakpoint-enabled",glyphMarginHoverMessage:{value:"Breakpoint"}}}])[0])}}}),i.pause_location.observe(e=>{const t=this.old_pause_location,i=e.value;if(this.old_pause_location=i,void 0!==t&&void 0!==this.execloc_decoration_id){this.editor.getLineDecorations(t)&&this.editor.deltaDecorations([this.execloc_decoration_id],[])}void 0!==i&&(this.execloc_decoration_id=this.editor.deltaDecorations([],[{range:new Ve.Range(i,0,i,0),options:{className:"quest_editor_AsmEditorView_execution-location",isWholeLine:!0}}])[0],this.editor.revealLineInCenterIfOutsideViewport(i))}),this.editor.onDidFocusEditorWidget(()=>i.undo.make_current()),this.editor.onMouseDown(e=>{switch(e.target.type){case Ve.editor.MouseTargetType.GUTTER_GLYPH_MARGIN:{const i=e.target.position;if(!i)return;t.toggle_breakpoint(i.lineNumber)}}}),this.enabled.bind_to(t.running.map(e=>!e))),this.finalize_construction()}focus(){this.editor.focus()}resize(e,t){const i=Math.max(0,t-this.tool_bar_view.height);return this.editor.layout({width:e,height:i}),this}set_enabled(e){super.set_enabled(e),this.tool_bar_view.enabled.val=e,this.editor.updateOptions({readOnly:!e||!this.asm_editor_store.model.val})}}i("egRq");class Qe extends o.a{constructor(e){super(),this.ctrl=e,this.element=Object(v.i)({className:"quest_editor_EntityInfoView",tabIndex:-1}),this.no_entity_view=new b("No entity selected."),this.table_element=Object(v.s)(),this.pos_x_element=this.disposable(new a.a(0,{round_to:3})),this.pos_y_element=this.disposable(new a.a(0,{round_to:3})),this.pos_z_element=this.disposable(new a.a(0,{round_to:3})),this.rot_x_element=this.disposable(new a.a(0,{round_to:3})),this.rot_y_element=this.disposable(new a.a(0,{round_to:3})),this.rot_z_element=this.disposable(new a.a(0,{round_to:3}));const t="quest_editor_EntityInfoView_coord";this.table_element.append(Object(v.z)(Object(v.x)("Type:"),this.type_element=Object(v.u)()),Object(v.z)(Object(v.x)("Name:"),this.name_element=Object(v.u)()),Object(v.z)(Object(v.x)("Section:"),this.section_id_element=Object(v.u)()),this.wave_row_element=Object(v.z)(Object(v.x)("Wave:"),this.wave_element=Object(v.u)()),Object(v.z)(Object(v.x)({colSpan:2},"Position:")),Object(v.z)(Object(v.x)({className:t},"X:"),Object(v.u)(this.pos_x_element.element)),Object(v.z)(Object(v.x)({className:t},"Y:"),Object(v.u)(this.pos_y_element.element)),Object(v.z)(Object(v.x)({className:t},"Z:"),Object(v.u)(this.pos_z_element.element)),Object(v.z)(Object(v.x)({colSpan:2},"Rotation:")),Object(v.z)(Object(v.x)({className:t},"X:"),Object(v.u)(this.rot_x_element.element)),Object(v.z)(Object(v.x)({className:t},"Y:"),Object(v.u)(this.rot_y_element.element)),Object(v.z)(Object(v.x)({className:t},"Z:"),Object(v.u)(this.rot_z_element.element))),this.element.append(this.table_element,this.no_entity_view.element),this.element.addEventListener("focus",e.focused,!0),this.disposables(Object(v.c)(this.table_element,"hidden",e.unavailable),this.no_entity_view.visible.bind_to(e.unavailable),Object(v.c)(this.type_element,"textContent",e.type),Object(v.c)(this.name_element,"textContent",e.name),Object(v.c)(this.section_id_element,"textContent",e.section_id),Object(v.c)(this.wave_element,"textContent",e.wave),Object(v.c)(this.wave_row_element,"hidden",e.wave_hidden),e.position.observe(({value:{x:e,y:t,z:i}})=>{this.pos_x_element.value.val=e,this.pos_y_element.value.val=t,this.pos_z_element.value.val=i},{call_now:!0}),e.rotation.observe(({value:{x:e,y:t,z:i}})=>{this.rot_x_element.value.val=z(e),this.rot_y_element.value.val=z(t),this.rot_z_element.value.val=z(i)},{call_now:!0}),this.pos_x_element.value.observe(({value:t})=>e.set_pos_x(t)),this.pos_y_element.value.observe(({value:t})=>e.set_pos_y(t)),this.pos_z_element.value.observe(({value:t})=>e.set_pos_z(t)),this.rot_x_element.value.observe(({value:t})=>e.set_rot_x(t)),this.rot_y_element.value.observe(({value:t})=>e.set_rot_y(t)),this.rot_z_element.value.observe(({value:t})=>e.set_rot_z(t)),this.enabled.bind_to(e.enabled)),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.pos_x_element.enabled.val=e,this.pos_y_element.enabled.val=e,this.pos_z_element.enabled.val=e,this.rot_x_element.enabled.val=e,this.rot_y_element.enabled.val=e,this.rot_z_element.enabled.val=e}}i("ZZ0G");class Ze extends o.a{constructor(e,t,i){super(),this.entity_image_renderer=t,this.entities=Object(M.c)(),this.create_entity_element=(e,t)=>{const i=Object(v.i)({className:"quest_editor_EntityListView_entity",data:{index:t.toString()}});i.draggable=!0;const o=Object(v.l)({width:100,height:100});o.style.visibility="hidden",o.style.pointerEvents="none",i.append(o),this.entity_image_renderer.render(e).then(e=>{o.src=e,o.style.visibility="visible"});const s=Object(v.r)(L(e).name);return i.append(s),i};const o=Object(v.i)({className:"quest_editor_EntityListView_entity_list"});this.element=Object(v.i)({className:`${i} quest_editor_EntityListView`,tabIndex:-1},o),this.disposables(Object(v.d)(o,this.entities,this.create_entity_element),function(e,t){function i(e){if(e.target instanceof HTMLElement){const i=t(e.target);i?(he.set(e.offsetX,e.offsetY),ue={drag_element:i[0],entity_type:i[1]},ue.drag_element.style.position="fixed",ue.drag_element.style.pointerEvents="none",ue.drag_element.style.zIndex="500",ue.drag_element.style.top="0",ue.drag_element.style.left="0",ue.drag_element.style.transform=`translate(${e.clientX-he.x}px, ${e.clientY-he.y}px)`,document.body.append(ue.drag_element),e.dataTransfer&&(e.dataTransfer.effectAllowed="copy",e.dataTransfer.setDragImage(Object(v.i)(),0,0),e.dataTransfer.setData("phantasmal-entity",L(ue.entity_type).name))):e.preventDefault()}}return e.addEventListener("dragstart",i),1==++pe&&(document.addEventListener("dragover",fe),document.addEventListener("dragend",me)),{dispose(){e.removeEventListener("dragstart",i),0==--pe&&(document.removeEventListener("dragover",fe),document.removeEventListener("dragend",me))}}}(o,e=>{if(!this.enabled.val)return;let t=e;do{const i=e.dataset.index;if(null!=i)return[t.querySelector("img").cloneNode(!0),this.entities.get(parseInt(i,10))];t=t.parentElement}while(t&&t!==o)}),this.enabled.bind_to(e.quest_runner.running.map(e=>!e)))}}class Je extends Ze{constructor(e,t){super(e,t,"quest_editor_NpcListView"),this.quest_editor_store=e,this.filter_npcs=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:r.b.I,o=t?t.id:0;this.entities.val=I.b.filter(e=>{const t=Object(I.d)(e);return(null==t.episode||t.episode===i)&&t.area_ids.includes(o)})},this.disposables(e.current_quest.observe(this.filter_npcs),e.current_area.observe(this.filter_npcs)),this.filter_npcs(),this.finalize_construction()}}class Xe extends Ze{constructor(e,t){super(e,t,"quest_editor_ObjectListView"),this.quest_editor_store=e,this.filter_objects=()=>{const e=this.quest_editor_store.current_quest.val,t=this.quest_editor_store.current_area.val,i=e?e.episode:r.b.I,o=t?t.id:0;this.entities.val=j.filter(e=>{const t=x(e);if(null==t.area_ids)return!0;const s=t.area_ids[i];return s&&s.includes(o)})},this.disposables(e.current_quest.observe(this.filter_objects),e.current_area.observe(this.filter_objects)),this.filter_objects(),this.finalize_construction()}}i("RL+K");var et,tt=i("KVVN");!function(e){e[e.NodeAdded=0]="NodeAdded",e[e.NodeRemoved=1]="NodeRemoved",e[e.EdgeAdded=2]="EdgeAdded",e[e.EdgeRemoved=3]="EdgeRemoved"}(et||(et={}));class it{constructor(e){this.area_id=e,this._connected_sub_graphs=Object(M.c)(),this.meta=new Map,this.emitter=Object(M.a)(),this.events=[],this.connected_sub_graphs=this._connected_sub_graphs,Object(U.k)(e,"area_id")}observe(e){return this.emitter.observe(e)}get_index(e){return this.meta.get(e).index}get_sub_graph(e){return this.meta.get(e).sub_graph}get_children(e){return this.meta.get(e).children}get_parents(e){return this.meta.get(e).parents}add_event(e,t,i){this.remove_event(e);const o=this.events.length,s=Object(M.c)(void 0,e);this.meta.set(e,{index:o,sub_graph:s,children:[],parents:[]}),this.events.push(e),this._connected_sub_graphs.push(s);for(const i of t)this.add_edge(i,e);for(const t of i)this.add_edge(e,t);this.emit({type:et.NodeAdded,event:e})}insert_event(e,t,i,o){this.remove_event(t);const s=Object(M.c)(void 0,t);this.meta.set(t,{index:e,sub_graph:s,parents:[],children:[]}),this.events.splice(e,0,t);for(let t=e+1;ti.index);)e++;i.sub_graph=s,s.splice(e,0,t),e++}this._connected_sub_graphs.remove(n),n.clear()}this.emit({type:et.EdgeAdded,parent:e,child:t})}remove_edge(e,t){this.internal_remove_edge(e,this.meta.get(e),t,this.meta.get(t))}internal_remove_edge(e,t,i,o){if(t&&o){const s=t.children.indexOf(i);-1!==s&&t.children.splice(s,1);const n=o.parents.indexOf(e);-1!==n&&o.parents.splice(n,1);const r=new Set;if(!this.connected(e,i,r)){const e=Object(M.c)(void 0,...r);e.sort((e,t)=>this.meta.get(e).index-this.meta.get(t).index);for(const i of e)t.sub_graph.remove(i);this.insert_sub_graph(this.meta.get(e.get(0)).index,e),o.sub_graph=e}this.emit({type:et.EdgeRemoved,parent:e,child:i})}}connected(e,t,i){if(e===t)return!0;if(i.has(t))return!1;i.add(t);const o=this.meta.get(t);if(o){for(const t of o.children)if(this.connected(e,t,i))return!0;for(const t of o.parents)if(this.connected(e,t,i))return!0}return!1}insert_sub_graph(e,t){let i=0;for(;ie)break;i++}this._connected_sub_graphs.splice(i,0,t)}emit(e){this.emitter.emit({value:e})}}i("xqR9");var ot,st=i("uiJh");!function(e){e[e.SpawnNpcs=0]="SpawnNpcs",e[e.Unlock=1]="Unlock",e[e.Lock=2]="Lock"}(ot||(ot={}));const nt=Object(st.a)(ot);class rt{constructor(e,t){this.type=ot.SpawnNpcs,Object(U.k)(e,"section_id"),Object(U.k)(t,"appear_flag"),this.section_id=e,this.appear_flag=t}}class at{constructor(e){this.type=ot.Unlock,Object(U.k)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(U.k)(e,"door_id"),this._door_id.val=e}}class dt{constructor(e){this.type=ot.Lock,Object(U.k)(e,"door_id"),this._door_id=Object(M.e)(e),this.door_id=this._door_id}set_door_id(e){Object(U.k)(e,"door_id"),this._door_id.val=e}}i("CCCE");var ct=i("LSoc"),lt=i("QmPX");class _t extends lt.a{constructor(e){super(e),this.element=Object(v.i)({className:"core_DropDown"}),this.button_mousedown=()=>{this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0},this.button_mouseup=()=>{this.just_opened?this.menu.focus():this.menu.visible.val=!1,this.just_opened=!1},this.button_keydown=({value:e})=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.just_opened=!this.menu.visible.val,this.menu.visible.val=!0,this.menu.focus(),this.menu.hover_next())},this.button=this.disposable(new tt.a({text:e.text,icon_left:e&&e.icon_left,icon_right:v.a.TriangleDown})),this.menu=this.disposable(new ct.a({items:e.items,to_label:e.to_label,related_element:this.element})),this.element.append(this.button.element,this.menu.element),this._chosen=Object(M.a)(),this.chosen=this._chosen,this.just_opened=!1,this.disposables(Object(v.h)(this.button.element,"mousedown",this.button_mousedown,{capture:!0}),this.button.mouseup.observe(this.button_mouseup),this.button.keydown.observe(this.button_keydown),this.menu.selected.observe(({value:e})=>{void 0!==e&&(this._chosen.emit({value:e}),this.menu.selected.val=void 0)})),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.button.enabled.val=e}}class ut extends p.a{constructor(e,t){super(),this.ctrl=e,this.event=t,this.inputs_enabled=Object(M.e)(!0),this.create_action_element=e=>{const t=new d.a;let i,o;if(e.type===ot.SpawnNpcs)i="Spawn:",o=Object(v.i)(Object(v.i)(t.add(new a.a(e.section_id,{min:0,step:1,enabled:!1})).element),Object(v.i)(t.add(new a.a(e.appear_flag,{min:0,step:1,enabled:!1})).element));else{i=e.type===ot.Unlock?"Unlock:":"Lock:";const s=t.add(new a.a(e.door_id.val,{min:0,step:1,enabled:this.inputs_enabled}));o=s.element,t.add_all(s.value.bind_to(e.door_id),s.value.observe(({value:t})=>e.set_door_id(t)))}const s=t.add(new tt.a({icon_left:v.a.Remove}));return t.add_all(s.click.observe(()=>this.ctrl.remove_action(this.event,e))),[Object(v.z)(Object(v.x)(i),Object(v.u)(o),Object(v.u)(s.element)),t]};const i=document.createTextNode(t.wave.id.val.toString());this.delay_input=this.disposable(new a.a(t.delay.val,{min:0,step:1,enabled:this.inputs_enabled}));const o=Object(v.s)({className:"quest_editor_EventView_actions"}),s=this.disposable(new _t({text:"Add action",items:nt,to_label(e){switch(e){case ot.SpawnNpcs:return"Spawn NPCs";case ot.Unlock:return"Unlock door";case ot.Lock:return"Lock door"}}}));this.element=Object(v.i)({tabIndex:0},Object(v.s)(Object(v.z)(Object(v.x)("ID:"),Object(v.u)(t.id.toString())),Object(v.z)(Object(v.x)("Section:"),Object(v.u)(t.section_id.toString())),Object(v.z)(Object(v.x)("Wave:"),Object(v.u)(i)),Object(v.z)(Object(v.x)("Delay:"),Object(v.u)(this.delay_input.element)),Object(v.z)(Object(v.x)({colSpan:2},"Actions:")),Object(v.z)(Object(v.u)({colSpan:2},o)),Object(v.z)(Object(v.u)({colSpan:2},s.element)))),this.disposables(Object(v.c)(this.element,"className",e.is_selected(t).map(e=>`quest_editor_EventView ${e?"selected":""}`)),t.wave.id.observe(({value:e})=>i.data=e.toString()),Object(v.h)(this.element,"focus",()=>{e.set_selected_wave(t.wave)}),Object(v.h)(this.element,"click",i=>{i.stopPropagation(),e.set_selected_wave(t.wave)}),Object(v.h)(this.element,"keyup",i=>{"Delete"===i.key&&e.remove_event(t)}),this.delay_input.value.bind_to(t.delay),this.delay_input.value.observe(i=>e.set_delay(t,i.value)),Object(v.d)(o,t.actions,this.create_action_element),s.chosen.observe(({value:i})=>e.add_action(t,i))),this.finalize_construction()}set_enabled(e){super.set_enabled(e),this.inputs_enabled.val=e}}i("CGbB");const vt=X.c.get("quest_editor/gui/EventSubGraphView"),ht=8,pt=20;class gt extends p.a{constructor(e,t,i,o){super(),this.ctrl=e,this.dag=t,this.sub_graph=i,this.max_edge_depth=o,this.event_gui_data=new Map,this.event_container_element=Object(v.i)({className:"quest_editor_EventSubGraphView_event_container"}),this.edge_container_element=Object(v.i)({className:"quest_editor_EventSubGraphView_edge_container"}),this.element=Object(v.i)({className:"quest_editor_EventSubGraphView"},this.edge_container_element,this.event_container_element),this.update_edges=()=>{if(this.edge_container_element.innerHTML="",0===this.sub_graph.length.val)return;const e=Array(this.sub_graph.length.val-1);for(let t=0;ts,h=Math.min(s,a),p=Math.max(s,a);e:for(;;){for(let t=u?h:Math.max(0,h-1);t{const i=new d.a,o=i.add(new ut(this.ctrl,e));return this.event_gui_data.set(e,{event_view:o,position:t}),i.add({dispose:()=>this.event_gui_data.delete(e)}),[o.element,i]},this.after_events_changed=e=>{e.type===J.a.ListChange&&(this.sub_graph.val.forEach((e,t)=>{this.event_gui_data.get(e).position=t}),this.update_edges())},this.disposables(o.observe(({value:e})=>{this.element.style.marginLeft=`${ht*e}px`},{call_now:!0}),Object(v.d)(this.event_container_element,i,this.create_event_element,{after:this.after_events_changed}),t.observe(({value:e})=>{e.type!==et.EdgeAdded&&e.type!==et.EdgeRemoved||this.update_edges()})),this.finalize_construction()}set_enabled(e){super.set_enabled(e);for(const{event_view:t}of this.event_gui_data.values())t.enabled.val=e}}class bt extends o.a{constructor(e){super(),this.ctrl=e,this.sub_graph_views=new Map,this.unavailable_view=new b("No quest loaded."),this.max_edge_depth=Object(M.e)(0),this.create_sub_graph_element=e=>{let t=this.sub_graph_views.get(e);return t||(t=new gt(this.ctrl,this.ctrl.event_dag.val,e,this.max_edge_depth),this.sub_graph_views.set(e,t)),t.element},this.update_edges=()=>{for(const e of this.sub_graph_views.values())e.element.parentNode&&e.update_edges()},this.after_event_dags_changed=e=>{var t;if(e.type===J.a.ListChange)for(const i of e.inserted)null===(t=this.sub_graph_views.get(i))||void 0===t||t.update_edges()},this.element=Object(v.i)({className:"quest_editor_EventsView",tabIndex:-1},this.container_element=Object(v.i)({className:"quest_editor_EventsView_container"},this.disposable(new Ue.a(this.add_event_button=new tt.a({text:"Add event"}))).element,this.dag_container_element=Object(v.i)({className:"quest_editor_EventsView_sub_graph_container"})),this.unavailable_view.element),this.disposables(Object(v.c)(this.container_element,"hidden",e.unavailable),this.unavailable_view.visible.bind_to(e.unavailable),this.enabled.bind_to(e.enabled),this.add_event_button.click.observe(e.add_event),Object(v.d)(this.dag_container_element,e.event_sub_graphs,this.create_sub_graph_element,{after:this.after_event_dags_changed}),Object(v.h)(this.element,"focus",()=>{e.focused()}),Object(v.h)(this.element,"click",()=>{e.set_selected_wave(void 0)})),this.finalize_construction()}dispose(){super.dispose();for(const e of this.sub_graph_views.values())e.dispose();this.sub_graph_views.clear()}resize(e,t){return super.resize(e,t),this.update_edges(),this}focus(){super.focus(),this.update_edges()}set_enabled(e){super.set_enabled(e);for(const t of this.sub_graph_views.values())t.element.parentNode&&(t.enabled.val=e)}}var ft;!function(e){e[e.Any=0]="Any",e[e.Byte=1]="Byte",e[e.Word=2]="Word",e[e.DWord=3]="DWord",e[e.Float=4]="Float",e[e.Label=5]="Label",e[e.ILabel=6]="ILabel",e[e.DLabel=7]="DLabel",e[e.SLabel=8]="SLabel",e[e.String=9]="String",e[e.ILabelVar=10]="ILabelVar",e[e.RegRef=11]="RegRef",e[e.RegTupRef=12]="RegTupRef",e[e.RegRefVar=13]="RegRefVar",e[e.Pointer=14]="Pointer"}(ft||(ft={}));const mt={kind:ft.Any},wt={kind:ft.Byte},kt={kind:ft.Word},yt={kind:ft.DWord},Rt={kind:ft.Float},It={kind:ft.Label},jt={kind:ft.ILabel},xt={kind:ft.DLabel},Tt={kind:ft.SLabel},St={kind:ft.String},Ct={kind:ft.ILabelVar},Ot={kind:ft.RegRef},Lt={kind:ft.RegRefVar},Pt={kind:ft.Pointer},Dt=-Math.pow(2,31),Bt=Math.pow(2,31)-1;Math.pow(2,32);var Et,Mt;function Wt(e,t,i){return{type:e,doc:t,access:i}}!function(e){e[e.Read=0]="Read",e[e.Write=1]="Write",e[e.ReadWrite=2]="ReadWrite"}(Et||(Et={})),function(e){e[e.Push=0]="Push",e[e.Pop=1]="Pop"}(Mt||(Mt={}));const qt=[],zt=new Map;function Ft(e,t,i,o,s){return{code:e,mnemonic:t,doc:i,size:e<256?1:2,params:o,stack:s}}const Vt=qt[0]=Ft(0,"nop","No operation, does nothing.",[],void 0),Ut=qt[1]=Ft(1,"ret","Returns control to caller.",[],void 0),$t=qt[2]=Ft(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),Nt=qt[3]=Ft(3,"exit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),At=qt[4]=Ft(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[Wt(jt,void 0,void 0)],void 0),Ht=qt[5]=Ft(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),Gt=qt[6]=Ft(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),Yt=qt[7]=Ft(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[Wt(jt,void 0,void 0)],void 0),Kt=qt[8]=Ft(8,"let","Sets the first register's value to second one's value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),Qt=qt[9]=Ft(9,"leti","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),Zt=qt[10]=Ft(10,"letb","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(wt,void 0,void 0)],void 0),Jt=qt[11]=Ft(11,"letw","Sets a register to the given value.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0),Wt(kt,void 0,void 0)],void 0),Xt=qt[12]=Ft(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),ei=(qt[13]=Ft(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Pt,void 0,Et.Write)]},void 0,void 0),Wt(It,void 0,void 0)],void 0),qt[14]=Ft(14,"unknown_0e",void 0,[],void 0),qt[15]=Ft(15,"unknown_0f",void 0,[],void 0),qt[16]=Ft(16,"set","Sets a register to 1.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ti=qt[17]=Ft(17,"clear","Sets a register to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),ii=qt[18]=Ft(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.ReadWrite)]},void 0,void 0)],void 0),oi=(qt[19]=Ft(19,"gset",void 0,[Wt(kt,void 0,void 0)],void 0),qt[20]=Ft(20,"gclear",void 0,[Wt(kt,void 0,void 0)],void 0),qt[21]=Ft(21,"grev",void 0,[Wt(kt,void 0,void 0)],void 0),qt[22]=Ft(22,"glet",void 0,[Wt(kt,void 0,void 0)],void 0),qt[23]=Ft(23,"gget","Sets a register to value of the given flag.",[Wt(kt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(kt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[24]=Ft(24,"add",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),si=qt[25]=Ft(25,"addi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ni=qt[26]=Ft(26,"sub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ri=qt[27]=Ft(27,"subi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ai=qt[28]=Ft(28,"mul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),di=qt[29]=Ft(29,"muli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),ci=qt[30]=Ft(30,"div",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),li=qt[31]=Ft(31,"divi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),_i=qt[32]=Ft(32,"and",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),ui=qt[33]=Ft(33,"andi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),vi=qt[34]=Ft(34,"or",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),hi=qt[35]=Ft(35,"ori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),pi=qt[36]=Ft(36,"xor",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),gi=qt[37]=Ft(37,"xori",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),bi=qt[38]=Ft(38,"mod",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),fi=qt[39]=Ft(39,"modi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),mi=qt[40]=Ft(40,"jmp",void 0,[Wt(jt,void 0,void 0)],void 0),wi=qt[41]=Ft(41,"call",void 0,[Wt(jt,void 0,void 0)],void 0),ki=qt[42]=Ft(42,"jmp_on",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),yi=qt[43]=Ft(43,"jmp_off",void 0,[Wt(jt,void 0,void 0),Wt(Lt,void 0,Et.Read)],void 0),Ri=qt[44]=Ft(44,"jmp_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ii=qt[45]=Ft(45,"jmpi_=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),ji=qt[46]=Ft(46,"jmp_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),xi=qt[47]=Ft(47,"jmpi_!=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ti=qt[48]=Ft(48,"ujmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Si=qt[49]=Ft(49,"ujmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ci=qt[50]=Ft(50,"jmp_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Oi=qt[51]=Ft(51,"jmpi_>",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Li=qt[52]=Ft(52,"ujmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Pi=qt[53]=Ft(53,"ujmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Di=qt[54]=Ft(54,"jmp_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Bi=qt[55]=Ft(55,"jmpi_<",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ei=qt[56]=Ft(56,"ujmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Mi=qt[57]=Ft(57,"ujmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Wi=qt[58]=Ft(58,"jmp_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),qi=qt[59]=Ft(59,"jmpi_>=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),zi=qt[60]=Ft(60,"ujmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Fi=qt[61]=Ft(61,"ujmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),Vi=qt[62]=Ft(62,"jmp_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(jt,void 0,void 0)],void 0),Ui=qt[63]=Ft(63,"jmpi_<=",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0)],void 0),$i=qt[64]=Ft(64,"switch_jmp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),Ni=qt[65]=Ft(65,"switch_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Ct,void 0,void 0)],void 0),Ai=qt[66]=Ft(66,"stack_push",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),Hi=qt[67]=Ft(67,"stack_pop",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),Gi=qt[68]=Ft(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[Wt(Ot,void 0,Et.Read),Wt(yt,void 0,void 0)],void 0),Yi=qt[69]=Ft(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[Wt(Ot,void 0,Et.Write),Wt(yt,void 0,void 0)],void 0),Ki=(qt[70]=Ft(70,"unknown_46",void 0,[],void 0),qt[71]=Ft(71,"unknown_47",void 0,[],void 0),qt[72]=Ft(72,"arg_pushr","Pushes the value of the given register onto the stack.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push)),Qi=qt[73]=Ft(73,"arg_pushl","Pushes the given value onto the stack.",[Wt(yt,void 0,void 0)],Mt.Push),Zi=qt[74]=Ft(74,"arg_pushb","Pushes the given value onto the stack.",[Wt(wt,void 0,void 0)],Mt.Push),Ji=qt[75]=Ft(75,"arg_pushw","Pushes the given value onto the stack.",[Wt(kt,void 0,void 0)],Mt.Push),Xi=qt[76]=Ft(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Push),eo=qt[77]=Ft(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[Wt(It,void 0,void 0)],Mt.Push),to=qt[78]=Ft(78,"arg_pushs","Pushes the given value onto the stack.",[Wt(St,void 0,void 0)],Mt.Push),io=(qt[79]=Ft(79,"unknown_4f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[80]=Ft(80,"message",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[81]=Ft(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(wt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop)),oo=(qt[82]=Ft(82,"fadein",void 0,[],void 0),qt[83]=Ft(83,"fadeout",void 0,[],void 0),qt[84]=Ft(84,"se",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[85]=Ft(85,"bgm",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[86]=Ft(86,"unknown_56",void 0,[],void 0),qt[87]=Ft(87,"unknown_57",void 0,[],void 0),qt[88]=Ft(88,"enable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[89]=Ft(89,"disable",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[90]=Ft(90,"window_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop)),so=qt[91]=Ft(91,"add_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),no=(qt[92]=Ft(92,"mesend",void 0,[],void 0),qt[93]=Ft(93,"gettime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),ro=qt[94]=Ft(94,"winend",void 0,[],void 0),ao=(qt[95]=Ft(95,"unknown_5f",void 0,[],void 0),qt[96]=Ft(96,"npc_crt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[97]=Ft(97,"npc_stop",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[98]=Ft(98,"npc_play",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[99]=Ft(99,"npc_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[100]=Ft(100,"npc_nont",void 0,[],void 0),qt[101]=Ft(101,"npc_talk",void 0,[],void 0),qt[102]=Ft(102,"npc_crp_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(jt,void 0,Et.Read),Wt(mt,void 0,Et.Read),Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[103]=Ft(103,"unknown_67",void 0,[],void 0),qt[104]=Ft(104,"create_pipe",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[105]=Ft(105,"p_hpstat_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[106]=Ft(106,"p_dead_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0)],Mt.Pop)),co=(qt[107]=Ft(107,"p_disablewarp",void 0,[],void 0),qt[108]=Ft(108,"p_enablewarp",void 0,[],void 0),qt[109]=Ft(109,"p_move_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[110]=Ft(110,"p_look",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[111]=Ft(111,"unknown_6f",void 0,[],void 0),qt[112]=Ft(112,"p_action_disable",void 0,[],void 0),qt[113]=Ft(113,"p_action_enable",void 0,[],void 0),qt[114]=Ft(114,"disable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[115]=Ft(115,"enable_movement1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[116]=Ft(116,"p_noncol",void 0,[],void 0),qt[117]=Ft(117,"p_col",void 0,[],void 0),qt[118]=Ft(118,"p_setpos","Sets a player's position.",[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Y-axis rotation.",Et.Read)]},void 0,void 0)],Mt.Pop),qt[119]=Ft(119,"p_return_guild",void 0,[],void 0),qt[120]=Ft(120,"p_talk_guild",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[121]=Ft(121,"npc_talk_pl_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[122]=Ft(122,"npc_talk_kill",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[123]=Ft(123,"npc_crtpk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[124]=Ft(124,"npc_crppk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[125]=Ft(125,"npc_crptalk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[126]=Ft(126,"p_look_at_v1",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[127]=Ft(127,"npc_crp_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[128]=Ft(128,"cam_quake",void 0,[],void 0),qt[129]=Ft(129,"cam_adj",void 0,[],void 0),qt[130]=Ft(130,"cam_zmin",void 0,[],void 0),qt[131]=Ft(131,"cam_zmout",void 0,[],void 0),qt[132]=Ft(132,"cam_pan_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[133]=Ft(133,"game_lev_super",void 0,[],void 0),qt[134]=Ft(134,"game_lev_reset",void 0,[],void 0),qt[135]=Ft(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[136]=Ft(136,"if_zone_clear",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),lo=(qt[137]=Ft(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[138]=Ft(138,"unhide_obj",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[139]=Ft(139,"unhide_ene",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[140]=Ft(140,"at_coords_call",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[141]=Ft(141,"at_coords_talk",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[142]=Ft(142,"col_npcin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(jt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[143]=Ft(143,"col_npcinr",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[144]=Ft(144,"switch_on",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[145]=Ft(145,"switch_off",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[146]=Ft(146,"playbgm_epi",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[147]=Ft(147,"set_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[148]=Ft(148,"set_obj_param","Creates a targetable object.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Read),Wt(yt,"Y coordinate.",Et.Read),Wt(yt,"Z coordinate.",Et.Read),Wt(yt,"Collision radius.",Et.Read),Wt(jt,"Function label.",Et.Read),Wt(yt,"Vertical position of the cursor.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},"Object handle.",void 0)],void 0),qt[149]=Ft(149,"set_floor_handler",void 0,[Wt(yt,"Floor number.",void 0),Wt(jt,"Handler function label.",void 0)],Mt.Pop)),_o=(qt[150]=Ft(150,"clr_floor_handler",void 0,[Wt(yt,"Floor number.",void 0)],Mt.Pop),qt[151]=Ft(151,"col_plinaw",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[152]=Ft(152,"hud_hide",void 0,[],void 0),qt[153]=Ft(153,"hud_show",void 0,[],void 0),qt[154]=Ft(154,"cine_enable",void 0,[],void 0),qt[155]=Ft(155,"cine_disable",void 0,[],void 0),qt[156]=Ft(156,"unknown_9c",void 0,[],void 0),qt[157]=Ft(157,"unknown_9d",void 0,[],void 0),qt[158]=Ft(158,"unknown_9e",void 0,[],void 0),qt[159]=Ft(159,"unknown_9f",void 0,[],void 0),qt[160]=Ft(160,"unknown_a0",void 0,[],void 0),qt[161]=Ft(161,"set_qt_failure",void 0,[Wt(jt,void 0,void 0)],void 0),qt[162]=Ft(162,"set_qt_success",void 0,[Wt(jt,void 0,void 0)],void 0),qt[163]=Ft(163,"clr_qt_failure",void 0,[],void 0),qt[164]=Ft(164,"clr_qt_success",void 0,[],void 0),qt[165]=Ft(165,"set_qt_cancel",void 0,[Wt(jt,void 0,void 0)],void 0),qt[166]=Ft(166,"clr_qt_cancel",void 0,[],void 0),qt[167]=Ft(167,"unknown_a7",void 0,[],void 0),qt[168]=Ft(168,"pl_walk_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[169]=Ft(169,"unknown_a9",void 0,[],void 0),qt[170]=Ft(170,"unknown_aa",void 0,[],void 0),qt[171]=Ft(171,"unknown_ab",void 0,[],void 0),qt[172]=Ft(172,"unknown_ac",void 0,[],void 0),qt[173]=Ft(173,"unknown_ad",void 0,[],void 0),qt[174]=Ft(174,"unknown_ae",void 0,[],void 0),qt[175]=Ft(175,"unknown_af",void 0,[],void 0),qt[176]=Ft(176,"pl_add_meseta",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[177]=Ft(177,"thread_stg",void 0,[Wt(jt,void 0,void 0)],void 0)),uo=(qt[178]=Ft(178,"del_obj_param",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},"Object handle.",void 0)],void 0),qt[179]=Ft(179,"item_create",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[180]=Ft(180,"item_create2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[181]=Ft(181,"item_delete",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[182]=Ft(182,"item_delete2","Deletes an item from the player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[183]=Ft(183,"item_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[184]=Ft(184,"setevt",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[185]=Ft(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),vo=(qt[186]=Ft(186,"set_qt_exit",void 0,[Wt(jt,void 0,void 0)],void 0),qt[187]=Ft(187,"clr_qt_exit",void 0,[],void 0),qt[188]=Ft(188,"unknown_bc",void 0,[],void 0),qt[189]=Ft(189,"unknown_bd",void 0,[],void 0),qt[190]=Ft(190,"unknown_be",void 0,[],void 0),qt[191]=Ft(191,"unknown_bf",void 0,[],void 0),qt[192]=Ft(192,"particle_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[193]=Ft(193,"npc_text",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[194]=Ft(194,"npc_chkwarp",void 0,[],void 0),qt[195]=Ft(195,"pl_pkoff",void 0,[],void 0),qt[196]=Ft(196,"map_designate",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0)),ho=(qt[197]=Ft(197,"masterkey_on",void 0,[],void 0),qt[198]=Ft(198,"masterkey_off",void 0,[],void 0),qt[199]=Ft(199,"window_time",void 0,[],void 0),qt[200]=Ft(200,"winend_time",void 0,[],void 0),qt[201]=Ft(201,"winset_time",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[202]=Ft(202,"getmtime",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[203]=Ft(203,"set_quest_board_handler",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[204]=Ft(204,"clear_quest_board_handler",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[205]=Ft(205,"particle_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[206]=Ft(206,"npc_crptalk_id_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[207]=Ft(207,"npc_lang_clean",void 0,[],void 0),qt[208]=Ft(208,"pl_pkon",void 0,[],void 0),qt[209]=Ft(209,"pl_chk_item2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[210]=Ft(210,"enable_mainmenu",void 0,[],void 0),qt[211]=Ft(211,"disable_mainmenu",void 0,[],void 0),qt[212]=Ft(212,"start_battlebgm",void 0,[],void 0),qt[213]=Ft(213,"end_battlebgm",void 0,[],void 0),qt[214]=Ft(214,"disp_msg_qb",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[215]=Ft(215,"close_msg_qb",void 0,[],void 0),qt[216]=Ft(216,"set_eventflag_v3",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[217]=Ft(217,"sync_leti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0)),po=(qt[218]=Ft(218,"set_returnhunter",void 0,[],void 0),qt[219]=Ft(219,"set_returncity",void 0,[],void 0),qt[220]=Ft(220,"load_pvr",void 0,[],void 0),qt[221]=Ft(221,"load_midi",void 0,[],void 0),qt[222]=Ft(222,"unknown_de",void 0,[],void 0),qt[223]=Ft(223,"npc_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[224]=Ft(224,"pad_dragon",void 0,[],void 0),qt[225]=Ft(225,"clear_mainwarp",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[226]=Ft(226,"pcam_param_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[227]=Ft(227,"start_setevt_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[228]=Ft(228,"warp_on",void 0,[],void 0),qt[229]=Ft(229,"warp_off",void 0,[],void 0),qt[230]=Ft(230,"get_slotnumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0)),go=(qt[231]=Ft(231,"get_servernumber",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[232]=Ft(232,"set_eventflag2",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[233]=Ft(233,"res",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[234]=Ft(234,"unknown_ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0)],void 0),qt[235]=Ft(235,"enable_bgmctrl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[236]=Ft(236,"sw_send",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[237]=Ft(237,"create_bgmctrl",void 0,[],void 0),qt[238]=Ft(238,"pl_add_meseta2",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[239]=Ft(239,"sync_register",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[240]=Ft(240,"send_regwork",void 0,[],void 0),qt[241]=Ft(241,"leti_fixed_camera_v3",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[242]=Ft(242,"default_camera_pos1",void 0,[],void 0),qt[243]=Ft(243,"unknown_f3",void 0,[],void 0),qt[244]=Ft(244,"unknown_f4",void 0,[],void 0),qt[245]=Ft(245,"unknown_f5",void 0,[],void 0),qt[246]=Ft(246,"unknown_f6",void 0,[],void 0),qt[247]=Ft(247,"unknown_f7",void 0,[],void 0),qt[248]=Ft(248,"unknown_f8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[249]=Ft(249,"unknown_f9",void 0,[],void 0),qt[250]=Ft(250,"get_gc_number",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[251]=Ft(251,"unknown_fb",void 0,[Wt(kt,void 0,void 0)],void 0),qt[252]=Ft(252,"unknown_fc",void 0,[],void 0),qt[253]=Ft(253,"unknown_fd",void 0,[],void 0),qt[254]=Ft(254,"unknown_fe",void 0,[],void 0),qt[255]=Ft(255,"unknown_ff",void 0,[],void 0),qt[63488]=Ft(63488,"unknown_f800",void 0,[],void 0),qt[63489]=Ft(63489,"set_chat_callback",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63490]=Ft(63490,"unknown_f802",void 0,[],void 0),qt[63491]=Ft(63491,"unknown_f803",void 0,[],void 0),qt[63492]=Ft(63492,"unknown_f804",void 0,[],void 0),qt[63493]=Ft(63493,"unknown_f805",void 0,[],void 0),qt[63494]=Ft(63494,"unknown_f806",void 0,[],void 0),qt[63495]=Ft(63495,"unknown_f807",void 0,[],void 0),qt[63496]=Ft(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63497]=Ft(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63498]=Ft(63498,"get_coord_of_player","Retrieves a player's position.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"X coordinate.",Et.Write),Wt(yt,"Y coordinate.",Et.Write),Wt(yt,"Z coordinate.",Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63499]=Ft(63499,"enable_map",void 0,[],void 0),qt[63500]=Ft(63500,"disable_map",void 0,[],void 0),qt[63501]=Ft(63501,"map_designate_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),bo=(qt[63502]=Ft(63502,"unknown_f80e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63503]=Ft(63503,"unknown_f80f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63504]=Ft(63504,"ba_initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63505]=Ft(63505,"set_ba_rules",void 0,[],void 0),qt[63506]=Ft(63506,"unknown_f812",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63507]=Ft(63507,"unknown_f813",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63508]=Ft(63508,"unknown_f814",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63509]=Ft(63509,"unknown_f815",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63510]=Ft(63510,"unknown_f816",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63511]=Ft(63511,"unknown_f817",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63512]=Ft(63512,"unknown_f818",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63513]=Ft(63513,"unknown_f819",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63514]=Ft(63514,"unknown_f81a",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63515]=Ft(63515,"unknown_f81b",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63516]=Ft(63516,"ba_disp_msg",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63517]=Ft(63517,"death_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63518]=Ft(63518,"death_tech_lvl_up",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63519]=Ft(63519,"unknown_f81f",void 0,[],void 0),qt[63520]=Ft(63520,"cmode_stage",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63521]=Ft(63521,"unknown_f821",void 0,[],void 0),qt[63522]=Ft(63522,"unknown_f822",void 0,[],void 0),qt[63523]=Ft(63523,"unknown_f823",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63524]=Ft(63524,"unknown_f824",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63525]=Ft(63525,"exp_multiplication",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63526]=Ft(63526,"exp_division",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63527]=Ft(63527,"get_user_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63528]=Ft(63528,"go_floor","Sends a player to the given floor.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read)]},void 0,void 0)],void 0),qt[63529]=Ft(63529,"unknown_f829",void 0,[],void 0),qt[63530]=Ft(63530,"unknown_f82a",void 0,[],void 0),qt[63531]=Ft(63531,"unlock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63532]=Ft(63532,"lock_door2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63533]=Ft(63533,"if_switch_not_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63534]=Ft(63534,"if_switch_pressed",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Floor ID.",Et.Read),Wt(yt,"Switch ID.",Et.Read),Wt(yt,"Will be set to 1 if the switch is pressed, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63535]=Ft(63535,"unknown_f82f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63536]=Ft(63536,"control_dragon",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63537]=Ft(63537,"release_dragon",void 0,[],void 0),qt[63538]=Ft(63538,"unknown_f832",void 0,[],void 0),qt[63539]=Ft(63539,"unknown_f833",void 0,[],void 0),qt[63540]=Ft(63540,"unknown_f834",void 0,[],void 0),qt[63541]=Ft(63541,"unknown_f835",void 0,[],void 0),qt[63542]=Ft(63542,"unknown_f836",void 0,[],void 0),qt[63543]=Ft(63543,"unknown_f837",void 0,[],void 0),qt[63544]=Ft(63544,"shrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63545]=Ft(63545,"unshrink",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63546]=Ft(63546,"unknown_f83a",void 0,[],void 0),qt[63547]=Ft(63547,"unknown_f83b",void 0,[],void 0),qt[63548]=Ft(63548,"display_clock2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63549]=Ft(63549,"unknown_f83d",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63550]=Ft(63550,"delete_area_title",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63551]=Ft(63551,"unknown_f83f",void 0,[],void 0),qt[63552]=Ft(63552,"load_npc_data",void 0,[],void 0),qt[63553]=Ft(63553,"get_npc_data",void 0,[Wt(xt,void 0,void 0)],void 0),qt[63554]=Ft(63554,"unknown_f842",void 0,[],void 0),qt[63555]=Ft(63555,"unknown_f843",void 0,[],void 0),qt[63556]=Ft(63556,"unknown_f844",void 0,[],void 0),qt[63557]=Ft(63557,"unknown_f845",void 0,[],void 0),qt[63558]=Ft(63558,"unknown_f846",void 0,[],void 0),qt[63559]=Ft(63559,"unknown_f847",void 0,[],void 0),qt[63560]=Ft(63560,"give_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63561]=Ft(63561,"take_damage_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63562]=Ft(63562,"unk_score_f84a",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63563]=Ft(63563,"unk_score_f84b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63564]=Ft(63564,"kill_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63565]=Ft(63565,"death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63566]=Ft(63566,"unk_score_f84e",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63567]=Ft(63567,"enemy_death_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63568]=Ft(63568,"meseta_score",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63569]=Ft(63569,"unknown_f851",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63570]=Ft(63570,"unknown_f852",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63571]=Ft(63571,"reverse_warps",void 0,[],void 0),qt[63572]=Ft(63572,"unreverse_warps",void 0,[],void 0),qt[63573]=Ft(63573,"set_ult_map",void 0,[],void 0),qt[63574]=Ft(63574,"unset_ult_map",void 0,[],void 0),qt[63575]=Ft(63575,"set_area_title",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63576]=Ft(63576,"unknown_f858",void 0,[],void 0),qt[63577]=Ft(63577,"unknown_f859",void 0,[],void 0),qt[63578]=Ft(63578,"equip_item",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63579]=Ft(63579,"unequip_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63580]=Ft(63580,"unknown_f85c",void 0,[],void 0),qt[63581]=Ft(63581,"unknown_f85d",void 0,[],void 0),qt[63582]=Ft(63582,"unknown_f85e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63583]=Ft(63583,"unknown_f85f",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63584]=Ft(63584,"unknown_f860",void 0,[],void 0),qt[63585]=Ft(63585,"unknown_f861",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63586]=Ft(63586,"unknown_f862",void 0,[],void 0),qt[63587]=Ft(63587,"unknown_f863",void 0,[],void 0),qt[63588]=Ft(63588,"cmode_rank",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63589]=Ft(63589,"award_item_name",void 0,[],void 0),qt[63590]=Ft(63590,"award_item_select",void 0,[],void 0),qt[63591]=Ft(63591,"award_item_give_to",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63592]=Ft(63592,"unknown_f868",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63593]=Ft(63593,"unknown_f869",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63594]=Ft(63594,"item_create_cmode",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63595]=Ft(63595,"unknown_f86b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63596]=Ft(63596,"award_item_ok",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63597]=Ft(63597,"unknown_f86d",void 0,[],void 0),qt[63598]=Ft(63598,"unknown_f86e",void 0,[],void 0),qt[63599]=Ft(63599,"ba_set_lives",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63600]=Ft(63600,"ba_set_tech_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63601]=Ft(63601,"ba_set_lvl",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63602]=Ft(63602,"ba_set_time_limit",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63603]=Ft(63603,"boss_is_dead",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63604]=Ft(63604,"unknown_f874",void 0,[],void 0),qt[63605]=Ft(63605,"unknown_f875",void 0,[],void 0),qt[63606]=Ft(63606,"unknown_f876",void 0,[],void 0),qt[63607]=Ft(63607,"enable_techs","Enables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63608]=Ft(63608,"disable_techs","Disables technique use for the given player.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63609]=Ft(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player gender.",Et.Write)]},void 0,void 0)],void 0),qt[63610]=Ft(63610,"get_chara_class","Retrieves the player's race and character class.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player race. 0 If human, 1 if newman, 2 if cast.",Et.Write),Wt(yt,"Player class. 0 If hunter, 1 if ranger, 2 if force.",Et.Write)]},void 0,void 0)],void 0),qt[63611]=Ft(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,"Amount of meseta to take.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Will be set to 1 if the meseta was taken, 0 otherwise.",Et.Write)]},void 0,void 0)],void 0),qt[63612]=Ft(63612,"unknown_f87c",void 0,[],void 0),qt[63613]=Ft(63613,"unknown_f87d",void 0,[],void 0),qt[63614]=Ft(63614,"unknown_f87e",void 0,[],void 0),qt[63615]=Ft(63615,"read_guildcard_flag",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63616]=Ft(63616,"unknown_f880",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63617]=Ft(63617,"get_pl_name","Sets the value of to the given player's name.",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63618]=Ft(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63619]=Ft(63619,"unknown_f883",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63620]=Ft(63620,"unknown_f884",void 0,[],void 0),qt[63621]=Ft(63621,"unknown_f885",void 0,[],void 0),qt[63622]=Ft(63622,"unknown_f886",void 0,[],void 0),qt[63623]=Ft(63623,"unknown_f887",void 0,[],void 0),qt[63624]=Ft(63624,"unknown_f888",void 0,[],void 0),qt[63625]=Ft(63625,"unknown_f889",void 0,[],void 0),qt[63626]=Ft(63626,"get_player_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63627]=Ft(63627,"send_mail",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63628]=Ft(63628,"online_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63629]=Ft(63629,"chl_set_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63630]=Ft(63630,"chl_get_timerecord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63631]=Ft(63631,"unknown_f88f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63632]=Ft(63632,"unknown_f890",void 0,[],void 0),qt[63633]=Ft(63633,"load_enemy_data",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63634]=Ft(63634,"get_physical_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63635]=Ft(63635,"get_attack_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63636]=Ft(63636,"get_resist_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63637]=Ft(63637,"get_movement_data",void 0,[Wt(kt,void 0,void 0)],void 0),qt[63638]=Ft(63638,"unknown_f896",void 0,[],void 0),qt[63639]=Ft(63639,"unknown_f897",void 0,[],void 0),qt[63640]=Ft(63640,"shift_left",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0)),fo=qt[63641]=Ft(63641,"shift_right",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),mo=qt[63642]=Ft(63642,"get_random",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),wo=(qt[63643]=Ft(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),qt[63644]=Ft(63644,"disp_chl_retry_menu",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63645]=Ft(63645,"chl_reverser",void 0,[],void 0),qt[63646]=Ft(63646,"unknown_f89e",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63647]=Ft(63647,"unknown_f89f",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63648]=Ft(63648,"unknown_f8a0",void 0,[],void 0),qt[63649]=Ft(63649,"unknown_f8a1",void 0,[],void 0),qt[63650]=Ft(63650,"unknown_f8a2",void 0,[],void 0),qt[63651]=Ft(63651,"unknown_f8a3",void 0,[],void 0),qt[63652]=Ft(63652,"unknown_f8a4",void 0,[],void 0),qt[63653]=Ft(63653,"unknown_f8a5",void 0,[],void 0),qt[63654]=Ft(63654,"unknown_f8a6",void 0,[],void 0),qt[63655]=Ft(63655,"unknown_f8a7",void 0,[],void 0),qt[63656]=Ft(63656,"unknown_f8a8",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63657]=Ft(63657,"unknown_f8a9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63658]=Ft(63658,"unknown_f8aa",void 0,[],void 0),qt[63659]=Ft(63659,"unknown_f8ab",void 0,[],void 0),qt[63660]=Ft(63660,"unknown_f8ac",void 0,[],void 0),qt[63661]=Ft(63661,"get_number_of_player2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63662]=Ft(63662,"unknown_f8ae",void 0,[],void 0),qt[63663]=Ft(63663,"unknown_f8af",void 0,[],void 0),qt[63664]=Ft(63664,"unknown_f8b0",void 0,[],void 0),qt[63665]=Ft(63665,"unknown_f8b1",void 0,[],void 0),qt[63666]=Ft(63666,"unknown_f8b2",void 0,[],void 0),qt[63667]=Ft(63667,"unknown_f8b3",void 0,[],void 0),qt[63668]=Ft(63668,"unknown_f8b4",void 0,[],void 0),qt[63669]=Ft(63669,"unknown_f8b5",void 0,[],void 0),qt[63670]=Ft(63670,"unknown_f8b6",void 0,[],void 0),qt[63671]=Ft(63671,"unknown_f8b7",void 0,[],void 0),qt[63672]=Ft(63672,"unknown_f8b8",void 0,[],void 0),qt[63673]=Ft(63673,"chl_recovery",void 0,[],void 0),qt[63674]=Ft(63674,"unknown_f8ba",void 0,[],void 0),qt[63675]=Ft(63675,"unknown_f8bb",void 0,[],void 0),qt[63676]=Ft(63676,"set_episode",void 0,[Wt(yt,void 0,void 0)],void 0)),ko=(qt[63677]=Ft(63677,"unknown_f8bd",void 0,[],void 0),qt[63678]=Ft(63678,"unknown_f8be",void 0,[],void 0),qt[63679]=Ft(63679,"unknown_f8bf",void 0,[],void 0),qt[63680]=Ft(63680,"file_dl_req",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63681]=Ft(63681,"get_dl_status",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63682]=Ft(63682,"gba_unknown4",void 0,[],void 0),qt[63683]=Ft(63683,"get_gba_state",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63684]=Ft(63684,"unknown_f8c4",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63685]=Ft(63685,"unknown_f8c5",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63686]=Ft(63686,"qexit",void 0,[],void 0),qt[63687]=Ft(63687,"use_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Animation ID.",Et.Read),Wt(yt,"Animation duration in number of frames.",Et.Read)]},void 0,void 0)],void 0),qt[63688]=Ft(63688,"stop_animation",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63689]=Ft(63689,"run_to_coord",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63690]=Ft(63690,"set_slot_invincible",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63691]=Ft(63691,"unknown_f8cb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63692]=Ft(63692,"set_slot_poison",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63693]=Ft(63693,"set_slot_paralyze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63694]=Ft(63694,"set_slot_shock",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63695]=Ft(63695,"set_slot_freeze",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63696]=Ft(63696,"set_slot_slow",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63697]=Ft(63697,"set_slot_confuse",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63698]=Ft(63698,"set_slot_shifta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63699]=Ft(63699,"set_slot_deband",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63700]=Ft(63700,"set_slot_jellen",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63701]=Ft(63701,"set_slot_zalure",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read)]},void 0,void 0)],void 0),qt[63702]=Ft(63702,"fleti_fixed_camera",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63703]=Ft(63703,"fleti_locked_camera",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],Mt.Pop),qt[63704]=Ft(63704,"default_camera_pos2",void 0,[],void 0),qt[63705]=Ft(63705,"set_motion_blur",void 0,[],void 0),qt[63706]=Ft(63706,"set_screen_bw",void 0,[],void 0),qt[63707]=Ft(63707,"unknown_f8db",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63708]=Ft(63708,"npc_action_string",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt(Tt,void 0,void 0)],void 0),qt[63709]=Ft(63709,"get_pad_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63710]=Ft(63710,"get_button_cond",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63711]=Ft(63711,"freeze_enemies",void 0,[],void 0),qt[63712]=Ft(63712,"unfreeze_enemies",void 0,[],void 0),qt[63713]=Ft(63713,"freeze_everything",void 0,[],void 0),qt[63714]=Ft(63714,"unfreeze_everything",void 0,[],void 0),qt[63715]=Ft(63715,"restore_hp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63716]=Ft(63716,"restore_tp",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63717]=Ft(63717,"close_chat_bubble",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63718]=Ft(63718,"move_coords_object",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63719]=Ft(63719,"at_coords_call_ex",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63720]=Ft(63720,"unknown_f8e8",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63721]=Ft(63721,"unknown_f8e9",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63722]=Ft(63722,"unknown_f8ea",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63723]=Ft(63723,"unknown_f8eb",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63724]=Ft(63724,"unknown_f8ec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63725]=Ft(63725,"animation_check",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63726]=Ft(63726,"call_image_data",void 0,[Wt(yt,void 0,void 0),Wt(kt,void 0,void 0)],Mt.Pop),qt[63727]=Ft(63727,"unknown_f8ef",void 0,[],void 0),qt[63728]=Ft(63728,"turn_off_bgm_p2",void 0,[],void 0),qt[63729]=Ft(63729,"turn_on_bgm_p2",void 0,[],void 0),qt[63730]=Ft(63730,"load_unk_data",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(xt,void 0,void 0)],Mt.Pop),qt[63731]=Ft(63731,"particle2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63732]=Ft(63732,"unknown_f8f4",void 0,[],void 0),qt[63733]=Ft(63733,"unknown_f8f5",void 0,[],void 0),qt[63734]=Ft(63734,"unknown_f8f6",void 0,[],void 0),qt[63735]=Ft(63735,"unknown_f8f7",void 0,[],void 0),qt[63736]=Ft(63736,"unknown_f8f8",void 0,[],void 0),qt[63737]=Ft(63737,"unknown_f8f9",void 0,[],void 0),qt[63738]=Ft(63738,"unknown_f8fa",void 0,[],void 0),qt[63739]=Ft(63739,"unknown_f8fb",void 0,[],void 0),qt[63740]=Ft(63740,"unknown_f8fc",void 0,[],void 0),qt[63741]=Ft(63741,"unknown_f8fd",void 0,[],void 0),qt[63742]=Ft(63742,"unknown_f8fe",void 0,[],void 0),qt[63743]=Ft(63743,"unknown_f8ff",void 0,[],void 0),qt[63744]=Ft(63744,"unknown_f900",void 0,[],void 0),qt[63745]=Ft(63745,"dec2float",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63746]=Ft(63746,"float2dec",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63747]=Ft(63747,"flet",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),yo=qt[63748]=Ft(63748,"fleti",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Ro=(qt[63749]=Ft(63749,"unknown_f905",void 0,[],void 0),qt[63750]=Ft(63750,"unknown_f906",void 0,[],void 0),qt[63751]=Ft(63751,"unknown_f907",void 0,[],void 0),qt[63752]=Ft(63752,"fadd",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0)),Io=qt[63753]=Ft(63753,"faddi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),jo=qt[63754]=Ft(63754,"fsub",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),xo=qt[63755]=Ft(63755,"fsubi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),To=qt[63756]=Ft(63756,"fmul",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),So=qt[63757]=Ft(63757,"fmuli",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Co=qt[63758]=Ft(63758,"fdiv",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Read)]},void 0,void 0)],void 0),Oo=qt[63759]=Ft(63759,"fdivi",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(Rt,void 0,Et.Write)]},void 0,void 0),Wt(Rt,void 0,void 0)],void 0),Lo=(qt[63760]=Ft(63760,"get_unknown_count",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63761]=Ft(63761,"get_stackable_item_count",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Player slot.",Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read),Wt(yt,void 0,Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63762]=Ft(63762,"freeze_and_hide_equip",void 0,[],void 0),qt[63763]=Ft(63763,"thaw_and_show_equip",void 0,[],void 0),qt[63764]=Ft(63764,"set_palettex_callback",void 0,[Wt(yt,"Player slot.",void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63765]=Ft(63765,"activate_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63766]=Ft(63766,"enable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63767]=Ft(63767,"restore_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63768]=Ft(63768,"disable_palettex",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63769]=Ft(63769,"get_palettex_activated",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63770]=Ft(63770,"get_unknown_palettex_status",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63771]=Ft(63771,"disable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63772]=Ft(63772,"enable_movement2",void 0,[Wt(yt,"Player slot.",void 0)],Mt.Pop),qt[63773]=Ft(63773,"get_time_played",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63774]=Ft(63774,"get_guildcard_total",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63775]=Ft(63775,"get_slot_meseta",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63776]=Ft(63776,"get_player_level",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63777]=Ft(63777,"get_section_id",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63778]=Ft(63778,"get_player_hp",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,"Maximum HP.",Et.Write),Wt(yt,"Current HP.",Et.Write),Wt(yt,"Maximum TP.",Et.Write),Wt(yt,"Current TP.",Et.Write)]},void 0,void 0)],Mt.Pop),qt[63779]=Ft(63779,"get_floor_number",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63780]=Ft(63780,"get_coord_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,"Player slot.",Et.Read)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Read)]},void 0,void 0)],void 0),qt[63781]=Ft(63781,"read_global_flag",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63782]=Ft(63782,"write_global_flag",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63783]=Ft(63783,"unknown_f927",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63784]=Ft(63784,"floor_player_detect",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write),Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63785]=Ft(63785,"read_disk_file",void 0,[Wt(St,void 0,void 0)],Mt.Pop),qt[63786]=Ft(63786,"open_pack_select",void 0,[],void 0),qt[63787]=Ft(63787,"item_select",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63788]=Ft(63788,"get_item_id",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63789]=Ft(63789,"color_change",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63790]=Ft(63790,"send_statistic",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63791]=Ft(63791,"unknown_f92f",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63792]=Ft(63792,"chat_box",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63793]=Ft(63793,"chat_bubble",void 0,[Wt(yt,void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63794]=Ft(63794,"unknown_f932",void 0,[],void 0),qt[63795]=Ft(63795,"unknown_f933",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63796]=Ft(63796,"scroll_text",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63797]=Ft(63797,"gba_unknown1",void 0,[],void 0),qt[63798]=Ft(63798,"gba_unknown2",void 0,[],void 0),qt[63799]=Ft(63799,"gba_unknown3",void 0,[],void 0),qt[63800]=Ft(63800,"add_damage_to",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63801]=Ft(63801,"item_delete3",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63802]=Ft(63802,"get_item_info",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63803]=Ft(63803,"item_packing1",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63804]=Ft(63804,"item_packing2",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63805]=Ft(63805,"get_lang_setting",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(mt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63806]=Ft(63806,"prepare_statistic",void 0,[Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63807]=Ft(63807,"keyword_detect",void 0,[],void 0),qt[63808]=Ft(63808,"keyword",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,"Player slot.",void 0),Wt(St,void 0,void 0)],Mt.Pop),qt[63809]=Ft(63809,"get_guildcard_num",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63810]=Ft(63810,"unknown_f942",void 0,[],void 0),qt[63811]=Ft(63811,"unknown_f943",void 0,[],void 0),qt[63812]=Ft(63812,"get_wrap_status",void 0,[Wt(yt,"Player slot.",void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63813]=Ft(63813,"initial_floor",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63814]=Ft(63814,"sin",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63815]=Ft(63815,"cos",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0)],Mt.Pop),qt[63816]=Ft(63816,"unknown_f948",void 0,[],void 0),qt[63817]=Ft(63817,"unknown_f949",void 0,[],void 0),qt[63818]=Ft(63818,"boss_is_dead2",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63819]=Ft(63819,"unknown_f94b",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63820]=Ft(63820,"unknown_f94c",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63821]=Ft(63821,"is_there_cardbattle",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63822]=Ft(63822,"unknown_f94e",void 0,[],void 0),qt[63823]=Ft(63823,"unknown_f94f",void 0,[],void 0),qt[63824]=Ft(63824,"bb_p2_menu",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63825]=Ft(63825,"bb_map_designate",void 0,[Wt(wt,void 0,void 0),Wt(kt,void 0,void 0),Wt(wt,void 0,void 0),Wt(wt,void 0,void 0)],void 0));qt[63826]=Ft(63826,"bb_get_number_in_pack",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],void 0),qt[63827]=Ft(63827,"bb_swap_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63828]=Ft(63828,"bb_check_wrap",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0)],Mt.Pop),qt[63829]=Ft(63829,"bb_exchange_pd_item",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63830]=Ft(63830,"bb_exchange_pd_srank",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63831]=Ft(63831,"bb_exchange_pd_special",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63832]=Ft(63832,"bb_exchange_pd_percent",void 0,[Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63833]=Ft(63833,"unknown_f959",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63834]=Ft(63834,"unknown_f95a",void 0,[],void 0),qt[63835]=Ft(63835,"unknown_f95b",void 0,[],void 0),qt[63836]=Ft(63836,"bb_exchange_slt",void 0,[Wt(yt,void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63837]=Ft(63837,"bb_exchange_pc",void 0,[],void 0),qt[63838]=Ft(63838,"bb_box_create_bp",void 0,[Wt(yt,void 0,void 0),Wt(Rt,void 0,void 0),Wt(Rt,void 0,void 0)],Mt.Pop),qt[63839]=Ft(63839,"bb_exchange_pt",void 0,[Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt({kind:ft.RegTupRef,register_tuples:[Wt(yt,void 0,Et.Write)]},void 0,void 0),Wt(yt,void 0,void 0),Wt(jt,void 0,void 0),Wt(jt,void 0,void 0)],Mt.Pop),qt[63840]=Ft(63840,"unknown_f960",void 0,[Wt(yt,void 0,void 0)],Mt.Pop),qt[63841]=Ft(63841,"unknown_f961",void 0,[],void 0),qt[63842]=Ft(63842,"unknown_f962",void 0,[],void 0),qt[63843]=Ft(63843,"unknown_f963",void 0,[],void 0),qt[63844]=Ft(63844,"unknown_f964",void 0,[],void 0),qt[63845]=Ft(63845,"unknown_f965",void 0,[],void 0),qt[63846]=Ft(63846,"unknown_f966",void 0,[],void 0),qt[63847]=Ft(63847,"unknown_f967",void 0,[],void 0),qt[63848]=Ft(63848,"unknown_f968",void 0,[],void 0),qt[63849]=Ft(63849,"unknown_f969",void 0,[],void 0),qt[63850]=Ft(63850,"unknown_f96a",void 0,[],void 0),qt[63851]=Ft(63851,"unknown_f96b",void 0,[],void 0),qt[63852]=Ft(63852,"unknown_f96c",void 0,[],void 0),qt[63853]=Ft(63853,"unknown_f96d",void 0,[],void 0),qt[63854]=Ft(63854,"unknown_f96e",void 0,[],void 0),qt[63855]=Ft(63855,"unknown_f96f",void 0,[],void 0),qt[63856]=Ft(63856,"unknown_f970",void 0,[],void 0),qt[63857]=Ft(63857,"unknown_f971",void 0,[],void 0),qt[63858]=Ft(63858,"unknown_f972",void 0,[],void 0),qt[63859]=Ft(63859,"unknown_f973",void 0,[],void 0),qt[63860]=Ft(63860,"unknown_f974",void 0,[],void 0),qt[63861]=Ft(63861,"unknown_f975",void 0,[],void 0),qt[63862]=Ft(63862,"unknown_f976",void 0,[],void 0),qt[63863]=Ft(63863,"unknown_f977",void 0,[],void 0),qt[63864]=Ft(63864,"unknown_f978",void 0,[],void 0),qt[63865]=Ft(63865,"unknown_f979",void 0,[],void 0),qt[63866]=Ft(63866,"unknown_f97a",void 0,[],void 0),qt[63867]=Ft(63867,"unknown_f97b",void 0,[],void 0),qt[63868]=Ft(63868,"unknown_f97c",void 0,[],void 0),qt[63869]=Ft(63869,"unknown_f97d",void 0,[],void 0),qt[63870]=Ft(63870,"unknown_f97e",void 0,[],void 0),qt[63871]=Ft(63871,"unknown_f97f",void 0,[],void 0),qt[63872]=Ft(63872,"unknown_f980",void 0,[],void 0),qt[63873]=Ft(63873,"unknown_f981",void 0,[],void 0),qt[63874]=Ft(63874,"unknown_f982",void 0,[],void 0),qt[63875]=Ft(63875,"unknown_f983",void 0,[],void 0),qt[63876]=Ft(63876,"unknown_f984",void 0,[],void 0),qt[63877]=Ft(63877,"unknown_f985",void 0,[],void 0),qt[63878]=Ft(63878,"unknown_f986",void 0,[],void 0),qt[63879]=Ft(63879,"unknown_f987",void 0,[],void 0),qt[63880]=Ft(63880,"unknown_f988",void 0,[],void 0),qt[63881]=Ft(63881,"unknown_f989",void 0,[],void 0),qt[63882]=Ft(63882,"unknown_f98a",void 0,[],void 0),qt[63883]=Ft(63883,"unknown_f98b",void 0,[],void 0),qt[63884]=Ft(63884,"unknown_f98c",void 0,[],void 0),qt[63885]=Ft(63885,"unknown_f98d",void 0,[],void 0),qt[63886]=Ft(63886,"unknown_f98e",void 0,[],void 0),qt[63887]=Ft(63887,"unknown_f98f",void 0,[],void 0),qt[63888]=Ft(63888,"unknown_f990",void 0,[],void 0),qt[63889]=Ft(63889,"unknown_f991",void 0,[],void 0),qt[63890]=Ft(63890,"unknown_f992",void 0,[],void 0),qt[63891]=Ft(63891,"unknown_f993",void 0,[],void 0),qt[63892]=Ft(63892,"unknown_f994",void 0,[],void 0),qt[63893]=Ft(63893,"unknown_f995",void 0,[],void 0),qt[63894]=Ft(63894,"unknown_f996",void 0,[],void 0),qt[63895]=Ft(63895,"unknown_f997",void 0,[],void 0),qt[63896]=Ft(63896,"unknown_f998",void 0,[],void 0),qt[63897]=Ft(63897,"unknown_f999",void 0,[],void 0),qt[63898]=Ft(63898,"unknown_f99a",void 0,[],void 0),qt[63899]=Ft(63899,"unknown_f99b",void 0,[],void 0),qt[63900]=Ft(63900,"unknown_f99c",void 0,[],void 0),qt[63901]=Ft(63901,"unknown_f99d",void 0,[],void 0),qt[63902]=Ft(63902,"unknown_f99e",void 0,[],void 0),qt[63903]=Ft(63903,"unknown_f99f",void 0,[],void 0),qt[63904]=Ft(63904,"unknown_f9a0",void 0,[],void 0),qt[63905]=Ft(63905,"unknown_f9a1",void 0,[],void 0),qt[63906]=Ft(63906,"unknown_f9a2",void 0,[],void 0),qt[63907]=Ft(63907,"unknown_f9a3",void 0,[],void 0),qt[63908]=Ft(63908,"unknown_f9a4",void 0,[],void 0),qt[63909]=Ft(63909,"unknown_f9a5",void 0,[],void 0),qt[63910]=Ft(63910,"unknown_f9a6",void 0,[],void 0),qt[63911]=Ft(63911,"unknown_f9a7",void 0,[],void 0),qt[63912]=Ft(63912,"unknown_f9a8",void 0,[],void 0),qt[63913]=Ft(63913,"unknown_f9a9",void 0,[],void 0),qt[63914]=Ft(63914,"unknown_f9aa",void 0,[],void 0),qt[63915]=Ft(63915,"unknown_f9ab",void 0,[],void 0),qt[63916]=Ft(63916,"unknown_f9ac",void 0,[],void 0),qt[63917]=Ft(63917,"unknown_f9ad",void 0,[],void 0),qt[63918]=Ft(63918,"unknown_f9ae",void 0,[],void 0),qt[63919]=Ft(63919,"unknown_f9af",void 0,[],void 0),qt[63920]=Ft(63920,"unknown_f9b0",void 0,[],void 0),qt[63921]=Ft(63921,"unknown_f9b1",void 0,[],void 0),qt[63922]=Ft(63922,"unknown_f9b2",void 0,[],void 0),qt[63923]=Ft(63923,"unknown_f9b3",void 0,[],void 0),qt[63924]=Ft(63924,"unknown_f9b4",void 0,[],void 0),qt[63925]=Ft(63925,"unknown_f9b5",void 0,[],void 0),qt[63926]=Ft(63926,"unknown_f9b6",void 0,[],void 0),qt[63927]=Ft(63927,"unknown_f9b7",void 0,[],void 0),qt[63928]=Ft(63928,"unknown_f9b8",void 0,[],void 0),qt[63929]=Ft(63929,"unknown_f9b9",void 0,[],void 0),qt[63930]=Ft(63930,"unknown_f9ba",void 0,[],void 0),qt[63931]=Ft(63931,"unknown_f9bb",void 0,[],void 0),qt[63932]=Ft(63932,"unknown_f9bc",void 0,[],void 0),qt[63933]=Ft(63933,"unknown_f9bd",void 0,[],void 0),qt[63934]=Ft(63934,"unknown_f9be",void 0,[],void 0),qt[63935]=Ft(63935,"unknown_f9bf",void 0,[],void 0),qt[63936]=Ft(63936,"unknown_f9c0",void 0,[],void 0),qt[63937]=Ft(63937,"unknown_f9c1",void 0,[],void 0),qt[63938]=Ft(63938,"unknown_f9c2",void 0,[],void 0),qt[63939]=Ft(63939,"unknown_f9c3",void 0,[],void 0),qt[63940]=Ft(63940,"unknown_f9c4",void 0,[],void 0),qt[63941]=Ft(63941,"unknown_f9c5",void 0,[],void 0),qt[63942]=Ft(63942,"unknown_f9c6",void 0,[],void 0),qt[63943]=Ft(63943,"unknown_f9c7",void 0,[],void 0),qt[63944]=Ft(63944,"unknown_f9c8",void 0,[],void 0),qt[63945]=Ft(63945,"unknown_f9c9",void 0,[],void 0),qt[63946]=Ft(63946,"unknown_f9ca",void 0,[],void 0),qt[63947]=Ft(63947,"unknown_f9cb",void 0,[],void 0),qt[63948]=Ft(63948,"unknown_f9cc",void 0,[],void 0),qt[63949]=Ft(63949,"unknown_f9cd",void 0,[],void 0),qt[63950]=Ft(63950,"unknown_f9ce",void 0,[],void 0),qt[63951]=Ft(63951,"unknown_f9cf",void 0,[],void 0),qt[63952]=Ft(63952,"unknown_f9d0",void 0,[],void 0),qt[63953]=Ft(63953,"unknown_f9d1",void 0,[],void 0),qt[63954]=Ft(63954,"unknown_f9d2",void 0,[],void 0),qt[63955]=Ft(63955,"unknown_f9d3",void 0,[],void 0),qt[63956]=Ft(63956,"unknown_f9d4",void 0,[],void 0),qt[63957]=Ft(63957,"unknown_f9d5",void 0,[],void 0),qt[63958]=Ft(63958,"unknown_f9d6",void 0,[],void 0),qt[63959]=Ft(63959,"unknown_f9d7",void 0,[],void 0),qt[63960]=Ft(63960,"unknown_f9d8",void 0,[],void 0),qt[63961]=Ft(63961,"unknown_f9d9",void 0,[],void 0),qt[63962]=Ft(63962,"unknown_f9da",void 0,[],void 0),qt[63963]=Ft(63963,"unknown_f9db",void 0,[],void 0),qt[63964]=Ft(63964,"unknown_f9dc",void 0,[],void 0),qt[63965]=Ft(63965,"unknown_f9dd",void 0,[],void 0),qt[63966]=Ft(63966,"unknown_f9de",void 0,[],void 0),qt[63967]=Ft(63967,"unknown_f9df",void 0,[],void 0),qt[63968]=Ft(63968,"unknown_f9e0",void 0,[],void 0),qt[63969]=Ft(63969,"unknown_f9e1",void 0,[],void 0),qt[63970]=Ft(63970,"unknown_f9e2",void 0,[],void 0),qt[63971]=Ft(63971,"unknown_f9e3",void 0,[],void 0),qt[63972]=Ft(63972,"unknown_f9e4",void 0,[],void 0),qt[63973]=Ft(63973,"unknown_f9e5",void 0,[],void 0),qt[63974]=Ft(63974,"unknown_f9e6",void 0,[],void 0),qt[63975]=Ft(63975,"unknown_f9e7",void 0,[],void 0),qt[63976]=Ft(63976,"unknown_f9e8",void 0,[],void 0),qt[63977]=Ft(63977,"unknown_f9e9",void 0,[],void 0),qt[63978]=Ft(63978,"unknown_f9ea",void 0,[],void 0),qt[63979]=Ft(63979,"unknown_f9eb",void 0,[],void 0),qt[63980]=Ft(63980,"unknown_f9ec",void 0,[],void 0),qt[63981]=Ft(63981,"unknown_f9ed",void 0,[],void 0),qt[63982]=Ft(63982,"unknown_f9ee",void 0,[],void 0),qt[63983]=Ft(63983,"unknown_f9ef",void 0,[],void 0),qt[63984]=Ft(63984,"unknown_f9f0",void 0,[],void 0),qt[63985]=Ft(63985,"unknown_f9f1",void 0,[],void 0),qt[63986]=Ft(63986,"unknown_f9f2",void 0,[],void 0),qt[63987]=Ft(63987,"unknown_f9f3",void 0,[],void 0),qt[63988]=Ft(63988,"unknown_f9f4",void 0,[],void 0),qt[63989]=Ft(63989,"unknown_f9f5",void 0,[],void 0),qt[63990]=Ft(63990,"unknown_f9f6",void 0,[],void 0),qt[63991]=Ft(63991,"unknown_f9f7",void 0,[],void 0),qt[63992]=Ft(63992,"unknown_f9f8",void 0,[],void 0),qt[63993]=Ft(63993,"unknown_f9f9",void 0,[],void 0),qt[63994]=Ft(63994,"unknown_f9fa",void 0,[],void 0),qt[63995]=Ft(63995,"unknown_f9fb",void 0,[],void 0),qt[63996]=Ft(63996,"unknown_f9fc",void 0,[],void 0),qt[63997]=Ft(63997,"unknown_f9fd",void 0,[],void 0),qt[63998]=Ft(63998,"unknown_f9fe",void 0,[],void 0),qt[63999]=Ft(63999,"unknown_f9ff",void 0,[],void 0);function Po(e,t,i){const o=Math.min(e.params.length,t.length),s=[];let n=0;for(let i=0;iObject.assign({},e))};switch(e.type){case Bo.Instructions:return{type:Bo.Instructions,labels:t,instructions:e.instructions.map(e=>(function(e){return{opcode:e.opcode,args:e.args.map(e=>Object.assign({},e)),arg_size:e.arg_size,size:e.size,param_to_args:e.param_to_args.map(e=>e.map(e=>Object.assign({},e))),asm:e.asm}})(e)),asm:i};case Bo.Data:return{type:Bo.Data,labels:t,data:e.data.slice(0),asm:i};case Bo.String:return{type:Bo.String,labels:t,value:e.value,asm:i}}}qt.forEach(e=>{zt.set(e.mnemonic,e)}),function(e){e[e.Instructions=0]="Instructions",e[e.Data=1]="Data",e[e.String=2]="String"}(Bo||(Bo={}));const Mo={add:(e,t)=>e+t,sub:(e,t)=>e-t,mul:(e,t)=>e*t,div:(e,t)=>e/t,idiv:(e,t)=>Math.floor(e/t),mod:(e,t)=>e%t,and:(e,t)=>e&t,or:(e,t)=>e|t,xor:(e,t)=>e^t,shl:(e,t)=>e<e>>>t};function Wo(e,t,i){if(e(t,i))return i}function qo(e){return e.slice(1)}const zo=X.c.get("quest_editor/scripting/vm/io");class Fo{bb_map_designate(e,t){zo.warn(`bb_map_designate(${e}, ${t})`)}set_floor_handler(e,t){zo.warn(`set_floor_handler(${e}, ${t})`)}window_msg(e){zo.warn(`window_msg("${e}")`)}message(e){zo.warn(`message("${e}")`)}add_msg(e){zo.warn(`add_msg("${e}")`)}winend(){zo.warn("winend")}p_dead_v3(e){return zo.warn(`p_dead_v3(${e})`),!1}mesend(){zo.warn("mesend")}list(e){zo.warn(`list([${e.map(e=>`"${e}"`).join(", ")}])`)}warning(e,t){var i;zo.warn(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}error(e,t){var i;zo.error(e+this.srcloc_to_string(null===(i=t)||void 0===i?void 0:i.source_location))}srcloc_to_string(e){return e?` [${e.line_no}:${e.col}]`:" "}}var Vo=i("bcBH");class Uo{constructor(e=Math.floor(performance.now())){this.holdrand=e}next(){const e=214013*this.holdrand+2531011>>>0;return this.holdrand=e,e>>>16&32767}}var $o=i("NRxM");class No extends $o.a{constructor(e,t){super(new ArrayBuffer(e),t)}zero(){new Uint32Array(this.backing_buffer).fill(0)}}class Ao{constructor(e,t,i){Object(U.c)(e>=0,"seg_idx should be greater or equal to 0."),Object(U.c)(e=0,"inst_idx should be greater or equal to 0."),Object(U.c)(t=Go)throw new Error("Argument stack: Stack overflow");this.arg_stack.write_u32_at(this.arg_stack_counter*Ho,e),this.arg_stack_types[this.arg_stack_counter]=t,this.arg_stack_counter++}fetch_args(e){const t=e.instruction;if(t.opcode.stack!==Mt.Pop)return[];const i=[];t.opcode.params.length!==this.arg_stack_counter&&this.io.warning("Argument stack: Argument count mismatch.",e);for(let o=0;o0&&i.push(this.arg_stack.u8_at(n));break;default:throw new Error(`Argument stack: Unhandled parameter kind: ${ft[s.type.kind]}.`)}}return this.arg_stack_counter=0,i}check_arg_type(e,t,i){let o;switch(e){case ft.Any:o=!0;break;case ft.Byte:case ft.Word:case ft.DWord:case ft.Float:case ft.String:case ft.Pointer:o=t===e;break;case ft.Label:case ft.ILabel:case ft.ILabelVar:case ft.DLabel:case ft.SLabel:o=t===ft.Word;break;case ft.RegRef:case ft.RegTupRef:case ft.RegRefVar:o=t===ft.Byte}o||this.io.warning(`Argument stack: Argument type mismatch, expected ${ft[e]} but received ${ft[t]}.`,i)}}Qo.next_id=0;const Zo=256,Jo=4,Xo=16,es=11085568,ts=1024,is=0,os="\n",ss=X.c.get("quest_editor/scripting/vm/VirtualMachine");var ns;!function(e){e[e.Suspended=0]="Suspended",e[e.Paused=1]="Paused",e[e.WaitingVsync=2]="WaitingVsync",e[e.WaitingInput=3]="WaitingInput",e[e.WaitingSelection=4]="WaitingSelection",e[e.Halted=5]="Halted"}(ns||(ns={}));class rs{constructor(e=new Fo,t=new Uo){this.io=e,this.random=t,this.episode=r.b.I,this._object_code=[],this.label_to_seg_idx=new Map,this.registers=new No(Zo*Jo,Vo.a.Little),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.breakpoints=[],this.paused=!1,this.unsupported_opcodes_logged=new Set}get object_code(){return this._object_code}get halted(){return this._halted}set step_mode(e){if(null!=e){const t=this.current_thread();t&&(t.step_mode=e)}}load_object_code(e,t){this.halt(),ss.debug("Starting."),this._object_code=e,this.episode=t,this.label_to_seg_idx.clear();let i=0;for(const e of this._object_code){for(const t of e.labels)this.label_to_seg_idx.set(t,i);i++}this._halted=!1}start_thread(e,t){const i=this.get_segment_index_by_label(e),o=this._object_code[i];if(o.type!==Bo.Instructions)throw new Error(`Label ${e} points to a ${Bo[o.type]} segment, expecting ${Bo[Bo.Instructions]}.`);this.threads.push(new Qo(this.io,new Ao(i,0,this.object_code),t))}execute(){var e,t,i;if(this._halted)return ns.Halted;let o;try{let s=0;for(;s++<1e4;){if(this.threads.length>=1&&this.thread_idx>=this.threads.length)return ns.WaitingVsync;const s=this.current_thread();if(!s)return ns.Suspended;const n=s.current_stack_frame();o=n.instruction_pointer;const r=o.instruction;if(!this.paused)switch(s.step_mode){case Yo.BreakPoint:if(-1!==this.breakpoints.findIndex(e=>e.equals(o)))return this.paused=!0,ns.Paused;break;case Yo.Over:if(s.step_frame&&n.idx<=s.step_frame.idx&&(null===(e=r.asm)||void 0===e?void 0:e.mnemonic))return this.paused=!0,ns.Paused;break;case Yo.In:if(null===(t=r.asm)||void 0===t?void 0:t.mnemonic)return this.paused=!0,ns.Paused;break;case Yo.Out:if(s.step_frame&&n.idx=this.threads.length&&(this.thread_idx=0)}halt(){this._halted||(ss.debug("Halting."),this.registers.zero(),this.string_arg_store="",this.threads=[],this.thread_idx=0,this.window_msg_open=!1,this.set_episode_called=!1,this.list_open=!1,this.selection_reg=0,this._halted=!0,this.paused=!1,this.breakpoints.splice(0,1/0),this.unsupported_opcodes_logged.clear())}get_current_stack_frame(){var e;return null===(e=this.current_thread())||void 0===e?void 0:e.current_stack_frame()}get_instruction_pointer(){var e;return null===(e=this.get_current_stack_frame())||void 0===e?void 0:e.instruction_pointer}get_segment_index_by_label(e){if(!this.label_to_seg_idx.has(e))throw new Error(`Invalid argument: No such label ${e}.`);return this.label_to_seg_idx.get(e)}list_select(e){if(!this.list_open)throw new Error("list_select may not be called if there is no list open");this.set_register_unsigned(this.selection_reg,e)}set_breakpoint(e){-1===this.breakpoints.findIndex(t=>t.equals(e))&&this.breakpoints.push(e)}remove_breakpoint(e){const t=this.breakpoints.findIndex(t=>t.equals(e));-1!==t&&this.breakpoints.splice(t,1)}current_thread(){return this.threads[this.thread_idx]}terminate_thread(e){this.threads.splice(e,1),this.thread_idx>=e&&this.thread_idx>0&&this.thread_idx--}advance(e){const t=e.current_stack_frame();if(!t)return;const i=t.instruction_pointer.next();i?e.set_current_instruction_pointer(i):(e.pop_call_stack(),this.terminate_thread(this.thread_idx))}execute_instruction(e,t){const i=t.instruction;let o=void 0,s=!0;const n=i.args.map(e=>e.value),[a,d,c,l]=n;this.list_open&&(this.list_open=!1);const _=e.fetch_args(t);switch(i.opcode.code){case Vt.code:break;case Ut.code:this.pop_call_stack(this.thread_idx);break;case $t.code:o=ns.WaitingVsync,this.advance(e),this.thread_idx++,s=!1;break;case Nt.code:this.halt();break;case At.code:this.start_thread(a);break;case Kt.code:this.set_register_signed(a,this.get_register_signed(d));break;case Qt.code:this.set_register_signed(a,d);break;case Zt.code:this.set_register_byte(a,d);break;case Jt.code:this.set_register_word(a,d);break;case Xt.code:this.set_register_unsigned(a,this.get_register_address(a));break;case ko.code:this.set_register_float(a,this.get_register_float(d));break;case yo.code:this.set_register_float(a,d);break;case ei.code:this.set_register_signed(a,1);break;case ti.code:this.set_register_signed(a,0);break;case ii.code:this.set_register_signed(a,0===this.get_register_signed(a)?1:0);break;case wi.code:this.push_call_stack(e,a),s=!1;break;case mi.code:this.jump_to_label(e,a),s=!1;break;case Ki.code:e.push_arg(this.get_register_signed(a),ft.DWord);break;case Qi.code:e.push_arg(i.args[0].value,ft.DWord);break;case Zi.code:e.push_arg(i.args[0].value,ft.Byte);break;case Ji.code:e.push_arg(i.args[0].value,ft.Word);break;case Xi.code:e.push_arg(this.get_register_address(i.args[0].value),ft.DWord);break;case to.code:if("string"==typeof a){const t=this.parse_template_string(a);this.string_arg_store=t.slice(0,ts/2),e.push_arg(es,ft.String)}break;case oi.code:this.do_integer_op_with_register(a,d,Mo.add);break;case si.code:this.do_integer_op_with_literal(a,d,Mo.add);break;case ni.code:this.do_integer_op_with_register(a,d,Mo.sub);break;case ri.code:this.do_integer_op_with_literal(a,d,Mo.sub);break;case ai.code:this.do_integer_op_with_register(a,d,Mo.mul);break;case di.code:this.do_integer_op_with_literal(a,d,Mo.mul);break;case ci.code:this.do_integer_op_with_register(a,d,Mo.idiv);break;case li.code:this.do_integer_op_with_literal(a,d,Mo.idiv);break;case bi.code:this.do_integer_op_with_register(a,d,Mo.mod);break;case fi.code:this.do_integer_op_with_literal(a,d,Mo.mod);break;case Ro.code:this.do_float_op_with_register(a,d,Mo.add);break;case Io.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.add);break;case jo.code:this.do_float_op_with_register(a,d,Mo.sub);break;case xo.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.sub);break;case To.code:this.do_float_op_with_register(a,d,Mo.mul);break;case So.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.mul);break;case Co.code:this.do_float_op_with_register(a,d,Mo.div);break;case Oo.code:this.do_float_op_with_literal(a,Math.fround(d),Mo.div);break;case _i.code:this.do_integer_op_with_register(a,d,Mo.and);break;case ui.code:this.do_integer_op_with_literal(a,d,Mo.and);break;case vi.code:this.do_integer_op_with_register(a,d,Mo.or);break;case hi.code:this.do_integer_op_with_literal(a,d,Mo.or);break;case pi.code:this.do_integer_op_with_register(a,d,Mo.xor);break;case gi.code:this.do_integer_op_with_literal(a,d,Mo.xor);break;case bo.code:this.do_integer_op_with_register(a,d,Mo.shl);break;case fo.code:this.do_integer_op_with_register(a,d,Mo.shr);break;case ki.code:this.conditional_jump(e,a,(e,t)=>e===t,1,...qo(n).map(e=>this.get_register_signed(e))),s=!1;break;case yi.code:this.conditional_jump(e,a,(e,t)=>e===t,0,...qo(n).map(e=>this.get_register_signed(e))),s=!1;break;case Ri.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e===t,a,d),s=!1;break;case Ii.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e===t,a,d),s=!1;break;case ji.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e!==t,a,d),s=!1;break;case xi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e!==t,a,d),s=!1;break;case Ti.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),s=!1;break;case Si.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),s=!1;break;case Ci.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>t,a,d),s=!1;break;case Oi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>t,a,d),s=!1;break;case Li.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>eeeee>=t,a,d),s=!1;break;case Mi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),s=!1;break;case Wi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e>=t,a,d),s=!1;break;case qi.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e>=t,a,d),s=!1;break;case zi.code:this.unsigned_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Fi.code:this.unsigned_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Vi.code:this.signed_cond_jump_with_register(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Ui.code:this.signed_cond_jump_with_literal(e,c,(e,t)=>e<=t,a,d),s=!1;break;case Ai.code:this.push_variable_stack(e,a,1);break;case Hi.code:this.pop_variable_stack(e,a,1);break;case Gi.code:this.push_variable_stack(e,a,d);break;case Yi.code:this.pop_variable_stack(e,a,d);break;case io.code:if(!this.window_msg_open){const e=this.deref_string(_[1]).split(os);o=ns.WaitingSelection,this.list_open=!0,this.selection_reg=_[0],this.io.list(e)}break;case oo.code:if(!this.window_msg_open){const e=this.deref_string(_[0]);o=ns.WaitingInput,this.window_msg_open=!0,this.io.window_msg(e)}break;case so.code:if(this.window_msg_open){const e=this.deref_string(_[0]);o=ns.WaitingInput,this.io.add_msg(e)}break;case no.code:this.set_register_unsigned(a,Math.floor(Date.now()/1e3));break;case ro.code:this.window_msg_open&&(this.window_msg_open=!1,this.io.winend());break;case ao.code:this.set_register_signed(_[0],this.io.p_dead_v3(_[1])?1:0);break;case lo.code:this.io.set_floor_handler(_[0],_[1]);break;case _o.code:this.start_thread(a);break;case mo.code:{const e=this.get_register_signed(a),t=this.get_register_signed(a+1),i=this.random.next();let o=Math.floor(Math.fround(i/32768)*t);e>=o&&(o=e),this.set_register_signed(d,o)}break;case wo.code:if(this.set_episode_called){this.io.warning("Calling set_episode more than once is not supported.",t);break}if(this.set_episode_called=!0,!this._object_code[t.seg_idx].labels.includes(is)){this.io.warning(`Calling set_episode outside of segment ${is} is not supported.`,t);break}if(function(e){switch(e){case r.b.I:return 0;case r.b.II:return 1;case r.b.IV:return 2}}(this.episode)!==a){this.io.warning("Calling set_episode with an argument that does notmatch the quest's designated episode is not supported.",t);break}break;case Lo.code:this.io.bb_map_designate(a,d,c,l);break;default:this.unsupported_opcodes_logged.has(i.opcode.code)||(this.unsupported_opcodes_logged.add(i.opcode.code),this.io.warning("Unsupported instruction.",t))}return s&&this.advance(e),o}get_register_signed(e){return this.registers.i32_at(Jo*e)}set_register_signed(e,t){this.registers.write_i32_at(Jo*e,t)}get_register_unsigned(e){return this.registers.u32_at(Jo*e)}set_register_unsigned(e,t){this.registers.write_u32_at(Jo*e,t)}get_register_word(e){return this.registers.u16_at(Jo*e)}set_register_word(e,t){this.registers.write_u16_at(Jo*e,t)}get_register_byte(e){return this.registers.u8_at(Jo*e)}set_register_byte(e,t){this.registers.write_u8_at(Jo*e,t)}get_register_float(e){return this.registers.f32_at(Jo*e)}set_register_float(e,t){this.registers.write_f32_at(Jo*e,t)}do_integer_op_with_register(e,t,i){this.do_integer_op_with_literal(e,this.get_register_signed(t),i)}do_integer_op_with_literal(e,t,i){if((i===Mo.div||i===Mo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_signed(e,i(this.get_register_signed(e),t))}do_float_op_with_register(e,t,i){this.do_float_op_with_literal(e,this.get_register_float(t),i)}do_float_op_with_literal(e,t,i){if((i===Mo.div||i===Mo.idiv)&&0===t)throw new Error("Division by zero");this.set_register_float(e,i(this.get_register_float(e),t))}push_call_stack(e,t){const i=this.get_segment_index_by_label(t),o=this._object_code[i];if(o.type!==Bo.Instructions)throw new Error(`Label ${t} points to a ${Bo[o.type]} segment, expecting ${Bo[Bo.Instructions]}.`);e.push_frame(new Ao(i,0,this.object_code))}pop_call_stack(e){this.threads[e].pop_call_stack(),0===this.threads[e].call_stack.length&&this.terminate_thread(e)}jump_to_label(e,t){e.set_current_instruction_pointer(new Ao(this.get_segment_index_by_label(t),0,this.object_code))}signed_cond_jump_with_register(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_signed(o),this.get_register_signed(s))}signed_cond_jump_with_literal(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_signed(o),s)}unsigned_cond_jump_with_register(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_unsigned(o),this.get_register_unsigned(s))}unsigned_cond_jump_with_literal(e,t,i,o,s){this.conditional_jump(e,t,i,this.get_register_unsigned(o),s)}conditional_jump(e,t,i,...o){const s=Wo.bind(null,i);var n;void 0!==function(e,t,i){let o=t;for(const t of i){const i=e(o,t);if(void 0===i)return;o=i}return o}(s,(n=o)[0],n.slice(1))?this.jump_to_label(e,t):this.advance(e)}push_variable_stack(e,t,i){const o=t+i;if(o>Zo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length+i>Xo)throw new Error("Variable stack: Stack overflow");for(let i=t;iZo)throw new Error("Variable stack: Invalid register");if(e.variable_stack.length=t;i--)this.set_register_unsigned(i,e.variable_stack.pop())}get_register_address(e){return e*Jo}deref_string(e){if(e===es)return this.string_arg_store;if(e>0&&e``],[/^r([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_unsigned(t).toString()}],[/^f([0-9]{1,3})$/,e=>{const t=parseInt(e);return isNaN(t)?"":this.get_register_float(t).toFixed(6)}]];let o=!1,s=-1,n=0,r=e.length;for(;n"===a){o=!1;const a=n,d=e.slice(s+1,a);let c=void 0;for(const[e,t]of i){const i=e.exec(d);if(i&&void 0!==i[1]){c=t(i[1]);break}}if(void 0===c&&(c=t[d]),void 0===c)c="";else if("function"==typeof c){const e=c();t[d]=e,c=e}e=e.slice(0,s)+c+e.slice(a+1);const l=c.length-(d.length+2);n+=l,r+=l}else"<"===a&&(o=!0,s=n);n++}return o&&(e=e.slice(0,s)),e}}i("PNEq");var as,ds=i("sv1z");!function(e){e[e.Signed=0]="Signed",e[e.Unsigned=1]="Unsigned",e[e.Word=2]="Word",e[e.Byte=3]="Byte",e[e.Float=4]="Float"}(as||(as={}));class cs extends o.a{constructor(e){super(),this.quest_runner=e,this.type_select=this.disposable(new ds.a({label:"Display type:",tooltip:"Select which data type register values should be displayed as.",items:[as.Signed,as.Unsigned,as.Word,as.Byte,as.Float],to_label:e=>as[e]})),this.register_getter=this.get_register_getter(as.Signed),this.hex_checkbox=this.disposable(new $e.a(!1,{label:"Hex",tooltip:"Display register values in hexadecimal."})),this.settings_bar=this.disposable(new Ue.a(this.type_select,this.hex_checkbox)),this.list_element=Object(v.i)({className:"quest_editor_RegistersView_list"}),this.container_element=Object(v.i)({className:"quest_editor_RegistersView_container"},this.list_element),this.element=Object(v.i)({className:"quest_editor_RegistersView"},this.settings_bar.element,this.container_element),this.type_select.selected.val=as.Signed;const t=Array(Zo);for(let e=0;e!this.quest_runner.paused.val||!this.quest_runner.running.val;this.update(i(),this.hex_checkbox.checked.val),this.disposables(this.quest_runner.running.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.quest_runner.paused.observe(()=>this.update(i(),this.hex_checkbox.checked.val)),this.type_select.selected.observe(({value:e})=>{null!=e&&(this.register_getter=this.get_register_getter(e),this.update(i(),this.hex_checkbox.checked.val))}),this.hex_checkbox.checked.observe(e=>this.update(i(),e.value))),this.finalize_construction()}get_register_getter(e){let t;switch(e){case as.Signed:t=this.quest_runner.vm.get_register_signed;break;case as.Unsigned:t=this.quest_runner.vm.get_register_unsigned;break;case as.Word:t=this.quest_runner.vm.get_register_word;break;case as.Byte:t=this.quest_runner.vm.get_register_byte;break;case as.Float:t=this.quest_runner.vm.get_register_float}return t.bind(this.quest_runner.vm)}update(e,t){if(e){const e="??";for(let t=0;t{this.buffer_log_entry(e,t)},this.level=this._level,this.log=this._log.filtered(this.level.map(e=>t=>t.level>=e))}get_logger(e){const t=X.c.get(e);return t.handler=this.handler,t}dispose(){this.disposer.dispose()}set_level(e){this._level.val=e}buffer_log_entry(e,t){this.log_buffer.push(e),this.logger_name_buffer.push(t),this.add_buffered_log_entries()}add_buffered_log_entries(){null==this.adding_log_entries&&(this.adding_log_entries=requestAnimationFrame(()=>{if(this.log_buffer.length>500){const e=this.log_buffer.length-500;this.log_buffer.splice(250,e,{time:new Date,message:`...dropped ${e} messages...`,level:X.a.Warn,logger:ls}),this.logger_name_buffer.splice(250,e,"quest_editor/stores/LogStore")}const e=Math.min(200,this.log_buffer.length),t=this.log_buffer.splice(0,e),i=this.logger_name_buffer.splice(0,e);this._log.push(...t);for(let o=0;o2e3&&this._log.splice(0,1e3),this.adding_log_entries=void 0,this.log_buffer.length&&this.add_buffered_log_entries()}))}},us=5;class vs extends o.a{constructor(){super(),this.element=Object(v.i)({className:"quest_editor_LogView",tabIndex:-1}),this.should_scroll_to_bottom=!0,this.scrolled=()=>{this.should_scroll_to_bottom=this.list_container.scrollTop>=this.list_container.scrollHeight-this.list_container.offsetHeight-us},this.scroll_to_bottom=()=>{this.should_scroll_to_bottom&&this.list_container.scrollTo({top:this.list_container.scrollHeight,left:0,behavior:"auto"})},this.create_message_element=({time:e,level:t,message:i})=>Object(v.i)({className:["quest_editor_LogView_message","quest_editor_LogView_"+X.a[t]+"_message"].join(" ")},Object(v.i)({className:"quest_editor_LogView_message_timestamp"},Object(X.d)(e)),Object(v.i)({className:"quest_editor_LogView_message_level"},"["+X.a[t]+"]"),Object(v.i)({className:"quest_editor_LogView_message_contents"},i)),this.list_container=Object(v.i)({className:"quest_editor_LogView_list_container"}),this.list_element=Object(v.i)({className:"quest_editor_LogView_message_list"}),this.level_filter=this.disposable(new ds.a({class:"quest_editor_LogView_level_filter",label:"Level:",items:X.b,to_label:e=>X.a[e]})),this.settings_bar=this.disposable(new Ue.a({class:"quest_editor_LogView_settings"},this.level_filter)),this.list_container.addEventListener("scroll",this.scrolled),this.disposables(Object(v.d)(this.list_element,_s.log,this.create_message_element,{after:this.scroll_to_bottom}),this.level_filter.selected.observe(({value:e})=>null!=e&&_s.set_level(e)),_s.level.observe(({value:e})=>{this.level_filter.selected.val=e},{call_now:!0})),this.list_container.appendChild(this.list_element),this.element.appendChild(this.settings_bar.element),this.element.appendChild(this.list_container),this.finalize_construction()}}class hs extends ne{constructor(e,t,i,o){super(Object(M.e)(void 0),t,i,o),this.quest_runner=e,this.disposer.add_all(this.quest_runner.game_state.current_area_variant.observe(this.area_variant_changed,{call_now:!0}))}get_area_variant_details(){const e=this.quest_runner.game_state;return{episode:e.episode,area_variant:e.current_area_variant.val,npcs:e.npcs,objects:e.objects}}}class ps extends _e{constructor(e,t,i,o,s){super(e,t,"quest_editor_QuestRunnerRendererView",new Q(s,e=>new hs(t.quest_runner,e,i,o))),this.renderer.init_camera_controls(),this.finalize_construction()}}i("PJoW");class gs extends o.a{constructor(e){super(),this.element=Object(v.i)({className:"core_ErrorView"},this.disposable(new b(e)).element),this.finalize_construction()}}var bs=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const fs=X.c.get("quest_editor/gui/QuestEditorView"),ms={settings:{showPopoutIcon:!1,showMaximiseIcon:!0,showCloseIcon:!0},dimensions:{headerHeight:24},labels:{close:"Close",maximise:"Maximise",minimise:"Minimise",popout:"Open in new window"}};class ws extends o.a{constructor(e,t,i,o,s,n,r,a,d,c,l,_,u,h){super(),this.gui_store=e,this.quest_editor_ui_persister=i,this.tool_bar=o,this.element=Object(v.i)({className:"quest_editor_QuestEditorView"}),this.layout_element=Object(v.i)({className:"quest_editor_gl_container"}),this.sub_views=new Map,this.view_map=new Map([[f,{name:"quest_info",create:s}],[m,{name:"npc_counts",create:n}],[Fe,{name:"quest_renderer",create:r}],[Ke,{name:"asm_editor",create:a}],[Qe,{name:"entity_info",create:d}],[Je,{name:"npc_list_view",create:c}],[Xe,{name:"object_list_view",create:l}],[bt,{name:"events_view",create:_}]]),e.feature_active("vm")&&(this.view_map.set(ps,{name:"quest_runner",create:u}),this.view_map.set(vs,{name:"log_view",create:()=>new vs}),this.view_map.set(cs,{name:"registers_view",create:h})),this.element.append(this.tool_bar.element,this.layout_element),this.layout=this.init_golden_layout(),this.layout.then(e=>this.loaded_layout=e),this.disposables(e.on_global_keydown(le.b.QuestEditor,"Ctrl-Alt-D",()=>t.debug.val=!t.debug.val),t.quest_runner.running.observe(({value:e})=>bs(this,void 0,void 0,(function*(){const i=yield this.layout;if(t.quest_runner.running.val===e){const t=i.root.getItemsById(this.view_map.get(ps).name);if(e){if(0===t.length){i.root.getItemsById(this.view_map.get(Fe).name)[0].parent.addChild({id:this.view_map.get(ps).name,title:"Debug 3D View",type:"component",componentName:this.view_map.get(ps).name,isClosable:!1})}}else for(const e of t)e.remove()}})))),this.finalize_construction()}resize(e,t){super.resize(e,t);const i=Math.max(0,t-this.tool_bar.height);return this.layout_element.style.width=`${e}px`,this.layout_element.style.height=`${i}px`,this.layout.then(t=>t.updateSize(e,i)),this}dispose(){super.dispose(),this.layout.then(e=>e.destroy());for(const e of this.sub_views.values())e.dispose();this.sub_views.clear()}init_golden_layout(){return bs(this,void 0,void 0,(function*(){const e=this.get_default_layout_content();try{const t=yield this.quest_editor_ui_persister.load_layout_config(e);if(t){const e=this.attempt_gl_init(Object.assign(Object.assign({},ms),{content:t}));return fs.info("Instantiated golden layout with persisted layout."),e}}catch(e){fs.warn("Couldn't instantiate golden layout with persisted layout.",e)}return fs.info("Instantiating golden layout with default layout."),this.attempt_gl_init(Object.assign(Object.assign({},ms),{content:e}))}))}attempt_gl_init(e){const t=new n.a(e,this.layout_element),i=this.sub_views;try{for(const{name:e,create:o}of this.view_map.values())t.registerComponent(e,(function(t){let s;try{s=o()}catch(t){fs.error(`Couldn't instantiate "${e}".`,t),s=new gs("Something went wrong while creating this window.")}t.on("close",()=>s.dispose()),t.on("resize",()=>s.resize(t.width,t.height-4)),s.resize(t.width,t.height),i.set(e,s),t.getElement().append(s.element)}));return t.on("stateChanged",()=>{this.quest_editor_ui_persister.persist_layout_config(t.toConfig().content)}),t.on("stackCreated",e=>{e.on("activeContentItemChanged",e=>{if("componentName"in e.config){const t=this.sub_views.get(e.config.componentName);t&&t.focus()}})}),t.init(),t}catch(e){throw t.destroy(),e}}get_default_layout_content(){return[{type:"row",content:[{type:"column",width:2,content:[{type:"stack",content:[{title:"Info",type:"component",componentName:this.view_map.get(f).name,isClosable:!1},{title:"NPC Counts",type:"component",componentName:this.view_map.get(m).name,isClosable:!1}]},{title:"Entity",type:"component",componentName:this.view_map.get(Qe).name,isClosable:!1}]},{type:"stack",width:9,content:[{id:this.view_map.get(Fe).name,title:"3D View",type:"component",componentName:this.view_map.get(Fe).name,isClosable:!1},{title:"Script",type:"component",componentName:this.view_map.get(Ke).name,isClosable:!1},...this.gui_store.feature_active("vm")?[{title:"Debug Log",type:"component",componentName:this.view_map.get(vs).name,isClosable:!1},{title:"Registers",type:"component",componentName:this.view_map.get(cs).name,isClosable:!1}]:[]]},{type:"stack",width:2,content:[{title:"NPCs",type:"component",componentName:this.view_map.get(Je).name,isClosable:!1},{title:"Objects",type:"component",componentName:this.view_map.get(Xe).name,isClosable:!1},{title:"Events",type:"component",componentName:this.view_map.get(bt).name,isClosable:!1}]}]}]}}const ks={can_redo:Object(M.e)(!1),can_undo:Object(M.e)(!1),first_redo:Object(M.e)(void 0),first_undo:Object(M.e)(void 0),make_current(){ys.current.val=this},redo:()=>!1,reset(){},undo:()=>!1};const ys=new class{constructor(){this.current=Object(M.e)(ks),this.can_undo=this.current.flat_map(e=>e.can_undo),this.can_redo=this.current.flat_map(e=>e.can_redo),this.first_undo=this.current.flat_map(e=>e.first_undo),this.first_redo=this.current.flat_map(e=>e.first_redo)}undo(){return this.current.val.undo()}redo(){return this.current.val.redo()}make_noop_current(){ys.current.val=ks}},Rs=X.c.get("core/undo/UndoStack");class Is{constructor(){this.stack=Object(M.c)(),this.index=Object(M.e)(0),this.can_undo=this.index.map(e=>e>0),this.can_redo=Object(M.d)((e,t)=>te?this.stack.get(this.index.val-1):void 0),this.first_redo=this.can_redo.map(e=>e?this.stack.get(this.index.val):void 0),this.undoing_or_redoing=!1}make_current(){ys.current.val=this}push(e){return this.undoing_or_redoing||(this.stack.splice(this.index.val,1/0,e),this.index.update(e=>e+1)),e}pop(){return this.index.update(e=>e-1),this.stack.splice(this.index.val,1)[0]}undo(){if(this.can_undo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.index.update(e=>e-1),this.stack.get(this.index.val).undo()}catch(e){Rs.warn("Error while undoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}redo(){if(this.can_redo.val&&!this.undoing_or_redoing){try{this.undoing_or_redoing=!0,this.stack.get(this.index.val).redo(),this.index.update(e=>e+1)}catch(e){Rs.warn("Error while redoing action.",e)}finally{this.undoing_or_redoing=!1}return!0}return!1}reset(){this.stack.clear(),this.index.val=0}}class js{constructor(e){this._breakpoints=[],this.breakpoints=this._breakpoints,this.vm=e}resume(){this.vm.step_mode=Yo.BreakPoint}step_over(){this.vm.step_mode=Yo.Over}step_in(){this.vm.step_mode=Yo.In}step_out(){this.vm.step_mode=Yo.Out}set_breakpoint(e){return-1===this._breakpoints.findIndex(t=>t.line_no===e)&&(this._breakpoints.push(new xs(e,void 0,this.vm)),!0)}remove_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);return-1!=t&&(this._breakpoints.splice(t,1)[0].deactivate(),!0)}toggle_breakpoint(e){const t=this._breakpoints.findIndex(t=>t.line_no===e);-1==t?this._breakpoints.push(new xs(e,void 0,this.vm)):this._breakpoints.splice(t,1)[0].deactivate()}clear_breakpoints(){for(const e of this._breakpoints.splice(0,1/0))e.deactivate()}activate_breakpoints(){for(const e of this._breakpoints)e.activate()}deactivate_breakpoints(){for(const e of this._breakpoints)e.deactivate()}}class xs{constructor(e,t,i){this.line_no=e,this.ptr=t,this.vm=i,null==t?this.activate():this.vm.set_breakpoint(t)}get active(){return null!=this.ptr}activate(){this.ptr=this.line_no_to_inst_pointer(this.line_no),this.ptr&&this.vm.set_breakpoint(this.ptr)}deactivate(){this.ptr&&this.vm.remove_breakpoint(this.ptr)}line_no_to_inst_pointer(e){var t,i;if(!this.vm.halted)for(let o=0;oe!==Ts.Stopped),this.paused=this._state.map(e=>e===Ts.Paused),this.breakpoints=this._breakpoints,this.pause_location=this._pause_location,this.execution_loop=()=>{var e,t;let i;switch(this.animation_frame=void 0,this.vm.vsync(),this.vm.execute()){case ns.Suspended:this._state.val=Ts.Running;break;case ns.Paused:this._state.val=Ts.Paused,i=null===(t=null===(e=this.vm.get_instruction_pointer())||void 0===e?void 0:e.source_location)||void 0===t?void 0:t.line_no;break;case ns.WaitingVsync:case ns.WaitingInput:this._state.val=Ts.Running,this.schedule_frame();break;case ns.WaitingSelection:this.vm.list_select(0),this._state.val=Ts.Running,this.schedule_frame();break;case ns.Halted:this.stop()}this._pause_location.val=i,this.startup&&this._state.val===Ts.Running&&(this.startup=!1,this.run_floor_handler(this._game_state.area_variants.get(this.initial_area_id)||this.area_store.get_variant(this._game_state.episode,this.initial_area_id,0)))},this.create_vm_io=()=>{function e(e,t){const i=[e];if(t){const{instruction:e,source_location:o}=t;i.push(` [${e.opcode.mnemonic}`),o&&i.push(` ${o.line_no}:${o.col}`),i.push("]")}return i.join("")}return{bb_map_designate:(e,t,i)=>{this._game_state.area_variants.set(e,this.area_store.get_variant(this._game_state.episode,e,i))},set_floor_handler:(e,t)=>{this._game_state.floor_handlers.set(e,t)},window_msg:e=>{this.logger.info(`window_msg "${e}"`)},message:e=>{this.logger.info(`message "${e}"`)},add_msg:e=>{this.logger.info(`add_msg "${e}"`)},winend:()=>{},p_dead_v3:()=>!1,mesend:()=>{},list:e=>{this.logger.info(`list "[${e}]"`)},warning:(t,i)=>{this.logger.warn(e(t,i))},error:(t,i)=>{this.logger.error(e(t.message,i))}}},this.vm=new rs(this.create_vm_io()),this.debugger=new js(this.vm)}get game_state(){return this._game_state}run(e){this.stop(),this.logger.info("Starting debugger."),this.startup=!0,this.initial_area_id=0,this.npcs.splice(0,this.npcs.length,...e.npcs.val),this.objects.splice(0,this.objects.length,...e.objects.val),this._game_state=new Ss(e.episode),this.vm.load_object_code(e.object_code.map(Eo),this.game_state.episode),this.vm.start_thread(0),this.debugger.activate_breakpoints(),this._state.val=Ts.Running,this.schedule_frame()}resume(){this.debugger.resume(),this.schedule_frame()}step_over(){this.debugger.step_over(),this.schedule_frame()}step_into(){this.debugger.step_in(),this.schedule_frame()}step_out(){this.debugger.step_out(),this.schedule_frame()}stop(){this.running.val&&(this.logger.info("Stopping debugger."),null!=this.animation_frame&&(cancelAnimationFrame(this.animation_frame),this.animation_frame=void 0),this.vm.halt(),this.debugger.deactivate_breakpoints(),this._state.val=Ts.Stopped,this._pause_location.val=void 0,this.npcs.splice(0,this.npcs.length),this.objects.splice(0,this.objects.length),this._game_state=new Ss(r.b.I))}set_breakpoint(e){const t=this.debugger.set_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}remove_breakpoint(e){const t=this.debugger.remove_breakpoint(e);return this._breakpoints.splice(0,1/0,...this.debugger.breakpoints),t}toggle_breakpoint(e){this.debugger.toggle_breakpoint(e),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}clear_breakpoints(){this.debugger.clear_breakpoints(),this._breakpoints.splice(0,1/0,...this.debugger.breakpoints)}schedule_frame(){null==this.animation_frame&&(this.animation_frame=requestAnimationFrame(this.execution_loop))}run_floor_handler(e){const t=e.area.id;this._game_state.current_area_variant.val=e,this._game_state.objects.push(...this.objects.filter(e=>e.area_id===t));const i=this._game_state.floor_handlers.get(t);null==i?this.logger.debug(`No floor handler registered for floor ${t}.`):(this.vm.start_thread(i),this.schedule_frame())}}var Os=i("kcKQ"),Ls=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Ps=X.c.get("quest_editor/gui/QuestEditorStore");class Ds extends Os.a{constructor(e,t){super(),this.area_store=t,this._current_quest=Object(M.e)(void 0),this._current_area=Object(M.e)(void 0),this._selected_wave=Object(M.e)(void 0),this._selected_entity=Object(M.e)(void 0),this.debug=Object(M.e)(!1),this.undo=new Is,this.current_quest=this._current_quest,this.current_area=this._current_area,this.selected_wave=this._selected_wave,this.selected_entity=this._selected_entity,this.set_current_area=e=>{var t,i;e&&e.id!==(null===(i=null===(t=this.selected_wave.val)||void 0===t?void 0:t.area_id)||void 0===i?void 0:i.val)&&this.set_selected_wave(void 0),this._selected_entity.val=void 0,this._current_area.val=e},this.set_selected_wave=e=>{if(e){const t=this.selected_entity.val;t&&t instanceof K&&t.wave.val!==e&&this.set_selected_entity(void 0)}this._selected_wave.val=e},this.set_selected_entity=e=>{e&&this.current_quest.val&&(this._current_area.val=this.area_store.get_area(this.current_quest.val.episode,e.area_id)),this._selected_entity.val=e},this.set_section_on_quest_entity=(e,t)=>{const i=t.find(t=>t.id===e.section_id.val);i?e.set_section(i):Ps.warn(`Section ${e.section_id.val} not found.`)},this.quest_runner=new Cs(t),this.disposables(e.tool.observe(({value:e})=>{e===le.b.QuestEditor&&this.undo.make_current()},{call_now:!0}),this.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof K&&!e.includes(t)&&this.set_selected_entity(void 0)}),this.current_quest.flat_map(e=>e?e.objects:Object(M.e)([])).observe(({value:e})=>{const t=this.selected_entity.val;t instanceof we&&!e.includes(t)&&this.set_selected_entity(void 0)}),Object(v.h)(window,"beforeunload",e=>{this.quest_runner.stop(),this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}dispose(){this.quest_runner.stop(),super.dispose()}set_current_quest(e){return Ls(this,void 0,void 0,(function*(){if(this.undo.reset(),this.quest_runner.stop(),this._current_area.val=void 0,this._selected_entity.val=void 0,this._current_quest.val=e,e){this._current_area.val=this.area_store.get_area(e.episode,0);for(const t of e.area_variants.val){const i=yield this.area_store.get_area_sections(e.episode,t);t.set_sections(i);for(const o of e.objects.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){Ps.error(e)}for(const o of e.npcs.val.filter(e=>e.area_id===t.area.id))try{this.set_section_on_quest_entity(o,i)}catch(e){Ps.error(e)}}}}))}}var Bs,Es,Ms=i("NUmZ"),Ws=i.n(Ms);!function(e){e[e.NewAssembly=0]="NewAssembly",e[e.AssemblyChange=1]="AssemblyChange",e[e.SignatureHelp=2]="SignatureHelp",e[e.Definition=3]="Definition",e[e.SettingsChange=4]="SettingsChange"}(Bs||(Bs={})),function(e){e[e.NewObjectCode=0]="NewObjectCode",e[e.SignatureHelp=1]="SignatureHelp",e[e.Definition=2]="Definition"}(Es||(Es={}));const qs=new DataView(new ArrayBuffer(4));function zs(e){return qs.setInt32(0,e),qs.getFloat32(0)}function Fs(e){return qs.setFloat32(0,e),qs.getInt32(0)}const Vs=X.c.get("quest_editor/scripting/disassembly");function Us(e,t){const i=[],o=Math.min(e.length,t.length);for(let s=0;snull!=e).map(e=>({label:e.mnemonic,kind:As.Function,insertText:e.mnemonic})),Gs=[{label:".code",kind:As.Keyword,insertText:"code"},{label:".data",kind:As.Keyword,insertText:"data"},{label:".string",kind:As.Keyword,insertText:"string"}];class Ys{constructor(e,t,i){this.can_undo=Object(M.e)(!1),this.can_redo=Object(M.e)(!1),this.action=Object(M.e)({description:e,undo:t,redo:i}),this.first_undo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_undo),this.first_redo=Object(M.d)((e,t)=>t?e:void 0,this.action,this.can_redo)}make_current(){ys.current.val=this}undo(){return!!this.can_undo&&(this.action.val.undo(),!0)}redo(){return!!this.can_redo&&(this.action.val.redo(),!0)}reset(){this.can_undo.val=!1,this.can_redo.val=!1}}var Ks=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Qs=new class{constructor(){this._issues=Object(M.e)({warnings:[],errors:[]}),this.issues=this._issues,this.worker=new Ws.a,this.promises=new Map,this.message_id=0,this.process_worker_message=e=>{const t=e.data;switch(t.type){case Es.NewObjectCode:this.quest&&(this.quest.object_code.splice(0,this.quest.object_code.length,...t.object_code),this.quest.set_map_designations(t.map_designations),this._issues.val={warnings:t.warnings,errors:t.errors});break;case Es.SignatureHelp:{const e=this.promises.get(t.id);if(e)if(this.promises.delete(t.id),t.opcode){let i=t.opcode.mnemonic+" ";const o=[];let s=!0;for(const e of t.opcode.params){let t;switch(s?s=!1:i+=", ",e.type.kind){case ft.ILabel:t="FuncLabel";break;case ft.DLabel:t="DataLabel";break;case ft.SLabel:t="StringLabel";break;case ft.ILabelVar:t="...FuncLabel";break;case ft.RegRef:case ft.RegTupRef:t="Register";break;case ft.RegRefVar:t="...Register";break;default:t=ft[e.type.kind]}o.push({label:[i.length,i.length+t.length],documentation:e.doc}),i+=t}const n={signatures:[{label:i,documentation:t.opcode.doc,parameters:o}],activeSignature:0,activeParameter:t.active_param};e.resolve(n)}else e.resolve(void 0)}break;case Es.Definition:{const e=this.promises.get(t.id);if(e){this.promises.delete(t.id);const i=[];null!=t.line_no&&i.push({uri:e.uri,range:{startLineNumber:t.line_no,startColumn:t.col,endLineNumber:t.line_no,endColumn:t.col+t.len}}),e.resolve(i)}}}},this.worker.onmessage=this.process_worker_message}disassemble(e,t){this.quest=e;const i=function(e,t=!1){Vs.trace("disassemble start");const i=[],o=[];let s=void 0;for(const r of e){let e;switch(r.type){case Bo.Instructions:e=".code";break;case Bo.Data:e=".data";break;case Bo.String:e=".string"}s!==r.type&&(s=r.type,i.length&&i.push(""),i.push(e,""));for(const e of r.labels)i.push(`${e}:`);if(r.type===Bo.Data){const e=new Uint8Array(r.data);let t=" ";for(let o=0;o4&&i.push(t)}else if(r.type===Bo.String)i.push(" "+(n=r.value,JSON.stringify(n.replace(//g,"\n"))));else{let e=!1;for(const s of r.instructions)if(s.opcode.code===Ht.code?e=!0:s.opcode.code===Gt.code&&(e=!1),t||e||s.opcode.stack!==Mt.Push){let e=[];s.opcode.stack===Mt.Pop?t||(e=$s(s.opcode.params,o.splice(Math.max(0,o.length-s.opcode.params.length),s.opcode.params.length),!0)):e=$s(s.opcode.params,Us(s.opcode.params,s.args),!1),i.push(" "+s.opcode.mnemonic+(e.length?" "+e.join(", "):""))}else o.push(...Us(s.opcode.params,s.args))}}var n;return i.length&&i.push(""),Vs.trace(`disassemble end, line count: ${i.length}`),i}(e.object_code,t),o={type:Bs.NewAssembly,assembly:i};return this.worker.postMessage(o),i}update_assembly(e){const t={type:Bs.AssemblyChange,changes:e.map(e=>({start_line_no:e.range.startLineNumber,start_col:e.range.startColumn,end_line_no:e.range.endLineNumber,end_col:e.range.endColumn,new_text:e.text}))};this.worker.postMessage(t)}provide_completion_items(e){return{suggestions:/^\s*([a-z][a-z0-9_=<>!]*)?$/.test(e)?Hs:/^\s*\.[a-z]+$/.test(e)?Gs:[],incomplete:!1}}provide_signature_help(e,t,i){return Ns(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Signature help provision",e,e=>({type:Bs.SignatureHelp,id:e,line_no:t,col:i}))}))}provide_definition(e,t,i){return Ns(this,void 0,void 0,(function*(){return yield this.send_and_await_response("Definition provision",e,e=>({type:Bs.Definition,id:e,line_no:t,col:i}))}))}update_settings(e){const t={type:Bs.SettingsChange,settings:e};this.worker.postMessage(t)}dispose(){this.worker.terminate()}send_and_await_response(e,t,i){return Ns(this,void 0,void 0,(function*(){const o=this.message_id++;return new Promise((s,n)=>{this.promises.set(o,{uri:t,resolve:s,reject:n});const r=i(o);this.worker.postMessage(r),setTimeout(()=>{this.promises.delete(o)&&n(new Error(`${e} timed out.`))},5e3)})}))}};Ve.languages.register({id:"psoasm"}),Ve.languages.setMonarchTokensProvider("psoasm",{defaultToken:"invalid",tokenizer:{root:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",bracket:"@open",next:"@string"}],[/r\d+/,"predefined"],[/[^\s]+:/,"tag"],[/0x[0-9a-fA-F]+/,"number.hex"],[/-?\d+(\.\d+)?(e-?\d+)?/,"number.float"],[/-?[0-9]+/,"number"],[/\.[^\s]+/,"keyword"],[/[a-z][a-z0-9_=<>!]*/,"identifier"],[/[ \t\r\n]+/,"white"],[/\/\/.*$/,"comment"],[/,/,"delimiter"]],string:[[/[^\\"]+/,"string"],[/\\(?:[n\\"])/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]]}}),Ve.languages.registerCompletionItemProvider("psoasm",{provideCompletionItems(e,t){const i=e.getValueInRange({startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:1,endColumn:t.column});return Qs.provide_completion_items(i)}}),Ve.languages.registerSignatureHelpProvider("psoasm",{signatureHelpTriggerCharacters:[" ",","],signatureHelpRetriggerCharacters:[", "],provideSignatureHelp(e,t){return Ks(this,void 0,void 0,(function*(){const i=yield Qs.provide_signature_help(e.uri,t.lineNumber,t.column);return i&&{value:i,dispose(){}}}))}}),Ve.languages.setLanguageConfiguration("psoasm",{indentationRules:{increaseIndentPattern:/^\s*\d+:/,decreaseIndentPattern:/^\s*(\d+|\.)/},autoClosingPairs:[{open:'"',close:'"'}],surroundingPairs:[{open:'"',close:'"'}],comments:{lineComment:"//"}}),Ve.languages.registerDefinitionProvider("psoasm",{provideDefinition:(e,t)=>Qs.provide_definition(e.uri,t.lineNumber,t.column)});class Zs extends Os.a{constructor(e){super(),this.quest_editor_store=e,this.model_disposer=this.disposable(new d.a),this._model=Object(M.e)(void 0),this._did_undo=Object(M.a)(),this._did_redo=Object(M.a)(),this._inline_args_mode=Object(M.e)(!0),this.model=this._model,this.did_undo=this._did_undo,this.did_redo=this._did_redo,this.undo=new Ys("Text edits",()=>this._did_undo.emit({value:"asm undo"}),()=>this._did_redo.emit({value:"asm undo"})),this.inline_args_mode=this._inline_args_mode,this.has_issues=Qs.issues.map(e=>e.warnings.length+e.errors.length>0),this.set_inline_args_mode=e=>{this.has_issues.val||(this._inline_args_mode.val=e,Qs.update_settings({manual_stack:!this.inline_args_mode.val}),this.update_model())},this.quest_changed=()=>{this.update_model()},this.breakpoints=e.quest_runner.breakpoints,this.pause_location=e.quest_runner.pause_location,this.disposables(e.current_quest.observe(this.quest_changed,{call_now:!0}),Qs.issues.observe(({value:e})=>this.update_model_markers(e),{call_now:!0}),Object(v.h)(window,"beforeunload",e=>{this.undo.can_undo.val&&(e.preventDefault(),e.returnValue=!1)}))}setup_editor_model_features(e){const t=e.getAlternativeVersionId();let i=t,o=t;this.model_disposer.add(e.onDidChangeContent(s=>{const n=e.getAlternativeVersionId();no&&(o=i)),this.undo.can_undo.val=!0),i=n,Qs.update_assembly(s.changes),this.update_breakpoints(s.changes)}))}update_model_markers({warnings:e,errors:t}){const i=this.model.val;i&&Ve.editor.setModelMarkers(i,"psoasm",e.map(e=>({severity:Ve.MarkerSeverity.Hint,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length,tags:[Ve.MarkerTag.Unnecessary]})).concat(t.map(e=>({severity:Ve.MarkerSeverity.Error,message:e.message,startLineNumber:e.line_no,endLineNumber:e.line_no,startColumn:e.col,endColumn:e.col+e.length}))))}update_model(){this.undo.reset(),this.model_disposer.dispose_all();const e=this.quest_editor_store.current_quest.val;if(e){const t=!this.inline_args_mode.val,i=Qs.disassemble(e,t),o=this.model_disposer.add(Ve.editor.createModel(i.join("\n"),"psoasm"));this.setup_editor_model_features(o),this._model.val=o}else this._model.val=void 0}update_breakpoints(e){for(const t of e){const e=[];if(""===t.text){const i=t.range.endLineNumber-t.range.startLineNumber;if(i>0){for(let o=t.range.startLineNumber+1;o<=t.range.endLineNumber;o++){const t=Math.max(o-i,1);this.quest_editor_store.quest_runner.remove_breakpoint(o)&&e.push(t)}for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no-i))}}else{const i=t.text.split("\n").length-1;if(i>0)for(const o of this.breakpoints.val)o.line_no>t.range.endLineNumber&&(this.quest_editor_store.quest_runner.remove_breakpoint(o.line_no),e.push(o.line_no+i))}for(const t of e)this.quest_editor_store.quest_runner.set_breakpoint(t)}}}class Js{constructor(e,t,i,o){if(!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);if(!t)throw new Error("name is required.");if(!o)throw new Error("area_variants is required.");this.id=e,this.name=t,this.order=i,this.area_variants=o}}class Xs{constructor(e,t){if(this._sections=Object(M.c)(),this.sections=this._sections,!Number.isInteger(e)||e<0)throw new Error(`Expected id to be a non-negative integer, got ${e}.`);this.id=e,this.area=t}set_sections(e){return this._sections.val=e,this}}function en(e){return tn[e]}const tn=[];function on(e,t,i,o){const s={id:e,name:t,order:i,area_variants:[]};for(let e=0;ethis.areas[e],this.get_area=(e,t)=>{const i=this.areas[e].find(e=>e.id===t);if(!i)throw new Error(`Area id ${t} for episode ${e} is invalid.`);return i},this.get_variant=(e,t,i)=>{const o=this.get_area(e,t).area_variants[i];if(!o)throw new Error(`Area variant id ${i} for area ${t} of episode ${r.b[e]} is invalid.`);return o},this.get_area_sections=(e,t)=>this.area_asset_loader.load_sections(e,t);for(const e of r.a)this.areas[e]=en(e).map(e=>{const t=new Js(e.id,e.name,e.order,[]);for(const i of e.area_variants)t.area_variants.push(new Xs(i.id,t));return t})}}function rn(e,t){e.seek_end(32);const i=e.u32(),o=e.u32();e.seek(8);const s=e.u32();return e.seek_start(i),{data_offset:s,index:t?function(e,t){const i=e.u16_array(t),o=[];let s=0;for(const t of i){s+=4*t,e.seek_start(s-4);const i=e.u32(),n=e.u32();o.push({offset:n,size:i})}return o}(e,o):[]}}var an=i("kwt4");function dn(e,t,i){const o=[];for(let s=0;s=0){const e=new un(n.id,Object(vn.a)(n.position),$(n.rotation.x,n.rotation.y,n.rotation.z),t);i.push(e),r.userData.section=e}}return[i,o]}class bn{constructor(e){this.http_client=e,this.disposer=new d.a,this.render_object_cache=this.disposer.add(new cn),this.collision_object_cache=this.disposer.add(new cn),this.area_sections_cache=this.disposer.add(new cn)}dispose(){this.disposer.dispose()}load_sections(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.area_sections_cache.get_or_set(i,()=>this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>gn(e,t)[0]))}load_render_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.render_object_cache.get_or_set(i,()=>this.load_render_object(e,t)).then(e=>gn(e,t)[1])}load_collision_geometry(e,t){const i=`${e}-${t.area.id}-${t.id}`;return this.collision_object_cache.get_or_set(i,()=>this.get_area_asset(e,t,"collision").then(e=>(function(e){const{data_offset:t}=rn(e,!1);e.seek_start(t);const i=e.u32();e.seek_start(i);const o={meshes:[]};for(;e.bytes_left;){const t=e.position,i=e.u32();if(0===i)break;const s={vertices:[],triangles:[]};o.meshes.push(s),e.seek_start(i);const n=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();e.seek_start(r);for(let t=0;t(function(e){const t=new y.Group;for(const i of e.meshes){const e=new y.Geometry;for(const{x:t,y:o,z:s}of i.vertices)e.vertices.push(new y.Vector3(t,o,s));for(const{indices:t,flags:o,normal:s}of i.triangles){const i=16&o,n=1&o,r=64&o?3:i?2:n?1:0;0!==r&&e.faces.push(new y.Face3(t[0],t[1],t[2],new y.Vector3(s.x,s.y,s.z),void 0,r))}if(e.faces.length){e.computeBoundingBox(),e.computeBoundingSphere();const i=new y.Mesh(e,hn);i.renderOrder=1,t.add(i);const o=new y.Mesh(e,pn);o.renderOrder=2,t.add(o)}}return t})(e))}load_render_object(e,t){return this.get_area_asset(e,t,"render").then(e=>(function(e){const t=[];e.seek_end(16);const{data_offset:i}=rn(e,!1);e.seek_start(i),e.seek(8);const o=e.u32();e.seek(4);const s=e.u32();for(let i=0;it.push({args:i,resolve:e,reject:o}));return 1===t.length&&function(){mn(this,void 0,void 0,(function*(){for(;t.length;){const{args:i,resolve:o,reject:s}=t[0];try{o(yield e(...i))}catch(e){s(e)}finally{t.shift()}}}))}(),o}}var kn=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const yn=new y.HemisphereLight(16777215,5263440,1.2),Rn=new y.Scene,In=new y.PerspectiveCamera(30,1,10,1e3),jn=new y.Vector3(1,1,2).normalize(),xn=1.3/Math.tan(In.fov/180*Math.PI/2);class Tn{constructor(e,t){this.entity_asset_loader=e,this.cache=new cn,this.render_to_image=wn(e=>this.entity_asset_loader.load_geometry(e).then(t=>this.entity_asset_loader.load_textures(e).then(i=>{Rn.remove(...Rn.children),Rn.add(yn);const o=E(e,t,i);Rn.add(o);const s=o.geometry.boundingSphere;return In.position.copy(jn),In.position.multiplyScalar(s.radius*xn),In.lookAt(s.center),this.renderer.render(Rn,In),this.renderer.domElement.toDataURL()}))),this.renderer=t(),this.renderer.setSize(100,100)}dispose(){this.renderer.dispose(),this.cache.dispose()}render(e){return kn(this,void 0,void 0,(function*(){return this.cache.get_or_set(e,()=>this.render_to_image(e))}))}}var Sn=i("yub1"),Cn=i("iR5r"),On=i("4eU9");const Ln=X.c.get("quest_editor/loading/EntityAssetLoader"),Pn=new y.CylinderBufferGeometry(3,3,20);Pn.translate(0,10,0),Pn.computeBoundingBox(),Pn.computeBoundingSphere();const Dn=On.a.resolve(Pn),Bn=[],En=On.a.resolve(Bn);class Mn{constructor(e){this.http_client=e,this.disposer=new d.a,this.geom_cache=this.disposer.add(new cn),this.tex_cache=this.disposer.add(new cn),this.warm_up_caches()}dispose(){this.disposer.dispose()}load_geometry(e){return this.geom_cache.get_or_set(e,()=>this.load_data(e,Wn.Geometry).then(({url:t,data:i})=>{const o=new $o.a(i,Vo.a.Little),s=t.endsWith(".nj")?Object(an.c)(o):Object(an.d)(o);return s.length?Object(_n.a)(s[0]):(Ln.warn(`Couldn't parse ${t} for ${C(e)}.`),Pn)}).catch(t=>(Ln.warn(`Couldn't load geometry file for ${C(e)}.`,t),Pn)))}load_textures(e){return this.tex_cache.get_or_set(e,()=>this.load_data(e,Wn.Texture).then(({data:e})=>{const t=new $o.a(e,Vo.a.Little),i=Object(Sn.a)(t);return Object(Cn.a)(i)}).catch(t=>(Ln.warn(`Couldn't load texture file for ${C(e)}.`,t),Bn)))}load_data(e,t){const i=function e(t,i){if(O(t))switch(t){case I.c.Dubswitch:return`/npcs/${I.c[t]}.${i===Wn.Geometry?"xj":"xvm"}`;case I.c.Hildebear2:return e(I.c.Hildebear,i);case I.c.Hildeblue2:return e(I.c.Hildeblue,i);case I.c.RagRappy2:return e(I.c.RagRappy,i);case I.c.Monest2:return e(I.c.Monest,i);case I.c.Mothmant2:return e(I.c.Mothmant,i);case I.c.PoisonLily2:return e(I.c.PoisonLily,i);case I.c.NarLily2:return e(I.c.NarLily,i);case I.c.GrassAssassin2:return e(I.c.GrassAssassin,i);case I.c.Dimenian2:return e(I.c.Dimenian,i);case I.c.LaDimenian2:return e(I.c.LaDimenian,i);case I.c.SoDimenian2:return e(I.c.SoDimenian,i);case I.c.DarkBelra2:return e(I.c.DarkBelra,i);case I.c.SavageWolf2:return e(I.c.SavageWolf,i);case I.c.BarbarousWolf2:return e(I.c.BarbarousWolf,i);case I.c.PanArms2:return e(I.c.PanArms,i);case I.c.Dubchic2:return e(I.c.Dubchic,i);case I.c.Gilchic2:return e(I.c.Gilchic,i);case I.c.Garanz2:return e(I.c.Garanz,i);case I.c.Dubswitch2:return e(I.c.Dubswitch,i);case I.c.Delsaber2:return e(I.c.Delsaber,i);case I.c.ChaosSorcerer2:return e(I.c.ChaosSorcerer,i);default:return`/npcs/${I.c[t]}.${i===Wn.Geometry?"nj":"xvm"}`}else{if(i!==Wn.Geometry)return`/objects/${x(t).pso_id}.xvm`;switch(t){case w.EasterEgg:case w.ChristmasTree:case w.ChristmasWreath:case w.TwentyFirstCentury:case w.Sonic:case w.WelcomeBoard:case w.FloatingJellyfish:case w.RuinsSeal:case w.Dolphin:case w.Cacti:case w.BigBrownRock:case w.PoisonPlant:case w.BigBlackRocks:case w.FallingRock:case w.DesertFixedTypeBoxBreakableCrystals:case w.BeeHive:return`/objects/${x(t).pso_id}.nj`;default:return`/objects/${x(t).pso_id}.xj`}}}(e,t);return this.http_client.get(i).array_buffer().then(e=>({url:i,data:e}))}warm_up_caches(){for(const e of[I.c.Unknown,I.c.Migium,I.c.Hidoom,I.c.DeathGunner,I.c.StRappy,I.c.HalloRappy,I.c.EggRappy,I.c.Migium2,I.c.Hidoom2,I.c.Recon,w.Unknown,w.PlayerSet,w.Particle,w.LightCollision,w.EnvSound,w.FogCollision,w.EventCollision,w.CharaCollision,w.ObjRoomID,w.LensFlare,w.ScriptCollision,w.MapCollision,w.ScriptCollisionA,w.ItemLight,w.RadarCollision,w.FogCollisionSW,w.ImageBoard,w.UnknownItem29,w.UnknownItem30,w.UnknownItem31,w.MenuActivation,w.BoxDetectObject,w.SymbolChatObject,w.TouchPlateObject,w.TargetableObject,w.EffectObject,w.CountDownObject,w.UnknownItem38,w.UnknownItem39,w.UnknownItem40,w.UnknownItem41,w.TelepipeLocation,w.BGMCollision,w.Pioneer2InvisibleTouchplate,w.TempleMapDetect,w.Firework,w.MainRagolTeleporterBattleInNextArea,w.Rainbow,w.FloatingBlueLight,w.PopupTrapNoTech,w.Poison,w.EnemyTypeBoxYellow,w.EnemyTypeBoxBlue,w.EmptyTypeBoxBlue,w.FloatingRocks,w.FloatingSoul,w.Butterfly,w.UnknownItem400,w.CCAAreaTeleporter,w.UnknownItem523,w.WhiteBird,w.OrangeBird,w.UnknownItem529,w.UnknownItem530,w.Seagull,w.UnknownItem576,w.WarpInBarbaRayRoom,w.UnknownItem672,w.InstaWarp,w.LabInvisibleObject,w.UnknownItem700])this.geom_cache.set(e,Dn),this.tex_cache.set(e,En)}}var Wn;!function(e){e[e.Geometry=0]="Geometry",e[e.Texture=1]="Texture"}(Wn||(Wn={}));var qn=i("I7a6"),zn=i("LvDl"),Fn=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const Vn="QuestEditorUiPersister.layout_config";class Un extends qn.a{constructor(){super(...arguments),this.persist_layout_config=Object(zn.throttle)(e=>{this.persist(Vn,this.to_persisted_item_config(e))},500,{leading:!1,trailing:!0})}load_layout_config(e){return Fn(this,void 0,void 0,(function*(){const t=yield this.load(Vn);if(t){const i=this.extract_components(e),o=this.sanitized_layout_config(this.from_persisted_item_config(t),i);if(o)return o}}))}sanitized_layout_config(e,t){const i=new Set,o=e.map(e=>this.sanitize_layout_child(e,t,i));if(i.size===t.size)return o.filter(e=>e)}sanitize_layout_child(e,t,i){if(!e)return;switch(e.type){case"component":{if(!("componentName"in e))return;const o=t.get(e.componentName);if(!o)return;i.add(e.componentName),e.id=o.id,e.title=o.title}break;case"stack":if(null==e.content||0===e.content.length)return}e.content&&(e.content=e.content.map(e=>this.sanitize_layout_child(e,t,i)).filter(e=>e));const o=e;return null!=o.activeItemIndex&&(null==o.content||o.activeItemIndex>=o.content.length)&&(o.activeItemIndex=void 0),e}extract_components(e,t=new Map){for(const i of e)"componentName"in i&&t.set(i.componentName,i),i.content&&this.extract_components(i.content,t);return t}to_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.to_persisted_item_config(e.content)}))}from_persisted_item_config(e){return e.map(e=>({id:e.id,type:e.type,componentName:e.componentName,width:e.width,height:e.height,activeItemIndex:e.activeItemIndex,content:e.content&&this.from_persisted_item_config(e.content),isClosable:"component"!==e.type&&void 0}))}}var $n=i("6cU9");class Nn extends Ue.a{constructor(e){const t=new _t({text:"New quest",icon_left:v.a.NewFile,items:[r.b.I],to_label:e=>`Episode ${r.b[e]}`}),i=new $n.a("Open file...",{icon_left:v.a.File,accept:".bin, .dat, .qst",multiple:!0,tooltip:"Open a quest file (Ctrl-O)"}),o=new tt.a({text:"Save as...",icon_left:v.a.Save,tooltip:"Save this quest to new file (Ctrl-Shift-S)"}),s=new tt.a({text:"Undo",icon_left:v.a.Undo,tooltip:ys.first_undo.map(e=>(e?`Undo "${e.description}"`:"Nothing to undo")+" (Ctrl-Z)")}),n=new tt.a({text:"Redo",icon_left:v.a.Redo,tooltip:ys.first_redo.map(e=>(e?`Redo "${e.description}"`:"Nothing to redo")+" (Ctrl-Shift-Z)")}),a=new ds.a({items:e.areas,to_label:({label:e})=>e}),d=new tt.a({text:"Debug",icon_left:v.a.Play,tooltip:"Debug the current quest in a virtual machine (F5)"}),c=new tt.a({text:"Continue",icon_left:v.a.SquareArrowRight,tooltip:"Resume execution (F6)"}),l=new tt.a({text:"Step over",icon_left:v.a.LongArrowRight,tooltip:"Execute the next line and step over any function calls (F8)"}),_=new tt.a({text:"Step into",icon_left:v.a.LevelDown,tooltip:"Execute the next line and step inside any function calls (F7)"}),u=new tt.a({text:"Step out",icon_left:v.a.LevelUp,tooltip:"Execute until outside of current call frame (Shift-F8)"}),h=new tt.a({text:"Stop",icon_left:v.a.Stop,tooltip:"Stop execution (Shift-F5)"}),p=[t,i,o,s,n,a];e.vm_feature_active&&p.push(d,c,l,_,u,h),super(...p),this.disposables(t.chosen.observe(({value:t})=>e.create_new_quest(t)),i.files.observe(({value:t})=>e.open_files(t)),o.click.observe(e.save_as),o.enabled.bind_to(e.can_save),s.click.observe(()=>ys.undo()),s.enabled.bind_to(e.can_undo),n.click.observe(()=>ys.redo()),n.enabled.bind_to(e.can_redo),a.selected.bind_to(e.current_area),a.selected.observe(({value:t})=>e.set_area(t)),a.enabled.bind_to(e.can_select_area),d.click.observe(e.debug),d.enabled.bind_to(e.can_debug),c.click.observe(e.resume),c.enabled.bind_to(e.can_step),l.click.observe(e.step_over),l.enabled.bind_to(e.can_step),_.click.observe(e.step_in),_.enabled.bind_to(e.can_step),u.click.observe(e.step_out),u.enabled.bind_to(e.can_step),h.click.observe(e.stop),h.enabled.bind_to(e.can_stop)),this.finalize_construction()}}class An{constructor(){this.disposer=new d.a}dispose(){this.disposer.dispose()}disposable(e){return this.disposer.add(e)}disposables(...e){this.disposer.add_all(...e)}}const Hn=X.c.get("quest_editor/model/QuestModel");class Gn{constructor(e,t,i,o,s,n,a,d,c,l,_,u,v,h){this.area_store=e,this._id=Object(M.e)(0),this._language=Object(M.e)(0),this._name=Object(M.e)(""),this._short_description=Object(M.e)(""),this._long_description=Object(M.e)(""),this._area_variants=Object(M.c)(),this.id=this._id,this.language=this._language,this.name=this._name,this.short_description=this._short_description,this.long_description=this._long_description,this.area_variants=this._area_variants,this.update_area_variants=()=>{const e=new Map;for(const t of this.entities_per_area.val.keys())try{e.set(t,this.area_store.get_variant(this.episode,t,0))}catch(e){Hn.warn(e)}for(const[t,i]of this.map_designations.val)try{e.set(t,this.area_store.get_variant(this.episode,t,i))}catch(e){Hn.warn(e)}this._area_variants.val=[...e.values()]},Object(r.c)(a),Object(U.e)(d,"map_designations"),Object(U.h)(c,"objs"),Object(U.h)(l,"npcs"),Object(U.e)(_,"event_dags"),Object(U.h)(u,"dat_unknowns"),Object(U.h)(v,"object_code"),Object(U.h)(h,"shop_items"),this.set_id(t),this.set_language(i),this.set_name(o),this.set_short_description(s),this.set_long_description(n),this.episode=a,this._map_designations=Object(M.e)(d),this.map_designations=this._map_designations,this._objects=Object(M.c)(void 0,...c),this.objects=this._objects,this._npcs=Object(M.c)(void 0,...l),this.npcs=this._npcs,this.event_dags=_,this.dat_unknowns=u,this.object_code=v,this.shop_items=h,this.entities_per_area=Object(M.d)((e,t)=>{const i=new Map;for(const t of e)i.set(t.area_id,(i.get(t.area_id)||0)+1);for(const e of t)i.set(e.area_id,(i.get(e.area_id)||0)+1);return i},this.npcs,this.objects),this.entities_per_area.observe(this.update_area_variants,{call_now:!0}),this.map_designations.observe(this.update_area_variants,{call_now:!0})}set_id(e){return Object(U.c)(e>=0,`id should be greater than or equal to 0, was ${e}.`),this._id.val=e,this}set_language(e){return Object(U.c)(e>=0,`language should be greater than or equal to 0, was ${e}.`),this._language.val=e,this}set_name(e){return Object(U.c)(e.length<=32,`name can't be longer than 32 characters, got "${e}".`),this._name.val=e,this}set_short_description(e){return Object(U.c)(e.length<=128,`short_description can't be longer than 128 characters, got "${e}".`),this._short_description.val=e,this}set_long_description(e){return Object(U.c)(e.length<=288,`long_description can't be longer than 288 characters, got "${e}".`),this._long_description.val=e,this}set_map_designations(e){return this._map_designations.val=e,this}add_entity(e){if(e instanceof we)this.add_object(e);else{if(!(e instanceof K))throw new Error(`${C(e.type)} not supported.`);this.add_npc(e)}}add_object(e){this._objects.push(e)}add_npc(e){this._npcs.push(e)}remove_entity(e){if(e instanceof we)this._objects.remove(e);else{if(!(e instanceof K))throw new Error(`${C(e.type)} not supported.`);this._npcs.remove(e)}}insert_event(e,t,i,o){const s=t.wave.area_id.val;let n=this.event_dags.get(s);n||(n=new it(s),this.event_dags.set(s,n)),n.insert_event(e,t,i,o)}get_event_dag_or_create(e){let t=this.event_dags.get(e);return t||(t=new it(e),this.event_dags.set(e,t)),t}add_event(e,t,i){const o=e.wave.area_id.val;let s=this.event_dags.get(o);s||(s=new it(o),this.event_dags.set(o,s)),s.add_event(e,t,i)}remove_event(e,t){for(const e of this.npcs)e.wave.val===t.wave&&e.set_wave(void 0);e.remove_event(t)}}var Yn;!function(e){e[e.Int=0]="Int",e[e.Float=1]="Float",e[e.InvalidNumber=2]="InvalidNumber",e[e.Register=3]="Register",e[e.Label=4]="Label",e[e.CodeSection=5]="CodeSection",e[e.DataSection=6]="DataSection",e[e.StringSection=7]="StringSection",e[e.InvalidSection=8]="InvalidSection",e[e.String=9]="String",e[e.UnterminatedString=10]="UnterminatedString",e[e.Ident=11]="Ident",e[e.InvalidIdent=12]="InvalidIdent",e[e.ArgSeparator=13]="ArgSeparator"}(Yn||(Yn={}));class Kn{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(e){this.line=e,this.index=0,this._mark=0;const t=[];for(;this.has_next();){const e=this.peek();let i;if("/"===e){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(e)?this.skip():(/[-\d]/.test(e)?i=this.tokenize_number_or_label():","===e?(i={type:Yn.ArgSeparator,col:this.col,len:1},this.skip()):i="."===e?this.tokenize_section():'"'===e?this.tokenize_string():"r"===e?this.tokenize_register_or_ident():this.tokenize_ident(),t.push(i))}return t}has_next(){return this.index!]*$/.test(t)?Yn.Ident:Yn.InvalidIdent;return i===Yn.Ident?{type:i,col:e,len:this.marked_len(),value:t}:{type:i,col:e,len:this.marked_len()}}}const Qn=X.c.get("quest_editor/scripting/assembly");class Zn{constructor(e,t){this.assembly=e,this.manual_stack=t,this.lexer=new Kn,this.section=Bo.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=Bo.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const e of this.assembly){if(this.tokens=this.lexer.tokenize_line(e),this.tokens.length>0){const e=this.tokens.shift();let t=!1;switch(e.type){case Yn.Label:this.parse_label(e),t=!0;break;case Yn.CodeSection:case Yn.DataSection:case Yn.StringSection:this.parse_section(e);break;case Yn.Int:this.section===Bo.Data?this.parse_bytes(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Yn.String:this.section===Bo.String?this.parse_string(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Yn.Ident:this.section===Bo.Instructions?this.parse_instruction(e):this.add_error({col:e.col,length:e.len,message:"Unexpected token."});break;case Yn.InvalidSection:this.add_error({col:e.col,length:e.len,message:"Invalid section type."});break;case Yn.InvalidIdent:this.add_error({col:e.col,length:e.len,message:"Invalid identifier."});break;default:this.add_error({col:e.col,length:e.len,message:"Unexpected token."})}this.prev_line_had_label=t}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(e,t,i,o,s,n){if(this.segment)this.segment.type===Bo.Instructions?this.segment.instructions.push(Po(e,t,{mnemonic:o&&{line_no:this.line_no,col:o.col,len:o.len},args:s.map(e=>({line_no:this.line_no,col:e.col,len:e.len})),stack_args:n.map((e,t)=>({line_no:this.line_no,col:e.col,len:e.len,value:i[t].value}))})):Qn.error(`Line ${this.line_no}: Expected instructions segment.`);else{const e={labels:[],type:Bo.Instructions,instructions:[],asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_bytes(e){if(this.segment)if(this.segment.type===Bo.Data){const t=new ArrayBuffer(this.segment.data.byteLength+e.length),i=new Uint8Array(t);i.set(new Uint8Array(this.segment.data)),i.set(new Uint8Array(e),this.segment.data.byteLength),this.segment.data=t}else Qn.error(`Line ${this.line_no}: Expected data segment.`);else{const t={labels:[],type:Bo.Data,data:new Uint8Array(e).buffer,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_string(e){if(this.segment)this.segment.type===Bo.String?this.segment.value+=e:Qn.error(`Line ${this.line_no}: Expected string segment.`);else{const t={labels:[],type:Bo.String,value:e,asm:{labels:[]}};this.segment=t,this.object_code.push(t)}}add_error({col:e,length:t,message:i}){this.errors.push({line_no:this.line_no,col:e,length:t,message:i})}add_warning({col:e,length:t,message:i}){this.warnings.push({line_no:this.line_no,col:e,length:t,message:i})}parse_label({col:e,len:t,value:i}){this.labels.has(i)&&this.add_error({col:e,length:t,message:"Duplicate label."}),this.labels.add(i);const o=this.tokens.shift(),s={line_no:this.line_no,col:e,len:t};if(this.prev_line_had_label){const e=this.object_code[this.object_code.length-1];e.labels.push(i),e.asm.labels.push(s)}switch(this.section){case Bo.Instructions:this.prev_line_had_label||(this.segment={type:Bo.Instructions,labels:[i],instructions:[],asm:{labels:[s]}},this.object_code.push(this.segment)),o&&(o.type===Yn.Ident?this.parse_instruction(o):this.add_error({col:o.col,length:o.len,message:"Expected opcode mnemonic."}));break;case Bo.Data:this.prev_line_had_label||(this.segment={type:Bo.Data,labels:[i],data:new ArrayBuffer(0),asm:{labels:[s]}},this.object_code.push(this.segment)),o&&(o.type===Yn.Int?this.parse_bytes(o):this.add_error({col:o.col,length:o.len,message:"Expected bytes."}));break;case Bo.String:this.prev_line_had_label||(this.segment={type:Bo.String,labels:[i],value:"",asm:{labels:[s]}},this.object_code.push(this.segment)),o&&(o.type===Yn.String?this.parse_string(o):this.add_error({col:o.col,length:o.len,message:"Expected a string."}))}}parse_section({type:e,col:t,len:i}){let o;switch(e){case Yn.CodeSection:o=Bo.Instructions;break;case Yn.DataSection:o=Bo.Data;break;case Yn.StringSection:o=Bo.String}this.section!==o||this.first_section_marker||this.add_warning({col:t,length:i,message:"Unnecessary section marker."}),this.section=o,this.first_section_marker=!1;const s=this.tokens.shift();s&&this.add_error({col:s.col,length:s.len,message:"Unexpected token."})}parse_instruction(e){const{col:t,len:i,value:o}=e,s=zt.get(o);if(s){const i=-1!==s.params.findIndex(e=>e.type.kind===ft.ILabelVar||e.type.kind===ft.RegRefVar),o=this.manual_stack&&s.stack===Mt.Pop?0:s.params.length;let n=0;for(const e of this.tokens)e.type!==Yn.ArgSeparator&&n++;const r=this.tokens[this.tokens.length-1],a=r?r.col+r.len-t:0,d=[],c=[];if(!i&&n!==o)return void this.add_error({col:t,length:a,message:`Expected ${o} argument${1===o?"":"s"}, got ${n}.`});if(i&&nd?this.add_error({col:s,length:n,message:`${r}-Bit integer can't be greater than ${d}.`}):i.push([{value:o,size:e},t])}parse_register(e,t){const{col:i,len:o,value:s}=e;s>255?this.add_error({col:i,length:o,message:"Invalid register reference, expected r0-r255."}):t.push([{value:s,size:1},e])}parse_bytes(e){const t=[];let i=e,o=0;for(;i.type===Yn.Int&&(i.value<0?this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be less than 0."}):i.value>255&&this.add_error({col:i.col,length:i.len,message:"Unsigned 8-bit integer can't be greater than 255."}),t.push(i.value),o"))}}function Jn(e,t){if(t===r.b.II)throw new Error("Episode II not yet supported.");if(t===r.b.IV)throw new Error("Episode IV not yet supported.");return new Gn(e,0,0,"Untitled","Created with phantasmal.world.","Created with phantasmal.world.",t,(new Map).set(0,0),[new we(w.MenuActivation,16384,0,0,10,new y.Vector3(-16.313568115234375,3,-579.5118408203125),$(.0009587526218325454,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365279104]]),[[2,0,0,0,0,0],[0,0]]),new we(w.MenuActivation,16385,0,0,10,new y.Vector3(-393.07318115234375,10,-12.964752197265625),$(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279264]]),[[2,0,1,0,0,0],[0,0]]),new we(w.MenuActivation,16386,0,0,10,new y.Vector3(-458.60699462890625,10,-51.270660400390625),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365279424]]),[[2,0,2,0,0,0],[0,0]]),new we(w.MenuActivation,16387,0,0,10,new y.Vector3(-430.19696044921875,10,-24.490447998046875),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365279584]]),[[2,0,3,0,0,0],[0,0]]),new we(w.PlayerSet,16388,0,0,10,new y.Vector3(.995330810546875,0,-37.0010986328125),$(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279744]]),[[2,0,4,0,0,0],[0,0]]),new we(w.PlayerSet,16389,0,0,10,new y.Vector3(3.0009307861328125,0,-23.99688720703125),$(0,4.859725289544806,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365279904]]),[[2,0,5,0,0,0],[0,0]]),new we(w.PlayerSet,16390,0,0,10,new y.Vector3(2.0015106201171875,0,-50.00386047363281),$(0,4.565196484117848,0),new Map([["property_0",2.000002384185791],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365280064]]),[[2,0,6,0,0,0],[0,0]]),new we(w.PlayerSet,16391,0,0,10,new y.Vector3(4.9973907470703125,0,-61.99664306640625),$(0,4.368843947166543,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",65536],["property_4",10],["property_5",0],["property_6",2365280224]]),[[2,0,7,0,0,0],[0,0]]),new we(w.MainRagolTeleporter,18264,0,0,10,new y.Vector3(132.00314331054688,1.000000238418579,-265.002197265625),$(0,.49088134237826325,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365227216]]),[[0,0,87,7,0,0],[0,0]]),new we(w.PrincipalWarp,16393,0,0,10,new y.Vector3(-228,0,-2020.99951171875),$(0,2.9452880542695796,0),new Map([["property_0",-10.000004768371582],["property_1",0],["property_2",-30.000030517578125],["property_3",0],["property_4",65536],["property_5",65536],["property_6",2365280688]]),[[2,0,9,0,0,0],[0,0]]),new we(w.MenuActivation,16394,0,0,10,new y.Vector3(-41.000030517578125,0,42.37322998046875),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",4],["property_4",0],["property_5",0],["property_6",2365280992]]),[[2,0,10,0,0,0],[1,0]]),new we(w.MenuActivation,16395,0,0,10,new y.Vector3(-479.21673583984375,8.781256675720215,-322.465576171875),$(6.28328118244177,.0009587526218325454,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",5],["property_4",0],["property_5",0],["property_6",2365281152]]),[[2,0,11,0,0,0],[0,0]]),new we(w.PrincipalWarp,16396,0,0,10,new y.Vector3(-228,0,-351.0015869140625),$(0,0,0),new Map([["property_0",10.000006675720215],["property_1",0],["property_2",-1760.0010986328125],["property_3",32768],["property_4",0],["property_5",0],["property_6",2365281312]]),[[2,0,12,0,0,0],[0,0]]),new we(w.TelepipeLocation,16397,0,0,10,new y.Vector3(-561.88232421875,0,-406.8829345703125),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",0],["property_4",0],["property_5",0],["property_6",2365281616]]),[[2,0,13,0,0,0],[0,0]]),new we(w.TelepipeLocation,16398,0,0,10,new y.Vector3(-547.8557739257812,0,-444.8822326660156),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365281808]]),[[2,0,14,0,0,0],[0,0]]),new we(w.TelepipeLocation,16399,0,0,10,new y.Vector3(-486.441650390625,0,-497.4501647949219),$(0,0,0),new Map([["property_0",9183549615799121e-56],["property_1",1.0000011920928955],["property_2",1],["property_3",3],["property_4",0],["property_5",0],["property_6",2365282e3]]),[[2,0,15,0,0,0],[0,0]]),new we(w.TelepipeLocation,16400,0,0,10,new y.Vector3(-522.4052734375,0,-474.1882629394531),$(0,0,0),new Map([["property_0",1],["property_1",1],["property_2",1],["property_3",2],["property_4",65536],["property_5",10],["property_6",2365282192]]),[[2,0,16,0,0,0],[0,0]]),new we(w.MedicalCenterDoor,16401,0,0,10,new y.Vector3(-34.49853515625,0,-384.4951171875),$(0,5.497871034636549,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282384]]),[[2,0,17,0,0,0],[0,0]]),new we(w.ShopDoor,16402,0,0,10,new y.Vector3(-393.0031433105469,0,-143.49981689453125),$(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365282640]]),[[2,0,18,0,0,0],[0,0]]),new we(w.MenuActivation,16403,0,0,10,new y.Vector3(-355.17462158203125,0,-43.15193176269531),$(0,0,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",6],["property_4",0],["property_5",0],["property_6",2365282896]]),[[2,0,19,0,0,0],[0,0]]),new we(w.HuntersGuildDoor,16404,0,0,10,new y.Vector3(-43.00239562988281,0,-118.00120544433594),$(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283056]]),[[2,0,20,0,0,0],[0,0]]),new we(w.TeleporterDoor,16405,0,0,10,new y.Vector3(26.000823974609375,0,-265.99810791015625),$(0,3.141640591220885,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283312]]),[[2,0,21,0,0,0],[0,0]]),new we(w.PlayerSet,16406,0,0,10,new y.Vector3(57.81005859375,0,-268.5472412109375),$(0,4.712460886831327,0),new Map([["property_0",0],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283568]]),[[2,0,22,0,0,0],[0,0]]),new we(w.PlayerSet,16407,0,0,10,new y.Vector3(66.769287109375,0,-252.3748779296875),$(0,4.712460886831327,0),new Map([["property_0",1.000000238418579],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283728]]),[[2,0,23,0,0,0],[0,0]]),new we(w.PlayerSet,16408,0,0,10,new y.Vector3(67.36819458007812,0,-284.9297180175781),$(0,4.712460886831327,0),new Map([["property_0",2.000000476837158],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365283888]]),[[2,0,24,0,0,0],[0,0]]),new we(w.PlayerSet,16409,0,0,10,new y.Vector3(77.10488891601562,0,-269.2830505371094),$(0,4.712460886831327,0),new Map([["property_0",3.0000007152557373],["property_1",1],["property_2",1],["property_3",1],["property_4",0],["property_5",0],["property_6",2365284048]]),[[2,0,25,0,0,0],[0,0]])],[new K(I.c.GuildLady,29,1011.0010986328125,void 0,0,850,0,0,10,new y.Vector3(-49.0010986328125,0,50.996429443359375),$(0,2.3562304434156633,0),new y.Vector3(0,0,0),[[0,0,7,86,0,0,0,0,23,87],[128,238,223,176]]),new K(I.c.FemaleFat,4,1016.0010986328125,void 0,0,100,1,0,20,new y.Vector3(167.99769592285156,0,83.99686431884766),$(0,3.927050739026106,0),new y.Vector3(24.000009536743164,0,0),[[0,0,7,88,0,0,0,0,23,89],[128,238,232,48]]),new K(I.c.MaleDwarf,10,1015.0010986328125,void 0,0,90,1,0,20,new y.Vector3(156.0028839111328,0,-49.99967575073242),$(0,5.497871034636549,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,89,0,0,0,0,23,90],[128,238,236,176]]),new K(I.c.RedSoldier,26,1020.0010986328125,void 0,0,130,0,0,20,new y.Vector3(237.9988250732422,0,-14.0001220703125),$(0,5.497871034636549,0),new y.Vector3(0,0,0),[[0,0,7,90,0,0,0,0,23,91],[128,238,241,48]]),new K(I.c.BlueSoldier,25,1019.0010986328125,void 0,0,120,0,0,20,new y.Vector3(238.00379943847656,0,63.00413513183594),$(0,3.927050739026106,0),new y.Vector3(0,0,0),[[0,0,7,91,0,0,0,0,23,92],[128,238,245,176]]),new K(I.c.FemaleMacho,5,1014.0010986328125,void 0,0,80,1,0,20,new y.Vector3(-2.001882553100586,0,35.0036506652832),$(0,3.141640591220885,0),new y.Vector3(26.000009536743164,0,0),[[0,0,7,92,0,0,0,0,23,93],[128,238,250,48]]),new K(I.c.Scientist,30,1013.0010986328125,void 0,0,70,1,0,20,new y.Vector3(-147.0000457763672,0,-7.996537208557129),$(0,2.577127047485882,0),new y.Vector3(30.000009536743164,0,0),[[0,0,7,93,0,0,0,0,23,94],[128,238,254,176]]),new K(I.c.MaleOld,13,1012.0010986328125,void 0,0,60,1,0,20,new y.Vector3(-219.99710083007812,0,-100.0008316040039),$(0,0,0),new y.Vector3(30.000011444091797,0,0),[[0,0,7,94,0,0,0,0,23,95],[128,239,3,48]]),new K(I.c.GuildLady,29,1010.0010986328125,void 0,0,840,0,0,20,new y.Vector3(-262.5099792480469,0,-24.53999900817871),$(0,1.963525369513053,0),new y.Vector3(0,0,0),[[0,0,7,95,0,0,0,0,23,106],[128,239,100,192]]),new K(I.c.Tekker,28,1009,void 0,0,830,0,0,30,new y.Vector3(-43.70983123779297,2.5999999046325684,-52.78248596191406),$(0,.7854101478052212,0),new y.Vector3(0,0,0),[[0,0,7,97,0,0,0,0,23,98],[128,239,16,176]]),new K(I.c.MaleMacho,12,1006,void 0,0,800,0,0,30,new y.Vector3(.33990478515625,2.5999999046325684,-84.71995544433594),$(0,0,0),new y.Vector3(0,0,0),[[0,0,7,98,0,0,0,0,23,99],[128,239,21,48]]),new K(I.c.FemaleMacho,5,1008,void 0,0,820,0,0,30,new y.Vector3(43.87113952636719,2.5999996662139893,-74.80299377441406),new y.Euler(0,-.5645135437350027,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,99,0,0,0,0,23,100],[128,239,25,176]]),new K(I.c.MaleFat,11,1007.0010986328125,void 0,0,810,0,0,30,new y.Vector3(75.88380432128906,2.5999996662139893,-42.69328308105469),new y.Euler(0,-1.0308508189943528,0,"ZXY"),new y.Vector3(0,0,0),[[0,0,7,100,0,0,0,0,23,101],[128,239,30,48]]),new K(I.c.FemaleTall,7,1021.0010986328125,void 0,0,140,1,0,30,new y.Vector3(16.003997802734375,0,5.995697021484375),new y.Euler(0,-1.1781152217078317,0,"ZXY"),new y.Vector3(22.000009536743164,0,0),[[0,0,7,101,0,0,0,0,23,102],[128,239,34,176]]),new K(I.c.Nurse,31,1017,void 0,0,860,0,0,40,new y.Vector3(.3097381591796875,3,-105.3865966796875),$(0,0,0),new y.Vector3(0,0,0),[[0,0,7,102,0,0,0,0,23,103],[128,239,39,48]]),new K(I.c.Nurse,31,1018.0010986328125,void 0,0,110,1,0,40,new y.Vector3(53.499176025390625,0,-26.496688842773438),$(0,5.497871034636549,0),new y.Vector3(18.000009536743164,0,0),[[0,0,7,103,0,0,0,0,23,104],[128,239,43,176]])],new Map,[],function(e,t=!1){Qn.trace("assemble start");const i=new Zn(e,t).assemble();return Qn.trace(`assemble end with ${i.warnings.length} warnings and ${i.errors.length} errors.`),i}(".code\n\n0:\n set_episode 0\n set_floor_handler 0, 150\n bb_map_designate 0, 0, 0, 0\n ret\n150:\n leti r60, 237\n leti r61, 0\n leti r62, 333\n leti r63, -15\n p_setpos 0, r60\n leti r60, 255\n leti r61, 0\n leti r62, 338\n leti r63, -43\n p_setpos 1, r60\n leti r60, 222\n leti r61, 0\n leti r62, 322\n leti r63, 25\n p_setpos 2, r60\n leti r60, 248\n leti r61, 0\n leti r62, 323\n leti r63, -20\n p_setpos 3, r60\n ret".split("\n")).object_code,[])}var Xn=i("Sa3/"),er=i("9dYx");class tr extends er.a{constructor(e,t,i=0,o=e.size-i){if(i<0||i>e.size)throw new Error(`Offset ${i} is out of bounds.`);if(o<0||i+o>e.size)throw new Error(`Size ${o} is out of bounds.`);super(t,i),this.buffer=e,this._size=o}get size(){return this._size}set size(e){e>this._size?this.ensure_size(e-this.position):this._size=e}get backing_buffer(){return this.buffer.backing_buffer}get dv(){return this.buffer.view}take(e){this.check_size("size",e,e);const t=this.offset+this.position,i=new tr(this.buffer,this.endianness,t,e);return this._position+=e,i}ensure_size(e,t=this.position){const i=t+e-this._size;i>0&&(this._size+=i,this.buffer.sizethis.capacity){let t=this.capacity||e;do{t*=2}while(t=s;t--){let s=e.position,n=t,r=0;for(;s+3=o&&(i=t,o=r,r>=255))break}o<3?t.add_u8(e.u8()):(t.copy(i-e.position,o),e.seek(o))}return t.finalize()}class sr{constructor(e,t){this.flags=0,this.flag_bits_left=0,this.flag_offset=0,this.output=new tr(new ir(e),t)}add_u8(e){this.write_control_bit(1),this.write_u8(e)}copy(e,t){e>-256&&t<=5?this.short_copy(e,t):this.long_copy(e,t)}finalize(){this.write_control_bit(0),this.write_control_bit(1),this.flags>>>=this.flag_bits_left;const e=this.output.position;return this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e),this.write_u8(0),this.write_u8(0),this.output.seek_start(0)}write_control_bit(e){if(0==this.flag_bits_left--){const e=this.output.position;this.output.seek_start(this.flag_offset).write_u8(this.flags).seek_start(e).write_u8(0),this.flag_offset=e,this.flag_bits_left=7}this.flags>>>=1,e&&(this.flags|=128)}write_u8(e){this.output.write_u8(e)}short_copy(e,t){t-=2,this.write_control_bit(0),this.write_control_bit(0),this.write_control_bit(t>>>1&1),this.write_control_bit(1&t),this.write_u8(255&e)}long_copy(e,t){t<=9?(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248|t-2&7),this.write_u8(e>>5&255)):(this.write_control_bit(0),this.write_control_bit(1),this.write_u8(e<<3&248),this.write_u8(e>>5&255),this.write_u8(t-1))}}const nr=X.c.get("core/data_formats/compression/prs/decompress");function rr(e){const t=new ar(e);for(;;)if(1===t.read_flag_bit())t.copy_u8();else{let e,i;if(0===t.read_flag_bit())e=t.read_flag_bit()<<1,e|=t.read_flag_bit(),e+=2,i=t.read_u8()-256;else{if(i=t.read_u16(),0===i)break;e=7&i,i>>>=3,0===e?(e=t.read_u8(),e+=1):e+=2,i-=8192}t.offset_copy(i,e)}return t.dst.seek_start(0)}class ar{constructor(e){this.src=e,this.dst=new tr(new ir(Math.floor(1.5*e.size)),e.endianness),this.flags=0,this.flag_bits_left=0}read_flag_bit(){0===this.flag_bits_left&&(this.flags=this.read_u8(),this.flag_bits_left=8);const e=1&this.flags;return this.flags>>>=1,this.flag_bits_left-=1,e}copy_u8(){this.dst.write_u8(this.read_u8())}read_u8(){return this.src.u8()}read_u16(){return this.src.u16()}offset_copy(e,t){(e<-8192||e>0)&&nr.error(`offset was ${e}, should be between -8192 and 0.`),(t<1||t>256)&&nr.error(`length was ${t}, should be between 1 and 256.`);const i=Math.min(-e,t);this.dst.seek(e);const o=this.dst.take(i);this.dst.seek(-e-i);for(let e=0;ee+t.total_size,0)),n=new tr(s,Vo.a.Little);!function(e,t){const i=Object(zn.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],s=o.length*lr;e.write_u32(1),e.write_u32(s+16),e.write_u32(t),e.write_u32(s);for(const t of o)Object(U.c)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(U.c)(6===t.unknown[0].length,()=>`unknown[0] should be of length 6, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.id),e.write_u16(t.group_id),e.write_u16(t.section_id),Object(U.c)(2===t.unknown[1].length,()=>`unknown[1] should be of length 2, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1]),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),Object(U.c)(7===t.properties.length,()=>`properties should be of length 7, was ${t.properties.length}`),e.write_f32(t.properties[0]),e.write_f32(t.properties[1]),e.write_f32(t.properties[2]),e.write_u32(t.properties[3]),e.write_u32(t.properties[4]),e.write_u32(t.properties[5]),e.write_u32(t.properties[6])}}(n,e),function(e,t){const i=Object(zn.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t],s=o.length*_r;e.write_u32(2),e.write_u32(s+16),e.write_u32(t),e.write_u32(s);for(const t of o)Object(U.c)(2===t.unknown.length,()=>`unknown should be of length 2, was ${t.unknown.length}`),e.write_u16(t.type_id),Object(U.c)(10===t.unknown[0].length,()=>`unknown[0] should be of length 10, was ${t.unknown[0].length}`),e.write_u8_array(t.unknown[0]),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u32(t.wave2),e.write_vec3_f32(t.position),e.write_i32(Math.round(t.rotation.x/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.y/(2*Math.PI)*65535)),e.write_i32(Math.round(t.rotation.z/(2*Math.PI)*65535)),e.write_vec3_f32(t.scale),e.write_f32(t.npc_id),e.write_f32(t.script_label),e.write_u32(t.roaming),Object(U.c)(4===t.unknown[1].length,()=>`unknown[1] should be of length 4, was ${t.unknown[1].length}`),e.write_u8_array(t.unknown[1])}}(n,t),function(e,t){const i=Object(zn.groupBy)(t,e=>e.area_id),o=Object.keys(i).map(e=>parseInt(e,10)).sort((e,t)=>e-t);for(const t of o){const o=i[t];e.write_u32(3);const s=e.position;e.write_u32(0),e.write_u32(t);const n=e.position;e.write_u32(0);const r=e.position,a=r+16+20*o.length;e.size=Math.max(a,e.size),e.write_u32(a-r),e.write_u32(16),e.write_u32(o.length),e.write_u32(0);let d=0;for(const t of o){e.write_u32(t.id),e.write_u32(65536),e.write_u16(t.section_id),e.write_u16(t.wave),e.write_u16(t.delay),e.write_u16(t.unknown),e.write_u32(d);const i=e.position;e.seek_start(a+d);for(const i of t.actions)switch(e.write_u8(i.type),i.type){case ur.SpawnNpcs:e.write_u16(i.section_id),e.write_u16(i.appear_flag);break;case ur.Unlock:case ur.Lock:e.write_u16(i.door_id);break;case ur.TriggerEvent:e.write_u32(i.event_id);break;default:throw new Error(`Unknown event action type ${i.type}.`)}e.write_u8(1),d=e.position-a,e.seek_start(i)}for(e.seek_start(a+d);(e.position-a)%4!=0;)e.write_u8(255);const c=e.position;e.seek_start(s),e.write_u32(c-r+16),e.seek_start(n),e.write_u32(c-r),e.seek_start(c)}}(n,i);for(const e of o)n.write_u32(e.entity_type),n.write_u32(e.total_size),n.write_u32(e.area_id),n.write_u32(e.entities_size),n.write_u8_array(e.data);return n.write_u32(0),n.write_u32(0),n.write_u32(0),n.write_u32(0),s}function pr(e,t,i){const o=Math.floor(e.size/lr);for(let s=0;s=l;){const r=e.position;let a;switch(t){case vr.DC:case vr.GC:e.seek(1),a=e.u8(),e.seek(2);break;case vr.PC:e.seek(3),a=e.u8();break;case vr.BB:e.seek(4),a=e.u32()}const d=e.string_ascii(16,!0,!0);let u=c.get(d);if(!u){const e=i.get(d);u={name:d,expected_size:null===(o=e)||void 0===o?void 0:o.size,cursor:new tr(new ir((n=null===(s=e)||void 0===s?void 0:s.size,null!=n?n:10240)),Vo.a.Little),chunk_nos:new Set},c.set(d,u)}u.chunk_nos.has(a)?mr.warn(`File chunk number ${a} of file ${d} was already encountered, overwriting previous chunk.`):u.chunk_nos.add(a);let v=e.seek(Ir).u32();e.seek(-Ir-4),v>Ir&&(mr.warn(`Data segment size of ${v} is larger than expected maximum size, reading just ${Ir} bytes.`),v=Ir);const h=e.take(v),p=a*Ir;if(u.cursor.size=Math.max(p+v,u.cursor.size),u.cursor.seek_start(p).write_cursor(h),e.seek(Ir+_-h.size),e.position!==r+l)throw new Error(`Read ${e.position-r} file chunk message bytes instead of expected ${l}.`)}e.bytes_left&&mr.warn(`${e.bytes_left} Bytes left in file.`);for(const e of c.values()){e.cursor.seek_start(0),e.chunk_nos=new Set(Array.from(e.chunk_nos.values()).sort((e,t)=>e-t)),null!=e.expected_size&&e.cursor.size!==e.expected_size&&mr.warn(`File ${e.name} has an actual size of ${e.cursor.size} instead of the expected size ${e.expected_size}.`);const t=Math.max(e.cursor.size,null!=(r=e.expected_size)?r:0),i=Math.ceil(t/Ir);for(let t=0;t[e.file_name,e])))}}function xr(e){const t=e.files,i=t.map(e=>88+1056*Math.ceil(e.data.byteLength/1024)).reduce((e,t)=>e+t),o=new ArrayBuffer(i),s=new $o.a(o,Vo.a.Little);if(function(e,t){for(const i of t){if(i.filename.length>15)throw new Error(`File ${i.filename} has a name longer than 15 characters.`);e.write_u16(88),e.write_u16(68),e.write_u16(i.id||0);for(let t=0;t<38;++t)e.write_u8(0);let t;if(e.write_string_ascii(i.filename,16),e.write_u32(i.data.byteLength),null==i.quest_name){const e=i.filename.lastIndexOf(".");t=-1===e?i.filename+"_j":i.filename.slice(0,e)+"_j"+i.filename.slice(e)}else t=i.quest_name;if(t.length>24)throw Error(`File ${i.filename} has a file_name_2 length (${t}) longer than 24 characters.`);e.write_string_ascii(t,24)}}(s,t),function(e,t){const i=t.map(e=>({no:0,data:new $o.a(e.data,Vo.a.Little),name:e.filename}));let o=0;for(;o0}var Sr;!function(e){e[e.None=0]="None",e[e.Return=1]="Return",e[e.Jump=2]="Jump",e[e.ConditionalJump=3]="ConditionalJump",e[e.Call=4]="Call"}(Sr||(Sr={}));class Cr{constructor(e,t,i,o,s){this.from=[],this.to=[],this.segment=e,this.start=t,this.end=i,this.branch_type=o,this.branch_labels=s}link_to(e){this.to.includes(e)||(this.to.push(e),e.from.push(this))}index_of_instruction(e){const t=this.segment.instructions.indexOf(e,this.start);return te.value);break;case wi.code:case Yt.code:a=Sr.Call,d=[r.args[0].value];break;case Ni.code:a=Sr.Call,d=r.args.slice(1).map(e=>e.value);break;default:if(n===i-1){a=Sr.None,d=[];break}continue}const c=new Cr(t,o,n+1,a,d);for(let t=c.start;t{let e=0,t=NaN;return{next:()=>{let i=!0;return ethis.intervals[e].end?(e++,ee+t.end-t.start+1,0)}get(e){for(const{start:t,end:i}of this.intervals){const o=i-t+1;if(ethis.intervals[o].start;)e.end=this.intervals[o].end,o++;this.intervals.splice(t+1,o-t-1),e.end=Math.max(e.end,i.end),t++;continue e}t++}this.intervals.push(i)}return this}to_array(){const e=[];for(const{start:t,end:i}of this.intervals)for(let o=t;o<=i;o++)e.push(o);return e}}const Br=X.c.get("core/data_formats/asm/data_flow_analysis/register_value"),Er=Dt,Mr=Bt;Math.pow(2,32);function Wr(e,t,i){const o=e.get_block_for_instruction(t);return o?function e(t,i,o,s,n){if(++t.iterations>100)return Br.warn("Too many iterations."),(new Dr).set_interval(Er,Mr);for(let r=s-1;r>=o.start;r--){const s=o.segment.instructions[r],a=s.args;switch(s.opcode.code){case Kt.code:if(a[0].value===n)return e(t,new Set(i),o,r,a[1].value);break;case Qt.code:case Zt.code:case Jt.code:case ho.code:if(a[0].value===n)return(new Dr).set_value(a[1].value);break;case ei.code:if(a[0].value===n)return(new Dr).set_value(1);break;case ti.code:if(a[0].value===n)return(new Dr).set_value(0);break;case ii.code:if(a[0].value===n){const s=e(t,new Set(i),o,r,n),a=s.size();return 0===a||1===a&&0===s.get(0)?(new Dr).set_value(1):s.has(0)?(new Dr).set_interval(0,1):(new Dr).set_value(0)}break;case si.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_add(a[1].value)}break;case ri.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_sub(a[1].value)}break;case di.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_mul(a[1].value)}break;case li.code:if(a[0].value===n){return e(t,new Set(i),o,r,n).scalar_div(a[1].value)}break;case co.code:if(a[0].value===n)return(new Dr).set_interval(0,1);break;case uo.code:if(a[0].value===n)return(new Dr).set_interval(0,2);break;case po.code:if(a[0].value===n)return(new Dr).set_interval(0,3);break;case mo.code:if(a[1].value===n){const s=e(t,new Set(i),o,r,a[0].value).min()||0,n=Math.max(e(t,new Set(i),o,r,a[0].value+1).max()||0,s+1);return(new Dr).set_interval(s,n-1)}break;case Gi.code:case Yi.code:{const e=a[0].value,t=a[0].value+a[1].value;if(e<=n&&n100)return zr.warn("Too many iterations."),(new Dr).set_interval(Fr,Vr);for(let e=s-1;e>=o.start;e--){const i=o.segment.instructions[e];if(i.opcode.stack===Mt.Pop){n+=i.opcode.params.length;continue}const s=i.args;switch(i.opcode.code){case Ki.code:if(0===n)return Wr(t.cfg,i,s[0].value);n--;break;case Qi.code:case Zi.code:case Ji.code:if(0===n)return(new Dr).set_value(s[0].value);n--;break;case Xi.code:case eo.code:case to.code:if(0===n)return(new Dr).set_interval(Fr,Vr);n--}}const r=new Dr;i.add(o);for(const s of o.from){if(i.has(s)){r.set_interval(Fr,Vr);break}r.union(e(t,new Set(i),s,s.end,n))}return r}(new $r(e),new Set,o,o.index_of_instruction(t),i):new Dr}class $r{constructor(e){this.cfg=e,this.iterations=0}}const Nr=X.c.get("core/data_formats/parsing/quest/object_code"),Ar=[];function Hr(e,t,i,o,s){return function(e,t,i,o,s){const n=new Map;!function(e,t,i,o,s,n){let r;do{r=o.size;for(const[r,a]of i)Yr(o,t,e,r,a,s,n);const a=[...o.entries()].filter(([,e])=>e.type===Bo.Instructions).sort(([e],[t])=>e-t).map(([,e])=>e),d=Or.create(a);i=new Map;for(const e of a)for(const t of e.instructions)for(let e=0;er)}(e,t,i.reduce((e,t)=>e.set(t,Bo.Instructions),new Map),n,o,s);const r=[];let a=0;for(;aa){s=e.offset;break}}if(e.seek_start(a),Kr(n,e,s,o||[]),i=n.get(a),s<=a){Nr.error(`Next offset ${s} was smaller than or equal to current offset ${a}.`);break}if(!i){Nr.error(`Couldn't create segment for offset ${a}.`);break}}switch(r.push(i),i.type){case Bo.Instructions:for(const e of i.instructions)a+=e.size;break;case Bo.Data:a+=i.data.byteLength;break;case Bo.String:a+=4*Math.ceil((i.value.length+1)/2);break;default:throw new Error(`${Bo[i.type]} not implemented.`)}}for(const{label:e,offset:i}of t.labels){const t=n.get(i);t?t.labels.includes(e)||(t.labels.push(e),t.labels.sort((e,t)=>e-t)):Nr.warn(`Label ${e} with offset ${i} does not point to anything.`)}if(e.size!==a){const t=`Expected to parse ${e.size} bytes but parsed ${a} instead.`;if(!o)throw new Error(t);Nr.error(t)}return r}(new $o.a(e,Vo.a.Little),new Zr(t),i,o,s)}function Gr(e,t,i,o,s){if(i.opcode.stack===Mt.Pop){const n=Ur(e,i,i.opcode.params.length-o-1);if(n.size()<=10)for(const e of n){const i=t.get(e);(null==i||Ar[s]>Ar[i])&&t.set(e,s)}}else{const e=i.args[o].value,n=t.get(e);(null==n||Ar[s]>Ar[n])&&t.set(e,s)}}function Yr(e,t,i,o,s,n,r){try{const a=t.get_info(o);if(null==a)return void Nr.warn(`Label ${o} is not registered in the label table.`);const d=e.get(a.offset);let c;if(d){if(d.labels.includes(o)||(d.labels.push(o),d.labels.sort((e,t)=>e-t)),!(Ar[s]>Ar[d.type]))return;c=d.labels}else c=[o];const l=a.next?a.next.offset:i.size;switch(i.seek_start(a.offset),s){case Bo.Instructions:!function(e,t,i,o,s,n,r,a){const d=[],c={type:Bo.Instructions,labels:s,instructions:d,asm:{labels:[]}};e.set(i.position,c);for(;i.position=0;e--){const t=d[e].opcode;if(t.code===Ut.code||t.code===mi.code){o=!1;break}}o&&Yr(e,t,i,n,Bo.Instructions,r,a)}}(e,t,i,l,c,a.next&&a.next.label,n,r);break;case Bo.Data:Kr(e,i,l,c);break;case Bo.String:!function(e,t,i,o,s){const n=t.position,r={type:Bo.String,labels:o,value:s?t.string_ascii(i-n,!0,!0):t.string_utf16(i-n,!0,!0),asm:{labels:[]}};e.set(n,r)}(e,i,l,c,r);break;default:throw new Error(`Segment type ${Bo[s]} not implemented.`)}}catch(e){if(!n)throw e;Nr.error("Couldn't fully parse object code segment.",e)}}function Kr(e,t,i,o){const s=t.position,n={type:Bo.Data,labels:o,data:t.array_buffer(i-s),asm:{labels:[]}};e.set(s,n)}function Qr(e,t,i){const o=[];if(t.stack!==Mt.Pop)for(const s of t.params)switch(s.type.kind){case ft.Byte:o.push(Do(e.u8(),1));break;case ft.Word:o.push(Do(e.u16(),2));break;case ft.DWord:o.push(Do(e.i32(),4));break;case ft.Float:o.push(Do(e.f32(),4));break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:o.push(Do(e.u16(),2));break;case ft.String:{const t=e.position,s=Math.min(4096,e.bytes_left);o.push(Do(i?e.string_ascii(s,!0,!1):e.string_utf16(s,!0,!1),e.position-t))}break;case ft.ILabelVar:{const t=e.u8();o.push(...e.u16_array(t).map(e=>Do(e,2)))}break;case ft.RegRef:case ft.RegTupRef:o.push(Do(e.u8(),1));break;case ft.RegRefVar:{const t=e.u8();o.push(...e.u8_array(t).map(e=>Do(e,1)))}break;default:throw new Error(`Parameter type ${ft[s.type.kind]} not implemented.`)}return o}Ar[Bo.Instructions]=2,Ar[Bo.String]=1,Ar[Bo.Data]=0;class Zr{constructor(e){this.labels=[],this.label_map=new Map,this.offset_map=new Map;for(let t=0;te.offset-t.offset||e.label-t.label);for(let e=0;et.offset));e++)i=void 0;return{offset:t.offset,next:i}}}const Jr=X.c.get("core/data_formats/asm/data_flow_analysis/map_designations");const Xr=X.c.get("core/data_formats/parsing/quest");function ea(e,t,i=!1){const o=rr(e),{bin:s,dc_gc_format:n}=function(e){const t=e.u32(),i=e.u32(),o=e.u32();e.seek(4);const s=4652!==t;let n,r;s?(r=e.u16(),n=e.u16()):(n=e.u32(),r=e.u32());const a=s?e.string_ascii(32,!0,!0):e.string_utf16(64,!0,!0),d=s?e.string_ascii(128,!0,!0):e.string_utf16(256,!0,!0),c=s?e.string_ascii(288,!0,!0):e.string_utf16(576,!0,!0);o!==e.size&&dr.warn(`Value ${o} in bin size field does not match actual size ${e.size}.`),e.seek(4);const l=e.u32_array(932),_=Math.floor((e.size-i)/4);e.seek_start(i);const u=e.i32_array(_);return{bin:{quest_id:n,language:r,quest_name:a,short_description:d,long_description:c,object_code:e.seek_start(t).array_buffer(i-t),label_offsets:u,shop_items:l},dc_gc_format:s}}(o),a=function(e){const t=[],i=[],o=[],s=[];for(;e.bytes_left;){const n=e.u32(),r=e.u32(),a=e.u32(),d=e.u32();if(0===n)break;{if(d!==r-16)throw Error(`Malformed DAT file. Expected an entities size of ${r-16}, got ${d}.`);const c=e.take(d);1===n?pr(c,a,t):2===n?gr(c,a,i):3===n?br(c,a,o):s.push({entity_type:n,total_size:r,area_id:a,entities_size:d,data:e.u8_array(d)}),c.bytes_left&&cr.warn(`Read ${c.position} bytes instead of expected ${c.size} for entity type ${n}.`)}}return{objs:t,npcs:i,events:o,unknowns:s}}(rr(t)),d=a.objs.map(e=>{const t=function(e){switch(e){default:return w.Unknown;case 0:return w.PlayerSet;case 1:return w.Particle;case 2:return w.Teleporter;case 3:return w.Warp;case 4:return w.LightCollision;case 5:return w.Item;case 6:return w.EnvSound;case 7:return w.FogCollision;case 8:return w.EventCollision;case 9:return w.CharaCollision;case 10:return w.ElementalTrap;case 11:return w.StatusTrap;case 12:return w.HealTrap;case 13:return w.LargeElementalTrap;case 14:return w.ObjRoomID;case 15:return w.Sensor;case 16:return w.UnknownItem16;case 17:return w.LensFlare;case 18:return w.ScriptCollision;case 19:return w.HealRing;case 20:return w.MapCollision;case 21:return w.ScriptCollisionA;case 22:return w.ItemLight;case 23:return w.RadarCollision;case 24:return w.FogCollisionSW;case 25:return w.BossTeleporter;case 26:return w.ImageBoard;case 27:return w.QuestWarp;case 28:return w.Epilogue;case 29:return w.UnknownItem29;case 30:return w.UnknownItem30;case 31:return w.UnknownItem31;case 32:return w.BoxDetectObject;case 33:return w.SymbolChatObject;case 34:return w.TouchPlateObject;case 35:return w.TargetableObject;case 36:return w.EffectObject;case 37:return w.CountDownObject;case 38:return w.UnknownItem38;case 39:return w.UnknownItem39;case 40:return w.UnknownItem40;case 41:return w.UnknownItem41;case 64:return w.MenuActivation;case 65:return w.TelepipeLocation;case 66:return w.BGMCollision;case 67:return w.MainRagolTeleporter;case 68:return w.LobbyTeleporter;case 69:return w.PrincipalWarp;case 70:return w.ShopDoor;case 71:return w.HuntersGuildDoor;case 72:return w.TeleporterDoor;case 73:return w.MedicalCenterDoor;case 74:return w.Elevator;case 75:return w.EasterEgg;case 76:return w.ValentinesHeart;case 77:return w.ChristmasTree;case 78:return w.ChristmasWreath;case 79:return w.HalloweenPumpkin;case 80:return w.TwentyFirstCentury;case 81:return w.Sonic;case 82:return w.WelcomeBoard;case 83:return w.Firework;case 84:return w.LobbyScreenDoor;case 85:return w.MainRagolTeleporterBattleInNextArea;case 86:return w.LabTeleporterDoor;case 87:return w.Pioneer2InvisibleTouchplate;case 128:return w.ForestDoor;case 129:return w.ForestSwitch;case 130:return w.LaserFence;case 131:return w.LaserSquareFence;case 132:return w.ForestLaserFenceSwitch;case 133:return w.LightRays;case 134:return w.BlueButterfly;case 135:return w.Probe;case 136:return w.RandomTypeBox1;case 137:return w.ForestWeatherStation;case 138:return w.Battery;case 139:return w.ForestConsole;case 140:return w.BlackSlidingDoor;case 141:return w.RicoMessagePod;case 142:return w.EnergyBarrier;case 143:return w.ForestRisingBridge;case 144:return w.SwitchNoneDoor;case 145:return w.EnemyBoxGrey;case 146:return w.FixedTypeBox;case 147:return w.EnemyBoxBrown;case 149:return w.EmptyTypeBox;case 150:return w.LaserFenceEx;case 151:return w.LaserSquareFenceEx;case 192:return w.FloorPanel1;case 193:return w.Caves4ButtonDoor;case 194:return w.CavesNormalDoor;case 195:return w.CavesSmashingPillar;case 196:return w.CavesSign1;case 197:return w.CavesSign2;case 198:return w.CavesSign3;case 199:return w.HexagonalTank;case 200:return w.BrownPlatform;case 201:return w.WarningLightObject;case 203:return w.Rainbow;case 204:return w.FloatingJellyfish;case 205:return w.FloatingDragonfly;case 206:return w.CavesSwitchDoor;case 207:return w.RobotRechargeStation;case 208:return w.CavesCakeShop;case 209:return w.Caves1SmallRedRock;case 210:return w.Caves1MediumRedRock;case 211:return w.Caves1LargeRedRock;case 212:return w.Caves2SmallRock1;case 213:return w.Caves2MediumRock1;case 214:return w.Caves2LargeRock1;case 215:return w.Caves2SmallRock2;case 216:return w.Caves2MediumRock2;case 217:return w.Caves2LargeRock2;case 218:return w.Caves3SmallRock;case 219:return w.Caves3MediumRock;case 220:return w.Caves3LargeRock;case 222:return w.FloorPanel2;case 223:return w.DestructableRockCaves1;case 224:return w.DestructableRockCaves2;case 225:return w.DestructableRockCaves3;case 256:return w.MinesDoor;case 257:return w.FloorPanel3;case 258:return w.MinesSwitchDoor;case 259:return w.LargeCryoTube;case 260:return w.ComputerLikeCalus;case 261:return w.GreenScreenOpeningAndClosing;case 262:return w.FloatingRobot;case 263:return w.FloatingBlueLight;case 264:return w.SelfDestructingObject1;case 265:return w.SelfDestructingObject2;case 266:return w.SelfDestructingObject3;case 267:return w.SparkMachine;case 268:return w.MinesLargeFlashingCrate;case 304:return w.RuinsSeal;case 320:return w.RuinsTeleporter;case 321:return w.RuinsWarpSiteToSite;case 322:return w.RuinsSwitch;case 323:return w.FloorPanel4;case 324:return w.Ruins1Door;case 325:return w.Ruins3Door;case 326:return w.Ruins2Door;case 327:return w.Ruins11ButtonDoor;case 328:return w.Ruins21ButtonDoor;case 329:return w.Ruins31ButtonDoor;case 330:return w.Ruins4ButtonDoor;case 331:return w.Ruins2ButtonDoor;case 332:return w.RuinsSensor;case 333:return w.RuinsFenceSwitch;case 334:return w.RuinsLaserFence4x2;case 335:return w.RuinsLaserFence6x2;case 336:return w.RuinsLaserFence4x4;case 337:return w.RuinsLaserFence6x4;case 338:return w.RuinsPoisonBlob;case 339:return w.RuinsPillarTrap;case 340:return w.PopupTrapNoTech;case 341:return w.RuinsCrystal;case 342:return w.Monument;case 345:return w.RuinsRock1;case 346:return w.RuinsRock2;case 347:return w.RuinsRock3;case 348:return w.RuinsRock4;case 349:return w.RuinsRock5;case 350:return w.RuinsRock6;case 351:return w.RuinsRock7;case 352:return w.Poison;case 353:return w.FixedBoxTypeRuins;case 354:return w.RandomBoxTypeRuins;case 355:return w.EnemyTypeBoxYellow;case 356:return w.EnemyTypeBoxBlue;case 357:return w.EmptyTypeBoxBlue;case 358:return w.DestructableRock;case 359:return w.PopupTrapsTechs;case 368:return w.FlyingWhiteBird;case 369:return w.Tower;case 370:return w.FloatingRocks;case 371:return w.FloatingSoul;case 372:return w.Butterfly;case 384:return w.LobbyGameMenu;case 385:return w.LobbyWarpObject;case 386:return w.Lobby1EventObjectDefaultTree;case 387:return w.UnknownItem387;case 388:return w.UnknownItem388;case 389:return w.UnknownItem389;case 390:return w.LobbyEventObjectStaticPumpkin;case 391:return w.LobbyEventObject3ChristmasWindows;case 392:return w.LobbyEventObjectRedAndWhiteCurtain;case 393:return w.UnknownItem393;case 394:return w.UnknownItem394;case 395:return w.LobbyFishTank;case 396:return w.LobbyEventObjectButterflies;case 400:return w.UnknownItem400;case 401:return w.GreyWallLow;case 402:return w.SpaceshipDoor;case 403:return w.GreyWallHigh;case 416:return w.TempleNormalDoor;case 417:return w.BreakableWallWallButUnbreakable;case 418:return w.BrokenCylinderAndRubble;case 419:return w.ThreeBrokenWallPiecesOnFloor;case 420:return w.HighBrickCylinder;case 421:return w.LyingCylinder;case 422:return w.BrickConeWithFlatTop;case 423:return w.BreakableTempleWall;case 424:return w.TempleMapDetect;case 425:return w.SmallBrownBrickRisingBridge;case 426:return w.LongRisingBridgeWithPinkHighEdges;case 427:return w.FourSwitchTempleDoor;case 448:return w.FourButtonSpaceshipDoor;case 512:return w.ItemBoxCca;case 513:return w.TeleporterEp2;case 514:return w.CCADoor;case 515:return w.SpecialBoxCCA;case 516:return w.BigCCADoor;case 517:return w.BigCCADoorSwitch;case 518:return w.LittleRock;case 519:return w.Little3StoneWall;case 520:return w.Medium3StoneWall;case 521:return w.SpiderPlant;case 522:return w.CCAAreaTeleporter;case 523:return w.UnknownItem523;case 524:return w.WhiteBird;case 525:return w.OrangeBird;case 527:return w.Saw;case 528:return w.LaserDetect;case 529:return w.UnknownItem529;case 530:return w.UnknownItem530;case 531:return w.Seagull;case 544:return w.Fish;case 545:return w.SeabedDoorWithBlueEdges;case 546:return w.SeabedDoorAlwaysOpenNonTriggerable;case 547:return w.LittleCryotube;case 548:return w.WideGlassWallBreakable;case 549:return w.BlueFloatingRobot;case 550:return w.RedFloatingRobot;case 551:return w.Dolphin;case 552:return w.CaptureTrap;case 553:return w.VRLink;case 576:return w.UnknownItem576;case 640:return w.WarpInBarbaRayRoom;case 672:return w.UnknownItem672;case 688:return w.GeeNest;case 689:return w.LabComputerConsole;case 690:return w.LabComputerConsoleGreenScreen;case 691:return w.ChairYellowPillow;case 692:return w.OrangeWallWithHoleInMiddle;case 693:return w.GreyWallWithHoleInMiddle;case 694:return w.LongTable;case 695:return w.GBAStation;case 696:return w.TalkLinkToSupport;case 697:return w.InstaWarp;case 698:return w.LabInvisibleObject;case 699:return w.LabGlassWindowDoor;case 700:return w.UnknownItem700;case 701:return w.LabCeilingWarp;case 768:return w.Ep4LightSource;case 769:return w.Cacti;case 770:return w.BigBrownRock;case 771:return w.BreakableBrownRock;case 832:return w.UnknownItem832;case 833:return w.UnknownItem833;case 896:return w.PoisonPlant;case 897:return w.UnknownItem897;case 898:return w.UnknownItem898;case 899:return w.OozingDesertPlant;case 901:return w.UnknownItem901;case 902:return w.BigBlackRocks;case 903:return w.UnknownItem903;case 904:return w.UnknownItem904;case 905:return w.UnknownItem905;case 906:return w.UnknownItem906;case 907:return w.FallingRock;case 908:return w.DesertPlantHasCollision;case 909:return w.DesertFixedTypeBoxBreakableCrystals;case 910:return w.UnknownItem910;case 911:return w.BeeHive;case 912:return w.UnknownItem912;case 913:return w.Heat;case 960:return w.TopOfSaintMillionEgg;case 961:return w.UnknownItem961}}(e.type_id);return{type:t,id:e.id,group_id:e.group_id,area_id:e.area_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:new Map(e.properties.map((e,i)=>3!==i||t!==w.ScriptCollision&&t!==w.ForestConsole&&t!==w.TalkLinkToSupport?4===i&&t===w.RicoMessagePod?["script_label",e]:5===i&&t===w.RicoMessagePod?["script_label_2",e]:[`property_${i}`,e]:["script_label",e])),unknown:e.unknown}});let c=r.b.I,l=new Map;const _=Hr(s.object_code,s.label_offsets,function(e,t){const i=new Set([0]);for(const t of e){const e=t.properties.get("script_label");null!=e&&i.add(e);const o=t.properties.get("script_label_2");null!=o&&i.add(o)}for(const e of t)i.add(Math.round(e.script_label));return[...i]}(d,a.npcs),i,n);if(_.length){const e=_.filter(e=>e.type===Bo.Instructions);let t;for(const i of e)if(i.labels.includes(0)){t=i;break}t?(c=function(e){const t=e.instructions.find(e=>e.opcode.code===wo.code);if(!t)return Xr.debug("Function 0 has no set_episode instruction."),r.b.I;switch(t.args[0].value){default:case 0:return r.b.I;case 1:return r.b.II;case 2:return r.b.IV}}(t),l=function(e,t){const i=new Map;let o;for(const s of t.instructions)switch(s.opcode.code){case vo.code:case go.code:{o||(o=Or.create(e));const t=Wr(o,s,s.args[0].value);if(1!==t.size()){Jr.warn("Couldn't determine area ID for map_designate instruction.");continue}const n=Wr(o,s,s.args[0].value+(s.opcode.code===vo.code?2:3));if(1!==n.size()){Jr.warn("Couldn't determine area variant ID for map_designate instruction.");continue}i.set(t.get(0),n.get(0))}break;case Lo.code:i.set(s.args[0].value,s.args[2].value)}return i}(e,t)):Xr.warn("No instruction for label 0 found.")}else Xr.warn("File contains no instruction labels.");return{id:s.quest_id,language:s.language,name:s.quest_name,short_description:s.short_description,long_description:s.long_description,episode:c,objects:d,npcs:ia(c,a.npcs),events:a.events,dat_unknowns:a.unknowns,object_code:_,shop_items:s.shop_items,map_designations:l}}function ta(e,t){const i=hr({objs:(s=e.objects,s.map(e=>({type_id:x(e.type).pso_id,id:e.id,group_id:e.group_id,section_id:e.section_id,position:e.position,rotation:e.rotation,properties:[...e.properties.values()],area_id:e.area_id,unknown:e.unknown}))),npcs:(o=e.npcs,o.map(e=>{const t=Object(I.d)(e.type),i=null==t.pso_type_id?e.pso_type_id:t.pso_type_id,o=null==t.pso_roaming?e.pso_roaming:t.pso_roaming,s=null==t.pso_regular||t.pso_regular,n=zs(-8388609&Fs(e.scale.y)|(s?0:8388608)),r={x:e.scale.x,y:n,z:e.scale.z};return{type_id:i,wave:e.wave,wave2:e.pso_wave2,section_id:e.section_id,position:e.position,rotation:e.rotation,scale:r,npc_id:e.npc_id,script_label:e.script_label,roaming:o,area_id:e.area_id,unknown:e.unknown}})),events:e.events,unknowns:e.dat_unknowns});var o,s;const{object_code:n,label_offsets:r}=function(e){const t=new tr(new ir(100*e.length),Vo.a.Little),i=t.position,o=[];for(const s of e){for(const e of s.labels)o[e]=t.position-i;if(s.type===Bo.Instructions)for(const e of s.instructions){const i=e.opcode;if(2===i.size&&t.write_u8(i.code>>>8),t.write_u8(255&i.code),i.stack!==Mt.Pop)for(let o=0;o=0?t.write_u8(r.value):t.write_i8(r.value);break;case ft.Word:r.value>=0?t.write_u16(r.value):t.write_i16(r.value);break;case ft.DWord:r.value>=0?t.write_u32(r.value):t.write_i32(r.value);break;case ft.Float:t.write_f32(r.value);break;case ft.Label:case ft.ILabel:case ft.DLabel:case ft.SLabel:t.write_u16(r.value);break;case ft.String:t.write_string_utf16(r.value,r.size);break;case ft.ILabelVar:t.write_u8(n.length),t.write_u16_array(n.map(e=>e.value));break;case ft.RegRef:case ft.RegTupRef:t.write_u8(r.value);break;case ft.RegRefVar:t.write_u8(n.length),t.write_u8_array(n.map(e=>e.value));break;default:throw new Error(`Parameter type ${ft[s.type.kind]} not implemented.`)}}}else if(s.type===Bo.String){const e=4*Math.ceil((s.value.length+1)/2);t.write_string_utf16(s.value,e)}else t.write_cursor(new $o.a(s.data,t.endianness))}for(let e=0;e932)throw new Error(`shop_items can't be larger than 932, was ${e.shop_items.length}.`);o.write_u32_array(e.shop_items);for(let t=e.shop_items.length;t<932;t++)o.write_u32(0);for(;o.position<4652;)o.write_u8(0);return o.write_cursor(new $o.a(e.object_code,Vo.a.Little)),o.write_i32_array(e.label_offsets),Object(U.c)(o.position===t,`Expected to write ${t} bytes, but wrote ${o.position}.`),i}({quest_id:e.id,language:e.language,quest_name:e.name,short_description:e.short_description,long_description:e.long_description,object_code:n,label_offsets:r,shop_items:e.shop_items}),d=t.lastIndexOf("."),c=-1===d?t.slice(0,11):t.slice(0,Math.min(11,d));return xr({files:[{filename:c+".dat",id:e.id,data:or(new tr(i,Vo.a.Little)).array_buffer()},{filename:c+".bin",id:e.id,data:or(new $o.a(a,Vo.a.Little)).array_buffer()}]})}function ia(e,t){return t.map(t=>({type:oa(e,t),area_id:t.area_id,section_id:t.section_id,wave:t.wave,pso_wave2:t.wave2,position:t.position,rotation:t.rotation,scale:t.scale,unknown:t.unknown,pso_type_id:t.type_id,npc_id:t.npc_id,script_label:Math.round(t.script_label),pso_roaming:t.roaming}))}function oa(e,{type_id:t,scale:i,roaming:o,area_id:s}){const n=Math.abs(i.y-1)>1e-5;switch(`${t}, ${o%3}, ${e}`){case"68, 0, 1":return I.c.Booma;case"68, 1, 1":return I.c.Gobooma;case"68, 2, 1":return I.c.Gigobooma;case"99, 0, 1":return I.c.EvilShark;case"99, 1, 1":return I.c.PalShark;case"99, 2, 1":return I.c.GuilShark;case"166, 0, 1":return I.c.Dimenian;case"166, 0, 2":return I.c.Dimenian2;case"166, 1, 1":return I.c.LaDimenian;case"166, 1, 2":return I.c.LaDimenian2;case"166, 2, 1":return I.c.SoDimenian;case"166, 2, 2":return I.c.SoDimenian2;case"214, 0, 2":return I.c.Mericarol;case"214, 1, 2":return I.c.Mericus;case"214, 2, 2":return I.c.Merikle;case"277, 0, 4":return I.c.Boota;case"277, 1, 4":return I.c.ZeBoota;case"277, 2, 4":return I.c.BaBoota;case"279, 0, 4":return I.c.Goran;case"279, 1, 4":return I.c.PyroGoran;case"279, 2, 4":return I.c.GoranDetonator}switch(`${t}, ${o%2}, ${e}`){case"64, 0, 1":return I.c.Hildebear;case"64, 0, 2":return I.c.Hildebear2;case"64, 1, 1":return I.c.Hildeblue;case"64, 1, 2":return I.c.Hildeblue2;case"65, 0, 1":return I.c.RagRappy;case"65, 0, 2":return I.c.RagRappy2;case"65, 0, 4":return I.c.SandRappy;case"65, 1, 1":return I.c.AlRappy;case"65, 1, 2":return I.c.LoveRappy;case"65, 1, 4":return I.c.DelRappy;case"128, 0, 1":return I.c.Dubchic;case"128, 0, 2":return I.c.Dubchic2;case"128, 1, 1":return I.c.Gilchic;case"128, 1, 2":return I.c.Gilchic2;case"212, 0, 2":return I.c.SinowBerill;case"212, 1, 2":return I.c.SinowSpigell;case"213, 0, 2":return I.c.Merillia;case"213, 1, 2":return I.c.Meriltas;case"215, 0, 2":return I.c.UlGibbon;case"215, 1, 2":return I.c.ZolGibbon;case"221, 0, 2":return I.c.Dolmolm;case"221, 1, 2":return I.c.Dolmdarl;case"224, 0, 2":return s>15?I.c.Epsilon:I.c.SinowZoa;case"224, 1, 2":return s>15?I.c.Epsilon:I.c.SinowZele;case"274, 0, 4":return I.c.MerissaA;case"274, 1, 4":return I.c.MerissaAA;case"276, 0, 4":return I.c.Zu;case"276, 1, 4":return I.c.Pazuzu;case"278, 0, 4":return I.c.Dorphon;case"278, 1, 4":return I.c.DorphonEclair;case"281, 0, 4":return n?I.c.SaintMilion:I.c.Kondrieu;case"281, 1, 4":return n?I.c.Shambertin:I.c.Kondrieu}switch(`${t}, ${e}`){case"66, 1":return I.c.Monest;case"66, 2":return I.c.Monest2;case"67, 1":return n?I.c.SavageWolf:I.c.BarbarousWolf;case"67, 2":return n?I.c.SavageWolf2:I.c.BarbarousWolf2;case"96, 1":return I.c.GrassAssassin;case"96, 2":return I.c.GrassAssassin2;case"97, 1":return s>15?I.c.DelLily:n?I.c.PoisonLily:I.c.NarLily;case"97, 2":return s>15?I.c.DelLily:n?I.c.PoisonLily2:I.c.NarLily2;case"98, 1":return I.c.NanoDragon;case"100, 1":return n?I.c.PofuillySlime:I.c.PouillySlime;case"101, 1":return I.c.PanArms;case"101, 2":return I.c.PanArms2;case"129, 1":return I.c.Garanz;case"129, 2":return I.c.Garanz2;case"130, 1":return n?I.c.SinowBeat:I.c.SinowGold;case"131, 1":return I.c.Canadine;case"132, 1":return I.c.Canane;case"133, 1":return I.c.Dubswitch;case"133, 2":return I.c.Dubswitch2;case"160, 1":return I.c.Delsaber;case"160, 2":return I.c.Delsaber2;case"161, 1":return I.c.ChaosSorcerer;case"161, 2":return I.c.ChaosSorcerer2;case"162, 1":return I.c.DarkGunner;case"164, 1":return I.c.ChaosBringer;case"165, 1":return I.c.DarkBelra;case"165, 2":return I.c.DarkBelra2;case"167, 1":return I.c.Bulclaw;case"168, 1":return I.c.Claw;case"192, 1":return I.c.Dragon;case"192, 2":return I.c.GalGryphon;case"193, 1":return I.c.DeRolLe;case"194, 1":return I.c.VolOptPart1;case"197, 1":return I.c.VolOptPart2;case"200, 1":return I.c.DarkFalz;case"202, 2":return I.c.OlgaFlow;case"203, 2":return I.c.BarbaRay;case"204, 2":return I.c.GolDragon;case"216, 2":return I.c.Gibbles;case"217, 2":return I.c.Gee;case"218, 2":return I.c.GiGue;case"219, 2":return I.c.Deldepth;case"220, 2":return I.c.Delbiter;case"222, 2":return I.c.Morfos;case"223, 2":return I.c.Recobox;case"225, 2":return I.c.IllGill;case"272, 4":return I.c.Astark;case"273, 4":return n?I.c.SatelliteLizard:I.c.Yowie;case"275, 4":return I.c.Girtablulu}switch(t){case 4:return I.c.FemaleFat;case 5:return I.c.FemaleMacho;case 7:return I.c.FemaleTall;case 10:return I.c.MaleDwarf;case 11:return I.c.MaleFat;case 12:return I.c.MaleMacho;case 13:return I.c.MaleOld;case 25:return I.c.BlueSoldier;case 26:return I.c.RedSoldier;case 27:return I.c.Principal;case 28:return I.c.Tekker;case 29:return I.c.GuildLady;case 30:return I.c.Scientist;case 31:return I.c.Nurse;case 32:return I.c.Irene;case 241:return I.c.ItemShop;case 254:return I.c.Nurse2}return I.c.Unknown}class sa{constructor(e,t,i,o,s){this._actions=Object(M.c)(),this.actions=this._actions,Object(U.k)(e,"id"),Object(U.k)(t,"section_id"),Object(U.e)(i,"wave"),Object(U.k)(o,"delay"),Object(U.j)(s,"unknown"),this.id=e,this.section_id=t,this.wave=i,this._delay=Object(M.e)(o),this.delay=this._delay,this.unknown=s}set_delay(e){Object(U.k)(e,"delay"),this._delay.val=e}add_action(e){this._actions.push(e)}remove_action(e){this._actions.remove(e)}}class na{constructor(e,t,i){Object(U.k)(e,"id"),Object(U.k)(t,"area_id"),Object(U.k)(i,"section_id"),this._id=Object(M.e)(e),this.id=this._id,this._area_id=Object(M.e)(t),this.area_id=this._area_id,this._section_id=Object(M.e)(i),this.section_id=this._section_id}}const ra=X.c.get("quest_editor/stores/model_conversion");function aa(e,t){const i=new Map;return new Gn(e,t.id,t.language,t.name,t.short_description,t.long_description,t.episode,t.map_designations,t.objects.map(e=>new we(e.type,e.id,e.group_id,e.area_id,e.section_id,Object(vn.a)(e.position),$(e.rotation.x,e.rotation.y,e.rotation.z),e.properties,e.unknown)),t.npcs.map(e=>(function(e,t){const i=0===t.wave?void 0:da(e,t.area_id,t.section_id,t.wave);return new K(t.type,t.pso_type_id,t.npc_id,i,t.pso_wave2,t.script_label,t.pso_roaming,t.area_id,t.section_id,Object(vn.a)(t.position),$(t.rotation.x,t.rotation.y,t.rotation.z),Object(vn.a)(t.scale),t.unknown)})(i,e)),function(e,t){const i=new Map;for(const o of t){const t=`${o.id}-${o.area_id}`;let s=i.get(t);if(s&&s.event){ra.warn(`Ignored duplicate event #${o.id} for area ${o.area_id}.`);continue}const n=da(e,o.area_id,o.section_id,o.wave),r=new sa(o.id,o.section_id,n,o.delay,o.unknown);s?s.event=r:(s={event:r,area_id:o.area_id,parents:[],child_ids:[]},i.set(t,s));for(const e of o.actions)switch(e.type){case ur.SpawnNpcs:r.add_action(new rt(e.section_id,e.appear_flag));break;case ur.Unlock:r.add_action(new at(e.door_id));break;case ur.Lock:r.add_action(new dt(e.door_id));break;case ur.TriggerEvent:{s.child_ids.push(e.event_id);const t=`${e.event_id}-${o.area_id}`,n=i.get(t);n?n.parents.push(r):i.set(t,{area_id:o.area_id,parents:[r],child_ids:[]})}break;default:ra.warn(`Unknown event action type: ${e.type}.`)}}const o=new Map;for(const{area_id:e,event:t}of i.values())if(t){let i=o.get(e);i||(i=new it(e),o.set(e,i)),i.add_event(t,[],[])}for(const e of i.values())if(e.event)for(const t of e.child_ids){const s=i.get(`${t}-${e.area_id}`);s.event?o.get(e.area_id).add_edge(e.event,s.event):ra.warn(`Event ${e.event.id} calls nonexistent event ${t}.`)}return o}(i,t.events),t.dat_unknowns,t.object_code.slice(),t.shop_items)}function da(e,t,i,o){const s=`${t}-${i}-${o}`;let n=e.get(s);return n||(n=new na(o,t,i),e.set(s,n)),n}function ca(e){const t=[];for(const i of e.values())for(const e of i.events){const o=e.actions.val.map(e=>{switch(e.type){case ot.SpawnNpcs:return{type:ur.SpawnNpcs,section_id:e.section_id,appear_flag:e.appear_flag};case ot.Unlock:return{type:ur.Unlock,door_id:e.door_id.val};case ot.Lock:return{type:ur.Lock,door_id:e.door_id.val}}});for(const t of i.get_children(e))o.push({type:ur.TriggerEvent,event_id:t.id});t.push({id:e.id,section_id:e.section_id,wave:e.wave.id.val,delay:e.delay.val,actions:o,area_id:i.area_id,unknown:e.unknown})}return t}var la=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const _a=X.c.get("quest_editor/controllers/QuestEditorToolBarController");class ua extends An{constructor(e,t,i){super(),this.area_store=t,this.quest_editor_store=i,this.create_new_quest=e=>la(this,void 0,void 0,(function*(){return this.quest_editor_store.set_current_quest(Jn(this.area_store,e))})),this.open_files=e=>la(this,void 0,void 0,(function*(){try{if(0===e.length)return;let t;const i=e.find(e=>e.name.toLowerCase().endsWith(".qst"));if(i){const e=yield Object(Xn.a)(i);t=function(e,t=!1){const i=jr(e);if(!i)return;let o,s;for(const e of i.files){const t=e.filename.trim().toLowerCase();t.endsWith(".dat")?o=e:t.endsWith(".bin")&&(s=e)}if(o){if(s)return ea(new $o.a(s.data,Vo.a.Little),new $o.a(o.data,Vo.a.Little),t);Xr.error("File contains no BIN file.")}else Xr.error("File contains no DAT file.")}(new $o.a(e,Vo.a.Little)),this.quest_filename=i.name,t||_a.error("Couldn't parse quest file.")}else{const i=e.find(e=>e.name.toLowerCase().endsWith(".bin")),o=e.find(e=>e.name.toLowerCase().endsWith(".dat"));if(i&&o){const e=yield Object(Xn.a)(i),s=yield Object(Xn.a)(o);t=ea(new $o.a(e,Vo.a.Little),new $o.a(s,Vo.a.Little)),this.quest_filename=i.name||o.name,t||_a.error("Couldn't parse quest file.")}}yield this.quest_editor_store.set_current_quest(t&&aa(this.area_store,t))}catch(e){_a.error("Couldn't read file.",e)}})),this.set_area=({area:e})=>{this.quest_editor_store.set_current_area(e)},this.save_as=()=>{const e=this.quest_editor_store.current_quest.val;if(!e)return;const t=this.quest_filename&&Object(U.d)(this.quest_filename);let i=prompt("File name:",t);if(!i)return;const o=ta(function(e){return{id:e.id.val,language:e.language.val,name:e.name.val,short_description:e.short_description.val,long_description:e.long_description.val,episode:e.episode,objects:e.objects.val.map(e=>({type:e.type,area_id:e.area_id,section_id:e.section_id.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),unknown:e.unknown,id:e.id,group_id:e.group_id,properties:new Map(e.properties)})),npcs:e.npcs.val.map(e=>{var t,i;return{type:e.type,area_id:e.area_id,section_id:e.section_id.val,wave:(i=null===(t=e.wave.val)||void 0===t?void 0:t.id.val,null!=i?i:0),pso_wave2:e.pso_wave2.val,position:e.position.val.clone(),rotation:e.rotation.val.clone(),scale:e.scale.clone(),unknown:e.unknown,pso_type_id:e.pso_type_id,npc_id:e.npc_id,script_label:e.script_label,pso_roaming:e.pso_roaming}}),events:ca(e.event_dags),dat_unknowns:e.dat_unknowns.map(e=>Object.assign({},e)),object_code:e.object_code.map(e=>Eo(e)),shop_items:e.shop_items.slice(),map_designations:new Map(e.map_designations.val)}}(e),i);i.endsWith(".qst")||(i+=".qst");const s=document.createElement("a");s.href=URL.createObjectURL(new Blob([o],{type:"application/octet-stream"})),s.download=i,document.body.appendChild(s),s.click(),URL.revokeObjectURL(s.href),document.body.removeChild(s)},this.debug=()=>{const e=this.quest_editor_store.current_quest.val;e&&this.quest_editor_store.quest_runner.run(e)},this.resume=()=>{this.quest_editor_store.quest_runner.resume()},this.step_over=()=>{this.quest_editor_store.quest_runner.step_over()},this.step_in=()=>{this.quest_editor_store.quest_runner.step_into()},this.step_out=()=>{this.quest_editor_store.quest_runner.step_out()},this.stop=()=>{this.quest_editor_store.quest_runner.stop()},this.vm_feature_active=e.feature_active("vm"),this.areas=i.current_quest.flat_map(e=>{var i;return e?null===(i=e)||void 0===i?void 0:i.entities_per_area.flat_map(i=>Object(M.c)(void 0,...t.get_areas_for_episode(e.episode).map(e=>{const t=i.get(e.id);return{area:e,label:e.name+(t?` (${t})`:"")}}))):Object(M.c)()}),this.current_area=Object(M.d)((e,t)=>e.find(e=>e.area==t),this.areas,i.current_area);const o=i.current_quest.map(e=>null!=e);this.can_save=o,this.can_select_area=o,this.can_debug=o,this.can_undo=Object(M.d)((e,t)=>e&&!t,ys.can_undo,i.quest_runner.running),this.can_redo=Object(M.d)((e,t)=>e&&!t,ys.can_redo,i.quest_runner.running),this.can_step=i.quest_runner.paused,this.can_stop=i.quest_runner.running,this.disposables(i.current_quest.observe(()=>{this.quest_filename=void 0}),e.on_global_keydown(le.b.QuestEditor,"Ctrl-O",()=>{const e=Object(v.m)();e.type="file",e.multiple=!0,e.onchange=()=>{this.open_files(Array.prototype.slice.apply(e.files))},e.click()}),e.on_global_keydown(le.b.QuestEditor,"Ctrl-Shift-S",this.save_as),e.on_global_keydown(le.b.QuestEditor,"Ctrl-Z",()=>{ys.undo()}),e.on_global_keydown(le.b.QuestEditor,"Ctrl-Shift-Z",()=>{ys.redo()}),e.on_global_keydown(le.b.QuestEditor,"F5",this.debug),e.on_global_keydown(le.b.QuestEditor,"Shift-F5",this.stop),e.on_global_keydown(le.b.QuestEditor,"F6",this.resume),e.on_global_keydown(le.b.QuestEditor,"F8",this.step_over),e.on_global_keydown(le.b.QuestEditor,"F7",this.step_in),e.on_global_keydown(le.b.QuestEditor,"Shift-F8",this.step_out))}}class va{constructor(e,t,i){this.quest=e,this.old=t,this.new=i}}class ha extends va{constructor(){super(...arguments),this.description="Edit ID"}undo(){this.quest.set_id(this.old)}redo(){this.quest.set_id(this.new)}}class pa extends va{constructor(){super(...arguments),this.description="Edit name"}undo(){this.quest.set_name(this.old)}redo(){this.quest.set_name(this.new)}}class ga extends va{constructor(){super(...arguments),this.description="Edit short description"}undo(){this.quest.set_short_description(this.old)}redo(){this.quest.set_short_description(this.new)}}class ba extends va{constructor(){super(...arguments),this.description="Edit long description"}undo(){this.quest.set_long_description(this.old)}redo(){this.quest.set_long_description(this.new)}}class fa extends An{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.set_id=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ha(t,t.id.val,e)).redo()},this.set_name=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new pa(t,t.name.val,e)).redo()},this.set_short_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ga(t,t.short_description.val,e)).redo()},this.set_long_description=e=>{const t=this.current_quest.val;t&&this.store.undo.push(new ba(t,t.long_description.val,e)).redo()},this.current_quest=e.current_quest,this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=this.current_quest.map(e=>null==e)}}const ma=Object.freeze(new y.Vector3),wa=Object.freeze(new y.Euler);class ka extends An{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()};const t=e.selected_entity;this.unavailable=t.map(e=>null==e),this.enabled=e.quest_runner.running.map(e=>!e),this.type=t.map(e=>e instanceof K?"NPC":"Object"),this.name=t.map(e=>null==e?"":L(e.type).name),this.section_id=t.flat_map(e=>null==e?Object(M.e)(""):e.section_id.map(e=>e.toString())),this.wave=t.flat_map(e=>e instanceof K?e.wave.flat_map(e=>{var t,i,o;return null!=(o=null===(i=null===(t=e)||void 0===t?void 0:t.id)||void 0===i?void 0:i.map(e=>e.toString()))?o:Object(M.e)("None")}):Object(M.e)("")),this.wave_hidden=t.map(e=>!(e instanceof K)),this.position=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.position)?i:Object(M.e)(ma)}),this.rotation=t.flat_map(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.rotation)?i:Object(M.e)(wa)})}set_pos_x(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Ie(this.store,t,t.section.val,t.section.val,i,new y.Vector3(e,i.y,i.z),!1)).redo()}}set_pos_y(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Ie(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,e,i.z),!1)).redo()}}set_pos_z(e){const t=this.store.selected_entity.val;if(t){const i=t.position.val;this.store.undo.push(new Ie(this.store,t,t.section.val,t.section.val,i,new y.Vector3(i.x,i.y,e),!1)).redo()}}set_rot_x(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ye(this.store,t,i,$(F(e),i.y,i.z),!1)).redo()}}set_rot_y(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ye(this.store,t,i,$(i.x,F(e),i.z),!1)).redo()}}set_rot_z(e){const t=this.store.selected_entity.val;if(t){const i=t.rotation.val;this.store.undo.push(new ye(this.store,t,i,$(i.x,i.y,F(e)),!1)).redo()}}}class ya extends An{constructor(e){super(),this.unavailable=e.current_quest.map(e=>null==e),this.npc_counts=e.current_quest.flat_map(e=>e?e.npcs:Object(M.e)([])).map(this.update_view)}update_view(e){const t=new Map;for(const i of e)if(i.type!==I.c.VolOptPart2){const e=t.get(i.type)||0;t.set(i.type,e+1)}const i=8*(t.get(I.c.Canane)||0);return[...t].sort((e,t)=>e[0]-t[0]).map(([e,t])=>{const o=e===I.c.Canadine?i:0;return{name:Object(I.d)(e).name,count:t+o}})}}class Ra{constructor(e,t,i){this.event=e,this.old_delay=t,this.new_delay=i,this.description=`Edit delay of event ${e.id}`}undo(){this.event.set_delay(this.old_delay)}redo(){this.event.set_delay(this.new_delay)}}class Ia{constructor(e,t,i,o){this.store=e,this.quest=t,this.event_dag=i,this.event=o,this.new_edges=[],this.description=`Delete event ${o.id}`,this.parents=i.get_parents(o).slice(),this.children=i.get_children(o).slice();for(const e of this.parents){const t=i.get_children(e);for(const i of this.children)t.includes(i)||this.new_edges.push({parent:e,child:i})}this.npcs=t.npcs.val.filter(e=>e.wave.val===o.wave),this.event_index=i.get_index(o)}undo(){this.quest.insert_event(this.event_index,this.event,this.parents,this.children);for(const{parent:e,child:t}of this.new_edges)this.event_dag.remove_edge(e,t);for(const e of this.npcs)e.set_wave(this.event.wave)}redo(){this.store.selected_wave.val===this.event.wave&&this.store.set_selected_wave(void 0);for(const{parent:e,child:t}of this.new_edges)this.event_dag.add_edge(e,t);this.quest.remove_event(this.event_dag,this.event)}}class ja{constructor(e,t,i,o){this.quest=e,this.event_dag=t,this.event=i,this.parent_event=o,this.description=`Add event ${i.id}`}undo(){this.quest.remove_event(this.event_dag,this.event)}redo(){this.quest.add_event(this.event,this.parent_event?[this.parent_event]:[],[])}}class xa extends An{constructor(e){super(),this.store=e,this.focused=()=>{this.store.undo.make_current()},this.add_event=()=>{var e,t,i,o,s;const n=this.store.current_quest.val,r=this.store.current_area.val;if(n&&r){const a=n.get_event_dag_or_create(r.id),d=a.events.find(e=>e.wave===this.store.selected_wave.val),c=null!=(s=null!=(t=null===(e=d)||void 0===e?void 0:e.section_id)?t:null===(o=null===(i=this.store.selected_entity.val)||void 0===i?void 0:i.section_id)||void 0===o?void 0:o.val)?s:1,l=[],_=[];for(const e of a.events)l.push(e.id),e.wave.section_id.val===c&&_.push(e.wave.id.val);l.sort((e,t)=>e-t),_.sort((e,t)=>e-t);let u,v=0;for(const e of _)if(++v!==e)break;if(v===_.length&&v++,d){let e=d;for(;;){const[t]=a.get_parents(e);if(!t)break;e=t}const t=a.get_sub_graph(e).length.val;u=`${e.id}${t}`}else u=`${c}${v}`;let h=parseInt(u,10),p=0;for(;p=l.indexOf(h,p),-1!==p;)h++;this.store.undo.push(new ja(n,a,new sa(h,c,new na(v,r.id,c),30,0),d)).redo()}},this.remove_event=e=>{const t=this.store.current_quest.val,i=this.event_dag.val;t&&i&&this.store.undo.push(new Ia(this.store,t,i,e)).redo()},this.set_selected_wave=e=>{this.store.set_selected_wave(e)},this.set_delay=(e,t)=>{this.store.undo.push(new Ra(e,e.delay.val,t)).redo()},this.enabled=e.quest_runner.running.map(e=>!e),this.unavailable=e.current_quest.map(e=>null==e),this.event_dag=Object(M.d)((e,t)=>e&&t?e.event_dags.get(t.id):void 0,e.current_quest,e.current_area),this.event_sub_graphs=Object(M.b)(e=>{var t,i;return null!=(i=null===(t=e)||void 0===t?void 0:t.connected_sub_graphs)?i:Object(M.c)()},this.event_dag)}is_selected(e){return this.store.selected_wave.map(t=>e.wave===t)}add_action(e,t){let i;switch(t){case ot.SpawnNpcs:i=new rt(0,0);break;case ot.Unlock:i=new at(0);break;case ot.Lock:i=new dt(0)}e.add_action(i)}remove_action(e,t){e.remove_action(t)}}function Ta(e,t,i){const o=new d.a,s=o.add(new bn(e)),n=o.add(new Mn(e)),r=o.add(new nn(s)),a=o.add(new Ds(t,r)),c=o.add(new Zs(a)),l=new Un,_=o.add(new Tn(n,i));return{view:o.add(new ws(t,a,l,o.add(new Nn(o.add(new ua(t,r,a)))),()=>new f(o.add(new fa(a))),()=>new m(o.add(new ya(a))),()=>new Fe(t,a,s,n,i()),()=>new Ke(t,a.quest_runner,c),()=>new Qe(o.add(new ka(a))),()=>new Je(a,_),()=>new Xe(a,_),()=>new bt(o.add(new xa(a))),()=>new ps(t,a,s,n,i()),()=>new cs(a.quest_runner))),dispose(){o.dispose()}}}i.d(t,"initialize_quest_editor",(function(){return Ta}))},"9dYx":function(e,t,i){"use strict";var o=i("bcBH");class s{constructor(e,t){this._position=0,this.endianness=e,this.offset=t}get position(){return this._position}get endianness(){return this.little_endian?o.a.Little:o.a.Big}set endianness(e){this.little_endian=e===o.a.Little}get bytes_left(){return this.size-this.position}seek(e){return this.seek_start(this.position+e)}seek_start(e){if(e<0||e>this.size)throw new Error(`Offset ${e} is out of bounds.`);return this._position=e,this}seek_end(e){if(e<0||e>this.size)throw new Error(`Offset ${e} is out of bounds.`);return this._position=this.size-e,this}u8(){return this.u8_at(this._position++)}u8_at(e){return this.check_offset(e,1),this.dv.getUint8(this.offset+e)}u16(){const e=this.u16_at(this.position);return this._position+=2,e}u16_at(e){return this.check_offset(e,2),this.dv.getUint16(this.offset+e,this.little_endian)}u32(){const e=this.u32_at(this.position);return this._position+=4,e}u32_at(e){return this.check_offset(e,4),this.dv.getUint32(this.offset+e,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(e){return this.check_offset(e,1),this.dv.getInt8(this.offset+e)}i16(){const e=this.i16_at(this.position);return this._position+=2,e}i16_at(e){return this.check_offset(e,2),this.dv.getInt16(this.offset+e,this.little_endian)}i32(){const e=this.i32_at(this.position);return this._position+=4,e}i32_at(e){return this.check_offset(e,4),this.dv.getInt32(this.offset+e,this.little_endian)}f32(){const e=this.f32_at(this.position);return this._position+=4,e}f32_at(e){return this.check_offset(e,4),this.dv.getFloat32(this.offset+e,this.little_endian)}u8_array(e){this.check_size("n",e,e);const t=[];for(let i=0;ithis.size-this.position)throw new Error(`${e} ${t} is out of bounds.`)}check_offset(e,t){if(e<0||e+t>this.size)throw new Error(`Offset ${e} is out of bounds.`)}}i.d(t,"a",(function(){return n}));class n extends s{write_u8(e){return this.write_u8_at(this.position,e),this._position+=1,this}write_u16(e){return this.write_u16_at(this.position,e),this._position+=2,this}write_u32(e){return this.write_u32_at(this.position,e),this._position+=4,this}write_i8(e){return this.write_i8_at(this.position,e),this._position+=1,this}write_i16(e){return this.write_i16_at(this.position,e),this._position+=2,this}write_i32(e){return this.write_i32_at(this.position,e),this._position+=4,this}write_f32(e){return this.write_f32_at(this.position,e),this._position+=4,this}write_u8_array(e){return this.write_u8_array_at(this.position,e),this._position+=e.length,this}write_u16_array(e){return this.write_u16_array_at(this.position,e),this._position+=2*e.length,this}write_u32_array(e){return this.write_u32_array_at(this.position,e),this._position+=4*e.length,this}write_i32_array(e){return this.write_i32_array_at(this.position,e),this._position+=4*e.length,this}write_vec2_f32(e){return this.write_vec2_f32_at(this.position,e),this._position+=8,this}write_vec3_f32(e){return this.write_vec3_f32_at(this.position,e),this._position+=12,this}write_cursor(e){const t=e.size-e.position;return this.ensure_size(t),e.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,t),t),this._position+=t,this}write_string_ascii(e,t){return this.write_string_ascii_at(this.position,e,t),this._position+=t,this}write_string_utf16(e,t){return this.write_string_utf16_at(this.position,e,t),this._position+=t,this}write_u8_at(e,t){return this.ensure_size(1,e),this.dv.setUint8(e,t),this}write_u16_at(e,t){return this.ensure_size(2,e),this.dv.setUint16(e,t,this.little_endian),this}write_u32_at(e,t){return this.ensure_size(4,e),this.dv.setUint32(e,t,this.little_endian),this}write_i8_at(e,t){return this.ensure_size(1,e),this.dv.setInt8(e,t),this}write_i16_at(e,t){return this.ensure_size(2,e),this.dv.setInt16(e,t,this.little_endian),this}write_i32_at(e,t){return this.ensure_size(4,e),this.dv.setInt32(e,t,this.little_endian),this}write_f32_at(e,t){return this.ensure_size(4,e),this.dv.setFloat32(e,t,this.little_endian),this}write_u8_array_at(e,t){return this.ensure_size(t.length,e),new Uint8Array(this.backing_buffer,this.offset+e).set(new Uint8Array(t)),this}write_u16_array_at(e,t){this.ensure_size(2*t.length,e);const i=t.length;for(let o=0;oi)throw new Error(`${e} Bytes required but only ${i} available.`)}}},I7a6:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var o=i("nsCy"),s=i("rwco"),n=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};const r=s.c.get("core/persistence/Persister");class a{persist_for_server(e,t,i){this.persist(this.server_key(e,t),i)}persist(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch(t){r.error(`Couldn't persist ${e}.`,t)}}load_for_server(e,t){return n(this,void 0,void 0,(function*(){return this.load(this.server_key(e,t))}))}load(e){return n(this,void 0,void 0,(function*(){try{const t=localStorage.getItem(e);return t&&JSON.parse(t)}catch(t){return void r.error(`Couldn't load ${e}.`,t)}}))}server_key(e,t){let i=t+".";switch(e){case o.g.Ephinea:i+="Ephinea";break;default:throw new Error(`Server ${o.g[e]} not supported.`)}return i}}},NRxM:function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var o=i("9dYx");class s extends o.a{constructor(e,t,i=0,o=e.byteLength-i){super(t,i),this._size=o,this.backing_buffer=e,this.dv=new DataView(e,0,e.byteLength)}get size(){return this._size}set size(e){if(e>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${e} is out of bounds.`);this._size=e}take(e){const t=this.offset+this.position,i=new s(this.backing_buffer,this.endianness,t,e);return this._position+=e,i}}},NUmZ:function(e,t,i){e.exports=function(){return new Worker(i.p+"9a937510e908df9fb2da.worker.js")}},"Sa3/":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var o=function(e,t,i,o){return new(i||(i=Promise))((function(s,n){function r(e){try{d(o.next(e))}catch(e){n(e)}}function a(e){try{d(o.throw(e))}catch(e){n(e)}}function d(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((o=o.apply(e,t||[])).next())}))};function s(e){return o(this,void 0,void 0,(function*(){return new Promise((t,i)=>{const o=new FileReader;o.addEventListener("loadend",()=>{o.result instanceof ArrayBuffer?t(o.result):i(new Error("Couldn't read file."))}),o.readAsArrayBuffer(e)})}))}},bcBH:function(e,t,i){"use strict";var o;i.d(t,"a",(function(){return o})),function(e){e[e.Little=0]="Little",e[e.Big=1]="Big"}(o||(o={}))},yub1:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var o=i("9Ykw");const s=i("rwco").c.get("core/data_formats/parsing/ninja/texture"),n=1213027928,r=1414682200;function a(e){const t=Object(o.a)(e),i=t.find(e=>e.type===n),a=i&&function(e){return{texture_count:e.u16()}}(i.data),d=t.filter(e=>e.type===r).map(e=>(function(e){const t=e.u32(),i=e.u32(),o=e.u32(),s=e.u16(),n=e.u16(),r=e.u32();return e.seek(36),{id:o,format:[t,i],width:s,height:n,size:r,data:e.array_buffer(r)}})(e.data));return a&&a.texture_count!==d.length&&s.warn(`Found ${d.length} textures instead of ${a.texture_count} as defined in the header.`),{textures:d}}}}]); \ No newline at end of file diff --git a/8.a899f94ab5fa466149a3.js b/8.a899f94ab5fa466149a3.js new file mode 100644 index 00000000..f4924047 --- /dev/null +++ b/8.a899f94ab5fa466149a3.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"9Ykw":function(t,e,i){"use strict";function s(t){const e=[];for(;t.bytes_left;){const i=t.u32(),s=t.u32();if(s>t.bytes_left)break;e.push({type:i,data:t.take(s)})}return e}i.d(e,"a",(function(){return s}))},"9dYx":function(t,e,i){"use strict";var s=i("bcBH");class n{constructor(t,e){this._position=0,this.endianness=t,this.offset=e}get position(){return this._position}get endianness(){return this.little_endian?s.a.Little:s.a.Big}set endianness(t){this.little_endian=t===s.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const e=[];for(let i=0;ithis.size-this.position)throw new Error(`${t} ${e} is out of bounds.`)}check_offset(t,e){if(t<0||t+e>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}i.d(e,"a",(function(){return r}));class r extends n{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_i32_array(t){return this.write_i32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const e=t.size-t.position;return this.ensure_size(e),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,e),e),this._position+=e,this}write_string_ascii(t,e){return this.write_string_ascii_at(this.position,t,e),this._position+=e,this}write_string_utf16(t,e){return this.write_string_utf16_at(this.position,t,e),this._position+=e,this}write_u8_at(t,e){return this.ensure_size(1,t),this.dv.setUint8(t,e),this}write_u16_at(t,e){return this.ensure_size(2,t),this.dv.setUint16(t,e,this.little_endian),this}write_u32_at(t,e){return this.ensure_size(4,t),this.dv.setUint32(t,e,this.little_endian),this}write_i8_at(t,e){return this.ensure_size(1,t),this.dv.setInt8(t,e),this}write_i16_at(t,e){return this.ensure_size(2,t),this.dv.setInt16(t,e,this.little_endian),this}write_i32_at(t,e){return this.ensure_size(4,t),this.dv.setInt32(t,e,this.little_endian),this}write_f32_at(t,e){return this.ensure_size(4,t),this.dv.setFloat32(t,e,this.little_endian),this}write_u8_array_at(t,e){return this.ensure_size(e.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(e)),this}write_u16_array_at(t,e){this.ensure_size(2*e.length,t);const i=e.length;for(let s=0;si)throw new Error(`${t} Bytes required but only ${i} available.`)}}},NRxM:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("9dYx");class n extends s.a{constructor(t,e,i=0,s=t.byteLength-i){super(e,i),this._size=s,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const e=this.offset+this.position,i=new n(this.backing_buffer,this.endianness,e,t);return this._position+=t,i}}},VwSi:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a}));var s=i("kwt4");const n=1296321870;var r,o;function a(t,e){return t.u32()===n?function(t,e){const i=t.u32();return _(t.take(i),e)}(t,e):(t.seek_start(0),function(t,e){t.seek_end(16);const i=t.u32();t.seek_start(i);const s=t.u32();return t.seek_start(s),function(t,e){t.seek(4);const i=t.u32();return t.seek_start(i),_(t,e)}(t,e)}(t,e))}function _(t,e){let i=t.u32();const s=t.u32(),n=t.u16(),r=t.u16(),a=(192&r)>>6,_=15&r,c=[];for(let r=0;r=i)return t.seek_start(r),c(t,e);o=s}return n}function c(t,e){const i=[];for(let n=0;n{if(!e)throw new Error(`Couldn't load body for player class ${t.name}.`);return this.load_body_part_geometry(t.name,"Head",0).then(i=>(i&&this.add_to_bone(e,i,59),0===t.hair_styles_count?e:this.load_body_part_geometry(t.name,"Hair",0).then(i=>(i&&this.add_to_bone(e,i,59),t.hair_styles_with_accessory.has(0)?this.load_body_part_geometry(t.name,"Accessory",0).then(t=>(t&&this.add_to_bone(e,t,59),e)):e))))})}load_body_part_geometry(t,e,i){return this.http_client.get(function(t,e,i){return`/player/${t}${e}${null==i?"":i}.nj`}(t,e,i)).array_buffer().then(t=>Object(s.c)(new n.a(t,r.a.Little))[0])}add_to_bone(t,e,i){const s=t.get_bone(i);s&&(s.evaluation_flags.hidden=!1,s.evaluation_flags.break_child_trace=!1,s.children.push(e))}load_animation(t,e){let i=this.nj_motion_cache.get(t);return i||(i=this.http_client.get(`/player/animation/animation_${t.toString().padStart(3,"0")}.njm`).array_buffer().then(t=>Object(o.c)(new n.a(t,r.a.Little),e))),i}}},bcBH:function(t,e,i){"use strict";var s;i.d(e,"a",(function(){return s})),function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(s||(s={}))},kwt4:function(t,e,i){"use strict";var s=i("9Ykw"),n=i("rwco");const r=n.c.get("core/data_formats/parsing/ninja/njcm");var o;function a(t,e){const i=t.u32(),s=t.u32(),n=t.vec3_f32(),r=t.f32(),a=[],h=[];if(i){t.seek_start(i);for(const i of _(t,e,!0))if(i.type===o.Vertex)for(const t of i.vertices)a[t.index]={position:t.position,normal:t.normal,bone_weight:t.bone_weight,bone_weight_status:t.bone_weight_status,calc_continue:t.calc_continue}}if(s){t.seek_start(s);let i=void 0;for(const s of _(t,e,!1))if(s.type===o.Tiny)i=s.texture_id;else if(s.type===o.Strip){for(const t of s.triangle_strips)t.texture_id=i;h.push(...s.triangle_strips)}}return{type:"njcm",vertices:a,meshes:h,collision_sphere_center:n,collision_sphere_radius:r}}function _(t,e,i){const s=[];let n=!0;for(;n;){const a=t.u8(),c=t.u8(),f=t.position;let l=0;if(0===a)s.push({type:o.Null,type_id:a});else if(1<=a&&a<=3)s.push({type:o.Bits,type_id:a});else if(4===a){const i=c,r=t.position;s.push({type:o.CachePolygonList,type_id:a,cache_index:i,offset:r}),e[i]=r,n=!1}else if(5===a){const n=c,r=e[n];null!=r&&(t.seek_start(r),s.push(..._(t,e,i))),s.push({type:o.DrawPolygonList,type_id:a,cache_index:n})}else if(8<=a&&a<=9){l=2;const e=t.u16();s.push({type:o.Tiny,type_id:a,flip_u:0!=(128&a),flip_v:0!=(64&a),clamp_u:0!=(32&a),clamp_v:0!=(16&a),mipmap_d_adjust:15&a,filter_mode:e>>>14,super_sample:0!=(64&e),texture_id:8191&e})}else 17<=a&&a<=31?(l=2+2*t.u16(),s.push({type:o.Material,type_id:a})):32<=a&&a<=50?(l=2+4*t.u16(),s.push({type:o.Vertex,type_id:a,vertices:h(t,a,c)})):56<=a&&a<=58?(l=2+2*t.u16(),s.push({type:o.Volume,type_id:a})):64<=a&&a<=75?(l=2+2*t.u16(),s.push({type:o.Strip,type_id:a,triangle_strips:u(t,a,c)})):255===a?(l=i?2:0,s.push({type:o.End,type_id:a}),n=!1):(l=2+2*t.u16(),s.push({type:o.Unknown,type_id:a}),r.warn(`Unknown chunk type ${a} at offset ${f}.`));t.seek_start(f+l)}return s}function h(t,e,i){if(e<32||e>50)return r.warn(`Unknown vertex chunk type ${e}.`),[];const s=3&i,n=0!=(128&i),o=t.u16(),a=t.u16(),_=[];for(let i=0;i=42&&(44===e?(r.index=o+t.u16(),r.bone_weight=t.u16()/255):t.seek(4));else if(48<=e&&e<=50){const i=t.u32();r.normal={x:(i>>20&1023)/1023,y:(i>>10&1023)/1023,z:(1023&i)/1023},e>=49&&t.seek(4)}_.push(r)}return _}function u(t,e,i){const s={ignore_light:0!=(1&i),ignore_specular:0!=(2&i),ignore_ambient:0!=(4&i),use_alpha:0!=(8&i),double_side:0!=(16&i),flat_shading:0!=(32&i),environment_mapping:0!=(64&i)},n=t.u16(),r=n>>>14,o=16383&n;let a=!1,_=!1,h=!1,u=!1;switch(e){case 64:break;case 65:case 66:a=!0;break;case 67:h=!0;break;case 68:case 69:a=!0,h=!0;break;case 70:_=!0;break;case 71:case 72:a=!0,_=!0;break;case 73:break;case 74:case 75:u=!0;break;default:throw new Error(`Unexpected chunk type ID: ${e}.`)}const c=[];for(let e=0;e=2&&t.seek(2*r)}c.push(Object.assign(Object.assign({},s),{clockwise_winding:i,has_tex_coords:a,has_normal:h,vertices:o}))}return c}!function(t){t[t.Unknown=0]="Unknown",t[t.Null=1]="Null",t[t.Bits=2]="Bits",t[t.CachePolygonList=3]="CachePolygonList",t[t.DrawPolygonList=4]="DrawPolygonList",t[t.Tiny=5]="Tiny",t[t.Material=6]="Material",t[t.Vertex=7]="Vertex",t[t.Volume=8]="Volume",t[t.Strip=9]="Strip",t[t.End=10]="End"}(o||(o={}));const c=n.c.get("core/data_formats/parsing/ninja/xj");function f(t){t.seek(4);const e=t.u32(),i=t.u32(),s=t.u32(),n=t.u32(),r=t.u32(),o=t.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:t.vec3_f32(),collision_sphere_radius:t.f32()};return i>=1&&(i>1&&c.warn(`Vertex info count of ${i} was larger than expected.`),a.vertices.push(...function(t,e){t.seek_start(e);const i=t.u16();t.seek(2);const s=t.u32(),n=t.u32(),r=t.u32(),o=[];for(let e=0;et.type===w),r=[];for(const t of n)r.push(...z(t.data,e,i));return r}function z(t,e,i){const s=t.u32(),n=0!=(1&s),r=0!=(2&s),o=0!=(4&s),a=0!=(8&s),_=0!=(16&s),h=0!=(32&s),u=0!=(64&s),c=0!=(128&s),f=t.u32(),l=t.vec3_f32(),p={x:t.i32()*d,y:t.i32()*d,z:t.i32()*d},w=t.vec3_f32(),y=t.u32(),g=t.u32();let b,v,m;return f&&(t.seek_start(f),b=e(t,i)),y?(t.seek_start(y),v=z(t,e,i)):v=[],g?(t.seek_start(g),m=z(t,e,i)):m=[],[new k({no_translate:n,no_rotate:r,no_scale:o,hidden:a,break_child_trace:_,zxy_rotation_order:h,skip:u,shape_skip:c},b,l,p,w,v),...m]}}}]); \ No newline at end of file diff --git a/8.cf479a8317c61fe46dd9.js b/8.cf479a8317c61fe46dd9.js deleted file mode 100644 index a6990c56..00000000 --- a/8.cf479a8317c61fe46dd9.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{"9Ykw":function(t,e,i){"use strict";function s(t){const e=[];for(;t.bytes_left;){const i=t.u32(),s=t.u32();if(s>t.bytes_left)break;e.push({type:i,data:t.take(s)})}return e}i.d(e,"a",(function(){return s}))},"9dYx":function(t,e,i){"use strict";var s=i("bcBH");class n{constructor(t,e){this._position=0,this.endianness=t,this.offset=e}get position(){return this._position}get endianness(){return this.little_endian?s.a.Little:s.a.Big}set endianness(t){this.little_endian=t===s.a.Little}get bytes_left(){return this.size-this.position}seek(t){return this.seek_start(this.position+t)}seek_start(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=t,this}seek_end(t){if(t<0||t>this.size)throw new Error(`Offset ${t} is out of bounds.`);return this._position=this.size-t,this}u8(){return this.u8_at(this._position++)}u8_at(t){return this.check_offset(t,1),this.dv.getUint8(this.offset+t)}u16(){const t=this.u16_at(this.position);return this._position+=2,t}u16_at(t){return this.check_offset(t,2),this.dv.getUint16(this.offset+t,this.little_endian)}u32(){const t=this.u32_at(this.position);return this._position+=4,t}u32_at(t){return this.check_offset(t,4),this.dv.getUint32(this.offset+t,this.little_endian)}i8(){return this.i8_at(this._position++)}i8_at(t){return this.check_offset(t,1),this.dv.getInt8(this.offset+t)}i16(){const t=this.i16_at(this.position);return this._position+=2,t}i16_at(t){return this.check_offset(t,2),this.dv.getInt16(this.offset+t,this.little_endian)}i32(){const t=this.i32_at(this.position);return this._position+=4,t}i32_at(t){return this.check_offset(t,4),this.dv.getInt32(this.offset+t,this.little_endian)}f32(){const t=this.f32_at(this.position);return this._position+=4,t}f32_at(t){return this.check_offset(t,4),this.dv.getFloat32(this.offset+t,this.little_endian)}u8_array(t){this.check_size("n",t,t);const e=[];for(let i=0;ithis.size-this.position)throw new Error(`${t} ${e} is out of bounds.`)}check_offset(t,e){if(t<0||t+e>this.size)throw new Error(`Offset ${t} is out of bounds.`)}}i.d(e,"a",(function(){return r}));class r extends n{write_u8(t){return this.write_u8_at(this.position,t),this._position+=1,this}write_u16(t){return this.write_u16_at(this.position,t),this._position+=2,this}write_u32(t){return this.write_u32_at(this.position,t),this._position+=4,this}write_i8(t){return this.write_i8_at(this.position,t),this._position+=1,this}write_i16(t){return this.write_i16_at(this.position,t),this._position+=2,this}write_i32(t){return this.write_i32_at(this.position,t),this._position+=4,this}write_f32(t){return this.write_f32_at(this.position,t),this._position+=4,this}write_u8_array(t){return this.write_u8_array_at(this.position,t),this._position+=t.length,this}write_u16_array(t){return this.write_u16_array_at(this.position,t),this._position+=2*t.length,this}write_u32_array(t){return this.write_u32_array_at(this.position,t),this._position+=4*t.length,this}write_vec2_f32(t){return this.write_vec2_f32_at(this.position,t),this._position+=8,this}write_vec3_f32(t){return this.write_vec3_f32_at(this.position,t),this._position+=12,this}write_cursor(t){const e=t.size-t.position;return this.ensure_size(e),t.copy_to_uint8_array(new Uint8Array(this.backing_buffer,this.offset+this.position,e),e),this._position+=e,this}write_string_ascii(t,e){return this.write_string_ascii_at(this.position,t,e),this._position+=e,this}write_string_utf16(t,e){return this.write_string_utf16_at(this.position,t,e),this._position+=e,this}write_u8_at(t,e){return this.ensure_size(1,t),this.dv.setUint8(t,e),this}write_u16_at(t,e){return this.ensure_size(2,t),this.dv.setUint16(t,e,this.little_endian),this}write_u32_at(t,e){return this.ensure_size(4,t),this.dv.setUint32(t,e,this.little_endian),this}write_i8_at(t,e){return this.ensure_size(1,t),this.dv.setInt8(t,e),this}write_i16_at(t,e){return this.ensure_size(2,t),this.dv.setInt16(t,e,this.little_endian),this}write_i32_at(t,e){return this.ensure_size(4,t),this.dv.setInt32(t,e,this.little_endian),this}write_f32_at(t,e){return this.ensure_size(4,t),this.dv.setFloat32(t,e,this.little_endian),this}write_u8_array_at(t,e){return this.ensure_size(e.length,t),new Uint8Array(this.backing_buffer,this.offset+t).set(new Uint8Array(e)),this}write_u16_array_at(t,e){this.ensure_size(2*e.length,t);const i=e.length;for(let s=0;si)throw new Error(`${t} Bytes required but only ${i} available.`)}}},NRxM:function(t,e,i){"use strict";i.d(e,"a",(function(){return n}));var s=i("9dYx");class n extends s.a{constructor(t,e,i=0,s=t.byteLength-i){super(e,i),this._size=s,this.backing_buffer=t,this.dv=new DataView(t,0,t.byteLength)}get size(){return this._size}set size(t){if(t>this.backing_buffer.byteLength-this.offset)throw new Error(`Size ${t} is out of bounds.`);this._size=t}take(t){const e=this.offset+this.position,i=new n(this.backing_buffer,this.endianness,e,t);return this._position+=t,i}}},VwSi:function(t,e,i){"use strict";i.d(e,"a",(function(){return r})),i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a}));var s=i("kwt4");const n=1296321870;var r,o;function a(t,e){return t.u32()===n?function(t,e){const i=t.u32();return h(t.take(i),e)}(t,e):(t.seek_start(0),function(t,e){t.seek_end(16);const i=t.u32();t.seek_start(i);const s=t.u32();return t.seek_start(s),function(t,e){t.seek(4);const i=t.u32();return t.seek_start(i),h(t,e)}(t,e)}(t,e))}function h(t,e){let i=t.u32();const s=t.u32(),n=t.u16(),r=t.u16(),a=(192&r)>>6,h=15&r,c=[];for(let r=0;r=i)return t.seek_start(r),c(t,e);o=s}return n}function c(t,e){const i=[];for(let n=0;n{if(!e)throw new Error(`Couldn't load body for player class ${t.name}.`);return this.load_body_part_geometry(t.name,"Head",0).then(i=>(i&&this.add_to_bone(e,i,59),0===t.hair_styles_count?e:this.load_body_part_geometry(t.name,"Hair",0).then(i=>(i&&this.add_to_bone(e,i,59),t.hair_styles_with_accessory.has(0)?this.load_body_part_geometry(t.name,"Accessory",0).then(t=>(t&&this.add_to_bone(e,t,59),e)):e))))})}load_body_part_geometry(t,e,i){return this.http_client.get(function(t,e,i){return`/player/${t}${e}${null==i?"":i}.nj`}(t,e,i)).array_buffer().then(t=>Object(s.c)(new n.a(t,r.a.Little))[0])}add_to_bone(t,e,i){const s=t.get_bone(i);s&&(s.evaluation_flags.hidden=!1,s.evaluation_flags.break_child_trace=!1,s.children.push(e))}load_animation(t,e){let i=this.nj_motion_cache.get(t);return i||(i=this.http_client.get(`/player/animation/animation_${t.toString().padStart(3,"0")}.njm`).array_buffer().then(t=>Object(o.c)(new n.a(t,r.a.Little),e))),i}}},bcBH:function(t,e,i){"use strict";var s;i.d(e,"a",(function(){return s})),function(t){t[t.Little=0]="Little",t[t.Big=1]="Big"}(s||(s={}))},kwt4:function(t,e,i){"use strict";var s=i("9Ykw"),n=i("rwco");const r=n.c.get("core/data_formats/parsing/ninja/njcm");var o;function a(t,e){const i=t.u32(),s=t.u32(),n=t.vec3_f32(),r=t.f32(),a=[],_=[];if(i){t.seek_start(i);for(const i of h(t,e,!0))if(i.type===o.Vertex)for(const t of i.vertices)a[t.index]={position:t.position,normal:t.normal,bone_weight:t.bone_weight,bone_weight_status:t.bone_weight_status,calc_continue:t.calc_continue}}if(s){t.seek_start(s);let i=void 0;for(const s of h(t,e,!1))if(s.type===o.Tiny)i=s.texture_id;else if(s.type===o.Strip){for(const t of s.triangle_strips)t.texture_id=i;_.push(...s.triangle_strips)}}return{type:"njcm",vertices:a,meshes:_,collision_sphere_center:n,collision_sphere_radius:r}}function h(t,e,i){const s=[];let n=!0;for(;n;){const a=t.u8(),c=t.u8(),f=t.position;let l=0;if(0===a)s.push({type:o.Null,type_id:a});else if(1<=a&&a<=3)s.push({type:o.Bits,type_id:a});else if(4===a){const i=c,r=t.position;s.push({type:o.CachePolygonList,type_id:a,cache_index:i,offset:r}),e[i]=r,n=!1}else if(5===a){const n=c,r=e[n];null!=r&&(t.seek_start(r),s.push(...h(t,e,i))),s.push({type:o.DrawPolygonList,type_id:a,cache_index:n})}else if(8<=a&&a<=9){l=2;const e=t.u16();s.push({type:o.Tiny,type_id:a,flip_u:0!=(128&a),flip_v:0!=(64&a),clamp_u:0!=(32&a),clamp_v:0!=(16&a),mipmap_d_adjust:15&a,filter_mode:e>>>14,super_sample:0!=(64&e),texture_id:8191&e})}else 17<=a&&a<=31?(l=2+2*t.u16(),s.push({type:o.Material,type_id:a})):32<=a&&a<=50?(l=2+4*t.u16(),s.push({type:o.Vertex,type_id:a,vertices:_(t,a,c)})):56<=a&&a<=58?(l=2+2*t.u16(),s.push({type:o.Volume,type_id:a})):64<=a&&a<=75?(l=2+2*t.u16(),s.push({type:o.Strip,type_id:a,triangle_strips:u(t,a,c)})):255===a?(l=i?2:0,s.push({type:o.End,type_id:a}),n=!1):(l=2+2*t.u16(),s.push({type:o.Unknown,type_id:a}),r.warn(`Unknown chunk type ${a} at offset ${f}.`));t.seek_start(f+l)}return s}function _(t,e,i){if(e<32||e>50)return r.warn(`Unknown vertex chunk type ${e}.`),[];const s=3&i,n=0!=(128&i),o=t.u16(),a=t.u16(),h=[];for(let i=0;i=42&&(44===e?(r.index=o+t.u16(),r.bone_weight=t.u16()/255):t.seek(4));else if(48<=e&&e<=50){const i=t.u32();r.normal={x:(i>>20&1023)/1023,y:(i>>10&1023)/1023,z:(1023&i)/1023},e>=49&&t.seek(4)}h.push(r)}return h}function u(t,e,i){const s={ignore_light:0!=(1&i),ignore_specular:0!=(2&i),ignore_ambient:0!=(4&i),use_alpha:0!=(8&i),double_side:0!=(16&i),flat_shading:0!=(32&i),environment_mapping:0!=(64&i)},n=t.u16(),r=n>>>14,o=16383&n;let a=!1,h=!1,_=!1,u=!1;switch(e){case 64:break;case 65:case 66:a=!0;break;case 67:_=!0;break;case 68:case 69:a=!0,_=!0;break;case 70:h=!0;break;case 71:case 72:a=!0,h=!0;break;case 73:break;case 74:case 75:u=!0;break;default:throw new Error(`Unexpected chunk type ID: ${e}.`)}const c=[];for(let e=0;e=2&&t.seek(2*r)}c.push(Object.assign(Object.assign({},s),{clockwise_winding:i,has_tex_coords:a,has_normal:_,vertices:o}))}return c}!function(t){t[t.Unknown=0]="Unknown",t[t.Null=1]="Null",t[t.Bits=2]="Bits",t[t.CachePolygonList=3]="CachePolygonList",t[t.DrawPolygonList=4]="DrawPolygonList",t[t.Tiny=5]="Tiny",t[t.Material=6]="Material",t[t.Vertex=7]="Vertex",t[t.Volume=8]="Volume",t[t.Strip=9]="Strip",t[t.End=10]="End"}(o||(o={}));const c=n.c.get("core/data_formats/parsing/ninja/xj");function f(t){t.seek(4);const e=t.u32(),i=t.u32(),s=t.u32(),n=t.u32(),r=t.u32(),o=t.u32(),a={type:"xj",vertices:[],meshes:[],collision_sphere_position:t.vec3_f32(),collision_sphere_radius:t.f32()};return i>=1&&(i>1&&c.warn(`Vertex info count of ${i} was larger than expected.`),a.vertices.push(...function(t,e){t.seek_start(e);const i=t.u16();t.seek(2);const s=t.u32(),n=t.u32(),r=t.u32(),o=[];for(let e=0;et.type===w),r=[];for(const t of n)r.push(...z(t.data,e,i));return r}function z(t,e,i){const s=t.u32(),n=0!=(1&s),r=0!=(2&s),o=0!=(4&s),a=0!=(8&s),h=0!=(16&s),_=0!=(32&s),u=0!=(64&s),c=0!=(128&s),f=t.u32(),l=t.vec3_f32(),p={x:t.i32()*d,y:t.i32()*d,z:t.i32()*d},w=t.vec3_f32(),k=t.u32(),b=t.u32();let g,v,m;return f&&(t.seek_start(f),g=e(t,i)),k?(t.seek_start(k),v=z(t,e,i)):v=[],b?(t.seek_start(b),m=z(t,e,i)):m=[],[new y({no_translate:n,no_rotate:r,no_scale:o,hidden:a,break_child_trace:h,zxy_rotation_order:_,skip:u,shape_skip:c},g,l,p,w,v),...m]}}}]); \ No newline at end of file diff --git a/8c50d8ef57594e0c97ab.worker.js b/8c50d8ef57594e0c97ab.worker.js deleted file mode 100644 index e89dd0ac..00000000 --- a/8c50d8ef57594e0c97ab.worker.js +++ /dev/null @@ -1 +0,0 @@ -!function(i){var e={};function o(d){if(e[d])return e[d].exports;var v=e[d]={i:d,l:!1,exports:{}};return i[d].call(v.exports,v,v.exports,o),v.l=!0,v.exports}o.m=i,o.c=e,o.d=function(i,e,d){o.o(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:d})},o.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,e){if(1&e&&(i=o(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var d=Object.create(null);if(o.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var v in i)o.d(d,v,function(e){return i[e]}.bind(null,v));return d},o.n=function(i){var e=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(e,"a",e),e},o.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},o.p="",o(o.s="yL6M")}({yL6M:function(i,e,o){"use strict";var d,v;o.r(e),function(i){i[i.NewAssembly=0]="NewAssembly",i[i.AssemblyChange=1]="AssemblyChange",i[i.SignatureHelp=2]="SignatureHelp",i[i.Definition=3]="Definition",i[i.SettingsChange=4]="SettingsChange"}(d||(d={})),function(i){i[i.NewObjectCode=0]="NewObjectCode",i[i.SignatureHelp=1]="SignatureHelp",i[i.Definition=2]="Definition"}(v||(v={}));const t=new DataView(new ArrayBuffer(4));var n,s;!function(i){i[i.Int=0]="Int",i[i.Float=1]="Float",i[i.InvalidNumber=2]="InvalidNumber",i[i.Register=3]="Register",i[i.Label=4]="Label",i[i.CodeSection=5]="CodeSection",i[i.DataSection=6]="DataSection",i[i.StringSection=7]="StringSection",i[i.InvalidSection=8]="InvalidSection",i[i.String=9]="String",i[i.UnterminatedString=10]="UnterminatedString",i[i.Ident=11]="Ident",i[i.InvalidIdent=12]="InvalidIdent",i[i.ArgSeparator=13]="ArgSeparator"}(n||(n={}));class r{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(i){this.line=i,this.index=0,this._mark=0;const e=[];for(;this.has_next();){const i=this.peek();let o;if("/"===i){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(i)?this.skip():(/[-\d]/.test(i)?o=this.tokenize_number_or_label():","===i?(o={type:n.ArgSeparator,col:this.col,len:1},this.skip()):o="."===i?this.tokenize_section():'"'===i?this.tokenize_string():"r"===i?this.tokenize_register_or_ident():this.tokenize_ident(),e.push(o))}return e}has_next(){return this.index!]*$/.test(e)?n.Ident:n.InvalidIdent;return o===n.Ident?{type:o,col:i,len:this.marked_len(),value:e}:{type:o,col:i,len:this.marked_len()}}}!function(i){i[i.Any=0]="Any",i[i.Byte=1]="Byte",i[i.Word=2]="Word",i[i.DWord=3]="DWord",i[i.Float=4]="Float",i[i.Label=5]="Label",i[i.ILabel=6]="ILabel",i[i.DLabel=7]="DLabel",i[i.SLabel=8]="SLabel",i[i.String=9]="String",i[i.ILabelVar=10]="ILabelVar",i[i.RegRef=11]="RegRef",i[i.RegTupRef=12]="RegTupRef",i[i.RegRefVar=13]="RegRefVar",i[i.Pointer=14]="Pointer"}(s||(s={}));const a={kind:s.Any},u={kind:s.Byte},_={kind:s.Word},l={kind:s.DWord},p={kind:s.Float},g={kind:s.Label},f={kind:s.ILabel},k={kind:s.DLabel},R={kind:s.SLabel},c={kind:s.String},h={kind:s.ILabelVar},w={kind:s.RegRef},b={kind:s.RegRefVar},m={kind:s.Pointer};Math.pow(2,31),Math.pow(2,31),Math.pow(2,32);var T,y;function P(i,e,o){return{type:i,doc:e,access:o}}!function(i){i[i.Read=0]="Read",i[i.Write=1]="Write",i[i.ReadWrite=2]="ReadWrite"}(T||(T={})),function(i){i[i.Push=0]="Push",i[i.Pop=1]="Pop"}(y||(y={}));const W=[],S=new Map;function x(i,e,o,d,v){return{code:i,mnemonic:e,doc:o,size:i<256?1:2,params:d,stack:v}}W[0]=x(0,"nop","No operation, does nothing.",[],void 0),W[1]=x(1,"ret","Returns control to caller.",[],void 0),W[2]=x(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),W[3]=x(3,"exit",void 0,[P(l,void 0,void 0)],y.Pop),W[4]=x(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[P(f,void 0,void 0)],void 0),W[5]=x(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),W[6]=x(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),W[7]=x(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[P(f,void 0,void 0)],void 0),W[8]=x(8,"let","Sets the first register's value to second one's value.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[9]=x(9,"leti","Sets a register to the given value.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[10]=x(10,"letb","Sets a register to the given value.",[P({kind:s.RegTupRef,register_tuples:[P(u,void 0,T.Write)]},void 0,void 0),P(u,void 0,void 0)],void 0),W[11]=x(11,"letw","Sets a register to the given value.",[P({kind:s.RegTupRef,register_tuples:[P(_,void 0,T.Write)]},void 0,void 0),P(_,void 0,void 0)],void 0),W[12]=x(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[P({kind:s.RegTupRef,register_tuples:[P(m,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[13]=x(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[P({kind:s.RegTupRef,register_tuples:[P(m,void 0,T.Write)]},void 0,void 0),P(g,void 0,void 0)],void 0),W[14]=x(14,"unknown_0e",void 0,[],void 0),W[15]=x(15,"unknown_0f",void 0,[],void 0),W[16]=x(16,"set","Sets a register to 1.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[17]=x(17,"clear","Sets a register to 0.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[18]=x(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.ReadWrite)]},void 0,void 0)],void 0),W[19]=x(19,"gset",void 0,[P(_,void 0,void 0)],void 0),W[20]=x(20,"gclear",void 0,[P(_,void 0,void 0)],void 0),W[21]=x(21,"grev",void 0,[P(_,void 0,void 0)],void 0),W[22]=x(22,"glet",void 0,[P(_,void 0,void 0)],void 0),W[23]=x(23,"gget","Sets a register to value of the given flag.",[P(_,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(_,void 0,T.Write)]},void 0,void 0)],void 0),W[24]=x(24,"add",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[25]=x(25,"addi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[26]=x(26,"sub",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[27]=x(27,"subi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[28]=x(28,"mul",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[29]=x(29,"muli",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[30]=x(30,"div",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[31]=x(31,"divi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[32]=x(32,"and",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[33]=x(33,"andi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[34]=x(34,"or",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[35]=x(35,"ori",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[36]=x(36,"xor",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[37]=x(37,"xori",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[38]=x(38,"mod",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[39]=x(39,"modi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[40]=x(40,"jmp",void 0,[P(f,void 0,void 0)],void 0),W[41]=x(41,"call",void 0,[P(f,void 0,void 0)],void 0),W[42]=x(42,"jmp_on",void 0,[P(f,void 0,void 0),P(b,void 0,T.Read)],void 0),W[43]=x(43,"jmp_off",void 0,[P(f,void 0,void 0),P(b,void 0,T.Read)],void 0),W[44]=x(44,"jmp_=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[45]=x(45,"jmpi_=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[46]=x(46,"jmp_!=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[47]=x(47,"jmpi_!=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[48]=x(48,"ujmp_>",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[49]=x(49,"ujmpi_>",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[50]=x(50,"jmp_>",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[51]=x(51,"jmpi_>",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[52]=x(52,"ujmp_<",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[53]=x(53,"ujmpi_<",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[54]=x(54,"jmp_<",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[55]=x(55,"jmpi_<",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[56]=x(56,"ujmp_>=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[57]=x(57,"ujmpi_>=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[58]=x(58,"jmp_>=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[59]=x(59,"jmpi_>=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[60]=x(60,"ujmp_<=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[61]=x(61,"ujmpi_<=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[62]=x(62,"jmp_<=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(f,void 0,void 0)],void 0),W[63]=x(63,"jmpi_<=",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0)],void 0),W[64]=x(64,"switch_jmp",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(h,void 0,void 0)],void 0),W[65]=x(65,"switch_call",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(h,void 0,void 0)],void 0),W[66]=x(66,"stack_push",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[67]=x(67,"stack_pop",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[68]=x(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[P(w,void 0,T.Read),P(l,void 0,void 0)],void 0),W[69]=x(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[P(w,void 0,T.Write),P(l,void 0,void 0)],void 0),W[70]=x(70,"unknown_46",void 0,[],void 0),W[71]=x(71,"unknown_47",void 0,[],void 0);const I=W[72]=x(72,"arg_pushr","Pushes the value of the given register onto the stack.",[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],y.Push),j=W[73]=x(73,"arg_pushl","Pushes the given value onto the stack.",[P(l,void 0,void 0)],y.Push),L=W[74]=x(74,"arg_pushb","Pushes the given value onto the stack.",[P(u,void 0,void 0)],y.Push),D=W[75]=x(75,"arg_pushw","Pushes the given value onto the stack.",[P(_,void 0,void 0)],y.Push),z=(W[76]=x(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],y.Push),W[77]=x(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[P(g,void 0,void 0)],y.Push),W[78]=x(78,"arg_pushs","Pushes the given value onto the stack.",[P(c,void 0,void 0)],y.Push)),$=(W[79]=x(79,"unknown_4f",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[80]=x(80,"message",void 0,[P(l,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[81]=x(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[P({kind:s.RegTupRef,register_tuples:[P(u,void 0,T.Write)]},void 0,void 0),P(c,void 0,void 0)],y.Pop),W[82]=x(82,"fadein",void 0,[],void 0),W[83]=x(83,"fadeout",void 0,[],void 0),W[84]=x(84,"se",void 0,[P(l,void 0,void 0)],y.Pop),W[85]=x(85,"bgm",void 0,[P(l,void 0,void 0)],y.Pop),W[86]=x(86,"unknown_56",void 0,[],void 0),W[87]=x(87,"unknown_57",void 0,[],void 0),W[88]=x(88,"enable",void 0,[P(l,void 0,void 0)],y.Pop),W[89]=x(89,"disable",void 0,[P(l,void 0,void 0)],y.Pop),W[90]=x(90,"window_msg",void 0,[P(c,void 0,void 0)],y.Pop),W[91]=x(91,"add_msg",void 0,[P(c,void 0,void 0)],y.Pop),W[92]=x(92,"mesend",void 0,[],void 0),W[93]=x(93,"gettime",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[94]=x(94,"winend",void 0,[],void 0),W[95]=x(95,"unknown_5f",void 0,[],void 0),W[96]=x(96,"npc_crt_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[97]=x(97,"npc_stop",void 0,[P(l,void 0,void 0)],y.Pop),W[98]=x(98,"npc_play",void 0,[P(l,void 0,void 0)],y.Pop),W[99]=x(99,"npc_kill",void 0,[P(l,void 0,void 0)],y.Pop),W[100]=x(100,"npc_nont",void 0,[],void 0),W[101]=x(101,"npc_talk",void 0,[],void 0),W[102]=x(102,"npc_crp_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read),P(a,void 0,T.Read),P(a,void 0,T.Read),P(f,void 0,T.Read),P(a,void 0,T.Read),P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[103]=x(103,"unknown_67",void 0,[],void 0),W[104]=x(104,"create_pipe",void 0,[P(l,void 0,void 0)],y.Pop),W[105]=x(105,"p_hpstat_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0)],y.Pop),W[106]=x(106,"p_dead_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,"Player slot.",void 0)],y.Pop),W[107]=x(107,"p_disablewarp",void 0,[],void 0),W[108]=x(108,"p_enablewarp",void 0,[],void 0),W[109]=x(109,"p_move_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[110]=x(110,"p_look",void 0,[P(l,void 0,void 0)],y.Pop),W[111]=x(111,"unknown_6f",void 0,[],void 0),W[112]=x(112,"p_action_disable",void 0,[],void 0),W[113]=x(113,"p_action_enable",void 0,[],void 0),W[114]=x(114,"disable_movement1",void 0,[P(l,void 0,void 0)],y.Pop),W[115]=x(115,"enable_movement1",void 0,[P(l,void 0,void 0)],y.Pop),W[116]=x(116,"p_noncol",void 0,[],void 0),W[117]=x(117,"p_col",void 0,[],void 0),W[118]=x(118,"p_setpos","Sets a player's position.",[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"X coordinate.",T.Read),P(l,"Y coordinate.",T.Read),P(l,"Z coordinate.",T.Read),P(l,"Y-axis rotation.",T.Read)]},void 0,void 0)],y.Pop),W[119]=x(119,"p_return_guild",void 0,[],void 0),W[120]=x(120,"p_talk_guild",void 0,[P(l,void 0,void 0)],y.Pop),W[121]=x(121,"npc_talk_pl_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[122]=x(122,"npc_talk_kill",void 0,[P(l,void 0,void 0)],y.Pop),W[123]=x(123,"npc_crtpk_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[124]=x(124,"npc_crppk_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[125]=x(125,"npc_crptalk_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[126]=x(126,"p_look_at_v1",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[127]=x(127,"npc_crp_id_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[128]=x(128,"cam_quake",void 0,[],void 0),W[129]=x(129,"cam_adj",void 0,[],void 0),W[130]=x(130,"cam_zmin",void 0,[],void 0),W[131]=x(131,"cam_zmout",void 0,[],void 0),W[132]=x(132,"cam_pan_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[133]=x(133,"game_lev_super",void 0,[],void 0),W[134]=x(134,"game_lev_reset",void 0,[],void 0),W[135]=x(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[P({kind:s.RegTupRef,register_tuples:[P(l,"X coordinate.",T.Read),P(l,"Y coordinate.",T.Read),P(l,"Z coordinate.",T.Read),P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[136]=x(136,"if_zone_clear",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[137]=x(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[138]=x(138,"unhide_obj",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[139]=x(139,"unhide_ene",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[140]=x(140,"at_coords_call",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(f,void 0,T.Read)]},void 0,void 0)],void 0),W[141]=x(141,"at_coords_talk",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(f,void 0,T.Read)]},void 0,void 0)],void 0),W[142]=x(142,"col_npcin",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(f,void 0,T.Read)]},void 0,void 0)],void 0),W[143]=x(143,"col_npcinr",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[144]=x(144,"switch_on",void 0,[P(l,void 0,void 0)],y.Pop),W[145]=x(145,"switch_off",void 0,[P(l,void 0,void 0)],y.Pop),W[146]=x(146,"playbgm_epi",void 0,[P(l,void 0,void 0)],y.Pop),W[147]=x(147,"set_mainwarp",void 0,[P(l,void 0,void 0)],y.Pop),W[148]=x(148,"set_obj_param","Creates a targetable object.",[P({kind:s.RegTupRef,register_tuples:[P(l,"X coordinate.",T.Read),P(l,"Y coordinate.",T.Read),P(l,"Z coordinate.",T.Read),P(l,"Collision radius.",T.Read),P(f,"Function label.",T.Read),P(l,"Vertical position of the cursor.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},"Object handle.",void 0)],void 0),W[149]=x(149,"set_floor_handler",void 0,[P(l,"Floor number.",void 0),P(f,"Handler function label.",void 0)],y.Pop),W[150]=x(150,"clr_floor_handler",void 0,[P(l,"Floor number.",void 0)],y.Pop),W[151]=x(151,"col_plinaw",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[152]=x(152,"hud_hide",void 0,[],void 0),W[153]=x(153,"hud_show",void 0,[],void 0),W[154]=x(154,"cine_enable",void 0,[],void 0),W[155]=x(155,"cine_disable",void 0,[],void 0),W[156]=x(156,"unknown_9c",void 0,[],void 0),W[157]=x(157,"unknown_9d",void 0,[],void 0),W[158]=x(158,"unknown_9e",void 0,[],void 0),W[159]=x(159,"unknown_9f",void 0,[],void 0),W[160]=x(160,"unknown_a0",void 0,[],void 0),W[161]=x(161,"set_qt_failure",void 0,[P(f,void 0,void 0)],void 0),W[162]=x(162,"set_qt_success",void 0,[P(f,void 0,void 0)],void 0),W[163]=x(163,"clr_qt_failure",void 0,[],void 0),W[164]=x(164,"clr_qt_success",void 0,[],void 0),W[165]=x(165,"set_qt_cancel",void 0,[P(f,void 0,void 0)],void 0),W[166]=x(166,"clr_qt_cancel",void 0,[],void 0),W[167]=x(167,"unknown_a7",void 0,[],void 0),W[168]=x(168,"pl_walk_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[169]=x(169,"unknown_a9",void 0,[],void 0),W[170]=x(170,"unknown_aa",void 0,[],void 0),W[171]=x(171,"unknown_ab",void 0,[],void 0),W[172]=x(172,"unknown_ac",void 0,[],void 0),W[173]=x(173,"unknown_ad",void 0,[],void 0),W[174]=x(174,"unknown_ae",void 0,[],void 0),W[175]=x(175,"unknown_af",void 0,[],void 0),W[176]=x(176,"pl_add_meseta",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[177]=x(177,"thread_stg",void 0,[P(f,void 0,void 0)],void 0),W[178]=x(178,"del_obj_param",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},"Object handle.",void 0)],void 0),W[179]=x(179,"item_create",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[180]=x(180,"item_create2",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[181]=x(181,"item_delete",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[182]=x(182,"item_delete2","Deletes an item from the player's inventory.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[183]=x(183,"item_check",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[184]=x(184,"setevt",void 0,[P(l,void 0,void 0)],y.Pop),W[185]=x(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[186]=x(186,"set_qt_exit",void 0,[P(f,void 0,void 0)],void 0),W[187]=x(187,"clr_qt_exit",void 0,[],void 0),W[188]=x(188,"unknown_bc",void 0,[],void 0),W[189]=x(189,"unknown_bd",void 0,[],void 0),W[190]=x(190,"unknown_be",void 0,[],void 0),W[191]=x(191,"unknown_bf",void 0,[],void 0),W[192]=x(192,"particle_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[193]=x(193,"npc_text",void 0,[P(l,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[194]=x(194,"npc_chkwarp",void 0,[],void 0),W[195]=x(195,"pl_pkoff",void 0,[],void 0),W[196]=x(196,"map_designate",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[197]=x(197,"masterkey_on",void 0,[],void 0),W[198]=x(198,"masterkey_off",void 0,[],void 0),W[199]=x(199,"window_time",void 0,[],void 0),W[200]=x(200,"winend_time",void 0,[],void 0),W[201]=x(201,"winset_time",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[202]=x(202,"getmtime",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[203]=x(203,"set_quest_board_handler",void 0,[P(l,void 0,void 0),P(f,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[204]=x(204,"clear_quest_board_handler",void 0,[P(l,void 0,void 0)],y.Pop),W[205]=x(205,"particle_id_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[206]=x(206,"npc_crptalk_id_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[207]=x(207,"npc_lang_clean",void 0,[],void 0),W[208]=x(208,"pl_pkon",void 0,[],void 0),W[209]=x(209,"pl_chk_item2",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[210]=x(210,"enable_mainmenu",void 0,[],void 0),W[211]=x(211,"disable_mainmenu",void 0,[],void 0),W[212]=x(212,"start_battlebgm",void 0,[],void 0),W[213]=x(213,"end_battlebgm",void 0,[],void 0),W[214]=x(214,"disp_msg_qb",void 0,[P(c,void 0,void 0)],y.Pop),W[215]=x(215,"close_msg_qb",void 0,[],void 0),W[216]=x(216,"set_eventflag_v3",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[217]=x(217,"sync_leti",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[218]=x(218,"set_returnhunter",void 0,[],void 0),W[219]=x(219,"set_returncity",void 0,[],void 0),W[220]=x(220,"load_pvr",void 0,[],void 0),W[221]=x(221,"load_midi",void 0,[],void 0),W[222]=x(222,"unknown_de",void 0,[],void 0),W[223]=x(223,"npc_param_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0)],y.Pop),W[224]=x(224,"pad_dragon",void 0,[],void 0),W[225]=x(225,"clear_mainwarp",void 0,[P(l,void 0,void 0)],y.Pop),W[226]=x(226,"pcam_param_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[227]=x(227,"start_setevt_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0)],y.Pop),W[228]=x(228,"warp_on",void 0,[],void 0),W[229]=x(229,"warp_off",void 0,[],void 0),W[230]=x(230,"get_slotnumber",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[231]=x(231,"get_servernumber",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[232]=x(232,"set_eventflag2",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],y.Pop),W[233]=x(233,"res",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[234]=x(234,"unknown_ea",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0)],void 0),W[235]=x(235,"enable_bgmctrl",void 0,[P(l,void 0,void 0)],y.Pop),W[236]=x(236,"sw_send",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[237]=x(237,"create_bgmctrl",void 0,[],void 0),W[238]=x(238,"pl_add_meseta2",void 0,[P(l,void 0,void 0)],y.Pop),W[239]=x(239,"sync_register",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],y.Pop),W[240]=x(240,"send_regwork",void 0,[],void 0),W[241]=x(241,"leti_fixed_camera_v3",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[242]=x(242,"default_camera_pos1",void 0,[],void 0),W[243]=x(243,"unknown_f3",void 0,[],void 0),W[244]=x(244,"unknown_f4",void 0,[],void 0),W[245]=x(245,"unknown_f5",void 0,[],void 0),W[246]=x(246,"unknown_f6",void 0,[],void 0),W[247]=x(247,"unknown_f7",void 0,[],void 0),W[248]=x(248,"unknown_f8",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[249]=x(249,"unknown_f9",void 0,[],void 0),W[250]=x(250,"get_gc_number",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[251]=x(251,"unknown_fb",void 0,[P(_,void 0,void 0)],void 0),W[252]=x(252,"unknown_fc",void 0,[],void 0),W[253]=x(253,"unknown_fd",void 0,[],void 0),W[254]=x(254,"unknown_fe",void 0,[],void 0),W[255]=x(255,"unknown_ff",void 0,[],void 0),W[63488]=x(63488,"unknown_f800",void 0,[],void 0),W[63489]=x(63489,"set_chat_callback",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63490]=x(63490,"unknown_f802",void 0,[],void 0),W[63491]=x(63491,"unknown_f803",void 0,[],void 0),W[63492]=x(63492,"unknown_f804",void 0,[],void 0),W[63493]=x(63493,"unknown_f805",void 0,[],void 0),W[63494]=x(63494,"unknown_f806",void 0,[],void 0),W[63495]=x(63495,"unknown_f807",void 0,[],void 0),W[63496]=x(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63497]=x(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63498]=x(63498,"get_coord_of_player","Retrieves a player's position.",[P({kind:s.RegTupRef,register_tuples:[P(l,"X coordinate.",T.Write),P(l,"Y coordinate.",T.Write),P(l,"Z coordinate.",T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63499]=x(63499,"enable_map",void 0,[],void 0),W[63500]=x(63500,"disable_map",void 0,[],void 0),W[63501]=x(63501,"map_designate_ex",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63502]=x(63502,"unknown_f80e",void 0,[P(l,void 0,void 0)],y.Pop),W[63503]=x(63503,"unknown_f80f",void 0,[P(l,void 0,void 0)],y.Pop),W[63504]=x(63504,"ba_initial_floor",void 0,[P(l,void 0,void 0)],y.Pop),W[63505]=x(63505,"set_ba_rules",void 0,[],void 0),W[63506]=x(63506,"unknown_f812",void 0,[P(l,void 0,void 0)],y.Pop),W[63507]=x(63507,"unknown_f813",void 0,[P(l,void 0,void 0)],y.Pop),W[63508]=x(63508,"unknown_f814",void 0,[P(l,void 0,void 0)],y.Pop),W[63509]=x(63509,"unknown_f815",void 0,[P(l,void 0,void 0)],y.Pop),W[63510]=x(63510,"unknown_f816",void 0,[P(l,void 0,void 0)],y.Pop),W[63511]=x(63511,"unknown_f817",void 0,[P(l,void 0,void 0)],y.Pop),W[63512]=x(63512,"unknown_f818",void 0,[P(l,void 0,void 0)],y.Pop),W[63513]=x(63513,"unknown_f819",void 0,[P(l,void 0,void 0)],y.Pop),W[63514]=x(63514,"unknown_f81a",void 0,[P(l,void 0,void 0)],y.Pop),W[63515]=x(63515,"unknown_f81b",void 0,[P(l,void 0,void 0)],y.Pop),W[63516]=x(63516,"ba_disp_msg",void 0,[P(c,void 0,void 0)],y.Pop),W[63517]=x(63517,"death_lvl_up",void 0,[P(l,void 0,void 0)],y.Pop),W[63518]=x(63518,"death_tech_lvl_up",void 0,[P(l,void 0,void 0)],y.Pop),W[63519]=x(63519,"unknown_f81f",void 0,[],void 0),W[63520]=x(63520,"cmode_stage",void 0,[P(l,void 0,void 0)],y.Pop),W[63521]=x(63521,"unknown_f821",void 0,[],void 0),W[63522]=x(63522,"unknown_f822",void 0,[],void 0),W[63523]=x(63523,"unknown_f823",void 0,[P(l,void 0,void 0)],y.Pop),W[63524]=x(63524,"unknown_f824",void 0,[P(l,void 0,void 0)],y.Pop),W[63525]=x(63525,"exp_multiplication",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63526]=x(63526,"exp_division",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63527]=x(63527,"get_user_is_dead",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63528]=x(63528,"go_floor","Sends a player to the given floor.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Floor ID.",T.Read)]},void 0,void 0)],void 0),W[63529]=x(63529,"unknown_f829",void 0,[],void 0),W[63530]=x(63530,"unknown_f82a",void 0,[],void 0),W[63531]=x(63531,"unlock_door2",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63532]=x(63532,"lock_door2",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63533]=x(63533,"if_switch_not_pressed",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63534]=x(63534,"if_switch_pressed",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Floor ID.",T.Read),P(l,"Switch ID.",T.Read),P(l,"Will be set to 1 if the switch is pressed, 0 otherwise.",T.Write)]},void 0,void 0)],void 0),W[63535]=x(63535,"unknown_f82f",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63536]=x(63536,"control_dragon",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63537]=x(63537,"release_dragon",void 0,[],void 0),W[63538]=x(63538,"unknown_f832",void 0,[],void 0),W[63539]=x(63539,"unknown_f833",void 0,[],void 0),W[63540]=x(63540,"unknown_f834",void 0,[],void 0),W[63541]=x(63541,"unknown_f835",void 0,[],void 0),W[63542]=x(63542,"unknown_f836",void 0,[],void 0),W[63543]=x(63543,"unknown_f837",void 0,[],void 0),W[63544]=x(63544,"shrink",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63545]=x(63545,"unshrink",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63546]=x(63546,"unknown_f83a",void 0,[],void 0),W[63547]=x(63547,"unknown_f83b",void 0,[],void 0),W[63548]=x(63548,"display_clock2",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63549]=x(63549,"unknown_f83d",void 0,[P(l,void 0,void 0)],y.Pop),W[63550]=x(63550,"delete_area_title",void 0,[P(l,void 0,void 0)],y.Pop),W[63551]=x(63551,"unknown_f83f",void 0,[],void 0),W[63552]=x(63552,"load_npc_data",void 0,[],void 0),W[63553]=x(63553,"get_npc_data",void 0,[P(k,void 0,void 0)],void 0),W[63554]=x(63554,"unknown_f842",void 0,[],void 0),W[63555]=x(63555,"unknown_f843",void 0,[],void 0),W[63556]=x(63556,"unknown_f844",void 0,[],void 0),W[63557]=x(63557,"unknown_f845",void 0,[],void 0),W[63558]=x(63558,"unknown_f846",void 0,[],void 0),W[63559]=x(63559,"unknown_f847",void 0,[],void 0),W[63560]=x(63560,"give_damage_score",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63561]=x(63561,"take_damage_score",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63562]=x(63562,"unk_score_f84a",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63563]=x(63563,"unk_score_f84b",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63564]=x(63564,"kill_score",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63565]=x(63565,"death_score",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63566]=x(63566,"unk_score_f84e",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63567]=x(63567,"enemy_death_score",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63568]=x(63568,"meseta_score",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63569]=x(63569,"unknown_f851",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63570]=x(63570,"unknown_f852",void 0,[P(l,void 0,void 0)],y.Pop),W[63571]=x(63571,"reverse_warps",void 0,[],void 0),W[63572]=x(63572,"unreverse_warps",void 0,[],void 0),W[63573]=x(63573,"set_ult_map",void 0,[],void 0),W[63574]=x(63574,"unset_ult_map",void 0,[],void 0),W[63575]=x(63575,"set_area_title",void 0,[P(c,void 0,void 0)],y.Pop),W[63576]=x(63576,"unknown_f858",void 0,[],void 0),W[63577]=x(63577,"unknown_f859",void 0,[],void 0),W[63578]=x(63578,"equip_item",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63579]=x(63579,"unequip_item",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63580]=x(63580,"unknown_f85c",void 0,[],void 0),W[63581]=x(63581,"unknown_f85d",void 0,[],void 0),W[63582]=x(63582,"unknown_f85e",void 0,[P(l,void 0,void 0)],y.Pop),W[63583]=x(63583,"unknown_f85f",void 0,[P(l,void 0,void 0)],y.Pop),W[63584]=x(63584,"unknown_f860",void 0,[],void 0),W[63585]=x(63585,"unknown_f861",void 0,[P(l,void 0,void 0)],y.Pop),W[63586]=x(63586,"unknown_f862",void 0,[],void 0),W[63587]=x(63587,"unknown_f863",void 0,[],void 0),W[63588]=x(63588,"cmode_rank",void 0,[P(l,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63589]=x(63589,"award_item_name",void 0,[],void 0),W[63590]=x(63590,"award_item_select",void 0,[],void 0),W[63591]=x(63591,"award_item_give_to",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63592]=x(63592,"unknown_f868",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63593]=x(63593,"unknown_f869",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63594]=x(63594,"item_create_cmode",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63595]=x(63595,"unknown_f86b",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63596]=x(63596,"award_item_ok",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63597]=x(63597,"unknown_f86d",void 0,[],void 0),W[63598]=x(63598,"unknown_f86e",void 0,[],void 0),W[63599]=x(63599,"ba_set_lives",void 0,[P(l,void 0,void 0)],y.Pop),W[63600]=x(63600,"ba_set_tech_lvl",void 0,[P(l,void 0,void 0)],y.Pop),W[63601]=x(63601,"ba_set_lvl",void 0,[P(l,void 0,void 0)],y.Pop),W[63602]=x(63602,"ba_set_time_limit",void 0,[P(l,void 0,void 0)],y.Pop),W[63603]=x(63603,"boss_is_dead",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63604]=x(63604,"unknown_f874",void 0,[],void 0),W[63605]=x(63605,"unknown_f875",void 0,[],void 0),W[63606]=x(63606,"unknown_f876",void 0,[],void 0),W[63607]=x(63607,"enable_techs","Enables technique use for the given player.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63608]=x(63608,"disable_techs","Disables technique use for the given player.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63609]=x(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Player gender.",T.Write)]},void 0,void 0)],void 0),W[63610]=x(63610,"get_chara_class","Retrieves the player's race and character class.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Player race. 0 If human, 1 if newman, 2 if cast.",T.Write),P(l,"Player class. 0 If hunter, 1 if ranger, 2 if force.",T.Write)]},void 0,void 0)],void 0),W[63611]=x(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read),P(l,"Amount of meseta to take.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Will be set to 1 if the meseta was taken, 0 otherwise.",T.Write)]},void 0,void 0)],void 0),W[63612]=x(63612,"unknown_f87c",void 0,[],void 0),W[63613]=x(63613,"unknown_f87d",void 0,[],void 0),W[63614]=x(63614,"unknown_f87e",void 0,[],void 0),W[63615]=x(63615,"read_guildcard_flag",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63616]=x(63616,"unknown_f880",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63617]=x(63617,"get_pl_name","Sets the value of to the given player's name.",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63618]=x(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63619]=x(63619,"unknown_f883",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63620]=x(63620,"unknown_f884",void 0,[],void 0),W[63621]=x(63621,"unknown_f885",void 0,[],void 0),W[63622]=x(63622,"unknown_f886",void 0,[],void 0),W[63623]=x(63623,"unknown_f887",void 0,[],void 0),W[63624]=x(63624,"unknown_f888",void 0,[],void 0),W[63625]=x(63625,"unknown_f889",void 0,[],void 0),W[63626]=x(63626,"get_player_status",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63627]=x(63627,"send_mail",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63628]=x(63628,"online_check",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63629]=x(63629,"chl_set_timerecord",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63630]=x(63630,"chl_get_timerecord",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63631]=x(63631,"unknown_f88f",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63632]=x(63632,"unknown_f890",void 0,[],void 0),W[63633]=x(63633,"load_enemy_data",void 0,[P(l,void 0,void 0)],y.Pop),W[63634]=x(63634,"get_physical_data",void 0,[P(_,void 0,void 0)],void 0),W[63635]=x(63635,"get_attack_data",void 0,[P(_,void 0,void 0)],void 0),W[63636]=x(63636,"get_resist_data",void 0,[P(_,void 0,void 0)],void 0),W[63637]=x(63637,"get_movement_data",void 0,[P(_,void 0,void 0)],void 0),W[63638]=x(63638,"unknown_f896",void 0,[],void 0),W[63639]=x(63639,"unknown_f897",void 0,[],void 0),W[63640]=x(63640,"shift_left",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63641]=x(63641,"shift_right",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63642]=x(63642,"get_random",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63643]=x(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),W[63644]=x(63644,"disp_chl_retry_menu",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63645]=x(63645,"chl_reverser",void 0,[],void 0),W[63646]=x(63646,"unknown_f89e",void 0,[P(l,void 0,void 0)],y.Pop),W[63647]=x(63647,"unknown_f89f",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63648]=x(63648,"unknown_f8a0",void 0,[],void 0),W[63649]=x(63649,"unknown_f8a1",void 0,[],void 0),W[63650]=x(63650,"unknown_f8a2",void 0,[],void 0),W[63651]=x(63651,"unknown_f8a3",void 0,[],void 0),W[63652]=x(63652,"unknown_f8a4",void 0,[],void 0),W[63653]=x(63653,"unknown_f8a5",void 0,[],void 0),W[63654]=x(63654,"unknown_f8a6",void 0,[],void 0),W[63655]=x(63655,"unknown_f8a7",void 0,[],void 0),W[63656]=x(63656,"unknown_f8a8",void 0,[P(l,void 0,void 0)],y.Pop),W[63657]=x(63657,"unknown_f8a9",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63658]=x(63658,"unknown_f8aa",void 0,[],void 0),W[63659]=x(63659,"unknown_f8ab",void 0,[],void 0),W[63660]=x(63660,"unknown_f8ac",void 0,[],void 0),W[63661]=x(63661,"get_number_of_player2",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63662]=x(63662,"unknown_f8ae",void 0,[],void 0),W[63663]=x(63663,"unknown_f8af",void 0,[],void 0),W[63664]=x(63664,"unknown_f8b0",void 0,[],void 0),W[63665]=x(63665,"unknown_f8b1",void 0,[],void 0),W[63666]=x(63666,"unknown_f8b2",void 0,[],void 0),W[63667]=x(63667,"unknown_f8b3",void 0,[],void 0),W[63668]=x(63668,"unknown_f8b4",void 0,[],void 0),W[63669]=x(63669,"unknown_f8b5",void 0,[],void 0),W[63670]=x(63670,"unknown_f8b6",void 0,[],void 0),W[63671]=x(63671,"unknown_f8b7",void 0,[],void 0),W[63672]=x(63672,"unknown_f8b8",void 0,[],void 0),W[63673]=x(63673,"chl_recovery",void 0,[],void 0),W[63674]=x(63674,"unknown_f8ba",void 0,[],void 0),W[63675]=x(63675,"unknown_f8bb",void 0,[],void 0),W[63676]=x(63676,"set_episode",void 0,[P(l,void 0,void 0)],void 0),W[63677]=x(63677,"unknown_f8bd",void 0,[],void 0),W[63678]=x(63678,"unknown_f8be",void 0,[],void 0),W[63679]=x(63679,"unknown_f8bf",void 0,[],void 0),W[63680]=x(63680,"file_dl_req",void 0,[P(l,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63681]=x(63681,"get_dl_status",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63682]=x(63682,"gba_unknown4",void 0,[],void 0),W[63683]=x(63683,"get_gba_state",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63684]=x(63684,"unknown_f8c4",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63685]=x(63685,"unknown_f8c5",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63686]=x(63686,"qexit",void 0,[],void 0),W[63687]=x(63687,"use_animation",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Animation ID.",T.Read),P(l,"Animation duration in number of frames.",T.Read)]},void 0,void 0)],void 0),W[63688]=x(63688,"stop_animation",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63689]=x(63689,"run_to_coord",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63690]=x(63690,"set_slot_invincible",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63691]=x(63691,"unknown_f8cb",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63692]=x(63692,"set_slot_poison",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63693]=x(63693,"set_slot_paralyze",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63694]=x(63694,"set_slot_shock",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63695]=x(63695,"set_slot_freeze",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63696]=x(63696,"set_slot_slow",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63697]=x(63697,"set_slot_confuse",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63698]=x(63698,"set_slot_shifta",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63699]=x(63699,"set_slot_deband",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63700]=x(63700,"set_slot_jellen",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63701]=x(63701,"set_slot_zalure",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read)]},void 0,void 0)],void 0),W[63702]=x(63702,"fleti_fixed_camera",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],y.Pop),W[63703]=x(63703,"fleti_locked_camera",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],y.Pop),W[63704]=x(63704,"default_camera_pos2",void 0,[],void 0),W[63705]=x(63705,"set_motion_blur",void 0,[],void 0),W[63706]=x(63706,"set_screen_bw",void 0,[],void 0),W[63707]=x(63707,"unknown_f8db",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(_,void 0,void 0)],y.Pop),W[63708]=x(63708,"npc_action_string",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0),P(R,void 0,void 0)],void 0),W[63709]=x(63709,"get_pad_cond",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63710]=x(63710,"get_button_cond",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63711]=x(63711,"freeze_enemies",void 0,[],void 0),W[63712]=x(63712,"unfreeze_enemies",void 0,[],void 0),W[63713]=x(63713,"freeze_everything",void 0,[],void 0),W[63714]=x(63714,"unfreeze_everything",void 0,[],void 0),W[63715]=x(63715,"restore_hp",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63716]=x(63716,"restore_tp",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63717]=x(63717,"close_chat_bubble",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63718]=x(63718,"move_coords_object",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63719]=x(63719,"at_coords_call_ex",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63720]=x(63720,"unknown_f8e8",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63721]=x(63721,"unknown_f8e9",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63722]=x(63722,"unknown_f8ea",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63723]=x(63723,"unknown_f8eb",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63724]=x(63724,"unknown_f8ec",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63725]=x(63725,"animation_check",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63726]=x(63726,"call_image_data",void 0,[P(l,void 0,void 0),P(_,void 0,void 0)],y.Pop),W[63727]=x(63727,"unknown_f8ef",void 0,[],void 0),W[63728]=x(63728,"turn_off_bgm_p2",void 0,[],void 0),W[63729]=x(63729,"turn_on_bgm_p2",void 0,[],void 0),W[63730]=x(63730,"load_unk_data",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(k,void 0,void 0)],y.Pop),W[63731]=x(63731,"particle2",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0),P(l,void 0,void 0),P(p,void 0,void 0)],y.Pop),W[63732]=x(63732,"unknown_f8f4",void 0,[],void 0),W[63733]=x(63733,"unknown_f8f5",void 0,[],void 0),W[63734]=x(63734,"unknown_f8f6",void 0,[],void 0),W[63735]=x(63735,"unknown_f8f7",void 0,[],void 0),W[63736]=x(63736,"unknown_f8f8",void 0,[],void 0),W[63737]=x(63737,"unknown_f8f9",void 0,[],void 0),W[63738]=x(63738,"unknown_f8fa",void 0,[],void 0),W[63739]=x(63739,"unknown_f8fb",void 0,[],void 0),W[63740]=x(63740,"unknown_f8fc",void 0,[],void 0),W[63741]=x(63741,"unknown_f8fd",void 0,[],void 0),W[63742]=x(63742,"unknown_f8fe",void 0,[],void 0),W[63743]=x(63743,"unknown_f8ff",void 0,[],void 0),W[63744]=x(63744,"unknown_f900",void 0,[],void 0),W[63745]=x(63745,"dec2float",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Read)]},void 0,void 0)],void 0),W[63746]=x(63746,"float2dec",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Read)]},void 0,void 0)],void 0),W[63747]=x(63747,"flet",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Read)]},void 0,void 0)],void 0),W[63748]=x(63748,"fleti",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P(p,void 0,void 0)],void 0),W[63749]=x(63749,"unknown_f905",void 0,[],void 0),W[63750]=x(63750,"unknown_f906",void 0,[],void 0),W[63751]=x(63751,"unknown_f907",void 0,[],void 0),W[63752]=x(63752,"fadd",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Read)]},void 0,void 0)],void 0),W[63753]=x(63753,"faddi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P(p,void 0,void 0)],void 0),W[63754]=x(63754,"fsub",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Read)]},void 0,void 0)],void 0),W[63755]=x(63755,"fsubi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P(p,void 0,void 0)],void 0),W[63756]=x(63756,"fmul",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Read)]},void 0,void 0)],void 0),W[63757]=x(63757,"fmuli",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P(p,void 0,void 0)],void 0),W[63758]=x(63758,"fdiv",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Read)]},void 0,void 0)],void 0),W[63759]=x(63759,"fdivi",void 0,[P({kind:s.RegTupRef,register_tuples:[P(p,void 0,T.Write)]},void 0,void 0),P(p,void 0,void 0)],void 0),W[63760]=x(63760,"get_unknown_count",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63761]=x(63761,"get_stackable_item_count",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,"Player slot.",T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read),P(l,void 0,T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63762]=x(63762,"freeze_and_hide_equip",void 0,[],void 0),W[63763]=x(63763,"thaw_and_show_equip",void 0,[],void 0),W[63764]=x(63764,"set_palettex_callback",void 0,[P(l,"Player slot.",void 0),P(f,void 0,void 0)],y.Pop),W[63765]=x(63765,"activate_palettex",void 0,[P(l,"Player slot.",void 0)],y.Pop),W[63766]=x(63766,"enable_palettex",void 0,[P(l,"Player slot.",void 0)],y.Pop),W[63767]=x(63767,"restore_palettex",void 0,[P(l,"Player slot.",void 0)],y.Pop),W[63768]=x(63768,"disable_palettex",void 0,[P(l,"Player slot.",void 0)],y.Pop),W[63769]=x(63769,"get_palettex_activated",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63770]=x(63770,"get_unknown_palettex_status",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63771]=x(63771,"disable_movement2",void 0,[P(l,"Player slot.",void 0)],y.Pop),W[63772]=x(63772,"enable_movement2",void 0,[P(l,"Player slot.",void 0)],y.Pop),W[63773]=x(63773,"get_time_played",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63774]=x(63774,"get_guildcard_total",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63775]=x(63775,"get_slot_meseta",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63776]=x(63776,"get_player_level",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63777]=x(63777,"get_section_id",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63778]=x(63778,"get_player_hp",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,"Maximum HP.",T.Write),P(l,"Current HP.",T.Write),P(l,"Maximum TP.",T.Write),P(l,"Current TP.",T.Write)]},void 0,void 0)],y.Pop),W[63779]=x(63779,"get_floor_number",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63780]=x(63780,"get_coord_player_detect",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,"Player slot.",T.Read)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Read)]},void 0,void 0)],void 0),W[63781]=x(63781,"read_global_flag",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63782]=x(63782,"write_global_flag",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63783]=x(63783,"unknown_f927",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63784]=x(63784,"floor_player_detect",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write),P(l,void 0,T.Write),P(l,void 0,T.Write),P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63785]=x(63785,"read_disk_file",void 0,[P(c,void 0,void 0)],y.Pop),W[63786]=x(63786,"open_pack_select",void 0,[],void 0),W[63787]=x(63787,"item_select",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63788]=x(63788,"get_item_id",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63789]=x(63789,"color_change",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63790]=x(63790,"send_statistic",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63791]=x(63791,"unknown_f92f",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63792]=x(63792,"chat_box",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63793]=x(63793,"chat_bubble",void 0,[P(l,void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63794]=x(63794,"unknown_f932",void 0,[],void 0),W[63795]=x(63795,"unknown_f933",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],void 0),W[63796]=x(63796,"scroll_text",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(p,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(c,void 0,void 0)],y.Pop),W[63797]=x(63797,"gba_unknown1",void 0,[],void 0),W[63798]=x(63798,"gba_unknown2",void 0,[],void 0),W[63799]=x(63799,"gba_unknown3",void 0,[],void 0),W[63800]=x(63800,"add_damage_to",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63801]=x(63801,"item_delete3",void 0,[P(l,void 0,void 0)],y.Pop),W[63802]=x(63802,"get_item_info",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63803]=x(63803,"item_packing1",void 0,[P(l,void 0,void 0)],y.Pop),W[63804]=x(63804,"item_packing2",void 0,[P(l,void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63805]=x(63805,"get_lang_setting",void 0,[P({kind:s.RegTupRef,register_tuples:[P(a,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63806]=x(63806,"prepare_statistic",void 0,[P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63807]=x(63807,"keyword_detect",void 0,[],void 0),W[63808]=x(63808,"keyword",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,"Player slot.",void 0),P(c,void 0,void 0)],y.Pop),W[63809]=x(63809,"get_guildcard_num",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63810]=x(63810,"unknown_f942",void 0,[],void 0),W[63811]=x(63811,"unknown_f943",void 0,[],void 0),W[63812]=x(63812,"get_wrap_status",void 0,[P(l,"Player slot.",void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63813]=x(63813,"initial_floor",void 0,[P(l,void 0,void 0)],y.Pop),W[63814]=x(63814,"sin",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63815]=x(63815,"cos",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0)],y.Pop),W[63816]=x(63816,"unknown_f948",void 0,[],void 0),W[63817]=x(63817,"unknown_f949",void 0,[],void 0),W[63818]=x(63818,"boss_is_dead2",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63819]=x(63819,"unknown_f94b",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63820]=x(63820,"unknown_f94c",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63821]=x(63821,"is_there_cardbattle",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63822]=x(63822,"unknown_f94e",void 0,[],void 0),W[63823]=x(63823,"unknown_f94f",void 0,[],void 0),W[63824]=x(63824,"bb_p2_menu",void 0,[P(l,void 0,void 0)],y.Pop),W[63825]=x(63825,"bb_map_designate",void 0,[P(u,void 0,void 0),P(_,void 0,void 0),P(u,void 0,void 0),P(u,void 0,void 0)],void 0));W[63826]=x(63826,"bb_get_number_in_pack",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],void 0),W[63827]=x(63827,"bb_swap_item",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63828]=x(63828,"bb_check_wrap",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0)],y.Pop),W[63829]=x(63829,"bb_exchange_pd_item",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63830]=x(63830,"bb_exchange_pd_srank",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63831]=x(63831,"bb_exchange_pd_special",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63832]=x(63832,"bb_exchange_pd_percent",void 0,[P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63833]=x(63833,"unknown_f959",void 0,[P(l,void 0,void 0)],y.Pop),W[63834]=x(63834,"unknown_f95a",void 0,[],void 0),W[63835]=x(63835,"unknown_f95b",void 0,[],void 0),W[63836]=x(63836,"bb_exchange_slt",void 0,[P(l,void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63837]=x(63837,"bb_exchange_pc",void 0,[],void 0),W[63838]=x(63838,"bb_box_create_bp",void 0,[P(l,void 0,void 0),P(p,void 0,void 0),P(p,void 0,void 0)],y.Pop),W[63839]=x(63839,"bb_exchange_pt",void 0,[P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P({kind:s.RegTupRef,register_tuples:[P(l,void 0,T.Write)]},void 0,void 0),P(l,void 0,void 0),P(f,void 0,void 0),P(f,void 0,void 0)],y.Pop),W[63840]=x(63840,"unknown_f960",void 0,[P(l,void 0,void 0)],y.Pop),W[63841]=x(63841,"unknown_f961",void 0,[],void 0),W[63842]=x(63842,"unknown_f962",void 0,[],void 0),W[63843]=x(63843,"unknown_f963",void 0,[],void 0),W[63844]=x(63844,"unknown_f964",void 0,[],void 0),W[63845]=x(63845,"unknown_f965",void 0,[],void 0),W[63846]=x(63846,"unknown_f966",void 0,[],void 0),W[63847]=x(63847,"unknown_f967",void 0,[],void 0),W[63848]=x(63848,"unknown_f968",void 0,[],void 0),W[63849]=x(63849,"unknown_f969",void 0,[],void 0),W[63850]=x(63850,"unknown_f96a",void 0,[],void 0),W[63851]=x(63851,"unknown_f96b",void 0,[],void 0),W[63852]=x(63852,"unknown_f96c",void 0,[],void 0),W[63853]=x(63853,"unknown_f96d",void 0,[],void 0),W[63854]=x(63854,"unknown_f96e",void 0,[],void 0),W[63855]=x(63855,"unknown_f96f",void 0,[],void 0),W[63856]=x(63856,"unknown_f970",void 0,[],void 0),W[63857]=x(63857,"unknown_f971",void 0,[],void 0),W[63858]=x(63858,"unknown_f972",void 0,[],void 0),W[63859]=x(63859,"unknown_f973",void 0,[],void 0),W[63860]=x(63860,"unknown_f974",void 0,[],void 0),W[63861]=x(63861,"unknown_f975",void 0,[],void 0),W[63862]=x(63862,"unknown_f976",void 0,[],void 0),W[63863]=x(63863,"unknown_f977",void 0,[],void 0),W[63864]=x(63864,"unknown_f978",void 0,[],void 0),W[63865]=x(63865,"unknown_f979",void 0,[],void 0),W[63866]=x(63866,"unknown_f97a",void 0,[],void 0),W[63867]=x(63867,"unknown_f97b",void 0,[],void 0),W[63868]=x(63868,"unknown_f97c",void 0,[],void 0),W[63869]=x(63869,"unknown_f97d",void 0,[],void 0),W[63870]=x(63870,"unknown_f97e",void 0,[],void 0),W[63871]=x(63871,"unknown_f97f",void 0,[],void 0),W[63872]=x(63872,"unknown_f980",void 0,[],void 0),W[63873]=x(63873,"unknown_f981",void 0,[],void 0),W[63874]=x(63874,"unknown_f982",void 0,[],void 0),W[63875]=x(63875,"unknown_f983",void 0,[],void 0),W[63876]=x(63876,"unknown_f984",void 0,[],void 0),W[63877]=x(63877,"unknown_f985",void 0,[],void 0),W[63878]=x(63878,"unknown_f986",void 0,[],void 0),W[63879]=x(63879,"unknown_f987",void 0,[],void 0),W[63880]=x(63880,"unknown_f988",void 0,[],void 0),W[63881]=x(63881,"unknown_f989",void 0,[],void 0),W[63882]=x(63882,"unknown_f98a",void 0,[],void 0),W[63883]=x(63883,"unknown_f98b",void 0,[],void 0),W[63884]=x(63884,"unknown_f98c",void 0,[],void 0),W[63885]=x(63885,"unknown_f98d",void 0,[],void 0),W[63886]=x(63886,"unknown_f98e",void 0,[],void 0),W[63887]=x(63887,"unknown_f98f",void 0,[],void 0),W[63888]=x(63888,"unknown_f990",void 0,[],void 0),W[63889]=x(63889,"unknown_f991",void 0,[],void 0),W[63890]=x(63890,"unknown_f992",void 0,[],void 0),W[63891]=x(63891,"unknown_f993",void 0,[],void 0),W[63892]=x(63892,"unknown_f994",void 0,[],void 0),W[63893]=x(63893,"unknown_f995",void 0,[],void 0),W[63894]=x(63894,"unknown_f996",void 0,[],void 0),W[63895]=x(63895,"unknown_f997",void 0,[],void 0),W[63896]=x(63896,"unknown_f998",void 0,[],void 0),W[63897]=x(63897,"unknown_f999",void 0,[],void 0),W[63898]=x(63898,"unknown_f99a",void 0,[],void 0),W[63899]=x(63899,"unknown_f99b",void 0,[],void 0),W[63900]=x(63900,"unknown_f99c",void 0,[],void 0),W[63901]=x(63901,"unknown_f99d",void 0,[],void 0),W[63902]=x(63902,"unknown_f99e",void 0,[],void 0),W[63903]=x(63903,"unknown_f99f",void 0,[],void 0),W[63904]=x(63904,"unknown_f9a0",void 0,[],void 0),W[63905]=x(63905,"unknown_f9a1",void 0,[],void 0),W[63906]=x(63906,"unknown_f9a2",void 0,[],void 0),W[63907]=x(63907,"unknown_f9a3",void 0,[],void 0),W[63908]=x(63908,"unknown_f9a4",void 0,[],void 0),W[63909]=x(63909,"unknown_f9a5",void 0,[],void 0),W[63910]=x(63910,"unknown_f9a6",void 0,[],void 0),W[63911]=x(63911,"unknown_f9a7",void 0,[],void 0),W[63912]=x(63912,"unknown_f9a8",void 0,[],void 0),W[63913]=x(63913,"unknown_f9a9",void 0,[],void 0),W[63914]=x(63914,"unknown_f9aa",void 0,[],void 0),W[63915]=x(63915,"unknown_f9ab",void 0,[],void 0),W[63916]=x(63916,"unknown_f9ac",void 0,[],void 0),W[63917]=x(63917,"unknown_f9ad",void 0,[],void 0),W[63918]=x(63918,"unknown_f9ae",void 0,[],void 0),W[63919]=x(63919,"unknown_f9af",void 0,[],void 0),W[63920]=x(63920,"unknown_f9b0",void 0,[],void 0),W[63921]=x(63921,"unknown_f9b1",void 0,[],void 0),W[63922]=x(63922,"unknown_f9b2",void 0,[],void 0),W[63923]=x(63923,"unknown_f9b3",void 0,[],void 0),W[63924]=x(63924,"unknown_f9b4",void 0,[],void 0),W[63925]=x(63925,"unknown_f9b5",void 0,[],void 0),W[63926]=x(63926,"unknown_f9b6",void 0,[],void 0),W[63927]=x(63927,"unknown_f9b7",void 0,[],void 0),W[63928]=x(63928,"unknown_f9b8",void 0,[],void 0),W[63929]=x(63929,"unknown_f9b9",void 0,[],void 0),W[63930]=x(63930,"unknown_f9ba",void 0,[],void 0),W[63931]=x(63931,"unknown_f9bb",void 0,[],void 0),W[63932]=x(63932,"unknown_f9bc",void 0,[],void 0),W[63933]=x(63933,"unknown_f9bd",void 0,[],void 0),W[63934]=x(63934,"unknown_f9be",void 0,[],void 0),W[63935]=x(63935,"unknown_f9bf",void 0,[],void 0),W[63936]=x(63936,"unknown_f9c0",void 0,[],void 0),W[63937]=x(63937,"unknown_f9c1",void 0,[],void 0),W[63938]=x(63938,"unknown_f9c2",void 0,[],void 0),W[63939]=x(63939,"unknown_f9c3",void 0,[],void 0),W[63940]=x(63940,"unknown_f9c4",void 0,[],void 0),W[63941]=x(63941,"unknown_f9c5",void 0,[],void 0),W[63942]=x(63942,"unknown_f9c6",void 0,[],void 0),W[63943]=x(63943,"unknown_f9c7",void 0,[],void 0),W[63944]=x(63944,"unknown_f9c8",void 0,[],void 0),W[63945]=x(63945,"unknown_f9c9",void 0,[],void 0),W[63946]=x(63946,"unknown_f9ca",void 0,[],void 0),W[63947]=x(63947,"unknown_f9cb",void 0,[],void 0),W[63948]=x(63948,"unknown_f9cc",void 0,[],void 0),W[63949]=x(63949,"unknown_f9cd",void 0,[],void 0),W[63950]=x(63950,"unknown_f9ce",void 0,[],void 0),W[63951]=x(63951,"unknown_f9cf",void 0,[],void 0),W[63952]=x(63952,"unknown_f9d0",void 0,[],void 0),W[63953]=x(63953,"unknown_f9d1",void 0,[],void 0),W[63954]=x(63954,"unknown_f9d2",void 0,[],void 0),W[63955]=x(63955,"unknown_f9d3",void 0,[],void 0),W[63956]=x(63956,"unknown_f9d4",void 0,[],void 0),W[63957]=x(63957,"unknown_f9d5",void 0,[],void 0),W[63958]=x(63958,"unknown_f9d6",void 0,[],void 0),W[63959]=x(63959,"unknown_f9d7",void 0,[],void 0),W[63960]=x(63960,"unknown_f9d8",void 0,[],void 0),W[63961]=x(63961,"unknown_f9d9",void 0,[],void 0),W[63962]=x(63962,"unknown_f9da",void 0,[],void 0),W[63963]=x(63963,"unknown_f9db",void 0,[],void 0),W[63964]=x(63964,"unknown_f9dc",void 0,[],void 0),W[63965]=x(63965,"unknown_f9dd",void 0,[],void 0),W[63966]=x(63966,"unknown_f9de",void 0,[],void 0),W[63967]=x(63967,"unknown_f9df",void 0,[],void 0),W[63968]=x(63968,"unknown_f9e0",void 0,[],void 0),W[63969]=x(63969,"unknown_f9e1",void 0,[],void 0),W[63970]=x(63970,"unknown_f9e2",void 0,[],void 0),W[63971]=x(63971,"unknown_f9e3",void 0,[],void 0),W[63972]=x(63972,"unknown_f9e4",void 0,[],void 0),W[63973]=x(63973,"unknown_f9e5",void 0,[],void 0),W[63974]=x(63974,"unknown_f9e6",void 0,[],void 0),W[63975]=x(63975,"unknown_f9e7",void 0,[],void 0),W[63976]=x(63976,"unknown_f9e8",void 0,[],void 0),W[63977]=x(63977,"unknown_f9e9",void 0,[],void 0),W[63978]=x(63978,"unknown_f9ea",void 0,[],void 0),W[63979]=x(63979,"unknown_f9eb",void 0,[],void 0),W[63980]=x(63980,"unknown_f9ec",void 0,[],void 0),W[63981]=x(63981,"unknown_f9ed",void 0,[],void 0),W[63982]=x(63982,"unknown_f9ee",void 0,[],void 0),W[63983]=x(63983,"unknown_f9ef",void 0,[],void 0),W[63984]=x(63984,"unknown_f9f0",void 0,[],void 0),W[63985]=x(63985,"unknown_f9f1",void 0,[],void 0),W[63986]=x(63986,"unknown_f9f2",void 0,[],void 0),W[63987]=x(63987,"unknown_f9f3",void 0,[],void 0),W[63988]=x(63988,"unknown_f9f4",void 0,[],void 0),W[63989]=x(63989,"unknown_f9f5",void 0,[],void 0),W[63990]=x(63990,"unknown_f9f6",void 0,[],void 0),W[63991]=x(63991,"unknown_f9f7",void 0,[],void 0),W[63992]=x(63992,"unknown_f9f8",void 0,[],void 0),W[63993]=x(63993,"unknown_f9f9",void 0,[],void 0),W[63994]=x(63994,"unknown_f9fa",void 0,[],void 0),W[63995]=x(63995,"unknown_f9fb",void 0,[],void 0),W[63996]=x(63996,"unknown_f9fc",void 0,[],void 0),W[63997]=x(63997,"unknown_f9fd",void 0,[],void 0),W[63998]=x(63998,"unknown_f9fe",void 0,[],void 0),W[63999]=x(63999,"unknown_f9ff",void 0,[],void 0);function A(i,e){if(!i){let i="Assertion Error";throw e&&(i+=": "+(e instanceof Function?e():e)),new Error(i)}}var M,F;function q(i){const e=Object.values(i),o=e.filter(i=>"number"==typeof i);return o.length?o:e}W.forEach(i=>{S.set(i.mnemonic,i)}),function(i){i[i.Instructions=0]="Instructions",i[i.Data=1]="Data",i[i.String=2]="String"}(M||(M={}));!function(i){i[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Info=2]="Info",i[i.Warn=3]="Warn",i[i.Error=4]="Error",i[i.Off=5]="Off"}(F||(F={}));q(F);function C(i,e){return i.toString().padStart(e,"0")}class E{constructor(i){this.name=i,this.trace=(i,e)=>{this.handle(F.Trace,i,e)},this.debug=(i,e)=>{this.handle(F.Debug,i,e)},this.info=(i,e)=>{this.handle(F.Info,i,e)},this.warn=(i,e)=>{this.handle(F.Warn,i,e)},this.error=(i,e)=>{this.handle(F.Error,i,e)}}get level(){var i;return null!=(i=this._level)?i:N.default_level}set level(i){this._level=i}get handler(){var i;return null!=(i=this._handler)?i:N.default_handler}set handler(i){this._handler=i}handle(i,e,o){i>=this.level&&this.handler({time:new Date,message:e,level:i,logger:this,cause:o},this.name)}}class N{static get(i){let e=this.loggers.get(i);return e||(e=new E(i),this.loggers.set(i,e)),e}static with_default_handler(i,e){const o=this.default_handler;let d=!1;try{this.default_handler=i;const v=e();return v instanceof Promise?(d=!0,v.finally(()=>this.default_handler=o)):v}finally{d||(this.default_handler=o)}}}N.loggers=new Map,N.default_level=function(i){const e=F[i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()];return A(null!=e,()=>`"${i}" is not a valid log level.`),e}("INFO"),N.default_handler=function({time:i,message:e,level:o,logger:d,cause:v}){const t=`${function(i){const e=C(i.getHours(),2),o=C(i.getMinutes(),2),d=C(i.getSeconds(),2),v=C(i.getMilliseconds(),3);return`${e}:${o}:${d}.${v}`}(i)} [${F[o]}] ${d.name} - ${e}`;let n;switch(o){case F.Trace:n=console.trace;break;case F.Debug:n=console.debug;break;case F.Info:n=console.info;break;case F.Warn:n=console.warn;break;case F.Error:n=console.error;break;default:n=console.log}null==v?n.call(console,t):n.call(console,t,v)};const O=N.get("quest_editor/scripting/assembly");class U{constructor(i,e){this.assembly=i,this.manual_stack=e,this.lexer=new r,this.section=M.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=M.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const i of this.assembly){if(this.tokens=this.lexer.tokenize_line(i),this.tokens.length>0){const i=this.tokens.shift();let e=!1;switch(i.type){case n.Label:this.parse_label(i),e=!0;break;case n.CodeSection:case n.DataSection:case n.StringSection:this.parse_section(i);break;case n.Int:this.section===M.Data?this.parse_bytes(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.String:this.section===M.String?this.parse_string(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.Ident:this.section===M.Instructions?this.parse_instruction(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.InvalidSection:this.add_error({col:i.col,length:i.len,message:"Invalid section type."});break;case n.InvalidIdent:this.add_error({col:i.col,length:i.len,message:"Invalid identifier."});break;default:this.add_error({col:i.col,length:i.len,message:"Unexpected token."})}this.prev_line_had_label=e}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(i,e,o,d,v,t){if(this.segment)this.segment.type===M.Instructions?this.segment.instructions.push(function(i,e,o){const d=Math.min(i.params.length,e.length),v=[];let t=0;for(let o=0;o({line_no:this.line_no,col:i.col,len:i.len})),stack_args:t.map((i,e)=>({line_no:this.line_no,col:i.col,len:i.len,value:o[e].value}))})):O.error(`Line ${this.line_no}: Expected instructions segment.`);else{const i={labels:[],type:M.Instructions,instructions:[],asm:{labels:[]}};this.segment=i,this.object_code.push(i)}}add_bytes(i){if(this.segment)if(this.segment.type===M.Data){const e=new ArrayBuffer(this.segment.data.byteLength+i.length),o=new Uint8Array(e);o.set(new Uint8Array(this.segment.data)),o.set(new Uint8Array(i),this.segment.data.byteLength),this.segment.data=e}else O.error(`Line ${this.line_no}: Expected data segment.`);else{const e={labels:[],type:M.Data,data:new Uint8Array(i).buffer,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_string(i){if(this.segment)this.segment.type===M.String?this.segment.value+=i:O.error(`Line ${this.line_no}: Expected string segment.`);else{const e={labels:[],type:M.String,value:i,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_error({col:i,length:e,message:o}){this.errors.push({line_no:this.line_no,col:i,length:e,message:o})}add_warning({col:i,length:e,message:o}){this.warnings.push({line_no:this.line_no,col:i,length:e,message:o})}parse_label({col:i,len:e,value:o}){this.labels.has(o)&&this.add_error({col:i,length:e,message:"Duplicate label."}),this.labels.add(o);const d=this.tokens.shift(),v={line_no:this.line_no,col:i,len:e};if(this.prev_line_had_label){const i=this.object_code[this.object_code.length-1];i.labels.push(o),i.asm.labels.push(v)}switch(this.section){case M.Instructions:this.prev_line_had_label||(this.segment={type:M.Instructions,labels:[o],instructions:[],asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.Ident?this.parse_instruction(d):this.add_error({col:d.col,length:d.len,message:"Expected opcode mnemonic."}));break;case M.Data:this.prev_line_had_label||(this.segment={type:M.Data,labels:[o],data:new ArrayBuffer(0),asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.Int?this.parse_bytes(d):this.add_error({col:d.col,length:d.len,message:"Expected bytes."}));break;case M.String:this.prev_line_had_label||(this.segment={type:M.String,labels:[o],value:"",asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.String?this.parse_string(d):this.add_error({col:d.col,length:d.len,message:"Expected a string."}))}}parse_section({type:i,col:e,len:o}){let d;switch(i){case n.CodeSection:d=M.Instructions;break;case n.DataSection:d=M.Data;break;case n.StringSection:d=M.String}this.section!==d||this.first_section_marker||this.add_warning({col:e,length:o,message:"Unnecessary section marker."}),this.section=d,this.first_section_marker=!1;const v=this.tokens.shift();v&&this.add_error({col:v.col,length:v.len,message:"Unexpected token."})}parse_instruction(i){const{col:e,len:o,value:d}=i,v=S.get(d);if(v){const o=-1!==v.params.findIndex(i=>i.type.kind===s.ILabelVar||i.type.kind===s.RegRefVar),d=this.manual_stack&&v.stack===y.Pop?0:v.params.length;let a=0;for(const i of this.tokens)i.type!==n.ArgSeparator&&a++;const u=this.tokens[this.tokens.length-1],_=u?u.col+u.len-e:0,l=[],p=[];if(!o&&a!==d)return void this.add_error({col:e,length:_,message:`Expected ${d} argument${1===d?"":"s"}, got ${a}.`});if(o&&ar?this.add_error({col:v,length:t,message:`${n}-Bit integer can't be greater than ${r}.`}):o.push([{value:d,size:i},e])}parse_register(i,e){const{col:o,len:d,value:v}=i;v>255?this.add_error({col:o,length:d,message:"Invalid register reference, expected r0-r255."}):e.push([{value:v,size:1},i])}parse_bytes(i){const e=[];let o=i,d=0;for(;o.type===n.Int&&(o.value<0?this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be less than 0."}):o.value>255&&this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be greater than 255."}),e.push(o.value),d"))}}const V=self;let B=[],H=[];const Y=[],X=new Map,Z=[];let J;const G={manual_stack:!1};function K(){if(0!==Z.length)for(const i of Z.splice(0,Z.length))switch(i.type){case d.NewAssembly:B=i.assembly,di();break;case d.AssemblyChange:Q(i);break;case d.SignatureHelp:ii(i);break;case d.Definition:ei(i);break;case d.SettingsChange:oi(i)}}function Q(i){for(const e of i.changes){const{start_line_no:i,end_line_no:o,start_col:d,end_col:v,new_text:t}=e,n=o-i+1,s=t.split("\n");1===n?vi(i,d,v,s):1===s.length?ri(i,o,d,v,s[0]):(ni(i,d,s[0]),ti(o,v,s[s.length-1]),si(i+1,o-1,s.slice(1,s.length-1)))}di()}function ii(i){let e,o=-1;if(i.line_no<=B.length){const d=B[i.line_no-1],v=(new r).tokenize_line(d),t=v.find(i=>i.type===n.Ident);if(t&&(e=S.get(t.value),e))for(const e of v){if(e.col+e.len>i.col)break;e.type===n.Ident&&-1===o?o=0:e.type===n.ArgSeparator&&o++}}const d={type:v.SignatureHelp,id:i.id,opcode:e,active_param:o};V.postMessage(d)}function ei(i){const e=function(i,e){const o=Y[i];if(!o)return;const d=H[o.segment_index];if(!d||d.type!==M.Instructions)return;for(const v of o.instruction_indices){const o=d.instructions[v];if(o&&o.asm){const d=o.opcode.params;for(let v=0;v=o.col&&e<=o.col+o.len)}V.onmessage=i=>{Z.push(i.data),J||(K(),J=setTimeout(()=>{J=void 0,K()},100))}}}); \ No newline at end of file diff --git a/9a937510e908df9fb2da.worker.js b/9a937510e908df9fb2da.worker.js new file mode 100644 index 00000000..dcc4de27 --- /dev/null +++ b/9a937510e908df9fb2da.worker.js @@ -0,0 +1 @@ +!function(i){var e={};function o(d){if(e[d])return e[d].exports;var v=e[d]={i:d,l:!1,exports:{}};return i[d].call(v.exports,v,v.exports,o),v.l=!0,v.exports}o.m=i,o.c=e,o.d=function(i,e,d){o.o(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:d})},o.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,e){if(1&e&&(i=o(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var d=Object.create(null);if(o.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var v in i)o.d(d,v,function(e){return i[e]}.bind(null,v));return d},o.n=function(i){var e=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(e,"a",e),e},o.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},o.p="",o(o.s="yL6M")}({yL6M:function(i,e,o){"use strict";var d,v;o.r(e),function(i){i[i.NewAssembly=0]="NewAssembly",i[i.AssemblyChange=1]="AssemblyChange",i[i.SignatureHelp=2]="SignatureHelp",i[i.Definition=3]="Definition",i[i.SettingsChange=4]="SettingsChange"}(d||(d={})),function(i){i[i.NewObjectCode=0]="NewObjectCode",i[i.SignatureHelp=1]="SignatureHelp",i[i.Definition=2]="Definition"}(v||(v={}));const t=new DataView(new ArrayBuffer(4));var n,s;!function(i){i[i.Int=0]="Int",i[i.Float=1]="Float",i[i.InvalidNumber=2]="InvalidNumber",i[i.Register=3]="Register",i[i.Label=4]="Label",i[i.CodeSection=5]="CodeSection",i[i.DataSection=6]="DataSection",i[i.StringSection=7]="StringSection",i[i.InvalidSection=8]="InvalidSection",i[i.String=9]="String",i[i.UnterminatedString=10]="UnterminatedString",i[i.Ident=11]="Ident",i[i.InvalidIdent=12]="InvalidIdent",i[i.ArgSeparator=13]="ArgSeparator"}(n||(n={}));class r{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(i){this.line=i,this.index=0,this._mark=0;const e=[];for(;this.has_next();){const i=this.peek();let o;if("/"===i){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(i)?this.skip():(/[-\d]/.test(i)?o=this.tokenize_number_or_label():","===i?(o={type:n.ArgSeparator,col:this.col,len:1},this.skip()):o="."===i?this.tokenize_section():'"'===i?this.tokenize_string():"r"===i?this.tokenize_register_or_ident():this.tokenize_ident(),e.push(o))}return e}has_next(){return this.index!]*$/.test(e)?n.Ident:n.InvalidIdent;return o===n.Ident?{type:o,col:i,len:this.marked_len(),value:e}:{type:o,col:i,len:this.marked_len()}}}!function(i){i[i.Any=0]="Any",i[i.Byte=1]="Byte",i[i.Word=2]="Word",i[i.DWord=3]="DWord",i[i.Float=4]="Float",i[i.Label=5]="Label",i[i.ILabel=6]="ILabel",i[i.DLabel=7]="DLabel",i[i.SLabel=8]="SLabel",i[i.String=9]="String",i[i.ILabelVar=10]="ILabelVar",i[i.RegRef=11]="RegRef",i[i.RegTupRef=12]="RegTupRef",i[i.RegRefVar=13]="RegRefVar",i[i.Pointer=14]="Pointer"}(s||(s={}));const a={kind:s.Any},l={kind:s.Byte},u={kind:s.Word},_={kind:s.DWord},p={kind:s.Float},g={kind:s.Label},f={kind:s.ILabel},c={kind:s.DLabel},k={kind:s.SLabel},R={kind:s.String},h={kind:s.ILabelVar},w={kind:s.RegRef},b={kind:s.RegRefVar},m={kind:s.Pointer},T=-Math.pow(2,31),y=Math.pow(2,31)-1;Math.pow(2,32);var P,W;function S(i,e,o){return{type:i,doc:e,access:o}}!function(i){i[i.Read=0]="Read",i[i.Write=1]="Write",i[i.ReadWrite=2]="ReadWrite"}(P||(P={})),function(i){i[i.Push=0]="Push",i[i.Pop=1]="Pop"}(W||(W={}));const x=[],I=new Map;function j(i,e,o,d,v){return{code:i,mnemonic:e,doc:o,size:i<256?1:2,params:d,stack:v}}x[0]=j(0,"nop","No operation, does nothing.",[],void 0);const L=x[1]=j(1,"ret","Returns control to caller.",[],void 0),z=(x[2]=j(2,"sync","Yields control for the rest of the current frame. Execution will continue the following frame.",[],void 0),x[3]=j(3,"exit",void 0,[S(_,void 0,void 0)],W.Pop),x[4]=j(4,"thread","Starts a new thread. Thread execution will start at the given label.\nOften used to check a register every frame. Make sure to yield control with sync when looping.",[S(f,void 0,void 0)],void 0),x[5]=j(5,"va_start","Initializes a variable argument list.\nMake sure to call va_end after va_start and va_call.",[],void 0),x[6]=j(6,"va_end","Restores the registers overwritten by arg_push* instructions.\nCalled after va_call.",[],void 0),x[7]=j(7,"va_call","Calls the variable argument function at the given label.\nCalled after initializing the argument list with va_start and pushing arguments onto the stack with arg_push* instructions. Make sure to call va_end afterwards.",[S(f,void 0,void 0)],void 0)),D=x[8]=j(8,"let","Sets the first register's value to second one's value.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),C=x[9]=j(9,"leti","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),M=x[10]=j(10,"letb","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(l,void 0,P.Write)]},void 0,void 0),S(l,void 0,void 0)],void 0),$=x[11]=j(11,"letw","Sets a register to the given value.",[S({kind:s.RegTupRef,register_tuples:[S(u,void 0,P.Write)]},void 0,void 0),S(u,void 0,void 0)],void 0),N=(x[12]=j(12,"leta","Sets the first register to the memory address of the second register. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(m,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[13]=j(13,"leto","Sets a register to the memory address of the given label. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(m,void 0,P.Write)]},void 0,void 0),S(g,void 0,void 0)],void 0),x[14]=j(14,"unknown_0e",void 0,[],void 0),x[15]=j(15,"unknown_0f",void 0,[],void 0),x[16]=j(16,"set","Sets a register to 1.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),A=x[17]=j(17,"clear","Sets a register to 0.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),q=x[18]=j(18,"rev","Sets a register to 1 if its current value is 0, otherwise sets it to 0.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.ReadWrite)]},void 0,void 0)],void 0),F=(x[19]=j(19,"gset",void 0,[S(u,void 0,void 0)],void 0),x[20]=j(20,"gclear",void 0,[S(u,void 0,void 0)],void 0),x[21]=j(21,"grev",void 0,[S(u,void 0,void 0)],void 0),x[22]=j(22,"glet",void 0,[S(u,void 0,void 0)],void 0),x[23]=j(23,"gget","Sets a register to value of the given flag.",[S(u,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(u,void 0,P.Write)]},void 0,void 0)],void 0),x[24]=j(24,"add",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[25]=j(25,"addi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),E=(x[26]=j(26,"sub",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[27]=j(27,"subi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),O=(x[28]=j(28,"mul",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[29]=j(29,"muli",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),U=(x[30]=j(30,"div",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[31]=j(31,"divi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),V=(x[32]=j(32,"and",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[33]=j(33,"andi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[34]=j(34,"or",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[35]=j(35,"ori",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[36]=j(36,"xor",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[37]=j(37,"xori",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[38]=j(38,"mod",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[39]=j(39,"modi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[40]=j(40,"jmp",void 0,[S(f,void 0,void 0)],void 0)),B=x[41]=j(41,"call",void 0,[S(f,void 0,void 0)],void 0),H=x[42]=j(42,"jmp_on",void 0,[S(f,void 0,void 0),S(b,void 0,P.Read)],void 0),J=x[43]=j(43,"jmp_off",void 0,[S(f,void 0,void 0),S(b,void 0,P.Read)],void 0),Y=x[44]=j(44,"jmp_=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),X=x[45]=j(45,"jmpi_=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),Z=x[46]=j(46,"jmp_!=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),G=x[47]=j(47,"jmpi_!=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),K=x[48]=j(48,"ujmp_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),Q=x[49]=j(49,"ujmpi_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ii=x[50]=j(50,"jmp_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ei=x[51]=j(51,"jmpi_>",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),oi=x[52]=j(52,"ujmp_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),di=x[53]=j(53,"ujmpi_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),vi=x[54]=j(54,"jmp_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ti=x[55]=j(55,"jmpi_<",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ni=x[56]=j(56,"ujmp_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),si=x[57]=j(57,"ujmpi_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),ri=x[58]=j(58,"jmp_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ai=x[59]=j(59,"jmpi_>=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),li=x[60]=j(60,"ujmp_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),ui=x[61]=j(61,"ujmpi_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),_i=x[62]=j(62,"jmp_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(f,void 0,void 0)],void 0),pi=x[63]=j(63,"jmpi_<=",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0)],void 0),gi=x[64]=j(64,"switch_jmp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(h,void 0,void 0)],void 0),fi=x[65]=j(65,"switch_call",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(h,void 0,void 0)],void 0),ci=(x[66]=j(66,"stack_push",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[67]=j(67,"stack_pop",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[68]=j(68,"stack_pushm","Pushes the values of an arbitrary amount of registers onto the stack.",[S(w,void 0,P.Read),S(_,void 0,void 0)],void 0)),ki=x[69]=j(69,"stack_popm","Pops an arbitrary amount of values from the stack and writes them to registers.",[S(w,void 0,P.Write),S(_,void 0,void 0)],void 0),Ri=(x[70]=j(70,"unknown_46",void 0,[],void 0),x[71]=j(71,"unknown_47",void 0,[],void 0),x[72]=j(72,"arg_pushr","Pushes the value of the given register onto the stack.",[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Push)),hi=x[73]=j(73,"arg_pushl","Pushes the given value onto the stack.",[S(_,void 0,void 0)],W.Push),wi=x[74]=j(74,"arg_pushb","Pushes the given value onto the stack.",[S(l,void 0,void 0)],W.Push),bi=x[75]=j(75,"arg_pushw","Pushes the given value onto the stack.",[S(u,void 0,void 0)],W.Push),mi=(x[76]=j(76,"arg_pusha","Pushes the memory address of the given register onto the stack. Not used by Sega.",[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Push),x[77]=j(77,"arg_pusho","Pushes the memory address of the given label onto the stack. Not used by Sega.",[S(g,void 0,void 0)],W.Push),x[78]=j(78,"arg_pushs","Pushes the given value onto the stack.",[S(R,void 0,void 0)],W.Push)),Ti=(x[79]=j(79,"unknown_4f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[80]=j(80,"message",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[81]=j(81,"list","Used to display a list of items and retrieve the item selected by the player.\nList items should be seperated by newlines. The selected item's index will be written to the given register.",[S({kind:s.RegTupRef,register_tuples:[S(l,void 0,P.Write)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[82]=j(82,"fadein",void 0,[],void 0),x[83]=j(83,"fadeout",void 0,[],void 0),x[84]=j(84,"se",void 0,[S(_,void 0,void 0)],W.Pop),x[85]=j(85,"bgm",void 0,[S(_,void 0,void 0)],W.Pop),x[86]=j(86,"unknown_56",void 0,[],void 0),x[87]=j(87,"unknown_57",void 0,[],void 0),x[88]=j(88,"enable",void 0,[S(_,void 0,void 0)],W.Pop),x[89]=j(89,"disable",void 0,[S(_,void 0,void 0)],W.Pop),x[90]=j(90,"window_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[91]=j(91,"add_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[92]=j(92,"mesend",void 0,[],void 0),x[93]=j(93,"gettime",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[94]=j(94,"winend",void 0,[],void 0),x[95]=j(95,"unknown_5f",void 0,[],void 0),x[96]=j(96,"npc_crt_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[97]=j(97,"npc_stop",void 0,[S(_,void 0,void 0)],W.Pop),x[98]=j(98,"npc_play",void 0,[S(_,void 0,void 0)],W.Pop),x[99]=j(99,"npc_kill",void 0,[S(_,void 0,void 0)],W.Pop),x[100]=j(100,"npc_nont",void 0,[],void 0),x[101]=j(101,"npc_talk",void 0,[],void 0),x[102]=j(102,"npc_crp_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read),S(a,void 0,P.Read),S(a,void 0,P.Read),S(f,void 0,P.Read),S(a,void 0,P.Read),S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[103]=j(103,"unknown_67",void 0,[],void 0),x[104]=j(104,"create_pipe",void 0,[S(_,void 0,void 0)],W.Pop),x[105]=j(105,"p_hpstat_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[106]=j(106,"p_dead_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,"Player slot.",void 0)],W.Pop),x[107]=j(107,"p_disablewarp",void 0,[],void 0),x[108]=j(108,"p_enablewarp",void 0,[],void 0),x[109]=j(109,"p_move_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[110]=j(110,"p_look",void 0,[S(_,void 0,void 0)],W.Pop),x[111]=j(111,"unknown_6f",void 0,[],void 0),x[112]=j(112,"p_action_disable",void 0,[],void 0),x[113]=j(113,"p_action_enable",void 0,[],void 0),x[114]=j(114,"disable_movement1",void 0,[S(_,void 0,void 0)],W.Pop),x[115]=j(115,"enable_movement1",void 0,[S(_,void 0,void 0)],W.Pop),x[116]=j(116,"p_noncol",void 0,[],void 0),x[117]=j(117,"p_col",void 0,[],void 0),x[118]=j(118,"p_setpos","Sets a player's position.",[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Y-axis rotation.",P.Read)]},void 0,void 0)],W.Pop),x[119]=j(119,"p_return_guild",void 0,[],void 0),x[120]=j(120,"p_talk_guild",void 0,[S(_,void 0,void 0)],W.Pop),x[121]=j(121,"npc_talk_pl_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[122]=j(122,"npc_talk_kill",void 0,[S(_,void 0,void 0)],W.Pop),x[123]=j(123,"npc_crtpk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[124]=j(124,"npc_crppk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[125]=j(125,"npc_crptalk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[126]=j(126,"p_look_at_v1",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[127]=j(127,"npc_crp_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[128]=j(128,"cam_quake",void 0,[],void 0),x[129]=j(129,"cam_adj",void 0,[],void 0),x[130]=j(130,"cam_zmin",void 0,[],void 0),x[131]=j(131,"cam_zmout",void 0,[],void 0),x[132]=j(132,"cam_pan_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[133]=j(133,"game_lev_super",void 0,[],void 0),x[134]=j(134,"game_lev_reset",void 0,[],void 0),x[135]=j(135,"pos_pipe_v3","Create a telepipe at a specific position for the given player slot that takes players back to Pioneer 2 or the Lab.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[136]=j(136,"if_zone_clear",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0)),yi=(x[137]=j(137,"chk_ene_num","Retrieves the amount of enemies killed during the quest.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[138]=j(138,"unhide_obj",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[139]=j(139,"unhide_ene",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[140]=j(140,"at_coords_call",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[141]=j(141,"at_coords_talk",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[142]=j(142,"col_npcin",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(f,void 0,P.Read)]},void 0,void 0)],void 0),x[143]=j(143,"col_npcinr",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[144]=j(144,"switch_on",void 0,[S(_,void 0,void 0)],W.Pop),x[145]=j(145,"switch_off",void 0,[S(_,void 0,void 0)],W.Pop),x[146]=j(146,"playbgm_epi",void 0,[S(_,void 0,void 0)],W.Pop),x[147]=j(147,"set_mainwarp",void 0,[S(_,void 0,void 0)],W.Pop),x[148]=j(148,"set_obj_param","Creates a targetable object.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Read),S(_,"Y coordinate.",P.Read),S(_,"Z coordinate.",P.Read),S(_,"Collision radius.",P.Read),S(f,"Function label.",P.Read),S(_,"Vertical position of the cursor.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},"Object handle.",void 0)],void 0),x[149]=j(149,"set_floor_handler",void 0,[S(_,"Floor number.",void 0),S(f,"Handler function label.",void 0)],W.Pop),x[150]=j(150,"clr_floor_handler",void 0,[S(_,"Floor number.",void 0)],W.Pop),x[151]=j(151,"col_plinaw",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[152]=j(152,"hud_hide",void 0,[],void 0),x[153]=j(153,"hud_show",void 0,[],void 0),x[154]=j(154,"cine_enable",void 0,[],void 0),x[155]=j(155,"cine_disable",void 0,[],void 0),x[156]=j(156,"unknown_9c",void 0,[],void 0),x[157]=j(157,"unknown_9d",void 0,[],void 0),x[158]=j(158,"unknown_9e",void 0,[],void 0),x[159]=j(159,"unknown_9f",void 0,[],void 0),x[160]=j(160,"unknown_a0",void 0,[],void 0),x[161]=j(161,"set_qt_failure",void 0,[S(f,void 0,void 0)],void 0),x[162]=j(162,"set_qt_success",void 0,[S(f,void 0,void 0)],void 0),x[163]=j(163,"clr_qt_failure",void 0,[],void 0),x[164]=j(164,"clr_qt_success",void 0,[],void 0),x[165]=j(165,"set_qt_cancel",void 0,[S(f,void 0,void 0)],void 0),x[166]=j(166,"clr_qt_cancel",void 0,[],void 0),x[167]=j(167,"unknown_a7",void 0,[],void 0),x[168]=j(168,"pl_walk_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[169]=j(169,"unknown_a9",void 0,[],void 0),x[170]=j(170,"unknown_aa",void 0,[],void 0),x[171]=j(171,"unknown_ab",void 0,[],void 0),x[172]=j(172,"unknown_ac",void 0,[],void 0),x[173]=j(173,"unknown_ad",void 0,[],void 0),x[174]=j(174,"unknown_ae",void 0,[],void 0),x[175]=j(175,"unknown_af",void 0,[],void 0),x[176]=j(176,"pl_add_meseta",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[177]=j(177,"thread_stg",void 0,[S(f,void 0,void 0)],void 0),x[178]=j(178,"del_obj_param",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},"Object handle.",void 0)],void 0),x[179]=j(179,"item_create",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[180]=j(180,"item_create2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[181]=j(181,"item_delete",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[182]=j(182,"item_delete2","Deletes an item from the player's inventory.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[183]=j(183,"item_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[184]=j(184,"setevt",void 0,[S(_,void 0,void 0)],W.Pop),x[185]=j(185,"get_difflvl","Sets the given register to the current difficulty. 0 For normal, 1 for hard and 2 for both very hard and ultimate.\nUse get_difficulty_level2 if you want to differentiate between very hard and ultimate.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),Pi=(x[186]=j(186,"set_qt_exit",void 0,[S(f,void 0,void 0)],void 0),x[187]=j(187,"clr_qt_exit",void 0,[],void 0),x[188]=j(188,"unknown_bc",void 0,[],void 0),x[189]=j(189,"unknown_bd",void 0,[],void 0),x[190]=j(190,"unknown_be",void 0,[],void 0),x[191]=j(191,"unknown_bf",void 0,[],void 0),x[192]=j(192,"particle_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[193]=j(193,"npc_text",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[194]=j(194,"npc_chkwarp",void 0,[],void 0),x[195]=j(195,"pl_pkoff",void 0,[],void 0),x[196]=j(196,"map_designate",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0)),Wi=(x[197]=j(197,"masterkey_on",void 0,[],void 0),x[198]=j(198,"masterkey_off",void 0,[],void 0),x[199]=j(199,"window_time",void 0,[],void 0),x[200]=j(200,"winend_time",void 0,[],void 0),x[201]=j(201,"winset_time",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[202]=j(202,"getmtime",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[203]=j(203,"set_quest_board_handler",void 0,[S(_,void 0,void 0),S(f,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[204]=j(204,"clear_quest_board_handler",void 0,[S(_,void 0,void 0)],W.Pop),x[205]=j(205,"particle_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[206]=j(206,"npc_crptalk_id_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[207]=j(207,"npc_lang_clean",void 0,[],void 0),x[208]=j(208,"pl_pkon",void 0,[],void 0),x[209]=j(209,"pl_chk_item2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[210]=j(210,"enable_mainmenu",void 0,[],void 0),x[211]=j(211,"disable_mainmenu",void 0,[],void 0),x[212]=j(212,"start_battlebgm",void 0,[],void 0),x[213]=j(213,"end_battlebgm",void 0,[],void 0),x[214]=j(214,"disp_msg_qb",void 0,[S(R,void 0,void 0)],W.Pop),x[215]=j(215,"close_msg_qb",void 0,[],void 0),x[216]=j(216,"set_eventflag_v3",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[217]=j(217,"sync_leti",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],void 0)),Si=(x[218]=j(218,"set_returnhunter",void 0,[],void 0),x[219]=j(219,"set_returncity",void 0,[],void 0),x[220]=j(220,"load_pvr",void 0,[],void 0),x[221]=j(221,"load_midi",void 0,[],void 0),x[222]=j(222,"unknown_de",void 0,[],void 0),x[223]=j(223,"npc_param_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[224]=j(224,"pad_dragon",void 0,[],void 0),x[225]=j(225,"clear_mainwarp",void 0,[S(_,void 0,void 0)],W.Pop),x[226]=j(226,"pcam_param_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[227]=j(227,"start_setevt_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[228]=j(228,"warp_on",void 0,[],void 0),x[229]=j(229,"warp_off",void 0,[],void 0),x[230]=j(230,"get_slotnumber",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),xi=(x[231]=j(231,"get_servernumber",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[232]=j(232,"set_eventflag2",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[233]=j(233,"res",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[234]=j(234,"unknown_ea",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0)],void 0),x[235]=j(235,"enable_bgmctrl",void 0,[S(_,void 0,void 0)],W.Pop),x[236]=j(236,"sw_send",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[237]=j(237,"create_bgmctrl",void 0,[],void 0),x[238]=j(238,"pl_add_meseta2",void 0,[S(_,void 0,void 0)],W.Pop),x[239]=j(239,"sync_register",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[240]=j(240,"send_regwork",void 0,[],void 0),x[241]=j(241,"leti_fixed_camera_v3",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[242]=j(242,"default_camera_pos1",void 0,[],void 0),x[243]=j(243,"unknown_f3",void 0,[],void 0),x[244]=j(244,"unknown_f4",void 0,[],void 0),x[245]=j(245,"unknown_f5",void 0,[],void 0),x[246]=j(246,"unknown_f6",void 0,[],void 0),x[247]=j(247,"unknown_f7",void 0,[],void 0),x[248]=j(248,"unknown_f8",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[249]=j(249,"unknown_f9",void 0,[],void 0),x[250]=j(250,"get_gc_number",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[251]=j(251,"unknown_fb",void 0,[S(u,void 0,void 0)],void 0),x[252]=j(252,"unknown_fc",void 0,[],void 0),x[253]=j(253,"unknown_fd",void 0,[],void 0),x[254]=j(254,"unknown_fe",void 0,[],void 0),x[255]=j(255,"unknown_ff",void 0,[],void 0),x[63488]=j(63488,"unknown_f800",void 0,[],void 0),x[63489]=j(63489,"set_chat_callback",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63490]=j(63490,"unknown_f802",void 0,[],void 0),x[63491]=j(63491,"unknown_f803",void 0,[],void 0),x[63492]=j(63492,"unknown_f804",void 0,[],void 0),x[63493]=j(63493,"unknown_f805",void 0,[],void 0),x[63494]=j(63494,"unknown_f806",void 0,[],void 0),x[63495]=j(63495,"unknown_f807",void 0,[],void 0),x[63496]=j(63496,"get_difficulty_level2","Sets the given register to the current difficulty. 0 For normal, 1 for hard, 2 for very hard and 3 for ultimate.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63497]=j(63497,"get_number_of_player1","Set the given register to the current number of players. Either 1, 2, 3 or 4.",[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63498]=j(63498,"get_coord_of_player","Retrieves a player's position.",[S({kind:s.RegTupRef,register_tuples:[S(_,"X coordinate.",P.Write),S(_,"Y coordinate.",P.Write),S(_,"Z coordinate.",P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63499]=j(63499,"enable_map",void 0,[],void 0),x[63500]=j(63500,"disable_map",void 0,[],void 0),x[63501]=j(63501,"map_designate_ex",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0)],void 0)),Ii=(x[63502]=j(63502,"unknown_f80e",void 0,[S(_,void 0,void 0)],W.Pop),x[63503]=j(63503,"unknown_f80f",void 0,[S(_,void 0,void 0)],W.Pop),x[63504]=j(63504,"ba_initial_floor",void 0,[S(_,void 0,void 0)],W.Pop),x[63505]=j(63505,"set_ba_rules",void 0,[],void 0),x[63506]=j(63506,"unknown_f812",void 0,[S(_,void 0,void 0)],W.Pop),x[63507]=j(63507,"unknown_f813",void 0,[S(_,void 0,void 0)],W.Pop),x[63508]=j(63508,"unknown_f814",void 0,[S(_,void 0,void 0)],W.Pop),x[63509]=j(63509,"unknown_f815",void 0,[S(_,void 0,void 0)],W.Pop),x[63510]=j(63510,"unknown_f816",void 0,[S(_,void 0,void 0)],W.Pop),x[63511]=j(63511,"unknown_f817",void 0,[S(_,void 0,void 0)],W.Pop),x[63512]=j(63512,"unknown_f818",void 0,[S(_,void 0,void 0)],W.Pop),x[63513]=j(63513,"unknown_f819",void 0,[S(_,void 0,void 0)],W.Pop),x[63514]=j(63514,"unknown_f81a",void 0,[S(_,void 0,void 0)],W.Pop),x[63515]=j(63515,"unknown_f81b",void 0,[S(_,void 0,void 0)],W.Pop),x[63516]=j(63516,"ba_disp_msg",void 0,[S(R,void 0,void 0)],W.Pop),x[63517]=j(63517,"death_lvl_up",void 0,[S(_,void 0,void 0)],W.Pop),x[63518]=j(63518,"death_tech_lvl_up",void 0,[S(_,void 0,void 0)],W.Pop),x[63519]=j(63519,"unknown_f81f",void 0,[],void 0),x[63520]=j(63520,"cmode_stage",void 0,[S(_,void 0,void 0)],W.Pop),x[63521]=j(63521,"unknown_f821",void 0,[],void 0),x[63522]=j(63522,"unknown_f822",void 0,[],void 0),x[63523]=j(63523,"unknown_f823",void 0,[S(_,void 0,void 0)],W.Pop),x[63524]=j(63524,"unknown_f824",void 0,[S(_,void 0,void 0)],W.Pop),x[63525]=j(63525,"exp_multiplication",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63526]=j(63526,"exp_division",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63527]=j(63527,"get_user_is_dead",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63528]=j(63528,"go_floor","Sends a player to the given floor.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Floor ID.",P.Read)]},void 0,void 0)],void 0),x[63529]=j(63529,"unknown_f829",void 0,[],void 0),x[63530]=j(63530,"unknown_f82a",void 0,[],void 0),x[63531]=j(63531,"unlock_door2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63532]=j(63532,"lock_door2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63533]=j(63533,"if_switch_not_pressed",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63534]=j(63534,"if_switch_pressed",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Floor ID.",P.Read),S(_,"Switch ID.",P.Read),S(_,"Will be set to 1 if the switch is pressed, 0 otherwise.",P.Write)]},void 0,void 0)],void 0),x[63535]=j(63535,"unknown_f82f",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63536]=j(63536,"control_dragon",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63537]=j(63537,"release_dragon",void 0,[],void 0),x[63538]=j(63538,"unknown_f832",void 0,[],void 0),x[63539]=j(63539,"unknown_f833",void 0,[],void 0),x[63540]=j(63540,"unknown_f834",void 0,[],void 0),x[63541]=j(63541,"unknown_f835",void 0,[],void 0),x[63542]=j(63542,"unknown_f836",void 0,[],void 0),x[63543]=j(63543,"unknown_f837",void 0,[],void 0),x[63544]=j(63544,"shrink",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63545]=j(63545,"unshrink",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63546]=j(63546,"unknown_f83a",void 0,[],void 0),x[63547]=j(63547,"unknown_f83b",void 0,[],void 0),x[63548]=j(63548,"display_clock2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63549]=j(63549,"unknown_f83d",void 0,[S(_,void 0,void 0)],W.Pop),x[63550]=j(63550,"delete_area_title",void 0,[S(_,void 0,void 0)],W.Pop),x[63551]=j(63551,"unknown_f83f",void 0,[],void 0),x[63552]=j(63552,"load_npc_data",void 0,[],void 0),x[63553]=j(63553,"get_npc_data",void 0,[S(c,void 0,void 0)],void 0),x[63554]=j(63554,"unknown_f842",void 0,[],void 0),x[63555]=j(63555,"unknown_f843",void 0,[],void 0),x[63556]=j(63556,"unknown_f844",void 0,[],void 0),x[63557]=j(63557,"unknown_f845",void 0,[],void 0),x[63558]=j(63558,"unknown_f846",void 0,[],void 0),x[63559]=j(63559,"unknown_f847",void 0,[],void 0),x[63560]=j(63560,"give_damage_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63561]=j(63561,"take_damage_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63562]=j(63562,"unk_score_f84a",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63563]=j(63563,"unk_score_f84b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63564]=j(63564,"kill_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63565]=j(63565,"death_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63566]=j(63566,"unk_score_f84e",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63567]=j(63567,"enemy_death_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63568]=j(63568,"meseta_score",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63569]=j(63569,"unknown_f851",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63570]=j(63570,"unknown_f852",void 0,[S(_,void 0,void 0)],W.Pop),x[63571]=j(63571,"reverse_warps",void 0,[],void 0),x[63572]=j(63572,"unreverse_warps",void 0,[],void 0),x[63573]=j(63573,"set_ult_map",void 0,[],void 0),x[63574]=j(63574,"unset_ult_map",void 0,[],void 0),x[63575]=j(63575,"set_area_title",void 0,[S(R,void 0,void 0)],W.Pop),x[63576]=j(63576,"unknown_f858",void 0,[],void 0),x[63577]=j(63577,"unknown_f859",void 0,[],void 0),x[63578]=j(63578,"equip_item",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63579]=j(63579,"unequip_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63580]=j(63580,"unknown_f85c",void 0,[],void 0),x[63581]=j(63581,"unknown_f85d",void 0,[],void 0),x[63582]=j(63582,"unknown_f85e",void 0,[S(_,void 0,void 0)],W.Pop),x[63583]=j(63583,"unknown_f85f",void 0,[S(_,void 0,void 0)],W.Pop),x[63584]=j(63584,"unknown_f860",void 0,[],void 0),x[63585]=j(63585,"unknown_f861",void 0,[S(_,void 0,void 0)],W.Pop),x[63586]=j(63586,"unknown_f862",void 0,[],void 0),x[63587]=j(63587,"unknown_f863",void 0,[],void 0),x[63588]=j(63588,"cmode_rank",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63589]=j(63589,"award_item_name",void 0,[],void 0),x[63590]=j(63590,"award_item_select",void 0,[],void 0),x[63591]=j(63591,"award_item_give_to",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63592]=j(63592,"unknown_f868",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63593]=j(63593,"unknown_f869",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63594]=j(63594,"item_create_cmode",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63595]=j(63595,"unknown_f86b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63596]=j(63596,"award_item_ok",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63597]=j(63597,"unknown_f86d",void 0,[],void 0),x[63598]=j(63598,"unknown_f86e",void 0,[],void 0),x[63599]=j(63599,"ba_set_lives",void 0,[S(_,void 0,void 0)],W.Pop),x[63600]=j(63600,"ba_set_tech_lvl",void 0,[S(_,void 0,void 0)],W.Pop),x[63601]=j(63601,"ba_set_lvl",void 0,[S(_,void 0,void 0)],W.Pop),x[63602]=j(63602,"ba_set_time_limit",void 0,[S(_,void 0,void 0)],W.Pop),x[63603]=j(63603,"boss_is_dead",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63604]=j(63604,"unknown_f874",void 0,[],void 0),x[63605]=j(63605,"unknown_f875",void 0,[],void 0),x[63606]=j(63606,"unknown_f876",void 0,[],void 0),x[63607]=j(63607,"enable_techs","Enables technique use for the given player.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63608]=j(63608,"disable_techs","Disables technique use for the given player.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63609]=j(63609,"get_gender","Retrieves the player's gender. 0 If male, 1 if female.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player gender.",P.Write)]},void 0,void 0)],void 0),x[63610]=j(63610,"get_chara_class","Retrieves the player's race and character class.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Player race. 0 If human, 1 if newman, 2 if cast.",P.Write),S(_,"Player class. 0 If hunter, 1 if ranger, 2 if force.",P.Write)]},void 0,void 0)],void 0),x[63611]=j(63611,"take_slot_meseta","Takes an amount of meseta from a player's inventory.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read),S(_,"Amount of meseta to take.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Will be set to 1 if the meseta was taken, 0 otherwise.",P.Write)]},void 0,void 0)],void 0),x[63612]=j(63612,"unknown_f87c",void 0,[],void 0),x[63613]=j(63613,"unknown_f87d",void 0,[],void 0),x[63614]=j(63614,"unknown_f87e",void 0,[],void 0),x[63615]=j(63615,"read_guildcard_flag",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63616]=j(63616,"unknown_f880",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63617]=j(63617,"get_pl_name","Sets the value of to the given player's name.",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63618]=j(63618,"get_pl_job","Sets the value of to the given player's job (Hunter/Ranger/Force).",[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63619]=j(63619,"unknown_f883",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63620]=j(63620,"unknown_f884",void 0,[],void 0),x[63621]=j(63621,"unknown_f885",void 0,[],void 0),x[63622]=j(63622,"unknown_f886",void 0,[],void 0),x[63623]=j(63623,"unknown_f887",void 0,[],void 0),x[63624]=j(63624,"unknown_f888",void 0,[],void 0),x[63625]=j(63625,"unknown_f889",void 0,[],void 0),x[63626]=j(63626,"get_player_status",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63627]=j(63627,"send_mail",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63628]=j(63628,"online_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63629]=j(63629,"chl_set_timerecord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63630]=j(63630,"chl_get_timerecord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63631]=j(63631,"unknown_f88f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63632]=j(63632,"unknown_f890",void 0,[],void 0),x[63633]=j(63633,"load_enemy_data",void 0,[S(_,void 0,void 0)],W.Pop),x[63634]=j(63634,"get_physical_data",void 0,[S(u,void 0,void 0)],void 0),x[63635]=j(63635,"get_attack_data",void 0,[S(u,void 0,void 0)],void 0),x[63636]=j(63636,"get_resist_data",void 0,[S(u,void 0,void 0)],void 0),x[63637]=j(63637,"get_movement_data",void 0,[S(u,void 0,void 0)],void 0),x[63638]=j(63638,"unknown_f896",void 0,[],void 0),x[63639]=j(63639,"unknown_f897",void 0,[],void 0),x[63640]=j(63640,"shift_left",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63641]=j(63641,"shift_right",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63642]=j(63642,"get_random",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0)),ji=(x[63643]=j(63643,"reset_map","Sets all registers to 0 and resets the quest.",[],void 0),x[63644]=j(63644,"disp_chl_retry_menu",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63645]=j(63645,"chl_reverser",void 0,[],void 0),x[63646]=j(63646,"unknown_f89e",void 0,[S(_,void 0,void 0)],W.Pop),x[63647]=j(63647,"unknown_f89f",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63648]=j(63648,"unknown_f8a0",void 0,[],void 0),x[63649]=j(63649,"unknown_f8a1",void 0,[],void 0),x[63650]=j(63650,"unknown_f8a2",void 0,[],void 0),x[63651]=j(63651,"unknown_f8a3",void 0,[],void 0),x[63652]=j(63652,"unknown_f8a4",void 0,[],void 0),x[63653]=j(63653,"unknown_f8a5",void 0,[],void 0),x[63654]=j(63654,"unknown_f8a6",void 0,[],void 0),x[63655]=j(63655,"unknown_f8a7",void 0,[],void 0),x[63656]=j(63656,"unknown_f8a8",void 0,[S(_,void 0,void 0)],W.Pop),x[63657]=j(63657,"unknown_f8a9",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63658]=j(63658,"unknown_f8aa",void 0,[],void 0),x[63659]=j(63659,"unknown_f8ab",void 0,[],void 0),x[63660]=j(63660,"unknown_f8ac",void 0,[],void 0),x[63661]=j(63661,"get_number_of_player2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63662]=j(63662,"unknown_f8ae",void 0,[],void 0),x[63663]=j(63663,"unknown_f8af",void 0,[],void 0),x[63664]=j(63664,"unknown_f8b0",void 0,[],void 0),x[63665]=j(63665,"unknown_f8b1",void 0,[],void 0),x[63666]=j(63666,"unknown_f8b2",void 0,[],void 0),x[63667]=j(63667,"unknown_f8b3",void 0,[],void 0),x[63668]=j(63668,"unknown_f8b4",void 0,[],void 0),x[63669]=j(63669,"unknown_f8b5",void 0,[],void 0),x[63670]=j(63670,"unknown_f8b6",void 0,[],void 0),x[63671]=j(63671,"unknown_f8b7",void 0,[],void 0),x[63672]=j(63672,"unknown_f8b8",void 0,[],void 0),x[63673]=j(63673,"chl_recovery",void 0,[],void 0),x[63674]=j(63674,"unknown_f8ba",void 0,[],void 0),x[63675]=j(63675,"unknown_f8bb",void 0,[],void 0),x[63676]=j(63676,"set_episode",void 0,[S(_,void 0,void 0)],void 0),x[63677]=j(63677,"unknown_f8bd",void 0,[],void 0),x[63678]=j(63678,"unknown_f8be",void 0,[],void 0),x[63679]=j(63679,"unknown_f8bf",void 0,[],void 0),x[63680]=j(63680,"file_dl_req",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63681]=j(63681,"get_dl_status",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63682]=j(63682,"gba_unknown4",void 0,[],void 0),x[63683]=j(63683,"get_gba_state",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63684]=j(63684,"unknown_f8c4",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63685]=j(63685,"unknown_f8c5",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63686]=j(63686,"qexit",void 0,[],void 0),x[63687]=j(63687,"use_animation",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Animation ID.",P.Read),S(_,"Animation duration in number of frames.",P.Read)]},void 0,void 0)],void 0),x[63688]=j(63688,"stop_animation",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63689]=j(63689,"run_to_coord",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63690]=j(63690,"set_slot_invincible",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63691]=j(63691,"unknown_f8cb",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63692]=j(63692,"set_slot_poison",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63693]=j(63693,"set_slot_paralyze",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63694]=j(63694,"set_slot_shock",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63695]=j(63695,"set_slot_freeze",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63696]=j(63696,"set_slot_slow",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63697]=j(63697,"set_slot_confuse",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63698]=j(63698,"set_slot_shifta",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63699]=j(63699,"set_slot_deband",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63700]=j(63700,"set_slot_jellen",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63701]=j(63701,"set_slot_zalure",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read)]},void 0,void 0)],void 0),x[63702]=j(63702,"fleti_fixed_camera",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[63703]=j(63703,"fleti_locked_camera",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],W.Pop),x[63704]=j(63704,"default_camera_pos2",void 0,[],void 0),x[63705]=j(63705,"set_motion_blur",void 0,[],void 0),x[63706]=j(63706,"set_screen_bw",void 0,[],void 0),x[63707]=j(63707,"unknown_f8db",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(u,void 0,void 0)],W.Pop),x[63708]=j(63708,"npc_action_string",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0),S(k,void 0,void 0)],void 0),x[63709]=j(63709,"get_pad_cond",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63710]=j(63710,"get_button_cond",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63711]=j(63711,"freeze_enemies",void 0,[],void 0),x[63712]=j(63712,"unfreeze_enemies",void 0,[],void 0),x[63713]=j(63713,"freeze_everything",void 0,[],void 0),x[63714]=j(63714,"unfreeze_everything",void 0,[],void 0),x[63715]=j(63715,"restore_hp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63716]=j(63716,"restore_tp",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63717]=j(63717,"close_chat_bubble",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63718]=j(63718,"move_coords_object",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63719]=j(63719,"at_coords_call_ex",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63720]=j(63720,"unknown_f8e8",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63721]=j(63721,"unknown_f8e9",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63722]=j(63722,"unknown_f8ea",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63723]=j(63723,"unknown_f8eb",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63724]=j(63724,"unknown_f8ec",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63725]=j(63725,"animation_check",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63726]=j(63726,"call_image_data",void 0,[S(_,void 0,void 0),S(u,void 0,void 0)],W.Pop),x[63727]=j(63727,"unknown_f8ef",void 0,[],void 0),x[63728]=j(63728,"turn_off_bgm_p2",void 0,[],void 0),x[63729]=j(63729,"turn_on_bgm_p2",void 0,[],void 0),x[63730]=j(63730,"load_unk_data",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(c,void 0,void 0)],W.Pop),x[63731]=j(63731,"particle2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0),S(_,void 0,void 0),S(p,void 0,void 0)],W.Pop),x[63732]=j(63732,"unknown_f8f4",void 0,[],void 0),x[63733]=j(63733,"unknown_f8f5",void 0,[],void 0),x[63734]=j(63734,"unknown_f8f6",void 0,[],void 0),x[63735]=j(63735,"unknown_f8f7",void 0,[],void 0),x[63736]=j(63736,"unknown_f8f8",void 0,[],void 0),x[63737]=j(63737,"unknown_f8f9",void 0,[],void 0),x[63738]=j(63738,"unknown_f8fa",void 0,[],void 0),x[63739]=j(63739,"unknown_f8fb",void 0,[],void 0),x[63740]=j(63740,"unknown_f8fc",void 0,[],void 0),x[63741]=j(63741,"unknown_f8fd",void 0,[],void 0),x[63742]=j(63742,"unknown_f8fe",void 0,[],void 0),x[63743]=j(63743,"unknown_f8ff",void 0,[],void 0),x[63744]=j(63744,"unknown_f900",void 0,[],void 0),x[63745]=j(63745,"dec2float",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Read)]},void 0,void 0)],void 0),x[63746]=j(63746,"float2dec",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63747]=j(63747,"flet",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63748]=j(63748,"fleti",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63749]=j(63749,"unknown_f905",void 0,[],void 0),x[63750]=j(63750,"unknown_f906",void 0,[],void 0),x[63751]=j(63751,"unknown_f907",void 0,[],void 0),x[63752]=j(63752,"fadd",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63753]=j(63753,"faddi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63754]=j(63754,"fsub",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63755]=j(63755,"fsubi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63756]=j(63756,"fmul",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63757]=j(63757,"fmuli",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63758]=j(63758,"fdiv",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Read)]},void 0,void 0)],void 0),x[63759]=j(63759,"fdivi",void 0,[S({kind:s.RegTupRef,register_tuples:[S(p,void 0,P.Write)]},void 0,void 0),S(p,void 0,void 0)],void 0),x[63760]=j(63760,"get_unknown_count",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63761]=j(63761,"get_stackable_item_count",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,"Player slot.",P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read),S(_,void 0,P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63762]=j(63762,"freeze_and_hide_equip",void 0,[],void 0),x[63763]=j(63763,"thaw_and_show_equip",void 0,[],void 0),x[63764]=j(63764,"set_palettex_callback",void 0,[S(_,"Player slot.",void 0),S(f,void 0,void 0)],W.Pop),x[63765]=j(63765,"activate_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63766]=j(63766,"enable_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63767]=j(63767,"restore_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63768]=j(63768,"disable_palettex",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63769]=j(63769,"get_palettex_activated",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63770]=j(63770,"get_unknown_palettex_status",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63771]=j(63771,"disable_movement2",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63772]=j(63772,"enable_movement2",void 0,[S(_,"Player slot.",void 0)],W.Pop),x[63773]=j(63773,"get_time_played",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63774]=j(63774,"get_guildcard_total",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63775]=j(63775,"get_slot_meseta",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63776]=j(63776,"get_player_level",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63777]=j(63777,"get_section_id",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63778]=j(63778,"get_player_hp",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,"Maximum HP.",P.Write),S(_,"Current HP.",P.Write),S(_,"Maximum TP.",P.Write),S(_,"Current TP.",P.Write)]},void 0,void 0)],W.Pop),x[63779]=j(63779,"get_floor_number",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63780]=j(63780,"get_coord_player_detect",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,"Player slot.",P.Read)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Read)]},void 0,void 0)],void 0),x[63781]=j(63781,"read_global_flag",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63782]=j(63782,"write_global_flag",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63783]=j(63783,"unknown_f927",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63784]=j(63784,"floor_player_detect",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write),S(_,void 0,P.Write),S(_,void 0,P.Write),S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63785]=j(63785,"read_disk_file",void 0,[S(R,void 0,void 0)],W.Pop),x[63786]=j(63786,"open_pack_select",void 0,[],void 0),x[63787]=j(63787,"item_select",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63788]=j(63788,"get_item_id",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63789]=j(63789,"color_change",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63790]=j(63790,"send_statistic",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63791]=j(63791,"unknown_f92f",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63792]=j(63792,"chat_box",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63793]=j(63793,"chat_bubble",void 0,[S(_,void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63794]=j(63794,"unknown_f932",void 0,[],void 0),x[63795]=j(63795,"unknown_f933",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],void 0),x[63796]=j(63796,"scroll_text",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(p,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(R,void 0,void 0)],W.Pop),x[63797]=j(63797,"gba_unknown1",void 0,[],void 0),x[63798]=j(63798,"gba_unknown2",void 0,[],void 0),x[63799]=j(63799,"gba_unknown3",void 0,[],void 0),x[63800]=j(63800,"add_damage_to",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63801]=j(63801,"item_delete3",void 0,[S(_,void 0,void 0)],W.Pop),x[63802]=j(63802,"get_item_info",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63803]=j(63803,"item_packing1",void 0,[S(_,void 0,void 0)],W.Pop),x[63804]=j(63804,"item_packing2",void 0,[S(_,void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63805]=j(63805,"get_lang_setting",void 0,[S({kind:s.RegTupRef,register_tuples:[S(a,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63806]=j(63806,"prepare_statistic",void 0,[S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63807]=j(63807,"keyword_detect",void 0,[],void 0),x[63808]=j(63808,"keyword",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,"Player slot.",void 0),S(R,void 0,void 0)],W.Pop),x[63809]=j(63809,"get_guildcard_num",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63810]=j(63810,"unknown_f942",void 0,[],void 0),x[63811]=j(63811,"unknown_f943",void 0,[],void 0),x[63812]=j(63812,"get_wrap_status",void 0,[S(_,"Player slot.",void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63813]=j(63813,"initial_floor",void 0,[S(_,void 0,void 0)],W.Pop),x[63814]=j(63814,"sin",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63815]=j(63815,"cos",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0)],W.Pop),x[63816]=j(63816,"unknown_f948",void 0,[],void 0),x[63817]=j(63817,"unknown_f949",void 0,[],void 0),x[63818]=j(63818,"boss_is_dead2",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63819]=j(63819,"unknown_f94b",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63820]=j(63820,"unknown_f94c",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63821]=j(63821,"is_there_cardbattle",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63822]=j(63822,"unknown_f94e",void 0,[],void 0),x[63823]=j(63823,"unknown_f94f",void 0,[],void 0),x[63824]=j(63824,"bb_p2_menu",void 0,[S(_,void 0,void 0)],W.Pop),x[63825]=j(63825,"bb_map_designate",void 0,[S(l,void 0,void 0),S(u,void 0,void 0),S(l,void 0,void 0),S(l,void 0,void 0)],void 0));x[63826]=j(63826,"bb_get_number_in_pack",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],void 0),x[63827]=j(63827,"bb_swap_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63828]=j(63828,"bb_check_wrap",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0)],W.Pop),x[63829]=j(63829,"bb_exchange_pd_item",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63830]=j(63830,"bb_exchange_pd_srank",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63831]=j(63831,"bb_exchange_pd_special",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63832]=j(63832,"bb_exchange_pd_percent",void 0,[S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63833]=j(63833,"unknown_f959",void 0,[S(_,void 0,void 0)],W.Pop),x[63834]=j(63834,"unknown_f95a",void 0,[],void 0),x[63835]=j(63835,"unknown_f95b",void 0,[],void 0),x[63836]=j(63836,"bb_exchange_slt",void 0,[S(_,void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63837]=j(63837,"bb_exchange_pc",void 0,[],void 0),x[63838]=j(63838,"bb_box_create_bp",void 0,[S(_,void 0,void 0),S(p,void 0,void 0),S(p,void 0,void 0)],W.Pop),x[63839]=j(63839,"bb_exchange_pt",void 0,[S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S({kind:s.RegTupRef,register_tuples:[S(_,void 0,P.Write)]},void 0,void 0),S(_,void 0,void 0),S(f,void 0,void 0),S(f,void 0,void 0)],W.Pop),x[63840]=j(63840,"unknown_f960",void 0,[S(_,void 0,void 0)],W.Pop),x[63841]=j(63841,"unknown_f961",void 0,[],void 0),x[63842]=j(63842,"unknown_f962",void 0,[],void 0),x[63843]=j(63843,"unknown_f963",void 0,[],void 0),x[63844]=j(63844,"unknown_f964",void 0,[],void 0),x[63845]=j(63845,"unknown_f965",void 0,[],void 0),x[63846]=j(63846,"unknown_f966",void 0,[],void 0),x[63847]=j(63847,"unknown_f967",void 0,[],void 0),x[63848]=j(63848,"unknown_f968",void 0,[],void 0),x[63849]=j(63849,"unknown_f969",void 0,[],void 0),x[63850]=j(63850,"unknown_f96a",void 0,[],void 0),x[63851]=j(63851,"unknown_f96b",void 0,[],void 0),x[63852]=j(63852,"unknown_f96c",void 0,[],void 0),x[63853]=j(63853,"unknown_f96d",void 0,[],void 0),x[63854]=j(63854,"unknown_f96e",void 0,[],void 0),x[63855]=j(63855,"unknown_f96f",void 0,[],void 0),x[63856]=j(63856,"unknown_f970",void 0,[],void 0),x[63857]=j(63857,"unknown_f971",void 0,[],void 0),x[63858]=j(63858,"unknown_f972",void 0,[],void 0),x[63859]=j(63859,"unknown_f973",void 0,[],void 0),x[63860]=j(63860,"unknown_f974",void 0,[],void 0),x[63861]=j(63861,"unknown_f975",void 0,[],void 0),x[63862]=j(63862,"unknown_f976",void 0,[],void 0),x[63863]=j(63863,"unknown_f977",void 0,[],void 0),x[63864]=j(63864,"unknown_f978",void 0,[],void 0),x[63865]=j(63865,"unknown_f979",void 0,[],void 0),x[63866]=j(63866,"unknown_f97a",void 0,[],void 0),x[63867]=j(63867,"unknown_f97b",void 0,[],void 0),x[63868]=j(63868,"unknown_f97c",void 0,[],void 0),x[63869]=j(63869,"unknown_f97d",void 0,[],void 0),x[63870]=j(63870,"unknown_f97e",void 0,[],void 0),x[63871]=j(63871,"unknown_f97f",void 0,[],void 0),x[63872]=j(63872,"unknown_f980",void 0,[],void 0),x[63873]=j(63873,"unknown_f981",void 0,[],void 0),x[63874]=j(63874,"unknown_f982",void 0,[],void 0),x[63875]=j(63875,"unknown_f983",void 0,[],void 0),x[63876]=j(63876,"unknown_f984",void 0,[],void 0),x[63877]=j(63877,"unknown_f985",void 0,[],void 0),x[63878]=j(63878,"unknown_f986",void 0,[],void 0),x[63879]=j(63879,"unknown_f987",void 0,[],void 0),x[63880]=j(63880,"unknown_f988",void 0,[],void 0),x[63881]=j(63881,"unknown_f989",void 0,[],void 0),x[63882]=j(63882,"unknown_f98a",void 0,[],void 0),x[63883]=j(63883,"unknown_f98b",void 0,[],void 0),x[63884]=j(63884,"unknown_f98c",void 0,[],void 0),x[63885]=j(63885,"unknown_f98d",void 0,[],void 0),x[63886]=j(63886,"unknown_f98e",void 0,[],void 0),x[63887]=j(63887,"unknown_f98f",void 0,[],void 0),x[63888]=j(63888,"unknown_f990",void 0,[],void 0),x[63889]=j(63889,"unknown_f991",void 0,[],void 0),x[63890]=j(63890,"unknown_f992",void 0,[],void 0),x[63891]=j(63891,"unknown_f993",void 0,[],void 0),x[63892]=j(63892,"unknown_f994",void 0,[],void 0),x[63893]=j(63893,"unknown_f995",void 0,[],void 0),x[63894]=j(63894,"unknown_f996",void 0,[],void 0),x[63895]=j(63895,"unknown_f997",void 0,[],void 0),x[63896]=j(63896,"unknown_f998",void 0,[],void 0),x[63897]=j(63897,"unknown_f999",void 0,[],void 0),x[63898]=j(63898,"unknown_f99a",void 0,[],void 0),x[63899]=j(63899,"unknown_f99b",void 0,[],void 0),x[63900]=j(63900,"unknown_f99c",void 0,[],void 0),x[63901]=j(63901,"unknown_f99d",void 0,[],void 0),x[63902]=j(63902,"unknown_f99e",void 0,[],void 0),x[63903]=j(63903,"unknown_f99f",void 0,[],void 0),x[63904]=j(63904,"unknown_f9a0",void 0,[],void 0),x[63905]=j(63905,"unknown_f9a1",void 0,[],void 0),x[63906]=j(63906,"unknown_f9a2",void 0,[],void 0),x[63907]=j(63907,"unknown_f9a3",void 0,[],void 0),x[63908]=j(63908,"unknown_f9a4",void 0,[],void 0),x[63909]=j(63909,"unknown_f9a5",void 0,[],void 0),x[63910]=j(63910,"unknown_f9a6",void 0,[],void 0),x[63911]=j(63911,"unknown_f9a7",void 0,[],void 0),x[63912]=j(63912,"unknown_f9a8",void 0,[],void 0),x[63913]=j(63913,"unknown_f9a9",void 0,[],void 0),x[63914]=j(63914,"unknown_f9aa",void 0,[],void 0),x[63915]=j(63915,"unknown_f9ab",void 0,[],void 0),x[63916]=j(63916,"unknown_f9ac",void 0,[],void 0),x[63917]=j(63917,"unknown_f9ad",void 0,[],void 0),x[63918]=j(63918,"unknown_f9ae",void 0,[],void 0),x[63919]=j(63919,"unknown_f9af",void 0,[],void 0),x[63920]=j(63920,"unknown_f9b0",void 0,[],void 0),x[63921]=j(63921,"unknown_f9b1",void 0,[],void 0),x[63922]=j(63922,"unknown_f9b2",void 0,[],void 0),x[63923]=j(63923,"unknown_f9b3",void 0,[],void 0),x[63924]=j(63924,"unknown_f9b4",void 0,[],void 0),x[63925]=j(63925,"unknown_f9b5",void 0,[],void 0),x[63926]=j(63926,"unknown_f9b6",void 0,[],void 0),x[63927]=j(63927,"unknown_f9b7",void 0,[],void 0),x[63928]=j(63928,"unknown_f9b8",void 0,[],void 0),x[63929]=j(63929,"unknown_f9b9",void 0,[],void 0),x[63930]=j(63930,"unknown_f9ba",void 0,[],void 0),x[63931]=j(63931,"unknown_f9bb",void 0,[],void 0),x[63932]=j(63932,"unknown_f9bc",void 0,[],void 0),x[63933]=j(63933,"unknown_f9bd",void 0,[],void 0),x[63934]=j(63934,"unknown_f9be",void 0,[],void 0),x[63935]=j(63935,"unknown_f9bf",void 0,[],void 0),x[63936]=j(63936,"unknown_f9c0",void 0,[],void 0),x[63937]=j(63937,"unknown_f9c1",void 0,[],void 0),x[63938]=j(63938,"unknown_f9c2",void 0,[],void 0),x[63939]=j(63939,"unknown_f9c3",void 0,[],void 0),x[63940]=j(63940,"unknown_f9c4",void 0,[],void 0),x[63941]=j(63941,"unknown_f9c5",void 0,[],void 0),x[63942]=j(63942,"unknown_f9c6",void 0,[],void 0),x[63943]=j(63943,"unknown_f9c7",void 0,[],void 0),x[63944]=j(63944,"unknown_f9c8",void 0,[],void 0),x[63945]=j(63945,"unknown_f9c9",void 0,[],void 0),x[63946]=j(63946,"unknown_f9ca",void 0,[],void 0),x[63947]=j(63947,"unknown_f9cb",void 0,[],void 0),x[63948]=j(63948,"unknown_f9cc",void 0,[],void 0),x[63949]=j(63949,"unknown_f9cd",void 0,[],void 0),x[63950]=j(63950,"unknown_f9ce",void 0,[],void 0),x[63951]=j(63951,"unknown_f9cf",void 0,[],void 0),x[63952]=j(63952,"unknown_f9d0",void 0,[],void 0),x[63953]=j(63953,"unknown_f9d1",void 0,[],void 0),x[63954]=j(63954,"unknown_f9d2",void 0,[],void 0),x[63955]=j(63955,"unknown_f9d3",void 0,[],void 0),x[63956]=j(63956,"unknown_f9d4",void 0,[],void 0),x[63957]=j(63957,"unknown_f9d5",void 0,[],void 0),x[63958]=j(63958,"unknown_f9d6",void 0,[],void 0),x[63959]=j(63959,"unknown_f9d7",void 0,[],void 0),x[63960]=j(63960,"unknown_f9d8",void 0,[],void 0),x[63961]=j(63961,"unknown_f9d9",void 0,[],void 0),x[63962]=j(63962,"unknown_f9da",void 0,[],void 0),x[63963]=j(63963,"unknown_f9db",void 0,[],void 0),x[63964]=j(63964,"unknown_f9dc",void 0,[],void 0),x[63965]=j(63965,"unknown_f9dd",void 0,[],void 0),x[63966]=j(63966,"unknown_f9de",void 0,[],void 0),x[63967]=j(63967,"unknown_f9df",void 0,[],void 0),x[63968]=j(63968,"unknown_f9e0",void 0,[],void 0),x[63969]=j(63969,"unknown_f9e1",void 0,[],void 0),x[63970]=j(63970,"unknown_f9e2",void 0,[],void 0),x[63971]=j(63971,"unknown_f9e3",void 0,[],void 0),x[63972]=j(63972,"unknown_f9e4",void 0,[],void 0),x[63973]=j(63973,"unknown_f9e5",void 0,[],void 0),x[63974]=j(63974,"unknown_f9e6",void 0,[],void 0),x[63975]=j(63975,"unknown_f9e7",void 0,[],void 0),x[63976]=j(63976,"unknown_f9e8",void 0,[],void 0),x[63977]=j(63977,"unknown_f9e9",void 0,[],void 0),x[63978]=j(63978,"unknown_f9ea",void 0,[],void 0),x[63979]=j(63979,"unknown_f9eb",void 0,[],void 0),x[63980]=j(63980,"unknown_f9ec",void 0,[],void 0),x[63981]=j(63981,"unknown_f9ed",void 0,[],void 0),x[63982]=j(63982,"unknown_f9ee",void 0,[],void 0),x[63983]=j(63983,"unknown_f9ef",void 0,[],void 0),x[63984]=j(63984,"unknown_f9f0",void 0,[],void 0),x[63985]=j(63985,"unknown_f9f1",void 0,[],void 0),x[63986]=j(63986,"unknown_f9f2",void 0,[],void 0),x[63987]=j(63987,"unknown_f9f3",void 0,[],void 0),x[63988]=j(63988,"unknown_f9f4",void 0,[],void 0),x[63989]=j(63989,"unknown_f9f5",void 0,[],void 0),x[63990]=j(63990,"unknown_f9f6",void 0,[],void 0),x[63991]=j(63991,"unknown_f9f7",void 0,[],void 0),x[63992]=j(63992,"unknown_f9f8",void 0,[],void 0),x[63993]=j(63993,"unknown_f9f9",void 0,[],void 0),x[63994]=j(63994,"unknown_f9fa",void 0,[],void 0),x[63995]=j(63995,"unknown_f9fb",void 0,[],void 0),x[63996]=j(63996,"unknown_f9fc",void 0,[],void 0),x[63997]=j(63997,"unknown_f9fd",void 0,[],void 0),x[63998]=j(63998,"unknown_f9fe",void 0,[],void 0),x[63999]=j(63999,"unknown_f9ff",void 0,[],void 0);function Li(i,e){if(!i){let i="Assertion Error";throw e&&(i+=": "+(e instanceof Function?e():e)),new Error(i)}}var zi,Di;function Ci(i){const e=Object.values(i),o=e.filter(i=>"number"==typeof i);return o.length?o:e}x.forEach(i=>{I.set(i.mnemonic,i)}),function(i){i[i.Instructions=0]="Instructions",i[i.Data=1]="Data",i[i.String=2]="String"}(zi||(zi={}));!function(i){i[i.Trace=0]="Trace",i[i.Debug=1]="Debug",i[i.Info=2]="Info",i[i.Warn=3]="Warn",i[i.Error=4]="Error",i[i.Off=5]="Off"}(Di||(Di={}));Ci(Di);function Mi(i,e){return i.toString().padStart(e,"0")}class $i{constructor(i){this.name=i,this.trace=(i,e)=>{this.handle(Di.Trace,i,e)},this.debug=(i,e)=>{this.handle(Di.Debug,i,e)},this.info=(i,e)=>{this.handle(Di.Info,i,e)},this.warn=(i,e)=>{this.handle(Di.Warn,i,e)},this.error=(i,e)=>{this.handle(Di.Error,i,e)}}get level(){var i;return null!=(i=this._level)?i:Ni.default_level}set level(i){this._level=i}get handler(){var i;return null!=(i=this._handler)?i:Ni.default_handler}set handler(i){this._handler=i}handle(i,e,o){i>=this.level&&this.handler({time:new Date,message:e,level:i,logger:this,cause:o},this.name)}}class Ni{static get(i){let e=this.loggers.get(i);return e||(e=new $i(i),this.loggers.set(i,e)),e}static with_default_handler(i,e){const o=this.default_handler;let d=!1;try{this.default_handler=i;const v=e();return v instanceof Promise?(d=!0,v.finally(()=>this.default_handler=o)):v}finally{d||(this.default_handler=o)}}}Ni.loggers=new Map,Ni.default_level=function(i){const e=Di[i.slice(0,1).toUpperCase()+i.slice(1).toLowerCase()];return Li(null!=e,()=>`"${i}" is not a valid log level.`),e}("INFO"),Ni.default_handler=function({time:i,message:e,level:o,logger:d,cause:v}){const t=`${function(i){const e=Mi(i.getHours(),2),o=Mi(i.getMinutes(),2),d=Mi(i.getSeconds(),2),v=Mi(i.getMilliseconds(),3);return`${e}:${o}:${d}.${v}`}(i)} [${Di[o]}] ${d.name} - ${e}`;let n;switch(o){case Di.Trace:n=console.trace;break;case Di.Debug:n=console.debug;break;case Di.Info:n=console.info;break;case Di.Warn:n=console.warn;break;case Di.Error:n=console.error;break;default:n=console.log}null==v?n.call(console,t):n.call(console,t,v)};const Ai=Ni.get("quest_editor/scripting/assembly");class qi{constructor(i,e){this.assembly=i,this.manual_stack=e,this.lexer=new r,this.section=zi.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1}assemble(){this.line_no=1,this.object_code=[],this.warnings=[],this.errors=[],this.labels=new Set,this.section=zi.Instructions,this.first_section_marker=!0,this.prev_line_had_label=!1;for(const i of this.assembly){if(this.tokens=this.lexer.tokenize_line(i),this.tokens.length>0){const i=this.tokens.shift();let e=!1;switch(i.type){case n.Label:this.parse_label(i),e=!0;break;case n.CodeSection:case n.DataSection:case n.StringSection:this.parse_section(i);break;case n.Int:this.section===zi.Data?this.parse_bytes(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.String:this.section===zi.String?this.parse_string(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.Ident:this.section===zi.Instructions?this.parse_instruction(i):this.add_error({col:i.col,length:i.len,message:"Unexpected token."});break;case n.InvalidSection:this.add_error({col:i.col,length:i.len,message:"Invalid section type."});break;case n.InvalidIdent:this.add_error({col:i.col,length:i.len,message:"Invalid identifier."});break;default:this.add_error({col:i.col,length:i.len,message:"Unexpected token."})}this.prev_line_had_label=e}this.line_no++}return{object_code:this.object_code,warnings:this.warnings,errors:this.errors}}add_instruction(i,e,o,d,v,t){if(this.segment)this.segment.type===zi.Instructions?this.segment.instructions.push(function(i,e,o){const d=Math.min(i.params.length,e.length),v=[];let t=0;for(let o=0;o({line_no:this.line_no,col:i.col,len:i.len})),stack_args:t.map((i,e)=>({line_no:this.line_no,col:i.col,len:i.len,value:o[e].value}))})):Ai.error(`Line ${this.line_no}: Expected instructions segment.`);else{const i={labels:[],type:zi.Instructions,instructions:[],asm:{labels:[]}};this.segment=i,this.object_code.push(i)}}add_bytes(i){if(this.segment)if(this.segment.type===zi.Data){const e=new ArrayBuffer(this.segment.data.byteLength+i.length),o=new Uint8Array(e);o.set(new Uint8Array(this.segment.data)),o.set(new Uint8Array(i),this.segment.data.byteLength),this.segment.data=e}else Ai.error(`Line ${this.line_no}: Expected data segment.`);else{const e={labels:[],type:zi.Data,data:new Uint8Array(i).buffer,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_string(i){if(this.segment)this.segment.type===zi.String?this.segment.value+=i:Ai.error(`Line ${this.line_no}: Expected string segment.`);else{const e={labels:[],type:zi.String,value:i,asm:{labels:[]}};this.segment=e,this.object_code.push(e)}}add_error({col:i,length:e,message:o}){this.errors.push({line_no:this.line_no,col:i,length:e,message:o})}add_warning({col:i,length:e,message:o}){this.warnings.push({line_no:this.line_no,col:i,length:e,message:o})}parse_label({col:i,len:e,value:o}){this.labels.has(o)&&this.add_error({col:i,length:e,message:"Duplicate label."}),this.labels.add(o);const d=this.tokens.shift(),v={line_no:this.line_no,col:i,len:e};if(this.prev_line_had_label){const i=this.object_code[this.object_code.length-1];i.labels.push(o),i.asm.labels.push(v)}switch(this.section){case zi.Instructions:this.prev_line_had_label||(this.segment={type:zi.Instructions,labels:[o],instructions:[],asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.Ident?this.parse_instruction(d):this.add_error({col:d.col,length:d.len,message:"Expected opcode mnemonic."}));break;case zi.Data:this.prev_line_had_label||(this.segment={type:zi.Data,labels:[o],data:new ArrayBuffer(0),asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.Int?this.parse_bytes(d):this.add_error({col:d.col,length:d.len,message:"Expected bytes."}));break;case zi.String:this.prev_line_had_label||(this.segment={type:zi.String,labels:[o],value:"",asm:{labels:[v]}},this.object_code.push(this.segment)),d&&(d.type===n.String?this.parse_string(d):this.add_error({col:d.col,length:d.len,message:"Expected a string."}))}}parse_section({type:i,col:e,len:o}){let d;switch(i){case n.CodeSection:d=zi.Instructions;break;case n.DataSection:d=zi.Data;break;case n.StringSection:d=zi.String}this.section!==d||this.first_section_marker||this.add_warning({col:e,length:o,message:"Unnecessary section marker."}),this.section=d,this.first_section_marker=!1;const v=this.tokens.shift();v&&this.add_error({col:v.col,length:v.len,message:"Unexpected token."})}parse_instruction(i){const{col:e,len:o,value:d}=i,v=I.get(d);if(v){const o=-1!==v.params.findIndex(i=>i.type.kind===s.ILabelVar||i.type.kind===s.RegRefVar),d=this.manual_stack&&v.stack===W.Pop?0:v.params.length;let a=0;for(const i of this.tokens)i.type!==n.ArgSeparator&&a++;const l=this.tokens[this.tokens.length-1],u=l?l.col+l.len-e:0,_=[],p=[];if(!o&&a!==d)return void this.add_error({col:e,length:u,message:`Expected ${d} argument${1===d?"":"s"}, got ${a}.`});if(o&&ar?this.add_error({col:v,length:t,message:`${n}-Bit integer can't be greater than ${r}.`}):o.push([{value:d,size:i},e])}parse_register(i,e){const{col:o,len:d,value:v}=i;v>255?this.add_error({col:o,length:d,message:"Invalid register reference, expected r0-r255."}):e.push([{value:v,size:1},i])}parse_bytes(i){const e=[];let o=i,d=0;for(;o.type===n.Int&&(o.value<0?this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be less than 0."}):o.value>255&&this.add_error({col:o.col,length:o.len,message:"Unsigned 8-bit integer can't be greater than 255."}),e.push(o.value),d"))}}var Fi;!function(i){i[i.None=0]="None",i[i.Return=1]="Return",i[i.Jump=2]="Jump",i[i.ConditionalJump=3]="ConditionalJump",i[i.Call=4]="Call"}(Fi||(Fi={}));class Ei{constructor(i,e,o,d,v){this.from=[],this.to=[],this.segment=i,this.start=e,this.end=o,this.branch_type=d,this.branch_labels=v}link_to(i){this.to.includes(i)||(this.to.push(i),i.from.push(this))}index_of_instruction(i){const e=this.segment.instructions.indexOf(i,this.start);return ei.value);break;case B.code:case z.code:s=Fi.Call,r=[n.args[0].value];break;case fi.code:s=Fi.Call,r=n.args.slice(1).map(i=>i.value);break;default:if(t===o-1){s=Fi.None,r=[];break}continue}const a=new Ei(e,d,t+1,s,r);for(let e=a.start;e{let i=0,e=NaN;return{next:()=>{let o=!0;return ithis.intervals[i].end?(i++,ii+e.end-e.start+1,0)}get(i){for(const{start:e,end:o}of this.intervals){const d=o-e+1;if(ithis.intervals[d].start;)i.end=this.intervals[d].end,d++;this.intervals.splice(e+1,d-e-1),i.end=Math.max(i.end,o.end),e++;continue i}e++}this.intervals.push(o)}return this}to_array(){const i=[];for(const{start:e,end:o}of this.intervals)for(let d=e;d<=o;d++)i.push(d);return i}}const Hi=Ni.get("core/data_formats/asm/data_flow_analysis/register_value"),Ji=T,Yi=y;Math.pow(2,32);function Xi(i,e,o){const d=i.get_block_for_instruction(e);return d?function i(e,o,d,v,t){if(++e.iterations>100)return Hi.warn("Too many iterations."),(new Bi).set_interval(Ji,Yi);for(let n=v-1;n>=d.start;n--){const v=d.segment.instructions[n],r=v.args;switch(v.opcode.code){case D.code:if(r[0].value===t)return i(e,new Set(o),d,n,r[1].value);break;case C.code:case M.code:case $.code:case Wi.code:if(r[0].value===t)return(new Bi).set_value(r[1].value);break;case N.code:if(r[0].value===t)return(new Bi).set_value(1);break;case A.code:if(r[0].value===t)return(new Bi).set_value(0);break;case q.code:if(r[0].value===t){const v=i(e,new Set(o),d,n,t),s=v.size();return 0===s||1===s&&0===v.get(0)?(new Bi).set_value(1):v.has(0)?(new Bi).set_interval(0,1):(new Bi).set_value(0)}break;case F.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_add(r[1].value)}break;case E.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_sub(r[1].value)}break;case O.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_mul(r[1].value)}break;case U.code:if(r[0].value===t){return i(e,new Set(o),d,n,t).scalar_div(r[1].value)}break;case Ti.code:if(r[0].value===t)return(new Bi).set_interval(0,1);break;case yi.code:if(r[0].value===t)return(new Bi).set_interval(0,2);break;case Si.code:if(r[0].value===t)return(new Bi).set_interval(0,3);break;case Ii.code:if(r[1].value===t){const v=i(e,new Set(o),d,n,r[0].value).min()||0,t=Math.max(i(e,new Set(o),d,n,r[0].value+1).max()||0,v+1);return(new Bi).set_interval(v,t-1)}break;case ci.code:case ki.code:{const i=r[0].value,e=r[0].value+r[1].value;if(i<=t&&ti.type===n.Ident);if(t&&(e=I.get(t.value),e))for(const e of v){if(e.col+e.len>i.col)break;e.type===n.Ident&&-1===o?o=0:e.type===n.ArgSeparator&&o++}}const d={type:v.SignatureHelp,id:i.id,opcode:e,active_param:o};Qi.postMessage(d)}function le(i){const e=function(i,e){const o=oe[i];if(!o)return;const d=ee[o.segment_index];if(!d||d.type!==zi.Instructions)return;for(const v of o.instruction_indices){const o=d.instructions[v];if(o&&o.asm){const d=o.opcode.params;for(let v=0;vi.type===zi.Instructions);for(let i=0;i=o.col&&e<=o.col+o.len)}Qi.onmessage=i=>{ve.push(i.data),te||(se(),te=setTimeout(()=>{te=void 0,se()},100))}}}); \ No newline at end of file diff --git a/index.html b/index.html index d8d6a298..07b50624 100644 --- a/index.html +++ b/index.html @@ -5,5 +5,5 @@ Phantasmal World - + \ No newline at end of file diff --git a/runtime.22bf1c5f795e88f41fab.js b/runtime.5fe5789a7219008eba66.js similarity index 85% rename from runtime.22bf1c5f795e88f41fab.js rename to runtime.5fe5789a7219008eba66.js index 67f23863..86e030ff 100644 --- a/runtime.22bf1c5f795e88f41fab.js +++ b/runtime.5fe5789a7219008eba66.js @@ -1 +1 @@ -!function(e){function r(r){for(var n,f,u=r[0],c=r[1],i=r[2],d=0,p=[];d