Pixel Editor
Gallery
Projects
People
The online game development toolkit
Log in or sign up
Clone
Run
Test
Console
Help
What are you working on?
It's Dangerous To Go Alone
Test It's Dangerous To Go Alone
Choose an Export Method
Zip File
Packaged for Chrome Web Store
Embed Code
New File
Choose type
Script
Test
Image
Sound
Entity
Tilemap
${name}
Name
Create
File Importer
Drag files from your desktop here and we'll add them to your project.
{"name":"","files":[{"name":"src","files":[{"name":"item","contents":"Item = (I) ->\n $.reverseMerge I,\n width: 16\n height: 16\n\n #TODO: This is a gross hack to center\n I.x += 8\n I.y += 8\n I.x += 2 if I.cat\n\n self = GameObject(I)\n\n self.bind \"step\", ->\n if I.cat\n player = engine.find(\"Cat\").first()\n else\n player = engine.find(\"Player\").first()\n\n return unless player\n\n I.active = false if player.I.items[I.name]\n\n if Collision.rectangular(self.bounds(), player.collisionBounds())\n if I.active\n player.pickup(self)\n I.active = false\n\n return self\n\n","docSelector":"#file_src_item_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":535,"mtime":1304290583},{"name":"lever","contents":"Lever = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n triggered: false\n\n if leverTriggered I.id\n I.sprite = Sprite.loadByName(\"lever_triggered\") \n\n self = GameObject(I)\n\n self.bind \"step\", ->\n unless I.triggered\n player = engine.find(\"Cat\").first()\n\n if player && Collision.rectangular(self.bounds(), player.collisionBounds())\n I.triggered = true\n triggerLever I.id\n I.sprite = Sprite.loadByName(\"lever_triggered\")\n Sound.play \"trigger\"\n\n return self\n\n","docSelector":"#file_src_lever_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":517,"mtime":1304215175},{"name":"tilemap","contents":"(() ->\n Map = (data, entityCallback) ->\n tileHeight = data.tileHeight\n tileWidth = data.tileWidth\n\n spriteLookup = {}\n\n data.tileset.each (tileData, i) ->\n spriteLookup[i] = Sprite.fromURL(tileData.src)\n\n loadEntities = () ->\n return unless entityCallback\n\n data.layers.each (layer, layerIndex) ->\n return unless layer.name.match /entities/i\n\n layer.tiles.each (row, y) ->\n row.each (tileIndex, x) ->\n if spriteLookup[tileIndex]\n entityData = $.extend(\n layer: layerIndex\n sprite: spriteLookup[tileIndex]\n tileIndex: tileIndex\n x: x * tileWidth\n y: y * tileHeight\n , data.tileset[tileIndex]?.properties)\n\n entityCallback(entityData)\n\n loadEntities() \n\n $.extend data,\n draw: (canvas, x, y) ->\n canvas.withTransform Matrix.translation(x, y), () ->\n data.layers.each (layer) ->\n return if layer.name.match /entities/i\n\n layer.tiles.each (row, y) ->\n row.each (tileIndex, x) ->\n if sprite = spriteLookup[tileIndex]\n sprite.draw(canvas, x * tileWidth, y * tileHeight)\n\n window.Tilemap = (name, callback, entityCallback) ->\n fromPixieId(App.Tilemaps[name], callback, entityCallback)\n\n fromPixieId = (id, callback, entityCallback) ->\n url = \"http://pixieengine.com/s3/tilemaps/#{id}/data.json\"\n\n proxy =\n draw: $.noop\n\n $.getJSON url, (data) ->\n $.extend(proxy, Map(data, entityCallback))\n\n callback? proxy\n\n return proxy\n\n loadByName = (name, callback, entityCallback) ->\n #TODO: Better cachebusting\n url = \"#{BASE_URL}/data/#{name}.tilemap?#{new Date().getTime()}\"\n\n proxy =\n draw: $.noop\n\n $.getJSON url, (data) ->\n $.extend(proxy, Map(data, entityCallback))\n\n callback? proxy\n\n return proxy\n\n window.Tilemap.fromPixieId = fromPixieId\n\n window.Tilemap.load = (options) ->\n if options.pixieId\n fromPixieId options.pixieId, options.complete, options.entity\n else if options.name\n loadByName options.name, options.complete, options.entity\n\n)()\n\n","docSelector":"#file_src_tilemap_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":2198,"mtime":1304146697},{"name":"main","contents":"window.engine = Engine \n canvas: $(\"canvas\").powerCanvas()\n includedModules: \"Tilemap\"\n\n# Add a red square to the scene\nengine.loadMap \"start\", ->\n engine.add\n class: \"Player\"\n location: \"start\"\n\nengine.start()\n\nleversTriggered = {}\nwindow.triggerLever = (name) ->\n leversTriggered[name] = true\n\nwindow.leverTriggered = (name) ->\n leversTriggered[name]\n\nparent.gameControlData =\n Movement: \"Arrow Keys\"\n \"Deploy/Return Cat\": \"Spacebar\"\n \"Place Bomb\": \"Enter\"\n\n","docSelector":"#file_src_main_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":474,"mtime":1304291377},{"name":"mouse","contents":"MousePlayer = (I) ->\n $.reverseMerge I,\n name: \"mouse\"\n width: 12\n height: 12\n speed: 1\n excludedModules: [\"Movable\"]\n\n cooldown = 0\n collisionMargin =\n x: 2\n y: 1\n\n I.sprite = Sprite.loadByName(\"mouse\")\n\n self = GameObject(I).extend\n collisionBounds: (xOffset, yOffset) ->\n x: I.x + (xOffset || 0) + collisionMargin.x\n y: I.y + (yOffset || 0) + collisionMargin.y\n width: I.width - 2 * collisionMargin.x\n height: I.height - 2 * collisionMargin.y\n\n self.bind \"step\", ->\n movement = Point(0, 0)\n\n cooldown = cooldown.approach(0, 1)\n\n if I.age > 10 && keydown.space\n cat = engine.find(\"Cat\").first()\n\n if cat && Collision.rectangular(self.bounds(), cat.bounds())\n I.active = false\n cat.I.state.mouse = false\n cat.pickup self\n cat.I.mouseCooldown = 30\n else\n unless cooldown\n Sound.play \"squeak\"\n cooldown += 30\n\n if keydown.left\n movement = movement.add(Point(-1, 0))\n if keydown.right\n movement = movement.add(Point(1, 0))\n if keydown.up\n movement = movement.add(Point(0, -1))\n if keydown.down\n movement = movement.add(Point(0, 1))\n\n if movement.equal(Point(0, 0))\n I.velocity = movement\n else\n movement = movement.norm().scale(I.speed)\n\n I.velocity = movement\n\n I.velocity.x.abs().times ->\n if !engine.collides(self.collisionBounds(I.velocity.x.sign(), 0), self)\n I.x += I.velocity.x.sign()\n else \n I.velocity.x = 0\n\n I.velocity.y.abs().times ->\n if !engine.collides(self.collisionBounds(0, I.velocity.y.sign()), self)\n I.y += I.velocity.y.sign()\n else \n I.velocity.y = 0\n\n I.x = I.x.clamp(0, 480 - I.width)\n I.y = I.y.clamp(0, 320 - I.height)\n\n self\n","docSelector":"#file_src_mouse_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":1811,"mtime":1304289557},{"name":"stream","contents":"Stream = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n\n self = GameObject(I).extend\n draw: (canvas) ->\n offsetY = (-I.flow.y * I.age).floor().mod(32)\n offsetX = (-I.flow.x * I.age).floor().mod(32)\n source = Stream.fillSource.element()\n canvas.drawImage source, offsetX, offsetY, I.width, I.height, I.x, I.y, I.width, I.height\n\n unless Stream.fillSource\n Stream.fillSource = $(\"<canvas width='128' height='128'></canvas>\").powerCanvas()\n\n Sprite.loadByName \"water0\", (waterSprite) ->\n waterSprite.fill(Stream.fillSource, 0, 0, 128, 128)\n\n self\n\n","docSelector":"#file_src_stream_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":592,"mtime":1304284455},{"name":"drawbridge","contents":"Drawbridge = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n solid: true\n\n I.sprite = Sprite.NONE\n\n if leverTriggered \"bridgeLever\"\n I.sprite = Sprite.loadByName(\"wood_floor\")\n I.solid = false\n\n GameObject(I)\n\n","docSelector":"#file_src_drawbridge_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":231,"mtime":1304274824},{"name":"wall","contents":"Wall = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n solid: true\n\n if I.invisible \n I.sprite = Sprite.NONE\n\n GameObject(I)\n\n","docSelector":"#file_src_wall_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":143,"mtime":1304236483},{"name":"text","contents":"Text = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n\n GameObject(I).extend\n draw: (canvas) ->\n canvas.font(\"bold 11pt consolas, 'Courier New', 'andale mono', 'lucida console', monospace\")\n canvas.fillColor \"#FFF\"\n canvas.centerText I.message, I.y\n\n","docSelector":"#file_src_text_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":278,"mtime":1304140920},{"name":"drawable","contents":"###\nThe Drawable module is used to provide a simple draw method to the including\nobject.\n\nBinds a default draw listener to draw a rectangle or a sprite, if one exists.\n\nBinds a step listener to update the transform of the object.\n\nAutoloads the sprite specified in I.spriteName, if any.\n\n@name Drawable\n@module\n@constructor\n\n@param {Object} I Instance variables\n@param {Object} self Reference to including object\n###\nDrawable = (I, self) ->\n I ||= {}\n\n $.reverseMerge I,\n color: \"#196\"\n spriteName: null\n\n #TODO: Clean up this auto-loading\n if I.spriteName\n I.sprite = Sprite.loadByName(I.spriteName, (sprite) ->\n I.width = sprite.width\n I.height = sprite.height\n )\n else if I.spriteURL\n I.sprite = Sprite.fromURL(I.spriteURL, (sprite) ->\n I.width = sprite.width\n I.height = sprite.height\n )\n\n self.bind 'step', ->\n center = self.center()\n\n if I.rotation\n I.transform = Matrix.translation(center.x, center.y)\n .concat(Matrix.rotation(I.rotation))\n .concat(Matrix.translation(-I.width/2, -I.height/2))\n else\n # Assumes I.x and I.y are top-left\n I.transform = Matrix.translation(I.x, I.y)\n\n self.bind 'draw', (canvas) ->\n if I.sprite\n I.sprite.draw(canvas, 0, 0)\n else\n canvas.fillColor(I.color)\n canvas.fillRect(0, 0, I.width, I.height)\n\n return {}\n","docSelector":"#file_src_drawable_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":1353,"mtime":1304147885},{"name":"player","contents":"Player = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n x: 160\n y: 160\n state: {}\n speed: 4\n items: {\n #kitten: true\n #bomb: true\n }\n excludedModules: [\"Movable\"]\n\n I.sprite = Sprite.loadByName(\"player\")\n walkSprites =\n up: [Sprite.loadByName(\"walk_up0\"), Sprite.loadByName(\"walk_up1\")]\n right: [Sprite.loadByName(\"walk_right0\"), Sprite.loadByName(\"walk_right1\")]\n down: [Sprite.loadByName(\"walk_down0\"), Sprite.loadByName(\"walk_down1\")]\n left: [Sprite.loadByName(\"walk_left0\"), Sprite.loadByName(\"walk_left1\")]\n\n pickupSprite = Sprite.loadByName(\"player_get\")\n bombCooldown = 0\n\n pickupItem = null\n\n self = GameObject(I).extend\n collisionBounds: (xOffset, yOffset) ->\n x: I.x + (xOffset || 0) + collisionMargin.x\n y: I.y + (yOffset || 0) + collisionMargin.y\n width: I.width - 2 * collisionMargin.x\n height: I.height - 2 * collisionMargin.y\n\n pickup: (item) ->\n I.state.pickup = 45\n pickupItem = item\n\n I.items[item.I.name] = true\n\n if item.I.message\n engine.add\n class: \"Text\"\n duration: 150\n message: item.I.message\n y: 32\n\n Sound.play \"fanfare\"\n\n walkCycle = 0\n\n facing = Point(0, 0)\n\n collisionMargin =\n x: 2\n y: 2\n\n self.bind \"draw\", (canvas) ->\n if I.state.pickup && pickupItem\n pickupItem.I.sprite.draw(canvas, 8, -8)\n\n self.bind \"step\", ->\n bombCooldown = bombCooldown.approach(0, 1)\n\n movement = Point(0, 0)\n\n if I.state.pickup\n I.state.pickup -= 1\n I.sprite = pickupSprite\n else if I.state.cat\n\n else\n if keydown.left\n movement = movement.add(Point(-1, 0))\n I.sprite = walkSprites.left.wrap((walkCycle/4).floor())\n if keydown.right\n movement = movement.add(Point(1, 0))\n I.sprite = walkSprites.right.wrap((walkCycle/4).floor())\n if keydown.up\n movement = movement.add(Point(0, -1))\n I.sprite = walkSprites.up.wrap((walkCycle/4).floor())\n if keydown.down\n movement = movement.add(Point(0, 1))\n I.sprite = walkSprites.down.wrap((walkCycle/4).floor())\n\n if I.items.bomb && keydown.return && !bombCooldown\n bombCooldown += 90\n\n target = facing.scale(32).add(self.center()).subtract(Point(8, 8))\n\n engine.add\n class: \"Bomb\"\n x: target.x\n y: target.y\n\n if I.items.kitten && keydown.space\n target = facing.scale(32).add(self.center()).subtract(Point(8, 8))\n\n catBounds =\n x: target.x\n y: target.y\n width: 16\n height: 16\n\n unless engine.collides catBounds\n I.state.cat = true\n I.items.kitten = false\n\n engine.add\n class: \"Cat\"\n playerData: I\n x: target.x\n y: target.y\n\n if movement.equal(Point(0, 0))\n I.velocity = movement\n else\n walkCycle += 1\n\n facing = movement.norm()\n I.velocity = facing.scale(I.speed)\n\n I.velocity.x.abs().times ->\n if !engine.collides(self.collisionBounds(I.velocity.x.sign(), 0), self)\n I.x += I.velocity.x.sign()\n else \n I.velocity.x = 0\n\n I.velocity.y.abs().times ->\n if !engine.collides(self.collisionBounds(0, I.velocity.y.sign()), self)\n I.y += I.velocity.y.sign()\n else \n I.velocity.y = 0\n\n I.x = I.x.clamp(0, 480 - I.width)\n I.y = I.y.clamp(0, 320 - I.height)\n\n self\n\n","docSelector":"#file_src_player_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":3469,"mtime":1304292670},{"name":"sound","contents":"`\nvar Sound = (function($) {\n // TODO: detecting audio with canPlay is f***ed\n // Hopefully get more robust later\n // audio.canPlayType(\"audio/ogg\") === \"maybe\" WTF?\n // http://ajaxian.com/archives/the-doctor-subscribes-html-5-audio-cross-browser-support\n var format = \".wav\";\n var soundPath = BASE_URL + \"/sounds/\";\n var sounds = {};\n\n function loadSoundChannel(name) {\n var sound = $('<audio />').get(0);\n sound.autobuffer = true;\n sound.preload = 'auto';\n sound.src = soundPath + name + format;\n\n return sound;\n }\n\n function Sound(id, maxChannels) {\n return {\n play: function() {\n Sound.play(id, maxChannels);\n },\n\n stop: function() {\n Sound.stop(id);\n }\n }\n }\n\n return $.extend(Sound, {\n play: function(id, maxChannels) {\n // TODO: Too many channels crash Chrome!!!1\n maxChannels = maxChannels || 4;\n\n if(!sounds[id]) {\n sounds[id] = [loadSoundChannel(id)];\n }\n\n var freeChannels = $.grep(sounds[id], function(sound) {\n return sound.currentTime == sound.duration || sound.currentTime == 0\n });\n\n if(freeChannels[0]) {\n try {\n freeChannels[0].currentTime = 0;\n } catch(e) {\n }\n freeChannels[0].play();\n } else {\n if(!maxChannels || sounds[id].length < maxChannels) {\n var sound = loadSoundChannel(id);\n sounds[id].push(sound);\n sound.play();\n }\n }\n },\n\n playFromUrl: function(url) {\n var sound = $('<audio />').get(0);\n sound.src = url;\n\n sound.play();\n\n return sound;\n },\n\n stop: function(id) {\n if(sounds[id]) {\n sounds[id].stop();\n }\n }\n });\n}(jQuery));\n`","docSelector":"#file_src_sound_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":1721,"mtime":1304189588},{"name":"cat","contents":"Cat = (I) ->\n $.reverseMerge I,\n name: \"kitten\"\n width: 16\n height: 16\n speed: 2\n excludedModules: [\"Movable\"]\n items: {}\n state: {}\n\n # HACK\n if window.hasMouse\n I.items.mouse = true\n\n collisionMargin =\n x: 1\n y: 1\n\n facing = Point(0, 0)\n walkCycle = 0\n mewDown = 0\n carriedItem = null\n pickupItem = null\n pickupCooldown = 0\n\n pickupSprite = Sprite.loadByName(\"cat_get\")\n I.sprite = Sprite.loadByName(\"cat\")\n I.mouseCooldown = 0\n\n walkSprites =\n up: [Sprite.loadByName(\"cat_walk_up0\"), Sprite.loadByName(\"cat_walk_up1\")]\n right: [Sprite.loadByName(\"cat_walk_right0\"), Sprite.loadByName(\"cat_walk_right1\")]\n down: [Sprite.loadByName(\"cat_walk_down0\"), Sprite.loadByName(\"cat_walk_down1\")]\n left: [Sprite.loadByName(\"cat_walk_left0\"), Sprite.loadByName(\"cat_walk_left1\")]\n\n self = GameObject(I).extend\n collisionBounds: (xOffset, yOffset) ->\n x: I.x + (xOffset || 0) + collisionMargin.x\n y: I.y + (yOffset || 0) + collisionMargin.y\n width: I.width - 2 * collisionMargin.x\n height: I.height - 2 * collisionMargin.y\n pickup: (item) ->\n pickupCooldown = 45\n pickupItem = item\n\n I.items[item.I.name] = true\n\n # HACK\n window.hasMouse = true\n\n Sound.play \"fanfare\"\n\n self.bind \"draw\", (canvas) ->\n if pickupCooldown && pickupItem\n pickupItem.I.sprite.draw(canvas, 6, -6)\n\n self.bind \"step\", ->\n mewDown = mewDown.approach(0, 1)\n pickupCooldown = pickupCooldown.approach(0, 1)\n I.mouseCooldown = I.mouseCooldown.approach(0, 1)\n\n return if I.state.mouse\n\n movement = Point(0, 0)\n inStream = false\n\n if I.age > 10 && keydown.space && !I.mouseCooldown\n player = engine.find(\"Player\").first()\n\n pickupItem = engine.find(\"Item\").select (item) ->\n Collision.rectangular(self.bounds(), item.bounds())\n .first()\n\n if player && Collision.rectangular(self.bounds(), player.collisionBounds())\n I.active = false\n player.I.state.cat = false\n player.pickup self\n else if pickupItem\n carriedItem = pickupItem\n carriedItem.I.x = I.x\n carriedItem.I.y = I.y\n Sound.play \"pickup\"\n else if I.items.mouse\n target = facing.scale(32).add(self.center()).subtract(Point(12, 12))\n\n mouseBounds =\n x: target.x\n y: target.y\n width: 12\n height: 12\n\n unless engine.collides mouseBounds\n I.state.mouse = true\n I.items.mouse = false\n\n engine.add\n class: \"MousePlayer\"\n x: target.x\n y: target.y\n else\n unless mewDown\n Sound.play \"mew\"\n mewDown += 60\n\n engine.find(\"Stream\").select (tile) ->\n Collision.rectangular({x: I.x + 8, y: I.y + 8, width: 1, height: 1}, tile.bounds())\n .each (stream) ->\n inStream = true\n movement = movement.add(stream.I.flow)\n\n if inStream\n unless mewDown\n Sound.play \"mew\"\n mewDown += 30\n\n if player = engine.find(\"Player\").first()\n player.I.state.cat = false\n\n else if pickupCooldown\n I.sprite = pickupSprite\n else\n if keydown.left\n movement = movement.add(Point(-1, 0))\n I.sprite = walkSprites.left.wrap((walkCycle/4).floor())\n if keydown.right\n movement = movement.add(Point(1, 0))\n I.sprite = walkSprites.right.wrap((walkCycle/4).floor())\n if keydown.up\n movement = movement.add(Point(0, -1))\n I.sprite = walkSprites.up.wrap((walkCycle/4).floor())\n if keydown.down\n movement = movement.add(Point(0, 1))\n I.sprite = walkSprites.down.wrap((walkCycle/4).floor())\n\n if movement.equal(Point(0, 0))\n I.velocity = movement\n else\n walkCycle += 1\n\n unless inStream\n movement = movement.norm().scale(I.speed)\n\n I.velocity = movement\n\n I.velocity.x.abs().times ->\n if !engine.collides(self.collisionBounds(I.velocity.x.sign(), 0), self)\n I.x += I.velocity.x.sign()\n else \n I.velocity.x = 0\n\n I.velocity.y.abs().times ->\n if !engine.collides(self.collisionBounds(0, I.velocity.y.sign()), self)\n I.y += I.velocity.y.sign()\n else \n I.velocity.y = 0\n\n if carriedItem\n carriedItem.I.x = I.x\n carriedItem.I.y = I.y\n\n I.x = I.x.clamp(0, 480 - I.width)\n I.y = I.y.clamp(0, 320 - I.height)\n\n self\n\n","docSelector":"#file_src_cat_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":4420,"mtime":1304290123},{"name":"door","contents":"Door = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n\n I.sprite = Sprite.NONE unless I.keepSprite\n\n self = GameObject(I)\n\n self.bind \"step\", ->\n if I.cat\n player = engine.find(\"Cat\").first()\n\n # Cat can't exit if mouse is about\n return if engine.find(\"MousePlayer\").first()\n else if I.mouse\n player = engine.find(\"MousePlayer\").first()\n else\n player = engine.find(\"Player\").first()\n\n # Player can't exit if cat is about\n return if engine.find(\"Cat\").first()\n\n if player && Collision.rectangular(self.bounds(), player.collisionBounds())\n engine.loadMap I.destination, ->\n player.I.location = I.destination\n\n # Pretty hacky...\n engine.add player.I\n\n if I.cat && player.I.playerData.location == I.destination\n engine.add player.I.playerData\n\n if I.autoPosition\n if I.x == 0\n player.I.x = 416\n else if I.x == 448\n player.I.x = 32\n\n if I.y == 0\n player.I.y = 256\n else if I.y == 288\n player.I.y = 32\n\n if I.destinationPosition\n player.I.x = I.destinationPosition.x\n player.I.y = I.destinationPosition.y\n\n return self\n\n","docSelector":"#file_src_door_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":1204,"mtime":1304287955},{"name":"bomb","contents":"Bomb = (I) ->\n $.reverseMerge I,\n width: 16\n height: 16\n\n I.sprite = Sprite.loadByName(\"bomb\")\n\n self = GameObject(I)\n\n self.bind \"step\", ->\n if I.age == 55\n Sound.play \"explosion\"\n\n if I.age >= 60\n self.destroy()\n\n self.bind \"destroy\", ->\n engine.find(\"BombDoor\").select (door) ->\n Collision.rectangular(self.bounds(), door.bounds())\n .each (door) ->\n door.open()\n\n self\n\n","docSelector":"#file_src_bomb_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":417,"mtime":1304280339},{"name":"engine.tilemap","contents":"###*\nThe <code>Tilemap</code> module provides a way to load tilemaps in the engine.\n\n@name Tilemap\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n###\nEngine.Tilemap = (I, self) ->\n map = null\n updating = false\n clearObjects = false\n\n self.bind \"preDraw\", (canvas) ->\n map?.draw canvas\n\n self.bind \"update\", ->\n updating = true \n\n self.bind \"afterUpdate\", ->\n updating = false\n\n if clearObjects\n #TODO: Clear these out in a more graceful way, triggering unload events\n I.objects.clear()\n clearObjects = false\n\n loadMap: (name, complete) ->\n clearObjects = updating\n\n map = Tilemap.load\n name: name\n complete: complete\n entity: self.add\n\n","docSelector":"#file_src_engine_tilemap_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":751,"mtime":1304142954},{"name":"gate","contents":"Gate = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n solid: true\n\n if leverTriggered I.lever\n I.sprite = Sprite.NONE\n I.solid = false\n\n self = GameObject(I)\n\n return self\n\n","docSelector":"#file_src_gate_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":195,"mtime":1304214552},{"name":"bomb_door","contents":"BombDoor = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n solid: true\n\n openSprite = Sprite.loadByName(\"cave_small\")\n\n self = GameObject(I).extend\n open: ->\n I.solid = false\n I.sprite = openSprite\n Sound.play \"secret\"\n\n self.bind \"step\", ->\n\n if I.cat\n player = engine.find(\"Cat\").first()\n else\n player = engine.find(\"Player\").first()\n\n if player && Collision.rectangular(self.bounds(), player.collisionBounds())\n engine.loadMap I.destination, ->\n player.I.location = I.destination\n\n # Pretty hacky...\n engine.add player.I\n\n if I.cat && player.I.playerData.location == I.destination\n engine.add player.I.playerData\n\n if I.autoPosition\n if I.x == 0\n player.I.x = 416\n else if I.x == 448\n player.I.x = 32\n\n if I.y == 0\n player.I.y = 256\n else if I.y == 288\n player.I.y = 32\n\n if I.destinationPosition\n player.I.x = I.destinationPosition.x\n player.I.y = I.destinationPosition.y\n\n return self\n","docSelector":"#file_src_bomb_door_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":1073,"mtime":1304274666},{"name":"lava","contents":"Lava = (I) ->\n $.reverseMerge I,\n width: 32\n height: 32\n solid: true\n\n self = GameObject(I).extend\n draw: (canvas) ->\n offsetX = (-I.age/7).floor().mod(I.width)\n offsetY = (-I.age/16).floor().mod(I.height)\n source = Lava.fillSource.element()\n canvas.drawImage source, offsetX, offsetY, I.width, I.height, I.x, I.y, I.width, I.height\n\n unless Lava.fillSource\n Lava.fillSource = $(\"<canvas width='128' height='128'></canvas>\").powerCanvas()\n\n Sprite.loadByName \"lava\", (lavaSprite) ->\n lavaSprite.fill(Lava.fillSource, 0, 0, 128, 128)\n\n self\n\n","docSelector":"#file_src_lava_coffee","extension":"coffee","language":"coffeescript","hidden":false,"type":"text","size":588,"mtime":1304279732}]},{"name":"lib","files":[{"name":"gamelib","contents":"/*\n* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com\n*\n* This software is provided 'as-is', without any express or implied\n* warranty. In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\nvar a2j = {};\n\n(function (a2j, window) {\n\n if(!window.flash) window.flash = {utils: {Dictionary: Object} };\n else if(!window.flash.utils) window.flash.utils = {Dictionary: Object};\n else if(!window.flash.utils.Dictionary) window.flash.utils.Dictionary = Object;\n\n window.Vector = window.Array;\n\n Function.prototype.inherit = function (base) {\n var tmpCtr = this;\n var empty = Function.prototype.inherit.empty;\n empty.prototype = base.prototype;\n this.prototype = new empty();\n this.prototype.constructor = tmpCtr;\n };\n Function.prototype.inherit.empty = function () {};\n\n window.trace = function () {\n if (window.console && (window.console.log instanceof Function)) window.console.log.apply(window.console, arguments);\n };\n window.assert = function () {\n if (window.console && (window.console.assert instanceof Function)) window.console.assert.apply(window.console, arguments);\n };\n\n a2j.warn = function warn() {\n if (window.console) console.warn.apply(console, arguments);\n };\n\n a2j.generateCallback = function generateCallback(context, cb) {\n return function () {\n cb.apply(context, arguments);\n };\n };\n\n a2j.NVector = function NVector(length) {\n if (length === undefined) length = 0;\n var tmp = new Array(length || 0);\n for (var i = 0; i < length; ++i)\n tmp[i] = 0;\n return tmp;\n };\n\n a2j.is = function is(o1, o2) {\n if (o1 === null) return false;\n if ((o2 instanceof Function) && (o1 instanceof o2)) return true;\n if ((o1.constructor.__implements != undefined) && (o1.constructor.__implements[o2])) return true;\n return false;\n };\n\n a2j.parseUInt = function(v) {\n return Math.abs(parseInt(v));\n }\n\n})(a2j, window, undefined);\n\nvar Vector_a2j_Number = a2j.NVector;\n//package structure\nif (!window.Box2D) Box2D = {};\nif (!window.Box2D.Collision) Box2D.Collision = {};\nif (!window.Box2D.Collision.Shapes) Box2D.Collision.Shapes = {};\nif (!window.Box2D.Common) Box2D.Common = {};\nif (!window.Box2D.Common.Math) Box2D.Common.Math = {};\nif (!window.Box2D.Dynamics) Box2D.Dynamics = {};\nif (!window.Box2D.Dynamics.Contacts) Box2D.Dynamics.Contacts = {};\nif (!window.Box2D.Dynamics.Controllers) Box2D.Dynamics.Controllers = {};\nif (!window.Box2D.Dynamics.Joints) Box2D.Dynamics.Joints = {};\n//pre-definitions\n(function () {\n Box2D.Collision.IBroadPhase = 'Box2D.Collision.IBroadPhase';\n\n function b2AABB() {\n b2AABB.b2AABB.apply(this, arguments);\n };\n Box2D.Collision.b2AABB = b2AABB;\n\n function b2Bound() {\n b2Bound.b2Bound.apply(this, arguments);\n };\n Box2D.Collision.b2Bound = b2Bound;\n\n function b2BoundValues() {\n b2BoundValues.b2BoundValues.apply(this, arguments);\n if (this.constructor === b2BoundValues) this.b2BoundValues.apply(this, arguments);\n };\n Box2D.Collision.b2BoundValues = b2BoundValues;\n\n function b2BroadPhase() {\n b2BroadPhase.b2BroadPhase.apply(this, arguments);\n if (this.constructor === b2BroadPhase) this.b2BroadPhase.apply(this, arguments);\n };\n Box2D.Collision.b2BroadPhase = b2BroadPhase;\n\n function b2Collision() {\n b2Collision.b2Collision.apply(this, arguments);\n };\n Box2D.Collision.b2Collision = b2Collision;\n\n function b2ContactID() {\n b2ContactID.b2ContactID.apply(this, arguments);\n if (this.constructor === b2ContactID) this.b2ContactID.apply(this, arguments);\n };\n Box2D.Collision.b2ContactID = b2ContactID;\n\n function b2ContactPoint() {\n b2ContactPoint.b2ContactPoint.apply(this, arguments);\n };\n Box2D.Collision.b2ContactPoint = b2ContactPoint;\n\n function b2Distance() {\n b2Distance.b2Distance.apply(this, arguments);\n };\n Box2D.Collision.b2Distance = b2Distance;\n\n function b2DistanceInput() {\n b2DistanceInput.b2DistanceInput.apply(this, arguments);\n };\n Box2D.Collision.b2DistanceInput = b2DistanceInput;\n\n function b2DistanceOutput() {\n b2DistanceOutput.b2DistanceOutput.apply(this, arguments);\n };\n Box2D.Collision.b2DistanceOutput = b2DistanceOutput;\n\n function b2DistanceProxy() {\n b2DistanceProxy.b2DistanceProxy.apply(this, arguments);\n };\n Box2D.Collision.b2DistanceProxy = b2DistanceProxy;\n\n function b2DynamicTree() {\n b2DynamicTree.b2DynamicTree.apply(this, arguments);\n if (this.constructor === b2DynamicTree) this.b2DynamicTree.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTree = b2DynamicTree;\n\n function b2DynamicTreeBroadPhase() {\n b2DynamicTreeBroadPhase.b2DynamicTreeBroadPhase.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTreeBroadPhase = b2DynamicTreeBroadPhase;\n\n function b2DynamicTreeNode() {\n b2DynamicTreeNode.b2DynamicTreeNode.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTreeNode = b2DynamicTreeNode;\n\n function b2DynamicTreePair() {\n b2DynamicTreePair.b2DynamicTreePair.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTreePair = b2DynamicTreePair;\n\n function b2Manifold() {\n b2Manifold.b2Manifold.apply(this, arguments);\n if (this.constructor === b2Manifold) this.b2Manifold.apply(this, arguments);\n };\n Box2D.Collision.b2Manifold = b2Manifold;\n\n function b2ManifoldPoint() {\n b2ManifoldPoint.b2ManifoldPoint.apply(this, arguments);\n if (this.constructor === b2ManifoldPoint) this.b2ManifoldPoint.apply(this, arguments);\n };\n Box2D.Collision.b2ManifoldPoint = b2ManifoldPoint;\n\n function b2OBB() {\n b2OBB.b2OBB.apply(this, arguments);\n };\n Box2D.Collision.b2OBB = b2OBB;\n\n function b2Pair() {\n b2Pair.b2Pair.apply(this, arguments);\n };\n Box2D.Collision.b2Pair = b2Pair;\n\n function b2PairManager() {\n b2PairManager.b2PairManager.apply(this, arguments);\n if (this.constructor === b2PairManager) this.b2PairManager.apply(this, arguments);\n };\n Box2D.Collision.b2PairManager = b2PairManager;\n\n function b2Point() {\n b2Point.b2Point.apply(this, arguments);\n };\n Box2D.Collision.b2Point = b2Point;\n\n function b2Proxy() {\n b2Proxy.b2Proxy.apply(this, arguments);\n };\n Box2D.Collision.b2Proxy = b2Proxy;\n\n function b2RayCastInput() {\n b2RayCastInput.b2RayCastInput.apply(this, arguments);\n if (this.constructor === b2RayCastInput) this.b2RayCastInput.apply(this, arguments);\n };\n Box2D.Collision.b2RayCastInput = b2RayCastInput;\n\n function b2RayCastOutput() {\n b2RayCastOutput.b2RayCastOutput.apply(this, arguments);\n };\n Box2D.Collision.b2RayCastOutput = b2RayCastOutput;\n\n function b2Segment() {\n b2Segment.b2Segment.apply(this, arguments);\n };\n Box2D.Collision.b2Segment = b2Segment;\n\n function b2SeparationFunction() {\n b2SeparationFunction.b2SeparationFunction.apply(this, arguments);\n };\n Box2D.Collision.b2SeparationFunction = b2SeparationFunction;\n\n function b2Simplex() {\n b2Simplex.b2Simplex.apply(this, arguments);\n if (this.constructor === b2Simplex) this.b2Simplex.apply(this, arguments);\n };\n Box2D.Collision.b2Simplex = b2Simplex;\n\n function b2SimplexCache() {\n b2SimplexCache.b2SimplexCache.apply(this, arguments);\n };\n Box2D.Collision.b2SimplexCache = b2SimplexCache;\n\n function b2SimplexVertex() {\n b2SimplexVertex.b2SimplexVertex.apply(this, arguments);\n };\n Box2D.Collision.b2SimplexVertex = b2SimplexVertex;\n\n function b2TimeOfImpact() {\n b2TimeOfImpact.b2TimeOfImpact.apply(this, arguments);\n };\n Box2D.Collision.b2TimeOfImpact = b2TimeOfImpact;\n\n function b2TOIInput() {\n b2TOIInput.b2TOIInput.apply(this, arguments);\n };\n Box2D.Collision.b2TOIInput = b2TOIInput;\n\n function b2WorldManifold() {\n b2WorldManifold.b2WorldManifold.apply(this, arguments);\n if (this.constructor === b2WorldManifold) this.b2WorldManifold.apply(this, arguments);\n };\n Box2D.Collision.b2WorldManifold = b2WorldManifold;\n\n function ClipVertex() {\n ClipVertex.ClipVertex.apply(this, arguments);\n };\n Box2D.Collision.ClipVertex = ClipVertex;\n\n function Features() {\n Features.Features.apply(this, arguments);\n };\n Box2D.Collision.Features = Features;\n\n function b2CircleShape() {\n b2CircleShape.b2CircleShape.apply(this, arguments);\n if (this.constructor === b2CircleShape) this.b2CircleShape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2CircleShape = b2CircleShape;\n\n function b2EdgeChainDef() {\n b2EdgeChainDef.b2EdgeChainDef.apply(this, arguments);\n if (this.constructor === b2EdgeChainDef) this.b2EdgeChainDef.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2EdgeChainDef = b2EdgeChainDef;\n\n function b2EdgeShape() {\n b2EdgeShape.b2EdgeShape.apply(this, arguments);\n if (this.constructor === b2EdgeShape) this.b2EdgeShape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2EdgeShape = b2EdgeShape;\n\n function b2MassData() {\n b2MassData.b2MassData.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2MassData = b2MassData;\n\n function b2PolygonShape() {\n b2PolygonShape.b2PolygonShape.apply(this, arguments);\n if (this.constructor === b2PolygonShape) this.b2PolygonShape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2PolygonShape = b2PolygonShape;\n\n function b2Shape() {\n b2Shape.b2Shape.apply(this, arguments);\n if (this.constructor === b2Shape) this.b2Shape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2Shape = b2Shape;\n Box2D.Common.b2internal = 'Box2D.Common.b2internal';\n\n function b2Color() {\n b2Color.b2Color.apply(this, arguments);\n if (this.constructor === b2Color) this.b2Color.apply(this, arguments);\n };\n Box2D.Common.b2Color = b2Color;\n\n function b2Settings() {\n b2Settings.b2Settings.apply(this, arguments);\n };\n Box2D.Common.b2Settings = b2Settings;\n\n function b2Mat22() {\n b2Mat22.b2Mat22.apply(this, arguments);\n if (this.constructor === b2Mat22) this.b2Mat22.apply(this, arguments);\n };\n Box2D.Common.Math.b2Mat22 = b2Mat22;\n\n function b2Mat33() {\n b2Mat33.b2Mat33.apply(this, arguments);\n if (this.constructor === b2Mat33) this.b2Mat33.apply(this, arguments);\n };\n Box2D.Common.Math.b2Mat33 = b2Mat33;\n\n function b2Math() {\n b2Math.b2Math.apply(this, arguments);\n };\n Box2D.Common.Math.b2Math = b2Math;\n\n function b2Sweep() {\n b2Sweep.b2Sweep.apply(this, arguments);\n };\n Box2D.Common.Math.b2Sweep = b2Sweep;\n\n function b2Transform() {\n b2Transform.b2Transform.apply(this, arguments);\n if (this.constructor === b2Transform) this.b2Transform.apply(this, arguments);\n };\n Box2D.Common.Math.b2Transform = b2Transform;\n\n function b2Vec2() {\n b2Vec2.b2Vec2.apply(this, arguments);\n if (this.constructor === b2Vec2) this.b2Vec2.apply(this, arguments);\n };\n Box2D.Common.Math.b2Vec2 = b2Vec2;\n\n function b2Vec3() {\n b2Vec3.b2Vec3.apply(this, arguments);\n if (this.constructor === b2Vec3) this.b2Vec3.apply(this, arguments);\n };\n Box2D.Common.Math.b2Vec3 = b2Vec3;\n\n function b2Body() {\n b2Body.b2Body.apply(this, arguments);\n if (this.constructor === b2Body) this.b2Body.apply(this, arguments);\n };\n Box2D.Dynamics.b2Body = b2Body;\n\n function b2BodyDef() {\n b2BodyDef.b2BodyDef.apply(this, arguments);\n if (this.constructor === b2BodyDef) this.b2BodyDef.apply(this, arguments);\n };\n Box2D.Dynamics.b2BodyDef = b2BodyDef;\n\n function b2ContactFilter() {\n b2ContactFilter.b2ContactFilter.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactFilter = b2ContactFilter;\n\n function b2ContactImpulse() {\n b2ContactImpulse.b2ContactImpulse.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactImpulse = b2ContactImpulse;\n\n function b2ContactListener() {\n b2ContactListener.b2ContactListener.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactListener = b2ContactListener;\n\n function b2ContactManager() {\n b2ContactManager.b2ContactManager.apply(this, arguments);\n if (this.constructor === b2ContactManager) this.b2ContactManager.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactManager = b2ContactManager;\n\n function b2DebugDraw() {\n b2DebugDraw.b2DebugDraw.apply(this, arguments);\n if (this.constructor === b2DebugDraw) this.b2DebugDraw.apply(this, arguments);\n };\n Box2D.Dynamics.b2DebugDraw = b2DebugDraw;\n\n function b2DestructionListener() {\n b2DestructionListener.b2DestructionListener.apply(this, arguments);\n };\n Box2D.Dynamics.b2DestructionListener = b2DestructionListener;\n\n function b2FilterData() {\n b2FilterData.b2FilterData.apply(this, arguments);\n };\n Box2D.Dynamics.b2FilterData = b2FilterData;\n\n function b2Fixture() {\n b2Fixture.b2Fixture.apply(this, arguments);\n if (this.constructor === b2Fixture) this.b2Fixture.apply(this, arguments);\n };\n Box2D.Dynamics.b2Fixture = b2Fixture;\n\n function b2FixtureDef() {\n b2FixtureDef.b2FixtureDef.apply(this, arguments);\n if (this.constructor === b2FixtureDef) this.b2FixtureDef.apply(this, arguments);\n };\n Box2D.Dynamics.b2FixtureDef = b2FixtureDef;\n\n function b2Island() {\n b2Island.b2Island.apply(this, arguments);\n if (this.constructor === b2Island) this.b2Island.apply(this, arguments);\n };\n Box2D.Dynamics.b2Island = b2Island;\n\n function b2TimeStep() {\n b2TimeStep.b2TimeStep.apply(this, arguments);\n };\n Box2D.Dynamics.b2TimeStep = b2TimeStep;\n\n function b2World() {\n b2World.b2World.apply(this, arguments);\n if (this.constructor === b2World) this.b2World.apply(this, arguments);\n };\n Box2D.Dynamics.b2World = b2World;\n\n function b2CircleContact() {\n b2CircleContact.b2CircleContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2CircleContact = b2CircleContact;\n\n function b2Contact() {\n b2Contact.b2Contact.apply(this, arguments);\n if (this.constructor === b2Contact) this.b2Contact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2Contact = b2Contact;\n\n function b2ContactConstraint() {\n b2ContactConstraint.b2ContactConstraint.apply(this, arguments);\n if (this.constructor === b2ContactConstraint) this.b2ContactConstraint.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactConstraint = b2ContactConstraint;\n\n function b2ContactConstraintPoint() {\n b2ContactConstraintPoint.b2ContactConstraintPoint.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactConstraintPoint = b2ContactConstraintPoint;\n\n function b2ContactEdge() {\n b2ContactEdge.b2ContactEdge.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactEdge = b2ContactEdge;\n\n function b2ContactFactory() {\n b2ContactFactory.b2ContactFactory.apply(this, arguments);\n if (this.constructor === b2ContactFactory) this.b2ContactFactory.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactFactory = b2ContactFactory;\n\n function b2ContactRegister() {\n b2ContactRegister.b2ContactRegister.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactRegister = b2ContactRegister;\n\n function b2ContactResult() {\n b2ContactResult.b2ContactResult.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactResult = b2ContactResult;\n\n function b2ContactSolver() {\n b2ContactSolver.b2ContactSolver.apply(this, arguments);\n if (this.constructor === b2ContactSolver) this.b2ContactSolver.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactSolver = b2ContactSolver;\n\n function b2EdgeAndCircleContact() {\n b2EdgeAndCircleContact.b2EdgeAndCircleContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2EdgeAndCircleContact = b2EdgeAndCircleContact;\n\n function b2NullContact() {\n b2NullContact.b2NullContact.apply(this, arguments);\n if (this.constructor === b2NullContact) this.b2NullContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2NullContact = b2NullContact;\n\n function b2PolyAndCircleContact() {\n b2PolyAndCircleContact.b2PolyAndCircleContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PolyAndCircleContact = b2PolyAndCircleContact;\n\n function b2PolyAndEdgeContact() {\n b2PolyAndEdgeContact.b2PolyAndEdgeContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PolyAndEdgeContact = b2PolyAndEdgeContact;\n\n function b2PolygonContact() {\n b2PolygonContact.b2PolygonContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PolygonContact = b2PolygonContact;\n\n function b2PositionSolverManifold() {\n b2PositionSolverManifold.b2PositionSolverManifold.apply(this, arguments);\n if (this.constructor === b2PositionSolverManifold) this.b2PositionSolverManifold.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PositionSolverManifold = b2PositionSolverManifold;\n\n function b2BuoyancyController() {\n b2BuoyancyController.b2BuoyancyController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2BuoyancyController = b2BuoyancyController;\n\n function b2ConstantAccelController() {\n b2ConstantAccelController.b2ConstantAccelController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2ConstantAccelController = b2ConstantAccelController;\n\n function b2ConstantForceController() {\n b2ConstantForceController.b2ConstantForceController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2ConstantForceController = b2ConstantForceController;\n\n function b2Controller() {\n b2Controller.b2Controller.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2Controller = b2Controller;\n\n function b2ControllerEdge() {\n b2ControllerEdge.b2ControllerEdge.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2ControllerEdge = b2ControllerEdge;\n\n function b2GravityController() {\n b2GravityController.b2GravityController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2GravityController = b2GravityController;\n\n function b2TensorDampingController() {\n b2TensorDampingController.b2TensorDampingController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2TensorDampingController = b2TensorDampingController;\n\n function b2DistanceJoint() {\n b2DistanceJoint.b2DistanceJoint.apply(this, arguments);\n if (this.constructor === b2DistanceJoint) this.b2DistanceJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2DistanceJoint = b2DistanceJoint;\n\n function b2DistanceJointDef() {\n b2DistanceJointDef.b2DistanceJointDef.apply(this, arguments);\n if (this.constructor === b2DistanceJointDef) this.b2DistanceJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2DistanceJointDef = b2DistanceJointDef;\n\n function b2FrictionJoint() {\n b2FrictionJoint.b2FrictionJoint.apply(this, arguments);\n if (this.constructor === b2FrictionJoint) this.b2FrictionJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2FrictionJoint = b2FrictionJoint;\n\n function b2FrictionJointDef() {\n b2FrictionJointDef.b2FrictionJointDef.apply(this, arguments);\n if (this.constructor === b2FrictionJointDef) this.b2FrictionJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2FrictionJointDef = b2FrictionJointDef;\n\n function b2GearJoint() {\n b2GearJoint.b2GearJoint.apply(this, arguments);\n if (this.constructor === b2GearJoint) this.b2GearJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2GearJoint = b2GearJoint;\n\n function b2GearJointDef() {\n b2GearJointDef.b2GearJointDef.apply(this, arguments);\n if (this.constructor === b2GearJointDef) this.b2GearJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2GearJointDef = b2GearJointDef;\n\n function b2Jacobian() {\n b2Jacobian.b2Jacobian.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2Jacobian = b2Jacobian;\n\n function b2Joint() {\n b2Joint.b2Joint.apply(this, arguments);\n if (this.constructor === b2Joint) this.b2Joint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2Joint = b2Joint;\n\n function b2JointDef() {\n b2JointDef.b2JointDef.apply(this, arguments);\n if (this.constructor === b2JointDef) this.b2JointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2JointDef = b2JointDef;\n\n function b2JointEdge() {\n b2JointEdge.b2JointEdge.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2JointEdge = b2JointEdge;\n\n function b2LineJoint() {\n b2LineJoint.b2LineJoint.apply(this, arguments);\n if (this.constructor === b2LineJoint) this.b2LineJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2LineJoint = b2LineJoint;\n\n function b2LineJointDef() {\n b2LineJointDef.b2LineJointDef.apply(this, arguments);\n if (this.constructor === b2LineJointDef) this.b2LineJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2LineJointDef = b2LineJointDef;\n\n function b2MouseJoint() {\n b2MouseJoint.b2MouseJoint.apply(this, arguments);\n if (this.constructor === b2MouseJoint) this.b2MouseJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2MouseJoint = b2MouseJoint;\n\n function b2MouseJointDef() {\n b2MouseJointDef.b2MouseJointDef.apply(this, arguments);\n if (this.constructor === b2MouseJointDef) this.b2MouseJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2MouseJointDef = b2MouseJointDef;\n\n function b2PrismaticJoint() {\n b2PrismaticJoint.b2PrismaticJoint.apply(this, arguments);\n if (this.constructor === b2PrismaticJoint) this.b2PrismaticJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PrismaticJoint = b2PrismaticJoint;\n\n function b2PrismaticJointDef() {\n b2PrismaticJointDef.b2PrismaticJointDef.apply(this, arguments);\n if (this.constructor === b2PrismaticJointDef) this.b2PrismaticJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PrismaticJointDef = b2PrismaticJointDef;\n\n function b2PulleyJoint() {\n b2PulleyJoint.b2PulleyJoint.apply(this, arguments);\n if (this.constructor === b2PulleyJoint) this.b2PulleyJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PulleyJoint = b2PulleyJoint;\n\n function b2PulleyJointDef() {\n b2PulleyJointDef.b2PulleyJointDef.apply(this, arguments);\n if (this.constructor === b2PulleyJointDef) this.b2PulleyJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PulleyJointDef = b2PulleyJointDef;\n\n function b2RevoluteJoint() {\n b2RevoluteJoint.b2RevoluteJoint.apply(this, arguments);\n if (this.constructor === b2RevoluteJoint) this.b2RevoluteJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2RevoluteJoint = b2RevoluteJoint;\n\n function b2RevoluteJointDef() {\n b2RevoluteJointDef.b2RevoluteJointDef.apply(this, arguments);\n if (this.constructor === b2RevoluteJointDef) this.b2RevoluteJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2RevoluteJointDef = b2RevoluteJointDef;\n\n function b2WeldJoint() {\n b2WeldJoint.b2WeldJoint.apply(this, arguments);\n if (this.constructor === b2WeldJoint) this.b2WeldJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2WeldJoint = b2WeldJoint;\n\n function b2WeldJointDef() {\n b2WeldJointDef.b2WeldJointDef.apply(this, arguments);\n if (this.constructor === b2WeldJointDef) this.b2WeldJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2WeldJointDef = b2WeldJointDef;\n})(); //definitions\n_A2J_postDefs = []; /* source: disabled*/\n(function () {\n var Dictionary = flash.utils.Dictionary;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2internal = Box2D.Common.b2internal;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2internal = Box2D.Common.b2internal;\n var b2internal = Box2D.Common.b2internal;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n b2AABB.b2AABB = function () {\n this.lowerBound = new b2Vec2();\n this.upperBound = new b2Vec2();\n };\n b2AABB.prototype.IsValid = function () {\n var dX = this.upperBound.x - this.lowerBound.x;\n var dY = this.upperBound.y - this.lowerBound.y;\n var valid = dX >= 0.0 && dY >= 0.0;\n valid = valid && this.lowerBound.IsValid() && this.upperBound.IsValid();\n return valid;\n }\n b2AABB.prototype.GetCenter = function () {\n return new b2Vec2((this.lowerBound.x + this.upperBound.x) / 2, (this.lowerBound.y + this.upperBound.y) / 2);\n }\n b2AABB.prototype.GetExtents = function () {\n return new b2Vec2((this.upperBound.x - this.lowerBound.x) / 2, (this.upperBound.y - this.lowerBound.y) / 2);\n }\n b2AABB.prototype.Contains = function (aabb) {\n var result = true;\n result = result && this.lowerBound.x <= aabb.lowerBound.x;\n result = result && this.lowerBound.y <= aabb.lowerBound.y;\n result = result && aabb.upperBound.x <= this.upperBound.x;\n result = result && aabb.upperBound.y <= this.upperBound.y;\n return result;\n }\n b2AABB.prototype.RayCast = function (output, input) {\n var tmin = (-Number.MAX_VALUE);\n var tmax = Number.MAX_VALUE;\n var pX = input.p1.x;\n var pY = input.p1.y;\n var dX = input.p2.x - input.p1.x;\n var dY = input.p2.y - input.p1.y;\n var absDX = Math.abs(dX);\n var absDY = Math.abs(dY);\n var normal = output.normal;\n var inv_d = 0;\n var t1 = 0;\n var t2 = 0;\n var t3 = 0;\n var s = 0; {\n if (absDX < Number.MIN_VALUE) {\n if (pX < this.lowerBound.x || this.upperBound.x < pX) return false;\n }\n else {\n inv_d = 1.0 / dX;\n t1 = (this.lowerBound.x - pX) * inv_d;\n t2 = (this.upperBound.x - pX) * inv_d;\n s = (-1.0);\n if (t1 > t2) {\n t3 = t1;\n t1 = t2;\n t2 = t3;\n s = 1.0;\n }\n if (t1 > tmin) {\n normal.x = s;\n normal.y = 0;\n tmin = t1;\n }\n tmax = Math.min(tmax, t2);\n if (tmin > tmax) return false;\n }\n } {\n if (absDY < Number.MIN_VALUE) {\n if (pY < this.lowerBound.y || this.upperBound.y < pY) return false;\n }\n else {\n inv_d = 1.0 / dY;\n t1 = (this.lowerBound.y - pY) * inv_d;\n t2 = (this.upperBound.y - pY) * inv_d;\n s = (-1.0);\n if (t1 > t2) {\n t3 = t1;\n t1 = t2;\n t2 = t3;\n s = 1.0;\n }\n if (t1 > tmin) {\n normal.y = s;\n normal.x = 0;\n tmin = t1;\n }\n tmax = Math.min(tmax, t2);\n if (tmin > tmax) return false;\n }\n }\n output.fraction = tmin;\n return true;\n }\n b2AABB.prototype.TestOverlap = function (other) {\n var d1X = other.lowerBound.x - this.upperBound.x;\n var d1Y = other.lowerBound.y - this.upperBound.y;\n var d2X = this.lowerBound.x - other.upperBound.x;\n var d2Y = this.lowerBound.y - other.upperBound.y;\n if (d1X > 0.0 || d1Y > 0.0) return false;\n if (d2X > 0.0 || d2Y > 0.0) return false;\n return true;\n }\n b2AABB.prototype.Combine = function (aabb1, aabb2) {\n var aabb = new b2AABB();\n if (this.constructor === Box2D.Collision.b2AABB) this._a2j__Combine(aabb1, aabb2);\n else aabb._a2j__Combine(aabb1, aabb2);\n return aabb;\n }\n b2AABB.Combine = b2AABB.prototype.Combine;\n b2AABB.prototype._a2j__Combine = function (aabb1, aabb2) {\n this.lowerBound.x = Math.min(aabb1.lowerBound.x, aabb2.lowerBound.x);\n this.lowerBound.y = Math.min(aabb1.lowerBound.y, aabb2.lowerBound.y);\n this.upperBound.x = Math.max(aabb1.upperBound.x, aabb2.upperBound.x);\n this.upperBound.y = Math.max(aabb1.upperBound.y, aabb2.upperBound.y);\n }\n b2Bound.b2Bound = function () {};\n b2Bound.prototype.IsLower = function () {\n return (this.value & 1) == 0;\n }\n b2Bound.prototype.IsUpper = function () {\n return (this.value & 1) == 1;\n }\n b2Bound.prototype.Swap = function (b) {\n var tempValue = this.value;\n var tempProxy = this.proxy;\n var tempStabbingCount = this.stabbingCount;\n this.value = b.value;\n this.proxy = b.proxy;\n this.stabbingCount = b.stabbingCount;\n b.value = tempValue;\n b.proxy = tempProxy;\n b.stabbingCount = tempStabbingCount;\n }\n b2BoundValues.b2BoundValues = function () {};\n b2BoundValues.prototype.b2BoundValues = function () {\n this.lowerValues = new Vector_a2j_Number();\n this.lowerValues[0] = 0.0;\n this.lowerValues[1] = 0.0;\n this.upperValues = new Vector_a2j_Number();\n this.upperValues[0] = 0.0;\n this.upperValues[1] = 0.0;\n }\n b2BroadPhase.b2BroadPhase = function () {\n this.m_pairManager = new b2PairManager();\n this.m_proxyPool = new Array();\n this.m_querySortKeys = new Array();\n this.m_queryResults = new Array();\n this.m_quantizationFactor = new b2Vec2();\n };\n b2BroadPhase.prototype.b2BroadPhase = function (worldAABB) {\n var i = 0;\n this.m_pairManager.Initialize(this);\n this.m_worldAABB = worldAABB;\n this.m_proxyCount = 0;\n this.m_bounds = new Vector();\n for (i = 0;\n i < 2; i++) {\n this.m_bounds[i] = new Vector();\n }\n var dX = worldAABB.upperBound.x - worldAABB.lowerBound.x;\n var dY = worldAABB.upperBound.y - worldAABB.lowerBound.y;\n this.m_quantizationFactor.x = b2Settings.USHRT_MAX / dX;\n this.m_quantizationFactor.y = b2Settings.USHRT_MAX / dY;\n this.m_timeStamp = 1;\n this.m_queryResultCount = 0;\n }\n b2BroadPhase.prototype.InRange = function (aabb) {\n var dX = 0;\n var dY = 0;\n var d2X = 0;\n var d2Y = 0;\n dX = aabb.lowerBound.x;\n dY = aabb.lowerBound.y;\n dX -= this.m_worldAABB.upperBound.x;\n dY -= this.m_worldAABB.upperBound.y;\n d2X = this.m_worldAABB.lowerBound.x;\n d2Y = this.m_worldAABB.lowerBound.y;\n d2X -= aabb.upperBound.x;\n d2Y -= aabb.upperBound.y;\n dX = b2Math.Max(dX, d2X);\n dY = b2Math.Max(dY, d2Y);\n return b2Math.Max(dX, dY) < 0.0;\n }\n b2BroadPhase.prototype.CreateProxy = function (aabb, userData) {\n var index = 0;\n var proxy;\n var i = 0;\n var j = 0;\n if (!this.m_freeProxy) {\n this.m_freeProxy = this.m_proxyPool[this.m_proxyCount] = new b2Proxy();\n this.m_freeProxy.next = null;\n this.m_freeProxy.timeStamp = 0;\n this.m_freeProxy.overlapCount = b2BroadPhase.b2_invalid;\n this.m_freeProxy.userData = null;\n for (i = 0;\n i < 2; i++) {\n j = this.m_proxyCount * 2;\n this.m_bounds[i][j++] = new b2Bound();\n this.m_bounds[i][j] = new b2Bound();\n }\n }\n proxy = this.m_freeProxy;\n this.m_freeProxy = proxy.next;\n proxy.overlapCount = 0;\n proxy.userData = userData;\n var boundCount = 2 * this.m_proxyCount;\n var lowerValues = new Vector_a2j_Number();\n var upperValues = new Vector_a2j_Number();\n this.ComputeBounds(lowerValues, upperValues, aabb);\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var lowerIndex = 0;\n var upperIndex = 0;\n var lowerIndexOut = new Vector_a2j_Number();\n lowerIndexOut.push(lowerIndex);\n var upperIndexOut = new Vector_a2j_Number();\n upperIndexOut.push(upperIndex);\n this.QueryAxis(lowerIndexOut, upperIndexOut, lowerValues[axis], upperValues[axis], bounds, boundCount, axis);\n lowerIndex = lowerIndexOut[0];\n upperIndex = upperIndexOut[0];\n bounds.splice(upperIndex, 0, bounds[bounds.length - 1]);\n bounds.length--;\n bounds.splice(lowerIndex, 0, bounds[bounds.length - 1]);\n bounds.length--;\n ++upperIndex;\n var tBound1 = bounds[lowerIndex];\n var tBound2 = bounds[upperIndex];\n tBound1.value = lowerValues[axis];\n tBound1.proxy = proxy;\n tBound2.value = upperValues[axis];\n tBound2.proxy = proxy;\n var tBoundAS3 = bounds[parseInt(lowerIndex - 1)];\n tBound1.stabbingCount = lowerIndex == 0 ? 0 : tBoundAS3.stabbingCount;\n tBoundAS3 = bounds[parseInt(upperIndex - 1)];\n tBound2.stabbingCount = tBoundAS3.stabbingCount;\n for (index = lowerIndex;\n index < upperIndex; ++index) {\n tBoundAS3 = bounds[index];\n tBoundAS3.stabbingCount++;\n }\n for (index = lowerIndex;\n index < boundCount + 2; ++index) {\n tBound1 = bounds[index];\n var proxy2 = tBound1.proxy;\n if (tBound1.IsLower()) {\n proxy2.lowerBounds[axis] = index;\n }\n else {\n proxy2.upperBounds[axis] = index;\n }\n }\n }++this.m_proxyCount;\n for (i = 0;\n i < this.m_queryResultCount; ++i) {\n this.m_pairManager.AddBufferedPair(proxy, this.m_queryResults[i]);\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n return proxy;\n }\n b2BroadPhase.prototype.DestroyProxy = function (proxy_) {\n var proxy = (proxy_ instanceof b2Proxy ? proxy_ : null);\n var tBound1;\n var tBound2;\n var boundCount = parseInt(2 * this.m_proxyCount);\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var lowerIndex = proxy.lowerBounds[axis];\n var upperIndex = proxy.upperBounds[axis];\n tBound1 = bounds[lowerIndex];\n var lowerValue = tBound1.value;\n tBound2 = bounds[upperIndex];\n var upperValue = tBound2.value;\n bounds.splice(upperIndex, 1);\n bounds.splice(lowerIndex, 1);\n bounds.push(tBound1);\n bounds.push(tBound2);\n var tEnd = parseInt(boundCount - 2);\n for (var index = lowerIndex; index < tEnd; ++index) {\n tBound1 = bounds[index];\n var proxy2 = tBound1.proxy;\n if (tBound1.IsLower()) {\n proxy2.lowerBounds[axis] = index;\n }\n else {\n proxy2.upperBounds[axis] = index;\n }\n }\n tEnd = upperIndex - 1;\n for (var index2 = parseInt(lowerIndex); index2 < tEnd; ++index2) {\n tBound1 = bounds[index2];\n tBound1.stabbingCount--;\n }\n var ignore = new Vector_a2j_Number();\n this.QueryAxis(ignore, ignore, lowerValue, upperValue, bounds, boundCount - 2, axis);\n }\n for (var i = 0; i < this.m_queryResultCount; ++i) {\n this.m_pairManager.RemoveBufferedPair(proxy, this.m_queryResults[i]);\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n proxy.userData = null;\n proxy.overlapCount = b2BroadPhase.b2_invalid;\n proxy.lowerBounds[0] = b2BroadPhase.b2_invalid;\n proxy.lowerBounds[1] = b2BroadPhase.b2_invalid;\n proxy.upperBounds[0] = b2BroadPhase.b2_invalid;\n proxy.upperBounds[1] = b2BroadPhase.b2_invalid;\n proxy.next = this.m_freeProxy;\n this.m_freeProxy = proxy;\n --this.m_proxyCount;\n }\n b2BroadPhase.prototype.MoveProxy = function (proxy_, aabb, displacement) {\n var proxy = (proxy_ instanceof b2Proxy ? proxy_ : null);\n var as3arr;\n var as3int = 0;\n var axis = 0;\n var index = 0;\n var bound;\n var prevBound;\n var nextBound;\n var nextProxyId = 0;\n var nextProxy;\n if (proxy == null) {\n return;\n }\n if (aabb.IsValid() == false) {\n return;\n }\n var boundCount = 2 * this.m_proxyCount;\n var newValues = new b2BoundValues();\n this.ComputeBounds(newValues.lowerValues, newValues.upperValues, aabb);\n var oldValues = new b2BoundValues();\n for (axis = 0;\n axis < 2; ++axis) {\n bound = this.m_bounds[axis][proxy.lowerBounds[axis]];\n oldValues.lowerValues[axis] = bound.value;\n bound = this.m_bounds[axis][proxy.upperBounds[axis]];\n oldValues.upperValues[axis] = bound.value;\n }\n for (axis = 0;\n axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var lowerIndex = proxy.lowerBounds[axis];\n var upperIndex = proxy.upperBounds[axis];\n var lowerValue = newValues.lowerValues[axis];\n var upperValue = newValues.upperValues[axis];\n bound = bounds[lowerIndex];\n var deltaLower = parseInt(lowerValue - bound.value);\n bound.value = lowerValue;\n bound = bounds[upperIndex];\n var deltaUpper = parseInt(upperValue - bound.value);\n bound.value = upperValue;\n if (deltaLower < 0) {\n index = lowerIndex;\n while (index > 0 && lowerValue < ((bounds[parseInt(index - 1)] instanceof b2Bound ? bounds[parseInt(index - 1)] : null)).value) {\n bound = bounds[index];\n prevBound = bounds[parseInt(index - 1)];\n var prevProxy = prevBound.proxy;\n prevBound.stabbingCount++;\n if (prevBound.IsUpper() == true) {\n if (this.TestOverlapBound(newValues, prevProxy)) {\n this.m_pairManager.AddBufferedPair(proxy, prevProxy);\n }\n as3arr = prevProxy.upperBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n else {\n as3arr = prevProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n as3arr = proxy.lowerBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.Swap(prevBound);\n --index;\n }\n }\n if (deltaUpper > 0) {\n index = upperIndex;\n while (index < boundCount - 1 && ((bounds[parseInt(index + 1)] instanceof b2Bound ? bounds[parseInt(index + 1)] : null)).value <= upperValue) {\n bound = bounds[index];\n nextBound = bounds[parseInt(index + 1)];\n nextProxy = nextBound.proxy;\n nextBound.stabbingCount++;\n if (nextBound.IsLower() == true) {\n if (this.TestOverlapBound(newValues, nextProxy)) {\n this.m_pairManager.AddBufferedPair(proxy, nextProxy);\n }\n as3arr = nextProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n else {\n as3arr = nextProxy.upperBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n as3arr = proxy.upperBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.Swap(nextBound);\n index++;\n }\n }\n if (deltaLower > 0) {\n index = lowerIndex;\n while (index < boundCount - 1 && ((bounds[parseInt(index + 1)] instanceof b2Bound ? bounds[parseInt(index + 1)] : null)).value <= lowerValue) {\n bound = bounds[index];\n nextBound = bounds[parseInt(index + 1)];\n nextProxy = nextBound.proxy;\n nextBound.stabbingCount--;\n if (nextBound.IsUpper()) {\n if (this.TestOverlapBound(oldValues, nextProxy)) {\n this.m_pairManager.RemoveBufferedPair(proxy, nextProxy);\n }\n as3arr = nextProxy.upperBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n else {\n as3arr = nextProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n as3arr = proxy.lowerBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.Swap(nextBound);\n index++;\n }\n }\n if (deltaUpper < 0) {\n index = upperIndex;\n while (index > 0 && upperValue < ((bounds[parseInt(index - 1)] instanceof b2Bound ? bounds[parseInt(index - 1)] : null)).value) {\n bound = bounds[index];\n prevBound = bounds[parseInt(index - 1)];\n prevProxy = prevBound.proxy;\n prevBound.stabbingCount--;\n if (prevBound.IsLower() == true) {\n if (this.TestOverlapBound(oldValues, prevProxy)) {\n this.m_pairManager.RemoveBufferedPair(proxy, prevProxy);\n }\n as3arr = prevProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n else {\n as3arr = prevProxy.upperBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n as3arr = proxy.upperBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.Swap(prevBound);\n index--;\n }\n }\n }\n }\n b2BroadPhase.prototype.UpdatePairs = function (callback) {\n this.m_pairManager.Commit(callback);\n }\n b2BroadPhase.prototype.TestOverlap = function (proxyA, proxyB) {\n var proxyA_ = (proxyA instanceof b2Proxy ? proxyA : null);\n var proxyB_ = (proxyB instanceof b2Proxy ? proxyB : null);\n if (proxyA_.lowerBounds[0] > proxyB_.upperBounds[0]) return false;\n if (proxyB_.lowerBounds[0] > proxyA_.upperBounds[0]) return false;\n if (proxyA_.lowerBounds[1] > proxyB_.upperBounds[1]) return false;\n if (proxyB_.lowerBounds[1] > proxyA_.upperBounds[1]) return false;\n return true;\n }\n b2BroadPhase.prototype.GetUserData = function (proxy) {\n return ((proxy instanceof b2Proxy ? proxy : null)).userData;\n }\n b2BroadPhase.prototype.GetFatAABB = function (proxy_) {\n var aabb = new b2AABB();\n var proxy = (proxy_ instanceof b2Proxy ? proxy_ : null);\n aabb.lowerBound.x = this.m_worldAABB.lowerBound.x + this.m_bounds[0][proxy.lowerBounds[0]].value / this.m_quantizationFactor.x;\n aabb.lowerBound.y = this.m_worldAABB.lowerBound.y + this.m_bounds[1][proxy.lowerBounds[1]].value / this.m_quantizationFactor.y;\n aabb.upperBound.x = this.m_worldAABB.lowerBound.x + this.m_bounds[0][proxy.upperBounds[0]].value / this.m_quantizationFactor.x;\n aabb.upperBound.y = this.m_worldAABB.lowerBound.y + this.m_bounds[1][proxy.upperBounds[1]].value / this.m_quantizationFactor.y;\n return aabb;\n }\n b2BroadPhase.prototype.GetProxyCount = function () {\n return this.m_proxyCount;\n }\n b2BroadPhase.prototype.Query = function (callback, aabb) {\n var lowerValues = new Vector_a2j_Number();\n var upperValues = new Vector_a2j_Number();\n this.ComputeBounds(lowerValues, upperValues, aabb);\n var lowerIndex = 0;\n var upperIndex = 0;\n var lowerIndexOut = new Vector_a2j_Number();\n lowerIndexOut.push(lowerIndex);\n var upperIndexOut = new Vector_a2j_Number();\n upperIndexOut.push(upperIndex);\n this.QueryAxis(lowerIndexOut, upperIndexOut, lowerValues[0], upperValues[0], this.m_bounds[0], 2 * this.m_proxyCount, 0);\n this.QueryAxis(lowerIndexOut, upperIndexOut, lowerValues[1], upperValues[1], this.m_bounds[1], 2 * this.m_proxyCount, 1);\n for (var i = 0; i < this.m_queryResultCount; ++i) {\n var proxy = this.m_queryResults[i];\n if (!callback(proxy)) {\n break;\n }\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n }\n b2BroadPhase.prototype.Validate = function () {\n var pair;\n var proxy1;\n var proxy2;\n var overlap;\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var boundCount = 2 * this.m_proxyCount;\n var stabbingCount = 0;\n for (var i = 0; i < boundCount; ++i) {\n var bound = bounds[i];\n if (bound.IsLower() == true) {\n stabbingCount++;\n }\n else {\n stabbingCount--;\n }\n }\n }\n }\n b2BroadPhase.prototype.Rebalance = function (iterations) {\n if (iterations === undefined) iterations = 0;\n }\n b2BroadPhase.prototype.RayCast = function (callback, input) {\n var subInput = new b2RayCastInput();\n subInput.p1.SetV(input.p1);\n subInput.p2.SetV(input.p2);\n subInput.maxFraction = input.maxFraction;\n var dx = (input.p2.x - input.p1.x) * this.m_quantizationFactor.x;\n var dy = (input.p2.y - input.p1.y) * this.m_quantizationFactor.y;\n var sx = parseInt(dx < (-Number.MIN_VALUE ? (-1) : (dx > Number.MIN_VALUE ? 1 : 0)));\n var sy = parseInt(dy < (-Number.MIN_VALUE ? (-1) : (dy > Number.MIN_VALUE ? 1 : 0)));\n var p1x = this.m_quantizationFactor.x * (input.p1.x - this.m_worldAABB.lowerBound.x);\n var p1y = this.m_quantizationFactor.y * (input.p1.y - this.m_worldAABB.lowerBound.y);\n var startValues = new Array();\n var startValues2 = new Array();\n startValues[0] = a2j.parseUInt(p1x) & (b2Settings.USHRT_MAX - 1);\n startValues[1] = a2j.parseUInt(p1y) & (b2Settings.USHRT_MAX - 1);\n startValues2[0] = startValues[0] + 1;\n startValues2[1] = startValues[1] + 1;\n var startIndices = new Array();\n var xIndex = 0;\n var yIndex = 0;\n var proxy;\n var lowerIndex = 0;\n var upperIndex = 0;\n var lowerIndexOut = new Vector_a2j_Number();\n lowerIndexOut.push(lowerIndex);\n var upperIndexOut = new Vector_a2j_Number();\n upperIndexOut.push(upperIndex);\n this.QueryAxis(lowerIndexOut, upperIndexOut, startValues[0], startValues2[0], this.m_bounds[0], 2 * this.m_proxyCount, 0);\n if (sx >= 0) xIndex = upperIndexOut[0] - 1;\n else xIndex = lowerIndexOut[0];\n this.QueryAxis(lowerIndexOut, upperIndexOut, startValues[1], startValues2[1], this.m_bounds[1], 2 * this.m_proxyCount, 1);\n if (sy >= 0) yIndex = upperIndexOut[0] - 1;\n else yIndex = lowerIndexOut[0];\n for (var i = 0; i < this.m_queryResultCount; i++) {\n subInput.maxFraction = callback(subInput, this.m_queryResults[i]);\n }\n for (;;) {\n var xProgress = 0;\n var yProgress = 0;\n xIndex += sx >= 0 ? 1 : (-1);\n if (xIndex < 0 || xIndex >= this.m_proxyCount * 2) break;\n if (sx != 0) {\n xProgress = (this.m_bounds[0][xIndex].value - p1x) / dx;\n }\n yIndex += sy >= 0 ? 1 : (-1);\n if (yIndex < 0 || yIndex >= this.m_proxyCount * 2) break;\n if (sy != 0) {\n yProgress = (this.m_bounds[1][yIndex].value - p1y) / dy;\n }\n for (;;) {\n if (sy == 0 || (sx != 0 && xProgress < yProgress)) {\n if (xProgress > subInput.maxFraction) break;\n if (sx > 0 ? this.m_bounds[0][xIndex].IsLower() : this.m_bounds[0][xIndex].IsUpper()) {\n proxy = this.m_bounds[0][xIndex].proxy;\n if (sy >= 0) {\n if (proxy.lowerBounds[1] <= yIndex - 1 && proxy.upperBounds[1] >= yIndex) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n else {\n if (proxy.lowerBounds[1] <= yIndex && proxy.upperBounds[1] >= yIndex + 1) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n }\n if (subInput.maxFraction == 0) break;\n if (sx > 0) {\n xIndex++;\n if (xIndex == this.m_proxyCount * 2) break;\n }\n else {\n xIndex--;\n if (xIndex < 0) break;\n }\n xProgress = (this.m_bounds[0][xIndex].value - p1x) / dx;\n }\n else {\n if (yProgress > subInput.maxFraction) break;\n if (sy > 0 ? this.m_bounds[1][yIndex].IsLower() : this.m_bounds[1][yIndex].IsUpper()) {\n proxy = this.m_bounds[1][yIndex].proxy;\n if (sx >= 0) {\n if (proxy.lowerBounds[0] <= xIndex - 1 && proxy.upperBounds[0] >= xIndex) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n else {\n if (proxy.lowerBounds[0] <= xIndex && proxy.upperBounds[0] >= xIndex + 1) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n }\n if (subInput.maxFraction == 0) break;\n if (sy > 0) {\n yIndex++;\n if (yIndex == this.m_proxyCount * 2) break;\n }\n else {\n yIndex--;\n if (yIndex < 0) break;\n }\n yProgress = (this.m_bounds[1][yIndex].value - p1y) / dy;\n }\n }\n break;\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n return;\n }\n b2BroadPhase.prototype.ComputeBounds = function (lowerValues, upperValues, aabb) {\n var minVertexX = aabb.lowerBound.x;\n var minVertexY = aabb.lowerBound.y;\n minVertexX = b2Math.Min(minVertexX, this.m_worldAABB.upperBound.x);\n minVertexY = b2Math.Min(minVertexY, this.m_worldAABB.upperBound.y);\n minVertexX = b2Math.Max(minVertexX, this.m_worldAABB.lowerBound.x);\n minVertexY = b2Math.Max(minVertexY, this.m_worldAABB.lowerBound.y);\n var maxVertexX = aabb.upperBound.x;\n var maxVertexY = aabb.upperBound.y;\n maxVertexX = b2Math.Min(maxVertexX, this.m_worldAABB.upperBound.x);\n maxVertexY = b2Math.Min(maxVertexY, this.m_worldAABB.upperBound.y);\n maxVertexX = b2Math.Max(maxVertexX, this.m_worldAABB.lowerBound.x);\n maxVertexY = b2Math.Max(maxVertexY, this.m_worldAABB.lowerBound.y);\n lowerValues[0] = a2j.parseUInt(this.m_quantizationFactor.x * (minVertexX - this.m_worldAABB.lowerBound.x)) & (b2Settings.USHRT_MAX - 1);\n upperValues[0] = (a2j.parseUInt(this.m_quantizationFactor.x * (maxVertexX - this.m_worldAABB.lowerBound.x)) & 0x0000ffff) | 1;\n lowerValues[1] = a2j.parseUInt(this.m_quantizationFactor.y * (minVertexY - this.m_worldAABB.lowerBound.y)) & (b2Settings.USHRT_MAX - 1);\n upperValues[1] = (a2j.parseUInt(this.m_quantizationFactor.y * (maxVertexY - this.m_worldAABB.lowerBound.y)) & 0x0000ffff) | 1;\n }\n b2BroadPhase.prototype.TestOverlapValidate = function (p1, p2) {\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var bound1 = bounds[p1.lowerBounds[axis]];\n var bound2 = bounds[p2.upperBounds[axis]];\n if (bound1.value > bound2.value) return false;\n bound1 = bounds[p1.upperBounds[axis]];\n bound2 = bounds[p2.lowerBounds[axis]];\n if (bound1.value < bound2.value) return false;\n }\n return true;\n }\n b2BroadPhase.prototype.TestOverlapBound = function (b, p) {\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var bound = bounds[p.upperBounds[axis]];\n if (b.lowerValues[axis] > bound.value) return false;\n bound = bounds[p.lowerBounds[axis]];\n if (b.upperValues[axis] < bound.value) return false;\n }\n return true;\n }\n b2BroadPhase.prototype.QueryAxis = function (lowerQueryOut, upperQueryOut, lowerValue, upperValue, bounds, boundCount, axis) {\n if (lowerValue === undefined) lowerValue = 0;\n if (upperValue === undefined) upperValue = 0;\n if (boundCount === undefined) boundCount = 0;\n if (axis === undefined) axis = 0;\n var lowerQuery = this.BinarySearch(bounds, boundCount, lowerValue);\n var upperQuery = this.BinarySearch(bounds, boundCount, upperValue);\n var bound;\n for (var j = lowerQuery; j < upperQuery; ++j) {\n bound = bounds[j];\n if (bound.IsLower()) {\n this.IncrementOverlapCount(bound.proxy);\n }\n }\n if (lowerQuery > 0) {\n var i = parseInt(lowerQuery - 1);\n bound = bounds[i];\n var s = parseInt(bound.stabbingCount);\n while (s) {\n bound = bounds[i];\n if (bound.IsLower()) {\n var proxy = bound.proxy;\n if (lowerQuery <= proxy.upperBounds[axis]) {\n this.IncrementOverlapCount(bound.proxy);\n --s;\n }\n }--i;\n }\n }\n lowerQueryOut[0] = lowerQuery;\n upperQueryOut[0] = upperQuery;\n }\n b2BroadPhase.prototype.IncrementOverlapCount = function (proxy) {\n if (proxy.timeStamp < this.m_timeStamp) {\n proxy.timeStamp = this.m_timeStamp;\n proxy.overlapCount = 1;\n }\n else {\n proxy.overlapCount = 2;\n this.m_queryResults[this.m_queryResultCount] = proxy;\n ++this.m_queryResultCount;\n }\n }\n b2BroadPhase.prototype.IncrementTimeStamp = function () {\n if (this.m_timeStamp == b2Settings.USHRT_MAX) {\n for (var i = 0; i < this.m_proxyPool.length; ++i) {\n ((this.m_proxyPool[i] instanceof b2Proxy ? this.m_proxyPool[i] : null)).timeStamp = 0;\n }\n this.m_timeStamp = 1;\n }\n else {\n ++this.m_timeStamp;\n }\n }\n b2BroadPhase.prototype.BinarySearch = function (bounds, count, value) {\n if (count === undefined) count = 0;\n if (value === undefined) value = 0;\n var low = 0;\n var high = parseInt(count - 1);\n while (low <= high) {\n var mid = parseInt(((low + high) / 2));\n var bound = bounds[mid];\n if (bound.value > value) {\n high = mid - 1;\n }\n else if (bound.value < value) {\n low = mid + 1;\n }\n else {\n return a2j.parseUInt(mid);\n }\n }\n return a2j.parseUInt(low);\n }\n b2BroadPhase.BinarySearch = b2BroadPhase.prototype.BinarySearch;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2BroadPhase.s_validate = false;\n Box2D.Collision.b2BroadPhase.prototype.s_validate = Box2D.Collision.b2BroadPhase.s_validate;\n Box2D.Collision.b2BroadPhase.b2_invalid = parseInt(b2Settings.USHRT_MAX);\n Box2D.Collision.b2BroadPhase.prototype.b2_invalid = Box2D.Collision.b2BroadPhase.b2_invalid;\n Box2D.Collision.b2BroadPhase.b2_nullEdge = parseInt(b2Settings.USHRT_MAX);\n Box2D.Collision.b2BroadPhase.prototype.b2_nullEdge = Box2D.Collision.b2BroadPhase.b2_nullEdge;\n });\n b2BroadPhase.__implements = {};\n b2BroadPhase.__implements[IBroadPhase] = true;\n b2Collision.b2Collision = function () {};\n b2Collision.prototype.ClipSegmentToLine = function (vOut, vIn, normal, offset) {\n if (offset === undefined) offset = 0;\n var cv;\n var numOut = 0;\n cv = vIn[0];\n var vIn0 = cv.v;\n cv = vIn[1];\n var vIn1 = cv.v;\n var distance0 = normal.x * vIn0.x + normal.y * vIn0.y - offset;\n var distance1 = normal.x * vIn1.x + normal.y * vIn1.y - offset;\n if (distance0 <= 0.0) vOut[numOut++].Set(vIn[0]);\n if (distance1 <= 0.0) vOut[numOut++].Set(vIn[1]);\n if (distance0 * distance1 < 0.0) {\n var interp = distance0 / (distance0 - distance1);\n cv = vOut[numOut];\n var tVec = cv.v;\n tVec.x = vIn0.x + interp * (vIn1.x - vIn0.x);\n tVec.y = vIn0.y + interp * (vIn1.y - vIn0.y);\n cv = vOut[numOut];\n var cv2;\n if (distance0 > 0.0) {\n cv2 = vIn[0];\n cv.id = cv2.id;\n }\n else {\n cv2 = vIn[1];\n cv.id = cv2.id;\n }++numOut;\n }\n return numOut;\n }\n b2Collision.ClipSegmentToLine = b2Collision.prototype.ClipSegmentToLine;\n b2Collision.prototype.EdgeSeparation = function (poly1, xf1, edge1, poly2, xf2) {\n if (edge1 === undefined) edge1 = 0;\n var count1 = parseInt(poly1.m_vertexCount);\n var vertices1 = poly1.m_vertices;\n var normals1 = poly1.m_normals;\n var count2 = parseInt(poly2.m_vertexCount);\n var vertices2 = poly2.m_vertices;\n var tMat;\n var tVec;\n tMat = xf1.R;\n tVec = normals1[edge1];\n var normal1WorldX = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var normal1WorldY = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf2.R;\n var normal1X = (tMat.col1.x * normal1WorldX + tMat.col1.y * normal1WorldY);\n var normal1Y = (tMat.col2.x * normal1WorldX + tMat.col2.y * normal1WorldY);\n var index = 0;\n var minDot = Number.MAX_VALUE;\n for (var i = 0; i < count2; ++i) {\n tVec = vertices2[i];\n var dot = tVec.x * normal1X + tVec.y * normal1Y;\n if (dot < minDot) {\n minDot = dot;\n index = i;\n }\n }\n tVec = vertices1[edge1];\n tMat = xf1.R;\n var v1X = xf1.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var v1Y = xf1.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = vertices2[index];\n tMat = xf2.R;\n var v2X = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var v2Y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n v2X -= v1X;\n v2Y -= v1Y;\n var separation = v2X * normal1WorldX + v2Y * normal1WorldY;\n return separation;\n }\n b2Collision.EdgeSeparation = b2Collision.prototype.EdgeSeparation;\n b2Collision.prototype.FindMaxSeparation = function (edgeIndex, poly1, xf1, poly2, xf2) {\n var count1 = parseInt(poly1.m_vertexCount);\n var normals1 = poly1.m_normals;\n var tVec;\n var tMat;\n tMat = xf2.R;\n tVec = poly2.m_centroid;\n var dX = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var dY = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf1.R;\n tVec = poly1.m_centroid;\n dX -= xf1.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n dY -= xf1.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var dLocal1X = (dX * xf1.R.col1.x + dY * xf1.R.col1.y);\n var dLocal1Y = (dX * xf1.R.col2.x + dY * xf1.R.col2.y);\n var edge = 0;\n var maxDot = (-Number.MAX_VALUE);\n for (var i = 0; i < count1; ++i) {\n tVec = normals1[i];\n var dot = (tVec.x * dLocal1X + tVec.y * dLocal1Y);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n var s = this.EdgeSeparation(poly1, xf1, edge, poly2, xf2);\n var prevEdge = parseInt(edge - 1 >= 0 ? edge - 1 : count1 - 1);\n var sPrev = this.EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n var nextEdge = parseInt(edge + 1 < count1 ? edge + 1 : 0);\n var sNext = this.EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n var bestEdge = 0;\n var bestSeparation = 0;\n var increment = 0;\n if (sPrev > s && sPrev > sNext) {\n increment = (-1);\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s) {\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n }\n else {\n edgeIndex[0] = edge;\n return s;\n }\n while (true) {\n if (increment == (-1)) edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;s = this.EdgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > bestSeparation) {\n bestEdge = edge;\n bestSeparation = s;\n }\n else {\n break;\n }\n }\n edgeIndex[0] = bestEdge;\n return bestSeparation;\n }\n b2Collision.FindMaxSeparation = b2Collision.prototype.FindMaxSeparation;\n b2Collision.prototype.FindIncidentEdge = function (c, poly1, xf1, edge1, poly2, xf2) {\n if (edge1 === undefined) edge1 = 0;\n var count1 = parseInt(poly1.m_vertexCount);\n var normals1 = poly1.m_normals;\n var count2 = parseInt(poly2.m_vertexCount);\n var vertices2 = poly2.m_vertices;\n var normals2 = poly2.m_normals;\n var tMat;\n var tVec;\n tMat = xf1.R;\n tVec = normals1[edge1];\n var normal1X = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var normal1Y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf2.R;\n var tX = (tMat.col1.x * normal1X + tMat.col1.y * normal1Y);\n normal1Y = (tMat.col2.x * normal1X + tMat.col2.y * normal1Y);\n normal1X = tX;\n var index = 0;\n var minDot = Number.MAX_VALUE;\n for (var i = 0; i < count2; ++i) {\n tVec = normals2[i];\n var dot = (normal1X * tVec.x + normal1Y * tVec.y);\n if (dot < minDot) {\n minDot = dot;\n index = i;\n }\n }\n var tClip;\n var i1 = parseInt(index);\n var i2 = parseInt(i1 + 1 < count2 ? i1 + 1 : 0);\n tClip = c[0];\n tVec = vertices2[i1];\n tMat = xf2.R;\n tClip.v.x = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n tClip.v.y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tClip.id.features.referenceEdge = edge1;\n tClip.id.features.incidentEdge = i1;\n tClip.id.features.incidentVertex = 0;\n tClip = c[1];\n tVec = vertices2[i2];\n tMat = xf2.R;\n tClip.v.x = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n tClip.v.y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tClip.id.features.referenceEdge = edge1;\n tClip.id.features.incidentEdge = i2;\n tClip.id.features.incidentVertex = 1;\n }\n b2Collision.FindIncidentEdge = b2Collision.prototype.FindIncidentEdge;\n b2Collision.prototype.MakeClipPointVector = function () {\n var r = new Vector(2);\n r[0] = new ClipVertex();\n r[1] = new ClipVertex();\n return r;\n }\n b2Collision.MakeClipPointVector = b2Collision.prototype.MakeClipPointVector;\n b2Collision.prototype.CollidePolygons = function (manifold, polyA, xfA, polyB, xfB) {\n var cv;\n manifold.m_pointCount = 0;\n var totalRadius = polyA.m_radius + polyB.m_radius;\n var edgeA = 0;\n b2Collision.s_edgeAO[0] = edgeA;\n var separationA = this.FindMaxSeparation(b2Collision.s_edgeAO, polyA, xfA, polyB, xfB);\n edgeA = b2Collision.s_edgeAO[0];\n if (separationA > totalRadius) return;\n var edgeB = 0;\n b2Collision.s_edgeBO[0] = edgeB;\n var separationB = this.FindMaxSeparation(b2Collision.s_edgeBO, polyB, xfB, polyA, xfA);\n edgeB = b2Collision.s_edgeBO[0];\n if (separationB > totalRadius) return;\n var poly1;\n var poly2;\n var xf1;\n var xf2;\n var edge1 = 0;\n var flip = 0;\n var k_relativeTol = 0.98;\n var k_absoluteTol = 0.001;\n var tMat;\n if (separationB > k_relativeTol * separationA + k_absoluteTol) {\n poly1 = polyB;\n poly2 = polyA;\n xf1 = xfB;\n xf2 = xfA;\n edge1 = edgeB;\n manifold.m_type = b2Manifold.e_faceB;\n flip = 1;\n }\n else {\n poly1 = polyA;\n poly2 = polyB;\n xf1 = xfA;\n xf2 = xfB;\n edge1 = edgeA;\n manifold.m_type = b2Manifold.e_faceA;\n flip = 0;\n }\n var incidentEdge = b2Collision.s_incidentEdge;\n this.FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);\n var count1 = parseInt(poly1.m_vertexCount);\n var vertices1 = poly1.m_vertices;\n var local_v11 = vertices1[edge1];\n var local_v12;\n if (edge1 + 1 < count1) {\n local_v12 = vertices1[parseInt(edge1 + 1)];\n }\n else {\n local_v12 = vertices1[0];\n }\n var localTangent = b2Collision.s_localTangent;\n localTangent.Set(local_v12.x - local_v11.x, local_v12.y - local_v11.y);\n localTangent.Normalize();\n var localNormal = b2Collision.s_localNormal;\n localNormal.x = localTangent.y;\n localNormal.y = (-localTangent.x);\n var planePoint = b2Collision.s_planePoint;\n planePoint.Set(0.5 * (local_v11.x + local_v12.x), 0.5 * (local_v11.y + local_v12.y));\n var tangent = b2Collision.s_tangent;\n tMat = xf1.R;\n tangent.x = (tMat.col1.x * localTangent.x + tMat.col2.x * localTangent.y);\n tangent.y = (tMat.col1.y * localTangent.x + tMat.col2.y * localTangent.y);\n var tangent2 = b2Collision.s_tangent2;\n tangent2.x = (-tangent.x);\n tangent2.y = (-tangent.y);\n var normal = b2Collision.s_normal;\n normal.x = tangent.y;\n normal.y = (-tangent.x);\n var v11 = b2Collision.s_v11;\n var v12 = b2Collision.s_v12;\n v11.x = xf1.position.x + (tMat.col1.x * local_v11.x + tMat.col2.x * local_v11.y);\n v11.y = xf1.position.y + (tMat.col1.y * local_v11.x + tMat.col2.y * local_v11.y);\n v12.x = xf1.position.x + (tMat.col1.x * local_v12.x + tMat.col2.x * local_v12.y);\n v12.y = xf1.position.y + (tMat.col1.y * local_v12.x + tMat.col2.y * local_v12.y);\n var frontOffset = normal.x * v11.x + normal.y * v11.y;\n var sideOffset1 = (-tangent.x * v11.x) - tangent.y * v11.y + totalRadius;\n var sideOffset2 = tangent.x * v12.x + tangent.y * v12.y + totalRadius;\n var clipPoints1 = b2Collision.s_clipPoints1;\n var clipPoints2 = b2Collision.s_clipPoints2;\n var np = 0;\n np = this.ClipSegmentToLine(clipPoints1, incidentEdge, tangent2, sideOffset1);\n if (np < 2) return;\n np = this.ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2);\n if (np < 2) return;\n manifold.m_localPlaneNormal.SetV(localNormal);\n manifold.m_localPoint.SetV(planePoint);\n var pointCount = 0;\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; ++i) {\n cv = clipPoints2[i];\n var separation = normal.x * cv.v.x + normal.y * cv.v.y - frontOffset;\n if (separation <= totalRadius) {\n var cp = manifold.m_points[pointCount];\n tMat = xf2.R;\n var tX = cv.v.x - xf2.position.x;\n var tY = cv.v.y - xf2.position.y;\n cp.m_localPoint.x = (tX * tMat.col1.x + tY * tMat.col1.y);\n cp.m_localPoint.y = (tX * tMat.col2.x + tY * tMat.col2.y);\n cp.m_id.Set(cv.id);\n cp.m_id.features.flip = flip;\n ++pointCount;\n }\n }\n manifold.m_pointCount = pointCount;\n }\n b2Collision.CollidePolygons = b2Collision.prototype.CollidePolygons;\n b2Collision.prototype.CollideCircles = function (manifold, circle1, xf1, circle2, xf2) {\n manifold.m_pointCount = 0;\n var tMat;\n var tVec;\n tMat = xf1.R;\n tVec = circle1.m_p;\n var p1X = xf1.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var p1Y = xf1.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf2.R;\n tVec = circle2.m_p;\n var p2X = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var p2Y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var distSqr = dX * dX + dY * dY;\n var radius = circle1.m_radius + circle2.m_radius;\n if (distSqr > radius * radius) {\n return;\n }\n manifold.m_type = b2Manifold.e_circles;\n manifold.m_localPoint.SetV(circle1.m_p);\n manifold.m_localPlaneNormal.SetZero();\n manifold.m_pointCount = 1;\n manifold.m_points[0].m_localPoint.SetV(circle2.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n b2Collision.CollideCircles = b2Collision.prototype.CollideCircles;\n b2Collision.prototype.CollidePolygonAndCircle = function (manifold, polygon, xf1, circle, xf2) {\n manifold.m_pointCount = 0;\n var tPoint;\n var dX = 0;\n var dY = 0;\n var positionX = 0;\n var positionY = 0;\n var tVec;\n var tMat;\n tMat = xf2.R;\n tVec = circle.m_p;\n var cX = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var cY = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n dX = cX - xf1.position.x;\n dY = cY - xf1.position.y;\n tMat = xf1.R;\n var cLocalX = (dX * tMat.col1.x + dY * tMat.col1.y);\n var cLocalY = (dX * tMat.col2.x + dY * tMat.col2.y);\n var dist = 0;\n var normalIndex = 0;\n var separation = (-Number.MAX_VALUE);\n var radius = polygon.m_radius + circle.m_radius;\n var vertexCount = parseInt(polygon.m_vertexCount);\n var vertices = polygon.m_vertices;\n var normals = polygon.m_normals;\n for (var i = 0; i < vertexCount; ++i) {\n tVec = vertices[i];\n dX = cLocalX - tVec.x;\n dY = cLocalY - tVec.y;\n tVec = normals[i];\n var s = tVec.x * dX + tVec.y * dY;\n if (s > radius) {\n return;\n }\n if (s > separation) {\n separation = s;\n normalIndex = i;\n }\n }\n var vertIndex1 = parseInt(normalIndex);\n var vertIndex2 = parseInt(vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0);\n var v1 = vertices[vertIndex1];\n var v2 = vertices[vertIndex2];\n if (separation < Number.MIN_VALUE) {\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.SetV(normals[normalIndex]);\n manifold.m_localPoint.x = 0.5 * (v1.x + v2.x);\n manifold.m_localPoint.y = 0.5 * (v1.y + v2.y);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n return;\n }\n var u1 = (cLocalX - v1.x) * (v2.x - v1.x) + (cLocalY - v1.y) * (v2.y - v1.y);\n var u2 = (cLocalX - v2.x) * (v1.x - v2.x) + (cLocalY - v2.y) * (v1.y - v2.y);\n if (u1 <= 0.0) {\n if ((cLocalX - v1.x) * (cLocalX - v1.x) + (cLocalY - v1.y) * (cLocalY - v1.y) > radius * radius) return;\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.x = cLocalX - v1.x;\n manifold.m_localPlaneNormal.y = cLocalY - v1.y;\n manifold.m_localPlaneNormal.Normalize();\n manifold.m_localPoint.SetV(v1);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n else if (u2 <= 0) {\n if ((cLocalX - v2.x) * (cLocalX - v2.x) + (cLocalY - v2.y) * (cLocalY - v2.y) > radius * radius) return;\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.x = cLocalX - v2.x;\n manifold.m_localPlaneNormal.y = cLocalY - v2.y;\n manifold.m_localPlaneNormal.Normalize();\n manifold.m_localPoint.SetV(v2);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n else {\n var faceCenterX = 0.5 * (v1.x + v2.x);\n var faceCenterY = 0.5 * (v1.y + v2.y);\n separation = (cLocalX - faceCenterX) * normals[vertIndex1].x + (cLocalY - faceCenterY) * normals[vertIndex1].y;\n if (separation > radius) return;\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.x = normals[vertIndex1].x;\n manifold.m_localPlaneNormal.y = normals[vertIndex1].y;\n manifold.m_localPlaneNormal.Normalize();\n manifold.m_localPoint.Set(faceCenterX, faceCenterY);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n }\n b2Collision.CollidePolygonAndCircle = b2Collision.prototype.CollidePolygonAndCircle;\n b2Collision.prototype.TestOverlap = function (a, b) {\n var t1 = b.lowerBound;\n var t2 = a.upperBound;\n var d1X = t1.x - t2.x;\n var d1Y = t1.y - t2.y;\n t1 = a.lowerBound;\n t2 = b.upperBound;\n var d2X = t1.x - t2.x;\n var d2Y = t1.y - t2.y;\n if (d1X > 0.0 || d1Y > 0.0) return false;\n if (d2X > 0.0 || d2Y > 0.0) return false;\n return true;\n }\n b2Collision.TestOverlap = b2Collision.prototype.TestOverlap;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Collision.s_incidentEdge = b2Collision.MakeClipPointVector();\n Box2D.Collision.b2Collision.prototype.s_incidentEdge = Box2D.Collision.b2Collision.s_incidentEdge;\n Box2D.Collision.b2Collision.s_clipPoints1 = b2Collision.MakeClipPointVector();\n Box2D.Collision.b2Collision.prototype.s_clipPoints1 = Box2D.Collision.b2Collision.s_clipPoints1;\n Box2D.Collision.b2Collision.s_clipPoints2 = b2Collision.MakeClipPointVector();\n Box2D.Collision.b2Collision.prototype.s_clipPoints2 = Box2D.Collision.b2Collision.s_clipPoints2;\n Box2D.Collision.b2Collision.s_edgeAO = new Vector_a2j_Number(1);\n Box2D.Collision.b2Collision.prototype.s_edgeAO = Box2D.Collision.b2Collision.s_edgeAO;\n Box2D.Collision.b2Collision.s_edgeBO = new Vector_a2j_Number(1);\n Box2D.Collision.b2Collision.prototype.s_edgeBO = Box2D.Collision.b2Collision.s_edgeBO;\n Box2D.Collision.b2Collision.s_localTangent = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_localTangent = Box2D.Collision.b2Collision.s_localTangent;\n Box2D.Collision.b2Collision.s_localNormal = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_localNormal = Box2D.Collision.b2Collision.s_localNormal;\n Box2D.Collision.b2Collision.s_planePoint = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_planePoint = Box2D.Collision.b2Collision.s_planePoint;\n Box2D.Collision.b2Collision.s_normal = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_normal = Box2D.Collision.b2Collision.s_normal;\n Box2D.Collision.b2Collision.s_tangent = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_tangent = Box2D.Collision.b2Collision.s_tangent;\n Box2D.Collision.b2Collision.s_tangent2 = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_tangent2 = Box2D.Collision.b2Collision.s_tangent2;\n Box2D.Collision.b2Collision.s_v11 = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_v11 = Box2D.Collision.b2Collision.s_v11;\n Box2D.Collision.b2Collision.s_v12 = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_v12 = Box2D.Collision.b2Collision.s_v12;\n Box2D.Collision.b2Collision.b2CollidePolyTempVec = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.b2CollidePolyTempVec = Box2D.Collision.b2Collision.b2CollidePolyTempVec;\n Box2D.Collision.b2Collision.b2_nullFeature = 0x000000ff;\n Box2D.Collision.b2Collision.prototype.b2_nullFeature = Box2D.Collision.b2Collision.b2_nullFeature;\n });\n b2ContactID.b2ContactID = function () {\n this.features = new Features();\n };\n b2ContactID.prototype.b2ContactID = function () {\n this.features._m_id = this;\n }\n b2ContactID.prototype.Set = function (id) {\n this.key = id._key;\n }\n b2ContactID.prototype.Copy = function () {\n var id = new b2ContactID();\n id.key = this.key;\n return id;\n }\n b2ContactID.prototype.__defineGetter__('key', function () {\n return this._key;\n });\n b2ContactID.prototype.__defineSetter__('key', function (value) {\n if (value === undefined) value = 0;\n this._key = value;\n this.features._referenceEdge = this._key & 0x000000ff;\n this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;\n this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;\n this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;\n });\n b2ContactPoint.b2ContactPoint = function () {\n this.position = new b2Vec2();\n this.velocity = new b2Vec2();\n this.normal = new b2Vec2();\n this.id = new b2ContactID();\n };\n b2Distance.b2Distance = function () {};\n b2Distance.prototype.Distance = function (output, cache, input) {\n ++b2Distance.b2_gjkCalls;\n var proxyA = input.proxyA;\n var proxyB = input.proxyB;\n var transformA = input.transformA;\n var transformB = input.transformB;\n var simplex = b2Distance.s_simplex;\n simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB);\n var vertices = simplex.m_vertices;\n var k_maxIters = 20;\n var saveA = b2Distance.s_saveA;\n var saveB = b2Distance.s_saveB;\n var saveCount = 0;\n var closestPoint = simplex.GetClosestPoint();\n var distanceSqr1 = closestPoint.LengthSquared();\n var distanceSqr2 = distanceSqr1;\n var i = 0;\n var p;\n var iter = 0;\n while (iter < k_maxIters) {\n saveCount = simplex.m_count;\n for (i = 0;\n i < saveCount; i++) {\n saveA[i] = vertices[i].indexA;\n saveB[i] = vertices[i].indexB;\n }\n switch (simplex.m_count) {\n case 1:\n break;\n case 2:\n simplex.Solve2();\n break;\n case 3:\n simplex.Solve3();\n break;\n default:\n b2Settings.b2Assert(false);\n }\n if (simplex.m_count == 3) {\n break;\n }\n p = simplex.GetClosestPoint();\n distanceSqr2 = p.LengthSquared();\n if (distanceSqr2 > distanceSqr1) {}\n distanceSqr1 = distanceSqr2;\n var d = simplex.GetSearchDirection();\n if (d.LengthSquared() < Number.MIN_VALUE * Number.MIN_VALUE) {\n break;\n }\n var vertex = vertices[simplex.m_count];\n vertex.indexA = proxyA.GetSupport(b2Math.MulTMV(transformA.R, d.GetNegative()));\n vertex.wA = b2Math.MulX(transformA, proxyA.GetVertex(vertex.indexA));\n vertex.indexB = proxyB.GetSupport(b2Math.MulTMV(transformB.R, d));\n vertex.wB = b2Math.MulX(transformB, proxyB.GetVertex(vertex.indexB));\n vertex.w = b2Math.SubtractVV(vertex.wB, vertex.wA);\n ++iter;\n ++b2Distance.b2_gjkIters;\n var duplicate = false;\n for (i = 0;\n i < saveCount; i++) {\n if (vertex.indexA == saveA[i] && vertex.indexB == saveB[i]) {\n duplicate = true;\n break;\n }\n }\n if (duplicate) {\n break;\n }++simplex.m_count;\n }\n b2Distance.b2_gjkMaxIters = b2Math.Max(b2Distance.b2_gjkMaxIters, iter);\n simplex.GetWitnessPoints(output.pointA, output.pointB);\n output.distance = b2Math.SubtractVV(output.pointA, output.pointB).Length();\n output.iterations = iter;\n simplex.WriteCache(cache);\n if (input.useRadii) {\n var rA = proxyA.m_radius;\n var rB = proxyB.m_radius;\n if (output.distance > rA + rB && output.distance > Number.MIN_VALUE) {\n output.distance -= rA + rB;\n var normal = b2Math.SubtractVV(output.pointB, output.pointA);\n normal.Normalize();\n output.pointA.x += rA * normal.x;\n output.pointA.y += rA * normal.y;\n output.pointB.x -= rB * normal.x;\n output.pointB.y -= rB * normal.y;\n }\n else {\n p = new b2Vec2();\n p.x = .5 * (output.pointA.x + output.pointB.x);\n p.y = .5 * (output.pointA.y + output.pointB.y);\n output.pointA.x = output.pointB.x = p.x;\n output.pointA.y = output.pointB.y = p.y;\n output.distance = 0.0;\n }\n }\n }\n b2Distance.Distance = b2Distance.prototype.Distance;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Distance.s_simplex = new b2Simplex();\n Box2D.Collision.b2Distance.prototype.s_simplex = Box2D.Collision.b2Distance.s_simplex;\n Box2D.Collision.b2Distance.s_saveA = new Vector_a2j_Number(3);\n Box2D.Collision.b2Distance.prototype.s_saveA = Box2D.Collision.b2Distance.s_saveA;\n Box2D.Collision.b2Distance.s_saveB = new Vector_a2j_Number(3);\n Box2D.Collision.b2Distance.prototype.s_saveB = Box2D.Collision.b2Distance.s_saveB;\n });\n b2DistanceInput.b2DistanceInput = function () {};\n b2DistanceOutput.b2DistanceOutput = function () {\n this.pointA = new b2Vec2();\n this.pointB = new b2Vec2();\n };\n b2DistanceProxy.b2DistanceProxy = function () {};\n b2DistanceProxy.prototype.Set = function (shape) {\n switch (shape.GetType()) {\n case b2Shape.e_circleShape:\n {\n var circle = (shape instanceof b2CircleShape ? shape : null);\n this.m_vertices = new Vector(1, true);\n this.m_vertices[0] = circle.m_p;\n this.m_count = 1;\n this.m_radius = circle.m_radius;\n }\n break;\n case b2Shape.e_polygonShape:\n {\n var polygon = (shape instanceof b2PolygonShape ? shape : null);\n this.m_vertices = polygon.m_vertices;\n this.m_count = polygon.m_vertexCount;\n this.m_radius = polygon.m_radius;\n }\n break;\n default:\n b2Settings.b2Assert(false);\n }\n }\n b2DistanceProxy.prototype.GetSupport = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_count; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return bestIndex;\n }\n b2DistanceProxy.prototype.GetSupportVertex = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_count; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return this.m_vertices[bestIndex];\n }\n b2DistanceProxy.prototype.GetVertexCount = function () {\n return this.m_count;\n }\n b2DistanceProxy.prototype.GetVertex = function (index) {\n if (index === undefined) index = 0;\n b2Settings.b2Assert(0 <= index && index < this.m_count);\n return this.m_vertices[index];\n }\n b2DynamicTree.b2DynamicTree = function () {};\n b2DynamicTree.prototype.b2DynamicTree = function () {\n this.m_root = null;\n this.m_freeList = null;\n this.m_path = 0;\n this.m_insertionCount = 0;\n }\n b2DynamicTree.prototype.CreateProxy = function (aabb, userData) {\n var node = this.AllocateNode();\n var extendX = b2Settings.b2_aabbExtension;\n var extendY = b2Settings.b2_aabbExtension;\n node.aabb.lowerBound.x = aabb.lowerBound.x - extendX;\n node.aabb.lowerBound.y = aabb.lowerBound.y - extendY;\n node.aabb.upperBound.x = aabb.upperBound.x + extendX;\n node.aabb.upperBound.y = aabb.upperBound.y + extendY;\n node.userData = userData;\n this.InsertLeaf(node);\n return node;\n }\n b2DynamicTree.prototype.DestroyProxy = function (proxy) {\n this.RemoveLeaf(proxy);\n this.FreeNode(proxy);\n }\n b2DynamicTree.prototype.MoveProxy = function (proxy, aabb, displacement) {\n b2Settings.b2Assert(proxy.IsLeaf());\n if (proxy.aabb.Contains(aabb)) {\n return false;\n }\n this.RemoveLeaf(proxy);\n var extendX = b2Settings.b2_aabbExtension + b2Settings.b2_aabbMultiplier * (displacement.x > 0 ? displacement.x : (-displacement.x));\n var extendY = b2Settings.b2_aabbExtension + b2Settings.b2_aabbMultiplier * (displacement.y > 0 ? displacement.y : (-displacement.y));\n proxy.aabb.lowerBound.x = aabb.lowerBound.x - extendX;\n proxy.aabb.lowerBound.y = aabb.lowerBound.y - extendY;\n proxy.aabb.upperBound.x = aabb.upperBound.x + extendX;\n proxy.aabb.upperBound.y = aabb.upperBound.y + extendY;\n this.InsertLeaf(proxy);\n return true;\n }\n b2DynamicTree.prototype.Rebalance = function (iterations) {\n if (iterations === undefined) iterations = 0;\n if (this.m_root == null) return;\n for (var i = 0; i < iterations; i++) {\n var node = this.m_root;\n var bit = 0;\n while (node.IsLeaf() == false) {\n node = (this.m_path >> bit) & 1 ? node.child2 : node.child1;\n bit = (bit + 1) & 31;\n }++this.m_path;\n this.RemoveLeaf(node);\n this.InsertLeaf(node);\n }\n }\n b2DynamicTree.prototype.GetFatAABB = function (proxy) {\n return proxy.aabb;\n }\n b2DynamicTree.prototype.GetUserData = function (proxy) {\n return proxy.userData;\n }\n b2DynamicTree.prototype.Query = function (callback, aabb) {\n if (this.m_root == null) return;\n var stack = new Vector();\n var count = 0;\n stack[count++] = this.m_root;\n while (count > 0) {\n var node = stack[--count];\n if (node.aabb.TestOverlap(aabb)) {\n if (node.IsLeaf()) {\n var proceed = callback(node);\n if (!proceed) return;\n }\n else {\n stack[count++] = node.child1;\n stack[count++] = node.child2;\n }\n }\n }\n }\n b2DynamicTree.prototype.RayCast = function (callback, input) {\n if (this.m_root == null) return;\n var p1 = input.p1;\n var p2 = input.p2;\n var r = b2Math.SubtractVV(p1, p2);\n r.Normalize();\n var v = b2Math.CrossFV(1.0, r);\n var abs_v = b2Math.AbsV(v);\n var maxFraction = input.maxFraction;\n var segmentAABB = new b2AABB();\n var tX = 0;\n var tY = 0; {\n tX = p1.x + maxFraction * (p2.x - p1.x);\n tY = p1.y + maxFraction * (p2.y - p1.y);\n segmentAABB.lowerBound.x = Math.min(p1.x, tX);\n segmentAABB.lowerBound.y = Math.min(p1.y, tY);\n segmentAABB.upperBound.x = Math.max(p1.x, tX);\n segmentAABB.upperBound.y = Math.max(p1.y, tY);\n }\n var stack = new Vector();\n var count = 0;\n stack[count++] = this.m_root;\n while (count > 0) {\n var node = stack[--count];\n if (node.aabb.TestOverlap(segmentAABB) == false) {\n continue;\n }\n var c = node.aabb.GetCenter();\n var h = node.aabb.GetExtents();\n var separation = Math.abs(v.x * (p1.x - c.x) + v.y * (p1.y - c.y)) - abs_v.x * h.x - abs_v.y * h.y;\n if (separation > 0.0) continue;\n if (node.IsLeaf()) {\n var subInput = new b2RayCastInput();\n subInput.p1 = input.p1;\n subInput.p2 = input.p2;\n subInput.maxFraction = input.maxFraction;\n maxFraction = callback(subInput, node);\n if (maxFraction == 0.0) return;\n if (maxFraction > 0.0) {\n tX = p1.x + maxFraction * (p2.x - p1.x);\n tY = p1.y + maxFraction * (p2.y - p1.y);\n segmentAABB.lowerBound.x = Math.min(p1.x, tX);\n segmentAABB.lowerBound.y = Math.min(p1.y, tY);\n segmentAABB.upperBound.x = Math.max(p1.x, tX);\n segmentAABB.upperBound.y = Math.max(p1.y, tY);\n }\n }\n else {\n stack[count++] = node.child1;\n stack[count++] = node.child2;\n }\n }\n }\n b2DynamicTree.prototype.AllocateNode = function () {\n if (this.m_freeList) {\n var node = this.m_freeList;\n this.m_freeList = node.parent;\n node.parent = null;\n node.child1 = null;\n node.child2 = null;\n return node;\n }\n return new b2DynamicTreeNode();\n }\n b2DynamicTree.prototype.FreeNode = function (node) {\n node.parent = this.m_freeList;\n this.m_freeList = node;\n }\n b2DynamicTree.prototype.InsertLeaf = function (leaf) {\n ++this.m_insertionCount;\n if (this.m_root == null) {\n this.m_root = leaf;\n this.m_root.parent = null;\n return;\n }\n var center = leaf.aabb.GetCenter();\n var sibling = this.m_root;\n if (sibling.IsLeaf() == false) {\n do {\n var child1 = sibling.child1;\n var child2 = sibling.child2;\n var norm1 = Math.abs((child1.aabb.lowerBound.x + child1.aabb.upperBound.x) / 2 - center.x) + Math.abs((child1.aabb.lowerBound.y + child1.aabb.upperBound.y) / 2 - center.y);\n var norm2 = Math.abs((child2.aabb.lowerBound.x + child2.aabb.upperBound.x) / 2 - center.x) + Math.abs((child2.aabb.lowerBound.y + child2.aabb.upperBound.y) / 2 - center.y);\n if (norm1 < norm2) {\n sibling = child1;\n }\n else {\n sibling = child2;\n }\n }\n while (sibling.IsLeaf() == false)\n }\n var node1 = sibling.parent;\n var node2 = this.AllocateNode();\n node2.parent = node1;\n node2.userData = null;\n node2.aabb.Combine(leaf.aabb, sibling.aabb);\n if (node1) {\n if (sibling.parent.child1 == sibling) {\n node1.child1 = node2;\n }\n else {\n node1.child2 = node2;\n }\n node2.child1 = sibling;\n node2.child2 = leaf;\n sibling.parent = node2;\n leaf.parent = node2;\n do {\n if (node1.aabb.Contains(node2.aabb)) break;\n node1.aabb.Combine(node1.child1.aabb, node1.child2.aabb);\n node2 = node1;\n node1 = node1.parent;\n }\n while (node1)\n }\n else {\n node2.child1 = sibling;\n node2.child2 = leaf;\n sibling.parent = node2;\n leaf.parent = node2;\n this.m_root = node2;\n }\n }\n b2DynamicTree.prototype.RemoveLeaf = function (leaf) {\n if (leaf == this.m_root) {\n this.m_root = null;\n return;\n }\n var node2 = leaf.parent;\n var node1 = node2.parent;\n var sibling;\n if (node2.child1 == leaf) {\n sibling = node2.child2;\n }\n else {\n sibling = node2.child1;\n }\n if (node1) {\n if (node1.child1 == node2) {\n node1.child1 = sibling;\n }\n else {\n node1.child2 = sibling;\n }\n sibling.parent = node1;\n this.FreeNode(node2);\n while (node1) {\n var oldAABB = node1.aabb;\n node1.aabb = b2AABB.Combine(node1.child1.aabb, node1.child2.aabb);\n if (oldAABB.Contains(node1.aabb)) break;\n node1 = node1.parent;\n }\n }\n else {\n this.m_root = sibling;\n sibling.parent = null;\n this.FreeNode(node2);\n }\n }\n b2DynamicTreeBroadPhase.b2DynamicTreeBroadPhase = function () {\n this.m_tree = new b2DynamicTree();\n this.m_moveBuffer = new Vector();\n this.m_pairBuffer = new Vector();\n this.m_pairCount = 0;\n };\n b2DynamicTreeBroadPhase.prototype.CreateProxy = function (aabb, userData) {\n var proxy = this.m_tree.CreateProxy(aabb, userData);\n ++this.m_proxyCount;\n this.BufferMove(proxy);\n return proxy;\n }\n b2DynamicTreeBroadPhase.prototype.DestroyProxy = function (proxy) {\n this.UnBufferMove(proxy);\n --this.m_proxyCount;\n this.m_tree.DestroyProxy(proxy);\n }\n b2DynamicTreeBroadPhase.prototype.MoveProxy = function (proxy, aabb, displacement) {\n var buffer = this.m_tree.MoveProxy(proxy, aabb, displacement);\n if (buffer) {\n this.BufferMove(proxy);\n }\n }\n b2DynamicTreeBroadPhase.prototype.TestOverlap = function (proxyA, proxyB) {\n var aabbA = this.m_tree.GetFatAABB(proxyA);\n var aabbB = this.m_tree.GetFatAABB(proxyB);\n return aabbA.TestOverlap(aabbB);\n }\n b2DynamicTreeBroadPhase.prototype.GetUserData = function (proxy) {\n return this.m_tree.GetUserData(proxy);\n }\n b2DynamicTreeBroadPhase.prototype.GetFatAABB = function (proxy) {\n return this.m_tree.GetFatAABB(proxy);\n }\n b2DynamicTreeBroadPhase.prototype.GetProxyCount = function () {\n return this.m_proxyCount;\n }\n b2DynamicTreeBroadPhase.prototype.UpdatePairs = function (callback) {\n var __this = this;\n __this.m_pairCount = 0;\n var queryProxy;\n\n var len = __this.m_moveBuffer.length\n for (var i=0; i < len; i++) {\n queryProxy = __this.m_moveBuffer[i]; {\n function QueryCallback(proxy) {\n if (proxy == queryProxy) return true;\n if (__this.m_pairCount == __this.m_pairBuffer.length) {\n __this.m_pairBuffer[__this.m_pairCount] = new b2DynamicTreePair();\n }\n var pair = __this.m_pairBuffer[__this.m_pairCount];\n pair.proxyA = proxy < queryProxy ? proxy : queryProxy;\n pair.proxyB = proxy >= queryProxy ? proxy : queryProxy;++__this.m_pairCount;\n return true;\n };\n var fatAABB = __this.m_tree.GetFatAABB(queryProxy);\n __this.m_tree.Query(QueryCallback, fatAABB);\n }\n }\n __this.m_moveBuffer.length = 0;\n for (var i = 0; i < __this.m_pairCount;) {\n var primaryPair = __this.m_pairBuffer[i];\n var userDataA = __this.m_tree.GetUserData(primaryPair.proxyA);\n var userDataB = __this.m_tree.GetUserData(primaryPair.proxyB);\n callback(userDataA, userDataB);\n ++i;\n while (i < __this.m_pairCount) {\n var pair = __this.m_pairBuffer[i];\n if (pair.proxyA != primaryPair.proxyA || pair.proxyB != primaryPair.proxyB) {\n break;\n }++i;\n }\n }\n }\n b2DynamicTreeBroadPhase.prototype.Query = function (callback, aabb) {\n this.m_tree.Query(callback, aabb);\n }\n b2DynamicTreeBroadPhase.prototype.RayCast = function (callback, input) {\n this.m_tree.RayCast(callback, input);\n }\n b2DynamicTreeBroadPhase.prototype.Validate = function () {}\n b2DynamicTreeBroadPhase.prototype.Rebalance = function (iterations) {\n if (iterations === undefined) iterations = 0;\n this.m_tree.Rebalance(iterations);\n }\n b2DynamicTreeBroadPhase.prototype.BufferMove = function (proxy) {\n this.m_moveBuffer[this.m_moveBuffer.length] = proxy;\n }\n b2DynamicTreeBroadPhase.prototype.UnBufferMove = function (proxy) {\n var i = parseInt(this.m_moveBuffer.indexOf(proxy));\n this.m_moveBuffer.splice(i, 1);\n }\n b2DynamicTreeBroadPhase.prototype.ComparePairs = function (pair1, pair2) {\n return 0;\n }\n b2DynamicTreeBroadPhase.__implements = {};\n b2DynamicTreeBroadPhase.__implements[IBroadPhase] = true;\n b2DynamicTreeNode.b2DynamicTreeNode = function () {\n this.aabb = new b2AABB();\n };\n b2DynamicTreeNode.prototype.IsLeaf = function () {\n return this.child1 == null;\n }\n b2DynamicTreePair.b2DynamicTreePair = function () {};\n b2Manifold.b2Manifold = function () {\n this.m_pointCount = 0;\n };\n b2Manifold.prototype.b2Manifold = function () {\n this.m_points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.m_points[i] = new b2ManifoldPoint();\n }\n this.m_localPlaneNormal = new b2Vec2();\n this.m_localPoint = new b2Vec2();\n }\n b2Manifold.prototype.Reset = function () {\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n ((this.m_points[i] instanceof b2ManifoldPoint ? this.m_points[i] : null)).Reset();\n }\n this.m_localPlaneNormal.SetZero();\n this.m_localPoint.SetZero();\n this.m_type = 0;\n this.m_pointCount = 0;\n }\n b2Manifold.prototype.Set = function (m) {\n this.m_pointCount = m.m_pointCount;\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n ((this.m_points[i] instanceof b2ManifoldPoint ? this.m_points[i] : null)).Set(m.m_points[i]);\n }\n this.m_localPlaneNormal.SetV(m.m_localPlaneNormal);\n this.m_localPoint.SetV(m.m_localPoint);\n this.m_type = m.m_type;\n }\n b2Manifold.prototype.Copy = function () {\n var copy = new b2Manifold();\n copy.Set(this);\n return copy;\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Manifold.e_circles = 0x0001;\n Box2D.Collision.b2Manifold.prototype.e_circles = Box2D.Collision.b2Manifold.e_circles;\n Box2D.Collision.b2Manifold.e_faceA = 0x0002;\n Box2D.Collision.b2Manifold.prototype.e_faceA = Box2D.Collision.b2Manifold.e_faceA;\n Box2D.Collision.b2Manifold.e_faceB = 0x0004;\n Box2D.Collision.b2Manifold.prototype.e_faceB = Box2D.Collision.b2Manifold.e_faceB;\n });\n b2ManifoldPoint.b2ManifoldPoint = function () {\n this.m_localPoint = new b2Vec2();\n this.m_id = new b2ContactID();\n };\n b2ManifoldPoint.prototype.b2ManifoldPoint = function () {\n this.Reset();\n }\n b2ManifoldPoint.prototype.Reset = function () {\n this.m_localPoint.SetZero();\n this.m_normalImpulse = 0.0;\n this.m_tangentImpulse = 0.0;\n this.m_id.key = 0;\n }\n b2ManifoldPoint.prototype.Set = function (m) {\n this.m_localPoint.SetV(m.m_localPoint);\n this.m_normalImpulse = m.m_normalImpulse;\n this.m_tangentImpulse = m.m_tangentImpulse;\n this.m_id.Set(m.m_id);\n }\n b2OBB.b2OBB = function () {\n this.R = new b2Mat22();\n this.center = new b2Vec2();\n this.extents = new b2Vec2();\n };\n b2Pair.b2Pair = function () {\n this.userData = null;\n };\n b2Pair.prototype.SetBuffered = function () {\n this.status |= b2Pair.e_pairBuffered;\n }\n b2Pair.prototype.ClearBuffered = function () {\n this.status &= ~b2Pair.e_pairBuffered;\n }\n b2Pair.prototype.IsBuffered = function () {\n return (this.status & b2Pair.e_pairBuffered) == b2Pair.e_pairBuffered;\n }\n b2Pair.prototype.SetRemoved = function () {\n this.status |= b2Pair.e_pairRemoved;\n }\n b2Pair.prototype.ClearRemoved = function () {\n this.status &= ~b2Pair.e_pairRemoved;\n }\n b2Pair.prototype.IsRemoved = function () {\n return (this.status & b2Pair.e_pairRemoved) == b2Pair.e_pairRemoved;\n }\n b2Pair.prototype.SetFinal = function () {\n this.status |= b2Pair.e_pairFinal;\n }\n b2Pair.prototype.IsFinal = function () {\n return (this.status & b2Pair.e_pairFinal) == b2Pair.e_pairFinal;\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Pair.b2_nullProxy = parseInt(b2Settings.USHRT_MAX);\n Box2D.Collision.b2Pair.prototype.b2_nullProxy = Box2D.Collision.b2Pair.b2_nullProxy;\n Box2D.Collision.b2Pair.e_pairBuffered = 0x0001;\n Box2D.Collision.b2Pair.prototype.e_pairBuffered = Box2D.Collision.b2Pair.e_pairBuffered;\n Box2D.Collision.b2Pair.e_pairRemoved = 0x0002;\n Box2D.Collision.b2Pair.prototype.e_pairRemoved = Box2D.Collision.b2Pair.e_pairRemoved;\n Box2D.Collision.b2Pair.e_pairFinal = 0x0004;\n Box2D.Collision.b2Pair.prototype.e_pairFinal = Box2D.Collision.b2Pair.e_pairFinal;\n });\n b2PairManager.b2PairManager = function () {};\n b2PairManager.prototype.b2PairManager = function () {\n this.m_pairs = new Array();\n this.m_pairBuffer = new Array();\n this.m_pairCount = 0;\n this.m_pairBufferCount = 0;\n this.m_freePair = null;\n }\n b2PairManager.prototype.Initialize = function (broadPhase) {\n this.m_broadPhase = broadPhase;\n }\n b2PairManager.prototype.AddBufferedPair = function (proxy1, proxy2) {\n var pair = this.AddPair(proxy1, proxy2);\n if (pair.IsBuffered() == false) {\n pair.SetBuffered();\n this.m_pairBuffer[this.m_pairBufferCount] = pair;\n ++this.m_pairBufferCount;\n }\n pair.ClearRemoved();\n if (b2BroadPhase.s_validate) {\n this.ValidateBuffer();\n }\n }\n b2PairManager.prototype.RemoveBufferedPair = function (proxy1, proxy2) {\n var pair = this.Find(proxy1, proxy2);\n if (pair == null) {\n return;\n }\n if (pair.IsBuffered() == false) {\n pair.SetBuffered();\n this.m_pairBuffer[this.m_pairBufferCount] = pair;\n ++this.m_pairBufferCount;\n }\n pair.SetRemoved();\n if (b2BroadPhase.s_validate) {\n this.ValidateBuffer();\n }\n }\n b2PairManager.prototype.Commit = function (callback) {\n var i = 0;\n var removeCount = 0;\n for (i = 0;\n i < this.m_pairBufferCount; ++i) {\n var pair = this.m_pairBuffer[i];\n pair.ClearBuffered();\n var proxy1 = pair.proxy1;\n var proxy2 = pair.proxy2;\n if (pair.IsRemoved()) {} else {\n if (pair.IsFinal() == false) {\n callback(proxy1.userData, proxy2.userData);\n }\n }\n }\n this.m_pairBufferCount = 0;\n if (b2BroadPhase.s_validate) {\n this.ValidateTable();\n }\n }\n b2PairManager.prototype.AddPair = function (proxy1, proxy2) {\n var pair = proxy1.pairs[proxy2];\n if (pair != null) return pair;\n if (this.m_freePair == null) {\n this.m_freePair = new b2Pair();\n this.m_pairs.push(this.m_freePair);\n }\n pair = this.m_freePair;\n this.m_freePair = pair.next;\n pair.proxy1 = proxy1;\n pair.proxy2 = proxy2;\n pair.status = 0;\n pair.userData = null;\n pair.next = null;\n proxy1.pairs[proxy2] = pair;\n proxy2.pairs[proxy1] = pair;\n ++this.m_pairCount;\n return pair;\n }\n b2PairManager.prototype.RemovePair = function (proxy1, proxy2) {\n var pair = proxy1.pairs[proxy2];\n if (pair == null) {\n return null;\n }\n var userData = pair.userData;\n delete proxy1.pairs[proxy2];\n delete proxy2.pairs[proxy1];\n pair.next = this.m_freePair;\n pair.proxy1 = null;\n pair.proxy2 = null;\n pair.userData = null;\n pair.status = 0;\n this.m_freePair = pair;\n --this.m_pairCount;\n return userData;\n }\n b2PairManager.prototype.Find = function (proxy1, proxy2) {\n return proxy1.pairs[proxy2];\n }\n b2PairManager.prototype.ValidateBuffer = function () {}\n b2PairManager.prototype.ValidateTable = function () {}\n b2Point.b2Point = function () {\n this.p = new b2Vec2();\n };\n b2Point.prototype.Support = function (xf, vX, vY) {\n if (vX === undefined) vX = 0;\n if (vY === undefined) vY = 0;\n return this.p;\n }\n b2Point.prototype.GetFirstVertex = function (xf) {\n return this.p;\n }\n b2Proxy.b2Proxy = function () {\n this.lowerBounds = new Vector_a2j_Number(2);\n this.upperBounds = new Vector_a2j_Number(2);\n this.pairs = new Dictionary();\n this.userData = null;\n };\n b2Proxy.prototype.IsValid = function () {\n return this.overlapCount != b2BroadPhase.b2_invalid;\n }\n b2RayCastInput.b2RayCastInput = function () {\n this.p1 = new b2Vec2();\n this.p2 = new b2Vec2();\n };\n b2RayCastInput.prototype.b2RayCastInput = function (p1, p2, maxFraction) {\n if (p1 === undefined) p1 = null;\n if (p2 === undefined) p2 = null;\n if (maxFraction === undefined) maxFraction = 1;\n if (p1) this.p1.SetV(p1);\n if (p2) this.p2.SetV(p2);\n this.maxFraction = maxFraction;\n }\n b2RayCastOutput.b2RayCastOutput = function () {\n this.normal = new b2Vec2();\n };\n b2Segment.b2Segment = function () {\n this.p1 = new b2Vec2();\n this.p2 = new b2Vec2();\n };\n b2Segment.prototype.TestSegment = function (lambda, normal, segment, maxLambda) {\n if (maxLambda === undefined) maxLambda = 0;\n var s = segment.p1;\n var rX = segment.p2.x - s.x;\n var rY = segment.p2.y - s.y;\n var dX = this.p2.x - this.p1.x;\n var dY = this.p2.y - this.p1.y;\n var nX = dY;\n var nY = (-dX);\n var k_slop = 100.0 * Number.MIN_VALUE;\n var denom = (-(rX * nX + rY * nY));\n if (denom > k_slop) {\n var bX = s.x - this.p1.x;\n var bY = s.y - this.p1.y;\n var a = (bX * nX + bY * nY);\n if (0.0 <= a && a <= maxLambda * denom) {\n var mu2 = (-rX * bY) + rY * bX;\n if ((-k_slop * denom) <= mu2 && mu2 <= denom * (1.0 + k_slop)) {\n a /= denom;\n var nLen = Math.sqrt(nX * nX + nY * nY);\n nX /= nLen;\n nY /= nLen;\n lambda[0] = a;\n normal.Set(nX, nY);\n return true;\n }\n }\n }\n return false;\n }\n b2Segment.prototype.Extend = function (aabb) {\n this.ExtendForward(aabb);\n this.ExtendBackward(aabb);\n }\n b2Segment.prototype.ExtendForward = function (aabb) {\n var dX = this.p2.x - this.p1.x;\n var dY = this.p2.y - this.p1.y;\n var lambda = Math.min(dX > 0 ? (aabb.upperBound.x - this.p1.x) / dX : dX < 0 ? (aabb.lowerBound.x - this.p1.x) / dX : Number.POSITIVE_INFINITY,\n dY > 0 ? (aabb.upperBound.y - this.p1.y) / dY : dY < 0 ? (aabb.lowerBound.y - this.p1.y) / dY : Number.POSITIVE_INFINITY);\n this.p2.x = this.p1.x + dX * lambda;\n this.p2.y = this.p1.y + dY * lambda;\n }\n b2Segment.prototype.ExtendBackward = function (aabb) {\n var dX = (-this.p2.x) + this.p1.x;\n var dY = (-this.p2.y) + this.p1.y;\n var lambda = Math.min(dX > 0 ? (aabb.upperBound.x - this.p2.x) / dX : dX < 0 ? (aabb.lowerBound.x - this.p2.x) / dX : Number.POSITIVE_INFINITY,\n dY > 0 ? (aabb.upperBound.y - this.p2.y) / dY : dY < 0 ? (aabb.lowerBound.y - this.p2.y) / dY : Number.POSITIVE_INFINITY);\n this.p1.x = this.p2.x + dX * lambda;\n this.p1.y = this.p2.y + dY * lambda;\n }\n b2SeparationFunction.b2SeparationFunction = function () {\n this.m_localPoint = new b2Vec2();\n this.m_axis = new b2Vec2();\n };\n b2SeparationFunction.prototype.Initialize = function (cache, proxyA, transformA, proxyB, transformB) {\n this.m_proxyA = proxyA;\n this.m_proxyB = proxyB;\n var count = parseInt(cache.count);\n b2Settings.b2Assert(0 < count && count < 3);\n var localPointA;\n var localPointA1;\n var localPointA2;\n var localPointB;\n var localPointB1;\n var localPointB2;\n var pointAX = 0;\n var pointAY = 0;\n var pointBX = 0;\n var pointBY = 0;\n var normalX = 0;\n var normalY = 0;\n var tMat;\n var tVec;\n var s = 0;\n var sgn = 0;\n if (count == 1) {\n this.m_type = b2SeparationFunction.e_points;\n localPointA = this.m_proxyA.GetVertex(cache.indexA[0]);\n localPointB = this.m_proxyB.GetVertex(cache.indexB[0]);\n tVec = localPointA;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointB;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_axis.x = pointBX - pointAX;\n this.m_axis.y = pointBY - pointAY;\n this.m_axis.Normalize();\n }\n else if (cache.indexB[0] == cache.indexB[1]) {\n this.m_type = b2SeparationFunction.e_faceA;\n localPointA1 = this.m_proxyA.GetVertex(cache.indexA[0]);\n localPointA2 = this.m_proxyA.GetVertex(cache.indexA[1]);\n localPointB = this.m_proxyB.GetVertex(cache.indexB[0]);\n this.m_localPoint.x = 0.5 * (localPointA1.x + localPointA2.x);\n this.m_localPoint.y = 0.5 * (localPointA1.y + localPointA2.y);\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointA2, localPointA1), 1.0);\n this.m_axis.Normalize();\n tVec = this.m_axis;\n tMat = transformA.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointB;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n s = (pointBX - pointAX) * normalX + (pointBY - pointAY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n else if (cache.indexA[0] == cache.indexA[0]) {\n this.m_type = b2SeparationFunction.e_faceB;\n localPointB1 = this.m_proxyB.GetVertex(cache.indexB[0]);\n localPointB2 = this.m_proxyB.GetVertex(cache.indexB[1]);\n localPointA = this.m_proxyA.GetVertex(cache.indexA[0]);\n this.m_localPoint.x = 0.5 * (localPointB1.x + localPointB2.x);\n this.m_localPoint.y = 0.5 * (localPointB1.y + localPointB2.y);\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointB2, localPointB1), 1.0);\n this.m_axis.Normalize();\n tVec = this.m_axis;\n tMat = transformB.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointA;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n s = (pointAX - pointBX) * normalX + (pointAY - pointBY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n else {\n localPointA1 = this.m_proxyA.GetVertex(cache.indexA[0]);\n localPointA2 = this.m_proxyA.GetVertex(cache.indexA[1]);\n localPointB1 = this.m_proxyB.GetVertex(cache.indexB[0]);\n localPointB2 = this.m_proxyB.GetVertex(cache.indexB[1]);\n var pA = b2Math.MulX(transformA, localPointA);\n var dA = b2Math.MulMV(transformA.R, b2Math.SubtractVV(localPointA2, localPointA1));\n var pB = b2Math.MulX(transformB, localPointB);\n var dB = b2Math.MulMV(transformB.R, b2Math.SubtractVV(localPointB2, localPointB1));\n var a = dA.x * dA.x + dA.y * dA.y;\n var e = dB.x * dB.x + dB.y * dB.y;\n var r = b2Math.SubtractVV(dB, dA);\n var c = dA.x * r.x + dA.y * r.y;\n var f = dB.x * r.x + dB.y * r.y;\n var b = dA.x * dB.x + dA.y * dB.y;\n var denom = a * e - b * b;\n s = 0.0;\n if (denom != 0.0) {\n s = b2Math.Clamp((b * f - c * e) / denom, 0.0, 1.0);\n }\n var t = (b * s + f) / e;\n if (t < 0.0) {\n t = 0.0;\n s = b2Math.Clamp((b - c) / a, 0.0, 1.0);\n }\n localPointA = new b2Vec2();\n localPointA.x = localPointA1.x + s * (localPointA2.x - localPointA1.x);\n localPointA.y = localPointA1.y + s * (localPointA2.y - localPointA1.y);\n localPointB = new b2Vec2();\n localPointB.x = localPointB1.x + s * (localPointB2.x - localPointB1.x);\n localPointB.y = localPointB1.y + s * (localPointB2.y - localPointB1.y);\n if (s == 0.0 || s == 1.0) {\n this.m_type = b2SeparationFunction.e_faceB;\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointB2, localPointB1), 1.0);\n this.m_axis.Normalize();\n this.m_localPoint = localPointB;\n tVec = this.m_axis;\n tMat = transformB.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointA;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n sgn = (pointAX - pointBX) * normalX + (pointAY - pointBY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n else {\n this.m_type = b2SeparationFunction.e_faceA;\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointA2, localPointA1), 1.0);\n this.m_localPoint = localPointA;\n tVec = this.m_axis;\n tMat = transformA.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointB;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n sgn = (pointBX - pointAX) * normalX + (pointBY - pointAY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n }\n }\n b2SeparationFunction.prototype.Evaluate = function (transformA, transformB) {\n var axisA;\n var axisB;\n var localPointA;\n var localPointB;\n var pointA;\n var pointB;\n var seperation = 0;\n var normal;\n switch (this.m_type) {\n case b2SeparationFunction.e_points:\n {\n axisA = b2Math.MulTMV(transformA.R, this.m_axis);\n axisB = b2Math.MulTMV(transformB.R, this.m_axis.GetNegative());\n localPointA = this.m_proxyA.GetSupportVertex(axisA);\n localPointB = this.m_proxyB.GetSupportVertex(axisB);\n pointA = b2Math.MulX(transformA, localPointA);\n pointB = b2Math.MulX(transformB, localPointB);\n seperation = (pointB.x - pointA.x) * this.m_axis.x + (pointB.y - pointA.y) * this.m_axis.y;\n return seperation;\n }\n case b2SeparationFunction.e_faceA:\n {\n normal = b2Math.MulMV(transformA.R, this.m_axis);\n pointA = b2Math.MulX(transformA, this.m_localPoint);\n axisB = b2Math.MulTMV(transformB.R, normal.GetNegative());\n localPointB = this.m_proxyB.GetSupportVertex(axisB);\n pointB = b2Math.MulX(transformB, localPointB);\n seperation = (pointB.x - pointA.x) * normal.x + (pointB.y - pointA.y) * normal.y;\n return seperation;\n }\n case b2SeparationFunction.e_faceB:\n {\n normal = b2Math.MulMV(transformB.R, this.m_axis);\n pointB = b2Math.MulX(transformB, this.m_localPoint);\n axisA = b2Math.MulTMV(transformA.R, normal.GetNegative());\n localPointA = this.m_proxyA.GetSupportVertex(axisA);\n pointA = b2Math.MulX(transformA, localPointA);\n seperation = (pointA.x - pointB.x) * normal.x + (pointA.y - pointB.y) * normal.y;\n return seperation;\n }\n default:\n b2Settings.b2Assert(false);\n return 0.0;\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2SeparationFunction.e_points = 0x01;\n Box2D.Collision.b2SeparationFunction.prototype.e_points = Box2D.Collision.b2SeparationFunction.e_points;\n Box2D.Collision.b2SeparationFunction.e_faceA = 0x02;\n Box2D.Collision.b2SeparationFunction.prototype.e_faceA = Box2D.Collision.b2SeparationFunction.e_faceA;\n Box2D.Collision.b2SeparationFunction.e_faceB = 0x04;\n Box2D.Collision.b2SeparationFunction.prototype.e_faceB = Box2D.Collision.b2SeparationFunction.e_faceB;\n });\n b2Simplex.b2Simplex = function () {\n this.m_v1 = new b2SimplexVertex();\n this.m_v2 = new b2SimplexVertex();\n this.m_v3 = new b2SimplexVertex();\n this.m_vertices = new Vector(3);\n };\n b2Simplex.prototype.b2Simplex = function () {\n this.m_vertices[0] = this.m_v1;\n this.m_vertices[1] = this.m_v2;\n this.m_vertices[2] = this.m_v3;\n }\n b2Simplex.prototype.ReadCache = function (cache, proxyA, transformA, proxyB, transformB) {\n b2Settings.b2Assert(0 <= cache.count && cache.count <= 3);\n var wALocal;\n var wBLocal;\n this.m_count = cache.count;\n var vertices = this.m_vertices;\n for (var i = 0; i < this.m_count; i++) {\n var v = vertices[i];\n v.indexA = cache.indexA[i];\n v.indexB = cache.indexB[i];\n wALocal = proxyA.GetVertex(v.indexA);\n wBLocal = proxyB.GetVertex(v.indexB);\n v.wA = b2Math.MulX(transformA, wALocal);\n v.wB = b2Math.MulX(transformB, wBLocal);\n v.w = b2Math.SubtractVV(v.wB, v.wA);\n v.a = 0;\n }\n if (this.m_count > 1) {\n var metric1 = cache.metric;\n var metric2 = this.GetMetric();\n if (metric2 < .5 * metric1 || 2.0 * metric1 < metric2 || metric2 < Number.MIN_VALUE) {\n this.m_count = 0;\n }\n }\n if (this.m_count == 0) {\n v = vertices[0];\n v.indexA = 0;\n v.indexB = 0;\n wALocal = proxyA.GetVertex(0);\n wBLocal = proxyB.GetVertex(0);\n v.wA = b2Math.MulX(transformA, wALocal);\n v.wB = b2Math.MulX(transformB, wBLocal);\n v.w = b2Math.SubtractVV(v.wB, v.wA);\n this.m_count = 1;\n }\n }\n b2Simplex.prototype.WriteCache = function (cache) {\n cache.metric = this.GetMetric();\n cache.count = a2j.parseUInt(this.m_count);\n var vertices = this.m_vertices;\n for (var i = 0; i < this.m_count; i++) {\n cache.indexA[i] = a2j.parseUInt(vertices[i].indexA);\n cache.indexB[i] = a2j.parseUInt(vertices[i].indexB);\n }\n }\n b2Simplex.prototype.GetSearchDirection = function () {\n switch (this.m_count) {\n case 1:\n return this.m_v1.w.GetNegative();\n case 2:\n {\n var e12 = b2Math.SubtractVV(this.m_v2.w, this.m_v1.w);\n var sgn = b2Math.CrossVV(e12, this.m_v1.w.GetNegative());\n if (sgn > 0.0) {\n return b2Math.CrossFV(1.0, e12);\n }\n else {\n return b2Math.CrossVF(e12, 1.0);\n }\n }\n default:\n b2Settings.b2Assert(false);\n return new b2Vec2();\n }\n }\n b2Simplex.prototype.GetClosestPoint = function () {\n switch (this.m_count) {\n case 0:\n b2Settings.b2Assert(false);\n return new b2Vec2();\n case 1:\n return this.m_v1.w;\n case 2:\n return new b2Vec2(this.m_v1.a * this.m_v1.w.x + this.m_v2.a * this.m_v2.w.x, this.m_v1.a * this.m_v1.w.y + this.m_v2.a * this.m_v2.w.y);\n default:\n b2Settings.b2Assert(false);\n return new b2Vec2();\n }\n }\n b2Simplex.prototype.GetWitnessPoints = function (pA, pB) {\n switch (this.m_count) {\n case 0:\n b2Settings.b2Assert(false);\n break;\n case 1:\n pA.SetV(this.m_v1.wA);\n pB.SetV(this.m_v1.wB);\n break;\n case 2:\n pA.x = this.m_v1.a * this.m_v1.wA.x + this.m_v2.a * this.m_v2.wA.x;\n pA.y = this.m_v1.a * this.m_v1.wA.y + this.m_v2.a * this.m_v2.wA.y;\n pB.x = this.m_v1.a * this.m_v1.wB.x + this.m_v2.a * this.m_v2.wB.x;\n pB.y = this.m_v1.a * this.m_v1.wB.y + this.m_v2.a * this.m_v2.wB.y;\n break;\n case 3:\n pB.x = pA.x = this.m_v1.a * this.m_v1.wA.x + this.m_v2.a * this.m_v2.wA.x + this.m_v3.a * this.m_v3.wA.x;\n pB.y = pA.y = this.m_v1.a * this.m_v1.wA.y + this.m_v2.a * this.m_v2.wA.y + this.m_v3.a * this.m_v3.wA.y;\n break;\n default:\n b2Settings.b2Assert(false);\n break;\n }\n }\n b2Simplex.prototype.GetMetric = function () {\n switch (this.m_count) {\n case 0:\n b2Settings.b2Assert(false);\n return 0.0;\n case 1:\n return 0.0;\n case 2:\n return b2Math.SubtractVV(this.m_v1.w, this.m_v2.w).Length();\n case 3:\n return b2Math.CrossVV(b2Math.SubtractVV(this.m_v2.w, this.m_v1.w), b2Math.SubtractVV(this.m_v3.w, this.m_v1.w));\n default:\n b2Settings.b2Assert(false);\n return 0.0;\n }\n }\n b2Simplex.prototype.Solve2 = function () {\n var w1 = this.m_v1.w;\n var w2 = this.m_v2.w;\n var e12 = b2Math.SubtractVV(w2, w1);\n var d12_2 = (-(w1.x * e12.x + w1.y * e12.y));\n if (d12_2 <= 0.0) {\n this.m_v1.a = 1.0;\n this.m_count = 1;\n return;\n }\n var d12_1 = (w2.x * e12.x + w2.y * e12.y);\n if (d12_1 <= 0.0) {\n this.m_v2.a = 1.0;\n this.m_count = 1;\n this.m_v1.Set(this.m_v2);\n return;\n }\n var inv_d12 = 1.0 / (d12_1 + d12_2);\n this.m_v1.a = d12_1 * inv_d12;\n this.m_v2.a = d12_2 * inv_d12;\n this.m_count = 2;\n }\n b2Simplex.prototype.Solve3 = function () {\n var w1 = this.m_v1.w;\n var w2 = this.m_v2.w;\n var w3 = this.m_v3.w;\n var e12 = b2Math.SubtractVV(w2, w1);\n var w1e12 = b2Math.Dot(w1, e12);\n var w2e12 = b2Math.Dot(w2, e12);\n var d12_1 = w2e12;\n var d12_2 = (-w1e12);\n var e13 = b2Math.SubtractVV(w3, w1);\n var w1e13 = b2Math.Dot(w1, e13);\n var w3e13 = b2Math.Dot(w3, e13);\n var d13_1 = w3e13;\n var d13_2 = (-w1e13);\n var e23 = b2Math.SubtractVV(w3, w2);\n var w2e23 = b2Math.Dot(w2, e23);\n var w3e23 = b2Math.Dot(w3, e23);\n var d23_1 = w3e23;\n var d23_2 = (-w2e23);\n var n123 = b2Math.CrossVV(e12, e13);\n var d123_1 = n123 * b2Math.CrossVV(w2, w3);\n var d123_2 = n123 * b2Math.CrossVV(w3, w1);\n var d123_3 = n123 * b2Math.CrossVV(w1, w2);\n if (d12_2 <= 0.0 && d13_2 <= 0.0) {\n this.m_v1.a = 1.0;\n this.m_count = 1;\n return;\n }\n if (d12_1 > 0.0 && d12_2 > 0.0 && d123_3 <= 0.0) {\n var inv_d12 = 1.0 / (d12_1 + d12_2);\n this.m_v1.a = d12_1 * inv_d12;\n this.m_v2.a = d12_2 * inv_d12;\n this.m_count = 2;\n return;\n }\n if (d13_1 > 0.0 && d13_2 > 0.0 && d123_2 <= 0.0) {\n var inv_d13 = 1.0 / (d13_1 + d13_2);\n this.m_v1.a = d13_1 * inv_d13;\n this.m_v3.a = d13_2 * inv_d13;\n this.m_count = 2;\n this.m_v2.Set(this.m_v3);\n return;\n }\n if (d12_1 <= 0.0 && d23_2 <= 0.0) {\n this.m_v2.a = 1.0;\n this.m_count = 1;\n this.m_v1.Set(this.m_v2);\n return;\n }\n if (d13_1 <= 0.0 && d23_1 <= 0.0) {\n this.m_v3.a = 1.0;\n this.m_count = 1;\n this.m_v1.Set(this.m_v3);\n return;\n }\n if (d23_1 > 0.0 && d23_2 > 0.0 && d123_1 <= 0.0) {\n var inv_d23 = 1.0 / (d23_1 + d23_2);\n this.m_v2.a = d23_1 * inv_d23;\n this.m_v3.a = d23_2 * inv_d23;\n this.m_count = 2;\n this.m_v1.Set(this.m_v3);\n return;\n }\n var inv_d123 = 1.0 / (d123_1 + d123_2 + d123_3);\n this.m_v1.a = d123_1 * inv_d123;\n this.m_v2.a = d123_2 * inv_d123;\n this.m_v3.a = d123_3 * inv_d123;\n this.m_count = 3;\n }\n b2SimplexCache.b2SimplexCache = function () {\n this.indexA = new Vector_a2j_Number(3);\n this.indexB = new Vector_a2j_Number(3);\n };\n b2SimplexVertex.b2SimplexVertex = function () {};\n b2SimplexVertex.prototype.Set = function (other) {\n this.wA.SetV(other.wA);\n this.wB.SetV(other.wB);\n this.w.SetV(other.w);\n this.a = other.a;\n this.indexA = other.indexA;\n this.indexB = other.indexB;\n }\n b2TimeOfImpact.b2TimeOfImpact = function () {};\n b2TimeOfImpact.prototype.TimeOfImpact = function (input) {\n ++b2TimeOfImpact.b2_toiCalls;\n var proxyA = input.proxyA;\n var proxyB = input.proxyB;\n var sweepA = input.sweepA;\n var sweepB = input.sweepB;\n b2Settings.b2Assert(sweepA.t0 == sweepB.t0);\n b2Settings.b2Assert(1.0 - sweepA.t0 > Number.MIN_VALUE);\n var radius = proxyA.m_radius + proxyB.m_radius;\n var tolerance = input.tolerance;\n var alpha = 0.0;\n var k_maxIterations = 1000;\n var iter = 0;\n var target = 0.0;\n b2TimeOfImpact.s_cache.count = 0;\n b2TimeOfImpact.s_distanceInput.useRadii = false;\n for (;;) {\n sweepA.GetTransform(b2TimeOfImpact.s_xfA, alpha);\n sweepB.GetTransform(b2TimeOfImpact.s_xfB, alpha);\n b2TimeOfImpact.s_distanceInput.proxyA = proxyA;\n b2TimeOfImpact.s_distanceInput.proxyB = proxyB;\n b2TimeOfImpact.s_distanceInput.transformA = b2TimeOfImpact.s_xfA;\n b2TimeOfImpact.s_distanceInput.transformB = b2TimeOfImpact.s_xfB;\n b2Distance.Distance(b2TimeOfImpact.s_distanceOutput, b2TimeOfImpact.s_cache, b2TimeOfImpact.s_distanceInput);\n if (b2TimeOfImpact.s_distanceOutput.distance <= 0.0) {\n alpha = 1.0;\n break;\n }\n b2TimeOfImpact.s_fcn.Initialize(b2TimeOfImpact.s_cache, proxyA, b2TimeOfImpact.s_xfA, proxyB, b2TimeOfImpact.s_xfB);\n var separation = b2TimeOfImpact.s_fcn.Evaluate(b2TimeOfImpact.s_xfA, b2TimeOfImpact.s_xfB);\n if (separation <= 0.0) {\n alpha = 1.0;\n break;\n }\n if (iter == 0) {\n if (separation > radius) {\n target = b2Math.Max(radius - tolerance, 0.75 * radius);\n }\n else {\n target = b2Math.Max(separation - tolerance, 0.02 * radius);\n }\n }\n if (separation - target < 0.5 * tolerance) {\n if (iter == 0) {\n alpha = 1.0;\n break;\n }\n break;\n }\n var newAlpha = alpha; {\n var x1 = alpha;\n var x2 = 1.0;\n var f1 = separation;\n sweepA.GetTransform(b2TimeOfImpact.s_xfA, x2);\n sweepB.GetTransform(b2TimeOfImpact.s_xfB, x2);\n var f2 = b2TimeOfImpact.s_fcn.Evaluate(b2TimeOfImpact.s_xfA, b2TimeOfImpact.s_xfB);\n if (f2 >= target) {\n alpha = 1.0;\n break;\n }\n var rootIterCount = 0;\n for (;;) {\n var x = 0;\n if (rootIterCount & 1) {\n x = x1 + (target - f1) * (x2 - x1) / (f2 - f1);\n }\n else {\n x = 0.5 * (x1 + x2);\n }\n sweepA.GetTransform(b2TimeOfImpact.s_xfA, x);\n sweepB.GetTransform(b2TimeOfImpact.s_xfB, x);\n var f = b2TimeOfImpact.s_fcn.Evaluate(b2TimeOfImpact.s_xfA, b2TimeOfImpact.s_xfB);\n if (b2Math.Abs(f - target) < 0.025 * tolerance) {\n newAlpha = x;\n break;\n }\n if (f > target) {\n x1 = x;\n f1 = f;\n }\n else {\n x2 = x;\n f2 = f;\n }++rootIterCount;\n ++b2TimeOfImpact.b2_toiRootIters;\n if (rootIterCount == 50) {\n break;\n }\n }\n b2TimeOfImpact.b2_toiMaxRootIters = b2Math.Max(b2TimeOfImpact.b2_toiMaxRootIters, rootIterCount);\n }\n if (newAlpha < (1.0 + 100.0 * Number.MIN_VALUE) * alpha) {\n break;\n }\n alpha = newAlpha;\n iter++;\n ++b2TimeOfImpact.b2_toiIters;\n if (iter == k_maxIterations) {\n break;\n }\n }\n b2TimeOfImpact.b2_toiMaxIters = b2Math.Max(b2TimeOfImpact.b2_toiMaxIters, iter);\n return alpha;\n }\n b2TimeOfImpact.TimeOfImpact = b2TimeOfImpact.prototype.TimeOfImpact;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2TimeOfImpact.b2_toiCalls = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiCalls = Box2D.Collision.b2TimeOfImpact.b2_toiCalls;\n Box2D.Collision.b2TimeOfImpact.b2_toiIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiIters = Box2D.Collision.b2TimeOfImpact.b2_toiIters;\n Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiMaxIters = Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters;\n Box2D.Collision.b2TimeOfImpact.b2_toiRootIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiRootIters = Box2D.Collision.b2TimeOfImpact.b2_toiRootIters;\n Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiMaxRootIters = Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters;\n Box2D.Collision.b2TimeOfImpact.s_cache = new b2SimplexCache();\n Box2D.Collision.b2TimeOfImpact.prototype.s_cache = Box2D.Collision.b2TimeOfImpact.s_cache;\n Box2D.Collision.b2TimeOfImpact.s_distanceInput = new b2DistanceInput();\n Box2D.Collision.b2TimeOfImpact.prototype.s_distanceInput = Box2D.Collision.b2TimeOfImpact.s_distanceInput;\n Box2D.Collision.b2TimeOfImpact.s_xfA = new b2Transform();\n Box2D.Collision.b2TimeOfImpact.prototype.s_xfA = Box2D.Collision.b2TimeOfImpact.s_xfA;\n Box2D.Collision.b2TimeOfImpact.s_xfB = new b2Transform();\n Box2D.Collision.b2TimeOfImpact.prototype.s_xfB = Box2D.Collision.b2TimeOfImpact.s_xfB;\n Box2D.Collision.b2TimeOfImpact.s_fcn = new b2SeparationFunction();\n Box2D.Collision.b2TimeOfImpact.prototype.s_fcn = Box2D.Collision.b2TimeOfImpact.s_fcn;\n Box2D.Collision.b2TimeOfImpact.s_distanceOutput = new b2DistanceOutput();\n Box2D.Collision.b2TimeOfImpact.prototype.s_distanceOutput = Box2D.Collision.b2TimeOfImpact.s_distanceOutput;\n });\n b2TOIInput.b2TOIInput = function () {\n this.proxyA = new b2DistanceProxy();\n this.proxyB = new b2DistanceProxy();\n this.sweepA = new b2Sweep();\n this.sweepB = new b2Sweep();\n };\n b2WorldManifold.b2WorldManifold = function () {\n this.m_normal = new b2Vec2();\n };\n b2WorldManifold.prototype.b2WorldManifold = function () {\n this.m_points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.m_points[i] = new b2Vec2();\n }\n }\n b2WorldManifold.prototype.Initialize = function (manifold, xfA, radiusA, xfB, radiusB) {\n if (radiusA === undefined) radiusA = 0;\n if (radiusB === undefined) radiusB = 0;\n if (manifold.m_pointCount == 0) {\n return;\n }\n var i = 0;\n var tVec;\n var tMat;\n var normalX = 0;\n var normalY = 0;\n var planePointX = 0;\n var planePointY = 0;\n var clipPointX = 0;\n var clipPointY = 0;\n switch (manifold.m_type) {\n case b2Manifold.e_circles:\n {\n tMat = xfA.R;\n tVec = manifold.m_localPoint;\n var pointAX = xfA.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n var pointAY = xfA.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = xfB.R;\n tVec = manifold.m_points[0].m_localPoint;\n var pointBX = xfB.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n var pointBY = xfB.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n var dX = pointBX - pointAX;\n var dY = pointBY - pointAY;\n var d2 = dX * dX + dY * dY;\n if (d2 > Number.MIN_VALUE * Number.MIN_VALUE) {\n var d = Math.sqrt(d2);\n this.m_normal.x = dX / d;\n this.m_normal.y = dY / d;\n }\n else {\n this.m_normal.x = 1;\n this.m_normal.y = 0;\n }\n var cAX = pointAX + radiusA * this.m_normal.x;\n var cAY = pointAY + radiusA * this.m_normal.y;\n var cBX = pointBX - radiusB * this.m_normal.x;\n var cBY = pointBY - radiusB * this.m_normal.y;\n this.m_points[0].x = 0.5 * (cAX + cBX);\n this.m_points[0].y = 0.5 * (cAY + cBY);\n }\n break;\n case b2Manifold.e_faceA:\n {\n tMat = xfA.R;\n tVec = manifold.m_localPlaneNormal;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = xfA.R;\n tVec = manifold.m_localPoint;\n planePointX = xfA.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n planePointY = xfA.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_normal.x = normalX;\n this.m_normal.y = normalY;\n for (i = 0;\n i < manifold.m_pointCount; i++) {\n tMat = xfB.R;\n tVec = manifold.m_points[i].m_localPoint;\n clipPointX = xfB.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n clipPointY = xfB.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_points[i].x = clipPointX + 0.5 * (radiusA - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusB) * normalX;\n this.m_points[i].y = clipPointY + 0.5 * (radiusA - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusB) * normalY;\n }\n }\n break;\n case b2Manifold.e_faceB:\n {\n tMat = xfB.R;\n tVec = manifold.m_localPlaneNormal;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = xfB.R;\n tVec = manifold.m_localPoint;\n planePointX = xfB.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n planePointY = xfB.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_normal.x = (-normalX);\n this.m_normal.y = (-normalY);\n for (i = 0;\n i < manifold.m_pointCount; i++) {\n tMat = xfA.R;\n tVec = manifold.m_points[i].m_localPoint;\n clipPointX = xfA.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n clipPointY = xfA.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_points[i].x = clipPointX + 0.5 * (radiusB - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusA) * normalX;\n this.m_points[i].y = clipPointY + 0.5 * (radiusB - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusA) * normalY;\n }\n }\n break;\n }\n }\n ClipVertex.ClipVertex = function () {\n this.v = new b2Vec2();\n this.id = new b2ContactID();\n };\n ClipVertex.prototype.Set = function (other) {\n this.v.SetV(other.v);\n this.id.Set(other.id);\n }\n Features.Features = function () {};\n Features.prototype.__defineGetter__('referenceEdge', function () {\n return this._referenceEdge;\n });\n Features.prototype.__defineSetter__('referenceEdge', function (value) {\n if (value === undefined) value = 0;\n this._referenceEdge = value;\n this._m_id._key = (this._m_id._key & 0xffffff00) | (this._referenceEdge & 0x000000ff);\n });\n Features.prototype.__defineGetter__('incidentEdge', function () {\n return this._incidentEdge;\n });\n Features.prototype.__defineSetter__('incidentEdge', function (value) {\n if (value === undefined) value = 0;\n this._incidentEdge = value;\n this._m_id._key = (this._m_id._key & 0xffff00ff) | ((this._incidentEdge << 8) & 0x0000ff00);\n });\n Features.prototype.__defineGetter__('incidentVertex', function () {\n return this._incidentVertex;\n });\n Features.prototype.__defineSetter__('incidentVertex', function (value) {\n if (value === undefined) value = 0;\n this._incidentVertex = value;\n this._m_id._key = (this._m_id._key & 0xff00ffff) | ((this._incidentVertex << 16) & 0x00ff0000);\n });\n Features.prototype.__defineGetter__('flip', function () {\n return this._flip;\n });\n Features.prototype.__defineSetter__('flip', function (value) {\n if (value === undefined) value = 0;\n this._flip = value;\n this._m_id._key = (this._m_id._key & 0x00ffffff) | ((this._flip << 24) & 0xff000000);\n });\n})(); /* source: disabled*/\n(function () {\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2internal = Box2D.Common.b2internal;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n b2CircleShape.inherit(Box2D.Collision.Shapes.b2Shape);\n b2CircleShape.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;\n b2CircleShape.b2CircleShape = function () {\n Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);\n this.m_p = new b2Vec2();\n };\n b2CircleShape.prototype.Copy = function () {\n var s = new b2CircleShape();\n s.Set(this);\n return s;\n }\n b2CircleShape.prototype.Set = function (other) {\n this.__super.Set.call(this, other);\n if (a2j.is(other, b2CircleShape)) {\n var other2 = (other instanceof b2CircleShape ? other : null);\n this.m_p.SetV(other2.m_p);\n }\n }\n b2CircleShape.prototype.TestPoint = function (transform, p) {\n var tMat = transform.R;\n var dX = transform.position.x + (tMat.col1.x * this.m_p.x + tMat.col2.x * this.m_p.y);\n var dY = transform.position.y + (tMat.col1.y * this.m_p.x + tMat.col2.y * this.m_p.y);\n dX = p.x - dX;\n dY = p.y - dY;\n return (dX * dX + dY * dY) <= this.m_radius * this.m_radius;\n }\n b2CircleShape.prototype.RayCast = function (output, input, transform) {\n var tMat = transform.R;\n var positionX = transform.position.x + (tMat.col1.x * this.m_p.x + tMat.col2.x * this.m_p.y);\n var positionY = transform.position.y + (tMat.col1.y * this.m_p.x + tMat.col2.y * this.m_p.y);\n var sX = input.p1.x - positionX;\n var sY = input.p1.y - positionY;\n var b = (sX * sX + sY * sY) - this.m_radius * this.m_radius;\n var rX = input.p2.x - input.p1.x;\n var rY = input.p2.y - input.p1.y;\n var c = (sX * rX + sY * rY);\n var rr = (rX * rX + rY * rY);\n var sigma = c * c - rr * b;\n if (sigma < 0.0 || rr < Number.MIN_VALUE) {\n return false;\n }\n var a = (-(c + Math.sqrt(sigma)));\n if (0.0 <= a && a <= input.maxFraction * rr) {\n a /= rr;\n output.fraction = a;\n output.normal.x = sX + a * rX;\n output.normal.y = sY + a * rY;\n output.normal.Normalize();\n return true;\n }\n return false;\n }\n b2CircleShape.prototype.ComputeAABB = function (aabb, transform) {\n var tMat = transform.R;\n var pX = transform.position.x + (tMat.col1.x * this.m_p.x + tMat.col2.x * this.m_p.y);\n var pY = transform.position.y + (tMat.col1.y * this.m_p.x + tMat.col2.y * this.m_p.y);\n aabb.lowerBound.Set(pX - this.m_radius, pY - this.m_radius);\n aabb.upperBound.Set(pX + this.m_radius, pY + this.m_radius);\n }\n b2CircleShape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n massData.mass = density * b2Settings.b2_pi * this.m_radius * this.m_radius;\n massData.center.SetV(this.m_p);\n massData.I = massData.mass * (0.5 * this.m_radius * this.m_radius + (this.m_p.x * this.m_p.x + this.m_p.y * this.m_p.y));\n }\n b2CircleShape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n var p = b2Math.MulX(xf, this.m_p);\n var l = (-(b2Math.Dot(normal, p) - offset));\n if (l < (-this.m_radius) + Number.MIN_VALUE) {\n return 0;\n }\n if (l > this.m_radius) {\n c.SetV(p);\n return Math.PI * this.m_radius * this.m_radius;\n }\n var r2 = this.m_radius * this.m_radius;\n var l2 = l * l;\n var area = r2 * (Math.asin(l / this.m_radius) + Math.PI / 2) + l * Math.sqrt(r2 - l2);\n var com = (-2 / 3 * Math.pow(r2 - l2, 1.5) / area);\n c.x = p.x + normal.x * com;\n c.y = p.y + normal.y * com;\n return area;\n }\n b2CircleShape.prototype.GetLocalPosition = function () {\n return this.m_p;\n }\n b2CircleShape.prototype.SetLocalPosition = function (position) {\n this.m_p.SetV(position);\n }\n b2CircleShape.prototype.GetRadius = function () {\n return this.m_radius;\n }\n b2CircleShape.prototype.SetRadius = function (radius) {\n if (radius === undefined) radius = 0;\n this.m_radius = radius;\n }\n b2CircleShape.prototype.b2CircleShape = function (radius) {\n if (radius === undefined) radius = 0;\n this.__super.b2Shape.call(this);\n this.m_type = this.e_circleShape;\n this.m_radius = radius;\n }\n b2EdgeChainDef.b2EdgeChainDef = function () {};\n b2EdgeChainDef.prototype.b2EdgeChainDef = function () {\n this.vertexCount = 0;\n this.isALoop = true;\n this.vertices = [];\n }\n b2EdgeShape.inherit(Box2D.Collision.Shapes.b2Shape);\n b2EdgeShape.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;\n b2EdgeShape.b2EdgeShape = function () {\n Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);\n this.s_supportVec = new b2Vec2();\n this.m_v1 = new b2Vec2();\n this.m_v2 = new b2Vec2();\n this.m_coreV1 = new b2Vec2();\n this.m_coreV2 = new b2Vec2();\n this.m_normal = new b2Vec2();\n this.m_direction = new b2Vec2();\n this.m_cornerDir1 = new b2Vec2();\n this.m_cornerDir2 = new b2Vec2();\n };\n b2EdgeShape.prototype.TestPoint = function (transform, p) {\n return false;\n }\n b2EdgeShape.prototype.RayCast = function (output, input, transform) {\n var tMat;\n var rX = input.p2.x - input.p1.x;\n var rY = input.p2.y - input.p1.y;\n tMat = transform.R;\n var v1X = transform.position.x + (tMat.col1.x * this.m_v1.x + tMat.col2.x * this.m_v1.y);\n var v1Y = transform.position.y + (tMat.col1.y * this.m_v1.x + tMat.col2.y * this.m_v1.y);\n var nX = transform.position.y + (tMat.col1.y * this.m_v2.x + tMat.col2.y * this.m_v2.y) - v1Y;\n var nY = (-(transform.position.x + (tMat.col1.x * this.m_v2.x + tMat.col2.x * this.m_v2.y) - v1X));\n var k_slop = 100.0 * Number.MIN_VALUE;\n var denom = (-(rX * nX + rY * nY));\n if (denom > k_slop) {\n var bX = input.p1.x - v1X;\n var bY = input.p1.y - v1Y;\n var a = (bX * nX + bY * nY);\n if (0.0 <= a && a <= input.maxFraction * denom) {\n var mu2 = (-rX * bY) + rY * bX;\n if ((-k_slop * denom) <= mu2 && mu2 <= denom * (1.0 + k_slop)) {\n a /= denom;\n output.fraction = a;\n var nLen = Math.sqrt(nX * nX + nY * nY);\n output.normal.x = nX / nLen;\n output.normal.y = nY / nLen;\n return true;\n }\n }\n }\n return false;\n }\n b2EdgeShape.prototype.ComputeAABB = function (aabb, transform) {\n var tMat = transform.R;\n var v1X = transform.position.x + (tMat.col1.x * this.m_v1.x + tMat.col2.x * this.m_v1.y);\n var v1Y = transform.position.y + (tMat.col1.y * this.m_v1.x + tMat.col2.y * this.m_v1.y);\n var v2X = transform.position.x + (tMat.col1.x * this.m_v2.x + tMat.col2.x * this.m_v2.y);\n var v2Y = transform.position.y + (tMat.col1.y * this.m_v2.x + tMat.col2.y * this.m_v2.y);\n if (v1X < v2X) {\n aabb.lowerBound.x = v1X;\n aabb.upperBound.x = v2X;\n }\n else {\n aabb.lowerBound.x = v2X;\n aabb.upperBound.x = v1X;\n }\n if (v1Y < v2Y) {\n aabb.lowerBound.y = v1Y;\n aabb.upperBound.y = v2Y;\n }\n else {\n aabb.lowerBound.y = v2Y;\n aabb.upperBound.y = v1Y;\n }\n }\n b2EdgeShape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n massData.mass = 0;\n massData.center.SetV(this.m_v1);\n massData.I = 0;\n }\n b2EdgeShape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n var v0 = new b2Vec2(normal.x * offset, normal.y * offset);\n var v1 = b2Math.MulX(xf, this.m_v1);\n var v2 = b2Math.MulX(xf, this.m_v2);\n var d1 = b2Math.Dot(normal, v1) - offset;\n var d2 = b2Math.Dot(normal, v2) - offset;\n if (d1 > 0) {\n if (d2 > 0) {\n return 0;\n }\n else {\n v1.x = (-d2 / (d1 - d2) * v1.x) + d1 / (d1 - d2) * v2.x;\n v1.y = (-d2 / (d1 - d2) * v1.y) + d1 / (d1 - d2) * v2.y;\n }\n }\n else {\n if (d2 > 0) {\n v2.x = (-d2 / (d1 - d2) * v1.x) + d1 / (d1 - d2) * v2.x;\n v2.y = (-d2 / (d1 - d2) * v1.y) + d1 / (d1 - d2) * v2.y;\n }\n else {}\n }\n c.x = (v0.x + v1.x + v2.x) / 3;\n c.y = (v0.y + v1.y + v2.y) / 3;\n return 0.5 * ((v1.x - v0.x) * (v2.y - v0.y) - (v1.y - v0.y) * (v2.x - v0.x));\n }\n b2EdgeShape.prototype.GetLength = function () {\n return this.m_length;\n }\n b2EdgeShape.prototype.GetVertex1 = function () {\n return this.m_v1;\n }\n b2EdgeShape.prototype.GetVertex2 = function () {\n return this.m_v2;\n }\n b2EdgeShape.prototype.GetCoreVertex1 = function () {\n return this.m_coreV1;\n }\n b2EdgeShape.prototype.GetCoreVertex2 = function () {\n return this.m_coreV2;\n }\n b2EdgeShape.prototype.GetNormalVector = function () {\n return this.m_normal;\n }\n b2EdgeShape.prototype.GetDirectionVector = function () {\n return this.m_direction;\n }\n b2EdgeShape.prototype.GetCorner1Vector = function () {\n return this.m_cornerDir1;\n }\n b2EdgeShape.prototype.GetCorner2Vector = function () {\n return this.m_cornerDir2;\n }\n b2EdgeShape.prototype.Corner1IsConvex = function () {\n return this.m_cornerConvex1;\n }\n b2EdgeShape.prototype.Corner2IsConvex = function () {\n return this.m_cornerConvex2;\n }\n b2EdgeShape.prototype.GetFirstVertex = function (xf) {\n var tMat = xf.R;\n return new b2Vec2(xf.position.x + (tMat.col1.x * this.m_coreV1.x + tMat.col2.x * this.m_coreV1.y), xf.position.y + (tMat.col1.y * this.m_coreV1.x + tMat.col2.y * this.m_coreV1.y));\n }\n b2EdgeShape.prototype.GetNextEdge = function () {\n return this.m_nextEdge;\n }\n b2EdgeShape.prototype.GetPrevEdge = function () {\n return this.m_prevEdge;\n }\n b2EdgeShape.prototype.Support = function (xf, dX, dY) {\n if (dX === undefined) dX = 0;\n if (dY === undefined) dY = 0;\n var tMat = xf.R;\n var v1X = xf.position.x + (tMat.col1.x * this.m_coreV1.x + tMat.col2.x * this.m_coreV1.y);\n var v1Y = xf.position.y + (tMat.col1.y * this.m_coreV1.x + tMat.col2.y * this.m_coreV1.y);\n var v2X = xf.position.x + (tMat.col1.x * this.m_coreV2.x + tMat.col2.x * this.m_coreV2.y);\n var v2Y = xf.position.y + (tMat.col1.y * this.m_coreV2.x + tMat.col2.y * this.m_coreV2.y);\n if ((v1X * dX + v1Y * dY) > (v2X * dX + v2Y * dY)) {\n this.s_supportVec.x = v1X;\n this.s_supportVec.y = v1Y;\n }\n else {\n this.s_supportVec.x = v2X;\n this.s_supportVec.y = v2Y;\n }\n return this.s_supportVec;\n }\n b2EdgeShape.prototype.b2EdgeShape = function (v1, v2) {\n this.__super.b2Shape.call(this);\n this.m_type = this.e_edgeShape;\n this.m_prevEdge = null;\n this.m_nextEdge = null;\n this.m_v1 = v1;\n this.m_v2 = v2;\n this.m_direction.Set(this.m_v2.x - this.m_v1.x, this.m_v2.y - this.m_v1.y);\n this.m_length = this.m_direction.Normalize();\n this.m_normal.Set(this.m_direction.y, (-this.m_direction.x));\n this.m_coreV1.Set((-b2Settings.b2_toiSlop * (this.m_normal.x - this.m_direction.x)) + this.m_v1.x, (-b2Settings.b2_toiSlop * (this.m_normal.y - this.m_direction.y)) + this.m_v1.y);\n this.m_coreV2.Set((-b2Settings.b2_toiSlop * (this.m_normal.x + this.m_direction.x)) + this.m_v2.x, (-b2Settings.b2_toiSlop * (this.m_normal.y + this.m_direction.y)) + this.m_v2.y);\n this.m_cornerDir1 = this.m_normal;\n this.m_cornerDir2.Set((-this.m_normal.x), (-this.m_normal.y));\n }\n b2EdgeShape.prototype.SetPrevEdge = function (edge, core, cornerDir, convex) {\n this.m_prevEdge = edge;\n this.m_coreV1 = core;\n this.m_cornerDir1 = cornerDir;\n this.m_cornerConvex1 = convex;\n }\n b2EdgeShape.prototype.SetNextEdge = function (edge, core, cornerDir, convex) {\n this.m_nextEdge = edge;\n this.m_coreV2 = core;\n this.m_cornerDir2 = cornerDir;\n this.m_cornerConvex2 = convex;\n }\n b2MassData.b2MassData = function () {\n this.mass = 0.0;\n this.center = new b2Vec2(0, 0);\n this.I = 0.0;\n };\n b2PolygonShape.inherit(Box2D.Collision.Shapes.b2Shape);\n b2PolygonShape.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;\n b2PolygonShape.b2PolygonShape = function () {\n Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);\n };\n b2PolygonShape.prototype.Copy = function () {\n var s = new b2PolygonShape();\n s.Set(this);\n return s;\n }\n b2PolygonShape.prototype.Set = function (other) {\n this.__super.Set.call(this, other);\n if (a2j.is(other, b2PolygonShape)) {\n var other2 = (other instanceof b2PolygonShape ? other : null);\n this.m_centroid.SetV(other2.m_centroid);\n this.m_vertexCount = other2.m_vertexCount;\n this.Reserve(this.m_vertexCount);\n for (var i = 0; i < this.m_vertexCount; i++) {\n this.m_vertices[i].SetV(other2.m_vertices[i]);\n this.m_normals[i].SetV(other2.m_normals[i]);\n }\n }\n }\n b2PolygonShape.prototype.SetAsArray = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n var v = new Vector();\n var tVec;\n\n var len = vertices.length\n for (var i = 0; i < len; i++) {\n tVec = vertices[i]; {\n v.push(tVec);\n }\n }\n this.SetAsVector(v, vertexCount);\n }\n b2PolygonShape.prototype.AsArray = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsArray(vertices, vertexCount);\n return polygonShape;\n }\n b2PolygonShape.AsArray = b2PolygonShape.prototype.AsArray;\n b2PolygonShape.prototype.SetAsVector = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n if (vertexCount == 0) vertexCount = vertices.length;\n b2Settings.b2Assert(2 <= vertexCount);\n this.m_vertexCount = vertexCount;\n this.Reserve(vertexCount);\n var i = 0;\n for (i = 0;\n i < this.m_vertexCount; i++) {\n this.m_vertices[i].SetV(vertices[i]);\n }\n for (i = 0;\n i < this.m_vertexCount; ++i) {\n var i1 = parseInt(i);\n var i2 = parseInt(i + 1 < this.m_vertexCount ? i + 1 : 0);\n var edge = b2Math.SubtractVV(this.m_vertices[i2], this.m_vertices[i1]);\n b2Settings.b2Assert(edge.LengthSquared() > Number.MIN_VALUE);\n this.m_normals[i].SetV(b2Math.CrossVF(edge, 1.0));\n this.m_normals[i].Normalize();\n }\n this.m_centroid = this.ComputeCentroid(this.m_vertices, this.m_vertexCount);\n }\n b2PolygonShape.prototype.AsVector = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsVector(vertices, vertexCount);\n return polygonShape;\n }\n b2PolygonShape.AsVector = b2PolygonShape.prototype.AsVector;\n b2PolygonShape.prototype.SetAsBox = function (hx, hy) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n this.m_vertexCount = 4;\n this.Reserve(4);\n this.m_vertices[0].Set((-hx), (-hy));\n this.m_vertices[1].Set(hx, (-hy));\n this.m_vertices[2].Set(hx, hy);\n this.m_vertices[3].Set((-hx), hy);\n this.m_normals[0].Set(0.0, (-1.0));\n this.m_normals[1].Set(1.0, 0.0);\n this.m_normals[2].Set(0.0, 1.0);\n this.m_normals[3].Set((-1.0), 0.0);\n this.m_centroid.SetZero();\n }\n b2PolygonShape.prototype.AsBox = function (hx, hy) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsBox(hx, hy);\n return polygonShape;\n }\n b2PolygonShape.AsBox = b2PolygonShape.prototype.AsBox;\n b2PolygonShape.prototype.SetAsOrientedBox = function (hx, hy, center, angle) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n if (center === undefined) center = null;\n if (angle === undefined) angle = 0.0;\n this.m_vertexCount = 4;\n this.Reserve(4);\n this.m_vertices[0].Set((-hx), (-hy));\n this.m_vertices[1].Set(hx, (-hy));\n this.m_vertices[2].Set(hx, hy);\n this.m_vertices[3].Set((-hx), hy);\n this.m_normals[0].Set(0.0, (-1.0));\n this.m_normals[1].Set(1.0, 0.0);\n this.m_normals[2].Set(0.0, 1.0);\n this.m_normals[3].Set((-1.0), 0.0);\n this.m_centroid = center;\n var xf = new b2Transform();\n xf.position = center;\n xf.R.Set(angle);\n for (var i = 0; i < this.m_vertexCount; ++i) {\n this.m_vertices[i] = b2Math.MulX(xf, this.m_vertices[i]);\n this.m_normals[i] = b2Math.MulMV(xf.R, this.m_normals[i]);\n }\n }\n b2PolygonShape.prototype.AsOrientedBox = function (hx, hy, center, angle) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n if (center === undefined) center = null;\n if (angle === undefined) angle = 0.0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsOrientedBox(hx, hy, center, angle);\n return polygonShape;\n }\n b2PolygonShape.AsOrientedBox = b2PolygonShape.prototype.AsOrientedBox;\n b2PolygonShape.prototype.SetAsEdge = function (v1, v2) {\n this.m_vertexCount = 2;\n this.Reserve(2);\n this.m_vertices[0].SetV(v1);\n this.m_vertices[1].SetV(v2);\n this.m_centroid.x = 0.5 * (v1.x + v2.x);\n this.m_centroid.y = 0.5 * (v1.y + v2.y);\n this.m_normals[0] = b2Math.CrossVF(b2Math.SubtractVV(v2, v1), 1.0);\n this.m_normals[0].Normalize();\n this.m_normals[1].x = (-this.m_normals[0].x);\n this.m_normals[1].y = (-this.m_normals[0].y);\n }\n b2PolygonShape.prototype.AsEdge = function (v1, v2) {\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsEdge(v1, v2);\n return polygonShape;\n }\n b2PolygonShape.AsEdge = b2PolygonShape.prototype.AsEdge;\n b2PolygonShape.prototype.TestPoint = function (xf, p) {\n var tVec;\n var tMat = xf.R;\n var tX = p.x - xf.position.x;\n var tY = p.y - xf.position.y;\n var pLocalX = (tX * tMat.col1.x + tY * tMat.col1.y);\n var pLocalY = (tX * tMat.col2.x + tY * tMat.col2.y);\n for (var i = 0; i < this.m_vertexCount; ++i) {\n tVec = this.m_vertices[i];\n tX = pLocalX - tVec.x;\n tY = pLocalY - tVec.y;\n tVec = this.m_normals[i];\n var dot = (tVec.x * tX + tVec.y * tY);\n if (dot > 0.0) {\n return false;\n }\n }\n return true;\n }\n b2PolygonShape.prototype.RayCast = function (output, input, transform) {\n var lower = 0.0;\n var upper = input.maxFraction;\n var tX = 0;\n var tY = 0;\n var tMat;\n var tVec;\n tX = input.p1.x - transform.position.x;\n tY = input.p1.y - transform.position.y;\n tMat = transform.R;\n var p1X = (tX * tMat.col1.x + tY * tMat.col1.y);\n var p1Y = (tX * tMat.col2.x + tY * tMat.col2.y);\n tX = input.p2.x - transform.position.x;\n tY = input.p2.y - transform.position.y;\n tMat = transform.R;\n var p2X = (tX * tMat.col1.x + tY * tMat.col1.y);\n var p2Y = (tX * tMat.col2.x + tY * tMat.col2.y);\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var index = parseInt((-1));\n for (var i = 0; i < this.m_vertexCount; ++i) {\n tVec = this.m_vertices[i];\n tX = tVec.x - p1X;\n tY = tVec.y - p1Y;\n tVec = this.m_normals[i];\n var numerator = (tVec.x * tX + tVec.y * tY);\n var denominator = (tVec.x * dX + tVec.y * dY);\n if (denominator == 0.0) {\n if (numerator < 0.0) {\n return false;\n }\n }\n else {\n if (denominator < 0.0 && numerator < lower * denominator) {\n lower = numerator / denominator;\n index = i;\n }\n else if (denominator > 0.0 && numerator < upper * denominator) {\n upper = numerator / denominator;\n }\n }\n if (upper < lower - Number.MIN_VALUE) {\n return false;\n }\n }\n if (index >= 0) {\n output.fraction = lower;\n tMat = transform.R;\n tVec = this.m_normals[index];\n output.normal.x = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n output.normal.y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n return true;\n }\n return false;\n }\n b2PolygonShape.prototype.ComputeAABB = function (aabb, xf) {\n var tMat = xf.R;\n var tVec = this.m_vertices[0];\n var lowerX = xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var lowerY = xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var upperX = lowerX;\n var upperY = lowerY;\n for (var i = 1; i < this.m_vertexCount; ++i) {\n tVec = this.m_vertices[i];\n var vX = xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var vY = xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n lowerX = lowerX < vX ? lowerX : vX;\n lowerY = lowerY < vY ? lowerY : vY;\n upperX = upperX > vX ? upperX : vX;\n upperY = upperY > vY ? upperY : vY;\n }\n aabb.lowerBound.x = lowerX - this.m_radius;\n aabb.lowerBound.y = lowerY - this.m_radius;\n aabb.upperBound.x = upperX + this.m_radius;\n aabb.upperBound.y = upperY + this.m_radius;\n }\n b2PolygonShape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n if (this.m_vertexCount == 2) {\n massData.center.x = 0.5 * (this.m_vertices[0].x + this.m_vertices[1].x);\n massData.center.y = 0.5 * (this.m_vertices[0].y + this.m_vertices[1].y);\n massData.mass = 0.0;\n massData.I = 0.0;\n return;\n }\n var centerX = 0.0;\n var centerY = 0.0;\n var area = 0.0;\n var I = 0.0;\n var p1X = 0.0;\n var p1Y = 0.0;\n var k_inv3 = 1.0 / 3.0;\n for (var i = 0; i < this.m_vertexCount; ++i) {\n var p2 = this.m_vertices[i];\n var p3 = i + 1 < this.m_vertexCount ? this.m_vertices[parseInt(i + 1)] : this.m_vertices[0];\n var e1X = p2.x - p1X;\n var e1Y = p2.y - p1Y;\n var e2X = p3.x - p1X;\n var e2Y = p3.y - p1Y;\n var D = e1X * e2Y - e1Y * e2X;\n var triangleArea = 0.5 * D;area += triangleArea;\n centerX += triangleArea * k_inv3 * (p1X + p2.x + p3.x);\n centerY += triangleArea * k_inv3 * (p1Y + p2.y + p3.y);\n var px = p1X;\n var py = p1Y;\n var ex1 = e1X;\n var ey1 = e1Y;\n var ex2 = e2X;\n var ey2 = e2Y;\n var intx2 = k_inv3 * (0.25 * (ex1 * ex1 + ex2 * ex1 + ex2 * ex2) + (px * ex1 + px * ex2)) + 0.5 * px * px;\n var inty2 = k_inv3 * (0.25 * (ey1 * ey1 + ey2 * ey1 + ey2 * ey2) + (py * ey1 + py * ey2)) + 0.5 * py * py;I += D * (intx2 + inty2);\n }\n massData.mass = density * area;\n centerX *= 1.0 / area;\n centerY *= 1.0 / area;\n massData.center.Set(centerX, centerY);\n massData.I = density * I;\n }\n b2PolygonShape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n var normalL = b2Math.MulTMV(xf.R, normal);\n var offsetL = offset - b2Math.Dot(normal, xf.position);\n var depths = new Vector_a2j_Number();\n var diveCount = 0;\n var intoIndex = parseInt((-1));\n var outoIndex = parseInt((-1));\n var lastSubmerged = false;\n var i = 0;\n for (i = 0;\n i < this.m_vertexCount; ++i) {\n depths[i] = b2Math.Dot(normalL, this.m_vertices[i]) - offsetL;\n var isSubmerged = depths[i] < (-Number.MIN_VALUE);\n if (i > 0) {\n if (isSubmerged) {\n if (!lastSubmerged) {\n intoIndex = i - 1;\n diveCount++;\n }\n }\n else {\n if (lastSubmerged) {\n outoIndex = i - 1;\n diveCount++;\n }\n }\n }\n lastSubmerged = isSubmerged;\n }\n switch (diveCount) {\n case 0:\n if (lastSubmerged) {\n var md = new b2MassData();\n this.ComputeMass(md, 1);\n c.SetV(b2Math.MulX(xf, md.center));\n return md.mass;\n }\n else {\n return 0;\n }\n break;\n case 1:\n if (intoIndex == (-1)) {\n intoIndex = this.m_vertexCount - 1;\n }\n else {\n outoIndex = this.m_vertexCount - 1;\n }\n break;\n }\n var intoIndex2 = parseInt((intoIndex + 1) % this.m_vertexCount);\n var outoIndex2 = parseInt((outoIndex + 1) % this.m_vertexCount);\n var intoLamdda = (0 - depths[intoIndex]) / (depths[intoIndex2] - depths[intoIndex]);\n var outoLamdda = (0 - depths[outoIndex]) / (depths[outoIndex2] - depths[outoIndex]);\n var intoVec = new b2Vec2(this.m_vertices[intoIndex].x * (1 - intoLamdda) + this.m_vertices[intoIndex2].x * intoLamdda, this.m_vertices[intoIndex].y * (1 - intoLamdda) + this.m_vertices[intoIndex2].y * intoLamdda);\n var outoVec = new b2Vec2(this.m_vertices[outoIndex].x * (1 - outoLamdda) + this.m_vertices[outoIndex2].x * outoLamdda, this.m_vertices[outoIndex].y * (1 - outoLamdda) + this.m_vertices[outoIndex2].y * outoLamdda);\n var area = 0;\n var center = new b2Vec2();\n var p2 = this.m_vertices[intoIndex2];\n var p3;\n i = intoIndex2;\n while (i != outoIndex2) {\n i = (i + 1) % this.m_vertexCount;\n if (i == outoIndex2) p3 = outoVec;\n else p3 = this.m_vertices[i];\n var triangleArea = 0.5 * ((p2.x - intoVec.x) * (p3.y - intoVec.y) - (p2.y - intoVec.y) * (p3.x - intoVec.x));\n area += triangleArea;\n center.x += triangleArea * (intoVec.x + p2.x + p3.x) / 3;\n center.y += triangleArea * (intoVec.y + p2.y + p3.y) / 3;\n p2 = p3;\n }\n center.Multiply(1 / area);\n c.SetV(b2Math.MulX(xf, center));\n return area;\n }\n b2PolygonShape.prototype.GetVertexCount = function () {\n return this.m_vertexCount;\n }\n b2PolygonShape.prototype.GetVertices = function () {\n return this.m_vertices;\n }\n b2PolygonShape.prototype.GetNormals = function () {\n return this.m_normals;\n }\n b2PolygonShape.prototype.GetSupport = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_vertexCount; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return bestIndex;\n }\n b2PolygonShape.prototype.GetSupportVertex = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_vertexCount; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return this.m_vertices[bestIndex];\n }\n b2PolygonShape.prototype.Validate = function () {\n return false;\n }\n b2PolygonShape.prototype.b2PolygonShape = function () {\n this.__super.b2Shape.call(this);\n this.m_type = this.e_polygonShape;\n this.m_centroid = new b2Vec2();\n this.m_vertices = new Vector();\n this.m_normals = new Vector();\n }\n b2PolygonShape.prototype.Reserve = function (count) {\n if (count === undefined) count = 0;\n for (var i = parseInt(this.m_vertices.length); i < count; i++) {\n this.m_vertices[i] = new b2Vec2();\n this.m_normals[i] = new b2Vec2();\n }\n }\n b2PolygonShape.prototype.ComputeCentroid = function (vs, count) {\n if (count === undefined) count = 0;\n var c = new b2Vec2();\n var area = 0.0;\n var p1X = 0.0;\n var p1Y = 0.0;\n var inv3 = 1.0 / 3.0;\n for (var i = 0; i < count; ++i) {\n var p2 = vs[i];\n var p3 = i + 1 < count ? vs[parseInt(i + 1)] : vs[0];\n var e1X = p2.x - p1X;\n var e1Y = p2.y - p1Y;\n var e2X = p3.x - p1X;\n var e2Y = p3.y - p1Y;\n var D = (e1X * e2Y - e1Y * e2X);\n var triangleArea = 0.5 * D;area += triangleArea;\n c.x += triangleArea * inv3 * (p1X + p2.x + p3.x);\n c.y += triangleArea * inv3 * (p1Y + p2.y + p3.y);\n }\n c.x *= 1.0 / area;\n c.y *= 1.0 / area;\n return c;\n }\n b2PolygonShape.ComputeCentroid = b2PolygonShape.prototype.ComputeCentroid;\n b2PolygonShape.prototype.ComputeOBB = function (obb, vs, count) {\n if (count === undefined) count = 0;\n var i = 0;\n var p = new Vector(count + 1);\n for (i = 0;\n i < count; ++i) {\n p[i] = vs[i];\n }\n p[count] = p[0];\n var minArea = Number.MAX_VALUE;\n for (i = 1;\n i <= count; ++i) {\n var root = p[parseInt(i - 1)];\n var uxX = p[i].x - root.x;\n var uxY = p[i].y - root.y;\n var length = Math.sqrt(uxX * uxX + uxY * uxY);\n uxX /= length;\n uxY /= length;\n var uyX = (-uxY);\n var uyY = uxX;\n var lowerX = Number.MAX_VALUE;\n var lowerY = Number.MAX_VALUE;\n var upperX = (-Number.MAX_VALUE);\n var upperY = (-Number.MAX_VALUE);\n for (var j = 0; j < count; ++j) {\n var dX = p[j].x - root.x;\n var dY = p[j].y - root.y;\n var rX = (uxX * dX + uxY * dY);\n var rY = (uyX * dX + uyY * dY);\n if (rX < lowerX) lowerX = rX;\n if (rY < lowerY) lowerY = rY;\n if (rX > upperX) upperX = rX;\n if (rY > upperY) upperY = rY;\n }\n var area = (upperX - lowerX) * (upperY - lowerY);\n if (area < 0.95 * minArea) {\n minArea = area;\n obb.R.col1.x = uxX;\n obb.R.col1.y = uxY;\n obb.R.col2.x = uyX;\n obb.R.col2.y = uyY;\n var centerX = 0.5 * (lowerX + upperX);\n var centerY = 0.5 * (lowerY + upperY);\n var tMat = obb.R;\n obb.center.x = root.x + (tMat.col1.x * centerX + tMat.col2.x * centerY);\n obb.center.y = root.y + (tMat.col1.y * centerX + tMat.col2.y * centerY);\n obb.extents.x = 0.5 * (upperX - lowerX);\n obb.extents.y = 0.5 * (upperY - lowerY);\n }\n }\n }\n b2PolygonShape.ComputeOBB = b2PolygonShape.prototype.ComputeOBB;\n _A2J_postDefs.push(function () {\n Box2D.Collision.Shapes.b2PolygonShape.s_mat = new b2Mat22();\n Box2D.Collision.Shapes.b2PolygonShape.prototype.s_mat = Box2D.Collision.Shapes.b2PolygonShape.s_mat;\n });\n b2Shape.b2Shape = function () {};\n b2Shape.prototype.Copy = function () {\n return null;\n }\n b2Shape.prototype.Set = function (other) {\n this.m_radius = other.m_radius;\n }\n b2Shape.prototype.GetType = function () {\n return this.m_type;\n }\n b2Shape.prototype.TestPoint = function (xf, p) {\n return false;\n }\n b2Shape.prototype.RayCast = function (output, input, transform) {\n return false;\n }\n b2Shape.prototype.ComputeAABB = function (aabb, xf) {}\n b2Shape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n }\n b2Shape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n return 0;\n }\n b2Shape.prototype.TestOverlap = function (shape1, transform1, shape2, transform2) {\n var input = new b2DistanceInput();\n input.proxyA = new b2DistanceProxy();\n input.proxyA.Set(shape1);\n input.proxyB = new b2DistanceProxy();\n input.proxyB.Set(shape2);\n input.transformA = transform1;\n input.transformB = transform2;\n input.useRadii = true;\n var simplexCache = new b2SimplexCache();\n simplexCache.count = 0;\n var output = new b2DistanceOutput();\n b2Distance.Distance(output, simplexCache, input);\n return output.distance < 10.0 * Number.MIN_VALUE;\n }\n b2Shape.TestOverlap = b2Shape.prototype.TestOverlap;\n b2Shape.prototype.b2Shape = function () {\n this.m_type = b2Shape.e_unknownShape;\n this.m_radius = b2Settings.b2_linearSlop;\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.Shapes.b2Shape.e_unknownShape = parseInt((-1));\n Box2D.Collision.Shapes.b2Shape.prototype.e_unknownShape = Box2D.Collision.Shapes.b2Shape.e_unknownShape;\n Box2D.Collision.Shapes.b2Shape.e_circleShape = 0;\n Box2D.Collision.Shapes.b2Shape.prototype.e_circleShape = Box2D.Collision.Shapes.b2Shape.e_circleShape;\n Box2D.Collision.Shapes.b2Shape.e_polygonShape = 1;\n Box2D.Collision.Shapes.b2Shape.prototype.e_polygonShape = Box2D.Collision.Shapes.b2Shape.e_polygonShape;\n Box2D.Collision.Shapes.b2Shape.e_edgeShape = 2;\n Box2D.Collision.Shapes.b2Shape.prototype.e_edgeShape = Box2D.Collision.Shapes.b2Shape.e_edgeShape;\n Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount = 3;\n Box2D.Collision.Shapes.b2Shape.prototype.e_shapeTypeCount = Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount;\n Box2D.Collision.Shapes.b2Shape.e_hitCollide = 1;\n Box2D.Collision.Shapes.b2Shape.prototype.e_hitCollide = Box2D.Collision.Shapes.b2Shape.e_hitCollide;\n Box2D.Collision.Shapes.b2Shape.e_missCollide = 0;\n Box2D.Collision.Shapes.b2Shape.prototype.e_missCollide = Box2D.Collision.Shapes.b2Shape.e_missCollide;\n Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide = parseInt((-1));\n Box2D.Collision.Shapes.b2Shape.prototype.e_startsInsideCollide = Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide;\n });\n})(); /* source: disabled*/\n(function () {\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2internal = Box2D.Common.b2internal;\n b2Color.b2Color = function () {\n this._r = 0;\n this._g = 0;\n this._b = 0;\n };\n b2Color.prototype.b2Color = function (rr, gg, bb) {\n if (rr === undefined) rr = 0;\n if (gg === undefined) gg = 0;\n if (bb === undefined) bb = 0;\n this._r = a2j.parseUInt(255 * b2Math.Clamp(rr, 0.0, 1.0));\n this._g = a2j.parseUInt(255 * b2Math.Clamp(gg, 0.0, 1.0));\n this._b = a2j.parseUInt(255 * b2Math.Clamp(bb, 0.0, 1.0));\n }\n b2Color.prototype.Set = function (rr, gg, bb) {\n if (rr === undefined) rr = 0;\n if (gg === undefined) gg = 0;\n if (bb === undefined) bb = 0;\n this._r = a2j.parseUInt(255 * b2Math.Clamp(rr, 0.0, 1.0));\n this._g = a2j.parseUInt(255 * b2Math.Clamp(gg, 0.0, 1.0));\n this._b = a2j.parseUInt(255 * b2Math.Clamp(bb, 0.0, 1.0));\n }\n b2Color.prototype.__defineSetter__('r', function (rr) {\n if (rr === undefined) rr = 0;\n this._r = a2j.parseUInt(255 * b2Math.Clamp(rr, 0.0, 1.0));\n });\n b2Color.prototype.__defineSetter__('g', function (gg) {\n if (gg === undefined) gg = 0;\n this._g = a2j.parseUInt(255 * b2Math.Clamp(gg, 0.0, 1.0));\n });\n b2Color.prototype.__defineSetter__('b', function (bb) {\n if (bb === undefined) bb = 0;\n this._b = a2j.parseUInt(255 * b2Math.Clamp(bb, 0.0, 1.0));\n });\n b2Color.prototype.__defineGetter__('color', function () {\n return (this._r << 16) | (this._g << 8) | (this._b);\n });\n b2Settings.b2Settings = function () {};\n b2Settings.prototype.b2MixFriction = function (friction1, friction2) {\n if (friction1 === undefined) friction1 = 0;\n if (friction2 === undefined) friction2 = 0;\n return Math.sqrt(friction1 * friction2);\n }\n b2Settings.b2MixFriction = b2Settings.prototype.b2MixFriction;\n b2Settings.prototype.b2MixRestitution = function (restitution1, restitution2) {\n if (restitution1 === undefined) restitution1 = 0;\n if (restitution2 === undefined) restitution2 = 0;\n return restitution1 > restitution2 ? restitution1 : restitution2;\n }\n b2Settings.b2MixRestitution = b2Settings.prototype.b2MixRestitution;\n b2Settings.prototype.b2Assert = function (a) {\n if (!a) {\n throw \"Assertion Failed\";\n }\n }\n b2Settings.b2Assert = b2Settings.prototype.b2Assert;\n _A2J_postDefs.push(function () {\n Box2D.Common.b2Settings.VERSION = \"2.1alpha\";\n Box2D.Common.b2Settings.prototype.VERSION = Box2D.Common.b2Settings.VERSION;\n Box2D.Common.b2Settings.USHRT_MAX = 0x0000ffff;\n Box2D.Common.b2Settings.prototype.USHRT_MAX = Box2D.Common.b2Settings.USHRT_MAX;\n Box2D.Common.b2Settings.b2_pi = Math.PI;\n Box2D.Common.b2Settings.prototype.b2_pi = Box2D.Common.b2Settings.b2_pi;\n Box2D.Common.b2Settings.b2_maxManifoldPoints = 2;\n Box2D.Common.b2Settings.prototype.b2_maxManifoldPoints = Box2D.Common.b2Settings.b2_maxManifoldPoints;\n Box2D.Common.b2Settings.b2_aabbExtension = 0.1;\n Box2D.Common.b2Settings.prototype.b2_aabbExtension = Box2D.Common.b2Settings.b2_aabbExtension;\n Box2D.Common.b2Settings.b2_aabbMultiplier = 2.0;\n Box2D.Common.b2Settings.prototype.b2_aabbMultiplier = Box2D.Common.b2Settings.b2_aabbMultiplier;\n Box2D.Common.b2Settings.b2_polygonRadius = 2.0 * b2Settings.b2_linearSlop;\n Box2D.Common.b2Settings.prototype.b2_polygonRadius = Box2D.Common.b2Settings.b2_polygonRadius;\n Box2D.Common.b2Settings.b2_linearSlop = 0.005;\n Box2D.Common.b2Settings.prototype.b2_linearSlop = Box2D.Common.b2Settings.b2_linearSlop;\n Box2D.Common.b2Settings.b2_angularSlop = 2.0 / 180.0 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_angularSlop = Box2D.Common.b2Settings.b2_angularSlop;\n Box2D.Common.b2Settings.b2_toiSlop = 8.0 * b2Settings.b2_linearSlop;\n Box2D.Common.b2Settings.prototype.b2_toiSlop = Box2D.Common.b2Settings.b2_toiSlop;\n Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland = 32;\n Box2D.Common.b2Settings.prototype.b2_maxTOIContactsPerIsland = Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland;\n Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland = 32;\n Box2D.Common.b2Settings.prototype.b2_maxTOIJointsPerIsland = Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland;\n Box2D.Common.b2Settings.b2_velocityThreshold = 1.0;\n Box2D.Common.b2Settings.prototype.b2_velocityThreshold = Box2D.Common.b2Settings.b2_velocityThreshold;\n Box2D.Common.b2Settings.b2_maxLinearCorrection = 0.2;\n Box2D.Common.b2Settings.prototype.b2_maxLinearCorrection = Box2D.Common.b2Settings.b2_maxLinearCorrection;\n Box2D.Common.b2Settings.b2_maxAngularCorrection = 8.0 / 180.0 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_maxAngularCorrection = Box2D.Common.b2Settings.b2_maxAngularCorrection;\n Box2D.Common.b2Settings.b2_maxTranslation = 2.0;\n Box2D.Common.b2Settings.prototype.b2_maxTranslation = Box2D.Common.b2Settings.b2_maxTranslation;\n Box2D.Common.b2Settings.b2_maxTranslationSquared = b2Settings.b2_maxTranslation * b2Settings.b2_maxTranslation;\n Box2D.Common.b2Settings.prototype.b2_maxTranslationSquared = Box2D.Common.b2Settings.b2_maxTranslationSquared;\n Box2D.Common.b2Settings.b2_maxRotation = 0.5 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_maxRotation = Box2D.Common.b2Settings.b2_maxRotation;\n Box2D.Common.b2Settings.b2_maxRotationSquared = b2Settings.b2_maxRotation * b2Settings.b2_maxRotation;\n Box2D.Common.b2Settings.prototype.b2_maxRotationSquared = Box2D.Common.b2Settings.b2_maxRotationSquared;\n Box2D.Common.b2Settings.b2_contactBaumgarte = 0.2;\n Box2D.Common.b2Settings.prototype.b2_contactBaumgarte = Box2D.Common.b2Settings.b2_contactBaumgarte;\n Box2D.Common.b2Settings.b2_timeToSleep = 0.5;\n Box2D.Common.b2Settings.prototype.b2_timeToSleep = Box2D.Common.b2Settings.b2_timeToSleep;\n Box2D.Common.b2Settings.b2_linearSleepTolerance = 0.01;\n Box2D.Common.b2Settings.prototype.b2_linearSleepTolerance = Box2D.Common.b2Settings.b2_linearSleepTolerance;\n Box2D.Common.b2Settings.b2_angularSleepTolerance = 2.0 / 180.0 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_angularSleepTolerance = Box2D.Common.b2Settings.b2_angularSleepTolerance;\n });\n})(); /* source: disabled*/\n(function () {\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n b2Mat22.b2Mat22 = function () {\n this.col1 = new b2Vec2();\n this.col2 = new b2Vec2();\n };\n b2Mat22.prototype.b2Mat22 = function () {\n this.SetIdentity();\n }\n b2Mat22.prototype.FromAngle = function (angle) {\n if (angle === undefined) angle = 0;\n var mat = new b2Mat22();\n mat.Set(angle);\n return mat;\n }\n b2Mat22.FromAngle = b2Mat22.prototype.FromAngle;\n b2Mat22.prototype.FromVV = function (c1, c2) {\n var mat = new b2Mat22();\n mat.SetVV(c1, c2);\n return mat;\n }\n b2Mat22.FromVV = b2Mat22.prototype.FromVV;\n b2Mat22.prototype.Set = function (angle) {\n if (angle === undefined) angle = 0;\n var c = Math.cos(angle);\n var s = Math.sin(angle);\n this.col1.x = c;\n this.col2.x = (-s);\n this.col1.y = s;\n this.col2.y = c;\n }\n b2Mat22.prototype.SetVV = function (c1, c2) {\n this.col1.SetV(c1);\n this.col2.SetV(c2);\n }\n b2Mat22.prototype.Copy = function () {\n var mat = new b2Mat22();\n mat.SetM(this);\n return mat;\n }\n b2Mat22.prototype.SetM = function (m) {\n this.col1.SetV(m.col1);\n this.col2.SetV(m.col2);\n }\n b2Mat22.prototype.AddM = function (m) {\n this.col1.x += m.col1.x;\n this.col1.y += m.col1.y;\n this.col2.x += m.col2.x;\n this.col2.y += m.col2.y;\n }\n b2Mat22.prototype.SetIdentity = function () {\n this.col1.x = 1.0;\n this.col2.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 1.0;\n }\n b2Mat22.prototype.SetZero = function () {\n this.col1.x = 0.0;\n this.col2.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 0.0;\n }\n b2Mat22.prototype.GetAngle = function () {\n return Math.atan2(this.col1.y, this.col1.x);\n }\n b2Mat22.prototype.GetInverse = function (out) {\n var a = this.col1.x;\n var b = this.col2.x;\n var c = this.col1.y;\n var d = this.col2.y;\n var det = a * d - b * c;\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.col1.x = det * d;\n out.col2.x = (-det * b);\n out.col1.y = (-det * c);\n out.col2.y = det * a;\n return out;\n }\n b2Mat22.prototype.Solve = function (out, bX, bY) {\n if (bX === undefined) bX = 0;\n if (bY === undefined) bY = 0;\n var a11 = this.col1.x;\n var a12 = this.col2.x;\n var a21 = this.col1.y;\n var a22 = this.col2.y;\n var det = a11 * a22 - a12 * a21;\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.x = det * (a22 * bX - a12 * bY);\n out.y = det * (a11 * bY - a21 * bX);\n return out;\n }\n b2Mat22.prototype.Abs = function () {\n this.col1.Abs();\n this.col2.Abs();\n }\n b2Mat33.b2Mat33 = function () {\n this.col1 = new b2Vec3();\n this.col2 = new b2Vec3();\n this.col3 = new b2Vec3();\n };\n b2Mat33.prototype.b2Mat33 = function (c1, c2, c3) {\n if (c1 === undefined) c1 = null;\n if (c2 === undefined) c2 = null;\n if (c3 === undefined) c3 = null;\n if (!c1 && !c2 && !c3) {\n this.col1.SetZero();\n this.col2.SetZero();\n this.col3.SetZero();\n }\n else {\n this.col1.SetV(c1);\n this.col2.SetV(c2);\n this.col3.SetV(c3);\n }\n }\n b2Mat33.prototype.SetVVV = function (c1, c2, c3) {\n this.col1.SetV(c1);\n this.col2.SetV(c2);\n this.col3.SetV(c3);\n }\n b2Mat33.prototype.Copy = function () {\n return new b2Mat33(this.col1, this.col2, this.col3);\n }\n b2Mat33.prototype.SetM = function (m) {\n this.col1.SetV(m.col1);\n this.col2.SetV(m.col2);\n this.col3.SetV(m.col3);\n }\n b2Mat33.prototype.AddM = function (m) {\n this.col1.x += m.col1.x;\n this.col1.y += m.col1.y;\n this.col1.z += m.col1.z;\n this.col2.x += m.col2.x;\n this.col2.y += m.col2.y;\n this.col2.z += m.col2.z;\n this.col3.x += m.col3.x;\n this.col3.y += m.col3.y;\n this.col3.z += m.col3.z;\n }\n b2Mat33.prototype.SetIdentity = function () {\n this.col1.x = 1.0;\n this.col2.x = 0.0;\n this.col3.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 1.0;\n this.col3.y = 0.0;\n this.col1.z = 0.0;\n this.col2.z = 0.0;\n this.col3.z = 1.0;\n }\n b2Mat33.prototype.SetZero = function () {\n this.col1.x = 0.0;\n this.col2.x = 0.0;\n this.col3.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 0.0;\n this.col3.y = 0.0;\n this.col1.z = 0.0;\n this.col2.z = 0.0;\n this.col3.z = 0.0;\n }\n b2Mat33.prototype.Solve22 = function (out, bX, bY) {\n if (bX === undefined) bX = 0;\n if (bY === undefined) bY = 0;\n var a11 = this.col1.x;\n var a12 = this.col2.x;\n var a21 = this.col1.y;\n var a22 = this.col2.y;\n var det = a11 * a22 - a12 * a21;\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.x = det * (a22 * bX - a12 * bY);\n out.y = det * (a11 * bY - a21 * bX);\n return out;\n }\n b2Mat33.prototype.Solve33 = function (out, bX, bY, bZ) {\n if (bX === undefined) bX = 0;\n if (bY === undefined) bY = 0;\n if (bZ === undefined) bZ = 0;\n var a11 = this.col1.x;\n var a21 = this.col1.y;\n var a31 = this.col1.z;\n var a12 = this.col2.x;\n var a22 = this.col2.y;\n var a32 = this.col2.z;\n var a13 = this.col3.x;\n var a23 = this.col3.y;\n var a33 = this.col3.z;\n var det = a11 * (a22 * a33 - a32 * a23) + a21 * (a32 * a13 - a12 * a33) + a31 * (a12 * a23 - a22 * a13);\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.x = det * (bX * (a22 * a33 - a32 * a23) + bY * (a32 * a13 - a12 * a33) + bZ * (a12 * a23 - a22 * a13));\n out.y = det * (a11 * (bY * a33 - bZ * a23) + a21 * (bZ * a13 - bX * a33) + a31 * (bX * a23 - bY * a13));\n out.z = det * (a11 * (a22 * bZ - a32 * bY) + a21 * (a32 * bX - a12 * bZ) + a31 * (a12 * bY - a22 * bX));\n return out;\n }\n b2Math.b2Math = function () {};\n b2Math.prototype.IsValid = function (x) {\n if (x === undefined) x = 0;\n return isFinite(x);\n }\n b2Math.IsValid = b2Math.prototype.IsValid;\n b2Math.prototype.Dot = function (a, b) {\n return a.x * b.x + a.y * b.y;\n }\n b2Math.Dot = b2Math.prototype.Dot;\n b2Math.prototype.CrossVV = function (a, b) {\n return a.x * b.y - a.y * b.x;\n }\n b2Math.CrossVV = b2Math.prototype.CrossVV;\n b2Math.prototype.CrossVF = function (a, s) {\n if (s === undefined) s = 0;\n var v = new b2Vec2(s * a.y, (-s * a.x));\n return v;\n }\n b2Math.CrossVF = b2Math.prototype.CrossVF;\n b2Math.prototype.CrossFV = function (s, a) {\n if (s === undefined) s = 0;\n var v = new b2Vec2((-s * a.y), s * a.x);\n return v;\n }\n b2Math.CrossFV = b2Math.prototype.CrossFV;\n b2Math.prototype.MulMV = function (A, v) {\n var u = new b2Vec2(A.col1.x * v.x + A.col2.x * v.y, A.col1.y * v.x + A.col2.y * v.y);\n return u;\n }\n b2Math.MulMV = b2Math.prototype.MulMV;\n b2Math.prototype.MulTMV = function (A, v) {\n var u = new b2Vec2(this.Dot(v, A.col1), this.Dot(v, A.col2));\n return u;\n }\n b2Math.MulTMV = b2Math.prototype.MulTMV;\n b2Math.prototype.MulX = function (T, v) {\n var a = this.MulMV(T.R, v);\n a.x += T.position.x;\n a.y += T.position.y;\n return a;\n }\n b2Math.MulX = b2Math.prototype.MulX;\n b2Math.prototype.MulXT = function (T, v) {\n var a = this.SubtractVV(v, T.position);\n var tX = (a.x * T.R.col1.x + a.y * T.R.col1.y);\n a.y = (a.x * T.R.col2.x + a.y * T.R.col2.y);\n a.x = tX;\n return a;\n }\n b2Math.MulXT = b2Math.prototype.MulXT;\n b2Math.prototype.AddVV = function (a, b) {\n var v = new b2Vec2(a.x + b.x, a.y + b.y);\n return v;\n }\n b2Math.AddVV = b2Math.prototype.AddVV;\n b2Math.prototype.SubtractVV = function (a, b) {\n var v = new b2Vec2(a.x - b.x, a.y - b.y);\n return v;\n }\n b2Math.SubtractVV = b2Math.prototype.SubtractVV;\n b2Math.prototype.Distance = function (a, b) {\n var cX = a.x - b.x;\n var cY = a.y - b.y;\n return Math.sqrt(cX * cX + cY * cY);\n }\n b2Math.Distance = b2Math.prototype.Distance;\n b2Math.prototype.DistanceSquared = function (a, b) {\n var cX = a.x - b.x;\n var cY = a.y - b.y;\n return (cX * cX + cY * cY);\n }\n b2Math.DistanceSquared = b2Math.prototype.DistanceSquared;\n b2Math.prototype.MulFV = function (s, a) {\n if (s === undefined) s = 0;\n var v = new b2Vec2(s * a.x, s * a.y);\n return v;\n }\n b2Math.MulFV = b2Math.prototype.MulFV;\n b2Math.prototype.AddMM = function (A, B) {\n var C = b2Mat22.FromVV(this.AddVV(A.col1, B.col1), this.AddVV(A.col2, B.col2));\n return C;\n }\n b2Math.AddMM = b2Math.prototype.AddMM;\n b2Math.prototype.MulMM = function (A, B) {\n var C = b2Mat22.FromVV(this.MulMV(A, B.col1), this.MulMV(A, B.col2));\n return C;\n }\n b2Math.MulMM = b2Math.prototype.MulMM;\n b2Math.prototype.MulTMM = function (A, B) {\n var c1 = new b2Vec2(this.Dot(A.col1, B.col1), this.Dot(A.col2, B.col1));\n var c2 = new b2Vec2(this.Dot(A.col1, B.col2), this.Dot(A.col2, B.col2));\n var C = b2Mat22.FromVV(c1, c2);\n return C;\n }\n b2Math.MulTMM = b2Math.prototype.MulTMM;\n b2Math.prototype.Abs = function (a) {\n if (a === undefined) a = 0;\n return a > 0.0 ? a : (-a);\n }\n b2Math.Abs = b2Math.prototype.Abs;\n b2Math.prototype.AbsV = function (a) {\n var b = new b2Vec2(this.Abs(a.x), this.Abs(a.y));\n return b;\n }\n b2Math.AbsV = b2Math.prototype.AbsV;\n b2Math.prototype.AbsM = function (A) {\n var B = b2Mat22.FromVV(this.AbsV(A.col1), this.AbsV(A.col2));\n return B;\n }\n b2Math.AbsM = b2Math.prototype.AbsM;\n b2Math.prototype.Min = function (a, b) {\n if (a === undefined) a = 0;\n if (b === undefined) b = 0;\n return a < b ? a : b;\n }\n b2Math.Min = b2Math.prototype.Min;\n b2Math.prototype.MinV = function (a, b) {\n var c = new b2Vec2(this.Min(a.x, b.x), this.Min(a.y, b.y));\n return c;\n }\n b2Math.MinV = b2Math.prototype.MinV;\n b2Math.prototype.Max = function (a, b) {\n if (a === undefined) a = 0;\n if (b === undefined) b = 0;\n return a > b ? a : b;\n }\n b2Math.Max = b2Math.prototype.Max;\n b2Math.prototype.MaxV = function (a, b) {\n var c = new b2Vec2(this.Max(a.x, b.x), this.Max(a.y, b.y));\n return c;\n }\n b2Math.MaxV = b2Math.prototype.MaxV;\n b2Math.prototype.Clamp = function (a, low, high) {\n if (a === undefined) a = 0;\n if (low === undefined) low = 0;\n if (high === undefined) high = 0;\n return a < low ? low : a > high ? high : a;\n }\n b2Math.Clamp = b2Math.prototype.Clamp;\n b2Math.prototype.ClampV = function (a, low, high) {\n return this.MaxV(low, this.MinV(a, high));\n }\n b2Math.ClampV = b2Math.prototype.ClampV;\n b2Math.prototype.Swap = function (a, b) {\n var tmp = a[0];\n a[0] = b[0];\n b[0] = tmp;\n }\n b2Math.Swap = b2Math.prototype.Swap;\n b2Math.prototype.Random = function () {\n return Math.random() * 2 - 1;\n }\n b2Math.Random = b2Math.prototype.Random;\n b2Math.prototype.RandomRange = function (lo, hi) {\n if (lo === undefined) lo = 0;\n if (hi === undefined) hi = 0;\n var r = Math.random();\n r = (hi - lo) * r + lo;\n return r;\n }\n b2Math.RandomRange = b2Math.prototype.RandomRange;\n b2Math.prototype.NextPowerOfTwo = function (x) {\n if (x === undefined) x = 0;\n x |= (x >> 1) & 0x7FFFFFFF;\n x |= (x >> 2) & 0x3FFFFFFF;\n x |= (x >> 4) & 0x0FFFFFFF;\n x |= (x >> 8) & 0x00FFFFFF;\n x |= (x >> 16) & 0x0000FFFF;\n return x + 1;\n }\n b2Math.NextPowerOfTwo = b2Math.prototype.NextPowerOfTwo;\n b2Math.prototype.IsPowerOfTwo = function (x) {\n if (x === undefined) x = 0;\n var result = x > 0 && (x & (x - 1)) == 0;\n return result;\n }\n b2Math.IsPowerOfTwo = b2Math.prototype.IsPowerOfTwo;\n _A2J_postDefs.push(function () {\n Box2D.Common.Math.b2Math.b2Vec2_zero = new b2Vec2(0.0, 0.0);\n Box2D.Common.Math.b2Math.prototype.b2Vec2_zero = Box2D.Common.Math.b2Math.b2Vec2_zero;\n Box2D.Common.Math.b2Math.b2Mat22_identity = b2Mat22.FromVV(new b2Vec2(1.0, 0.0), new b2Vec2(0.0, 1.0));\n Box2D.Common.Math.b2Math.prototype.b2Mat22_identity = Box2D.Common.Math.b2Math.b2Mat22_identity;\n Box2D.Common.Math.b2Math.b2Transform_identity = new b2Transform(b2Math.b2Vec2_zero, b2Math.b2Mat22_identity);\n Box2D.Common.Math.b2Math.prototype.b2Transform_identity = Box2D.Common.Math.b2Math.b2Transform_identity;\n });\n b2Sweep.b2Sweep = function () {\n this.localCenter = new b2Vec2();\n this.c0 = new b2Vec2;\n this.c = new b2Vec2();\n };\n b2Sweep.prototype.Set = function (other) {\n this.localCenter.SetV(other.localCenter);\n this.c0.SetV(other.c0);\n this.c.SetV(other.c);\n this.a0 = other.a0;\n this.a = other.a;\n this.t0 = other.t0;\n }\n b2Sweep.prototype.Copy = function () {\n var copy = new b2Sweep();\n copy.localCenter.SetV(this.localCenter);\n copy.c0.SetV(this.c0);\n copy.c.SetV(this.c);\n copy.a0 = this.a0;\n copy.a = this.a;\n copy.t0 = this.t0;\n return copy;\n }\n b2Sweep.prototype.GetTransform = function (xf, alpha) {\n if (alpha === undefined) alpha = 0;\n xf.position.x = (1.0 - alpha) * this.c0.x + alpha * this.c.x;\n xf.position.y = (1.0 - alpha) * this.c0.y + alpha * this.c.y;\n var angle = (1.0 - alpha) * this.a0 + alpha * this.a;\n xf.R.Set(angle);\n var tMat = xf.R;\n xf.position.x -= (tMat.col1.x * this.localCenter.x + tMat.col2.x * this.localCenter.y);\n xf.position.y -= (tMat.col1.y * this.localCenter.x + tMat.col2.y * this.localCenter.y);\n }\n b2Sweep.prototype.Advance = function (t) {\n if (t === undefined) t = 0;\n if (this.t0 < t && 1.0 - this.t0 > Number.MIN_VALUE) {\n var alpha = (t - this.t0) / (1.0 - this.t0);\n this.c0.x = (1.0 - alpha) * this.c0.x + alpha * this.c.x;\n this.c0.y = (1.0 - alpha) * this.c0.y + alpha * this.c.y;\n this.a0 = (1.0 - alpha) * this.a0 + alpha * this.a;\n this.t0 = t;\n }\n }\n b2Transform.b2Transform = function () {\n this.position = new b2Vec2;\n this.R = new b2Mat22();\n };\n b2Transform.prototype.b2Transform = function (pos, r) {\n if (pos === undefined) pos = null;\n if (r === undefined) r = null;\n if (pos) {\n this.position.SetV(pos);\n this.R.SetM(r);\n }\n }\n b2Transform.prototype.Initialize = function (pos, r) {\n this.position.SetV(pos);\n this.R.SetM(r);\n }\n b2Transform.prototype.SetIdentity = function () {\n this.position.SetZero();\n this.R.SetIdentity();\n }\n b2Transform.prototype.Set = function (x) {\n this.position.SetV(x.position);\n this.R.SetM(x.R);\n }\n b2Transform.prototype.GetAngle = function () {\n return Math.atan2(this.R.col1.y, this.R.col1.x);\n }\n b2Vec2.b2Vec2 = function () {};\n b2Vec2.prototype.b2Vec2 = function (x_, y_) {\n if (x_ === undefined) x_ = 0;\n if (y_ === undefined) y_ = 0;\n this.x = x_;\n this.y = y_;\n }\n b2Vec2.prototype.SetZero = function () {\n this.x = 0.0;\n this.y = 0.0;\n }\n b2Vec2.prototype.Set = function (x_, y_) {\n if (x_ === undefined) x_ = 0;\n if (y_ === undefined) y_ = 0;\n this.x = x_;\n this.y = y_;\n }\n b2Vec2.prototype.SetV = function (v) {\n this.x = v.x;\n this.y = v.y;\n }\n b2Vec2.prototype.GetNegative = function () {\n return new b2Vec2((-this.x), (-this.y));\n }\n b2Vec2.prototype.NegativeSelf = function () {\n this.x = (-this.x);\n this.y = (-this.y);\n }\n b2Vec2.prototype.Make = function (x_, y_) {\n if (x_ === undefined) x_ = 0;\n if (y_ === undefined) y_ = 0;\n return new b2Vec2(x_, y_);\n }\n b2Vec2.Make = b2Vec2.prototype.Make;\n b2Vec2.prototype.Copy = function () {\n return new b2Vec2(this.x, this.y);\n }\n b2Vec2.prototype.Add = function (v) {\n this.x += v.x;\n this.y += v.y;\n }\n b2Vec2.prototype.Subtract = function (v) {\n this.x -= v.x;\n this.y -= v.y;\n }\n b2Vec2.prototype.Multiply = function (a) {\n if (a === undefined) a = 0;\n this.x *= a;\n this.y *= a;\n }\n b2Vec2.prototype.MulM = function (A) {\n var tX = this.x;\n this.x = A.col1.x * tX + A.col2.x * this.y;\n this.y = A.col1.y * tX + A.col2.y * this.y;\n }\n b2Vec2.prototype.MulTM = function (A) {\n var tX = b2Math.Dot(this, A.col1);\n this.y = b2Math.Dot(this, A.col2);\n this.x = tX;\n }\n b2Vec2.prototype.CrossVF = function (s) {\n if (s === undefined) s = 0;\n var tX = this.x;\n this.x = s * this.y;\n this.y = (-s * tX);\n }\n b2Vec2.prototype.CrossFV = function (s) {\n if (s === undefined) s = 0;\n var tX = this.x;\n this.x = (-s * this.y);\n this.y = s * tX;\n }\n b2Vec2.prototype.MinV = function (b) {\n this.x = this.x < b.x ? this.x : b.x;\n this.y = this.y < b.y ? this.y : b.y;\n }\n b2Vec2.prototype.MaxV = function (b) {\n this.x = this.x > b.x ? this.x : b.x;\n this.y = this.y > b.y ? this.y : b.y;\n }\n b2Vec2.prototype.Abs = function () {\n if (this.x < 0) this.x = (-this.x);\n if (this.y < 0) this.y = (-this.y);\n }\n b2Vec2.prototype.Length = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n b2Vec2.prototype.LengthSquared = function () {\n return (this.x * this.x + this.y * this.y);\n }\n b2Vec2.prototype.Normalize = function () {\n var length = Math.sqrt(this.x * this.x + this.y * this.y);\n if (length < Number.MIN_VALUE) {\n return 0.0;\n }\n var invLength = 1.0 / length;\n this.x *= invLength;\n this.y *= invLength;\n return length;\n }\n b2Vec2.prototype.IsValid = function () {\n return b2Math.IsValid(this.x) && b2Math.IsValid(this.y);\n }\n b2Vec3.b2Vec3 = function () {};\n b2Vec3.prototype.b2Vec3 = function (x, y, z) {\n if (x === undefined) x = 0;\n if (y === undefined) y = 0;\n if (z === undefined) z = 0;\n this.x = x;\n this.y = y;\n this.z = z;\n }\n b2Vec3.prototype.SetZero = function () {\n this.x = this.y = this.z = 0.0;\n }\n b2Vec3.prototype.Set = function (x, y, z) {\n if (x === undefined) x = 0;\n if (y === undefined) y = 0;\n if (z === undefined) z = 0;\n this.x = x;\n this.y = y;\n this.z = z;\n }\n b2Vec3.prototype.SetV = function (v) {\n this.x = v.x;\n this.y = v.y;\n this.z = v.z;\n }\n b2Vec3.prototype.GetNegative = function () {\n return new b2Vec3((-this.x), (-this.y), (-this.z));\n }\n b2Vec3.prototype.NegativeSelf = function () {\n this.x = (-this.x);\n this.y = (-this.y);\n this.z = (-this.z);\n }\n b2Vec3.prototype.Copy = function () {\n return new b2Vec3(this.x, this.y, this.z);\n }\n b2Vec3.prototype.Add = function (v) {\n this.x += v.x;\n this.y += v.y;\n this.z += v.z;\n }\n b2Vec3.prototype.Subtract = function (v) {\n this.x -= v.x;\n this.y -= v.y;\n this.z -= v.z;\n }\n b2Vec3.prototype.Multiply = function (a) {\n if (a === undefined) a = 0;\n this.x *= a;\n this.y *= a;\n this.z *= a;\n }\n})(); /* source: disabled*/\n(function () {\n var b2ControllerEdge = Box2D.Dynamics.Controllers.b2ControllerEdge;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2CircleContact = Box2D.Dynamics.Contacts.b2CircleContact;\n var b2Contact = Box2D.Dynamics.Contacts.b2Contact;\n var b2ContactConstraint = Box2D.Dynamics.Contacts.b2ContactConstraint;\n var b2ContactConstraintPoint = Box2D.Dynamics.Contacts.b2ContactConstraintPoint;\n var b2ContactEdge = Box2D.Dynamics.Contacts.b2ContactEdge;\n var b2ContactFactory = Box2D.Dynamics.Contacts.b2ContactFactory;\n var b2ContactRegister = Box2D.Dynamics.Contacts.b2ContactRegister;\n var b2ContactResult = Box2D.Dynamics.Contacts.b2ContactResult;\n var b2ContactSolver = Box2D.Dynamics.Contacts.b2ContactSolver;\n var b2EdgeAndCircleContact = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact;\n var b2NullContact = Box2D.Dynamics.Contacts.b2NullContact;\n var b2PolyAndCircleContact = Box2D.Dynamics.Contacts.b2PolyAndCircleContact;\n var b2PolyAndEdgeContact = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact;\n var b2PolygonContact = Box2D.Dynamics.Contacts.b2PolygonContact;\n var b2PositionSolverManifold = Box2D.Dynamics.Contacts.b2PositionSolverManifold;\n var b2Controller = Box2D.Dynamics.Controllers.b2Controller;\n var b2ControllerEdge = Box2D.Dynamics.Controllers.b2ControllerEdge;\n var b2DistanceJoint = Box2D.Dynamics.Joints.b2DistanceJoint;\n var b2DistanceJointDef = Box2D.Dynamics.Joints.b2DistanceJointDef;\n var b2FrictionJoint = Box2D.Dynamics.Joints.b2FrictionJoint;\n var b2FrictionJointDef = Box2D.Dynamics.Joints.b2FrictionJointDef;\n var b2GearJoint = Box2D.Dynamics.Joints.b2GearJoint;\n var b2GearJointDef = Box2D.Dynamics.Joints.b2GearJointDef;\n var b2Jacobian = Box2D.Dynamics.Joints.b2Jacobian;\n var b2Joint = Box2D.Dynamics.Joints.b2Joint;\n var b2JointDef = Box2D.Dynamics.Joints.b2JointDef;\n var b2JointEdge = Box2D.Dynamics.Joints.b2JointEdge;\n var b2LineJoint = Box2D.Dynamics.Joints.b2LineJoint;\n var b2LineJointDef = Box2D.Dynamics.Joints.b2LineJointDef;\n var b2MouseJoint = Box2D.Dynamics.Joints.b2MouseJoint;\n var b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;\n var b2PrismaticJoint = Box2D.Dynamics.Joints.b2PrismaticJoint;\n var b2PrismaticJointDef = Box2D.Dynamics.Joints.b2PrismaticJointDef;\n var b2PulleyJoint = Box2D.Dynamics.Joints.b2PulleyJoint;\n var b2PulleyJointDef = Box2D.Dynamics.Joints.b2PulleyJointDef;\n var b2RevoluteJoint = Box2D.Dynamics.Joints.b2RevoluteJoint;\n var b2RevoluteJointDef = Box2D.Dynamics.Joints.b2RevoluteJointDef;\n var b2WeldJoint = Box2D.Dynamics.Joints.b2WeldJoint;\n var b2WeldJointDef = Box2D.Dynamics.Joints.b2WeldJointDef;\n var b2internal = Box2D.Common.b2internal;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n b2Body.b2Body = function () {\n this.m_xf = new b2Transform();\n this.m_sweep = new b2Sweep();\n this.m_linearVelocity = new b2Vec2();\n this.m_force = new b2Vec2();\n };\n b2Body.prototype.connectEdges = function (s1, s2, angle1) {\n if (angle1 === undefined) angle1 = 0;\n var angle2 = Math.atan2(s2.GetDirectionVector().y, s2.GetDirectionVector().x);\n var coreOffset = Math.tan((angle2 - angle1) * 0.5);\n var core = b2Math.MulFV(coreOffset, s2.GetDirectionVector());\n core = b2Math.SubtractVV(core, s2.GetNormalVector());\n core = b2Math.MulFV(b2Settings.b2_toiSlop, core);\n core = b2Math.AddVV(core, s2.GetVertex1());\n var cornerDir = b2Math.AddVV(s1.GetDirectionVector(), s2.GetDirectionVector());\n cornerDir.Normalize();\n var convex = b2Math.Dot(s1.GetDirectionVector(), s2.GetNormalVector()) > 0.0;\n s1.SetNextEdge(s2, core, cornerDir, convex);\n s2.SetPrevEdge(s1, core, cornerDir, convex);\n return angle2;\n }\n b2Body.prototype.CreateFixture = function (def) {\n if (this.m_world.IsLocked() == true) {\n return null;\n }\n var fixture = new b2Fixture();\n fixture.Create(this, this.m_xf, def);\n if (this.m_flags & b2Body.e_activeFlag) {\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n fixture.CreateProxy(broadPhase, this.m_xf);\n }\n fixture.m_next = this.m_fixtureList;\n this.m_fixtureList = fixture;\n ++this.m_fixtureCount;\n fixture.m_body = this;\n if (fixture.m_density > 0.0) {\n this.ResetMassData();\n }\n this.m_world.m_flags |= b2World.e_newFixture;\n return fixture;\n }\n b2Body.prototype.CreateFixture2 = function (shape, density) {\n if (density === undefined) density = 0.0;\n var def = new b2FixtureDef();\n def.shape = shape;\n def.density = density;\n return this.CreateFixture(def);\n }\n b2Body.prototype.DestroyFixture = function (fixture) {\n if (this.m_world.IsLocked() == true) {\n return;\n }\n var node = this.m_fixtureList;\n var ppF = null;\n var found = false;\n while (node != null) {\n if (node == fixture) {\n if (ppF) ppF.m_next = fixture.m_next;\n else this.m_fixtureList = fixture.m_next;\n found = true;\n break;\n }\n ppF = node;\n node = node.m_next;\n }\n var edge = this.m_contactList;\n while (edge) {\n var c = edge.contact;\n edge = edge.next;\n var fixtureA = c.GetFixtureA();\n var fixtureB = c.GetFixtureB();\n if (fixture == fixtureA || fixture == fixtureB) {\n this.m_world.m_contactManager.Destroy(c);\n }\n }\n if (this.m_flags & b2Body.e_activeFlag) {\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n fixture.DestroyProxy(broadPhase);\n }\n else {}\n fixture.Destroy();\n fixture.m_body = null;\n fixture.m_next = null;\n --this.m_fixtureCount;\n this.ResetMassData();\n }\n b2Body.prototype.SetPositionAndAngle = function (position, angle) {\n if (angle === undefined) angle = 0;\n var f;\n if (this.m_world.IsLocked() == true) {\n return;\n }\n this.m_xf.R.Set(angle);\n this.m_xf.position.SetV(position);\n var tMat = this.m_xf.R;\n var tVec = this.m_sweep.localCenter;\n this.m_sweep.c.x = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n this.m_sweep.c.y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_sweep.c.x += this.m_xf.position.x;\n this.m_sweep.c.y += this.m_xf.position.y;\n this.m_sweep.c0.SetV(this.m_sweep.c);\n this.m_sweep.a0 = this.m_sweep.a = angle;\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.Synchronize(broadPhase, this.m_xf, this.m_xf);\n }\n this.m_world.m_contactManager.FindNewContacts();\n }\n b2Body.prototype.SetTransform = function (xf) {\n this.SetPositionAndAngle(xf.position, xf.GetAngle());\n }\n b2Body.prototype.GetTransform = function () {\n return this.m_xf;\n }\n b2Body.prototype.GetPosition = function () {\n return this.m_xf.position;\n }\n b2Body.prototype.SetPosition = function (position) {\n this.SetPositionAndAngle(position, this.GetAngle());\n }\n b2Body.prototype.GetAngle = function () {\n return this.m_sweep.a;\n }\n b2Body.prototype.SetAngle = function (angle) {\n if (angle === undefined) angle = 0;\n this.SetPositionAndAngle(this.GetPosition(), angle);\n }\n b2Body.prototype.GetWorldCenter = function () {\n return this.m_sweep.c;\n }\n b2Body.prototype.GetLocalCenter = function () {\n return this.m_sweep.localCenter;\n }\n b2Body.prototype.SetLinearVelocity = function (v) {\n if (this.m_type == b2Body.b2_staticBody) {\n return;\n }\n this.m_linearVelocity.SetV(v);\n }\n b2Body.prototype.GetLinearVelocity = function () {\n return this.m_linearVelocity;\n }\n b2Body.prototype.SetAngularVelocity = function (omega) {\n if (omega === undefined) omega = 0;\n if (this.m_type == b2Body.b2_staticBody) {\n return;\n }\n this.m_angularVelocity = omega;\n }\n b2Body.prototype.GetAngularVelocity = function () {\n return this.m_angularVelocity;\n }\n b2Body.prototype.GetDefinition = function () {\n var bd = new b2BodyDef();\n bd.type = this.GetType();\n bd.allowSleep = (this.m_flags & b2Body.e_allowSleepFlag) == b2Body.e_allowSleepFlag;\n bd.angle = this.GetAngle();\n bd.angularDamping = this.m_angularDamping;\n bd.angularVelocity = this.m_angularVelocity;\n bd.fixedRotation = (this.m_flags & b2Body.e_fixedRotationFlag) == b2Body.e_fixedRotationFlag;\n bd.bullet = (this.m_flags & b2Body.e_bulletFlag) == b2Body.e_bulletFlag;\n bd.awake = (this.m_flags & b2Body.e_awakeFlag) == b2Body.e_awakeFlag;\n bd.linearDamping = this.m_linearDamping;\n bd.linearVelocity.SetV(this.GetLinearVelocity());\n bd.position = this.GetPosition();\n bd.userData = this.GetUserData();\n return bd;\n }\n b2Body.prototype.ApplyForce = function (force, point) {\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n if (this.IsAwake() == false) {\n this.SetAwake(true);\n }\n this.m_force.x += force.x;\n this.m_force.y += force.y;\n this.m_torque += ((point.x - this.m_sweep.c.x) * force.y - (point.y - this.m_sweep.c.y) * force.x);\n }\n b2Body.prototype.ApplyTorque = function (torque) {\n if (torque === undefined) torque = 0;\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n if (this.IsAwake() == false) {\n this.SetAwake(true);\n }\n this.m_torque += torque;\n }\n b2Body.prototype.ApplyImpulse = function (impulse, point) {\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n if (this.IsAwake() == false) {\n this.SetAwake(true);\n }\n this.m_linearVelocity.x += this.m_invMass * impulse.x;\n this.m_linearVelocity.y += this.m_invMass * impulse.y;\n this.m_angularVelocity += this.m_invI * ((point.x - this.m_sweep.c.x) * impulse.y - (point.y - this.m_sweep.c.y) * impulse.x);\n }\n b2Body.prototype.Split = function (callback) {\n var linearVelocity = this.GetLinearVelocity().Copy();\n var angularVelocity = this.GetAngularVelocity();\n var center = this.GetWorldCenter();\n var body1 = this;\n var body2 = this.m_world.CreateBody(this.GetDefinition());\n var prev;\n for (var f = body1.m_fixtureList; f;) {\n if (callback(f)) {\n var next = f.m_next;\n if (prev) {\n prev.m_next = next;\n }\n else {\n body1.m_fixtureList = next;\n }\n body1.m_fixtureCount--;\n f.m_next = body2.m_fixtureList;\n body2.m_fixtureList = f;\n body2.m_fixtureCount++;\n f.m_body = body2;\n f = next;\n }\n else {\n prev = f;\n f = f.m_next;\n }\n }\n body1.ResetMassData();\n body2.ResetMassData();\n var center1 = body1.GetWorldCenter();\n var center2 = body2.GetWorldCenter();\n var velocity1 = b2Math.AddVV(linearVelocity, b2Math.CrossFV(angularVelocity, b2Math.SubtractVV(center1, center)));\n var velocity2 = b2Math.AddVV(linearVelocity, b2Math.CrossFV(angularVelocity, b2Math.SubtractVV(center2, center)));\n body1.SetLinearVelocity(velocity1);\n body2.SetLinearVelocity(velocity2);\n body1.SetAngularVelocity(angularVelocity);\n body2.SetAngularVelocity(angularVelocity);\n body1.SynchronizeFixtures();\n body2.SynchronizeFixtures();\n return body2;\n }\n b2Body.prototype.Merge = function (other) {\n var f;\n for (f = other.m_fixtureList;\n f;) {\n var next = f.m_next;\n other.m_fixtureCount--;\n f.m_next = this.m_fixtureList;\n this.m_fixtureList = f;\n this.m_fixtureCount++;\n f.m_body = body2;\n f = next;\n }\n body1.m_fixtureCount = 0;\n var body1 = this;\n var body2 = other;\n var center1 = body1.GetWorldCenter();\n var center2 = body2.GetWorldCenter();\n var velocity1 = body1.GetLinearVelocity().Copy();\n var velocity2 = body2.GetLinearVelocity().Copy();\n var angular1 = body1.GetAngularVelocity();\n var angular = body2.GetAngularVelocity();\n body1.ResetMassData();\n this.SynchronizeFixtures();\n }\n b2Body.prototype.GetMass = function () {\n return this.m_mass;\n }\n b2Body.prototype.GetInertia = function () {\n return this.m_I;\n }\n b2Body.prototype.GetMassData = function (data) {\n data.mass = this.m_mass;\n data.I = this.m_I;\n data.center.SetV(this.m_sweep.localCenter);\n }\n b2Body.prototype.SetMassData = function (massData) {\n b2Settings.b2Assert(this.m_world.IsLocked() == false);\n if (this.m_world.IsLocked() == true) {\n return;\n }\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n this.m_invMass = 0.0;\n this.m_I = 0.0;\n this.m_invI = 0.0;\n this.m_mass = massData.mass;\n if (this.m_mass <= 0.0) {\n this.m_mass = 1.0;\n }\n this.m_invMass = 1.0 / this.m_mass;\n if (massData.I > 0.0 && (this.m_flags & b2Body.e_fixedRotationFlag) == 0) {\n this.m_I = massData.I - this.m_mass * (massData.center.x * massData.center.x + massData.center.y * massData.center.y);\n this.m_invI = 1.0 / this.m_I;\n }\n var oldCenter = this.m_sweep.c.Copy();\n this.m_sweep.localCenter.SetV(massData.center);\n this.m_sweep.c0.SetV(b2Math.MulX(this.m_xf, this.m_sweep.localCenter));\n this.m_sweep.c.SetV(this.m_sweep.c0);\n this.m_linearVelocity.x += this.m_angularVelocity * (-(this.m_sweep.c.y - oldCenter.y));\n this.m_linearVelocity.y += this.m_angularVelocity * (+(this.m_sweep.c.x - oldCenter.x));\n }\n b2Body.prototype.ResetMassData = function () {\n this.m_mass = 0.0;\n this.m_invMass = 0.0;\n this.m_I = 0.0;\n this.m_invI = 0.0;\n this.m_sweep.localCenter.SetZero();\n if (this.m_type == b2Body.b2_staticBody || this.m_type == b2Body.b2_kinematicBody) {\n return;\n }\n var center = b2Vec2.Make(0, 0);\n for (var f = this.m_fixtureList; f; f = f.m_next) {\n if (f.m_density == 0.0) {\n continue;\n }\n var massData = f.GetMassData();\n this.m_mass += massData.mass;\n center.x += massData.center.x * massData.mass;\n center.y += massData.center.y * massData.mass;\n this.m_I += massData.I;\n }\n if (this.m_mass > 0.0) {\n this.m_invMass = 1.0 / this.m_mass;\n center.x *= this.m_invMass;\n center.y *= this.m_invMass;\n }\n else {\n this.m_mass = 1.0;\n this.m_invMass = 1.0;\n }\n if (this.m_I > 0.0 && (this.m_flags & b2Body.e_fixedRotationFlag) == 0) {\n this.m_I -= this.m_mass * (center.x * center.x + center.y * center.y);\n this.m_I *= this.m_inertiaScale;\n b2Settings.b2Assert(this.m_I > 0);\n this.m_invI = 1.0 / this.m_I;\n }\n else {\n this.m_I = 0.0;\n this.m_invI = 0.0;\n }\n var oldCenter = this.m_sweep.c.Copy();\n this.m_sweep.localCenter.SetV(center);\n this.m_sweep.c0.SetV(b2Math.MulX(this.m_xf, this.m_sweep.localCenter));\n this.m_sweep.c.SetV(this.m_sweep.c0);\n this.m_linearVelocity.x += this.m_angularVelocity * (-(this.m_sweep.c.y - oldCenter.y));\n this.m_linearVelocity.y += this.m_angularVelocity * (+(this.m_sweep.c.x - oldCenter.x));\n }\n b2Body.prototype.GetWorldPoint = function (localPoint) {\n var A = this.m_xf.R;\n var u = new b2Vec2(A.col1.x * localPoint.x + A.col2.x * localPoint.y, A.col1.y * localPoint.x + A.col2.y * localPoint.y);\n u.x += this.m_xf.position.x;\n u.y += this.m_xf.position.y;\n return u;\n }\n b2Body.prototype.GetWorldVector = function (localVector) {\n return b2Math.MulMV(this.m_xf.R, localVector);\n }\n b2Body.prototype.GetLocalPoint = function (worldPoint) {\n return b2Math.MulXT(this.m_xf, worldPoint);\n }\n b2Body.prototype.GetLocalVector = function (worldVector) {\n return b2Math.MulTMV(this.m_xf.R, worldVector);\n }\n b2Body.prototype.GetLinearVelocityFromWorldPoint = function (worldPoint) {\n return new b2Vec2(this.m_linearVelocity.x - this.m_angularVelocity * (worldPoint.y - this.m_sweep.c.y), this.m_linearVelocity.y + this.m_angularVelocity * (worldPoint.x - this.m_sweep.c.x));\n }\n b2Body.prototype.GetLinearVelocityFromLocalPoint = function (localPoint) {\n var A = this.m_xf.R;\n var worldPoint = new b2Vec2(A.col1.x * localPoint.x + A.col2.x * localPoint.y, A.col1.y * localPoint.x + A.col2.y * localPoint.y);\n worldPoint.x += this.m_xf.position.x;\n worldPoint.y += this.m_xf.position.y;\n return new b2Vec2(this.m_linearVelocity.x - this.m_angularVelocity * (worldPoint.y - this.m_sweep.c.y), this.m_linearVelocity.y + this.m_angularVelocity * (worldPoint.x - this.m_sweep.c.x));\n }\n b2Body.prototype.GetLinearDamping = function () {\n return this.m_linearDamping;\n }\n b2Body.prototype.SetLinearDamping = function (linearDamping) {\n if (linearDamping === undefined) linearDamping = 0;\n this.m_linearDamping = linearDamping;\n }\n b2Body.prototype.GetAngularDamping = function () {\n return this.m_angularDamping;\n }\n b2Body.prototype.SetAngularDamping = function (angularDamping) {\n if (angularDamping === undefined) angularDamping = 0;\n this.m_angularDamping = angularDamping;\n }\n b2Body.prototype.SetType = function (type) {\n if (type === undefined) type = 0;\n if (this.m_type == type) {\n return;\n }\n this.m_type = type;\n this.ResetMassData();\n if (this.m_type == b2Body.b2_staticBody) {\n this.m_linearVelocity.SetZero();\n this.m_angularVelocity = 0.0;\n }\n this.SetAwake(true);\n this.m_force.SetZero();\n this.m_torque = 0.0;\n for (var ce = this.m_contactList; ce; ce = ce.next) {\n ce.contact.FlagForFiltering();\n }\n }\n b2Body.prototype.GetType = function () {\n return this.m_type;\n }\n b2Body.prototype.SetBullet = function (flag) {\n if (flag) {\n this.m_flags |= b2Body.e_bulletFlag;\n }\n else {\n this.m_flags &= ~b2Body.e_bulletFlag;\n }\n }\n b2Body.prototype.IsBullet = function () {\n return (this.m_flags & b2Body.e_bulletFlag) == b2Body.e_bulletFlag;\n }\n b2Body.prototype.SetSleepingAllowed = function (flag) {\n if (flag) {\n this.m_flags |= b2Body.e_allowSleepFlag;\n }\n else {\n this.m_flags &= ~b2Body.e_allowSleepFlag;\n this.SetAwake(true);\n }\n }\n b2Body.prototype.SetAwake = function (flag) {\n if (flag) {\n this.m_flags |= b2Body.e_awakeFlag;\n this.m_sleepTime = 0.0;\n }\n else {\n this.m_flags &= ~b2Body.e_awakeFlag;\n this.m_sleepTime = 0.0;\n this.m_linearVelocity.SetZero();\n this.m_angularVelocity = 0.0;\n this.m_force.SetZero();\n this.m_torque = 0.0;\n }\n }\n b2Body.prototype.IsAwake = function () {\n return (this.m_flags & b2Body.e_awakeFlag) == b2Body.e_awakeFlag;\n }\n b2Body.prototype.SetFixedRotation = function (fixed) {\n if (fixed) {\n this.m_flags |= b2Body.e_fixedRotationFlag;\n }\n else {\n this.m_flags &= ~b2Body.e_fixedRotationFlag;\n }\n this.ResetMassData();\n }\n b2Body.prototype.IsFixedRotation = function () {\n return (this.m_flags & b2Body.e_fixedRotationFlag) == b2Body.e_fixedRotationFlag;\n }\n b2Body.prototype.SetActive = function (flag) {\n if (flag == this.IsActive()) {\n return;\n }\n var broadPhase;\n var f;\n if (flag) {\n this.m_flags |= b2Body.e_activeFlag;\n broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.CreateProxy(broadPhase, this.m_xf);\n }\n }\n else {\n this.m_flags &= ~b2Body.e_activeFlag;\n broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.DestroyProxy(broadPhase);\n }\n var ce = this.m_contactList;\n while (ce) {\n var ce0 = ce;\n ce = ce.next;\n this.m_world.m_contactManager.Destroy(ce0.contact);\n }\n this.m_contactList = null;\n }\n }\n b2Body.prototype.IsActive = function () {\n return (this.m_flags & b2Body.e_activeFlag) == b2Body.e_activeFlag;\n }\n b2Body.prototype.IsSleepingAllowed = function () {\n return (this.m_flags & b2Body.e_allowSleepFlag) == b2Body.e_allowSleepFlag;\n }\n b2Body.prototype.GetFixtureList = function () {\n return this.m_fixtureList;\n }\n b2Body.prototype.GetJointList = function () {\n return this.m_jointList;\n }\n b2Body.prototype.GetControllerList = function () {\n return this.m_controllerList;\n }\n b2Body.prototype.GetContactList = function () {\n return this.m_contactList;\n }\n b2Body.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Body.prototype.GetUserData = function () {\n return this.m_userData;\n }\n b2Body.prototype.SetUserData = function (data) {\n this.m_userData = data;\n }\n b2Body.prototype.GetWorld = function () {\n return this.m_world;\n }\n b2Body.prototype.b2Body = function (bd, world) {\n this.m_flags = 0;\n if (bd.bullet) {\n this.m_flags |= b2Body.e_bulletFlag;\n }\n if (bd.fixedRotation) {\n this.m_flags |= b2Body.e_fixedRotationFlag;\n }\n if (bd.allowSleep) {\n this.m_flags |= b2Body.e_allowSleepFlag;\n }\n if (bd.awake) {\n this.m_flags |= b2Body.e_awakeFlag;\n }\n if (bd.active) {\n this.m_flags |= b2Body.e_activeFlag;\n }\n this.m_world = world;\n this.m_xf.position.SetV(bd.position);\n this.m_xf.R.Set(bd.angle);\n this.m_sweep.localCenter.SetZero();\n this.m_sweep.t0 = 1.0;\n this.m_sweep.a0 = this.m_sweep.a = bd.angle;\n var tMat = this.m_xf.R;\n var tVec = this.m_sweep.localCenter;\n this.m_sweep.c.x = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n this.m_sweep.c.y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_sweep.c.x += this.m_xf.position.x;\n this.m_sweep.c.y += this.m_xf.position.y;\n this.m_sweep.c0.SetV(this.m_sweep.c);\n this.m_jointList = null;\n this.m_controllerList = null;\n this.m_contactList = null;\n this.m_controllerCount = 0;\n this.m_prev = null;\n this.m_next = null;\n this.m_linearVelocity.SetV(bd.linearVelocity);\n this.m_angularVelocity = bd.angularVelocity;\n this.m_linearDamping = bd.linearDamping;\n this.m_angularDamping = bd.angularDamping;\n this.m_force.Set(0.0, 0.0);\n this.m_torque = 0.0;\n this.m_sleepTime = 0.0;\n this.m_type = bd.type;\n if (this.m_type == b2Body.b2_dynamicBody) {\n this.m_mass = 1.0;\n this.m_invMass = 1.0;\n }\n else {\n this.m_mass = 0.0;\n this.m_invMass = 0.0;\n }\n this.m_I = 0.0;\n this.m_invI = 0.0;\n this.m_inertiaScale = bd.inertiaScale;\n this.m_userData = bd.userData;\n this.m_fixtureList = null;\n this.m_fixtureCount = 0;\n }\n b2Body.prototype.SynchronizeFixtures = function () {\n var xf1 = b2Body.s_xf1;\n xf1.R.Set(this.m_sweep.a0);\n var tMat = xf1.R;\n var tVec = this.m_sweep.localCenter;\n xf1.position.x = this.m_sweep.c0.x - (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n xf1.position.y = this.m_sweep.c0.y - (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var f;\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.Synchronize(broadPhase, xf1, this.m_xf);\n }\n }\n b2Body.prototype.SynchronizeTransform = function () {\n this.m_xf.R.Set(this.m_sweep.a);\n var tMat = this.m_xf.R;\n var tVec = this.m_sweep.localCenter;\n this.m_xf.position.x = this.m_sweep.c.x - (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n this.m_xf.position.y = this.m_sweep.c.y - (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n }\n b2Body.prototype.ShouldCollide = function (other) {\n if (this.m_type != b2Body.b2_dynamicBody && other.m_type != b2Body.b2_dynamicBody) {\n return false;\n }\n for (var jn = this.m_jointList; jn; jn = jn.next) {\n if (jn.other == other) if (jn.joint.m_collideConnected == false) {\n return false;\n }\n }\n return true;\n }\n b2Body.prototype.Advance = function (t) {\n if (t === undefined) t = 0;\n this.m_sweep.Advance(t);\n this.m_sweep.c.SetV(this.m_sweep.c0);\n this.m_sweep.a = this.m_sweep.a0;\n this.SynchronizeTransform();\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2Body.s_xf1 = new b2Transform();\n Box2D.Dynamics.b2Body.prototype.s_xf1 = Box2D.Dynamics.b2Body.s_xf1;\n Box2D.Dynamics.b2Body.e_islandFlag = 0x0001;\n Box2D.Dynamics.b2Body.prototype.e_islandFlag = Box2D.Dynamics.b2Body.e_islandFlag;\n Box2D.Dynamics.b2Body.e_awakeFlag = 0x0002;\n Box2D.Dynamics.b2Body.prototype.e_awakeFlag = Box2D.Dynamics.b2Body.e_awakeFlag;\n Box2D.Dynamics.b2Body.e_allowSleepFlag = 0x0004;\n Box2D.Dynamics.b2Body.prototype.e_allowSleepFlag = Box2D.Dynamics.b2Body.e_allowSleepFlag;\n Box2D.Dynamics.b2Body.e_bulletFlag = 0x0008;\n Box2D.Dynamics.b2Body.prototype.e_bulletFlag = Box2D.Dynamics.b2Body.e_bulletFlag;\n Box2D.Dynamics.b2Body.e_fixedRotationFlag = 0x0010;\n Box2D.Dynamics.b2Body.prototype.e_fixedRotationFlag = Box2D.Dynamics.b2Body.e_fixedRotationFlag;\n Box2D.Dynamics.b2Body.e_activeFlag = 0x0020;\n Box2D.Dynamics.b2Body.prototype.e_activeFlag = Box2D.Dynamics.b2Body.e_activeFlag;\n Box2D.Dynamics.b2Body.b2_staticBody = 0;\n Box2D.Dynamics.b2Body.prototype.b2_staticBody = Box2D.Dynamics.b2Body.b2_staticBody;\n Box2D.Dynamics.b2Body.b2_kinematicBody = 1;\n Box2D.Dynamics.b2Body.prototype.b2_kinematicBody = Box2D.Dynamics.b2Body.b2_kinematicBody;\n Box2D.Dynamics.b2Body.b2_dynamicBody = 2;\n Box2D.Dynamics.b2Body.prototype.b2_dynamicBody = Box2D.Dynamics.b2Body.b2_dynamicBody;\n });\n b2BodyDef.b2BodyDef = function () {\n this.position = new b2Vec2();\n this.linearVelocity = new b2Vec2();\n };\n b2BodyDef.prototype.b2BodyDef = function () {\n this.userData = null;\n this.position.Set(0.0, 0.0);\n this.angle = 0.0;\n this.linearVelocity.Set(0, 0);\n this.angularVelocity = 0.0;\n this.linearDamping = 0.0;\n this.angularDamping = 0.0;\n this.allowSleep = true;\n this.awake = true;\n this.fixedRotation = false;\n this.bullet = false;\n this.type = b2Body.b2_staticBody;\n this.active = true;\n this.inertiaScale = 1.0;\n }\n b2ContactFilter.b2ContactFilter = function () {};\n b2ContactFilter.prototype.ShouldCollide = function (fixtureA, fixtureB) {\n var filter1 = fixtureA.GetFilterData();\n var filter2 = fixtureB.GetFilterData();\n if (filter1.groupIndex == filter2.groupIndex && filter1.groupIndex != 0) {\n return filter1.groupIndex > 0;\n }\n var collide = (filter1.maskBits & filter2.categoryBits) != 0 && (filter1.categoryBits & filter2.maskBits) != 0;\n return collide;\n }\n b2ContactFilter.prototype.RayCollide = function (userData, fixture) {\n if (!userData) return true;\n return this.ShouldCollide((userData instanceof b2Fixture ? userData : null), fixture);\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2ContactFilter.b2_defaultFilter = new b2ContactFilter();\n Box2D.Dynamics.b2ContactFilter.prototype.b2_defaultFilter = Box2D.Dynamics.b2ContactFilter.b2_defaultFilter;\n });\n b2ContactImpulse.b2ContactImpulse = function () {\n this.normalImpulses = new Vector_a2j_Number(b2Settings.b2_maxManifoldPoints);\n this.tangentImpulses = new Vector_a2j_Number(b2Settings.b2_maxManifoldPoints);\n };\n b2ContactListener.b2ContactListener = function () {};\n b2ContactListener.prototype.BeginContact = function (contact) {}\n b2ContactListener.prototype.EndContact = function (contact) {}\n b2ContactListener.prototype.PreSolve = function (contact, oldManifold) {}\n b2ContactListener.prototype.PostSolve = function (contact, impulse) {}\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2ContactListener.b2_defaultListener = new b2ContactListener();\n Box2D.Dynamics.b2ContactListener.prototype.b2_defaultListener = Box2D.Dynamics.b2ContactListener.b2_defaultListener;\n });\n b2ContactManager.b2ContactManager = function () {};\n b2ContactManager.prototype.b2ContactManager = function () {\n this.m_world = null;\n this.m_contactCount = 0;\n this.m_contactFilter = b2ContactFilter.b2_defaultFilter;\n this.m_contactListener = b2ContactListener.b2_defaultListener;\n this.m_contactFactory = new b2ContactFactory(this.m_allocator);\n this.m_broadPhase = new b2DynamicTreeBroadPhase();\n }\n b2ContactManager.prototype.AddPair = function (proxyUserDataA, proxyUserDataB) {\n var fixtureA = (proxyUserDataA instanceof b2Fixture ? proxyUserDataA : null);\n var fixtureB = (proxyUserDataB instanceof b2Fixture ? proxyUserDataB : null);\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (bodyA == bodyB) return;\n var edge = bodyB.GetContactList();\n while (edge) {\n if (edge.other == bodyA) {\n var fA = edge.contact.GetFixtureA();\n var fB = edge.contact.GetFixtureB();\n if (fA == fixtureA && fB == fixtureB) return;\n if (fA == fixtureB && fB == fixtureA) return;\n }\n edge = edge.next;\n }\n if (bodyB.ShouldCollide(bodyA) == false) {\n return;\n }\n if (this.m_contactFilter.ShouldCollide(fixtureA, fixtureB) == false) {\n return;\n }\n var c = this.m_contactFactory.Create(fixtureA, fixtureB);\n fixtureA = c.GetFixtureA();\n fixtureB = c.GetFixtureB();\n bodyA = fixtureA.m_body;\n bodyB = fixtureB.m_body;\n c.m_prev = null;\n c.m_next = this.m_world.m_contactList;\n if (this.m_world.m_contactList != null) {\n this.m_world.m_contactList.m_prev = c;\n }\n this.m_world.m_contactList = c;\n c.m_nodeA.contact = c;\n c.m_nodeA.other = bodyB;\n c.m_nodeA.prev = null;\n c.m_nodeA.next = bodyA.m_contactList;\n if (bodyA.m_contactList != null) {\n bodyA.m_contactList.prev = c.m_nodeA;\n }\n bodyA.m_contactList = c.m_nodeA;\n c.m_nodeB.contact = c;\n c.m_nodeB.other = bodyA;\n c.m_nodeB.prev = null;\n c.m_nodeB.next = bodyB.m_contactList;\n if (bodyB.m_contactList != null) {\n bodyB.m_contactList.prev = c.m_nodeB;\n }\n bodyB.m_contactList = c.m_nodeB;\n ++this.m_world.m_contactCount;\n return;\n }\n b2ContactManager.prototype.FindNewContacts = function () {\n this.m_broadPhase.UpdatePairs(a2j.generateCallback(this, this.AddPair));\n }\n b2ContactManager.prototype.Destroy = function (c) {\n var fixtureA = c.GetFixtureA();\n var fixtureB = c.GetFixtureB();\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (c.IsTouching()) {\n this.m_contactListener.EndContact(c);\n }\n if (c.m_prev) {\n c.m_prev.m_next = c.m_next;\n }\n if (c.m_next) {\n c.m_next.m_prev = c.m_prev;\n }\n if (c == this.m_world.m_contactList) {\n this.m_world.m_contactList = c.m_next;\n }\n if (c.m_nodeA.prev) {\n c.m_nodeA.prev.next = c.m_nodeA.next;\n }\n if (c.m_nodeA.next) {\n c.m_nodeA.next.prev = c.m_nodeA.prev;\n }\n if (c.m_nodeA == bodyA.m_contactList) {\n bodyA.m_contactList = c.m_nodeA.next;\n }\n if (c.m_nodeB.prev) {\n c.m_nodeB.prev.next = c.m_nodeB.next;\n }\n if (c.m_nodeB.next) {\n c.m_nodeB.next.prev = c.m_nodeB.prev;\n }\n if (c.m_nodeB == bodyB.m_contactList) {\n bodyB.m_contactList = c.m_nodeB.next;\n }\n this.m_contactFactory.Destroy(c);\n --this.m_contactCount;\n }\n b2ContactManager.prototype.Collide = function () {\n var c = this.m_world.m_contactList;\n while (c) {\n var fixtureA = c.GetFixtureA();\n var fixtureB = c.GetFixtureB();\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (bodyA.IsAwake() == false && bodyB.IsAwake() == false) {\n c = c.GetNext();\n continue;\n }\n if (c.m_flags & b2Contact.e_filterFlag) {\n if (bodyB.ShouldCollide(bodyA) == false) {\n var cNuke = c;\n c = cNuke.GetNext();\n this.Destroy(cNuke);\n continue;\n }\n if (this.m_contactFilter.ShouldCollide(fixtureA, fixtureB) == false) {\n cNuke = c;\n c = cNuke.GetNext();\n this.Destroy(cNuke);\n continue;\n }\n c.m_flags &= ~b2Contact.e_filterFlag;\n }\n var proxyA = fixtureA.m_proxy;\n var proxyB = fixtureB.m_proxy;\n var overlap = this.m_broadPhase.TestOverlap(proxyA, proxyB);\n if (overlap == false) {\n cNuke = c;\n c = cNuke.GetNext();\n this.Destroy(cNuke);\n continue;\n }\n c.Update(this.m_contactListener);\n c = c.GetNext();\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2ContactManager.s_evalCP = new b2ContactPoint();\n Box2D.Dynamics.b2ContactManager.prototype.s_evalCP = Box2D.Dynamics.b2ContactManager.s_evalCP;\n });\n b2DebugDraw.b2DebugDraw = function () {};\n b2DebugDraw.prototype.b2DebugDraw = function () {\n m_drawFlags = 0;\n }\n b2DebugDraw.prototype.SetFlags = function (flags) {\n if (flags === undefined) flags = 0;\n }\n b2DebugDraw.prototype.GetFlags = function () {}\n b2DebugDraw.prototype.AppendFlags = function (flags) {\n if (flags === undefined) flags = 0;\n }\n b2DebugDraw.prototype.ClearFlags = function (flags) {\n if (flags === undefined) flags = 0;\n }\n b2DebugDraw.prototype.SetSprite = function (sprite) {}\n b2DebugDraw.prototype.GetSprite = function () {}\n b2DebugDraw.prototype.SetDrawScale = function (drawScale) {\n if (drawScale === undefined) drawScale = 0;\n }\n b2DebugDraw.prototype.GetDrawScale = function () {}\n b2DebugDraw.prototype.SetLineThickness = function (lineThickness) {\n if (lineThickness === undefined) lineThickness = 0;\n }\n b2DebugDraw.prototype.GetLineThickness = function () {}\n b2DebugDraw.prototype.SetAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n }\n b2DebugDraw.prototype.GetAlpha = function () {}\n b2DebugDraw.prototype.SetFillAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n }\n b2DebugDraw.prototype.GetFillAlpha = function () {}\n b2DebugDraw.prototype.SetXFormScale = function (xformScale) {\n if (xformScale === undefined) xformScale = 0;\n }\n b2DebugDraw.prototype.GetXFormScale = function () {}\n b2DebugDraw.prototype.DrawPolygon = function (vertices, vertexCount, color) {\n if (vertexCount === undefined) vertexCount = 0;\n }\n b2DebugDraw.prototype.DrawSolidPolygon = function (vertices, vertexCount, color) {\n if (vertexCount === undefined) vertexCount = 0;\n }\n b2DebugDraw.prototype.DrawCircle = function (center, radius, color) {\n if (radius === undefined) radius = 0;\n }\n b2DebugDraw.prototype.DrawSolidCircle = function (center, radius, axis, color) {\n if (radius === undefined) radius = 0;\n }\n b2DebugDraw.prototype.DrawSegment = function (p1, p2, color) {}\n b2DebugDraw.prototype.DrawTransform = function (xf) {}\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2DebugDraw.e_shapeBit = 0x0001;\n Box2D.Dynamics.b2DebugDraw.prototype.e_shapeBit = Box2D.Dynamics.b2DebugDraw.e_shapeBit;\n Box2D.Dynamics.b2DebugDraw.e_jointBit = 0x0002;\n Box2D.Dynamics.b2DebugDraw.prototype.e_jointBit = Box2D.Dynamics.b2DebugDraw.e_jointBit;\n Box2D.Dynamics.b2DebugDraw.e_aabbBit = 0x0004;\n Box2D.Dynamics.b2DebugDraw.prototype.e_aabbBit = Box2D.Dynamics.b2DebugDraw.e_aabbBit;\n Box2D.Dynamics.b2DebugDraw.e_pairBit = 0x0008;\n Box2D.Dynamics.b2DebugDraw.prototype.e_pairBit = Box2D.Dynamics.b2DebugDraw.e_pairBit;\n Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit = 0x0010;\n Box2D.Dynamics.b2DebugDraw.prototype.e_centerOfMassBit = Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit;\n Box2D.Dynamics.b2DebugDraw.e_controllerBit = 0x0020;\n Box2D.Dynamics.b2DebugDraw.prototype.e_controllerBit = Box2D.Dynamics.b2DebugDraw.e_controllerBit;\n });\n b2DestructionListener.b2DestructionListener = function () {};\n b2DestructionListener.prototype.SayGoodbyeJoint = function (joint) {}\n b2DestructionListener.prototype.SayGoodbyeFixture = function (fixture) {}\n b2FilterData.b2FilterData = function () {\n this.categoryBits = 0x0001;\n this.maskBits = 0xFFFF;\n this.groupIndex = 0;\n };\n b2FilterData.prototype.Copy = function () {\n var copy = new b2FilterData();\n copy.categoryBits = this.categoryBits;\n copy.maskBits = this.maskBits;\n copy.groupIndex = this.groupIndex;\n return copy;\n }\n b2Fixture.b2Fixture = function () {\n this.m_filter = new b2FilterData();\n };\n b2Fixture.prototype.GetType = function () {\n return this.m_shape.GetType();\n }\n b2Fixture.prototype.GetShape = function () {\n return this.m_shape;\n }\n b2Fixture.prototype.SetSensor = function (sensor) {\n if (this.m_isSensor == sensor) return;\n this.m_isSensor = sensor;\n if (this.m_body == null) return;\n var edge = this.m_body.GetContactList();\n while (edge) {\n var contact = edge.contact;\n var fixtureA = contact.GetFixtureA();\n var fixtureB = contact.GetFixtureB();\n if (fixtureA == this || fixtureB == this) contact.SetSensor(fixtureA.IsSensor() || fixtureB.IsSensor());\n edge = edge.next;\n }\n }\n b2Fixture.prototype.IsSensor = function () {\n return this.m_isSensor;\n }\n b2Fixture.prototype.SetFilterData = function (filter) {\n this.m_filter = filter.Copy();\n if (this.m_body) return;\n var edge = this.m_body.GetContactList();\n while (edge) {\n var contact = edge.contact;\n var fixtureA = contact.GetFixtureA();\n var fixtureB = contact.GetFixtureB();\n if (fixtureA == this || fixtureB == this) contact.FlagForFiltering();\n edge = edge.next;\n }\n }\n b2Fixture.prototype.GetFilterData = function () {\n return this.m_filter.Copy();\n }\n b2Fixture.prototype.GetBody = function () {\n return this.m_body;\n }\n b2Fixture.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Fixture.prototype.GetUserData = function () {\n return this.m_userData;\n }\n b2Fixture.prototype.SetUserData = function (data) {\n this.m_userData = data;\n }\n b2Fixture.prototype.TestPoint = function (p) {\n return this.m_shape.TestPoint(this.m_body.GetTransform(), p);\n }\n b2Fixture.prototype.RayCast = function (output, input) {\n return this.m_shape.RayCast(output, input, this.m_body.GetTransform());\n }\n b2Fixture.prototype.GetMassData = function (massData) {\n if (massData === undefined) massData = null;\n if (massData == null) {\n massData = new b2MassData();\n }\n this.m_shape.ComputeMass(massData, this.m_density);\n return massData;\n }\n b2Fixture.prototype.SetDensity = function (density) {\n if (density === undefined) density = 0;\n this.m_density = density;\n }\n b2Fixture.prototype.GetDensity = function () {\n return this.m_density;\n }\n b2Fixture.prototype.GetFriction = function () {\n return this.m_friction;\n }\n b2Fixture.prototype.SetFriction = function (friction) {\n if (friction === undefined) friction = 0;\n this.m_friction = friction;\n }\n b2Fixture.prototype.GetRestitution = function () {\n return this.m_restitution;\n }\n b2Fixture.prototype.SetRestitution = function (restitution) {\n if (restitution === undefined) restitution = 0;\n this.m_restitution = restitution;\n }\n b2Fixture.prototype.GetAABB = function () {\n return this.m_aabb;\n }\n b2Fixture.prototype.b2Fixture = function () {\n this.m_aabb = new b2AABB();\n this.m_userData = null;\n this.m_body = null;\n this.m_next = null;\n this.m_shape = null;\n this.m_density = 0.0;\n this.m_friction = 0.0;\n this.m_restitution = 0.0;\n }\n b2Fixture.prototype.Create = function (body, xf, def) {\n this.m_userData = def.userData;\n this.m_friction = def.friction;\n this.m_restitution = def.restitution;\n this.m_body = body;\n this.m_next = null;\n this.m_filter = def.filter.Copy();\n this.m_isSensor = def.isSensor;\n this.m_shape = def.shape.Copy();\n this.m_density = def.density;\n }\n b2Fixture.prototype.Destroy = function () {\n this.m_shape = null;\n }\n b2Fixture.prototype.CreateProxy = function (broadPhase, xf) {\n this.m_shape.ComputeAABB(this.m_aabb, xf);\n this.m_proxy = broadPhase.CreateProxy(this.m_aabb, this);\n }\n b2Fixture.prototype.DestroyProxy = function (broadPhase) {\n if (this.m_proxy == null) {\n return;\n }\n broadPhase.DestroyProxy(this.m_proxy);\n this.m_proxy = null;\n }\n b2Fixture.prototype.Synchronize = function (broadPhase, transform1, transform2) {\n if (!this.m_proxy) return;\n var aabb1 = new b2AABB();\n var aabb2 = new b2AABB();\n this.m_shape.ComputeAABB(aabb1, transform1);\n this.m_shape.ComputeAABB(aabb2, transform2);\n this.m_aabb.Combine(aabb1, aabb2);\n var displacement = b2Math.SubtractVV(transform2.position, transform1.position);\n broadPhase.MoveProxy(this.m_proxy, this.m_aabb, displacement);\n }\n b2FixtureDef.b2FixtureDef = function () {\n this.filter = new b2FilterData();\n };\n b2FixtureDef.prototype.b2FixtureDef = function () {\n this.shape = null;\n this.userData = null;\n this.friction = 0.2;\n this.restitution = 0.0;\n this.density = 0.0;\n this.filter.categoryBits = 0x0001;\n this.filter.maskBits = 0xFFFF;\n this.filter.groupIndex = 0;\n this.isSensor = false;\n }\n b2Island.b2Island = function () {};\n b2Island.prototype.b2Island = function () {\n this.m_bodies = new Vector();\n this.m_contacts = new Vector();\n this.m_joints = new Vector();\n }\n b2Island.prototype.Initialize = function (bodyCapacity, contactCapacity, jointCapacity, allocator, listener, contactSolver) {\n if (bodyCapacity === undefined) bodyCapacity = 0;\n if (contactCapacity === undefined) contactCapacity = 0;\n if (jointCapacity === undefined) jointCapacity = 0;\n var i = 0;\n this.m_bodyCapacity = bodyCapacity;\n this.m_contactCapacity = contactCapacity;\n this.m_jointCapacity = jointCapacity;\n this.m_bodyCount = 0;\n this.m_contactCount = 0;\n this.m_jointCount = 0;\n this.m_allocator = allocator;\n this.m_listener = listener;\n this.m_contactSolver = contactSolver;\n for (i = this.m_bodies.length;\n i < bodyCapacity; i++)\n this.m_bodies[i] = null;\n for (i = this.m_contacts.length;\n i < contactCapacity; i++)\n this.m_contacts[i] = null;\n for (i = this.m_joints.length;\n i < jointCapacity; i++)\n this.m_joints[i] = null;\n }\n b2Island.prototype.Clear = function () {\n this.m_bodyCount = 0;\n this.m_contactCount = 0;\n this.m_jointCount = 0;\n }\n b2Island.prototype.Solve = function (step, gravity, allowSleep) {\n var i = 0;\n var j = 0;\n var b;\n var joint;\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n if (b.GetType() != b2Body.b2_dynamicBody) continue;\n b.m_linearVelocity.x += step.dt * (gravity.x + b.m_invMass * b.m_force.x);\n b.m_linearVelocity.y += step.dt * (gravity.y + b.m_invMass * b.m_force.y);\n b.m_angularVelocity += step.dt * b.m_invI * b.m_torque;\n b.m_linearVelocity.Multiply(b2Math.Clamp(1.0 - step.dt * b.m_linearDamping, 0.0, 1.0));\n b.m_angularVelocity *= b2Math.Clamp(1.0 - step.dt * b.m_angularDamping, 0.0, 1.0);\n }\n this.m_contactSolver.Initialize(step, this.m_contacts, this.m_contactCount, this.m_allocator);\n var contactSolver = this.m_contactSolver;\n contactSolver.InitVelocityConstraints(step);\n for (i = 0;\n i < this.m_jointCount; ++i) {\n joint = this.m_joints[i];\n joint.InitVelocityConstraints(step);\n }\n for (i = 0;\n i < step.velocityIterations; ++i) {\n for (j = 0;\n j < this.m_jointCount; ++j) {\n joint = this.m_joints[j];\n joint.SolveVelocityConstraints(step);\n }\n contactSolver.SolveVelocityConstraints();\n }\n for (i = 0;\n i < this.m_jointCount; ++i) {\n joint = this.m_joints[i];\n joint.FinalizeVelocityConstraints();\n }\n contactSolver.FinalizeVelocityConstraints();\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) continue;\n var translationX = step.dt * b.m_linearVelocity.x;\n var translationY = step.dt * b.m_linearVelocity.y;\n if ((translationX * translationX + translationY * translationY) > b2Settings.b2_maxTranslationSquared) {\n b.m_linearVelocity.Normalize();\n b.m_linearVelocity.x *= b2Settings.b2_maxTranslation * step.inv_dt;\n b.m_linearVelocity.y *= b2Settings.b2_maxTranslation * step.inv_dt;\n }\n var rotation = step.dt * b.m_angularVelocity;\n if (rotation * rotation > b2Settings.b2_maxRotationSquared) {\n if (b.m_angularVelocity < 0.0) {\n b.m_angularVelocity = (-b2Settings.b2_maxRotation * step.inv_dt);\n }\n else {\n b.m_angularVelocity = b2Settings.b2_maxRotation * step.inv_dt;\n }\n }\n b.m_sweep.c0.SetV(b.m_sweep.c);\n b.m_sweep.a0 = b.m_sweep.a;\n b.m_sweep.c.x += step.dt * b.m_linearVelocity.x;\n b.m_sweep.c.y += step.dt * b.m_linearVelocity.y;\n b.m_sweep.a += step.dt * b.m_angularVelocity;\n b.SynchronizeTransform();\n }\n for (i = 0;\n i < step.positionIterations; ++i) {\n var contactsOkay = contactSolver.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);\n var jointsOkay = true;\n for (j = 0;\n j < this.m_jointCount; ++j) {\n joint = this.m_joints[j];\n var jointOkay = joint.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);\n jointsOkay = jointsOkay && jointOkay;\n }\n if (contactsOkay && jointsOkay) {\n break;\n }\n }\n this.Report(contactSolver.m_constraints);\n if (allowSleep) {\n var minSleepTime = Number.MAX_VALUE;\n var linTolSqr = b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance;\n var angTolSqr = b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance;\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n if ((b.m_flags & b2Body.e_allowSleepFlag) == 0) {\n b.m_sleepTime = 0.0;\n minSleepTime = 0.0;\n }\n if ((b.m_flags & b2Body.e_allowSleepFlag) == 0 || b.m_angularVelocity * b.m_angularVelocity > angTolSqr || b2Math.Dot(b.m_linearVelocity, b.m_linearVelocity) > linTolSqr) {\n b.m_sleepTime = 0.0;\n minSleepTime = 0.0;\n }\n else {\n b.m_sleepTime += step.dt;\n minSleepTime = b2Math.Min(minSleepTime, b.m_sleepTime);\n }\n }\n if (minSleepTime >= b2Settings.b2_timeToSleep) {\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n b.SetAwake(false);\n }\n }\n }\n }\n b2Island.prototype.SolveTOI = function (subStep) {\n var i = 0;\n var j = 0;\n this.m_contactSolver.Initialize(subStep, this.m_contacts, this.m_contactCount, this.m_allocator);\n var contactSolver = this.m_contactSolver;\n for (i = 0;\n i < this.m_jointCount; ++i) {\n this.m_joints[i].InitVelocityConstraints(subStep);\n }\n for (i = 0;\n i < subStep.velocityIterations; ++i) {\n contactSolver.SolveVelocityConstraints();\n for (j = 0;\n j < this.m_jointCount; ++j) {\n this.m_joints[j].SolveVelocityConstraints(subStep);\n }\n }\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n var b = this.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) continue;\n var translationX = subStep.dt * b.m_linearVelocity.x;\n var translationY = subStep.dt * b.m_linearVelocity.y;\n if ((translationX * translationX + translationY * translationY) > b2Settings.b2_maxTranslationSquared) {\n b.m_linearVelocity.Normalize();\n b.m_linearVelocity.x *= b2Settings.b2_maxTranslation * subStep.inv_dt;\n b.m_linearVelocity.y *= b2Settings.b2_maxTranslation * subStep.inv_dt;\n }\n var rotation = subStep.dt * b.m_angularVelocity;\n if (rotation * rotation > b2Settings.b2_maxRotationSquared) {\n if (b.m_angularVelocity < 0.0) {\n b.m_angularVelocity = (-b2Settings.b2_maxRotation * subStep.inv_dt);\n }\n else {\n b.m_angularVelocity = b2Settings.b2_maxRotation * subStep.inv_dt;\n }\n }\n b.m_sweep.c0.SetV(b.m_sweep.c);\n b.m_sweep.a0 = b.m_sweep.a;\n b.m_sweep.c.x += subStep.dt * b.m_linearVelocity.x;\n b.m_sweep.c.y += subStep.dt * b.m_linearVelocity.y;\n b.m_sweep.a += subStep.dt * b.m_angularVelocity;\n b.SynchronizeTransform();\n }\n var k_toiBaumgarte = 0.75;\n for (i = 0;\n i < subStep.positionIterations; ++i) {\n var contactsOkay = contactSolver.SolvePositionConstraints(k_toiBaumgarte);\n var jointsOkay = true;\n for (j = 0;\n j < this.m_jointCount; ++j) {\n var jointOkay = this.m_joints[j].SolvePositionConstraints(b2Settings.b2_contactBaumgarte);\n jointsOkay = jointsOkay && jointOkay;\n }\n if (contactsOkay && jointsOkay) {\n break;\n }\n }\n this.Report(contactSolver.m_constraints);\n }\n b2Island.prototype.Report = function (constraints) {\n if (this.m_listener == null) {\n return;\n }\n for (var i = 0; i < this.m_contactCount; ++i) {\n var c = this.m_contacts[i];\n var cc = constraints[i];\n for (var j = 0; j < cc.pointCount; ++j) {\n b2Island.s_impulse.normalImpulses[j] = cc.points[j].normalImpulse;\n b2Island.s_impulse.tangentImpulses[j] = cc.points[j].tangentImpulse;\n }\n this.m_listener.PostSolve(c, b2Island.s_impulse);\n }\n }\n b2Island.prototype.AddBody = function (body) {\n body.m_islandIndex = this.m_bodyCount;\n this.m_bodies[this.m_bodyCount++] = body;\n }\n b2Island.prototype.AddContact = function (contact) {\n this.m_contacts[this.m_contactCount++] = contact;\n }\n b2Island.prototype.AddJoint = function (joint) {\n this.m_joints[this.m_jointCount++] = joint;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2Island.s_impulse = new b2ContactImpulse();\n Box2D.Dynamics.b2Island.prototype.s_impulse = Box2D.Dynamics.b2Island.s_impulse;\n });\n b2TimeStep.b2TimeStep = function () {};\n b2TimeStep.prototype.Set = function (step) {\n this.dt = step.dt;\n this.inv_dt = step.inv_dt;\n this.positionIterations = step.positionIterations;\n this.velocityIterations = step.velocityIterations;\n this.warmStarting = step.warmStarting;\n }\n b2World.b2World = function () {\n this.s_stack = new Vector();\n this.m_contactManager = new b2ContactManager();\n this.m_contactSolver = new b2ContactSolver();\n this.m_island = new b2Island();\n };\n b2World.prototype.b2World = function (gravity, doSleep) {\n this.m_destructionListener = null;\n this.m_debugDraw = null;\n this.m_bodyList = null;\n this.m_contactList = null;\n this.m_jointList = null;\n this.m_controllerList = null;\n this.m_bodyCount = 0;\n this.m_contactCount = 0;\n this.m_jointCount = 0;\n this.m_controllerCount = 0;\n b2World.m_warmStarting = true;\n b2World.m_continuousPhysics = true;\n this.m_allowSleep = doSleep;\n this.m_gravity = gravity;\n this.m_inv_dt0 = 0.0;\n this.m_contactManager.m_world = this;\n var bd = new b2BodyDef();\n this.m_groundBody = this.CreateBody(bd);\n }\n b2World.prototype.SetDestructionListener = function (listener) {\n this.m_destructionListener = listener;\n }\n b2World.prototype.SetContactFilter = function (filter) {\n this.m_contactManager.m_contactFilter = filter;\n }\n b2World.prototype.SetContactListener = function (listener) {\n this.m_contactManager.m_contactListener = listener;\n }\n b2World.prototype.SetDebugDraw = function (debugDraw) {\n this.m_debugDraw = debugDraw;\n }\n b2World.prototype.SetBroadPhase = function (broadPhase) {\n var oldBroadPhase = this.m_contactManager.m_broadPhase;\n this.m_contactManager.m_broadPhase = broadPhase;\n for (var b = this.m_bodyList; b; b = b.m_next) {\n for (var f = b.m_fixtureList; f; f = f.m_next) {\n f.m_proxy = broadPhase.CreateProxy(oldBroadPhase.GetFatAABB(f.m_proxy), f);\n }\n }\n }\n b2World.prototype.Validate = function () {\n this.m_contactManager.m_broadPhase.Validate();\n }\n b2World.prototype.GetProxyCount = function () {\n return this.m_contactManager.m_broadPhase.GetProxyCount();\n }\n b2World.prototype.CreateBody = function (def) {\n if (this.IsLocked() == true) {\n return null;\n }\n var b = new b2Body(def, this);\n b.m_prev = null;\n b.m_next = this.m_bodyList;\n if (this.m_bodyList) {\n this.m_bodyList.m_prev = b;\n }\n this.m_bodyList = b;\n ++this.m_bodyCount;\n return b;\n }\n b2World.prototype.DestroyBody = function (b) {\n if (this.IsLocked() == true) {\n return;\n }\n var jn = b.m_jointList;\n while (jn) {\n var jn0 = jn;\n jn = jn.next;\n if (this.m_destructionListener) {\n this.m_destructionListener.SayGoodbyeJoint(jn0.joint);\n }\n this.DestroyJoint(jn0.joint);\n }\n var coe = b.m_controllerList;\n while (coe) {\n var coe0 = coe;\n coe = coe.nextController;\n coe0.controller.RemoveBody(b);\n }\n var ce = b.m_contactList;\n while (ce) {\n var ce0 = ce;\n ce = ce.next;\n this.m_contactManager.Destroy(ce0.contact);\n }\n b.m_contactList = null;\n var f = b.m_fixtureList;\n while (f) {\n var f0 = f;\n f = f.m_next;\n if (this.m_destructionListener) {\n this.m_destructionListener.SayGoodbyeFixture(f0);\n }\n f0.DestroyProxy(this.m_contactManager.m_broadPhase);\n f0.Destroy();\n }\n b.m_fixtureList = null;\n b.m_fixtureCount = 0;\n if (b.m_prev) {\n b.m_prev.m_next = b.m_next;\n }\n if (b.m_next) {\n b.m_next.m_prev = b.m_prev;\n }\n if (b == this.m_bodyList) {\n this.m_bodyList = b.m_next;\n }--this.m_bodyCount;\n }\n b2World.prototype.CreateJoint = function (def) {\n var j = b2Joint.Create(def, null);\n j.m_prev = null;\n j.m_next = this.m_jointList;\n if (this.m_jointList) {\n this.m_jointList.m_prev = j;\n }\n this.m_jointList = j;\n ++this.m_jointCount;\n j.m_edgeA.joint = j;\n j.m_edgeA.other = j.m_bodyB;\n j.m_edgeA.prev = null;\n j.m_edgeA.next = j.m_bodyA.m_jointList;\n if (j.m_bodyA.m_jointList) j.m_bodyA.m_jointList.prev = j.m_edgeA;\n j.m_bodyA.m_jointList = j.m_edgeA;\n j.m_edgeB.joint = j;\n j.m_edgeB.other = j.m_bodyA;\n j.m_edgeB.prev = null;\n j.m_edgeB.next = j.m_bodyB.m_jointList;\n if (j.m_bodyB.m_jointList) j.m_bodyB.m_jointList.prev = j.m_edgeB;\n j.m_bodyB.m_jointList = j.m_edgeB;\n var bodyA = def.bodyA;\n var bodyB = def.bodyB;\n if (def.collideConnected == false) {\n var edge = bodyB.GetContactList();\n while (edge) {\n if (edge.other == bodyA) {\n edge.contact.FlagForFiltering();\n }\n edge = edge.next;\n }\n }\n return j;\n }\n b2World.prototype.DestroyJoint = function (j) {\n var collideConnected = j.m_collideConnected;\n if (j.m_prev) {\n j.m_prev.m_next = j.m_next;\n }\n if (j.m_next) {\n j.m_next.m_prev = j.m_prev;\n }\n if (j == this.m_jointList) {\n this.m_jointList = j.m_next;\n }\n var bodyA = j.m_bodyA;\n var bodyB = j.m_bodyB;\n bodyA.SetAwake(true);\n bodyB.SetAwake(true);\n if (j.m_edgeA.prev) {\n j.m_edgeA.prev.next = j.m_edgeA.next;\n }\n if (j.m_edgeA.next) {\n j.m_edgeA.next.prev = j.m_edgeA.prev;\n }\n if (j.m_edgeA == bodyA.m_jointList) {\n bodyA.m_jointList = j.m_edgeA.next;\n }\n j.m_edgeA.prev = null;\n j.m_edgeA.next = null;\n if (j.m_edgeB.prev) {\n j.m_edgeB.prev.next = j.m_edgeB.next;\n }\n if (j.m_edgeB.next) {\n j.m_edgeB.next.prev = j.m_edgeB.prev;\n }\n if (j.m_edgeB == bodyB.m_jointList) {\n bodyB.m_jointList = j.m_edgeB.next;\n }\n j.m_edgeB.prev = null;\n j.m_edgeB.next = null;\n b2Joint.Destroy(j, null);\n --this.m_jointCount;\n if (collideConnected == false) {\n var edge = bodyB.GetContactList();\n while (edge) {\n if (edge.other == bodyA) {\n edge.contact.FlagForFiltering();\n }\n edge = edge.next;\n }\n }\n }\n b2World.prototype.AddController = function (c) {\n c.m_next = this.m_controllerList;\n c.m_prev = null;\n this.m_controllerList = c;\n c.m_world = this;\n this.m_controllerCount++;\n return c;\n }\n b2World.prototype.RemoveController = function (c) {\n if (c.m_prev) c.m_prev.m_next = c.m_next;\n if (c.m_next) c.m_next.m_prev = c.m_prev;\n if (this.m_controllerList == c) this.m_controllerList = c.m_next;\n this.m_controllerCount--;\n }\n b2World.prototype.CreateController = function (controller) {\n if (controller.m_world != this) throw new Error(\"Controller can only be a member of one world\");\n controller.m_next = this.m_controllerList;\n controller.m_prev = null;\n if (this.m_controllerList) this.m_controllerList.m_prev = controller;\n this.m_controllerList = controller;\n ++this.m_controllerCount;\n controller.m_world = this;\n return controller;\n }\n b2World.prototype.DestroyController = function (controller) {\n controller.Clear();\n if (controller.m_next) controller.m_next.m_prev = controller.m_prev;\n if (controller.m_prev) controller.m_prev.m_next = controller.m_next;\n if (controller == this.m_controllerList) this.m_controllerList = controller.m_next;\n --this.m_controllerCount;\n }\n b2World.prototype.SetWarmStarting = function (flag) {\n b2World.m_warmStarting = flag;\n }\n b2World.prototype.SetContinuousPhysics = function (flag) {\n b2World.m_continuousPhysics = flag;\n }\n b2World.prototype.GetBodyCount = function () {\n return this.m_bodyCount;\n }\n b2World.prototype.GetJointCount = function () {\n return this.m_jointCount;\n }\n b2World.prototype.GetContactCount = function () {\n return this.m_contactCount;\n }\n b2World.prototype.SetGravity = function (gravity) {\n this.m_gravity = gravity;\n }\n b2World.prototype.GetGravity = function () {\n return this.m_gravity;\n }\n b2World.prototype.GetGroundBody = function () {\n return this.m_groundBody;\n }\n b2World.prototype.Step = function (dt, velocityIterations, positionIterations) {\n if (dt === undefined) dt = 0;\n if (velocityIterations === undefined) velocityIterations = 0;\n if (positionIterations === undefined) positionIterations = 0;\n if (this.m_flags & b2World.e_newFixture) {\n this.m_contactManager.FindNewContacts();\n this.m_flags &= ~b2World.e_newFixture;\n }\n this.m_flags |= b2World.e_locked;\n var step = b2World.s_timestep2;\n step.dt = dt;\n step.velocityIterations = velocityIterations;\n step.positionIterations = positionIterations;\n if (dt > 0.0) {\n step.inv_dt = 1.0 / dt;\n }\n else {\n step.inv_dt = 0.0;\n }\n step.dtRatio = this.m_inv_dt0 * dt;\n step.warmStarting = b2World.m_warmStarting;\n this.m_contactManager.Collide();\n if (step.dt > 0.0) {\n this.Solve(step);\n }\n if (b2World.m_continuousPhysics && step.dt > 0.0) {\n this.SolveTOI(step);\n }\n if (step.dt > 0.0) {\n this.m_inv_dt0 = step.inv_dt;\n }\n this.m_flags &= ~b2World.e_locked;\n }\n b2World.prototype.ClearForces = function () {\n for (var body = this.m_bodyList; body; body = body.m_next) {\n body.m_force.SetZero();\n body.m_torque = 0.0;\n }\n }\n b2World.prototype.DrawDebugData = function () {\n if (this.m_debugDraw == null) {\n return;\n }\n this.m_debugDraw.m_sprite.graphics.clear();\n var flags = this.m_debugDraw.GetFlags();\n var i = 0;\n var b;\n var f;\n var s;\n var j;\n var bp;\n var invQ = new b2Vec2;\n var x1 = new b2Vec2;\n var x2 = new b2Vec2;\n var xf;\n var b1 = new b2AABB();\n var b2 = new b2AABB();\n var vs = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];\n var color = new b2Color(0, 0, 0);\n if (flags & b2DebugDraw.e_shapeBit) {\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n xf = b.m_xf;\n for (f = b.GetFixtureList();\n f; f = f.m_next) {\n s = f.GetShape();\n if (b.IsActive() == false) {\n color.Set(0.5, 0.5, 0.3);\n this.DrawShape(s, xf, color);\n }\n else if (b.GetType() == b2Body.b2_staticBody) {\n color.Set(0.5, 0.9, 0.5);\n this.DrawShape(s, xf, color);\n }\n else if (b.GetType() == b2Body.b2_kinematicBody) {\n color.Set(0.5, 0.5, 0.9);\n this.DrawShape(s, xf, color);\n }\n else if (b.IsAwake() == false) {\n color.Set(0.6, 0.6, 0.6);\n this.DrawShape(s, xf, color);\n }\n else {\n color.Set(0.9, 0.7, 0.7);\n this.DrawShape(s, xf, color);\n }\n }\n }\n }\n if (flags & b2DebugDraw.e_jointBit) {\n for (j = this.m_jointList;\n j; j = j.m_next) {\n this.DrawJoint(j);\n }\n }\n if (flags & b2DebugDraw.e_controllerBit) {\n for (var c = this.m_controllerList; c; c = c.m_next) {\n c.Draw(this.m_debugDraw);\n }\n }\n if (flags & b2DebugDraw.e_pairBit) {\n color.Set(0.3, 0.9, 0.9);\n for (var contact = this.m_contactManager.m_contactList; contact; contact = contact.GetNext()) {\n var fixtureA = contact.GetFixtureA();\n var fixtureB = contact.GetFixtureB();\n var cA = fixtureA.GetAABB().GetCenter();\n var cB = fixtureB.GetAABB().GetCenter();\n this.m_debugDraw.DrawSegment(cA, cB, color);\n }\n }\n if (flags & b2DebugDraw.e_aabbBit) {\n bp = this.m_contactManager.m_broadPhase;\n vs = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];\n for (b = this.m_bodyList;\n b; b = b.GetNext()) {\n if (b.IsActive() == false) {\n continue;\n }\n for (f = b.GetFixtureList();\n f; f = f.GetNext()) {\n var aabb = bp.GetFatAABB(f.m_proxy);\n vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y);\n vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y);\n vs[2].Set(aabb.upperBound.x, aabb.upperBound.y);\n vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y);\n this.m_debugDraw.DrawPolygon(vs, 4, color);\n }\n }\n }\n if (flags & b2DebugDraw.e_centerOfMassBit) {\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n xf = b2World.s_xf;\n xf.R = b.m_xf.R;\n xf.position = b.GetWorldCenter();\n this.m_debugDraw.DrawTransform(xf);\n }\n }\n }\n b2World.prototype.QueryAABB = function (callback, aabb) {\n var __this = this;\n var broadPhase = __this.m_contactManager.m_broadPhase;\n\n function WorldQueryWrapper(proxy) {\n return callback(broadPhase.GetUserData(proxy));\n };\n broadPhase.Query(WorldQueryWrapper, aabb);\n }\n b2World.prototype.QueryShape = function (callback, shape, transform) {\n var __this = this;\n if (transform === undefined) transform = null;\n if (transform == null) {\n transform = new b2Transform();\n transform.SetIdentity();\n }\n var broadPhase = __this.m_contactManager.m_broadPhase;\n\n function WorldQueryWrapper(proxy) {\n var fixture = (broadPhase.GetUserData(proxy) instanceof b2Fixture ? broadPhase.GetUserData(proxy) : null);\n if (b2Shape.TestOverlap(shape, transform, fixture.GetShape(), fixture.GetBody().GetTransform())) return callback(fixture);\n return true;\n };\n var aabb = new b2AABB();\n shape.ComputeAABB(aabb, transform);\n broadPhase.Query(WorldQueryWrapper, aabb);\n }\n b2World.prototype.QueryPoint = function (callback, p) {\n var __this = this;\n var broadPhase = __this.m_contactManager.m_broadPhase;\n\n function WorldQueryWrapper(proxy) {\n var fixture = (broadPhase.GetUserData(proxy) instanceof b2Fixture ? broadPhase.GetUserData(proxy) : null);\n if (fixture.TestPoint(p)) return callback(fixture);\n return true;\n };\n var aabb = new b2AABB();\n aabb.lowerBound.Set(p.x - b2Settings.b2_linearSlop, p.y - b2Settings.b2_linearSlop);\n aabb.upperBound.Set(p.x + b2Settings.b2_linearSlop, p.y + b2Settings.b2_linearSlop);\n broadPhase.Query(WorldQueryWrapper, aabb);\n }\n b2World.prototype.RayCast = function (callback, point1, point2) {\n var __this = this;\n var broadPhase = __this.m_contactManager.m_broadPhase;\n var output = new b2RayCastOutput;\n\n function RayCastWrapper(input, proxy) {\n var userData = broadPhase.GetUserData(proxy);\n var fixture = (userData instanceof b2Fixture ? userData : null);\n var hit = fixture.RayCast(output, input);\n if (hit) {\n var fraction = output.fraction;\n var point = new b2Vec2((1.0 - fraction) * point1.x + fraction * point2.x, (1.0 - fraction) * point1.y + fraction * point2.y);\n return callback(fixture, point, output.normal, fraction);\n }\n return input.maxFraction;\n };\n var input = new b2RayCastInput(point1, point2);\n broadPhase.RayCast(RayCastWrapper, input);\n }\n b2World.prototype.RayCastOne = function (point1, point2) {\n var __this = this;\n var result;\n\n function RayCastOneWrapper(fixture, point, normal, fraction) {\n if (fraction === undefined) fraction = 0;\n result = fixture;\n return fraction;\n };\n __this.RayCast(RayCastOneWrapper, point1, point2);\n return result;\n }\n b2World.prototype.RayCastAll = function (point1, point2) {\n var __this = this;\n var result = new Vector();\n\n function RayCastAllWrapper(fixture, point, normal, fraction) {\n if (fraction === undefined) fraction = 0;\n result[result.length] = fixture;\n return 1;\n };\n __this.RayCast(RayCastAllWrapper, point1, point2);\n return result;\n }\n b2World.prototype.GetBodyList = function () {\n return this.m_bodyList;\n }\n b2World.prototype.GetJointList = function () {\n return this.m_jointList;\n }\n b2World.prototype.GetContactList = function () {\n return this.m_contactList;\n }\n b2World.prototype.IsLocked = function () {\n return (this.m_flags & b2World.e_locked) > 0;\n }\n b2World.prototype.Solve = function (step) {\n var b;\n for (var controller = this.m_controllerList; controller; controller = controller.m_next) {\n controller.Step(step);\n }\n var island = this.m_island;\n island.Initialize(this.m_bodyCount, this.m_contactCount, this.m_jointCount, null, this.m_contactManager.m_contactListener, this.m_contactSolver);\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n b.m_flags &= ~b2Body.e_islandFlag;\n }\n for (var c = this.m_contactList; c; c = c.m_next) {\n c.m_flags &= ~b2Contact.e_islandFlag;\n }\n for (var j = this.m_jointList; j; j = j.m_next) {\n j.m_islandFlag = false;\n }\n var stackSize = parseInt(this.m_bodyCount);\n var stack = this.s_stack;\n for (var seed = this.m_bodyList; seed; seed = seed.m_next) {\n if (seed.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n if (seed.IsAwake() == false || seed.IsActive() == false) {\n continue;\n }\n if (seed.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n island.Clear();\n var stackCount = 0;\n stack[stackCount++] = seed;\n seed.m_flags |= b2Body.e_islandFlag;\n while (stackCount > 0) {\n b = stack[--stackCount];\n island.AddBody(b);\n if (b.IsAwake() == false) {\n b.SetAwake(true);\n }\n if (b.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n var other;\n for (var ce = b.m_contactList; ce; ce = ce.next) {\n if (ce.contact.m_flags & b2Contact.e_islandFlag) {\n continue;\n }\n if (ce.contact.IsSensor() == true || ce.contact.IsEnabled() == false || ce.contact.IsTouching() == false) {\n continue;\n }\n island.AddContact(ce.contact);\n ce.contact.m_flags |= b2Contact.e_islandFlag;\n other = ce.other;\n if (other.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n stack[stackCount++] = other;\n other.m_flags |= b2Body.e_islandFlag;\n }\n for (var jn = b.m_jointList; jn; jn = jn.next) {\n if (jn.joint.m_islandFlag == true) {\n continue;\n }\n other = jn.other;\n if (other.IsActive() == false) {\n continue;\n }\n island.AddJoint(jn.joint);\n jn.joint.m_islandFlag = true;\n if (other.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n stack[stackCount++] = other;\n other.m_flags |= b2Body.e_islandFlag;\n }\n }\n island.Solve(step, this.m_gravity, this.m_allowSleep);\n for (var i = 0; i < island.m_bodyCount; ++i) {\n b = island.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) {\n b.m_flags &= ~b2Body.e_islandFlag;\n }\n }\n }\n for (i = 0;\n i < stack.length; ++i) {\n if (!stack[i]) break;\n stack[i] = null;\n }\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n if (b.IsAwake() == false || b.IsActive() == false) {\n continue;\n }\n if (b.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n b.SynchronizeFixtures();\n }\n this.m_contactManager.FindNewContacts();\n }\n b2World.prototype.SolveTOI = function (step) {\n var b;\n var fA;\n var fB;\n var bA;\n var bB;\n var cEdge;\n var j;\n var island = this.m_island;\n island.Initialize(this.m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, b2Settings.b2_maxTOIJointsPerIsland, null, this.m_contactManager.m_contactListener, this.m_contactSolver);\n var queue = b2World.s_queue;\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n b.m_flags &= ~b2Body.e_islandFlag;\n b.m_sweep.t0 = 0.0;\n }\n var c;\n for (c = this.m_contactList;\n c; c = c.m_next) {\n c.m_flags &= ~ (b2Contact.e_toiFlag | b2Contact.e_islandFlag);\n }\n for (j = this.m_jointList;\n j; j = j.m_next) {\n j.m_islandFlag = false;\n }\n for (;;) {\n var minContact = null;\n var minTOI = 1.0;\n for (c = this.m_contactList;\n c; c = c.m_next) {\n if (c.IsSensor() == true || c.IsEnabled() == false || c.IsContinuous() == false) {\n continue;\n }\n var toi = 1.0;\n if (c.m_flags & b2Contact.e_toiFlag) {\n toi = c.m_toi;\n }\n else {\n fA = c.m_fixtureA;\n fB = c.m_fixtureB;\n bA = fA.m_body;\n bB = fB.m_body;\n if ((bA.GetType() != b2Body.b2_dynamicBody || bA.IsAwake() == false) && (bB.GetType() != b2Body.b2_dynamicBody || bB.IsAwake() == false)) {\n continue;\n }\n var t0 = bA.m_sweep.t0;\n if (bA.m_sweep.t0 < bB.m_sweep.t0) {\n t0 = bB.m_sweep.t0;\n bA.m_sweep.Advance(t0);\n }\n else if (bB.m_sweep.t0 < bA.m_sweep.t0) {\n t0 = bA.m_sweep.t0;\n bB.m_sweep.Advance(t0);\n }\n toi = c.ComputeTOI(bA.m_sweep, bB.m_sweep);\n b2Settings.b2Assert(0.0 <= toi && toi <= 1.0);\n if (toi > 0.0 && toi < 1.0) {\n toi = (1.0 - toi) * t0 + toi;\n if (toi > 1) toi = 1;\n }\n c.m_toi = toi;\n c.m_flags |= b2Contact.e_toiFlag;\n }\n if (Number.MIN_VALUE < toi && toi < minTOI) {\n minContact = c;\n minTOI = toi;\n }\n }\n if (minContact == null || 1.0 - 100.0 * Number.MIN_VALUE < minTOI) {\n break;\n }\n fA = minContact.m_fixtureA;\n fB = minContact.m_fixtureB;\n bA = fA.m_body;\n bB = fB.m_body;\n b2World.s_backupA.Set(bA.m_sweep);\n b2World.s_backupB.Set(bB.m_sweep);\n bA.Advance(minTOI);\n bB.Advance(minTOI);\n minContact.Update(this.m_contactManager.m_contactListener);\n minContact.m_flags &= ~b2Contact.e_toiFlag;\n if (minContact.IsSensor() == true || minContact.IsEnabled() == false) {\n bA.m_sweep.Set(b2World.s_backupA);\n bB.m_sweep.Set(b2World.s_backupB);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n continue;\n }\n if (minContact.IsTouching() == false) {\n continue;\n }\n var seed = bA;\n if (seed.GetType() != b2Body.b2_dynamicBody) {\n seed = bB;\n }\n island.Clear();\n var queueStart = 0;\n var queueSize = 0;\n queue[queueStart + queueSize++] = seed;\n seed.m_flags |= b2Body.e_islandFlag;\n while (queueSize > 0) {\n b = queue[queueStart++];\n --queueSize;\n island.AddBody(b);\n if (b.IsAwake() == false) {\n b.SetAwake(true);\n }\n if (b.GetType() != b2Body.b2_dynamicBody) {\n continue;\n }\n for (cEdge = b.m_contactList;\n cEdge; cEdge = cEdge.next) {\n if (island.m_contactCount == island.m_contactCapacity) {\n break;\n }\n if (cEdge.contact.m_flags & b2Contact.e_islandFlag) {\n continue;\n }\n if (cEdge.contact.IsSensor() == true || cEdge.contact.IsEnabled() == false || cEdge.contact.IsTouching() == false) {\n continue;\n }\n island.AddContact(cEdge.contact);\n cEdge.contact.m_flags |= b2Contact.e_islandFlag;\n var other = cEdge.other;\n if (other.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n if (other.GetType() != b2Body.b2_staticBody) {\n other.Advance(minTOI);\n other.SetAwake(true);\n }\n queue[queueStart + queueSize] = other;\n ++queueSize;\n other.m_flags |= b2Body.e_islandFlag;\n }\n for (var jEdge = b.m_jointList; jEdge; jEdge = jEdge.next) {\n if (island.m_jointCount == island.m_jointCapacity) continue;\n if (jEdge.joint.m_islandFlag == true) continue;\n other = jEdge.other;\n if (other.IsActive() == false) {\n continue;\n }\n island.AddJoint(jEdge.joint);\n jEdge.joint.m_islandFlag = true;\n if (other.m_flags & b2Body.e_islandFlag) continue;\n if (other.GetType() != b2Body.b2_staticBody) {\n other.Advance(minTOI);\n other.SetAwake(true);\n }\n queue[queueStart + queueSize] = other;\n ++queueSize;\n other.m_flags |= b2Body.e_islandFlag;\n }\n }\n var subStep = b2World.s_timestep;\n subStep.warmStarting = false;\n subStep.dt = (1.0 - minTOI) * step.dt;\n subStep.inv_dt = 1.0 / subStep.dt;\n subStep.dtRatio = 0.0;\n subStep.velocityIterations = step.velocityIterations;\n subStep.positionIterations = step.positionIterations;\n island.SolveTOI(subStep);\n var i = 0;\n for (i = 0;\n i < island.m_bodyCount; ++i) {\n b = island.m_bodies[i];\n b.m_flags &= ~b2Body.e_islandFlag;\n if (b.IsAwake() == false) {\n continue;\n }\n if (b.GetType() != b2Body.b2_dynamicBody) {\n continue;\n }\n b.SynchronizeFixtures();\n for (cEdge = b.m_contactList;\n cEdge; cEdge = cEdge.next) {\n cEdge.contact.m_flags &= ~b2Contact.e_toiFlag;\n }\n }\n for (i = 0;\n i < island.m_contactCount; ++i) {\n c = island.m_contacts[i];\n c.m_flags &= ~ (b2Contact.e_toiFlag | b2Contact.e_islandFlag);\n }\n for (i = 0;\n i < island.m_jointCount; ++i) {\n j = island.m_joints[i];\n j.m_islandFlag = false;\n }\n this.m_contactManager.FindNewContacts();\n }\n }\n b2World.prototype.DrawJoint = function (joint) {\n var b1 = joint.GetBodyA();\n var b2 = joint.GetBodyB();\n var xf1 = b1.m_xf;\n var xf2 = b2.m_xf;\n var x1 = xf1.position;\n var x2 = xf2.position;\n var p1 = joint.GetAnchorA();\n var p2 = joint.GetAnchorB();\n var color = b2World.s_jointColor;\n switch (joint.m_type) {\n case b2Joint.e_distanceJoint:\n this.m_debugDraw.DrawSegment(p1, p2, color);\n break;\n case b2Joint.e_pulleyJoint:\n {\n var pulley = ((joint instanceof b2PulleyJoint ? joint : null));\n var s1 = pulley.GetGroundAnchorA();\n var s2 = pulley.GetGroundAnchorB();\n this.m_debugDraw.DrawSegment(s1, p1, color);\n this.m_debugDraw.DrawSegment(s2, p2, color);\n this.m_debugDraw.DrawSegment(s1, s2, color);\n }\n break;\n case b2Joint.e_mouseJoint:\n this.m_debugDraw.DrawSegment(p1, p2, color);\n break;\n default:\n if (b1 != this.m_groundBody) this.m_debugDraw.DrawSegment(x1, p1, color);\n this.m_debugDraw.DrawSegment(p1, p2, color);\n if (b2 != this.m_groundBody) this.m_debugDraw.DrawSegment(x2, p2, color);\n }\n }\n b2World.prototype.DrawShape = function (shape, xf, color) {\n switch (shape.m_type) {\n case b2Shape.e_circleShape:\n {\n var circle = ((shape instanceof b2CircleShape ? shape : null));\n var center = b2Math.MulX(xf, circle.m_p);\n var radius = circle.m_radius;\n var axis = xf.R.col1;\n this.m_debugDraw.DrawSolidCircle(center, radius, axis, color);\n }\n break;\n case b2Shape.e_polygonShape:\n {\n var i = 0;\n var poly = ((shape instanceof b2PolygonShape ? shape : null));\n var vertexCount = parseInt(poly.GetVertexCount());\n var localVertices = poly.GetVertices();\n var vertices = new Vector(vertexCount);\n for (i = 0;\n i < vertexCount; ++i) {\n vertices[i] = b2Math.MulX(xf, localVertices[i]);\n }\n this.m_debugDraw.DrawSolidPolygon(vertices, vertexCount, color);\n }\n break;\n case b2Shape.e_edgeShape:\n {\n var edge = (shape instanceof b2EdgeShape ? shape : null);\n this.m_debugDraw.DrawSegment(b2Math.MulX(xf, edge.GetVertex1()), b2Math.MulX(xf, edge.GetVertex2()), color);\n }\n break;\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2World.s_timestep2 = new b2TimeStep();\n Box2D.Dynamics.b2World.prototype.s_timestep2 = Box2D.Dynamics.b2World.s_timestep2;\n Box2D.Dynamics.b2World.s_xf = new b2Transform();\n Box2D.Dynamics.b2World.prototype.s_xf = Box2D.Dynamics.b2World.s_xf;\n Box2D.Dynamics.b2World.s_backupA = new b2Sweep();\n Box2D.Dynamics.b2World.prototype.s_backupA = Box2D.Dynamics.b2World.s_backupA;\n Box2D.Dynamics.b2World.s_backupB = new b2Sweep();\n Box2D.Dynamics.b2World.prototype.s_backupB = Box2D.Dynamics.b2World.s_backupB;\n Box2D.Dynamics.b2World.s_timestep = new b2TimeStep();\n Box2D.Dynamics.b2World.prototype.s_timestep = Box2D.Dynamics.b2World.s_timestep;\n Box2D.Dynamics.b2World.s_queue = new Vector();\n Box2D.Dynamics.b2World.prototype.s_queue = Box2D.Dynamics.b2World.s_queue;\n Box2D.Dynamics.b2World.s_jointColor = new b2Color(0.5, 0.8, 0.8);\n Box2D.Dynamics.b2World.prototype.s_jointColor = Box2D.Dynamics.b2World.s_jointColor;\n Box2D.Dynamics.b2World.e_newFixture = 0x0001;\n Box2D.Dynamics.b2World.prototype.e_newFixture = Box2D.Dynamics.b2World.e_newFixture;\n Box2D.Dynamics.b2World.e_locked = 0x0002;\n Box2D.Dynamics.b2World.prototype.e_locked = Box2D.Dynamics.b2World.e_locked;\n });\n})(); /* source: disabled*/\n(function () {\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2CircleContact = Box2D.Dynamics.Contacts.b2CircleContact;\n var b2Contact = Box2D.Dynamics.Contacts.b2Contact;\n var b2ContactConstraint = Box2D.Dynamics.Contacts.b2ContactConstraint;\n var b2ContactConstraintPoint = Box2D.Dynamics.Contacts.b2ContactConstraintPoint;\n var b2ContactEdge = Box2D.Dynamics.Contacts.b2ContactEdge;\n var b2ContactFactory = Box2D.Dynamics.Contacts.b2ContactFactory;\n var b2ContactRegister = Box2D.Dynamics.Contacts.b2ContactRegister;\n var b2ContactResult = Box2D.Dynamics.Contacts.b2ContactResult;\n var b2ContactSolver = Box2D.Dynamics.Contacts.b2ContactSolver;\n var b2EdgeAndCircleContact = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact;\n var b2NullContact = Box2D.Dynamics.Contacts.b2NullContact;\n var b2PolyAndCircleContact = Box2D.Dynamics.Contacts.b2PolyAndCircleContact;\n var b2PolyAndEdgeContact = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact;\n var b2PolygonContact = Box2D.Dynamics.Contacts.b2PolygonContact;\n var b2PositionSolverManifold = Box2D.Dynamics.Contacts.b2PositionSolverManifold;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2internal = Box2D.Common.b2internal;\n var b2CircleContact = Box2D.Dynamics.Contacts.b2CircleContact;\n var b2Contact = Box2D.Dynamics.Contacts.b2Contact;\n var b2ContactConstraint = Box2D.Dynamics.Contacts.b2ContactConstraint;\n var b2ContactConstraintPoint = Box2D.Dynamics.Contacts.b2ContactConstraintPoint;\n var b2ContactEdge = Box2D.Dynamics.Contacts.b2ContactEdge;\n var b2ContactFactory = Box2D.Dynamics.Contacts.b2ContactFactory;\n var b2ContactRegister = Box2D.Dynamics.Contacts.b2ContactRegister;\n var b2ContactResult = Box2D.Dynamics.Contacts.b2ContactResult;\n var b2ContactSolver = Box2D.Dynamics.Contacts.b2ContactSolver;\n var b2EdgeAndCircleContact = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact;\n var b2NullContact = Box2D.Dynamics.Contacts.b2NullContact;\n var b2PolyAndCircleContact = Box2D.Dynamics.Contacts.b2PolyAndCircleContact;\n var b2PolyAndEdgeContact = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact;\n var b2PolygonContact = Box2D.Dynamics.Contacts.b2PolygonContact;\n var b2PositionSolverManifold = Box2D.Dynamics.Contacts.b2PositionSolverManifold;\n b2CircleContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2CircleContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2CircleContact.b2CircleContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2CircleContact.prototype.Create = function (allocator) {\n return new b2CircleContact();\n }\n b2CircleContact.Create = b2CircleContact.prototype.Create;\n b2CircleContact.prototype.Destroy = function (contact, allocator) {}\n b2CircleContact.Destroy = b2CircleContact.prototype.Destroy;\n b2CircleContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n }\n b2CircleContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n b2Collision.CollideCircles(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2CircleShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2CircleShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2Contact.b2Contact = function () {\n this.m_nodeA = new b2ContactEdge();\n this.m_nodeB = new b2ContactEdge();\n this.m_manifold = new b2Manifold();\n this.m_oldManifold = new b2Manifold();\n };\n b2Contact.prototype.GetManifold = function () {\n return this.m_manifold;\n }\n b2Contact.prototype.GetWorldManifold = function (worldManifold) {\n var bodyA = this.m_fixtureA.GetBody();\n var bodyB = this.m_fixtureB.GetBody();\n var shapeA = this.m_fixtureA.GetShape();\n var shapeB = this.m_fixtureB.GetShape();\n worldManifold.Initialize(this.m_manifold, bodyA.GetTransform(), shapeA.m_radius, bodyB.GetTransform(), shapeB.m_radius);\n }\n b2Contact.prototype.IsTouching = function () {\n return (this.m_flags & b2Contact.e_touchingFlag) == b2Contact.e_touchingFlag;\n }\n b2Contact.prototype.IsContinuous = function () {\n return (this.m_flags & b2Contact.e_continuousFlag) == b2Contact.e_continuousFlag;\n }\n b2Contact.prototype.SetSensor = function (sensor) {\n if (sensor) {\n this.m_flags |= b2Contact.e_sensorFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_sensorFlag;\n }\n }\n b2Contact.prototype.IsSensor = function () {\n return (this.m_flags & b2Contact.e_sensorFlag) == b2Contact.e_sensorFlag;\n }\n b2Contact.prototype.SetEnabled = function (flag) {\n if (flag) {\n this.m_flags |= b2Contact.e_enabledFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_enabledFlag;\n }\n }\n b2Contact.prototype.IsEnabled = function () {\n return (this.m_flags & b2Contact.e_enabledFlag) == b2Contact.e_enabledFlag;\n }\n b2Contact.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Contact.prototype.GetFixtureA = function () {\n return this.m_fixtureA;\n }\n b2Contact.prototype.GetFixtureB = function () {\n return this.m_fixtureB;\n }\n b2Contact.prototype.FlagForFiltering = function () {\n this.m_flags |= b2Contact.e_filterFlag;\n }\n b2Contact.prototype.b2Contact = function () {}\n b2Contact.prototype.Reset = function (fixtureA, fixtureB) {\n if (fixtureA === undefined) fixtureA = null;\n if (fixtureB === undefined) fixtureB = null;\n this.m_flags = b2Contact.e_enabledFlag;\n if (!fixtureA || !fixtureB) {\n this.m_fixtureA = null;\n this.m_fixtureB = null;\n return;\n }\n if (fixtureA.IsSensor() || fixtureB.IsSensor()) {\n this.m_flags |= b2Contact.e_sensorFlag;\n }\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (bodyA.GetType() != b2Body.b2_dynamicBody || bodyA.IsBullet() || bodyB.GetType() != b2Body.b2_dynamicBody || bodyB.IsBullet()) {\n this.m_flags |= b2Contact.e_continuousFlag;\n }\n this.m_fixtureA = fixtureA;\n this.m_fixtureB = fixtureB;\n this.m_manifold.m_pointCount = 0;\n this.m_prev = null;\n this.m_next = null;\n this.m_nodeA.contact = null;\n this.m_nodeA.prev = null;\n this.m_nodeA.next = null;\n this.m_nodeA.other = null;\n this.m_nodeB.contact = null;\n this.m_nodeB.prev = null;\n this.m_nodeB.next = null;\n this.m_nodeB.other = null;\n }\n b2Contact.prototype.Update = function (listener) {\n var tManifold = this.m_oldManifold;\n this.m_oldManifold = this.m_manifold;\n this.m_manifold = tManifold;\n this.m_flags |= b2Contact.e_enabledFlag;\n var touching = false;\n var wasTouching = (this.m_flags & b2Contact.e_touchingFlag) == b2Contact.e_touchingFlag;\n var bodyA = this.m_fixtureA.m_body;\n var bodyB = this.m_fixtureB.m_body;\n var aabbOverlap = this.m_fixtureA.m_aabb.TestOverlap(this.m_fixtureB.m_aabb);\n if (this.m_flags & b2Contact.e_sensorFlag) {\n if (aabbOverlap) {\n var shapeA = this.m_fixtureA.GetShape();\n var shapeB = this.m_fixtureB.GetShape();\n var xfA = bodyA.GetTransform();\n var xfB = bodyB.GetTransform();\n touching = b2Shape.TestOverlap(shapeA, xfA, shapeB, xfB);\n }\n this.m_manifold.m_pointCount = 0;\n }\n else {\n if (bodyA.GetType() != b2Body.b2_dynamicBody || bodyA.IsBullet() || bodyB.GetType() != b2Body.b2_dynamicBody || bodyB.IsBullet()) {\n this.m_flags |= b2Contact.e_continuousFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_continuousFlag;\n }\n if (aabbOverlap) {\n this.Evaluate();\n touching = this.m_manifold.m_pointCount > 0;\n for (var i = 0; i < this.m_manifold.m_pointCount; ++i) {\n var mp2 = this.m_manifold.m_points[i];\n mp2.m_normalImpulse = 0.0;\n mp2.m_tangentImpulse = 0.0;\n var id2 = mp2.m_id;\n for (var j = 0; j < this.m_oldManifold.m_pointCount; ++j) {\n var mp1 = this.m_oldManifold.m_points[j];\n if (mp1.m_id.key == id2.key) {\n mp2.m_normalImpulse = mp1.m_normalImpulse;\n mp2.m_tangentImpulse = mp1.m_tangentImpulse;\n break;\n }\n }\n }\n }\n else {\n this.m_manifold.m_pointCount = 0;\n }\n if (touching != wasTouching) {\n bodyA.SetAwake(true);\n bodyB.SetAwake(true);\n }\n }\n if (touching) {\n this.m_flags |= b2Contact.e_touchingFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_touchingFlag;\n }\n if (wasTouching == false && touching == true) {\n listener.BeginContact(this);\n }\n if (wasTouching == true && touching == false) {\n listener.EndContact(this);\n }\n if ((this.m_flags & b2Contact.e_sensorFlag) == 0) {\n listener.PreSolve(this, this.m_oldManifold);\n }\n }\n b2Contact.prototype.Evaluate = function () {}\n b2Contact.prototype.ComputeTOI = function (sweepA, sweepB) {\n b2Contact.s_input.proxyA.Set(this.m_fixtureA.GetShape());\n b2Contact.s_input.proxyB.Set(this.m_fixtureB.GetShape());\n b2Contact.s_input.sweepA = sweepA;\n b2Contact.s_input.sweepB = sweepB;\n b2Contact.s_input.tolerance = b2Settings.b2_linearSlop;\n return b2TimeOfImpact.TimeOfImpact(b2Contact.s_input);\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag = 0x0001;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_sensorFlag = Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag = 0x0002;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_continuousFlag = Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_islandFlag = 0x0004;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_islandFlag = Box2D.Dynamics.Contacts.b2Contact.e_islandFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_toiFlag = 0x0008;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_toiFlag = Box2D.Dynamics.Contacts.b2Contact.e_toiFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag = 0x0010;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_touchingFlag = Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag = 0x0020;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_enabledFlag = Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_filterFlag = 0x0040;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_filterFlag = Box2D.Dynamics.Contacts.b2Contact.e_filterFlag;\n Box2D.Dynamics.Contacts.b2Contact.s_input = new b2TOIInput();\n Box2D.Dynamics.Contacts.b2Contact.prototype.s_input = Box2D.Dynamics.Contacts.b2Contact.s_input;\n });\n b2ContactConstraint.b2ContactConstraint = function () {\n this.localPlaneNormal = new b2Vec2();\n this.localPoint = new b2Vec2();\n this.normal = new b2Vec2();\n this.normalMass = new b2Mat22();\n this.K = new b2Mat22();\n };\n b2ContactConstraint.prototype.b2ContactConstraint = function () {\n this.points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.points[i] = new b2ContactConstraintPoint();\n }\n }\n b2ContactConstraintPoint.b2ContactConstraintPoint = function () {\n this.localPoint = new b2Vec2();\n this.rA = new b2Vec2();\n this.rB = new b2Vec2();\n };\n b2ContactEdge.b2ContactEdge = function () {};\n b2ContactFactory.b2ContactFactory = function () {};\n b2ContactFactory.prototype.b2ContactFactory = function (allocator) {\n this.m_allocator = allocator;\n this.InitializeRegisters();\n }\n b2ContactFactory.prototype.AddType = function (createFcn, destroyFcn, type1, type2) {\n if (type1 === undefined) type1 = 0;\n if (type2 === undefined) type2 = 0;\n this.m_registers[type1][type2].createFcn = createFcn;\n this.m_registers[type1][type2].destroyFcn = destroyFcn;\n this.m_registers[type1][type2].primary = true;\n if (type1 != type2) {\n this.m_registers[type2][type1].createFcn = createFcn;\n this.m_registers[type2][type1].destroyFcn = destroyFcn;\n this.m_registers[type2][type1].primary = false;\n }\n }\n b2ContactFactory.prototype.InitializeRegisters = function () {\n this.m_registers = new Vector(b2Shape.e_shapeTypeCount);\n for (var i = 0; i < b2Shape.e_shapeTypeCount; i++) {\n this.m_registers[i] = new Vector(b2Shape.e_shapeTypeCount);\n for (var j = 0; j < b2Shape.e_shapeTypeCount; j++) {\n this.m_registers[i][j] = new b2ContactRegister();\n }\n }\n this.AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);\n this.AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);\n this.AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);\n this.AddType(b2EdgeAndCircleContact.Create, b2EdgeAndCircleContact.Destroy, b2Shape.e_edgeShape, b2Shape.e_circleShape);\n this.AddType(b2PolyAndEdgeContact.Create, b2PolyAndEdgeContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_edgeShape);\n }\n b2ContactFactory.prototype.Create = function (fixtureA, fixtureB) {\n var type1 = parseInt(fixtureA.GetType());\n var type2 = parseInt(fixtureB.GetType());\n var reg = this.m_registers[type1][type2];\n var c;\n if (reg.pool) {\n c = reg.pool;\n reg.pool = c.m_next;\n reg.poolCount--;\n c.Reset(fixtureA, fixtureB);\n return c;\n }\n var createFcn = reg.createFcn;\n if (createFcn != null) {\n if (reg.primary) {\n c = createFcn(this.m_allocator);\n c.Reset(fixtureA, fixtureB);\n return c;\n }\n else {\n c = createFcn(this.m_allocator);\n c.Reset(fixtureB, fixtureA);\n return c;\n }\n }\n else {\n return null;\n }\n }\n b2ContactFactory.prototype.Destroy = function (contact) {\n if (contact.m_manifold.m_pointCount > 0) {\n contact.m_fixtureA.m_body.SetAwake(true);\n contact.m_fixtureB.m_body.SetAwake(true);\n }\n var type1 = parseInt(contact.m_fixtureA.GetType());\n var type2 = parseInt(contact.m_fixtureB.GetType());\n var reg = this.m_registers[type1][type2];\n if (true) {\n reg.poolCount++;\n contact.m_next = reg.pool;\n reg.pool = contact;\n }\n var destroyFcn = reg.destroyFcn;\n destroyFcn(contact, this.m_allocator);\n }\n b2ContactRegister.b2ContactRegister = function () {};\n b2ContactResult.b2ContactResult = function () {\n this.position = new b2Vec2();\n this.normal = new b2Vec2();\n this.id = new b2ContactID();\n };\n b2ContactSolver.b2ContactSolver = function () {\n this.m_step = new b2TimeStep();\n this.m_constraints = new Vector();\n };\n b2ContactSolver.prototype.b2ContactSolver = function () {}\n b2ContactSolver.prototype.Initialize = function (step, contacts, contactCount, allocator) {\n if (contactCount === undefined) contactCount = 0;\n var contact;\n this.m_step.Set(step);\n this.m_allocator = allocator;\n var i = 0;\n var tVec;\n var tMat;\n this.m_constraintCount = contactCount;\n while (this.m_constraints.length < this.m_constraintCount) {\n this.m_constraints[this.m_constraints.length] = new b2ContactConstraint();\n }\n for (i = 0;\n i < contactCount; ++i) {\n contact = contacts[i];\n var fixtureA = contact.m_fixtureA;\n var fixtureB = contact.m_fixtureB;\n var shapeA = fixtureA.m_shape;\n var shapeB = fixtureB.m_shape;\n var radiusA = shapeA.m_radius;\n var radiusB = shapeB.m_radius;\n var bodyA = fixtureA.m_body;\n var bodyB = fixtureB.m_body;\n var manifold = contact.GetManifold();\n var friction = b2Settings.b2MixFriction(fixtureA.GetFriction(), fixtureB.GetFriction());\n var restitution = b2Settings.b2MixRestitution(fixtureA.GetRestitution(), fixtureB.GetRestitution());\n var vAX = bodyA.m_linearVelocity.x;\n var vAY = bodyA.m_linearVelocity.y;\n var vBX = bodyB.m_linearVelocity.x;\n var vBY = bodyB.m_linearVelocity.y;\n var wA = bodyA.m_angularVelocity;\n var wB = bodyB.m_angularVelocity;\n b2Settings.b2Assert(manifold.m_pointCount > 0);\n b2ContactSolver.s_worldManifold.Initialize(manifold, bodyA.m_xf, radiusA, bodyB.m_xf, radiusB);\n var normalX = b2ContactSolver.s_worldManifold.m_normal.x;\n var normalY = b2ContactSolver.s_worldManifold.m_normal.y;\n var cc = this.m_constraints[i];\n cc.bodyA = bodyA;\n cc.bodyB = bodyB;\n cc.manifold = manifold;\n cc.normal.x = normalX;\n cc.normal.y = normalY;\n cc.pointCount = manifold.m_pointCount;\n cc.friction = friction;\n cc.restitution = restitution;\n cc.localPlaneNormal.x = manifold.m_localPlaneNormal.x;\n cc.localPlaneNormal.y = manifold.m_localPlaneNormal.y;\n cc.localPoint.x = manifold.m_localPoint.x;\n cc.localPoint.y = manifold.m_localPoint.y;\n cc.radius = radiusA + radiusB;\n cc.type = manifold.m_type;\n for (var k = 0; k < cc.pointCount; ++k) {\n var cp = manifold.m_points[k];\n var ccp = cc.points[k];\n ccp.normalImpulse = cp.m_normalImpulse;\n ccp.tangentImpulse = cp.m_tangentImpulse;\n ccp.localPoint.SetV(cp.m_localPoint);\n var rAX = ccp.rA.x = b2ContactSolver.s_worldManifold.m_points[k].x - bodyA.m_sweep.c.x;\n var rAY = ccp.rA.y = b2ContactSolver.s_worldManifold.m_points[k].y - bodyA.m_sweep.c.y;\n var rBX = ccp.rB.x = b2ContactSolver.s_worldManifold.m_points[k].x - bodyB.m_sweep.c.x;\n var rBY = ccp.rB.y = b2ContactSolver.s_worldManifold.m_points[k].y - bodyB.m_sweep.c.y;\n var rnA = rAX * normalY - rAY * normalX;\n var rnB = rBX * normalY - rBY * normalX;\n rnA *= rnA;\n rnB *= rnB;\n var kNormal = bodyA.m_invMass + bodyB.m_invMass + bodyA.m_invI * rnA + bodyB.m_invI * rnB;\n ccp.normalMass = 1.0 / kNormal;\n var kEqualized = bodyA.m_mass * bodyA.m_invMass + bodyB.m_mass * bodyB.m_invMass;\n kEqualized += bodyA.m_mass * bodyA.m_invI * rnA + bodyB.m_mass * bodyB.m_invI * rnB;\n ccp.equalizedMass = 1.0 / kEqualized;\n var tangentX = normalY;\n var tangentY = (-normalX);\n var rtA = rAX * tangentY - rAY * tangentX;\n var rtB = rBX * tangentY - rBY * tangentX;\n rtA *= rtA;\n rtB *= rtB;\n var kTangent = bodyA.m_invMass + bodyB.m_invMass + bodyA.m_invI * rtA + bodyB.m_invI * rtB;\n ccp.tangentMass = 1.0 / kTangent;\n ccp.velocityBias = 0.0;\n var tX = vBX + ((-wB * rBY)) - vAX - ((-wA * rAY));\n var tY = vBY + (wB * rBX) - vAY - (wA * rAX);\n var vRel = cc.normal.x * tX + cc.normal.y * tY;\n if (vRel < (-b2Settings.b2_velocityThreshold)) {\n ccp.velocityBias += (-cc.restitution * vRel);\n }\n }\n if (cc.pointCount == 2) {\n var ccp1 = cc.points[0];\n var ccp2 = cc.points[1];\n var invMassA = bodyA.m_invMass;\n var invIA = bodyA.m_invI;\n var invMassB = bodyB.m_invMass;\n var invIB = bodyB.m_invI;\n var rn1A = ccp1.rA.x * normalY - ccp1.rA.y * normalX;\n var rn1B = ccp1.rB.x * normalY - ccp1.rB.y * normalX;\n var rn2A = ccp2.rA.x * normalY - ccp2.rA.y * normalX;\n var rn2B = ccp2.rB.x * normalY - ccp2.rB.y * normalX;\n var k11 = invMassA + invMassB + invIA * rn1A * rn1A + invIB * rn1B * rn1B;\n var k22 = invMassA + invMassB + invIA * rn2A * rn2A + invIB * rn2B * rn2B;\n var k12 = invMassA + invMassB + invIA * rn1A * rn2A + invIB * rn1B * rn2B;\n var k_maxConditionNumber = 100.0;\n if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) {\n cc.K.col1.Set(k11, k12);\n cc.K.col2.Set(k12, k22);\n cc.K.GetInverse(cc.normalMass);\n }\n else {\n cc.pointCount = 1;\n }\n }\n }\n }\n b2ContactSolver.prototype.InitVelocityConstraints = function (step) {\n var tVec;\n var tVec2;\n var tMat;\n for (var i = 0; i < this.m_constraintCount; ++i) {\n var c = this.m_constraints[i];\n var bodyA = c.bodyA;\n var bodyB = c.bodyB;\n var invMassA = bodyA.m_invMass;\n var invIA = bodyA.m_invI;\n var invMassB = bodyB.m_invMass;\n var invIB = bodyB.m_invI;\n var normalX = c.normal.x;\n var normalY = c.normal.y;\n var tangentX = normalY;\n var tangentY = (-normalX);\n var tX = 0;\n var j = 0;\n var tCount = 0;\n if (step.warmStarting) {\n tCount = c.pointCount;\n for (j = 0;\n j < tCount; ++j) {\n var ccp = c.points[j];\n ccp.normalImpulse *= step.dtRatio;\n ccp.tangentImpulse *= step.dtRatio;\n var PX = ccp.normalImpulse * normalX + ccp.tangentImpulse * tangentX;\n var PY = ccp.normalImpulse * normalY + ccp.tangentImpulse * tangentY;\n bodyA.m_angularVelocity -= invIA * (ccp.rA.x * PY - ccp.rA.y * PX);\n bodyA.m_linearVelocity.x -= invMassA * PX;\n bodyA.m_linearVelocity.y -= invMassA * PY;\n bodyB.m_angularVelocity += invIB * (ccp.rB.x * PY - ccp.rB.y * PX);\n bodyB.m_linearVelocity.x += invMassB * PX;\n bodyB.m_linearVelocity.y += invMassB * PY;\n }\n }\n else {\n tCount = c.pointCount;\n for (j = 0;\n j < tCount; ++j) {\n var ccp2 = c.points[j];\n ccp2.normalImpulse = 0.0;\n ccp2.tangentImpulse = 0.0;\n }\n }\n }\n }\n b2ContactSolver.prototype.SolveVelocityConstraints = function () {\n var j = 0;\n var ccp;\n var rAX = 0;\n var rAY = 0;\n var rBX = 0;\n var rBY = 0;\n var dvX = 0;\n var dvY = 0;\n var vn = 0;\n var vt = 0;\n var lambda = 0;\n var maxFriction = 0;\n var newImpulse = 0;\n var PX = 0;\n var PY = 0;\n var dX = 0;\n var dY = 0;\n var P1X = 0;\n var P1Y = 0;\n var P2X = 0;\n var P2Y = 0;\n var tMat;\n var tVec;\n for (var i = 0; i < this.m_constraintCount; ++i) {\n var c = this.m_constraints[i];\n var bodyA = c.bodyA;\n var bodyB = c.bodyB;\n var wA = bodyA.m_angularVelocity;\n var wB = bodyB.m_angularVelocity;\n var vA = bodyA.m_linearVelocity;\n var vB = bodyB.m_linearVelocity;\n var invMassA = bodyA.m_invMass;\n var invIA = bodyA.m_invI;\n var invMassB = bodyB.m_invMass;\n var invIB = bodyB.m_invI;\n var normalX = c.normal.x;\n var normalY = c.normal.y;\n var tangentX = normalY;\n var tangentY = (-normalX);\n var friction = c.friction;\n var tX = 0;\n for (j = 0;\n j < c.pointCount; j++) {\n ccp = c.points[j];\n dvX = vB.x - wB * ccp.rB.y - vA.x + wA * ccp.rA.y;\n dvY = vB.y + wB * ccp.rB.x - vA.y - wA * ccp.rA.x;\n vt = dvX * tangentX + dvY * tangentY;\n lambda = ccp.tangentMass * (-vt);\n maxFriction = friction * ccp.normalImpulse;\n newImpulse = b2Math.Clamp(ccp.tangentImpulse + lambda, (-maxFriction), maxFriction);\n lambda = newImpulse - ccp.tangentImpulse;\n PX = lambda * tangentX;\n PY = lambda * tangentY;\n vA.x -= invMassA * PX;\n vA.y -= invMassA * PY;\n wA -= invIA * (ccp.rA.x * PY - ccp.rA.y * PX);\n vB.x += invMassB * PX;\n vB.y += invMassB * PY;\n wB += invIB * (ccp.rB.x * PY - ccp.rB.y * PX);\n ccp.tangentImpulse = newImpulse;\n }\n var tCount = parseInt(c.pointCount);\n if (c.pointCount == 1) {\n ccp = c.points[0];\n dvX = vB.x + ((-wB * ccp.rB.y)) - vA.x - ((-wA * ccp.rA.y));\n dvY = vB.y + (wB * ccp.rB.x) - vA.y - (wA * ccp.rA.x);\n vn = dvX * normalX + dvY * normalY;\n lambda = (-ccp.normalMass * (vn - ccp.velocityBias));\n newImpulse = ccp.normalImpulse + lambda;\n newImpulse = newImpulse > 0 ? newImpulse : 0.0;\n lambda = newImpulse - ccp.normalImpulse;\n PX = lambda * normalX;\n PY = lambda * normalY;\n vA.x -= invMassA * PX;\n vA.y -= invMassA * PY;\n wA -= invIA * (ccp.rA.x * PY - ccp.rA.y * PX);\n vB.x += invMassB * PX;\n vB.y += invMassB * PY;\n wB += invIB * (ccp.rB.x * PY - ccp.rB.y * PX);\n ccp.normalImpulse = newImpulse;\n }\n else {\n var cp1 = c.points[0];\n var cp2 = c.points[1];\n var aX = cp1.normalImpulse;\n var aY = cp2.normalImpulse;\n var dv1X = vB.x - wB * cp1.rB.y - vA.x + wA * cp1.rA.y;\n var dv1Y = vB.y + wB * cp1.rB.x - vA.y - wA * cp1.rA.x;\n var dv2X = vB.x - wB * cp2.rB.y - vA.x + wA * cp2.rA.y;\n var dv2Y = vB.y + wB * cp2.rB.x - vA.y - wA * cp2.rA.x;\n var vn1 = dv1X * normalX + dv1Y * normalY;\n var vn2 = dv2X * normalX + dv2Y * normalY;\n var bX = vn1 - cp1.velocityBias;\n var bY = vn2 - cp2.velocityBias;\n tMat = c.K;\n bX -= tMat.col1.x * aX + tMat.col2.x * aY;\n bY -= tMat.col1.y * aX + tMat.col2.y * aY;\n var k_errorTol = 0.001;\n for (;;) {\n tMat = c.normalMass;\n var xX = (-(tMat.col1.x * bX + tMat.col2.x * bY));\n var xY = (-(tMat.col1.y * bX + tMat.col2.y * bY));\n if (xX >= 0.0 && xY >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n xX = (-cp1.normalMass * bX);\n xY = 0.0;\n vn1 = 0.0;\n vn2 = c.K.col1.y * xX + bY;\n if (xX >= 0.0 && vn2 >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n xX = 0.0;\n xY = (-cp2.normalMass * bY);\n vn1 = c.K.col2.x * xY + bX;\n vn2 = 0.0;\n if (xY >= 0.0 && vn1 >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n xX = 0.0;\n xY = 0.0;\n vn1 = bX;\n vn2 = bY;\n if (vn1 >= 0.0 && vn2 >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n break;\n }\n }\n bodyA.m_angularVelocity = wA;\n bodyB.m_angularVelocity = wB;\n }\n }\n b2ContactSolver.prototype.FinalizeVelocityConstraints = function () {\n for (var i = 0; i < this.m_constraintCount; ++i) {\n var c = this.m_constraints[i];\n var m = c.manifold;\n for (var j = 0; j < c.pointCount; ++j) {\n var point1 = m.m_points[j];\n var point2 = c.points[j];\n point1.m_normalImpulse = point2.normalImpulse;\n point1.m_tangentImpulse = point2.tangentImpulse;\n }\n }\n }\n b2ContactSolver.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var minSeparation = 0.0;\n for (var i = 0; i < this.m_constraintCount; i++) {\n var c = this.m_constraints[i];\n var bodyA = c.bodyA;\n var bodyB = c.bodyB;\n var invMassA = bodyA.m_mass * bodyA.m_invMass;\n var invIA = bodyA.m_mass * bodyA.m_invI;\n var invMassB = bodyB.m_mass * bodyB.m_invMass;\n var invIB = bodyB.m_mass * bodyB.m_invI;\n b2ContactSolver.s_psm.Initialize(c);\n var normal = b2ContactSolver.s_psm.m_normal;\n for (var j = 0; j < c.pointCount; j++) {\n var ccp = c.points[j];\n var point = b2ContactSolver.s_psm.m_points[j];\n var separation = b2ContactSolver.s_psm.m_separations[j];\n var rAX = point.x - bodyA.m_sweep.c.x;\n var rAY = point.y - bodyA.m_sweep.c.y;\n var rBX = point.x - bodyB.m_sweep.c.x;\n var rBY = point.y - bodyB.m_sweep.c.y;\n minSeparation = minSeparation < separation ? minSeparation : separation;\n var C = b2Math.Clamp(baumgarte * (separation + b2Settings.b2_linearSlop), (-b2Settings.b2_maxLinearCorrection), 0.0);\n var impulse = (-ccp.equalizedMass * C);\n var PX = impulse * normal.x;\n var PY = impulse * normal.y;bodyA.m_sweep.c.x -= invMassA * PX;\n bodyA.m_sweep.c.y -= invMassA * PY;\n bodyA.m_sweep.a -= invIA * (rAX * PY - rAY * PX);\n bodyA.SynchronizeTransform();\n bodyB.m_sweep.c.x += invMassB * PX;\n bodyB.m_sweep.c.y += invMassB * PY;\n bodyB.m_sweep.a += invIB * (rBX * PY - rBY * PX);\n bodyB.SynchronizeTransform();\n }\n }\n return minSeparation > (-1.5 * b2Settings.b2_linearSlop);\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold = new b2WorldManifold();\n Box2D.Dynamics.Contacts.b2ContactSolver.prototype.s_worldManifold = Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold;\n Box2D.Dynamics.Contacts.b2ContactSolver.s_psm = new b2PositionSolverManifold();\n Box2D.Dynamics.Contacts.b2ContactSolver.prototype.s_psm = Box2D.Dynamics.Contacts.b2ContactSolver.s_psm;\n });\n b2EdgeAndCircleContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2EdgeAndCircleContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2EdgeAndCircleContact.b2EdgeAndCircleContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2EdgeAndCircleContact.prototype.Create = function (allocator) {\n return new b2EdgeAndCircleContact();\n }\n b2EdgeAndCircleContact.Create = b2EdgeAndCircleContact.prototype.Create;\n b2EdgeAndCircleContact.prototype.Destroy = function (contact, allocator) {}\n b2EdgeAndCircleContact.Destroy = b2EdgeAndCircleContact.prototype.Destroy;\n b2EdgeAndCircleContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n }\n b2EdgeAndCircleContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n this.b2CollideEdgeAndCircle(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2EdgeShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2CircleShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2EdgeAndCircleContact.prototype.b2CollideEdgeAndCircle = function (manifold, edge, xf1, circle, xf2) {}\n b2NullContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2NullContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2NullContact.b2NullContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2NullContact.prototype.b2NullContact = function () {\n this.__super.b2Contact.call(this);\n }\n b2NullContact.prototype.Evaluate = function () {}\n b2PolyAndCircleContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2PolyAndCircleContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2PolyAndCircleContact.b2PolyAndCircleContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2PolyAndCircleContact.prototype.Create = function (allocator) {\n return new b2PolyAndCircleContact();\n }\n b2PolyAndCircleContact.Create = b2PolyAndCircleContact.prototype.Create;\n b2PolyAndCircleContact.prototype.Destroy = function (contact, allocator) {}\n b2PolyAndCircleContact.Destroy = b2PolyAndCircleContact.prototype.Destroy;\n b2PolyAndCircleContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n b2Settings.b2Assert(fixtureA.GetType() == b2Shape.e_polygonShape);\n b2Settings.b2Assert(fixtureB.GetType() == b2Shape.e_circleShape);\n }\n b2PolyAndCircleContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.m_body;\n var bB = this.m_fixtureB.m_body;\n b2Collision.CollidePolygonAndCircle(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2PolygonShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2CircleShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2PolyAndEdgeContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2PolyAndEdgeContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2PolyAndEdgeContact.b2PolyAndEdgeContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2PolyAndEdgeContact.prototype.Create = function (allocator) {\n return new b2PolyAndEdgeContact();\n }\n b2PolyAndEdgeContact.Create = b2PolyAndEdgeContact.prototype.Create;\n b2PolyAndEdgeContact.prototype.Destroy = function (contact, allocator) {}\n b2PolyAndEdgeContact.Destroy = b2PolyAndEdgeContact.prototype.Destroy;\n b2PolyAndEdgeContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n b2Settings.b2Assert(fixtureA.GetType() == b2Shape.e_polygonShape);\n b2Settings.b2Assert(fixtureB.GetType() == b2Shape.e_edgeShape);\n }\n b2PolyAndEdgeContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n this.b2CollidePolyAndEdge(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2PolygonShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2EdgeShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2PolyAndEdgeContact.prototype.b2CollidePolyAndEdge = function (manifold, polygon, xf1, edge, xf2) {}\n b2PolygonContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2PolygonContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2PolygonContact.b2PolygonContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2PolygonContact.prototype.Create = function (allocator) {\n return new b2PolygonContact();\n }\n b2PolygonContact.Create = b2PolygonContact.prototype.Create;\n b2PolygonContact.prototype.Destroy = function (contact, allocator) {}\n b2PolygonContact.Destroy = b2PolygonContact.prototype.Destroy;\n b2PolygonContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n }\n b2PolygonContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n b2Collision.CollidePolygons(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2PolygonShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2PolygonShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2PositionSolverManifold.b2PositionSolverManifold = function () {};\n b2PositionSolverManifold.prototype.b2PositionSolverManifold = function () {\n this.m_normal = new b2Vec2();\n this.m_separations = new Vector_a2j_Number(b2Settings.b2_maxManifoldPoints);\n this.m_points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.m_points[i] = new b2Vec2();\n }\n }\n b2PositionSolverManifold.prototype.Initialize = function (cc) {\n b2Settings.b2Assert(cc.pointCount > 0);\n var i = 0;\n var clipPointX = 0;\n var clipPointY = 0;\n var tMat;\n var tVec;\n var planePointX = 0;\n var planePointY = 0;\n switch (cc.type) {\n case b2Manifold.e_circles:\n {\n tMat = cc.bodyA.m_xf.R;\n tVec = cc.localPoint;\n var pointAX = cc.bodyA.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var pointAY = cc.bodyA.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = cc.bodyB.m_xf.R;\n tVec = cc.points[0].localPoint;\n var pointBX = cc.bodyB.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var pointBY = cc.bodyB.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var dX = pointBX - pointAX;\n var dY = pointBY - pointAY;\n var d2 = dX * dX + dY * dY;\n if (d2 > Number.MIN_VALUE * Number.MIN_VALUE) {\n var d = Math.sqrt(d2);\n this.m_normal.x = dX / d;\n this.m_normal.y = dY / d;\n }\n else {\n this.m_normal.x = 1.0;\n this.m_normal.y = 0.0;\n }\n this.m_points[0].x = 0.5 * (pointAX + pointBX);\n this.m_points[0].y = 0.5 * (pointAY + pointBY);\n this.m_separations[0] = dX * this.m_normal.x + dY * this.m_normal.y - cc.radius;\n }\n break;\n case b2Manifold.e_faceA:\n {\n tMat = cc.bodyA.m_xf.R;\n tVec = cc.localPlaneNormal;\n this.m_normal.x = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n this.m_normal.y = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = cc.bodyA.m_xf.R;\n tVec = cc.localPoint;\n planePointX = cc.bodyA.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n planePointY = cc.bodyA.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = cc.bodyB.m_xf.R;\n for (i = 0;\n i < cc.pointCount; ++i) {\n tVec = cc.points[i].localPoint;\n clipPointX = cc.bodyB.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n clipPointY = cc.bodyB.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_separations[i] = (clipPointX - planePointX) * this.m_normal.x + (clipPointY - planePointY) * this.m_normal.y - cc.radius;\n this.m_points[i].x = clipPointX;\n this.m_points[i].y = clipPointY;\n }\n }\n break;\n case b2Manifold.e_faceB:\n {\n tMat = cc.bodyB.m_xf.R;\n tVec = cc.localPlaneNormal;\n this.m_normal.x = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n this.m_normal.y = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = cc.bodyB.m_xf.R;\n tVec = cc.localPoint;\n planePointX = cc.bodyB.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n planePointY = cc.bodyB.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = cc.bodyA.m_xf.R;\n for (i = 0;\n i < cc.pointCount; ++i) {\n tVec = cc.points[i].localPoint;\n clipPointX = cc.bodyA.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n clipPointY = cc.bodyA.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_separations[i] = (clipPointX - planePointX) * this.m_normal.x + (clipPointY - planePointY) * this.m_normal.y - cc.radius;\n this.m_points[i].Set(clipPointX, clipPointY);\n }\n this.m_normal.x *= (-1);\n this.m_normal.y *= (-1);\n }\n break;\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA = new b2Vec2();\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.prototype.circlePointA = Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA;\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB = new b2Vec2();\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.prototype.circlePointB = Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB;\n });\n})(); /* source: disabled*/\n(function () {\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2BuoyancyController = Box2D.Dynamics.Controllers.b2BuoyancyController;\n var b2ConstantAccelController = Box2D.Dynamics.Controllers.b2ConstantAccelController;\n var b2ConstantForceController = Box2D.Dynamics.Controllers.b2ConstantForceController;\n var b2Controller = Box2D.Dynamics.Controllers.b2Controller;\n var b2ControllerEdge = Box2D.Dynamics.Controllers.b2ControllerEdge;\n var b2GravityController = Box2D.Dynamics.Controllers.b2GravityController;\n var b2TensorDampingController = Box2D.Dynamics.Controllers.b2TensorDampingController;\n b2BuoyancyController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2BuoyancyController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2BuoyancyController.b2BuoyancyController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.normal = new b2Vec2(0, (-1));\n this.offset = 0;\n this.density = 0;\n this.velocity = new b2Vec2(0, 0);\n this.linearDrag = 2;\n this.angularDrag = 1;\n this.useDensity = false;\n this.useWorldGravity = true;\n this.gravity = null;\n };\n b2BuoyancyController.prototype.Step = function (step) {\n if (!this.m_bodyList) return;\n if (this.useWorldGravity) {\n this.gravity = this.GetWorld().GetGravity().Copy();\n }\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (body.IsAwake() == false) {\n continue;\n }\n var areac = new b2Vec2();\n var massc = new b2Vec2();\n var area = 0.0;\n var mass = 0.0;\n for (var fixture = body.GetFixtureList(); fixture; fixture = fixture.GetNext()) {\n var sc = new b2Vec2();\n var sarea = fixture.GetShape().ComputeSubmergedArea(this.normal, this.offset, body.GetTransform(), sc);\n area += sarea;\n areac.x += sarea * sc.x;\n areac.y += sarea * sc.y;\n var shapeDensity = 0;\n if (this.useDensity) {\n shapeDensity = 1;\n }\n else {\n shapeDensity = 1;\n }\n mass += sarea * shapeDensity;\n massc.x += sarea * sc.x * shapeDensity;\n massc.y += sarea * sc.y * shapeDensity;\n }\n areac.x /= area;\n areac.y /= area;\n massc.x /= mass;\n massc.y /= mass;\n if (area < Number.MIN_VALUE) continue;\n var buoyancyForce = this.gravity.GetNegative();\n buoyancyForce.Multiply(this.density * area);\n body.ApplyForce(buoyancyForce, massc);\n var dragForce = body.GetLinearVelocityFromWorldPoint(areac);\n dragForce.Subtract(this.velocity);\n dragForce.Multiply((-this.linearDrag * area));\n body.ApplyForce(dragForce, areac);\n body.ApplyTorque((-body.GetInertia() / body.GetMass() * area * body.GetAngularVelocity() * this.angularDrag));\n }\n }\n b2BuoyancyController.prototype.Draw = function (debugDraw) {\n var r = 1000;\n var p1 = new b2Vec2();\n var p2 = new b2Vec2();\n p1.x = this.normal.x * this.offset + this.normal.y * r;\n p1.y = this.normal.y * this.offset - this.normal.x * r;\n p2.x = this.normal.x * this.offset - this.normal.y * r;\n p2.y = this.normal.y * this.offset + this.normal.x * r;\n var color = new b2Color(0, 0, 1);\n debugDraw.DrawSegment(p1, p2, color);\n }\n b2ConstantAccelController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2ConstantAccelController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2ConstantAccelController.b2ConstantAccelController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.A = new b2Vec2(0, 0);\n };\n b2ConstantAccelController.prototype.Step = function (step) {\n var smallA = new b2Vec2(this.A.x * step.dt, this.A.y * step.dt);\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (!body.IsAwake()) continue;\n body.SetLinearVelocity(new b2Vec2(body.GetLinearVelocity().x + smallA.x, body.GetLinearVelocity().y + smallA.y));\n }\n }\n b2ConstantForceController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2ConstantForceController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2ConstantForceController.b2ConstantForceController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.F = new b2Vec2(0, 0);\n };\n b2ConstantForceController.prototype.Step = function (step) {\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (!body.IsAwake()) continue;\n body.ApplyForce(this.F, body.GetWorldCenter());\n }\n }\n b2Controller.b2Controller = function () {};\n b2Controller.prototype.Step = function (step) {}\n b2Controller.prototype.Draw = function (debugDraw) {}\n b2Controller.prototype.AddBody = function (body) {\n var edge = new b2ControllerEdge();\n edge.controller = this;\n edge.body = body;\n edge.nextBody = this.m_bodyList;\n edge.prevBody = null;\n this.m_bodyList = edge;\n if (edge.nextBody) edge.nextBody.prevBody = edge;\n this.m_bodyCount++;\n edge.nextController = body.m_controllerList;\n edge.prevController = null;\n body.m_controllerList = edge;\n if (edge.nextController) edge.nextController.prevController = edge;\n body.m_controllerCount++;\n }\n b2Controller.prototype.RemoveBody = function (body) {\n var edge = body.m_controllerList;\n while (edge && edge.controller != this)\n edge = edge.nextController;\n if (edge.prevBody) edge.prevBody.nextBody = edge.nextBody;\n if (edge.nextBody) edge.nextBody.prevBody = edge.prevBody;\n if (edge.nextController) edge.nextController.prevController = edge.prevController;\n if (edge.prevController) edge.prevController.nextController = edge.nextController;\n if (this.m_bodyList == edge) this.m_bodyList = edge.nextBody;\n if (body.m_controllerList == edge) body.m_controllerList = edge.nextController;\n body.m_controllerCount--;\n this.m_bodyCount--;\n }\n b2Controller.prototype.Clear = function () {\n while (this.m_bodyList)\n this.RemoveBody(this.m_bodyList.body);\n }\n b2Controller.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Controller.prototype.GetWorld = function () {\n return this.m_world;\n }\n b2Controller.prototype.GetBodyList = function () {\n return this.m_bodyList;\n }\n b2ControllerEdge.b2ControllerEdge = function () {};\n b2GravityController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2GravityController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2GravityController.b2GravityController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.G = 1;\n this.invSqr = true;\n };\n b2GravityController.prototype.Step = function (step) {\n var i = null;\n var body1 = null;\n var p1 = null;\n var mass1 = 0;\n var j = null;\n var body2 = null;\n var p2 = null;\n var dx = 0;\n var dy = 0;\n var r2 = 0;\n var f = null;\n if (this.invSqr) {\n for (i = this.m_bodyList;\n i; i = i.nextBody) {\n body1 = i.body;\n p1 = body1.GetWorldCenter();\n mass1 = body1.GetMass();\n for (j = this.m_bodyList;\n j != i; j = j.nextBody) {\n body2 = j.body;\n p2 = body2.GetWorldCenter();\n dx = p2.x - p1.x;\n dy = p2.y - p1.y;\n r2 = dx * dx + dy * dy;\n if (r2 < Number.MIN_VALUE) continue;\n f = new b2Vec2(dx, dy);\n f.Multiply(this.G / r2 / Math.sqrt(r2) * mass1 * body2.GetMass());\n if (body1.IsAwake()) body1.ApplyForce(f, p1);\n f.Multiply((-1));\n if (body2.IsAwake()) body2.ApplyForce(f, p2);\n }\n }\n }\n else {\n for (i = this.m_bodyList;\n i; i = i.nextBody) {\n body1 = i.body;\n p1 = body1.GetWorldCenter();\n mass1 = body1.GetMass();\n for (j = this.m_bodyList;\n j != i; j = j.nextBody) {\n body2 = j.body;\n p2 = body2.GetWorldCenter();\n dx = p2.x - p1.x;\n dy = p2.y - p1.y;\n r2 = dx * dx + dy * dy;\n if (r2 < Number.MIN_VALUE) continue;\n f = new b2Vec2(dx, dy);\n f.Multiply(this.G / r2 * mass1 * body2.GetMass());\n if (body1.IsAwake()) body1.ApplyForce(f, p1);\n f.Multiply((-1));\n if (body2.IsAwake()) body2.ApplyForce(f, p2);\n }\n }\n }\n }\n b2TensorDampingController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2TensorDampingController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2TensorDampingController.b2TensorDampingController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.T = new b2Mat22();\n this.maxTimestep = 0;\n };\n b2TensorDampingController.prototype.SetAxisAligned = function (xDamping, yDamping) {\n if (xDamping === undefined) xDamping = 0;\n if (yDamping === undefined) yDamping = 0;\n this.T.col1.x = (-xDamping);\n this.T.col1.y = 0;\n this.T.col2.x = 0;\n this.T.col2.y = (-yDamping);\n if (xDamping > 0 || yDamping > 0) {\n this.maxTimestep = 1 / Math.max(xDamping, yDamping);\n }\n else {\n this.maxTimestep = 0;\n }\n }\n b2TensorDampingController.prototype.Step = function (step) {\n var timestep = step.dt;\n if (timestep <= Number.MIN_VALUE) return;\n if (timestep > this.maxTimestep && this.maxTimestep > 0) timestep = this.maxTimestep;\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (!body.IsAwake()) {\n continue;\n }\n var damping = body.GetWorldVector(b2Math.MulMV(this.T, body.GetLocalVector(body.GetLinearVelocity())));\n body.SetLinearVelocity(new b2Vec2(body.GetLinearVelocity().x + damping.x * timestep, body.GetLinearVelocity().y + damping.y * timestep));\n }\n }\n})(); /* source: disabled*/\n(function () {\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2internal = Box2D.Common.b2internal;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2DistanceJoint = Box2D.Dynamics.Joints.b2DistanceJoint;\n var b2DistanceJointDef = Box2D.Dynamics.Joints.b2DistanceJointDef;\n var b2FrictionJoint = Box2D.Dynamics.Joints.b2FrictionJoint;\n var b2FrictionJointDef = Box2D.Dynamics.Joints.b2FrictionJointDef;\n var b2GearJoint = Box2D.Dynamics.Joints.b2GearJoint;\n var b2GearJointDef = Box2D.Dynamics.Joints.b2GearJointDef;\n var b2Jacobian = Box2D.Dynamics.Joints.b2Jacobian;\n var b2Joint = Box2D.Dynamics.Joints.b2Joint;\n var b2JointDef = Box2D.Dynamics.Joints.b2JointDef;\n var b2JointEdge = Box2D.Dynamics.Joints.b2JointEdge;\n var b2LineJoint = Box2D.Dynamics.Joints.b2LineJoint;\n var b2LineJointDef = Box2D.Dynamics.Joints.b2LineJointDef;\n var b2MouseJoint = Box2D.Dynamics.Joints.b2MouseJoint;\n var b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;\n var b2PrismaticJoint = Box2D.Dynamics.Joints.b2PrismaticJoint;\n var b2PrismaticJointDef = Box2D.Dynamics.Joints.b2PrismaticJointDef;\n var b2PulleyJoint = Box2D.Dynamics.Joints.b2PulleyJoint;\n var b2PulleyJointDef = Box2D.Dynamics.Joints.b2PulleyJointDef;\n var b2RevoluteJoint = Box2D.Dynamics.Joints.b2RevoluteJoint;\n var b2RevoluteJointDef = Box2D.Dynamics.Joints.b2RevoluteJointDef;\n var b2WeldJoint = Box2D.Dynamics.Joints.b2WeldJoint;\n var b2WeldJointDef = Box2D.Dynamics.Joints.b2WeldJointDef;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2internal = Box2D.Common.b2internal;\n var b2DistanceJoint = Box2D.Dynamics.Joints.b2DistanceJoint;\n var b2DistanceJointDef = Box2D.Dynamics.Joints.b2DistanceJointDef;\n var b2FrictionJoint = Box2D.Dynamics.Joints.b2FrictionJoint;\n var b2FrictionJointDef = Box2D.Dynamics.Joints.b2FrictionJointDef;\n var b2GearJoint = Box2D.Dynamics.Joints.b2GearJoint;\n var b2GearJointDef = Box2D.Dynamics.Joints.b2GearJointDef;\n var b2Jacobian = Box2D.Dynamics.Joints.b2Jacobian;\n var b2Joint = Box2D.Dynamics.Joints.b2Joint;\n var b2JointDef = Box2D.Dynamics.Joints.b2JointDef;\n var b2JointEdge = Box2D.Dynamics.Joints.b2JointEdge;\n var b2LineJoint = Box2D.Dynamics.Joints.b2LineJoint;\n var b2LineJointDef = Box2D.Dynamics.Joints.b2LineJointDef;\n var b2MouseJoint = Box2D.Dynamics.Joints.b2MouseJoint;\n var b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;\n var b2PrismaticJoint = Box2D.Dynamics.Joints.b2PrismaticJoint;\n var b2PrismaticJointDef = Box2D.Dynamics.Joints.b2PrismaticJointDef;\n var b2PulleyJoint = Box2D.Dynamics.Joints.b2PulleyJoint;\n var b2PulleyJointDef = Box2D.Dynamics.Joints.b2PulleyJointDef;\n var b2RevoluteJoint = Box2D.Dynamics.Joints.b2RevoluteJoint;\n var b2RevoluteJointDef = Box2D.Dynamics.Joints.b2RevoluteJointDef;\n var b2WeldJoint = Box2D.Dynamics.Joints.b2WeldJoint;\n var b2WeldJointDef = Box2D.Dynamics.Joints.b2WeldJointDef;\n b2DistanceJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2DistanceJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2DistanceJoint.b2DistanceJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_u = new b2Vec2();\n };\n b2DistanceJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2DistanceJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2DistanceJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse * this.m_u.x, inv_dt * this.m_impulse * this.m_u.y);\n }\n b2DistanceJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2DistanceJoint.prototype.GetLength = function () {\n return this.m_length;\n }\n b2DistanceJoint.prototype.SetLength = function (length) {\n if (length === undefined) length = 0;\n this.m_length = length;\n }\n b2DistanceJoint.prototype.GetFrequency = function () {\n return this.m_frequencyHz;\n }\n b2DistanceJoint.prototype.SetFrequency = function (hz) {\n if (hz === undefined) hz = 0;\n this.m_frequencyHz = hz;\n }\n b2DistanceJoint.prototype.GetDampingRatio = function () {\n return this.m_dampingRatio;\n }\n b2DistanceJoint.prototype.SetDampingRatio = function (ratio) {\n if (ratio === undefined) ratio = 0;\n this.m_dampingRatio = ratio;\n }\n b2DistanceJoint.prototype.b2DistanceJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_length = def.length;\n this.m_frequencyHz = def.frequencyHz;\n this.m_dampingRatio = def.dampingRatio;\n this.m_impulse = 0.0;\n this.m_gamma = 0.0;\n this.m_bias = 0.0;\n }\n b2DistanceJoint.prototype.InitVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n this.m_u.x = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n this.m_u.y = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n var length = Math.sqrt(this.m_u.x * this.m_u.x + this.m_u.y * this.m_u.y);\n if (length > b2Settings.b2_linearSlop) {\n this.m_u.Multiply(1.0 / length);\n }\n else {\n this.m_u.SetZero();\n }\n var cr1u = (r1X * this.m_u.y - r1Y * this.m_u.x);\n var cr2u = (r2X * this.m_u.y - r2Y * this.m_u.x);\n var invMass = bA.m_invMass + bA.m_invI * cr1u * cr1u + bB.m_invMass + bB.m_invI * cr2u * cr2u;\n this.m_mass = invMass != 0.0 ? 1.0 / invMass : 0.0;\n if (this.m_frequencyHz > 0.0) {\n var C = length - this.m_length;\n var omega = 2.0 * Math.PI * this.m_frequencyHz;\n var d = 2.0 * this.m_mass * this.m_dampingRatio * omega;\n var k = this.m_mass * omega * omega;\n this.m_gamma = step.dt * (d + step.dt * k);\n this.m_gamma = this.m_gamma != 0.0 ? 1 / this.m_gamma : 0.0;\n this.m_bias = C * step.dt * k * this.m_gamma;\n this.m_mass = invMass + this.m_gamma;\n this.m_mass = this.m_mass != 0.0 ? 1.0 / this.m_mass : 0.0;\n }\n if (step.warmStarting) {\n this.m_impulse *= step.dtRatio;\n var PX = this.m_impulse * this.m_u.x;\n var PY = this.m_impulse * this.m_u.y;\n bA.m_linearVelocity.x -= bA.m_invMass * PX;\n bA.m_linearVelocity.y -= bA.m_invMass * PY;\n bA.m_angularVelocity -= bA.m_invI * (r1X * PY - r1Y * PX);\n bB.m_linearVelocity.x += bB.m_invMass * PX;\n bB.m_linearVelocity.y += bB.m_invMass * PY;\n bB.m_angularVelocity += bB.m_invI * (r2X * PY - r2Y * PX);\n }\n else {\n this.m_impulse = 0.0;\n }\n }\n b2DistanceJoint.prototype.SolveVelocityConstraints = function (step) {\n var tMat;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var v1X = bA.m_linearVelocity.x + ((-bA.m_angularVelocity * r1Y));\n var v1Y = bA.m_linearVelocity.y + (bA.m_angularVelocity * r1X);\n var v2X = bB.m_linearVelocity.x + ((-bB.m_angularVelocity * r2Y));\n var v2Y = bB.m_linearVelocity.y + (bB.m_angularVelocity * r2X);\n var Cdot = (this.m_u.x * (v2X - v1X) + this.m_u.y * (v2Y - v1Y));\n var impulse = (-this.m_mass * (Cdot + this.m_bias + this.m_gamma * this.m_impulse));\n this.m_impulse += impulse;\n var PX = impulse * this.m_u.x;\n var PY = impulse * this.m_u.y;\n bA.m_linearVelocity.x -= bA.m_invMass * PX;\n bA.m_linearVelocity.y -= bA.m_invMass * PY;\n bA.m_angularVelocity -= bA.m_invI * (r1X * PY - r1Y * PX);\n bB.m_linearVelocity.x += bB.m_invMass * PX;\n bB.m_linearVelocity.y += bB.m_invMass * PY;\n bB.m_angularVelocity += bB.m_invI * (r2X * PY - r2Y * PX);\n }\n b2DistanceJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var tMat;\n if (this.m_frequencyHz > 0.0) {\n return true;\n }\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var dY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n var length = Math.sqrt(dX * dX + dY * dY);\n dX /= length;\n dY /= length;\n var C = length - this.m_length;\n C = b2Math.Clamp(C, (-b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);\n var impulse = (-this.m_mass * C);\n this.m_u.Set(dX, dY);\n var PX = impulse * this.m_u.x;\n var PY = impulse * this.m_u.y;\n bA.m_sweep.c.x -= bA.m_invMass * PX;\n bA.m_sweep.c.y -= bA.m_invMass * PY;\n bA.m_sweep.a -= bA.m_invI * (r1X * PY - r1Y * PX);\n bB.m_sweep.c.x += bB.m_invMass * PX;\n bB.m_sweep.c.y += bB.m_invMass * PY;\n bB.m_sweep.a += bB.m_invI * (r2X * PY - r2Y * PX);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return b2Math.Abs(C) < b2Settings.b2_linearSlop;\n }\n b2DistanceJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2DistanceJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2DistanceJointDef.b2DistanceJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2DistanceJointDef.prototype.b2DistanceJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_distanceJoint;\n this.length = 1.0;\n this.frequencyHz = 0.0;\n this.dampingRatio = 0.0;\n }\n b2DistanceJointDef.prototype.Initialize = function (bA, bB, anchorA, anchorB) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchorA));\n this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchorB));\n var dX = anchorB.x - anchorA.x;\n var dY = anchorB.y - anchorA.y;\n this.length = Math.sqrt(dX * dX + dY * dY);\n this.frequencyHz = 0.0;\n this.dampingRatio = 0.0;\n }\n b2FrictionJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2FrictionJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2FrictionJoint.b2FrictionJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchorA = new b2Vec2();\n this.m_localAnchorB = new b2Vec2();\n this.m_linearMass = new b2Mat22();\n this.m_linearImpulse = new b2Vec2();\n };\n b2FrictionJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchorA);\n }\n b2FrictionJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchorB);\n }\n b2FrictionJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_linearImpulse.x, inv_dt * this.m_linearImpulse.y);\n }\n b2FrictionJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_angularImpulse;\n }\n b2FrictionJoint.prototype.SetMaxForce = function (force) {\n if (force === undefined) force = 0;\n this.m_maxForce = force;\n }\n b2FrictionJoint.prototype.GetMaxForce = function () {\n return this.m_maxForce;\n }\n b2FrictionJoint.prototype.SetMaxTorque = function (torque) {\n if (torque === undefined) torque = 0;\n this.m_maxTorque = torque;\n }\n b2FrictionJoint.prototype.GetMaxTorque = function () {\n return this.m_maxTorque;\n }\n b2FrictionJoint.prototype.b2FrictionJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_localAnchorA.SetV(def.localAnchorA);\n this.m_localAnchorB.SetV(def.localAnchorB);\n this.m_linearMass.SetZero();\n this.m_angularMass = 0.0;\n this.m_linearImpulse.SetZero();\n this.m_angularImpulse = 0.0;\n this.m_maxForce = def.maxForce;\n this.m_maxTorque = def.maxTorque;\n }\n b2FrictionJoint.prototype.InitVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n var K = new b2Mat22();\n K.col1.x = mA + mB;\n K.col2.x = 0.0;\n K.col1.y = 0.0;\n K.col2.y = mA + mB;\n K.col1.x += iA * rAY * rAY;\n K.col2.x += (-iA * rAX * rAY);\n K.col1.y += (-iA * rAX * rAY);\n K.col2.y += iA * rAX * rAX;\n K.col1.x += iB * rBY * rBY;\n K.col2.x += (-iB * rBX * rBY);\n K.col1.y += (-iB * rBX * rBY);\n K.col2.y += iB * rBX * rBX;\n K.GetInverse(this.m_linearMass);\n this.m_angularMass = iA + iB;\n if (this.m_angularMass > 0.0) {\n this.m_angularMass = 1.0 / this.m_angularMass;\n }\n if (step.warmStarting) {\n this.m_linearImpulse.x *= step.dtRatio;\n this.m_linearImpulse.y *= step.dtRatio;\n this.m_angularImpulse *= step.dtRatio;\n var P = this.m_linearImpulse;\n bA.m_linearVelocity.x -= mA * P.x;\n bA.m_linearVelocity.y -= mA * P.y;\n bA.m_angularVelocity -= iA * (rAX * P.y - rAY * P.x + this.m_angularImpulse);\n bB.m_linearVelocity.x += mB * P.x;\n bB.m_linearVelocity.y += mB * P.y;\n bB.m_angularVelocity += iB * (rBX * P.y - rBY * P.x + this.m_angularImpulse);\n }\n else {\n this.m_linearImpulse.SetZero();\n this.m_angularImpulse = 0.0;\n }\n }\n b2FrictionJoint.prototype.SolveVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var vA = bA.m_linearVelocity;\n var wA = bA.m_angularVelocity;\n var vB = bB.m_linearVelocity;\n var wB = bB.m_angularVelocity;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var maxImpulse = 0; {\n var Cdot = wB - wA;\n var impulse = (-this.m_angularMass * Cdot);\n var oldImpulse = this.m_angularImpulse;\n maxImpulse = step.dt * this.m_maxTorque;\n this.m_angularImpulse = b2Math.Clamp(this.m_angularImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_angularImpulse - oldImpulse;\n wA -= iA * impulse;\n wB += iB * impulse;\n } {\n var CdotX = vB.x - wB * rBY - vA.x + wA * rAY;\n var CdotY = vB.y + wB * rBX - vA.y - wA * rAX;\n var impulseV = b2Math.MulMV(this.m_linearMass, new b2Vec2((-CdotX), (-CdotY)));\n var oldImpulseV = this.m_linearImpulse.Copy();\n this.m_linearImpulse.Add(impulseV);\n maxImpulse = step.dt * this.m_maxForce;\n if (this.m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) {\n this.m_linearImpulse.Normalize();\n this.m_linearImpulse.Multiply(maxImpulse);\n }\n impulseV = b2Math.SubtractVV(this.m_linearImpulse, oldImpulseV);\n vA.x -= mA * impulseV.x;\n vA.y -= mA * impulseV.y;\n wA -= iA * (rAX * impulseV.y - rAY * impulseV.x);\n vB.x += mB * impulseV.x;\n vB.y += mB * impulseV.y;\n wB += iB * (rBX * impulseV.y - rBY * impulseV.x);\n }\n bA.m_angularVelocity = wA;\n bB.m_angularVelocity = wB;\n }\n b2FrictionJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n return true;\n }\n b2FrictionJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2FrictionJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2FrictionJointDef.b2FrictionJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2FrictionJointDef.prototype.b2FrictionJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_frictionJoint;\n this.maxForce = 0.0;\n this.maxTorque = 0.0;\n }\n b2FrictionJointDef.prototype.Initialize = function (bA, bB, anchor) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchor));\n this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchor));\n }\n b2GearJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2GearJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2GearJoint.b2GearJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_groundAnchor1 = new b2Vec2();\n this.m_groundAnchor2 = new b2Vec2();\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_J = new b2Jacobian();\n };\n b2GearJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2GearJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2GearJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse * this.m_J.linearB.x, inv_dt * this.m_impulse * this.m_J.linearB.y);\n }\n b2GearJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n var tMat = this.m_bodyB.m_xf.R;\n var rX = this.m_localAnchor1.x - this.m_bodyB.m_sweep.localCenter.x;\n var rY = this.m_localAnchor1.y - this.m_bodyB.m_sweep.localCenter.y;\n var tX = tMat.col1.x * rX + tMat.col2.x * rY;\n rY = tMat.col1.y * rX + tMat.col2.y * rY;\n rX = tX;\n var PX = this.m_impulse * this.m_J.linearB.x;\n var PY = this.m_impulse * this.m_J.linearB.y;\n return inv_dt * (this.m_impulse * this.m_J.angularB - rX * PY + rY * PX);\n }\n b2GearJoint.prototype.GetRatio = function () {\n return this.m_ratio;\n }\n b2GearJoint.prototype.SetRatio = function (ratio) {\n if (ratio === undefined) ratio = 0;\n this.m_ratio = ratio;\n }\n b2GearJoint.prototype.b2GearJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var type1 = parseInt(def.joint1.m_type);\n var type2 = parseInt(def.joint2.m_type);\n this.m_revolute1 = null;\n this.m_prismatic1 = null;\n this.m_revolute2 = null;\n this.m_prismatic2 = null;\n var coordinate1 = 0;\n var coordinate2 = 0;\n this.m_ground1 = def.joint1.GetBodyA();\n this.m_bodyA = def.joint1.GetBodyB();\n if (type1 == b2Joint.e_revoluteJoint) {\n this.m_revolute1 = (def.joint1 instanceof b2RevoluteJoint ? def.joint1 : null);\n this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1);\n this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2);\n coordinate1 = this.m_revolute1.GetJointAngle();\n }\n else {\n this.m_prismatic1 = (def.joint1 instanceof b2PrismaticJoint ? def.joint1 : null);\n this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1);\n this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2);\n coordinate1 = this.m_prismatic1.GetJointTranslation();\n }\n this.m_ground2 = def.joint2.GetBodyA();\n this.m_bodyB = def.joint2.GetBodyB();\n if (type2 == b2Joint.e_revoluteJoint) {\n this.m_revolute2 = (def.joint2 instanceof b2RevoluteJoint ? def.joint2 : null);\n this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1);\n this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2);\n coordinate2 = this.m_revolute2.GetJointAngle();\n }\n else {\n this.m_prismatic2 = (def.joint2 instanceof b2PrismaticJoint ? def.joint2 : null);\n this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1);\n this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2);\n coordinate2 = this.m_prismatic2.GetJointTranslation();\n }\n this.m_ratio = def.ratio;\n this.m_constant = coordinate1 + this.m_ratio * coordinate2;\n this.m_impulse = 0.0;\n }\n b2GearJoint.prototype.InitVelocityConstraints = function (step) {\n var g1 = this.m_ground1;\n var g2 = this.m_ground2;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var ugX = 0;\n var ugY = 0;\n var rX = 0;\n var rY = 0;\n var tMat;\n var tVec;\n var crug = 0;\n var tX = 0;\n var K = 0.0;\n this.m_J.SetZero();\n if (this.m_revolute1) {\n this.m_J.angularA = (-1.0);\n K += bA.m_invI;\n }\n else {\n tMat = g1.m_xf.R;\n tVec = this.m_prismatic1.m_localXAxis1;\n ugX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n ugY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = bA.m_xf.R;\n rX = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n rY = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = tMat.col1.x * rX + tMat.col2.x * rY;\n rY = tMat.col1.y * rX + tMat.col2.y * rY;\n rX = tX;\n crug = rX * ugY - rY * ugX;\n this.m_J.linearA.Set((-ugX), (-ugY));\n this.m_J.angularA = (-crug);\n K += bA.m_invMass + bA.m_invI * crug * crug;\n }\n if (this.m_revolute2) {\n this.m_J.angularB = (-this.m_ratio);\n K += this.m_ratio * this.m_ratio * bB.m_invI;\n }\n else {\n tMat = g2.m_xf.R;\n tVec = this.m_prismatic2.m_localXAxis1;\n ugX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n ugY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = bB.m_xf.R;\n rX = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n rY = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = tMat.col1.x * rX + tMat.col2.x * rY;\n rY = tMat.col1.y * rX + tMat.col2.y * rY;\n rX = tX;\n crug = rX * ugY - rY * ugX;\n this.m_J.linearB.Set((-this.m_ratio * ugX), (-this.m_ratio * ugY));\n this.m_J.angularB = (-this.m_ratio * crug);\n K += this.m_ratio * this.m_ratio * (bB.m_invMass + bB.m_invI * crug * crug);\n }\n this.m_mass = K > 0.0 ? 1.0 / K : 0.0;\n if (step.warmStarting) {\n bA.m_linearVelocity.x += bA.m_invMass * this.m_impulse * this.m_J.linearA.x;\n bA.m_linearVelocity.y += bA.m_invMass * this.m_impulse * this.m_J.linearA.y;\n bA.m_angularVelocity += bA.m_invI * this.m_impulse * this.m_J.angularA;\n bB.m_linearVelocity.x += bB.m_invMass * this.m_impulse * this.m_J.linearB.x;\n bB.m_linearVelocity.y += bB.m_invMass * this.m_impulse * this.m_J.linearB.y;\n bB.m_angularVelocity += bB.m_invI * this.m_impulse * this.m_J.angularB;\n }\n else {\n this.m_impulse = 0.0;\n }\n }\n b2GearJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var Cdot = this.m_J.Compute(bA.m_linearVelocity, bA.m_angularVelocity, bB.m_linearVelocity, bB.m_angularVelocity);\n var impulse = (-this.m_mass * Cdot);\n this.m_impulse += impulse;\n bA.m_linearVelocity.x += bA.m_invMass * impulse * this.m_J.linearA.x;\n bA.m_linearVelocity.y += bA.m_invMass * impulse * this.m_J.linearA.y;\n bA.m_angularVelocity += bA.m_invI * impulse * this.m_J.angularA;\n bB.m_linearVelocity.x += bB.m_invMass * impulse * this.m_J.linearB.x;\n bB.m_linearVelocity.y += bB.m_invMass * impulse * this.m_J.linearB.y;\n bB.m_angularVelocity += bB.m_invI * impulse * this.m_J.angularB;\n }\n b2GearJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var linearError = 0.0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var coordinate1 = 0;\n var coordinate2 = 0;\n if (this.m_revolute1) {\n coordinate1 = this.m_revolute1.GetJointAngle();\n }\n else {\n coordinate1 = this.m_prismatic1.GetJointTranslation();\n }\n if (this.m_revolute2) {\n coordinate2 = this.m_revolute2.GetJointAngle();\n }\n else {\n coordinate2 = this.m_prismatic2.GetJointTranslation();\n }\n var C = this.m_constant - (coordinate1 + this.m_ratio * coordinate2);\n var impulse = (-this.m_mass * C);\n bA.m_sweep.c.x += bA.m_invMass * impulse * this.m_J.linearA.x;\n bA.m_sweep.c.y += bA.m_invMass * impulse * this.m_J.linearA.y;\n bA.m_sweep.a += bA.m_invI * impulse * this.m_J.angularA;\n bB.m_sweep.c.x += bB.m_invMass * impulse * this.m_J.linearB.x;\n bB.m_sweep.c.y += bB.m_invMass * impulse * this.m_J.linearB.y;\n bB.m_sweep.a += bB.m_invI * impulse * this.m_J.angularB;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return linearError < b2Settings.b2_linearSlop;\n }\n b2GearJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2GearJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2GearJointDef.b2GearJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n };\n b2GearJointDef.prototype.b2GearJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_gearJoint;\n this.joint1 = null;\n this.joint2 = null;\n this.ratio = 1.0;\n }\n b2Jacobian.b2Jacobian = function () {\n this.linearA = new b2Vec2();\n this.linearB = new b2Vec2();\n };\n b2Jacobian.prototype.SetZero = function () {\n this.linearA.SetZero();\n this.angularA = 0.0;\n this.linearB.SetZero();\n this.angularB = 0.0;\n }\n b2Jacobian.prototype.Set = function (x1, a1, x2, a2) {\n if (a1 === undefined) a1 = 0;\n if (a2 === undefined) a2 = 0;\n this.linearA.SetV(x1);\n this.angularA = a1;\n this.linearB.SetV(x2);\n this.angularB = a2;\n }\n b2Jacobian.prototype.Compute = function (x1, a1, x2, a2) {\n if (a1 === undefined) a1 = 0;\n if (a2 === undefined) a2 = 0;\n return (this.linearA.x * x1.x + this.linearA.y * x1.y) + this.angularA * a1 + (this.linearB.x * x2.x + this.linearB.y * x2.y) + this.angularB * a2;\n }\n b2Joint.b2Joint = function () {\n this.m_edgeA = new b2JointEdge();\n this.m_edgeB = new b2JointEdge();\n this.m_localCenterA = new b2Vec2();\n this.m_localCenterB = new b2Vec2();\n };\n b2Joint.prototype.GetType = function () {\n return this.m_type;\n }\n b2Joint.prototype.GetAnchorA = function () {\n return null;\n }\n b2Joint.prototype.GetAnchorB = function () {\n return null;\n }\n b2Joint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return null;\n }\n b2Joint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2Joint.prototype.GetBodyA = function () {\n return this.m_bodyA;\n }\n b2Joint.prototype.GetBodyB = function () {\n return this.m_bodyB;\n }\n b2Joint.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Joint.prototype.GetUserData = function () {\n return this.m_userData;\n }\n b2Joint.prototype.SetUserData = function (data) {\n this.m_userData = data;\n }\n b2Joint.prototype.IsActive = function () {\n return this.m_bodyA.IsActive() && this.m_bodyB.IsActive();\n }\n b2Joint.prototype.Create = function (def, allocator) {\n var joint = null;\n switch (def.type) {\n case b2Joint.e_distanceJoint:\n {\n joint = new b2DistanceJoint((def instanceof b2DistanceJointDef ? def : null));\n }\n break;\n case b2Joint.e_mouseJoint:\n {\n joint = new b2MouseJoint((def instanceof b2MouseJointDef ? def : null));\n }\n break;\n case b2Joint.e_prismaticJoint:\n {\n joint = new b2PrismaticJoint((def instanceof b2PrismaticJointDef ? def : null));\n }\n break;\n case b2Joint.e_revoluteJoint:\n {\n joint = new b2RevoluteJoint((def instanceof b2RevoluteJointDef ? def : null));\n }\n break;\n case b2Joint.e_pulleyJoint:\n {\n joint = new b2PulleyJoint((def instanceof b2PulleyJointDef ? def : null));\n }\n break;\n case b2Joint.e_gearJoint:\n {\n joint = new b2GearJoint((def instanceof b2GearJointDef ? def : null));\n }\n break;\n case b2Joint.e_lineJoint:\n {\n joint = new b2LineJoint((def instanceof b2LineJointDef ? def : null));\n }\n break;\n case b2Joint.e_weldJoint:\n {\n joint = new b2WeldJoint((def instanceof b2WeldJointDef ? def : null));\n }\n break;\n case b2Joint.e_frictionJoint:\n {\n joint = new b2FrictionJoint((def instanceof b2FrictionJointDef ? def : null));\n }\n break;\n default:\n break;\n }\n return joint;\n }\n b2Joint.Create = b2Joint.prototype.Create;\n b2Joint.prototype.Destroy = function (joint, allocator) {}\n b2Joint.Destroy = b2Joint.prototype.Destroy;\n b2Joint.prototype.b2Joint = function (def) {\n b2Settings.b2Assert(def.bodyA != def.bodyB);\n this.m_type = def.type;\n this.m_prev = null;\n this.m_next = null;\n this.m_bodyA = def.bodyA;\n this.m_bodyB = def.bodyB;\n this.m_collideConnected = def.collideConnected;\n this.m_islandFlag = false;\n this.m_userData = def.userData;\n }\n b2Joint.prototype.InitVelocityConstraints = function (step) {}\n b2Joint.prototype.SolveVelocityConstraints = function (step) {}\n b2Joint.prototype.FinalizeVelocityConstraints = function () {}\n b2Joint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n return false;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Joints.b2Joint.e_unknownJoint = 0;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_unknownJoint = Box2D.Dynamics.Joints.b2Joint.e_unknownJoint;\n Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint = 1;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_revoluteJoint = Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint;\n Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint = 2;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_prismaticJoint = Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint;\n Box2D.Dynamics.Joints.b2Joint.e_distanceJoint = 3;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_distanceJoint = Box2D.Dynamics.Joints.b2Joint.e_distanceJoint;\n Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint = 4;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_pulleyJoint = Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint;\n Box2D.Dynamics.Joints.b2Joint.e_mouseJoint = 5;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_mouseJoint = Box2D.Dynamics.Joints.b2Joint.e_mouseJoint;\n Box2D.Dynamics.Joints.b2Joint.e_gearJoint = 6;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_gearJoint = Box2D.Dynamics.Joints.b2Joint.e_gearJoint;\n Box2D.Dynamics.Joints.b2Joint.e_lineJoint = 7;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_lineJoint = Box2D.Dynamics.Joints.b2Joint.e_lineJoint;\n Box2D.Dynamics.Joints.b2Joint.e_weldJoint = 8;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_weldJoint = Box2D.Dynamics.Joints.b2Joint.e_weldJoint;\n Box2D.Dynamics.Joints.b2Joint.e_frictionJoint = 9;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_frictionJoint = Box2D.Dynamics.Joints.b2Joint.e_frictionJoint;\n Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit = 0;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_inactiveLimit = Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit;\n Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit = 1;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_atLowerLimit = Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit;\n Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit = 2;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_atUpperLimit = Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit;\n Box2D.Dynamics.Joints.b2Joint.e_equalLimits = 3;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_equalLimits = Box2D.Dynamics.Joints.b2Joint.e_equalLimits;\n });\n b2JointDef.b2JointDef = function () {};\n b2JointDef.prototype.b2JointDef = function () {\n this.type = b2Joint.e_unknownJoint;\n this.userData = null;\n this.bodyA = null;\n this.bodyB = null;\n this.collideConnected = false;\n }\n b2JointEdge.b2JointEdge = function () {};\n b2LineJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2LineJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2LineJoint.b2LineJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_localXAxis1 = new b2Vec2();\n this.m_localYAxis1 = new b2Vec2();\n this.m_axis = new b2Vec2();\n this.m_perp = new b2Vec2();\n this.m_K = new b2Mat22();\n this.m_impulse = new b2Vec2();\n };\n b2LineJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2LineJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2LineJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * (this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.x), inv_dt * (this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.y));\n }\n b2LineJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.y;\n }\n b2LineJoint.prototype.GetJointTranslation = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var p1 = bA.GetWorldPoint(this.m_localAnchor1);\n var p2 = bB.GetWorldPoint(this.m_localAnchor2);\n var dX = p2.x - p1.x;\n var dY = p2.y - p1.y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var translation = axis.x * dX + axis.y * dY;\n return translation;\n }\n b2LineJoint.prototype.GetJointSpeed = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var p1X = bA.m_sweep.c.x + r1X;\n var p1Y = bA.m_sweep.c.y + r1Y;\n var p2X = bB.m_sweep.c.x + r2X;\n var p2Y = bB.m_sweep.c.y + r2Y;\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var v1 = bA.m_linearVelocity;\n var v2 = bB.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var w2 = bB.m_angularVelocity;\n var speed = (dX * ((-w1 * axis.y)) + dY * (w1 * axis.x)) + (axis.x * (((v2.x + ((-w2 * r2Y))) - v1.x) - ((-w1 * r1Y))) + axis.y * (((v2.y + (w2 * r2X)) - v1.y) - (w1 * r1X)));\n return speed;\n }\n b2LineJoint.prototype.IsLimitEnabled = function () {\n return this.m_enableLimit;\n }\n b2LineJoint.prototype.EnableLimit = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableLimit = flag;\n }\n b2LineJoint.prototype.GetLowerLimit = function () {\n return this.m_lowerTranslation;\n }\n b2LineJoint.prototype.GetUpperLimit = function () {\n return this.m_upperTranslation;\n }\n b2LineJoint.prototype.SetLimits = function (lower, upper) {\n if (lower === undefined) lower = 0;\n if (upper === undefined) upper = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_lowerTranslation = lower;\n this.m_upperTranslation = upper;\n }\n b2LineJoint.prototype.IsMotorEnabled = function () {\n return this.m_enableMotor;\n }\n b2LineJoint.prototype.EnableMotor = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableMotor = flag;\n }\n b2LineJoint.prototype.SetMotorSpeed = function (speed) {\n if (speed === undefined) speed = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_motorSpeed = speed;\n }\n b2LineJoint.prototype.GetMotorSpeed = function () {\n return this.m_motorSpeed;\n }\n b2LineJoint.prototype.SetMaxMotorForce = function (force) {\n if (force === undefined) force = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_maxMotorForce = force;\n }\n b2LineJoint.prototype.GetMaxMotorForce = function () {\n return this.m_maxMotorForce;\n }\n b2LineJoint.prototype.GetMotorForce = function () {\n return this.m_motorImpulse;\n }\n b2LineJoint.prototype.b2LineJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_localXAxis1.SetV(def.localAxisA);\n this.m_localYAxis1.x = (-this.m_localXAxis1.y);\n this.m_localYAxis1.y = this.m_localXAxis1.x;\n this.m_impulse.SetZero();\n this.m_motorMass = 0.0;\n this.m_motorImpulse = 0.0;\n this.m_lowerTranslation = def.lowerTranslation;\n this.m_upperTranslation = def.upperTranslation;\n this.m_maxMotorForce = def.maxMotorForce;\n this.m_motorSpeed = def.motorSpeed;\n this.m_enableLimit = def.enableLimit;\n this.m_enableMotor = def.enableMotor;\n this.m_limitState = this.e_inactiveLimit;\n this.m_axis.SetZero();\n this.m_perp.SetZero();\n }\n b2LineJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n this.m_localCenterA.SetV(bA.GetLocalCenter());\n this.m_localCenterB.SetV(bB.GetLocalCenter());\n var xf1 = bA.GetTransform();\n var xf2 = bB.GetTransform();\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var dY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n this.m_invMassA = bA.m_invMass;\n this.m_invMassB = bB.m_invMass;\n this.m_invIA = bA.m_invI;\n this.m_invIB = bB.m_invI; {\n this.m_axis.SetV(b2Math.MulMV(xf1.R, this.m_localXAxis1));\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n this.m_motorMass = this.m_invMassA + this.m_invMassB + this.m_invIA * this.m_a1 * this.m_a1 + this.m_invIB * this.m_a2 * this.m_a2;\n this.m_motorMass = this.m_motorMass > Number.MIN_VALUE ? 1.0 / this.m_motorMass : 0.0;\n } {\n this.m_perp.SetV(b2Math.MulMV(xf1.R, this.m_localYAxis1));\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var m1 = this.m_invMassA;\n var m2 = this.m_invMassB;\n var i1 = this.m_invIA;\n var i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n }\n if (this.m_enableLimit) {\n var jointTransition = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n this.m_limitState = this.e_equalLimits;\n }\n else if (jointTransition <= this.m_lowerTranslation) {\n if (this.m_limitState != this.e_atLowerLimit) {\n this.m_limitState = this.e_atLowerLimit;\n this.m_impulse.y = 0.0;\n }\n }\n else if (jointTransition >= this.m_upperTranslation) {\n if (this.m_limitState != this.e_atUpperLimit) {\n this.m_limitState = this.e_atUpperLimit;\n this.m_impulse.y = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n this.m_impulse.y = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n }\n if (this.m_enableMotor == false) {\n this.m_motorImpulse = 0.0;\n }\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_motorImpulse *= step.dtRatio;\n var PX = this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.x;\n var PY = this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.y;\n var L1 = this.m_impulse.x * this.m_s1 + (this.m_motorImpulse + this.m_impulse.y) * this.m_a1;\n var L2 = this.m_impulse.x * this.m_s2 + (this.m_motorImpulse + this.m_impulse.y) * this.m_a2;\n bA.m_linearVelocity.x -= this.m_invMassA * PX;\n bA.m_linearVelocity.y -= this.m_invMassA * PY;\n bA.m_angularVelocity -= this.m_invIA * L1;\n bB.m_linearVelocity.x += this.m_invMassB * PX;\n bB.m_linearVelocity.y += this.m_invMassB * PY;\n bB.m_angularVelocity += this.m_invIB * L2;\n }\n else {\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n }\n }\n b2LineJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var v1 = bA.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var v2 = bB.m_linearVelocity;\n var w2 = bB.m_angularVelocity;\n var PX = 0;\n var PY = 0;\n var L1 = 0;\n var L2 = 0;\n if (this.m_enableMotor && this.m_limitState != this.e_equalLimits) {\n var Cdot = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var impulse = this.m_motorMass * (this.m_motorSpeed - Cdot);\n var oldImpulse = this.m_motorImpulse;\n var maxImpulse = step.dt * this.m_maxMotorForce;\n this.m_motorImpulse = b2Math.Clamp(this.m_motorImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_motorImpulse - oldImpulse;\n PX = impulse * this.m_axis.x;\n PY = impulse * this.m_axis.y;\n L1 = impulse * this.m_a1;\n L2 = impulse * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n var Cdot1 = this.m_perp.x * (v2.x - v1.x) + this.m_perp.y * (v2.y - v1.y) + this.m_s2 * w2 - this.m_s1 * w1;\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n var Cdot2 = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var f1 = this.m_impulse.Copy();\n var df = this.m_K.Solve(new b2Vec2(), (-Cdot1), (-Cdot2));\n this.m_impulse.Add(df);\n if (this.m_limitState == this.e_atLowerLimit) {\n this.m_impulse.y = b2Math.Max(this.m_impulse.y, 0.0);\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n this.m_impulse.y = b2Math.Min(this.m_impulse.y, 0.0);\n }\n var b = (-Cdot1) - (this.m_impulse.y - f1.y) * this.m_K.col2.x;\n var f2r = 0;\n if (this.m_K.col1.x != 0.0) {\n f2r = b / this.m_K.col1.x + f1.x;\n }\n else {\n f2r = f1.x;\n }\n this.m_impulse.x = f2r;\n df.x = this.m_impulse.x - f1.x;\n df.y = this.m_impulse.y - f1.y;\n PX = df.x * this.m_perp.x + df.y * this.m_axis.x;\n PY = df.x * this.m_perp.y + df.y * this.m_axis.y;\n L1 = df.x * this.m_s1 + df.y * this.m_a1;\n L2 = df.x * this.m_s2 + df.y * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n else {\n var df2 = 0;\n if (this.m_K.col1.x != 0.0) {\n df2 = ((-Cdot1)) / this.m_K.col1.x;\n }\n else {\n df2 = 0.0;\n }\n this.m_impulse.x += df2;\n PX = df2 * this.m_perp.x;\n PY = df2 * this.m_perp.y;\n L1 = df2 * this.m_s1;\n L2 = df2 * this.m_s2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n bA.m_linearVelocity.SetV(v1);\n bA.m_angularVelocity = w1;\n bB.m_linearVelocity.SetV(v2);\n bB.m_angularVelocity = w2;\n }\n b2LineJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var limitC = 0;\n var oldLimitImpulse = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var c1 = bA.m_sweep.c;\n var a1 = bA.m_sweep.a;\n var c2 = bB.m_sweep.c;\n var a2 = bB.m_sweep.a;\n var tMat;\n var tX = 0;\n var m1 = 0;\n var m2 = 0;\n var i1 = 0;\n var i2 = 0;\n var linearError = 0.0;\n var angularError = 0.0;\n var active = false;\n var C2 = 0.0;\n var R1 = b2Mat22.FromAngle(a1);\n var R2 = b2Mat22.FromAngle(a2);\n tMat = R1;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = R2;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = c2.x + r2X - c1.x - r1X;\n var dY = c2.y + r2Y - c1.y - r1Y;\n if (this.m_enableLimit) {\n this.m_axis = b2Math.MulMV(R1, this.m_localXAxis1);\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n var translation = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n C2 = b2Math.Clamp(translation, (-b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);\n linearError = b2Math.Abs(translation);\n active = true;\n }\n else if (translation <= this.m_lowerTranslation) {\n C2 = b2Math.Clamp(translation - this.m_lowerTranslation + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n linearError = this.m_lowerTranslation - translation;\n active = true;\n }\n else if (translation >= this.m_upperTranslation) {\n C2 = b2Math.Clamp(translation - this.m_upperTranslation + b2Settings.b2_linearSlop, 0.0, b2Settings.b2_maxLinearCorrection);\n linearError = translation - this.m_upperTranslation;\n active = true;\n }\n }\n this.m_perp = b2Math.MulMV(R1, this.m_localYAxis1);\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var impulse = new b2Vec2();\n var C1 = this.m_perp.x * dX + this.m_perp.y * dY;\n linearError = b2Math.Max(linearError, b2Math.Abs(C1));\n angularError = 0.0;\n if (active) {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n this.m_K.Solve(impulse, (-C1), (-C2));\n }\n else {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n var k11 = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n var impulse1 = 0;\n if (k11 != 0.0) {\n impulse1 = ((-C1)) / k11;\n }\n else {\n impulse1 = 0.0;\n }\n impulse.x = impulse1;\n impulse.y = 0.0;\n }\n var PX = impulse.x * this.m_perp.x + impulse.y * this.m_axis.x;\n var PY = impulse.x * this.m_perp.y + impulse.y * this.m_axis.y;\n var L1 = impulse.x * this.m_s1 + impulse.y * this.m_a1;\n var L2 = impulse.x * this.m_s2 + impulse.y * this.m_a2;\n c1.x -= this.m_invMassA * PX;\n c1.y -= this.m_invMassA * PY;\n a1 -= this.m_invIA * L1;\n c2.x += this.m_invMassB * PX;\n c2.y += this.m_invMassB * PY;\n a2 += this.m_invIB * L2;\n bA.m_sweep.a = a1;\n bB.m_sweep.a = a2;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return linearError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n b2LineJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2LineJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2LineJointDef.b2LineJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n this.localAxisA = new b2Vec2();\n };\n b2LineJointDef.prototype.b2LineJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_lineJoint;\n this.localAxisA.Set(1.0, 0.0);\n this.enableLimit = false;\n this.lowerTranslation = 0.0;\n this.upperTranslation = 0.0;\n this.enableMotor = false;\n this.maxMotorForce = 0.0;\n this.motorSpeed = 0.0;\n }\n b2LineJointDef.prototype.Initialize = function (bA, bB, anchor, axis) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA = this.bodyA.GetLocalPoint(anchor);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchor);\n this.localAxisA = this.bodyA.GetLocalVector(axis);\n }\n b2MouseJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2MouseJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2MouseJoint.b2MouseJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.K = new b2Mat22();\n this.K1 = new b2Mat22();\n this.K2 = new b2Mat22();\n this.m_localAnchor = new b2Vec2();\n this.m_target = new b2Vec2();\n this.m_impulse = new b2Vec2();\n this.m_mass = new b2Mat22();\n this.m_C = new b2Vec2();\n };\n b2MouseJoint.prototype.GetAnchorA = function () {\n return this.m_target;\n }\n b2MouseJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor);\n }\n b2MouseJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse.x, inv_dt * this.m_impulse.y);\n }\n b2MouseJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2MouseJoint.prototype.GetTarget = function () {\n return this.m_target;\n }\n b2MouseJoint.prototype.SetTarget = function (target) {\n if (this.m_bodyB.IsAwake() == false) {\n this.m_bodyB.SetAwake(true);\n }\n this.m_target = target;\n }\n b2MouseJoint.prototype.GetMaxForce = function () {\n return this.m_maxForce;\n }\n b2MouseJoint.prototype.SetMaxForce = function (maxForce) {\n if (maxForce === undefined) maxForce = 0;\n this.m_maxForce = maxForce;\n }\n b2MouseJoint.prototype.GetFrequency = function () {\n return this.m_frequencyHz;\n }\n b2MouseJoint.prototype.SetFrequency = function (hz) {\n if (hz === undefined) hz = 0;\n this.m_frequencyHz = hz;\n }\n b2MouseJoint.prototype.GetDampingRatio = function () {\n return this.m_dampingRatio;\n }\n b2MouseJoint.prototype.SetDampingRatio = function (ratio) {\n if (ratio === undefined) ratio = 0;\n this.m_dampingRatio = ratio;\n }\n b2MouseJoint.prototype.b2MouseJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_target.SetV(def.target);\n var tX = this.m_target.x - this.m_bodyB.m_xf.position.x;\n var tY = this.m_target.y - this.m_bodyB.m_xf.position.y;\n var tMat = this.m_bodyB.m_xf.R;\n this.m_localAnchor.x = (tX * tMat.col1.x + tY * tMat.col1.y);\n this.m_localAnchor.y = (tX * tMat.col2.x + tY * tMat.col2.y);\n this.m_maxForce = def.maxForce;\n this.m_impulse.SetZero();\n this.m_frequencyHz = def.frequencyHz;\n this.m_dampingRatio = def.dampingRatio;\n this.m_beta = 0.0;\n this.m_gamma = 0.0;\n }\n b2MouseJoint.prototype.InitVelocityConstraints = function (step) {\n var b = this.m_bodyB;\n var mass = b.GetMass();\n var omega = 2.0 * Math.PI * this.m_frequencyHz;\n var d = 2.0 * mass * this.m_dampingRatio * omega;\n var k = mass * omega * omega;\n this.m_gamma = step.dt * (d + step.dt * k);\n this.m_gamma = this.m_gamma != 0 ? 1 / this.m_gamma : 0.0;\n this.m_beta = step.dt * k * this.m_gamma;\n var tMat;tMat = b.m_xf.R;\n var rX = this.m_localAnchor.x - b.m_sweep.localCenter.x;\n var rY = this.m_localAnchor.y - b.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * rX + tMat.col2.x * rY);rY = (tMat.col1.y * rX + tMat.col2.y * rY);\n rX = tX;\n var invMass = b.m_invMass;\n var invI = b.m_invI;this.K1.col1.x = invMass;\n this.K1.col2.x = 0.0;\n this.K1.col1.y = 0.0;\n this.K1.col2.y = invMass;\n this.K2.col1.x = invI * rY * rY;\n this.K2.col2.x = (-invI * rX * rY);\n this.K2.col1.y = (-invI * rX * rY);\n this.K2.col2.y = invI * rX * rX;\n this.K.SetM(this.K1);\n this.K.AddM(this.K2);\n this.K.col1.x += this.m_gamma;\n this.K.col2.y += this.m_gamma;\n this.K.GetInverse(this.m_mass);\n this.m_C.x = b.m_sweep.c.x + rX - this.m_target.x;\n this.m_C.y = b.m_sweep.c.y + rY - this.m_target.y;\n b.m_angularVelocity *= 0.98;\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n b.m_linearVelocity.x += invMass * this.m_impulse.x;\n b.m_linearVelocity.y += invMass * this.m_impulse.y;\n b.m_angularVelocity += invI * (rX * this.m_impulse.y - rY * this.m_impulse.x);\n }\n b2MouseJoint.prototype.SolveVelocityConstraints = function (step) {\n var b = this.m_bodyB;\n var tMat;\n var tX = 0;\n var tY = 0;\n tMat = b.m_xf.R;\n var rX = this.m_localAnchor.x - b.m_sweep.localCenter.x;\n var rY = this.m_localAnchor.y - b.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rX + tMat.col2.x * rY);\n rY = (tMat.col1.y * rX + tMat.col2.y * rY);\n rX = tX;\n var CdotX = b.m_linearVelocity.x + ((-b.m_angularVelocity * rY));\n var CdotY = b.m_linearVelocity.y + (b.m_angularVelocity * rX);\n tMat = this.m_mass;\n tX = CdotX + this.m_beta * this.m_C.x + this.m_gamma * this.m_impulse.x;\n tY = CdotY + this.m_beta * this.m_C.y + this.m_gamma * this.m_impulse.y;\n var impulseX = (-(tMat.col1.x * tX + tMat.col2.x * tY));\n var impulseY = (-(tMat.col1.y * tX + tMat.col2.y * tY));\n var oldImpulseX = this.m_impulse.x;\n var oldImpulseY = this.m_impulse.y;\n this.m_impulse.x += impulseX;\n this.m_impulse.y += impulseY;\n var maxImpulse = step.dt * this.m_maxForce;\n if (this.m_impulse.LengthSquared() > maxImpulse * maxImpulse) {\n this.m_impulse.Multiply(maxImpulse / this.m_impulse.Length());\n }\n impulseX = this.m_impulse.x - oldImpulseX;\n impulseY = this.m_impulse.y - oldImpulseY;\n b.m_linearVelocity.x += b.m_invMass * impulseX;\n b.m_linearVelocity.y += b.m_invMass * impulseY;\n b.m_angularVelocity += b.m_invI * (rX * impulseY - rY * impulseX);\n }\n b2MouseJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n return true;\n }\n b2MouseJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2MouseJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2MouseJointDef.b2MouseJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.target = new b2Vec2();\n };\n b2MouseJointDef.prototype.b2MouseJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_mouseJoint;\n this.maxForce = 0.0;\n this.frequencyHz = 5.0;\n this.dampingRatio = 0.7;\n }\n b2PrismaticJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2PrismaticJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2PrismaticJoint.b2PrismaticJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_localXAxis1 = new b2Vec2();\n this.m_localYAxis1 = new b2Vec2();\n this.m_axis = new b2Vec2();\n this.m_perp = new b2Vec2();\n this.m_K = new b2Mat33();\n this.m_impulse = new b2Vec3();\n };\n b2PrismaticJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2PrismaticJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2PrismaticJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * (this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.x), inv_dt * (this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.y));\n }\n b2PrismaticJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.y;\n }\n b2PrismaticJoint.prototype.GetJointTranslation = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var p1 = bA.GetWorldPoint(this.m_localAnchor1);\n var p2 = bB.GetWorldPoint(this.m_localAnchor2);\n var dX = p2.x - p1.x;\n var dY = p2.y - p1.y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var translation = axis.x * dX + axis.y * dY;\n return translation;\n }\n b2PrismaticJoint.prototype.GetJointSpeed = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var p1X = bA.m_sweep.c.x + r1X;\n var p1Y = bA.m_sweep.c.y + r1Y;\n var p2X = bB.m_sweep.c.x + r2X;\n var p2Y = bB.m_sweep.c.y + r2Y;\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var v1 = bA.m_linearVelocity;\n var v2 = bB.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var w2 = bB.m_angularVelocity;\n var speed = (dX * ((-w1 * axis.y)) + dY * (w1 * axis.x)) + (axis.x * (((v2.x + ((-w2 * r2Y))) - v1.x) - ((-w1 * r1Y))) + axis.y * (((v2.y + (w2 * r2X)) - v1.y) - (w1 * r1X)));\n return speed;\n }\n b2PrismaticJoint.prototype.IsLimitEnabled = function () {\n return this.m_enableLimit;\n }\n b2PrismaticJoint.prototype.EnableLimit = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableLimit = flag;\n }\n b2PrismaticJoint.prototype.GetLowerLimit = function () {\n return this.m_lowerTranslation;\n }\n b2PrismaticJoint.prototype.GetUpperLimit = function () {\n return this.m_upperTranslation;\n }\n b2PrismaticJoint.prototype.SetLimits = function (lower, upper) {\n if (lower === undefined) lower = 0;\n if (upper === undefined) upper = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_lowerTranslation = lower;\n this.m_upperTranslation = upper;\n }\n b2PrismaticJoint.prototype.IsMotorEnabled = function () {\n return this.m_enableMotor;\n }\n b2PrismaticJoint.prototype.EnableMotor = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableMotor = flag;\n }\n b2PrismaticJoint.prototype.SetMotorSpeed = function (speed) {\n if (speed === undefined) speed = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_motorSpeed = speed;\n }\n b2PrismaticJoint.prototype.GetMotorSpeed = function () {\n return this.m_motorSpeed;\n }\n b2PrismaticJoint.prototype.SetMaxMotorForce = function (force) {\n if (force === undefined) force = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_maxMotorForce = force;\n }\n b2PrismaticJoint.prototype.GetMotorForce = function () {\n return this.m_motorImpulse;\n }\n b2PrismaticJoint.prototype.b2PrismaticJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_localXAxis1.SetV(def.localAxisA);\n this.m_localYAxis1.x = (-this.m_localXAxis1.y);\n this.m_localYAxis1.y = this.m_localXAxis1.x;\n this.m_refAngle = def.referenceAngle;\n this.m_impulse.SetZero();\n this.m_motorMass = 0.0;\n this.m_motorImpulse = 0.0;\n this.m_lowerTranslation = def.lowerTranslation;\n this.m_upperTranslation = def.upperTranslation;\n this.m_maxMotorForce = def.maxMotorForce;\n this.m_motorSpeed = def.motorSpeed;\n this.m_enableLimit = def.enableLimit;\n this.m_enableMotor = def.enableMotor;\n this.m_limitState = this.e_inactiveLimit;\n this.m_axis.SetZero();\n this.m_perp.SetZero();\n }\n b2PrismaticJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n this.m_localCenterA.SetV(bA.GetLocalCenter());\n this.m_localCenterB.SetV(bB.GetLocalCenter());\n var xf1 = bA.GetTransform();\n var xf2 = bB.GetTransform();\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var dY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n this.m_invMassA = bA.m_invMass;\n this.m_invMassB = bB.m_invMass;\n this.m_invIA = bA.m_invI;\n this.m_invIB = bB.m_invI; {\n this.m_axis.SetV(b2Math.MulMV(xf1.R, this.m_localXAxis1));\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n this.m_motorMass = this.m_invMassA + this.m_invMassB + this.m_invIA * this.m_a1 * this.m_a1 + this.m_invIB * this.m_a2 * this.m_a2;\n if (this.m_motorMass > Number.MIN_VALUE) this.m_motorMass = 1.0 / this.m_motorMass;\n } {\n this.m_perp.SetV(b2Math.MulMV(xf1.R, this.m_localYAxis1));\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var m1 = this.m_invMassA;\n var m2 = this.m_invMassB;\n var i1 = this.m_invIA;\n var i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 + i2 * this.m_s2;\n this.m_K.col1.z = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = i1 + i2;\n this.m_K.col2.z = i1 * this.m_a1 + i2 * this.m_a2;\n this.m_K.col3.x = this.m_K.col1.z;\n this.m_K.col3.y = this.m_K.col2.z;\n this.m_K.col3.z = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n }\n if (this.m_enableLimit) {\n var jointTransition = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n this.m_limitState = this.e_equalLimits;\n }\n else if (jointTransition <= this.m_lowerTranslation) {\n if (this.m_limitState != this.e_atLowerLimit) {\n this.m_limitState = this.e_atLowerLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else if (jointTransition >= this.m_upperTranslation) {\n if (this.m_limitState != this.e_atUpperLimit) {\n this.m_limitState = this.e_atUpperLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n }\n if (this.m_enableMotor == false) {\n this.m_motorImpulse = 0.0;\n }\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_motorImpulse *= step.dtRatio;\n var PX = this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.x;\n var PY = this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.y;\n var L1 = this.m_impulse.x * this.m_s1 + this.m_impulse.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_a1;\n var L2 = this.m_impulse.x * this.m_s2 + this.m_impulse.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_a2;\n bA.m_linearVelocity.x -= this.m_invMassA * PX;\n bA.m_linearVelocity.y -= this.m_invMassA * PY;\n bA.m_angularVelocity -= this.m_invIA * L1;\n bB.m_linearVelocity.x += this.m_invMassB * PX;\n bB.m_linearVelocity.y += this.m_invMassB * PY;\n bB.m_angularVelocity += this.m_invIB * L2;\n }\n else {\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n }\n }\n b2PrismaticJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var v1 = bA.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var v2 = bB.m_linearVelocity;\n var w2 = bB.m_angularVelocity;\n var PX = 0;\n var PY = 0;\n var L1 = 0;\n var L2 = 0;\n if (this.m_enableMotor && this.m_limitState != this.e_equalLimits) {\n var Cdot = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var impulse = this.m_motorMass * (this.m_motorSpeed - Cdot);\n var oldImpulse = this.m_motorImpulse;\n var maxImpulse = step.dt * this.m_maxMotorForce;\n this.m_motorImpulse = b2Math.Clamp(this.m_motorImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_motorImpulse - oldImpulse;\n PX = impulse * this.m_axis.x;\n PY = impulse * this.m_axis.y;\n L1 = impulse * this.m_a1;\n L2 = impulse * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n var Cdot1X = this.m_perp.x * (v2.x - v1.x) + this.m_perp.y * (v2.y - v1.y) + this.m_s2 * w2 - this.m_s1 * w1;\n var Cdot1Y = w2 - w1;\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n var Cdot2 = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var f1 = this.m_impulse.Copy();\n var df = this.m_K.Solve33(new b2Vec3(), (-Cdot1X), (-Cdot1Y), (-Cdot2));\n this.m_impulse.Add(df);\n if (this.m_limitState == this.e_atLowerLimit) {\n this.m_impulse.z = b2Math.Max(this.m_impulse.z, 0.0);\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n this.m_impulse.z = b2Math.Min(this.m_impulse.z, 0.0);\n }\n var bX = (-Cdot1X) - (this.m_impulse.z - f1.z) * this.m_K.col3.x;\n var bY = (-Cdot1Y) - (this.m_impulse.z - f1.z) * this.m_K.col3.y;\n var f2r = this.m_K.Solve22(new b2Vec2(), bX, bY);\n f2r.x += f1.x;\n f2r.y += f1.y;\n this.m_impulse.x = f2r.x;\n this.m_impulse.y = f2r.y;\n df.x = this.m_impulse.x - f1.x;\n df.y = this.m_impulse.y - f1.y;\n df.z = this.m_impulse.z - f1.z;\n PX = df.x * this.m_perp.x + df.z * this.m_axis.x;\n PY = df.x * this.m_perp.y + df.z * this.m_axis.y;\n L1 = df.x * this.m_s1 + df.y + df.z * this.m_a1;\n L2 = df.x * this.m_s2 + df.y + df.z * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n else {\n var df2 = this.m_K.Solve22(new b2Vec2(), (-Cdot1X), (-Cdot1Y));\n this.m_impulse.x += df2.x;\n this.m_impulse.y += df2.y;\n PX = df2.x * this.m_perp.x;\n PY = df2.x * this.m_perp.y;\n L1 = df2.x * this.m_s1 + df2.y;\n L2 = df2.x * this.m_s2 + df2.y;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n bA.m_linearVelocity.SetV(v1);\n bA.m_angularVelocity = w1;\n bB.m_linearVelocity.SetV(v2);\n bB.m_angularVelocity = w2;\n }\n b2PrismaticJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var limitC = 0;\n var oldLimitImpulse = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var c1 = bA.m_sweep.c;\n var a1 = bA.m_sweep.a;\n var c2 = bB.m_sweep.c;\n var a2 = bB.m_sweep.a;\n var tMat;\n var tX = 0;\n var m1 = 0;\n var m2 = 0;\n var i1 = 0;\n var i2 = 0;\n var linearError = 0.0;\n var angularError = 0.0;\n var active = false;\n var C2 = 0.0;\n var R1 = b2Mat22.FromAngle(a1);\n var R2 = b2Mat22.FromAngle(a2);\n tMat = R1;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = R2;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = c2.x + r2X - c1.x - r1X;\n var dY = c2.y + r2Y - c1.y - r1Y;\n if (this.m_enableLimit) {\n this.m_axis = b2Math.MulMV(R1, this.m_localXAxis1);\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n var translation = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n C2 = b2Math.Clamp(translation, (-b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);\n linearError = b2Math.Abs(translation);\n active = true;\n }\n else if (translation <= this.m_lowerTranslation) {\n C2 = b2Math.Clamp(translation - this.m_lowerTranslation + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n linearError = this.m_lowerTranslation - translation;\n active = true;\n }\n else if (translation >= this.m_upperTranslation) {\n C2 = b2Math.Clamp(translation - this.m_upperTranslation + b2Settings.b2_linearSlop, 0.0, b2Settings.b2_maxLinearCorrection);\n linearError = translation - this.m_upperTranslation;\n active = true;\n }\n }\n this.m_perp = b2Math.MulMV(R1, this.m_localYAxis1);\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var impulse = new b2Vec3();\n var C1X = this.m_perp.x * dX + this.m_perp.y * dY;\n var C1Y = a2 - a1 - this.m_refAngle;\n linearError = b2Math.Max(linearError, b2Math.Abs(C1X));\n angularError = b2Math.Abs(C1Y);\n if (active) {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 + i2 * this.m_s2;\n this.m_K.col1.z = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = i1 + i2;\n this.m_K.col2.z = i1 * this.m_a1 + i2 * this.m_a2;\n this.m_K.col3.x = this.m_K.col1.z;\n this.m_K.col3.y = this.m_K.col2.z;\n this.m_K.col3.z = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n this.m_K.Solve33(impulse, (-C1X), (-C1Y), (-C2));\n }\n else {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n var k11 = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n var k12 = i1 * this.m_s1 + i2 * this.m_s2;\n var k22 = i1 + i2;\n this.m_K.col1.Set(k11, k12, 0.0);\n this.m_K.col2.Set(k12, k22, 0.0);\n var impulse1 = this.m_K.Solve22(new b2Vec2(), (-C1X), (-C1Y));\n impulse.x = impulse1.x;\n impulse.y = impulse1.y;\n impulse.z = 0.0;\n }\n var PX = impulse.x * this.m_perp.x + impulse.z * this.m_axis.x;\n var PY = impulse.x * this.m_perp.y + impulse.z * this.m_axis.y;\n var L1 = impulse.x * this.m_s1 + impulse.y + impulse.z * this.m_a1;\n var L2 = impulse.x * this.m_s2 + impulse.y + impulse.z * this.m_a2;\n c1.x -= this.m_invMassA * PX;\n c1.y -= this.m_invMassA * PY;\n a1 -= this.m_invIA * L1;\n c2.x += this.m_invMassB * PX;\n c2.y += this.m_invMassB * PY;\n a2 += this.m_invIB * L2;\n bA.m_sweep.a = a1;\n bB.m_sweep.a = a2;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return linearError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n b2PrismaticJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2PrismaticJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2PrismaticJointDef.b2PrismaticJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n this.localAxisA = new b2Vec2();\n };\n b2PrismaticJointDef.prototype.b2PrismaticJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_prismaticJoint;\n this.localAxisA.Set(1.0, 0.0);\n this.referenceAngle = 0.0;\n this.enableLimit = false;\n this.lowerTranslation = 0.0;\n this.upperTranslation = 0.0;\n this.enableMotor = false;\n this.maxMotorForce = 0.0;\n this.motorSpeed = 0.0;\n }\n b2PrismaticJointDef.prototype.Initialize = function (bA, bB, anchor, axis) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA = this.bodyA.GetLocalPoint(anchor);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchor);\n this.localAxisA = this.bodyA.GetLocalVector(axis);\n this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle();\n }\n b2PulleyJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2PulleyJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2PulleyJoint.b2PulleyJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_groundAnchor1 = new b2Vec2();\n this.m_groundAnchor2 = new b2Vec2();\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_u1 = new b2Vec2();\n this.m_u2 = new b2Vec2();\n };\n b2PulleyJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2PulleyJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2PulleyJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse * this.m_u2.x, inv_dt * this.m_impulse * this.m_u2.y);\n }\n b2PulleyJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2PulleyJoint.prototype.GetGroundAnchorA = function () {\n var a = this.m_ground.m_xf.position.Copy();\n a.Add(this.m_groundAnchor1);\n return a;\n }\n b2PulleyJoint.prototype.GetGroundAnchorB = function () {\n var a = this.m_ground.m_xf.position.Copy();\n a.Add(this.m_groundAnchor2);\n return a;\n }\n b2PulleyJoint.prototype.GetLength1 = function () {\n var p = this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n var sX = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x;\n var sY = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y;\n var dX = p.x - sX;\n var dY = p.y - sY;\n return Math.sqrt(dX * dX + dY * dY);\n }\n b2PulleyJoint.prototype.GetLength2 = function () {\n var p = this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n var sX = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x;\n var sY = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;\n var dX = p.x - sX;\n var dY = p.y - sY;\n return Math.sqrt(dX * dX + dY * dY);\n }\n b2PulleyJoint.prototype.GetRatio = function () {\n return this.m_ratio;\n }\n b2PulleyJoint.prototype.b2PulleyJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_ground = this.m_bodyA.m_world.m_groundBody;\n this.m_groundAnchor1.x = def.groundAnchorA.x - this.m_ground.m_xf.position.x;\n this.m_groundAnchor1.y = def.groundAnchorA.y - this.m_ground.m_xf.position.y;\n this.m_groundAnchor2.x = def.groundAnchorB.x - this.m_ground.m_xf.position.x;\n this.m_groundAnchor2.y = def.groundAnchorB.y - this.m_ground.m_xf.position.y;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_ratio = def.ratio;\n this.m_constant = def.lengthA + this.m_ratio * def.lengthB;\n this.m_maxLength1 = b2Math.Min(def.maxLengthA, this.m_constant - this.m_ratio * b2PulleyJoint.b2_minPulleyLength);\n this.m_maxLength2 = b2Math.Min(def.maxLengthB, (this.m_constant - b2PulleyJoint.b2_minPulleyLength) / this.m_ratio);\n this.m_impulse = 0.0;\n this.m_limitImpulse1 = 0.0;\n this.m_limitImpulse2 = 0.0;\n }\n b2PulleyJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var p1X = bA.m_sweep.c.x + r1X;\n var p1Y = bA.m_sweep.c.y + r1Y;\n var p2X = bB.m_sweep.c.x + r2X;\n var p2Y = bB.m_sweep.c.y + r2Y;\n var s1X = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x;\n var s1Y = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y;\n var s2X = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x;\n var s2Y = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;\n this.m_u1.Set(p1X - s1X, p1Y - s1Y);\n this.m_u2.Set(p2X - s2X, p2Y - s2Y);\n var length1 = this.m_u1.Length();\n var length2 = this.m_u2.Length();\n if (length1 > b2Settings.b2_linearSlop) {\n this.m_u1.Multiply(1.0 / length1);\n }\n else {\n this.m_u1.SetZero();\n }\n if (length2 > b2Settings.b2_linearSlop) {\n this.m_u2.Multiply(1.0 / length2);\n }\n else {\n this.m_u2.SetZero();\n }\n var C = this.m_constant - length1 - this.m_ratio * length2;\n if (C > 0.0) {\n this.m_state = this.e_inactiveLimit;\n this.m_impulse = 0.0;\n }\n else {\n this.m_state = this.e_atUpperLimit;\n }\n if (length1 < this.m_maxLength1) {\n this.m_limitState1 = this.e_inactiveLimit;\n this.m_limitImpulse1 = 0.0;\n }\n else {\n this.m_limitState1 = this.e_atUpperLimit;\n }\n if (length2 < this.m_maxLength2) {\n this.m_limitState2 = this.e_inactiveLimit;\n this.m_limitImpulse2 = 0.0;\n }\n else {\n this.m_limitState2 = this.e_atUpperLimit;\n }\n var cr1u1 = r1X * this.m_u1.y - r1Y * this.m_u1.x;\n var cr2u2 = r2X * this.m_u2.y - r2Y * this.m_u2.x;\n this.m_limitMass1 = bA.m_invMass + bA.m_invI * cr1u1 * cr1u1;\n this.m_limitMass2 = bB.m_invMass + bB.m_invI * cr2u2 * cr2u2;\n this.m_pulleyMass = this.m_limitMass1 + this.m_ratio * this.m_ratio * this.m_limitMass2;\n this.m_limitMass1 = 1.0 / this.m_limitMass1;\n this.m_limitMass2 = 1.0 / this.m_limitMass2;\n this.m_pulleyMass = 1.0 / this.m_pulleyMass;\n if (step.warmStarting) {\n this.m_impulse *= step.dtRatio;\n this.m_limitImpulse1 *= step.dtRatio;\n this.m_limitImpulse2 *= step.dtRatio;\n var P1X = ((-this.m_impulse) - this.m_limitImpulse1) * this.m_u1.x;\n var P1Y = ((-this.m_impulse) - this.m_limitImpulse1) * this.m_u1.y;\n var P2X = ((-this.m_ratio * this.m_impulse) - this.m_limitImpulse2) * this.m_u2.x;\n var P2Y = ((-this.m_ratio * this.m_impulse) - this.m_limitImpulse2) * this.m_u2.y;\n bA.m_linearVelocity.x += bA.m_invMass * P1X;\n bA.m_linearVelocity.y += bA.m_invMass * P1Y;\n bA.m_angularVelocity += bA.m_invI * (r1X * P1Y - r1Y * P1X);\n bB.m_linearVelocity.x += bB.m_invMass * P2X;\n bB.m_linearVelocity.y += bB.m_invMass * P2Y;\n bB.m_angularVelocity += bB.m_invI * (r2X * P2Y - r2Y * P2X);\n }\n else {\n this.m_impulse = 0.0;\n this.m_limitImpulse1 = 0.0;\n this.m_limitImpulse2 = 0.0;\n }\n }\n b2PulleyJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var v1X = 0;\n var v1Y = 0;\n var v2X = 0;\n var v2Y = 0;\n var P1X = 0;\n var P1Y = 0;\n var P2X = 0;\n var P2Y = 0;\n var Cdot = 0;\n var impulse = 0;\n var oldImpulse = 0;\n if (this.m_state == this.e_atUpperLimit) {\n v1X = bA.m_linearVelocity.x + ((-bA.m_angularVelocity * r1Y));\n v1Y = bA.m_linearVelocity.y + (bA.m_angularVelocity * r1X);\n v2X = bB.m_linearVelocity.x + ((-bB.m_angularVelocity * r2Y));\n v2Y = bB.m_linearVelocity.y + (bB.m_angularVelocity * r2X);\n Cdot = (-(this.m_u1.x * v1X + this.m_u1.y * v1Y)) - this.m_ratio * (this.m_u2.x * v2X + this.m_u2.y * v2Y);\n impulse = this.m_pulleyMass * ((-Cdot));\n oldImpulse = this.m_impulse;\n this.m_impulse = b2Math.Max(0.0, this.m_impulse + impulse);\n impulse = this.m_impulse - oldImpulse;\n P1X = (-impulse * this.m_u1.x);\n P1Y = (-impulse * this.m_u1.y);\n P2X = (-this.m_ratio * impulse * this.m_u2.x);\n P2Y = (-this.m_ratio * impulse * this.m_u2.y);\n bA.m_linearVelocity.x += bA.m_invMass * P1X;\n bA.m_linearVelocity.y += bA.m_invMass * P1Y;\n bA.m_angularVelocity += bA.m_invI * (r1X * P1Y - r1Y * P1X);\n bB.m_linearVelocity.x += bB.m_invMass * P2X;\n bB.m_linearVelocity.y += bB.m_invMass * P2Y;\n bB.m_angularVelocity += bB.m_invI * (r2X * P2Y - r2Y * P2X);\n }\n if (this.m_limitState1 == this.e_atUpperLimit) {\n v1X = bA.m_linearVelocity.x + ((-bA.m_angularVelocity * r1Y));\n v1Y = bA.m_linearVelocity.y + (bA.m_angularVelocity * r1X);\n Cdot = (-(this.m_u1.x * v1X + this.m_u1.y * v1Y));\n impulse = (-this.m_limitMass1 * Cdot);\n oldImpulse = this.m_limitImpulse1;\n this.m_limitImpulse1 = b2Math.Max(0.0, this.m_limitImpulse1 + impulse);\n impulse = this.m_limitImpulse1 - oldImpulse;\n P1X = (-impulse * this.m_u1.x);\n P1Y = (-impulse * this.m_u1.y);\n bA.m_linearVelocity.x += bA.m_invMass * P1X;\n bA.m_linearVelocity.y += bA.m_invMass * P1Y;\n bA.m_angularVelocity += bA.m_invI * (r1X * P1Y - r1Y * P1X);\n }\n if (this.m_limitState2 == this.e_atUpperLimit) {\n v2X = bB.m_linearVelocity.x + ((-bB.m_angularVelocity * r2Y));\n v2Y = bB.m_linearVelocity.y + (bB.m_angularVelocity * r2X);\n Cdot = (-(this.m_u2.x * v2X + this.m_u2.y * v2Y));\n impulse = (-this.m_limitMass2 * Cdot);\n oldImpulse = this.m_limitImpulse2;\n this.m_limitImpulse2 = b2Math.Max(0.0, this.m_limitImpulse2 + impulse);\n impulse = this.m_limitImpulse2 - oldImpulse;\n P2X = (-impulse * this.m_u2.x);\n P2Y = (-impulse * this.m_u2.y);\n bB.m_linearVelocity.x += bB.m_invMass * P2X;\n bB.m_linearVelocity.y += bB.m_invMass * P2Y;\n bB.m_angularVelocity += bB.m_invI * (r2X * P2Y - r2Y * P2X);\n }\n }\n b2PulleyJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var s1X = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x;\n var s1Y = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y;\n var s2X = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x;\n var s2Y = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;\n var r1X = 0;\n var r1Y = 0;\n var r2X = 0;\n var r2Y = 0;\n var p1X = 0;\n var p1Y = 0;\n var p2X = 0;\n var p2Y = 0;\n var length1 = 0;\n var length2 = 0;\n var C = 0;\n var impulse = 0;\n var oldImpulse = 0;\n var oldLimitPositionImpulse = 0;\n var tX = 0;\n var linearError = 0.0;\n if (this.m_state == this.e_atUpperLimit) {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n p1X = bA.m_sweep.c.x + r1X;\n p1Y = bA.m_sweep.c.y + r1Y;\n p2X = bB.m_sweep.c.x + r2X;\n p2Y = bB.m_sweep.c.y + r2Y;\n this.m_u1.Set(p1X - s1X, p1Y - s1Y);\n this.m_u2.Set(p2X - s2X, p2Y - s2Y);\n length1 = this.m_u1.Length();\n length2 = this.m_u2.Length();\n if (length1 > b2Settings.b2_linearSlop) {\n this.m_u1.Multiply(1.0 / length1);\n }\n else {\n this.m_u1.SetZero();\n }\n if (length2 > b2Settings.b2_linearSlop) {\n this.m_u2.Multiply(1.0 / length2);\n }\n else {\n this.m_u2.SetZero();\n }\n C = this.m_constant - length1 - this.m_ratio * length2;\n linearError = b2Math.Max(linearError, (-C));\n C = b2Math.Clamp(C + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n impulse = (-this.m_pulleyMass * C);\n p1X = (-impulse * this.m_u1.x);\n p1Y = (-impulse * this.m_u1.y);\n p2X = (-this.m_ratio * impulse * this.m_u2.x);\n p2Y = (-this.m_ratio * impulse * this.m_u2.y);\n bA.m_sweep.c.x += bA.m_invMass * p1X;\n bA.m_sweep.c.y += bA.m_invMass * p1Y;\n bA.m_sweep.a += bA.m_invI * (r1X * p1Y - r1Y * p1X);\n bB.m_sweep.c.x += bB.m_invMass * p2X;\n bB.m_sweep.c.y += bB.m_invMass * p2Y;\n bB.m_sweep.a += bB.m_invI * (r2X * p2Y - r2Y * p2X);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n }\n if (this.m_limitState1 == this.e_atUpperLimit) {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n p1X = bA.m_sweep.c.x + r1X;\n p1Y = bA.m_sweep.c.y + r1Y;\n this.m_u1.Set(p1X - s1X, p1Y - s1Y);\n length1 = this.m_u1.Length();\n if (length1 > b2Settings.b2_linearSlop) {\n this.m_u1.x *= 1.0 / length1;\n this.m_u1.y *= 1.0 / length1;\n }\n else {\n this.m_u1.SetZero();\n }\n C = this.m_maxLength1 - length1;\n linearError = b2Math.Max(linearError, (-C));\n C = b2Math.Clamp(C + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n impulse = (-this.m_limitMass1 * C);\n p1X = (-impulse * this.m_u1.x);\n p1Y = (-impulse * this.m_u1.y);\n bA.m_sweep.c.x += bA.m_invMass * p1X;\n bA.m_sweep.c.y += bA.m_invMass * p1Y;\n bA.m_sweep.a += bA.m_invI * (r1X * p1Y - r1Y * p1X);\n bA.SynchronizeTransform();\n }\n if (this.m_limitState2 == this.e_atUpperLimit) {\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n p2X = bB.m_sweep.c.x + r2X;\n p2Y = bB.m_sweep.c.y + r2Y;\n this.m_u2.Set(p2X - s2X, p2Y - s2Y);\n length2 = this.m_u2.Length();\n if (length2 > b2Settings.b2_linearSlop) {\n this.m_u2.x *= 1.0 / length2;\n this.m_u2.y *= 1.0 / length2;\n }\n else {\n this.m_u2.SetZero();\n }\n C = this.m_maxLength2 - length2;\n linearError = b2Math.Max(linearError, (-C));\n C = b2Math.Clamp(C + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n impulse = (-this.m_limitMass2 * C);\n p2X = (-impulse * this.m_u2.x);\n p2Y = (-impulse * this.m_u2.y);\n bB.m_sweep.c.x += bB.m_invMass * p2X;\n bB.m_sweep.c.y += bB.m_invMass * p2Y;\n bB.m_sweep.a += bB.m_invI * (r2X * p2Y - r2Y * p2X);\n bB.SynchronizeTransform();\n }\n return linearError < b2Settings.b2_linearSlop;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength = 2.0;\n Box2D.Dynamics.Joints.b2PulleyJoint.prototype.b2_minPulleyLength = Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength;\n });\n b2PulleyJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2PulleyJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2PulleyJointDef.b2PulleyJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.groundAnchorA = new b2Vec2();\n this.groundAnchorB = new b2Vec2();\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2PulleyJointDef.prototype.b2PulleyJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_pulleyJoint;\n this.groundAnchorA.Set((-1.0), 1.0);\n this.groundAnchorB.Set(1.0, 1.0);\n this.localAnchorA.Set((-1.0), 0.0);\n this.localAnchorB.Set(1.0, 0.0);\n this.lengthA = 0.0;\n this.maxLengthA = 0.0;\n this.lengthB = 0.0;\n this.maxLengthB = 0.0;\n this.ratio = 1.0;\n this.collideConnected = true;\n }\n b2PulleyJointDef.prototype.Initialize = function (bA, bB, gaA, gaB, anchorA, anchorB, r) {\n if (r === undefined) r = 0;\n this.bodyA = bA;\n this.bodyB = bB;\n this.groundAnchorA.SetV(gaA);\n this.groundAnchorB.SetV(gaB);\n this.localAnchorA = this.bodyA.GetLocalPoint(anchorA);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchorB);\n var d1X = anchorA.x - gaA.x;\n var d1Y = anchorA.y - gaA.y;\n this.lengthA = Math.sqrt(d1X * d1X + d1Y * d1Y);\n var d2X = anchorB.x - gaB.x;\n var d2Y = anchorB.y - gaB.y;\n this.lengthB = Math.sqrt(d2X * d2X + d2Y * d2Y);\n this.ratio = r;\n var C = this.lengthA + this.ratio * this.lengthB;\n this.maxLengthA = C - this.ratio * b2PulleyJoint.b2_minPulleyLength;\n this.maxLengthB = (C - b2PulleyJoint.b2_minPulleyLength) / this.ratio;\n }\n b2RevoluteJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2RevoluteJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2RevoluteJoint.b2RevoluteJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.K = new b2Mat22();\n this.K1 = new b2Mat22();\n this.K2 = new b2Mat22();\n this.K3 = new b2Mat22();\n this.impulse3 = new b2Vec3();\n this.impulse2 = new b2Vec2();\n this.reduced = new b2Vec2();\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_impulse = new b2Vec3();\n this.m_mass = new b2Mat33();\n };\n b2RevoluteJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2RevoluteJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2RevoluteJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse.x, inv_dt * this.m_impulse.y);\n }\n b2RevoluteJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.z;\n }\n b2RevoluteJoint.prototype.GetJointAngle = function () {\n return this.m_bodyB.m_sweep.a - this.m_bodyA.m_sweep.a - this.m_referenceAngle;\n }\n b2RevoluteJoint.prototype.GetJointSpeed = function () {\n return this.m_bodyB.m_angularVelocity - this.m_bodyA.m_angularVelocity;\n }\n b2RevoluteJoint.prototype.IsLimitEnabled = function () {\n return this.m_enableLimit;\n }\n b2RevoluteJoint.prototype.EnableLimit = function (flag) {\n this.m_enableLimit = flag;\n }\n b2RevoluteJoint.prototype.GetLowerLimit = function () {\n return this.m_lowerAngle;\n }\n b2RevoluteJoint.prototype.GetUpperLimit = function () {\n return this.m_upperAngle;\n }\n b2RevoluteJoint.prototype.SetLimits = function (lower, upper) {\n if (lower === undefined) lower = 0;\n if (upper === undefined) upper = 0;\n this.m_lowerAngle = lower;\n this.m_upperAngle = upper;\n }\n b2RevoluteJoint.prototype.IsMotorEnabled = function () {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n return this.m_enableMotor;\n }\n b2RevoluteJoint.prototype.EnableMotor = function (flag) {\n this.m_enableMotor = flag;\n }\n b2RevoluteJoint.prototype.SetMotorSpeed = function (speed) {\n if (speed === undefined) speed = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_motorSpeed = speed;\n }\n b2RevoluteJoint.prototype.GetMotorSpeed = function () {\n return this.m_motorSpeed;\n }\n b2RevoluteJoint.prototype.SetMaxMotorTorque = function (torque) {\n if (torque === undefined) torque = 0;\n this.m_maxMotorTorque = torque;\n }\n b2RevoluteJoint.prototype.GetMotorTorque = function () {\n return this.m_maxMotorTorque;\n }\n b2RevoluteJoint.prototype.b2RevoluteJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_referenceAngle = def.referenceAngle;\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n this.m_lowerAngle = def.lowerAngle;\n this.m_upperAngle = def.upperAngle;\n this.m_maxMotorTorque = def.maxMotorTorque;\n this.m_motorSpeed = def.motorSpeed;\n this.m_enableLimit = def.enableLimit;\n this.m_enableMotor = def.enableMotor;\n this.m_limitState = this.e_inactiveLimit;\n }\n b2RevoluteJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n if (this.m_enableMotor || this.m_enableLimit) {}\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var m1 = bA.m_invMass;\n var m2 = bB.m_invMass;\n var i1 = bA.m_invI;\n var i2 = bB.m_invI;\n this.m_mass.col1.x = m1 + m2 + r1Y * r1Y * i1 + r2Y * r2Y * i2;\n this.m_mass.col2.x = (-r1Y * r1X * i1) - r2Y * r2X * i2;\n this.m_mass.col3.x = (-r1Y * i1) - r2Y * i2;\n this.m_mass.col1.y = this.m_mass.col2.x;\n this.m_mass.col2.y = m1 + m2 + r1X * r1X * i1 + r2X * r2X * i2;\n this.m_mass.col3.y = r1X * i1 + r2X * i2;\n this.m_mass.col1.z = this.m_mass.col3.x;\n this.m_mass.col2.z = this.m_mass.col3.y;\n this.m_mass.col3.z = i1 + i2;\n this.m_motorMass = 1.0 / (i1 + i2);\n if (this.m_enableMotor == false) {\n this.m_motorImpulse = 0.0;\n }\n if (this.m_enableLimit) {\n var jointAngle = bB.m_sweep.a - bA.m_sweep.a - this.m_referenceAngle;\n if (b2Math.Abs(this.m_upperAngle - this.m_lowerAngle) < 2.0 * b2Settings.b2_angularSlop) {\n this.m_limitState = this.e_equalLimits;\n }\n else if (jointAngle <= this.m_lowerAngle) {\n if (this.m_limitState != this.e_atLowerLimit) {\n this.m_impulse.z = 0.0;\n }\n this.m_limitState = this.e_atLowerLimit;\n }\n else if (jointAngle >= this.m_upperAngle) {\n if (this.m_limitState != this.e_atUpperLimit) {\n this.m_impulse.z = 0.0;\n }\n this.m_limitState = this.e_atUpperLimit;\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n }\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_motorImpulse *= step.dtRatio;\n var PX = this.m_impulse.x;\n var PY = this.m_impulse.y;\n bA.m_linearVelocity.x -= m1 * PX;\n bA.m_linearVelocity.y -= m1 * PY;\n bA.m_angularVelocity -= i1 * ((r1X * PY - r1Y * PX) + this.m_motorImpulse + this.m_impulse.z);\n bB.m_linearVelocity.x += m2 * PX;\n bB.m_linearVelocity.y += m2 * PY;\n bB.m_angularVelocity += i2 * ((r2X * PY - r2Y * PX) + this.m_motorImpulse + this.m_impulse.z);\n }\n else {\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n }\n }\n b2RevoluteJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n var newImpulse = 0;\n var r1X = 0;\n var r1Y = 0;\n var r2X = 0;\n var r2Y = 0;\n var v1 = bA.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var v2 = bB.m_linearVelocity;\n var w2 = bB.m_angularVelocity;\n var m1 = bA.m_invMass;\n var m2 = bB.m_invMass;\n var i1 = bA.m_invI;\n var i2 = bB.m_invI;\n if (this.m_enableMotor && this.m_limitState != this.e_equalLimits) {\n var Cdot = w2 - w1 - this.m_motorSpeed;\n var impulse = this.m_motorMass * ((-Cdot));\n var oldImpulse = this.m_motorImpulse;\n var maxImpulse = step.dt * this.m_maxMotorTorque;\n this.m_motorImpulse = b2Math.Clamp(this.m_motorImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_motorImpulse - oldImpulse;\n w1 -= i1 * impulse;\n w2 += i2 * impulse;\n }\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var Cdot1X = v2.x + ((-w2 * r2Y)) - v1.x - ((-w1 * r1Y));\n var Cdot1Y = v2.y + (w2 * r2X) - v1.y - (w1 * r1X);\n var Cdot2 = w2 - w1;\n this.m_mass.Solve33(this.impulse3, (-Cdot1X), (-Cdot1Y), (-Cdot2));\n if (this.m_limitState == this.e_equalLimits) {\n this.m_impulse.Add(this.impulse3);\n }\n else if (this.m_limitState == this.e_atLowerLimit) {\n newImpulse = this.m_impulse.z + this.impulse3.z;\n if (newImpulse < 0.0) {\n this.m_mass.Solve22(this.reduced, (-Cdot1X), (-Cdot1Y));\n this.impulse3.x = this.reduced.x;\n this.impulse3.y = this.reduced.y;\n this.impulse3.z = (-this.m_impulse.z);\n this.m_impulse.x += this.reduced.x;\n this.m_impulse.y += this.reduced.y;\n this.m_impulse.z = 0.0;\n }\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n newImpulse = this.m_impulse.z + this.impulse3.z;\n if (newImpulse > 0.0) {\n this.m_mass.Solve22(this.reduced, (-Cdot1X), (-Cdot1Y));\n this.impulse3.x = this.reduced.x;\n this.impulse3.y = this.reduced.y;\n this.impulse3.z = (-this.m_impulse.z);\n this.m_impulse.x += this.reduced.x;\n this.m_impulse.y += this.reduced.y;\n this.m_impulse.z = 0.0;\n }\n }\n v1.x -= m1 * this.impulse3.x;\n v1.y -= m1 * this.impulse3.y;\n w1 -= i1 * (r1X * this.impulse3.y - r1Y * this.impulse3.x + this.impulse3.z);\n v2.x += m2 * this.impulse3.x;\n v2.y += m2 * this.impulse3.y;\n w2 += i2 * (r2X * this.impulse3.y - r2Y * this.impulse3.x + this.impulse3.z);\n }\n else {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var CdotX = v2.x + ((-w2 * r2Y)) - v1.x - ((-w1 * r1Y));\n var CdotY = v2.y + (w2 * r2X) - v1.y - (w1 * r1X);\n this.m_mass.Solve22(this.impulse2, (-CdotX), (-CdotY));\n this.m_impulse.x += this.impulse2.x;\n this.m_impulse.y += this.impulse2.y;\n v1.x -= m1 * this.impulse2.x;\n v1.y -= m1 * this.impulse2.y;\n w1 -= i1 * (r1X * this.impulse2.y - r1Y * this.impulse2.x);\n v2.x += m2 * this.impulse2.x;\n v2.y += m2 * this.impulse2.y;\n w2 += i2 * (r2X * this.impulse2.y - r2Y * this.impulse2.x);\n }\n bA.m_linearVelocity.SetV(v1);\n bA.m_angularVelocity = w1;\n bB.m_linearVelocity.SetV(v2);\n bB.m_angularVelocity = w2;\n }\n b2RevoluteJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var oldLimitImpulse = 0;\n var C = 0;\n var tMat;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var angularError = 0.0;\n var positionError = 0.0;\n var tX = 0;\n var impulseX = 0;\n var impulseY = 0;\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n var angle = bB.m_sweep.a - bA.m_sweep.a - this.m_referenceAngle;\n var limitImpulse = 0.0;\n if (this.m_limitState == this.e_equalLimits) {\n C = b2Math.Clamp(angle - this.m_lowerAngle, (-b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);\n limitImpulse = (-this.m_motorMass * C);\n angularError = b2Math.Abs(C);\n }\n else if (this.m_limitState == this.e_atLowerLimit) {\n C = angle - this.m_lowerAngle;\n angularError = (-C);\n C = b2Math.Clamp(C + b2Settings.b2_angularSlop, (-b2Settings.b2_maxAngularCorrection), 0.0);\n limitImpulse = (-this.m_motorMass * C);\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n C = angle - this.m_upperAngle;\n angularError = C;\n C = b2Math.Clamp(C - b2Settings.b2_angularSlop, 0.0, b2Settings.b2_maxAngularCorrection);\n limitImpulse = (-this.m_motorMass * C);\n }\n bA.m_sweep.a -= bA.m_invI * limitImpulse;\n bB.m_sweep.a += bB.m_invI * limitImpulse;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n } {\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var CX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var CY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n var CLengthSquared = CX * CX + CY * CY;\n var CLength = Math.sqrt(CLengthSquared);\n positionError = CLength;\n var invMass1 = bA.m_invMass;\n var invMass2 = bB.m_invMass;\n var invI1 = bA.m_invI;\n var invI2 = bB.m_invI;\n var k_allowedStretch = 10.0 * b2Settings.b2_linearSlop;\n if (CLengthSquared > k_allowedStretch * k_allowedStretch) {\n var uX = CX / CLength;\n var uY = CY / CLength;\n var k = invMass1 + invMass2;\n var m = 1.0 / k;\n impulseX = m * ((-CX));\n impulseY = m * ((-CY));\n var k_beta = 0.5;\n bA.m_sweep.c.x -= k_beta * invMass1 * impulseX;\n bA.m_sweep.c.y -= k_beta * invMass1 * impulseY;\n bB.m_sweep.c.x += k_beta * invMass2 * impulseX;\n bB.m_sweep.c.y += k_beta * invMass2 * impulseY;\n CX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n CY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n }\n this.K1.col1.x = invMass1 + invMass2;\n this.K1.col2.x = 0.0;\n this.K1.col1.y = 0.0;\n this.K1.col2.y = invMass1 + invMass2;\n this.K2.col1.x = invI1 * r1Y * r1Y;\n this.K2.col2.x = (-invI1 * r1X * r1Y);\n this.K2.col1.y = (-invI1 * r1X * r1Y);\n this.K2.col2.y = invI1 * r1X * r1X;\n this.K3.col1.x = invI2 * r2Y * r2Y;\n this.K3.col2.x = (-invI2 * r2X * r2Y);\n this.K3.col1.y = (-invI2 * r2X * r2Y);\n this.K3.col2.y = invI2 * r2X * r2X;\n this.K.SetM(this.K1);\n this.K.AddM(this.K2);\n this.K.AddM(this.K3);\n this.K.Solve(b2RevoluteJoint.tImpulse, (-CX), (-CY));\n impulseX = b2RevoluteJoint.tImpulse.x;\n impulseY = b2RevoluteJoint.tImpulse.y;\n bA.m_sweep.c.x -= bA.m_invMass * impulseX;\n bA.m_sweep.c.y -= bA.m_invMass * impulseY;\n bA.m_sweep.a -= bA.m_invI * (r1X * impulseY - r1Y * impulseX);\n bB.m_sweep.c.x += bB.m_invMass * impulseX;\n bB.m_sweep.c.y += bB.m_invMass * impulseY;\n bB.m_sweep.a += bB.m_invI * (r2X * impulseY - r2Y * impulseX);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n }\n return positionError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse = new b2Vec2();\n Box2D.Dynamics.Joints.b2RevoluteJoint.prototype.tImpulse = Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse;\n });\n b2RevoluteJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2RevoluteJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2RevoluteJointDef.b2RevoluteJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2RevoluteJointDef.prototype.b2RevoluteJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_revoluteJoint;\n this.localAnchorA.Set(0.0, 0.0);\n this.localAnchorB.Set(0.0, 0.0);\n this.referenceAngle = 0.0;\n this.lowerAngle = 0.0;\n this.upperAngle = 0.0;\n this.maxMotorTorque = 0.0;\n this.motorSpeed = 0.0;\n this.enableLimit = false;\n this.enableMotor = false;\n }\n b2RevoluteJointDef.prototype.Initialize = function (bA, bB, anchor) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA = this.bodyA.GetLocalPoint(anchor);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchor);\n this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle();\n }\n b2WeldJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2WeldJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2WeldJoint.b2WeldJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchorA = new b2Vec2();\n this.m_localAnchorB = new b2Vec2();\n this.m_impulse = new b2Vec3();\n this.m_mass = new b2Mat33();\n };\n b2WeldJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchorA);\n }\n b2WeldJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchorB);\n }\n b2WeldJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse.x, inv_dt * this.m_impulse.y);\n }\n b2WeldJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.z;\n }\n b2WeldJoint.prototype.b2WeldJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_localAnchorA.SetV(def.localAnchorA);\n this.m_localAnchorB.SetV(def.localAnchorB);\n this.m_referenceAngle = def.referenceAngle;\n this.m_impulse.SetZero();\n this.m_mass = new b2Mat33();\n }\n b2WeldJoint.prototype.InitVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n this.m_mass.col1.x = mA + mB + rAY * rAY * iA + rBY * rBY * iB;\n this.m_mass.col2.x = (-rAY * rAX * iA) - rBY * rBX * iB;\n this.m_mass.col3.x = (-rAY * iA) - rBY * iB;\n this.m_mass.col1.y = this.m_mass.col2.x;\n this.m_mass.col2.y = mA + mB + rAX * rAX * iA + rBX * rBX * iB;\n this.m_mass.col3.y = rAX * iA + rBX * iB;\n this.m_mass.col1.z = this.m_mass.col3.x;\n this.m_mass.col2.z = this.m_mass.col3.y;\n this.m_mass.col3.z = iA + iB;\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_impulse.z *= step.dtRatio;\n bA.m_linearVelocity.x -= mA * this.m_impulse.x;\n bA.m_linearVelocity.y -= mA * this.m_impulse.y;\n bA.m_angularVelocity -= iA * (rAX * this.m_impulse.y - rAY * this.m_impulse.x + this.m_impulse.z);\n bB.m_linearVelocity.x += mB * this.m_impulse.x;\n bB.m_linearVelocity.y += mB * this.m_impulse.y;\n bB.m_angularVelocity += iB * (rBX * this.m_impulse.y - rBY * this.m_impulse.x + this.m_impulse.z);\n }\n else {\n this.m_impulse.SetZero();\n }\n }\n b2WeldJoint.prototype.SolveVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var vA = bA.m_linearVelocity;\n var wA = bA.m_angularVelocity;\n var vB = bB.m_linearVelocity;\n var wB = bB.m_angularVelocity;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var Cdot1X = vB.x - wB * rBY - vA.x + wA * rAY;\n var Cdot1Y = vB.y + wB * rBX - vA.y - wA * rAX;\n var Cdot2 = wB - wA;\n var impulse = new b2Vec3();\n this.m_mass.Solve33(impulse, (-Cdot1X), (-Cdot1Y), (-Cdot2));\n this.m_impulse.Add(impulse);\n vA.x -= mA * impulse.x;\n vA.y -= mA * impulse.y;\n wA -= iA * (rAX * impulse.y - rAY * impulse.x + impulse.z);\n vB.x += mB * impulse.x;\n vB.y += mB * impulse.y;\n wB += iB * (rBX * impulse.y - rBY * impulse.x + impulse.z);\n bA.m_angularVelocity = wA;\n bB.m_angularVelocity = wB;\n }\n b2WeldJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n var C1X = bB.m_sweep.c.x + rBX - bA.m_sweep.c.x - rAX;\n var C1Y = bB.m_sweep.c.y + rBY - bA.m_sweep.c.y - rAY;\n var C2 = bB.m_sweep.a - bA.m_sweep.a - this.m_referenceAngle;\n var k_allowedStretch = 10.0 * b2Settings.b2_linearSlop;\n var positionError = Math.sqrt(C1X * C1X + C1Y * C1Y);\n var angularError = b2Math.Abs(C2);\n if (positionError > k_allowedStretch) {\n iA *= 1.0;\n iB *= 1.0;\n }\n this.m_mass.col1.x = mA + mB + rAY * rAY * iA + rBY * rBY * iB;\n this.m_mass.col2.x = (-rAY * rAX * iA) - rBY * rBX * iB;\n this.m_mass.col3.x = (-rAY * iA) - rBY * iB;\n this.m_mass.col1.y = this.m_mass.col2.x;\n this.m_mass.col2.y = mA + mB + rAX * rAX * iA + rBX * rBX * iB;\n this.m_mass.col3.y = rAX * iA + rBX * iB;\n this.m_mass.col1.z = this.m_mass.col3.x;\n this.m_mass.col2.z = this.m_mass.col3.y;\n this.m_mass.col3.z = iA + iB;\n var impulse = new b2Vec3();\n this.m_mass.Solve33(impulse, (-C1X), (-C1Y), (-C2));\n bA.m_sweep.c.x -= mA * impulse.x;\n bA.m_sweep.c.y -= mA * impulse.y;\n bA.m_sweep.a -= iA * (rAX * impulse.y - rAY * impulse.x + impulse.z);\n bB.m_sweep.c.x += mB * impulse.x;\n bB.m_sweep.c.y += mB * impulse.y;\n bB.m_sweep.a += iB * (rBX * impulse.y - rBY * impulse.x + impulse.z);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return positionError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n b2WeldJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2WeldJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2WeldJointDef.b2WeldJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2WeldJointDef.prototype.b2WeldJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_weldJoint;\n this.referenceAngle = 0.0;\n }\n b2WeldJointDef.prototype.Initialize = function (bA, bB, anchor) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchor));\n this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchor));\n this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle();\n }\n})();\nvar Vector_a2j_Number = a2j.NVector;\n//post-definitions\nfor (var i = 0; i < _A2J_postDefs.length; ++i) _A2J_postDefs[i]();(function() {\n function b2DebugDraw() {\n b2DebugDraw.b2DebugDraw.apply(this, arguments);\n if (this.constructor === b2DebugDraw) this.b2DebugDraw.apply(this, arguments);\n }\n Box2D.Dynamics.b2DebugDraw = b2DebugDraw;\n})();\n_A2J_postDefs = [];\n(function() {\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n b2DebugDraw.b2DebugDraw = function () {\n this.m_drawScale = 1.0;\n this.m_lineThickness = 1.0;\n this.m_alpha = 1.0;\n this.m_fillAlpha = 1.0;\n this.m_xformScale = 1.0;\n var __this = this;\n //#WORKAROUND\n this.m_sprite = {graphics: {clear:\n function() {__this.m_ctx.clearRect(0,0,__this.m_ctx.canvas.width,__this.m_ctx.canvas.height)}\n }};\n };\n b2DebugDraw.prototype._color = function(color, alpha) {\n return \"rgba(\"+ ((color & 0xFF0000) >> 16) +\",\"+ ((color & 0xFF00) >> 8) +\",\"+\n (color & 0xFF) +\",\"+ alpha +\")\";\n };\n b2DebugDraw.prototype.b2DebugDraw = function () {\n this.m_drawFlags = 0;\n };\n b2DebugDraw.prototype.SetFlags = function (flags) {\n if (flags === undefined) flags = 0;\n this.m_drawFlags = flags;\n };\n b2DebugDraw.prototype.GetFlags = function () {\n return this.m_drawFlags;\n };\n b2DebugDraw.prototype.AppendFlags = function (flags) {\n if (flags === undefined) flags = 0;\n this.m_drawFlags |= flags;\n };\n b2DebugDraw.prototype.ClearFlags = function (flags) {\n if (flags === undefined) flags = 0;\n this.m_drawFlags &= ~flags;\n };\n b2DebugDraw.prototype.SetSprite = function (sprite) {\n this.m_ctx = sprite;\n };\n b2DebugDraw.prototype.GetSprite = function () {\n return this.m_ctx;\n };\n b2DebugDraw.prototype.SetDrawScale = function (drawScale) {\n if (drawScale === undefined) drawScale = 0;\n this.m_drawScale = drawScale;\n };\n b2DebugDraw.prototype.GetDrawScale = function () {\n return this.m_drawScale;\n };\n b2DebugDraw.prototype.SetLineThickness = function (lineThickness) {\n if (lineThickness === undefined) lineThickness = 0;\n this.m_lineThickness = lineThickness;\n this.m_ctx.strokeWidth = lineThickness;\n };\n b2DebugDraw.prototype.GetLineThickness = function () {\n return this.m_lineThickness;\n };\n b2DebugDraw.prototype.SetAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n this.m_alpha = alpha;\n };\n b2DebugDraw.prototype.GetAlpha = function () {\n return this.m_alpha;\n };\n b2DebugDraw.prototype.SetFillAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n this.m_fillAlpha = alpha;\n };\n b2DebugDraw.prototype.GetFillAlpha = function () {\n return this.m_fillAlpha;\n };\n b2DebugDraw.prototype.SetXFormScale = function (xformScale) {\n if (xformScale === undefined) xformScale = 0;\n this.m_xformScale = xformScale;\n };\n b2DebugDraw.prototype.GetXFormScale = function () {\n return this.m_xformScale;\n };\n b2DebugDraw.prototype.DrawPolygon = function (vertices, vertexCount, color) {\n if(!vertexCount) return;\n var s = this.m_ctx;\n var drawScale = this.m_drawScale;\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.moveTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n for (var i = 1; i < vertexCount; i++) {\n s.lineTo(vertices[i].x * drawScale, vertices[i].y * drawScale);\n }\n s.lineTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n s.closePath();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawSolidPolygon = function (vertices, vertexCount, color) {\n if(!vertexCount) return;\n var s = this.m_ctx;\n var drawScale = this.m_drawScale;\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.fillStyle = this._color(color.color, this.m_fillAlpha);\n s.moveTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n for (var i = 1; i < vertexCount; i++) {\n s.lineTo(vertices[i].x * drawScale, vertices[i].y * drawScale);\n }\n s.lineTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n s.closePath();\n s.fill();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawCircle = function (center, radius, color) {\n if(!radius) return;\n var s = this.m_ctx;\n var drawScale = this.m_drawScale;\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.arc(center.x * drawScale, center.y * drawScale, radius * drawScale, 0, Math.PI*2, true);\n s.closePath();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawSolidCircle = function (center, radius, axis, color) {\n /*if (radius === undefined) radius = 0;\n this.m_ctx.graphics.lineStyle(this.m_lineThickness, color.color, this.m_alpha);\n this.m_ctx.graphics.moveTo(0, 0);\n this.m_ctx.graphics.beginFill(color.color, this.m_fillAlpha);\n this.m_ctx.graphics.drawCircle(center.x * this.m_drawScale, center.y * this.m_drawScale, radius * this.m_drawScale);\n this.m_ctx.graphics.endFill();\n this.m_ctx.graphics.moveTo(center.x * this.m_drawScale, center.y * this.m_drawScale);\n this.m_ctx.graphics.lineTo((center.x + axis.x * radius) * this.m_drawScale, (center.y + axis.y * radius) * this.m_drawScale);\n */\n if(!radius) return;\n var s = this.m_ctx\n , drawScale = this.m_drawScale\n , cx = center.x * drawScale\n , cy = center.y * drawScale\n ;\n s.moveTo(0, 0);\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.fillStyle = this._color(color.color, this.m_fillAlpha);\n s.arc(cx, cy, radius * drawScale, 0, Math.PI*2, true);\n s.moveTo(cx, cy);\n s.lineTo((center.x + axis.x * radius) * drawScale, (center.y + axis.y * radius) * drawScale);\n s.closePath();\n s.fill();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawSegment = function (p1, p2, color) {\n var s = this.m_ctx\n , drawScale = this.m_drawScale\n ;\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.beginPath();\n s.moveTo(p1.x * drawScale, p1.y * drawScale);\n s.lineTo(p2.x * drawScale, p2.y * drawScale);\n s.closePath();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawTransform = function (xf) {\n var s = this.m_ctx\n , drawScale = this.m_drawScale\n ;\n s.beginPath();\n s.strokeStyle = this._color(0xff0000, this.m_alpha);\n s.moveTo(xf.position.x * drawScale, xf.position.y * drawScale);\n s.lineTo((xf.position.x + this.m_xformScale * xf.R.col1.x) * drawScale, (xf.position.y + this.m_xformScale * xf.R.col1.y) * drawScale);\n\n s.strokeStyle = this._color(0xff00, this.m_alpha);\n s.moveTo(xf.position.x * drawScale, xf.position.y * drawScale);\n s.lineTo((xf.position.x + this.m_xformScale * xf.R.col2.x) * drawScale, (xf.position.y + this.m_xformScale * xf.R.col2.y) * drawScale);\n s.closePath();\n s.stroke();\n };\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2DebugDraw.e_shapeBit = 0x0001;\n Box2D.Dynamics.b2DebugDraw.prototype.e_shapeBit = Box2D.Dynamics.b2DebugDraw.e_shapeBit;\n Box2D.Dynamics.b2DebugDraw.e_jointBit = 0x0002;\n Box2D.Dynamics.b2DebugDraw.prototype.e_jointBit = Box2D.Dynamics.b2DebugDraw.e_jointBit;\n Box2D.Dynamics.b2DebugDraw.e_aabbBit = 0x0004;\n Box2D.Dynamics.b2DebugDraw.prototype.e_aabbBit = Box2D.Dynamics.b2DebugDraw.e_aabbBit;\n Box2D.Dynamics.b2DebugDraw.e_pairBit = 0x0008;\n Box2D.Dynamics.b2DebugDraw.prototype.e_pairBit = Box2D.Dynamics.b2DebugDraw.e_pairBit;\n Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit = 0x0010;\n Box2D.Dynamics.b2DebugDraw.prototype.e_centerOfMassBit = Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit;\n Box2D.Dynamics.b2DebugDraw.e_controllerBit = 0x0020;\n Box2D.Dynamics.b2DebugDraw.prototype.e_controllerBit = Box2D.Dynamics.b2DebugDraw.e_controllerBit;\n });\n})();\n\n//post-definitions\nfor (var i = 0; i < _A2J_postDefs.length; ++i) _A2J_postDefs[i]();;\n;\nvar __slice = Array.prototype.slice;\n/***\nCreates and returns a copy of the array. The copy contains\nthe same objects.\n\n@name copy\n@methodOf Array#\n@type Array\n@returns A new array that is a copy of the array\n*/\nArray.prototype.copy = function() {\n return this.concat();\n};\n/***\nEmpties the array of its contents. It is modified in place.\n\n@name clear\n@methodOf Array#\n@type Array\n@returns this, now emptied.\n*/\nArray.prototype.clear = function() {\n this.length = 0;\n return this;\n};\n/***\nInvoke the named method on each element in the array\nand return a new array containing the results of the invocation.\n\n<code><pre>\n [1.1, 2.2, 3.3, 4.4].invoke(\"floor\")\n => [1, 2, 3, 4]\n\n ['hello', 'world', 'cool!'].invoke('substring', 0, 3)\n => ['hel', 'wor', 'coo']\n</pre></code>\n\n@param {String} method The name of the method to invoke.\n@param [arg...] Optional arguments to pass to the method being invoked.\n\n@name invoke\n@methodOf Array#\n@type Array\n@returns A new array containing the results of invoking the\nnamed method on each element.\n*/\nArray.prototype.invoke = function(method) {\n var args;\n args = __slice.call(arguments, 1);\n return this.map(function(element) {\n return element[method].apply(element, args);\n });\n};\n/***\nRandomly select an element from the array.\n\n@name rand\n@methodOf Array#\n@type Object\n@returns A random element from an array\n*/\nArray.prototype.rand = function() {\n return this[rand(this.length)];\n};\n/***\nRemove the first occurance of the given object from the array if it is\npresent.\n\n@name remove\n@methodOf Array#\n@param {Object} object The object to remove from the array if present.\n@returns The removed object if present otherwise undefined.\n*/\nArray.prototype.remove = function(object) {\n var index;\n index = this.indexOf(object);\n return index >= 0 ? this.splice(index, 1)[0] : undefined;\n};\n/***\nReturns true if the element is present in the array.\n\n@name include\n@methodOf Array#\n@param {Object} element The element to check if present.\n@returns true if the element is in the array, false otherwise.\n@type Boolean\n*/\nArray.prototype.include = function(element) {\n return this.indexOf(element) !== -1;\n};\n/***\nCall the given iterator once for each element in the array,\npassing in the element as the first argument, the index of\nthe element as the second argument, and this array as the\nthird argument.\n\n@name each\n@methodOf Array#\n@param {Function} iterator Function to be called once for\neach element in the array.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns this to enable method chaining.\n*/\nArray.prototype.each = function(iterator, context) {\n var _len, _ref, element, i;\n if (this.forEach) {\n this.forEach(iterator, context);\n } else {\n _ref = this;\n for (i = 0, _len = _ref.length; i < _len; i++) {\n element = _ref[i];\n iterator.call(context, element, i, this);\n }\n }\n return this;\n};\n/***\nCall the given iterator once for each element in the array,\npassing in the given object as the first argument and the element\nas the second argument. Additional arguments are passed similar to\n<code>each</code>\n\n@see Array#each\n\n@name eachWithObject\n@methodOf Array#\n\n@param {Object} object The number of elements in each group.\n@param {Function} iterator Function to be called once for\neach element in the array.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@returns this\n@type Array\n*/\nArray.prototype.eachWithObject = function(object, iterator, context) {\n this.each(function(element, i, self) {\n return iterator.call(context, object, element, i, self);\n });\n return object;\n};\n/***\nCall the given iterator once for each group of elements in the array,\npassing in the elements in groups of n. Additional argumens are\npassed as in <code>each</each>.\n\n@see Array#each\n\n@name eachSlice\n@methodOf Array#\n\n@param {Number} n The number of elements in each group.\n@param {Function} iterator Function to be called once for\neach group of elements in the array.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@returns this\n@type Array\n*/\nArray.prototype.eachSlice = function(n, iterator, context) {\n var i, len;\n if (n > 0) {\n len = (this.length / n).floor();\n i = -1;\n while (++i < len) {\n iterator.call(context, this.slice(i * n, (i + 1) * n), i * n, this);\n }\n }\n return this;\n};\n/***\nReturns a new array with the elements all shuffled up.\n\n@name shuffle\n@methodOf Array#\n\n@returns A new array that is randomly shuffled.\n@type Array\n*/\nArray.prototype.shuffle = function() {\n var shuffledArray;\n shuffledArray = [];\n this.each(function(element) {\n return shuffledArray.splice(rand(shuffledArray.length + 1), 0, element);\n });\n return shuffledArray;\n};\n/***\nReturns the first element of the array, undefined if the array is empty.\n\n@name first\n@methodOf Array#\n\n@returns The first element, or undefined if the array is empty.\n@type Object\n*/\nArray.prototype.first = function() {\n return this[0];\n};\n/***\nReturns the last element of the array, undefined if the array is empty.\n\n@name last\n@methodOf Array#\n\n@returns The last element, or undefined if the array is empty.\n@type Object\n*/\nArray.prototype.last = function() {\n return this[this.length - 1];\n};\n/***\nReturns an object containing the extremes of this array.\n<pre>\n[-1, 3, 0].extremes() # => {min: -1, max: 3}\n</pre>\n\n@name extremes\n@methodOf Array#\n\n@param {Function} [fn] An optional funtion used to evaluate\neach element to calculate its value for determining extremes.\n@returns {min: minElement, max: maxElement}\n@type Object\n*/\nArray.prototype.extremes = function(fn) {\n var max, maxResult, min, minResult;\n fn || (fn = function(n) {\n return n;\n });\n min = (max = undefined);\n minResult = (maxResult = undefined);\n this.each(function(object) {\n var result;\n result = fn(object);\n if (typeof min !== \"undefined\" && min !== null) {\n if (result < minResult) {\n min = object;\n minResult = result;\n }\n } else {\n min = object;\n minResult = result;\n }\n if (typeof max !== \"undefined\" && max !== null) {\n if (result > maxResult) {\n max = object;\n return (maxResult = result);\n }\n } else {\n max = object;\n return (maxResult = result);\n }\n });\n return {\n min: min,\n max: max\n };\n};\n/***\nPretend the array is a circle and grab a new array containing length elements.\nIf length is not given return the element at start, again assuming the array\nis a circle.\n\n@name wrap\n@methodOf Array#\n\n@param {Number} start The index to start wrapping at, or the index of the\nsole element to return if no length is given.\n@param {Number} [length] Optional length determines how long result\narray should be.\n@returns The element at start mod array.length, or an array of length elements,\nstarting from start and wrapping.\n@type Object or Array\n*/\nArray.prototype.wrap = function(start, length) {\n var end, i, result;\n if (typeof length !== \"undefined\" && length !== null) {\n end = start + length;\n i = start;\n result = [];\n while (i++ < end) {\n result.push(this[i.mod(this.length)]);\n }\n return result;\n } else {\n return this[start.mod(this.length)];\n }\n};\n/***\nPartitions the elements into two groups: those for which the iterator returns\ntrue, and those for which it returns false.\n\n@name partition\n@methodOf Array#\n\n@param {Function} iterator\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns An array in the form of [trueCollection, falseCollection]\n*/\nArray.prototype.partition = function(iterator, context) {\n var falseCollection, trueCollection;\n trueCollection = [];\n falseCollection = [];\n this.each(function(element) {\n return iterator.call(context, element) ? trueCollection.push(element) : falseCollection.push(element);\n });\n return [trueCollection, falseCollection];\n};\n/***\nReturn the group of elements for which the return value of the iterator is true.\n\n@name select\n@methodOf Array#\n\n@param {Function} iterator The iterator receives each element in turn as\nthe first agument.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns An array containing the elements for which the iterator returned true.\n*/\nArray.prototype.select = function(iterator, context) {\n return this.partition(iterator, context)[0];\n};\n/***\nReturn the group of elements that are not in the passed in set.\n\n@name without\n@methodOf Array#\n\n@param {Array} values List of elements to exclude.\n\n@type Array\n@returns An array containing the elements that are not passed in.\n*/\nArray.prototype.without = function(values) {\n return this.reject(function(element) {\n return values.include(element);\n });\n};\n/***\nReturn the group of elements for which the return value of the iterator is false.\n\n@name reject\n@methodOf Array#\n\n@param {Function} iterator The iterator receives each element in turn as\nthe first agument.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns An array containing the elements for which the iterator returned false.\n*/\nArray.prototype.reject = function(iterator, context) {\n return this.partition(iterator, context)[1];\n};\n/***\nCombines all elements of the array by applying a binary operation.\nfor each element in the arra the iterator is passed an accumulator\nvalue (memo) and the element.\n\n@name inject\n@methodOf Array#\n\n@type Object\n@returns The result of a\n*/\nArray.prototype.inject = function(initial, iterator) {\n this.each(function(element) {\n return (initial = iterator(initial, element));\n });\n return initial;\n};\n/***\nAdd all the elements in the array.\n\n@name sum\n@methodOf Array#\n\n@type Number\n@returns The sum of the elements in the array.\n*/\nArray.prototype.sum = function() {\n return this.inject(0, function(sum, n) {\n return sum + n;\n });\n};\nArray.prototype.zip = function() {\n var args;\n args = __slice.call(arguments, 0);\n return this.map(function(element, index) {\n var output;\n output = args.map(function(arr) {\n return arr[index];\n });\n output.unshift(element);\n return output;\n });\n};;\n/**\n * CoffeeScript Compiler v1.0.1\n * http://coffeescript.org\n *\n * Copyright 2011, Jeremy Ashkenas\n * Released under the MIT License\n */\nthis.CoffeeScript=function(){function require(a){return require[a]}require[\"./helpers\"]=new function(){var a=this;(function(){var b,c;a.starts=function(a,b,c){return b===a.substr(c,b.length)},a.ends=function(a,b,c){var d;d=b.length;return b===a.substr(a.length-d-(c||0),d)},a.compact=function(a){var b,c,d,e;e=[];for(c=0,d=a.length;c<d;c++)b=a[c],b&&e.push(b);return e},a.count=function(a,b){var c,d;c=d=0;if(!b.length)return 1/0;while(d=1+a.indexOf(b,d))c++;return c},a.merge=function(a,c){return b(b({},a),c)},b=a.extend=function(a,b){var c,d;for(c in b)d=b[c],a[c]=d;return a},a.flatten=c=function(a){var b,d,e,f;d=[];for(e=0,f=a.length;e<f;e++)b=a[e],b instanceof Array?d=d.concat(c(b)):d.push(b);return d},a.del=function(a,b){var c;c=a[b],delete a[b];return c},a.last=function(a,b){return a[a.length-(b||0)-1]}}).call(this)},require[\"./rewriter\"]=new function(){var a=this;(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]===a)return b;return-1},u=Array.prototype.slice;a.Rewriter=function(){function a(){}a.prototype.rewrite=function(a){this.tokens=a,this.removeLeadingNewlines(),this.removeMidExpressionNewlines(),this.closeOpenCalls(),this.closeOpenIndexes(),this.addImplicitIndentation(),this.tagPostfixConditionals(),this.addImplicitBraces(),this.addImplicitParentheses(),this.ensureBalance(b),this.rewriteClosingParens();return this.tokens},a.prototype.scanTokens=function(a){var b,c,d;d=this.tokens,b=0;while(c=d[b])b+=a.call(this,c,b,d);return!0},a.prototype.detectEnd=function(a,b,c){var f,g,h,i,j;h=this.tokens,f=0;while(g=h[a]){if(f===0&&b.call(this,g,a))return c.call(this,g,a);if(!g||f<0)return c.call(this,g,a-1);if(i=g[0],t.call(e,i)>=0)f+=1;else if(j=g[0],t.call(d,j)>=0)f-=1;a+=1}return a-1},a.prototype.removeLeadingNewlines=function(){var a,b,c,d;d=this.tokens;for(a=0,c=d.length;a<c;a++){b=d[a][0];if(b!==\"TERMINATOR\")break}if(a)return this.tokens.splice(0,a)},a.prototype.removeMidExpressionNewlines=function(){return this.scanTokens(function(a,b,d){var e;if(a[0]!==\"TERMINATOR\"||!(e=this.tag(b+1),t.call(c,e)>=0))return 1;d.splice(b,1);return 0})},a.prototype.closeOpenCalls=function(){var a,b;b=function(a,b){var c;return(c=a[0])===\")\"||c===\"CALL_END\"||a[0]===\"OUTDENT\"&&this.tag(b-1)===\")\"},a=function(a,b){return this.tokens[a[0]===\"OUTDENT\"?b-1:b][0]=\"CALL_END\"};return this.scanTokens(function(c,d){c[0]===\"CALL_START\"&&this.detectEnd(d+1,b,a);return 1})},a.prototype.closeOpenIndexes=function(){var a,b;b=function(a,b){var c;return(c=a[0])===\"]\"||c===\"INDEX_END\"},a=function(a,b){return a[0]=\"INDEX_END\"};return this.scanTokens(function(c,d){c[0]===\"INDEX_START\"&&this.detectEnd(d+1,b,a);return 1})},a.prototype.addImplicitBraces=function(){var a,b,c,f,g;c=[],f=null,g=0,b=function(a,b){var c,d,e,f,g,h;g=this.tokens.slice(b+1,b+3+1||9e9),c=g[0],f=g[1],e=g[2];if(\"HERECOMMENT\"===(c!=null?c[0]:void 0))return!1;d=a[0];return(d===\"TERMINATOR\"||d===\"OUTDENT\")&&((f!=null?f[0]:void 0)!==\":\"&&((c!=null?c[0]:void 0)!==\"@\"||(e!=null?e[0]:void 0)!==\":\"))||d===\",\"&&c&&((h=c[0])!==\"IDENTIFIER\"&&h!==\"NUMBER\"&&h!==\"STRING\"&&h!==\"@\"&&h!==\"TERMINATOR\"&&h!==\"OUTDENT\")},a=function(a,b){return this.tokens.splice(b,0,[\"}\",\"}\",a[2]])};return this.scanTokens(function(g,h,i){var j,k,l,m,n,o,p;if(o=l=g[0],t.call(e,o)>=0){c.push([l===\"INDENT\"&&this.tag(h-1)===\"{\"?\"{\":l,h]);return 1}if(t.call(d,l)>=0){f=c.pop();return 1}if(l!==\":\"||(j=this.tag(h-2))!==\":\"&&((p=c[c.length-1])!=null?p[0]:void 0)===\"{\")return 1;c.push([\"{\"]),k=j===\"@\"?h-2:h-1;while(this.tag(k-2)===\"HERECOMMENT\")k-=2;n=new String(\"{\"),n.generated=!0,m=[\"{\",n,g[2]],m.generated=!0,i.splice(k,0,m),this.detectEnd(h+2,b,a);return 2})},a.prototype.addImplicitParentheses=function(){var a,b;b=!1,a=function(a,b){var c;c=a[0]===\"OUTDENT\"?b+1:b;return this.tokens.splice(c,0,[\"CALL_END\",\")\",a[2]])};return this.scanTokens(function(c,d,e){var k,m,n,o,p,q,r,s,u;q=c[0];if(q===\"CLASS\"||q===\"IF\")b=!0;r=e.slice(d-1,d+1+1||9e9),o=r[0],m=r[1],n=r[2],k=!b&&q===\"INDENT\"&&n&&n.generated&&n[0]===\"{\"&&o&&(s=o[0],t.call(i,s)>=0),p=!1,t.call(l,q)>=0&&(b=!1),o&&!o.spaced&&q===\"?\"&&(c.call=!0);if(!k&&(!(o!=null?o.spaced:void 0)||!o.call&&!(u=o[0],t.call(i,u)>=0)||t.call(g,q)<0&&(c.spaced||c.newLine||t.call(j,q)<0)))return 1;e.splice(d,0,[\"CALL_START\",\"(\",c[2]]),this.detectEnd(d+1,function(a,b){var c,d;q=a[0];if(!p&&a.fromThen)return!0;if(q===\"IF\"||q===\"ELSE\"||q===\"->\"||q===\"=>\")p=!0;if((q===\".\"||q===\"?.\"||q===\"::\")&&this.tag(b-1)===\"OUTDENT\")return!0;return!a.generated&&this.tag(b-1)!==\",\"&&t.call(h,q)>=0&&(q!==\"INDENT\"||this.tag(b-2)!==\"CLASS\"&&(d=this.tag(b-1),t.call(f,d)<0)&&(!(c=this.tokens[b+1])||!c.generated||c[0]!==\"{\"))},a),o[0]===\"?\"&&(o[0]=\"FUNC_EXIST\");return 2})},a.prototype.addImplicitIndentation=function(){return this.scanTokens(function(a,b,c){var d,e,f,g,h,i,j,k;i=a[0];if(i===\"TERMINATOR\"&&this.tag(b+1)===\"THEN\"){c.splice(b,1);return 0}if(i===\"ELSE\"&&this.tag(b-1)!==\"OUTDENT\"){c.splice.apply(c,[b,0].concat(u.call(this.indentation(a))));return 2}if(i===\"CATCH\"&&((j=this.tag(b+2))===\"OUTDENT\"||j===\"TERMINATOR\"||j===\"FINALLY\")){c.splice.apply(c,[b+2,0].concat(u.call(this.indentation(a))));return 4}if(t.call(n,i)>=0&&this.tag(b+1)!==\"INDENT\"&&(i!==\"ELSE\"||this.tag(b+1)!==\"IF\")){h=i,k=this.indentation(a),f=k[0],g=k[1],h===\"THEN\"&&(f.fromThen=!0),f.generated=g.generated=!0,c.splice(b+1,0,f),e=function(a,b){var c;return a[1]!==\";\"&&(c=a[0],t.call(m,c)>=0)&&(a[0]!==\"ELSE\"||(h===\"IF\"||h===\"THEN\"))},d=function(a,b){return this.tokens.splice(this.tag(b-1)===\",\"?b-1:b,0,g)},this.detectEnd(b+2,e,d),i===\"THEN\"&&c.splice(b,1);return 1}return 1})},a.prototype.tagPostfixConditionals=function(){var a;a=function(a,b){var c;return(c=a[0])===\"TERMINATOR\"||c===\"INDENT\"};return this.scanTokens(function(b,c){var d;if(b[0]!==\"IF\")return 1;d=b,this.detectEnd(c+1,a,function(a,b){if(a[0]!==\"INDENT\")return d[0]=\"POST_\"+d[0]});return 1})},a.prototype.ensureBalance=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;d={},f={},m=this.tokens;for(i=0,k=m.length;i<k;i++){h=m[i],g=h[0];for(j=0,l=a.length;j<l;j++){n=a[j],e=n[0],b=n[1],d[e]|=0;if(g===e)d[e]++===0&&(f[e]=h[2]);else if(g===b&&--d[e]<0)throw Error(\"too many \"+h[1]+\" on line \"+(h[2]+1))}}for(e in d){c=d[e];if(c>0)throw Error(\"unclosed \"+e+\" on line \"+(f[e]+1))}return this},a.prototype.rewriteClosingParens=function(){var a,b,c;c=[],a={};for(b in k)a[b]=0;return this.scanTokens(function(b,f,g){var h,i,j,l,m,n,o;if(o=m=b[0],t.call(e,o)>=0){c.push(b);return 1}if(t.call(d,m)<0)return 1;if(a[h=k[m]]>0){a[h]-=1,g.splice(f,1);return 0}i=c.pop(),j=i[0],l=k[j];if(m===l)return 1;a[j]+=1,n=[l,j===\"INDENT\"?i[1]:l],this.tag(f+2)===j?(g.splice(f+3,0,n),c.push(i)):g.splice(f,0,n);return 1})},a.prototype.indentation=function(a){return[[\"INDENT\",2,a[2]],[\"OUTDENT\",2,a[2]]]},a.prototype.tag=function(a){var b;return(b=this.tokens[a])!=null?b[0]:void 0};return a}(),b=[[\"(\",\")\"],[\"[\",\"]\"],[\"{\",\"}\"],[\"INDENT\",\"OUTDENT\"],[\"CALL_START\",\"CALL_END\"],[\"PARAM_START\",\"PARAM_END\"],[\"INDEX_START\",\"INDEX_END\"]],k={},e=[],d=[];for(q=0,r=b.length;q<r;q++)s=b[q],o=s[0],p=s[1],e.push(k[p]=o),d.push(k[o]=p);c=[\"CATCH\",\"WHEN\",\"ELSE\",\"FINALLY\"].concat(d),i=[\"IDENTIFIER\",\"SUPER\",\")\",\"CALL_END\",\"]\",\"INDEX_END\",\"@\",\"THIS\"],g=[\"IDENTIFIER\",\"NUMBER\",\"STRING\",\"JS\",\"REGEX\",\"NEW\",\"PARAM_START\",\"CLASS\",\"IF\",\"TRY\",\"SWITCH\",\"THIS\",\"BOOL\",\"UNARY\",\"SUPER\",\"@\",\"->\",\"=>\",\"[\",\"(\",\"{\",\"--\",\"++\"],j=[\"+\",\"-\"],f=[\"->\",\"=>\",\"{\",\"[\",\",\"],h=[\"POST_IF\",\"FOR\",\"WHILE\",\"UNTIL\",\"WHEN\",\"BY\",\"LOOP\",\"TERMINATOR\",\"INDENT\"],n=[\"ELSE\",\"->\",\"=>\",\"TRY\",\"FINALLY\",\"THEN\"],m=[\"TERMINATOR\",\"CATCH\",\"FINALLY\",\"ELSE\",\"OUTDENT\",\"LEADING_WHEN\"],l=[\"TERMINATOR\",\"INDENT\",\"OUTDENT\"]}).call(this)},require[\"./lexer\"]=new function(){var a=this;(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]===a)return b;return-1};I=require(\"./rewriter\").Rewriter,T=require(\"./helpers\"),P=T.count,S=T.starts,O=T.compact,Q=T.last,a.Lexer=w=function(){function a(){}a.prototype.tokenize=function(a,b){var c;b==null&&(b={}),N.test(a)&&(a=\"\\n\"+a),a=a.replace(/\\r/g,\"\").replace(L,\"\"),this.code=a,this.line=b.line||0,this.indent=0,this.indebt=0,this.outdebt=0,this.indents=[],this.tokens=[],c=0;while(this.chunk=a.slice(c))c+=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.heredocToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken();this.closeIndentation();if(b.rewrite===!1)return this.tokens;return(new I).rewrite(this.tokens)},a.prototype.identifierToken=function(){var a,b,c,d,e,h,i,j,k;if(!(e=o.exec(this.chunk)))return 0;d=e[0],c=e[1],a=e[2];if(c===\"own\"&&this.tag()===\"FOR\"){this.token(\"OWN\",c);return c.length}b=a||(h=Q(this.tokens))&&!h.spaced&&((j=h[0])===\".\"||j===\"?.\"||j===\"@\"||j===\"::\"),i=\"IDENTIFIER\";if(U.call(s,c)>=0||!b&&U.call(g,c)>=0)i=c.toUpperCase(),i===\"WHEN\"&&(k=this.tag(),U.call(t,k)>=0)?i=\"LEADING_WHEN\":i===\"FOR\"?this.seenFor=!0:i===\"UNLESS\"?i=\"IF\":U.call(M,i)<0?U.call(G,i)>=0&&(i!==\"INSTANCEOF\"&&this.seenFor?(i=\"FOR\"+i,this.seenFor=!1):(i=\"RELATION\",this.value()===\"!\"&&(this.tokens.pop(),c=\"!\"+c))):i=\"UNARY\";U.call(r,c)>=0&&(b?(i=\"IDENTIFIER\",c=new String(c),c.reserved=!0):U.call(H,c)>=0&&this.identifierError(c)),b||(f.hasOwnProperty(c)&&(c=f[c]),i=function(){switch(c){case\"!\":return\"UNARY\";case\"==\":case\"!=\":return\"COMPARE\";case\"&&\":case\"||\":return\"LOGIC\";case\"true\":case\"false\":case\"null\":case\"undefined\":return\"BOOL\";case\"break\":case\"continue\":case\"debugger\":return\"STATEMENT\";default:return i}}()),this.token(i,c),a&&this.token(\":\",\":\");return d.length},a.prototype.numberToken=function(){var a,b;if(!(a=D.exec(this.chunk)))return 0;b=a[0],this.token(\"NUMBER\",b);return b.length},a.prototype.stringToken=function(){var a,b;switch(this.chunk.charAt(0)){case\"'\":if(!(a=K.exec(this.chunk)))return 0;this.token(\"STRING\",(b=a[0]).replace(y,\"\\\\\\n\"));break;case'\"':if(!(b=this.balancedString(this.chunk,'\"')))return 0;0<b.indexOf(\"#{\",1)?this.interpolateString(b.slice(1,-1)):this.token(\"STRING\",this.escapeLines(b));break;default:return 0}this.line+=P(b,\"\\n\");return b.length},a.prototype.heredocToken=function(){var a,b,c,d;if(!(c=k.exec(this.chunk)))return 0;b=c[0],d=b.charAt(0),a=this.sanitizeHeredoc(c[2],{quote:d,indent:null}),d!=='\"'||0>a.indexOf(\"#{\")?this.token(\"STRING\",this.makeString(a,d,!0)):this.interpolateString(a,{heredoc:!0}),this.line+=P(b,\"\\n\");return b.length},a.prototype.commentToken=function(){var a,b,c;if(!(c=this.chunk.match(h)))return 0;a=c[0],b=c[1],this.line+=P(a,\"\\n\"),b&&(this.token(\"HERECOMMENT\",this.sanitizeHeredoc(b,{herecomment:!0,indent:Array(this.indent+1).join(\" \")})),this.token(\"TERMINATOR\",\"\\n\"));return a.length},a.prototype.jsToken=function(){var a,b;if(this.chunk.charAt(0)!==\"`\"||!(a=q.exec(this.chunk)))return 0;this.token(\"JS\",(b=a[0]).slice(1,-1));return b.length},a.prototype.regexToken=function(){var a,b,c,d;if(this.chunk.charAt(0)!==\"/\")return 0;if(a=m.exec(this.chunk))return this.heregexToken(a);b=Q(this.tokens);if(b&&(d=b[0],U.call(b.spaced?A:B,d)>=0))return 0;if(!(a=F.exec(this.chunk)))return 0;c=a[0],this.token(\"REGEX\",c===\"//\"?\"/(?:)/\":c);return c.length},a.prototype.heregexToken=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,o;d=a[0],b=a[1],c=a[2];if(0>b.indexOf(\"#{\")){e=b.replace(n,\"\").replace(/\\//g,\"\\\\/\"),this.token(\"REGEX\",\"/\"+(e||\"(?:)\")+\"/\"+c);return d.length}this.token(\"IDENTIFIER\",\"RegExp\"),this.tokens.push([\"CALL_START\",\"(\"]),g=[],k=this.interpolateString(b,{regex:!0});for(i=0,j=k.length;i<j;i++){l=k[i],f=l[0],h=l[1];if(f===\"TOKENS\")g.push.apply(g,h);else{if(!(h=h.replace(n,\"\")))continue;h=h.replace(/\\\\/g,\"\\\\\\\\\"),g.push([\"STRING\",this.makeString(h,'\"',!0)])}g.push([\"+\",\"+\"])}g.pop(),((m=g[0])!=null?m[0]:void 0)!==\"STRING\"&&this.tokens.push([\"STRING\",'\"\"'],[\"+\",\"+\"]),(o=this.tokens).push.apply(o,g),c&&this.tokens.push([\",\",\",\"],[\"STRING\",'\"'+c+'\"']),this.token(\")\",\")\");return d.length},a.prototype.lineToken=function(){var a,b,c,d,e,f;if(!(c=z.exec(this.chunk)))return 0;b=c[0],this.line+=P(b,\"\\n\"),e=Q(this.tokens,1),f=b.length-1-b.lastIndexOf(\"\\n\"),d=this.unfinished();if(f-this.indebt===this.indent){d?this.suppressNewlines():this.newlineToken();return b.length}if(f>this.indent){if(d){this.indebt=f-this.indent,this.suppressNewlines();return b.length}a=f-this.indent+this.outdebt,this.token(\"INDENT\",a),this.indents.push(a),this.outdebt=this.indebt=0}else this.indebt=0,this.outdentToken(this.indent-f,d);this.indent=f;return b.length},a.prototype.outdentToken=function(a,b,c){var d,e;while(a>0)e=this.indents.length-1,this.indents[e]===void 0?a=0:this.indents[e]===this.outdebt?(a-=this.outdebt,this.outdebt=0):this.indents[e]<this.outdebt?(this.outdebt-=this.indents[e],a-=this.indents[e]):(d=this.indents.pop()-this.outdebt,a-=d,this.outdebt=0,this.token(\"OUTDENT\",d));d&&(this.outdebt-=a),this.tag()!==\"TERMINATOR\"&&!b&&this.token(\"TERMINATOR\",\"\\n\");return this},a.prototype.whitespaceToken=function(){var a,b,c;if(!(a=N.exec(this.chunk))&&!(b=this.chunk.charAt(0)===\"\\n\"))return 0;c=Q(this.tokens),c&&(c[a?\"spaced\":\"newLine\"]=!0);return a?a[0].length:0},a.prototype.newlineToken=function(){this.tag()!==\"TERMINATOR\"&&this.token(\"TERMINATOR\",\"\\n\");return this},a.prototype.suppressNewlines=function(){this.value()===\"\\\\\"&&this.tokens.pop();return this},a.prototype.literalToken=function(){var a,b,c,f,g,h,k,l;(a=E.exec(this.chunk))?(f=a[0],e.test(f)&&this.tagParameters()):f=this.chunk.charAt(0),c=f,b=Q(this.tokens);if(f===\"=\"&&b){!b[1].reserved&&(g=b[1],U.call(r,g)>=0)&&this.assignmentError();if((h=b[1])===\"||\"||h===\"&&\"){b[0]=\"COMPOUND_ASSIGN\",b[1]+=\"=\";return f.length}}if(f===\";\")c=\"TERMINATOR\";else if(U.call(x,f)<0)if(U.call(i,f)<0)if(U.call(j,f)<0)if(U.call(M,f)<0)if(U.call(J,f)<0){if(U.call(v,f)>=0||f===\"?\"&&(b!=null?b.spaced:void 0))c=\"LOGIC\";else if(b&&!b.spaced)if(f===\"(\"&&(k=b[0],U.call(d,k)>=0))b[0]===\"?\"&&(b[0]=\"FUNC_EXIST\"),c=\"CALL_START\";else if(f===\"[\"&&(l=b[0],U.call(p,l)>=0)){c=\"INDEX_START\";switch(b[0]){case\"?\":b[0]=\"INDEX_SOAK\";break;case\"::\":b[0]=\"INDEX_PROTO\"}}}else c=\"SHIFT\";else c=\"UNARY\";else c=\"COMPOUND_ASSIGN\";else c=\"COMPARE\";else c=\"MATH\";this.token(c,f);return f.length},a.prototype.sanitizeHeredoc=function(a,b){var c,d,e,f,g;e=b.indent,d=b.herecomment;if(d&&0>a.indexOf(\"\\n\"))return a;if(!d)while(f=l.exec(a)){c=f[1];if(e===null||0<(g=c.length)&&g<e.length)e=c}e&&(a=a.replace(RegExp(\"\\\\n\"+e,\"g\"),\"\\n\")),d||(a=a.replace(/^\\n/,\"\"));return a},a.prototype.tagParameters=function(){var a,b,c,d;if(this.tag()!==\")\")return this;b=[],d=this.tokens,a=d.length,d[--a][0]=\"PARAM_END\";while(c=d[--a])switch(c[0]){case\")\":b.push(c);break;case\"(\":case\"CALL_START\":if(b.length)b.pop();else{c[0]=\"PARAM_START\";return this}}return this},a.prototype.closeIndentation=function(){return this.outdentToken(this.indent)},a.prototype.identifierError=function(a){throw SyntaxError('Reserved word \"'+a+'\" on line '+(this.line+1))},a.prototype.assignmentError=function(){throw SyntaxError('Reserved word \"'+this.value()+'\" on line '+(this.line+1)+\" can't be assigned\")},a.prototype.balancedString=function(a,b){var c,d,e,f,g;f=[b];for(c=1,g=a.length;1<=g?c<g:c>g;1<=g?c+=1:c-=1){switch(d=a.charAt(c)){case\"\\\\\":c++;continue;case b:f.pop();if(!f.length)return a.slice(0,c+1);b=f[f.length-1];continue}b!==\"}\"||d!=='\"'&&d!==\"'\"?b===\"}\"&&d===\"{\"?f.push(b=\"}\"):b==='\"'&&e===\"#\"&&d===\"{\"&&f.push(b=\"}\"):f.push(b=d),e=d}throw new Error(\"missing \"+f.pop()+\", starting on line \"+(this.line+1))},a.prototype.interpolateString=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;c==null&&(c={}),e=c.heredoc,m=c.regex,o=[],l=0,f=-1;while(j=b.charAt(f+=1)){if(j===\"\\\\\"){f+=1;continue}if(j!==\"#\"||b.charAt(f+1)!==\"{\"||!(d=this.balancedString(b.slice(f+1),\"}\")))continue;l<f&&o.push([\"NEOSTRING\",b.slice(l,f)]),g=d.slice(1,-1);if(g.length){k=(new a).tokenize(g,{line:this.line,rewrite:!1}),k.pop(),((r=k[0])!=null?r[0]:void 0)===\"TERMINATOR\"&&k.shift();if(i=k.length)i>1&&(k.unshift([\"(\",\"(\"]),k.push([\")\",\")\"])),o.push([\"TOKENS\",k])}f+=d.length,l=f+1}f>l&&l<b.length&&o.push([\"NEOSTRING\",b.slice(l)]);if(m)return o;if(!o.length)return this.token(\"STRING\",'\"\"');o[0][0]!==\"NEOSTRING\"&&o.unshift([\"\",\"\"]),(h=o.length>1)&&this.token(\"(\",\"(\");for(f=0,q=o.length;f<q;f++)s=o[f],n=s[0],p=s[1],f&&this.token(\"+\",\"+\"),n===\"TOKENS\"?(t=this.tokens).push.apply(t,p):this.token(\"STRING\",this.makeString(p,'\"',e));h&&this.token(\")\",\")\");return o},a.prototype.token=function(a,b){return this.tokens.push([a,b,this.line])},a.prototype.tag=function(a,b){var c;return(c=Q(this.tokens,a))&&(b?c[0]=b:c[0])},a.prototype.value=function(a,b){var c;return(c=Q(this.tokens,a))&&(b?c[1]=b:c[1])},a.prototype.unfinished=function(){var a,c;return u.test(this.chunk)||(a=Q(this.tokens,1))&&a[0]!==\".\"&&(c=this.value())&&!c.reserved&&C.test(c)&&!e.test(c)&&!b.test(this.chunk)},a.prototype.escapeLines=function(a,b){return a.replace(y,b?\"\\\\n\":\"\")},a.prototype.makeString=function(a,b,c){if(!a)return b+b;a=a.replace(/\\\\([\\s\\S])/g,function(a,c){return c===\"\\n\"||c===b?c:a}),a=a.replace(RegExp(\"\"+b,\"g\"),\"\\\\$&\");return b+this.escapeLines(a,c)+b};return a}(),s=[\"true\",\"false\",\"null\",\"this\",\"new\",\"delete\",\"typeof\",\"in\",\"instanceof\",\"return\",\"throw\",\"break\",\"continue\",\"debugger\",\"if\",\"else\",\"switch\",\"for\",\"while\",\"do\",\"try\",\"catch\",\"finally\",\"class\",\"extends\",\"super\"],g=[\"undefined\",\"then\",\"unless\",\"until\",\"loop\",\"of\",\"by\",\"when\"];for(R in f={and:\"&&\",or:\"||\",is:\"==\",isnt:\"!=\",not:\"!\",yes:\"true\",no:\"false\",on:\"true\",off:\"false\"})g.push(R);H=[\"case\",\"default\",\"function\",\"var\",\"void\",\"with\",\"const\",\"let\",\"enum\",\"export\",\"import\",\"native\",\"__hasProp\",\"__extends\",\"__slice\",\"__bind\",\"__indexOf\"],r=s.concat(H),a.RESERVED=H.concat(s).concat(g),o=/^([$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*)([^\\n\\S]*:(?!:))?/,D=/^0x[\\da-f]+|^(?:\\d+(\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?/i,k=/^(\"\"\"|''')([\\s\\S]*?)(?:\\n[^\\n\\S]*)?\\1/,E=/^(?:[-=]>|[-+*\\/%<>&|^!?=]=|>>>=?|([-+:])\\1|([&|<>])\\2=?|\\?\\.|\\.{2,3})/,N=/^[^\\n\\S]+/,h=/^###([^#][\\s\\S]*?)(?:###[^\\n\\S]*|(?:###)?$)|^(?:\\s*#(?!##[^#]).*)+/,e=/^[-=]>/,z=/^(?:\\n[^\\n\\S]*)+/,K=/^'[^\\\\']*(?:\\\\.[^\\\\']*)*'/,q=/^`[^\\\\`]*(?:\\\\.[^\\\\`]*)*`/,F=/^\\/(?!\\s)[^[\\/\\n\\\\]*(?:(?:\\\\[\\s\\S]|\\[[^\\]\\n\\\\]*(?:\\\\[\\s\\S][^\\]\\n\\\\]*)*])[^[\\/\\n\\\\]*)*\\/[imgy]{0,4}(?!\\w)/,m=/^\\/{3}([\\s\\S]+?)\\/{3}([imgy]{0,4})(?!\\w)/,n=/\\s+(?:#.*)?/g,y=/\\n/g,l=/\\n+([^\\n\\S]*)/g,b=/^\\s*@?([$A-Za-z_][$\\w\\x7f-\\uffff]*|['\"].*['\"])[^\\n\\S]*?[:=][^:=>]/,u=/^\\s*(?:,|\\??\\.(?!\\.)|::)/,L=/\\s+$/,C=/^(?:[-+*&|\\/%=<>!.\\\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/,j=[\"-=\",\"+=\",\"/=\",\"*=\",\"%=\",\"||=\",\"&&=\",\"?=\",\"<<=\",\">>=\",\">>>=\",\"&=\",\"^=\",\"|=\"],M=[\"!\",\"~\",\"NEW\",\"TYPEOF\",\"DELETE\",\"DO\"],v=[\"&&\",\"||\",\"&\",\"|\",\"^\"],J=[\"<<\",\">>\",\">>>\"],i=[\"==\",\"!=\",\"<\",\">\",\"<=\",\">=\"],x=[\"*\",\"/\",\"%\"],G=[\"IN\",\"OF\",\"INSTANCEOF\"],c=[\"TRUE\",\"FALSE\",\"NULL\",\"UNDEFINED\"],A=[\"NUMBER\",\"REGEX\",\"BOOL\",\"++\",\"--\",\"]\"],B=A.concat(\")\",\"}\",\"THIS\",\"IDENTIFIER\",\"STRING\"),d=[\"IDENTIFIER\",\"STRING\",\"REGEX\",\")\",\"]\",\"}\",\"?\",\"::\",\"@\",\"THIS\",\"SUPER\"],p=d.concat(\"NUMBER\",\"BOOL\"),t=[\"INDENT\",\"OUTDENT\",\"TERMINATOR\"]}).call(this)},require[\"./parser\"]=new function(){var a=this,b=function(){var a={trace:function b(){},yy:{},symbols_:{error:2,Root:3,Body:4,Block:5,TERMINATOR:6,Line:7,Expression:8,Statement:9,Return:10,Throw:11,Comment:12,STATEMENT:13,Value:14,Invocation:15,Code:16,Operation:17,Assign:18,If:19,Try:20,While:21,For:22,Switch:23,Class:24,INDENT:25,OUTDENT:26,Identifier:27,IDENTIFIER:28,AlphaNumeric:29,NUMBER:30,STRING:31,Literal:32,JS:33,REGEX:34,BOOL:35,Assignable:36,\"=\":37,AssignObj:38,ObjAssignable:39,\":\":40,ThisProperty:41,RETURN:42,HERECOMMENT:43,PARAM_START:44,ParamList:45,PARAM_END:46,FuncGlyph:47,\"->\":48,\"=>\":49,OptComma:50,\",\":51,Param:52,ParamVar:53,\"...\":54,Array:55,Object:56,Splat:57,SimpleAssignable:58,Accessor:59,Parenthetical:60,Range:61,This:62,\".\":63,\"?.\":64,\"::\":65,Index:66,Slice:67,INDEX_START:68,INDEX_END:69,INDEX_SOAK:70,INDEX_PROTO:71,\"{\":72,AssignList:73,\"}\":74,CLASS:75,EXTENDS:76,OptFuncExist:77,Arguments:78,SUPER:79,FUNC_EXIST:80,CALL_START:81,CALL_END:82,ArgList:83,THIS:84,\"@\":85,\"[\":86,\"]\":87,RangeDots:88,\"..\":89,Arg:90,SimpleArgs:91,TRY:92,Catch:93,FINALLY:94,CATCH:95,THROW:96,\"(\":97,\")\":98,WhileSource:99,WHILE:100,WHEN:101,UNTIL:102,Loop:103,LOOP:104,ForBody:105,FOR:106,ForStart:107,ForSource:108,ForVariables:109,OWN:110,ForValue:111,FORIN:112,FOROF:113,BY:114,SWITCH:115,Whens:116,ELSE:117,When:118,LEADING_WHEN:119,IfBlock:120,IF:121,POST_IF:122,UNARY:123,\"-\":124,\"+\":125,\"--\":126,\"++\":127,\"?\":128,MATH:129,SHIFT:130,COMPARE:131,LOGIC:132,RELATION:133,COMPOUND_ASSIGN:134,$accept:0,$end:1},terminals_:{2:\"error\",6:\"TERMINATOR\",13:\"STATEMENT\",25:\"INDENT\",26:\"OUTDENT\",28:\"IDENTIFIER\",30:\"NUMBER\",31:\"STRING\",33:\"JS\",34:\"REGEX\",35:\"BOOL\",37:\"=\",40:\":\",42:\"RETURN\",43:\"HERECOMMENT\",44:\"PARAM_START\",46:\"PARAM_END\",48:\"->\",49:\"=>\",51:\",\",54:\"...\",63:\".\",64:\"?.\",65:\"::\",68:\"INDEX_START\",69:\"INDEX_END\",70:\"INDEX_SOAK\",71:\"INDEX_PROTO\",72:\"{\",74:\"}\",75:\"CLASS\",76:\"EXTENDS\",79:\"SUPER\",80:\"FUNC_EXIST\",81:\"CALL_START\",82:\"CALL_END\",84:\"THIS\",85:\"@\",86:\"[\",87:\"]\",89:\"..\",92:\"TRY\",94:\"FINALLY\",95:\"CATCH\",96:\"THROW\",97:\"(\",98:\")\",100:\"WHILE\",101:\"WHEN\",102:\"UNTIL\",104:\"LOOP\",106:\"FOR\",110:\"OWN\",112:\"FORIN\",113:\"FOROF\",114:\"BY\",115:\"SWITCH\",117:\"ELSE\",119:\"LEADING_WHEN\",121:\"IF\",122:\"POST_IF\",123:\"UNARY\",124:\"-\",125:\"+\",126:\"--\",127:\"++\",128:\"?\",129:\"MATH\",130:\"SHIFT\",131:\"COMPARE\",132:\"LOGIC\",133:\"RELATION\",134:\"COMPOUND_ASSIGN\"},productions_:[0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[18,3],[18,5],[38,1],[38,3],[38,5],[38,1],[39,1],[39,1],[39,1],[10,2],[10,1],[12,1],[16,5],[16,2],[47,1],[47,1],[50,0],[50,1],[45,0],[45,1],[45,3],[52,1],[52,2],[52,3],[53,1],[53,1],[53,1],[53,1],[57,2],[58,1],[58,2],[58,2],[58,1],[36,1],[36,1],[36,1],[14,1],[14,1],[14,1],[14,1],[14,1],[59,2],[59,2],[59,2],[59,1],[59,1],[59,1],[66,3],[66,2],[66,2],[56,4],[73,0],[73,1],[73,3],[73,4],[73,6],[24,1],[24,2],[24,3],[24,4],[24,2],[24,3],[24,4],[24,5],[15,3],[15,3],[15,1],[15,2],[77,0],[77,1],[78,2],[78,4],[62,1],[62,1],[41,2],[55,2],[55,4],[88,1],[88,1],[61,5],[67,5],[67,4],[67,4],[83,1],[83,3],[83,4],[83,4],[83,6],[90,1],[90,1],[91,1],[91,3],[20,2],[20,3],[20,4],[20,5],[93,3],[11,2],[60,3],[60,5],[99,2],[99,4],[99,2],[99,4],[21,2],[21,2],[21,2],[21,1],[103,2],[103,2],[22,2],[22,2],[22,2],[105,2],[105,2],[107,2],[107,3],[111,1],[111,1],[111,1],[109,1],[109,3],[108,2],[108,2],[108,4],[108,4],[108,4],[108,6],[108,6],[23,5],[23,7],[23,4],[23,6],[116,1],[116,2],[118,3],[118,4],[120,3],[120,5],[19,1],[19,3],[19,3],[19,3],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,5],[17,3]],performAction:function c(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return this.$=new d.Block;case 2:return this.$=f[g];case 3:return this.$=f[g-1];case 4:this.$=d.Block.wrap([f[g]]);break;case 5:this.$=f[g-2].push(f[g]);break;case 6:this.$=f[g-1];break;case 7:this.$=f[g];break;case 8:this.$=f[g];break;case 9:this.$=f[g];break;case 10:this.$=f[g];break;case 11:this.$=f[g];break;case 12:this.$=new d.Literal(f[g]);break;case 13:this.$=f[g];break;case 14:this.$=f[g];break;case 15:this.$=f[g];break;case 16:this.$=f[g];break;case 17:this.$=f[g];break;case 18:this.$=f[g];break;case 19:this.$=f[g];break;case 20:this.$=f[g];break;case 21:this.$=f[g];break;case 22:this.$=f[g];break;case 23:this.$=f[g];break;case 24:this.$=new d.Block;break;case 25:this.$=f[g-1];break;case 26:this.$=new d.Literal(f[g]);break;case 27:this.$=new d.Literal(f[g]);break;case 28:this.$=new d.Literal(f[g]);break;case 29:this.$=f[g];break;case 30:this.$=new d.Literal(f[g]);break;case 31:this.$=new d.Literal(f[g]);break;case 32:this.$=function(){var a;a=new d.Literal(f[g]),f[g]===\"undefined\"&&(a.isUndefined=!0);return a}();break;case 33:this.$=new d.Assign(f[g-2],f[g]);break;case 34:this.$=new d.Assign(f[g-4],f[g-1]);break;case 35:this.$=new d.Value(f[g]);break;case 36:this.$=new d.Assign(new d.Value(f[g-2]),f[g],\"object\");break;case 37:this.$=new d.Assign(new d.Value(f[g-4]),f[g-1],\"object\");break;case 38:this.$=f[g];break;case 39:this.$=f[g];break;case 40:this.$=f[g];break;case 41:this.$=f[g];break;case 42:this.$=new d.Return(f[g]);break;case 43:this.$=new d.Return;break;case 44:this.$=new d.Comment(f[g]);break;case 45:this.$=new d.Code(f[g-3],f[g],f[g-1]);break;case 46:this.$=new d.Code([],f[g],f[g-1]);break;case 47:this.$=\"func\";break;case 48:this.$=\"boundfunc\";break;case 49:this.$=f[g];break;case 50:this.$=f[g];break;case 51:this.$=[];break;case 52:this.$=[f[g]];break;case 53:this.$=f[g-2].concat(f[g]);break;case 54:this.$=new d.Param(f[g]);break;case 55:this.$=new d.Param(f[g-1],null,!0);break;case 56:this.$=new d.Param(f[g-2],f[g]);break;case 57:this.$=f[g];break;case 58:this.$=f[g];break;case 59:this.$=f[g];break;case 60:this.$=f[g];break;case 61:this.$=new d.Splat(f[g-1]);break;case 62:this.$=new d.Value(f[g]);break;case 63:this.$=f[g-1].push(f[g]);break;case 64:this.$=new d.Value(f[g-1],[f[g]]);break;case 65:this.$=f[g];break;case 66:this.$=f[g];break;case 67:this.$=new d.Value(f[g]);break;case 68:this.$=new d.Value(f[g]);break;case 69:this.$=f[g];break;case 70:this.$=new d.Value(f[g]);break;case 71:this.$=new d.Value(f[g]);break;case 72:this.$=new d.Value(f[g]);break;case 73:this.$=f[g];break;case 74:this.$=new d.Access(f[g]);break;case 75:this.$=new d.Access(f[g],\"soak\");break;case 76:this.$=new d.Access(f[g],\"proto\");break;case 77:this.$=new d.Access(new d.Literal(\"prototype\"));break;case 78:this.$=f[g];break;case 79:this.$=new d.Slice(f[g]);break;case 80:this.$=new d.Index(f[g-1]);break;case 81:this.$=d.extend(f[g],{soak:!0});break;case 82:this.$=d.extend(f[g],{proto:!0});break;case 83:this.$=new d.Obj(f[g-2],f[g-3].generated);break;case 84:this.$=[];break;case 85:this.$=[f[g]];break;case 86:this.$=f[g-2].concat(f[g]);break;case 87:this.$=f[g-3].concat(f[g]);break;case 88:this.$=f[g-5].concat(f[g-2]);break;case 89:this.$=new d.Class;break;case 90:this.$=new d.Class(null,null,f[g]);break;case 91:this.$=new d.Class(null,f[g]);break;case 92:this.$=new d.Class(null,f[g-1],f[g]);break;case 93:this.$=new d.Class(f[g]);break;case 94:this.$=new d.Class(f[g-1],null,f[g]);break;case 95:this.$=new d.Class(f[g-2],f[g]);break;case 96:this.$=new d.Class(f[g-3],f[g-1],f[g]);break;case 97:this.$=new d.Call(f[g-2],f[g],f[g-1]);break;case 98:this.$=new d.Call(f[g-2],f[g],f[g-1]);break;case 99:this.$=new d.Call(\"super\",[new d.Splat(new d.Literal(\"arguments\"))]);break;case 100:this.$=new d.Call(\"super\",f[g]);break;case 101:this.$=!1;break;case 102:this.$=!0;break;case 103:this.$=[];break;case 104:this.$=f[g-2];break;case 105:this.$=new d.Value(new d.Literal(\"this\"));break;case 106:this.$=new d.Value(new d.Literal(\"this\"));break;case 107:this.$=new d.Value(new d.Literal(\"this\"),[new d.Access(f[g])],\"this\");break;case 108:this.$=new d.Arr([]);break;case 109:this.$=new d.Arr(f[g-2]);break;case 110:this.$=\"inclusive\";break;case 111:this.$=\"exclusive\";break;case 112:this.$=new d.Range(f[g-3],f[g-1],f[g-2]);break;case 113:this.$=new d.Range(f[g-3],f[g-1],f[g-2]);break;case 114:this.$=new d.Range(f[g-2],null,f[g-1]);break;case 115:this.$=new d.Range(null,f[g-1],f[g-2]);break;case 116:this.$=[f[g]];break;case 117:this.$=f[g-2].concat(f[g]);break;case 118:this.$=f[g-3].concat(f[g]);break;case 119:this.$=f[g-2];break;case 120:this.$=f[g-5].concat(f[g-2]);break;case 121:this.$=f[g];break;case 122:this.$=f[g];break;case 123:this.$=f[g];break;case 124:this.$=[].concat(f[g-2],f[g]);break;case 125:this.$=new d.Try(f[g]);break;case 126:this.$=new d.Try(f[g-1],f[g][0],f[g][1]);break;case 127:this.$=new d.Try(f[g-2],null,null,f[g]);break;case 128:this.$=new d.Try(f[g-3],f[g-2][0],f[g-2][1],f[g]);break;case 129:this.$=[f[g-1],f[g]];break;case 130:this.$=new d.Throw(f[g]);break;case 131:this.$=new d.Parens(f[g-1]);break;case 132:this.$=new d.Parens(f[g-2]);break;case 133:this.$=new d.While(f[g]);break;case 134:this.$=new d.While(f[g-2],{guard:f[g]});break;case 135:this.$=new d.While(f[g],{invert:!0});break;case 136:this.$=new d.While(f[g-2],{invert:!0,guard:f[g]});break;case 137:this.$=f[g-1].addBody(f[g]);break;case 138:this.$=f[g].addBody(d.Block.wrap([f[g-1]]));break;case 139:this.$=f[g].addBody(d.Block.wrap([f[g-1]]));break;case 140:this.$=f[g];break;case 141:this.$=(new d.While(new d.Literal(\"true\"))).addBody(f[g]);break;case 142:this.$=(new d.While(new d.Literal(\"true\"))).addBody(d.Block.wrap([f[g]]));break;case 143:this.$=new d.For(f[g-1],f[g]);break;case 144:this.$=new d.For(f[g-1],f[g]);break;case 145:this.$=new d.For(f[g],f[g-1]);break;case 146:this.$={source:new d.Value(f[g])};break;case 147:this.$=function(){f[g].own=f[g-1].own,f[g].name=f[g-1][0],f[g].index=f[g-1][1];return f[g]}();break;case 148:this.$=f[g];break;case 149:this.$=function(){f[g].own=!0;return f[g]}();break;case 150:this.$=f[g];break;case 151:this.$=new d.Value(f[g]);break;case 152:this.$=new d.Value(f[g]);break;case 153:this.$=[f[g]];break;case 154:this.$=[f[g-2],f[g]];break;case 155:this.$={source:f[g]};break;case 156:this.$={source:f[g],object:!0};break;case 157:this.$={source:f[g-2],guard:f[g]};break;case 158:this.$={source:f[g-2],guard:f[g],object:!0};break;case 159:this.$={source:f[g-2],step:f[g]};break;case 160:this.$={source:f[g-4],guard:f[g-2],step:f[g]};break;case 161:this.$={source:f[g-4],step:f[g-2],guard:f[g]};break;case 162:this.$=new d.Switch(f[g-3],f[g-1]);break;case 163:this.$=new d.Switch(f[g-5],f[g-3],f[g-1]);break;case 164:this.$=new d.Switch(null,f[g-1]);break;case 165:this.$=new d.Switch(null,f[g-3],f[g-1]);break;case 166:this.$=f[g];break;case 167:this.$=f[g-1].concat(f[g]);break;case 168:this.$=[[f[g-1],f[g]]];break;case 169:this.$=[[f[g-2],f[g-1]]];break;case 170:this.$=new d.If(f[g-1],f[g],{type:f[g-2]});break;case 171:this.$=f[g-4].addElse(new d.If(f[g-1],f[g],{type:f[g-2]}));break;case 172:this.$=f[g];break;case 173:this.$=f[g-2].addElse(f[g]);break;case 174:this.$=new d.If(f[g],d.Block.wrap([f[g-2]]),{type:f[g-1],statement:!0});break;case 175:this.$=new d.If(f[g],d.Block.wrap([f[g-2]]),{type:f[g-1],statement:!0});break;case 176:this.$=new d.Op(f[g-1],f[g]);break;case 177:this.$=new d.Op(\"-\",f[g]);break;case 178:this.$=new d.Op(\"+\",f[g]);break;case 179:this.$=new d.Op(\"--\",f[g]);break;case 180:this.$=new d.Op(\"++\",f[g]);break;case 181:this.$=new d.Op(\"--\",f[g-1],null,!0);break;case 182:this.$=new d.Op(\"++\",f[g-1],null,!0);break;case 183:this.$=new d.Existence(f[g-1]);break;case 184:this.$=new d.Op(\"+\",f[g-2],f[g]);break;case 185:this.$=new d.Op(\"-\",f[g-2],f[g]);break;case 186:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 187:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 188:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 189:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 190:this.$=function(){return f[g-1].charAt(0)===\"!\"?(new d.Op(f[g-1].slice(1),f[g-2],f[g])).invert():new d.Op(f[g-1],f[g-2],f[g])}();break;case 191:this.$=new d.Assign(f[g-2],f[g],f[g-1]);break;case 192:this.$=new d.Assign(f[g-4],f[g-1],f[g-3]);break;case 193:this.$=new d.Extends(f[g-2],f[g])}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[3]},{1:[2,2],6:[1,71]},{6:[1,72]},{1:[2,4],6:[2,4],26:[2,4],98:[2,4]},{4:74,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[1,73],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,7],6:[2,7],26:[2,7],98:[2,7],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,8],6:[2,8],26:[2,8],98:[2,8],99:87,100:[1,62],102:[1,63],105:88,106:[1,65],107:66,122:[1,86]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],46:[2,13],51:[2,13],54:[2,13],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,13],70:[1,98],71:[1,99],74:[2,13],77:89,80:[1,91],81:[2,101],82:[2,13],87:[2,13],89:[2,13],98:[2,13],100:[2,13],101:[2,13],102:[2,13],106:[2,13],114:[2,13],122:[2,13],124:[2,13],125:[2,13],128:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],46:[2,14],51:[2,14],54:[2,14],59:101,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,14],70:[1,98],71:[1,99],74:[2,14],77:100,80:[1,91],81:[2,101],82:[2,14],87:[2,14],89:[2,14],98:[2,14],100:[2,14],101:[2,14],102:[2,14],106:[2,14],114:[2,14],122:[2,14],124:[2,14],125:[2,14],128:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],46:[2,15],51:[2,15],54:[2,15],69:[2,15],74:[2,15],82:[2,15],87:[2,15],89:[2,15],98:[2,15],100:[2,15],101:[2,15],102:[2,15],106:[2,15],114:[2,15],122:[2,15],124:[2,15],125:[2,15],128:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],46:[2,16],51:[2,16],54:[2,16],69:[2,16],74:[2,16],82:[2,16],87:[2,16],89:[2,16],98:[2,16],100:[2,16],101:[2,16],102:[2,16],106:[2,16],114:[2,16],122:[2,16],124:[2,16],125:[2,16],128:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],46:[2,17],51:[2,17],54:[2,17],69:[2,17],74:[2,17],82:[2,17],87:[2,17],89:[2,17],98:[2,17],100:[2,17],101:[2,17],102:[2,17],106:[2,17],114:[2,17],122:[2,17],124:[2,17],125:[2,17],128:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],46:[2,18],51:[2,18],54:[2,18],69:[2,18],74:[2,18],82:[2,18],87:[2,18],89:[2,18],98:[2,18],100:[2,18],101:[2,18],102:[2,18],106:[2,18],114:[2,18],122:[2,18],124:[2,18],125:[2,18],128:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],46:[2,19],51:[2,19],54:[2,19],69:[2,19],74:[2,19],82:[2,19],87:[2,19],89:[2,19],98:[2,19],100:[2,19],101:[2,19],102:[2,19],106:[2,19],114:[2,19],122:[2,19],124:[2,19],125:[2,19],128:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],46:[2,20],51:[2,20],54:[2,20],69:[2,20],74:[2,20],82:[2,20],87:[2,20],89:[2,20],98:[2,20],100:[2,20],101:[2,20],102:[2,20],106:[2,20],114:[2,20],122:[2,20],124:[2,20],125:[2,20],128:[2,20],129:[2,20],130:[2,20],131:[2,20],132:[2,20],133:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],46:[2,21],51:[2,21],54:[2,21],69:[2,21],74:[2,21],82:[2,21],87:[2,21],89:[2,21],98:[2,21],100:[2,21],101:[2,21],102:[2,21],106:[2,21],114:[2,21],122:[2,21],124:[2,21],125:[2,21],128:[2,21],129:[2,21],130:[2,21],131:[2,21],132:[2,21],133:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],46:[2,22],51:[2,22],54:[2,22],69:[2,22],74:[2,22],82:[2,22],87:[2,22],89:[2,22],98:[2,22],100:[2,22],101:[2,22],102:[2,22],106:[2,22],114:[2,22],122:[2,22],124:[2,22],125:[2,22],128:[2,22],129:[2,22],130:[2,22],131:[2,22],132:[2,22],133:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],46:[2,23],51:[2,23],54:[2,23],69:[2,23],74:[2,23],82:[2,23],87:[2,23],89:[2,23],98:[2,23],100:[2,23],101:[2,23],102:[2,23],106:[2,23],114:[2,23],122:[2,23],124:[2,23],125:[2,23],128:[2,23],129:[2,23],130:[2,23],131:[2,23],132:[2,23],133:[2,23]},{1:[2,9],6:[2,9],26:[2,9],98:[2,9],100:[2,9],102:[2,9],106:[2,9],122:[2,9]},{1:[2,10],6:[2,10],26:[2,10],98:[2,10],100:[2,10],102:[2,10],106:[2,10],122:[2,10]},{1:[2,11],6:[2,11],26:[2,11],98:[2,11],100:[2,11],102:[2,11],106:[2,11],122:[2,11]},{1:[2,12],6:[2,12],26:[2,12],98:[2,12],100:[2,12],102:[2,12],106:[2,12],122:[2,12]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],37:[1,102],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],68:[2,69],69:[2,69],70:[2,69],71:[2,69],74:[2,69],80:[2,69],81:[2,69],82:[2,69],87:[2,69],89:[2,69],98:[2,69],100:[2,69],101:[2,69],102:[2,69],106:[2,69],114:[2,69],122:[2,69],124:[2,69],125:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],46:[2,70],51:[2,70],54:[2,70],63:[2,70],64:[2,70],65:[2,70],68:[2,70],69:[2,70],70:[2,70],71:[2,70],74:[2,70],80:[2,70],81:[2,70],82:[2,70],87:[2,70],89:[2,70],98:[2,70],100:[2,70],101:[2,70],102:[2,70],106:[2,70],114:[2,70],122:[2,70],124:[2,70],125:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],46:[2,71],51:[2,71],54:[2,71],63:[2,71],64:[2,71],65:[2,71],68:[2,71],69:[2,71],70:[2,71],71:[2,71],74:[2,71],80:[2,71],81:[2,71],82:[2,71],87:[2,71],89:[2,71],98:[2,71],100:[2,71],101:[2,71],102:[2,71],106:[2,71],114:[2,71],122:[2,71],124:[2,71],125:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],46:[2,72],51:[2,72],54:[2,72],63:[2,72],64:[2,72],65:[2,72],68:[2,72],69:[2,72],70:[2,72],71:[2,72],74:[2,72],80:[2,72],81:[2,72],82:[2,72],87:[2,72],89:[2,72],98:[2,72],100:[2,72],101:[2,72],102:[2,72],106:[2,72],114:[2,72],122:[2,72],124:[2,72],125:[2,72],128:[2,72],129:[2,72],130:[2,72],131:[2,72],132:[2,72],133:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],46:[2,73],51:[2,73],54:[2,73],63:[2,73],64:[2,73],65:[2,73],68:[2,73],69:[2,73],70:[2,73],71:[2,73],74:[2,73],80:[2,73],81:[2,73],82:[2,73],87:[2,73],89:[2,73],98:[2,73],100:[2,73],101:[2,73],102:[2,73],106:[2,73],114:[2,73],122:[2,73],124:[2,73],125:[2,73],128:[2,73],129:[2,73],130:[2,73],131:[2,73],132:[2,73],133:[2,73]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],46:[2,99],51:[2,99],54:[2,99],63:[2,99],64:[2,99],65:[2,99],68:[2,99],69:[2,99],70:[2,99],71:[2,99],74:[2,99],78:103,80:[2,99],81:[1,104],82:[2,99],87:[2,99],89:[2,99],98:[2,99],100:[2,99],101:[2,99],102:[2,99],106:[2,99],114:[2,99],122:[2,99],124:[2,99],125:[2,99],128:[2,99],129:[2,99],130:[2,99],131:[2,99],132:[2,99],133:[2,99]},{27:108,28:[1,70],41:109,45:105,46:[2,51],51:[2,51],52:106,53:107,55:110,56:111,72:[1,67],85:[1,112],86:[1,113]},{5:114,25:[1,5]},{8:115,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:117,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:118,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{14:120,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:119,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{14:120,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:123,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],37:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,66],70:[2,66],71:[2,66],74:[2,66],76:[1,127],80:[2,66],81:[2,66],82:[2,66],87:[2,66],89:[2,66],98:[2,66],100:[2,66],101:[2,66],102:[2,66],106:[2,66],114:[2,66],122:[2,66],124:[2,66],125:[2,66],126:[1,124],127:[1,125],128:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[1,126]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],46:[2,172],51:[2,172],54:[2,172],69:[2,172],74:[2,172],82:[2,172],87:[2,172],89:[2,172],98:[2,172],100:[2,172],101:[2,172],102:[2,172],106:[2,172],114:[2,172],117:[1,128],122:[2,172],124:[2,172],125:[2,172],128:[2,172],129:[2,172],130:[2,172],131:[2,172],132:[2,172],133:[2,172]},{5:129,25:[1,5]},{5:130,25:[1,5]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],46:[2,140],51:[2,140],54:[2,140],69:[2,140],74:[2,140],82:[2,140],87:[2,140],89:[2,140],98:[2,140],100:[2,140],101:[2,140],102:[2,140],106:[2,140],114:[2,140],122:[2,140],124:[2,140],125:[2,140],128:[2,140],129:[2,140],130:[2,140],131:[2,140],132:[2,140],133:[2,140]},{5:131,25:[1,5]},{8:132,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,133],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,89],5:134,6:[2,89],14:120,15:121,25:[1,5],26:[2,89],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,46:[2,89],51:[2,89],54:[2,89],55:47,56:48,58:136,60:25,61:26,62:27,69:[2,89],72:[1,67],74:[2,89],76:[1,135],79:[1,28],82:[2,89],84:[1,55],85:[1,56],86:[1,54],87:[2,89],89:[2,89],97:[1,53],98:[2,89],100:[2,89],101:[2,89],102:[2,89],106:[2,89],114:[2,89],122:[2,89],124:[2,89],125:[2,89],128:[2,89],129:[2,89],130:[2,89],131:[2,89],132:[2,89],133:[2,89]},{1:[2,43],6:[2,43],8:137,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[2,43],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],98:[2,43],99:39,100:[2,43],102:[2,43],103:40,104:[1,64],105:41,106:[2,43],107:66,115:[1,42],120:37,121:[1,61],122:[2,43],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:138,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,44],6:[2,44],25:[2,44],26:[2,44],51:[2,44],74:[2,44],98:[2,44],100:[2,44],102:[2,44],106:[2,44],122:[2,44]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],37:[2,67],46:[2,67],51:[2,67],54:[2,67],63:[2,67],64:[2,67],65:[2,67],68:[2,67],69:[2,67],70:[2,67],71:[2,67],74:[2,67],80:[2,67],81:[2,67],82:[2,67],87:[2,67],89:[2,67],98:[2,67],100:[2,67],101:[2,67],102:[2,67],106:[2,67],114:[2,67],122:[2,67],124:[2,67],125:[2,67],128:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],37:[2,68],46:[2,68],51:[2,68],54:[2,68],63:[2,68],64:[2,68],65:[2,68],68:[2,68],69:[2,68],70:[2,68],71:[2,68],74:[2,68],80:[2,68],81:[2,68],82:[2,68],87:[2,68],89:[2,68],98:[2,68],100:[2,68],101:[2,68],102:[2,68],106:[2,68],114:[2,68],122:[2,68],124:[2,68],125:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],46:[2,29],51:[2,29],54:[2,29],63:[2,29],64:[2,29],65:[2,29],68:[2,29],69:[2,29],70:[2,29],71:[2,29],74:[2,29],80:[2,29],81:[2,29],82:[2,29],87:[2,29],89:[2,29],98:[2,29],100:[2,29],101:[2,29],102:[2,29],106:[2,29],114:[2,29],122:[2,29],124:[2,29],125:[2,29],128:[2,29],129:[2,29],130:[2,29],131:[2,29],132:[2,29],133:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],46:[2,30],51:[2,30],54:[2,30],63:[2,30],64:[2,30],65:[2,30],68:[2,30],69:[2,30],70:[2,30],71:[2,30],74:[2,30],80:[2,30],81:[2,30],82:[2,30],87:[2,30],89:[2,30],98:[2,30],100:[2,30],101:[2,30],102:[2,30],106:[2,30],114:[2,30],122:[2,30],124:[2,30],125:[2,30],128:[2,30],129:[2,30],130:[2,30],131:[2,30],132:[2,30],133:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],46:[2,31],51:[2,31],54:[2,31],63:[2,31],64:[2,31],65:[2,31],68:[2,31],69:[2,31],70:[2,31],71:[2,31],74:[2,31],80:[2,31],81:[2,31],82:[2,31],87:[2,31],89:[2,31],98:[2,31],100:[2,31],101:[2,31],102:[2,31],106:[2,31],114:[2,31],122:[2,31],124:[2,31],125:[2,31],128:[2,31],129:[2,31],130:[2,31],131:[2,31],132:[2,31],133:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],46:[2,32],51:[2,32],54:[2,32],63:[2,32],64:[2,32],65:[2,32],68:[2,32],69:[2,32],70:[2,32],71:[2,32],74:[2,32],80:[2,32],81:[2,32],82:[2,32],87:[2,32],89:[2,32],98:[2,32],100:[2,32],101:[2,32],102:[2,32],106:[2,32],114:[2,32],122:[2,32],124:[2,32],125:[2,32],128:[2,32],129:[2,32],130:[2,32],131:[2,32],132:[2,32],133:[2,32]},{4:139,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,140],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:141,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:143,84:[1,55],85:[1,56],86:[1,54],87:[1,142],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],46:[2,105],51:[2,105],54:[2,105],63:[2,105],64:[2,105],65:[2,105],68:[2,105],69:[2,105],70:[2,105],71:[2,105],74:[2,105],80:[2,105],81:[2,105],82:[2,105],87:[2,105],89:[2,105],98:[2,105],100:[2,105],101:[2,105],102:[2,105],106:[2,105],114:[2,105],122:[2,105],124:[2,105],125:[2,105],128:[2,105],129:[2,105],130:[2,105],131:[2,105],132:[2,105],133:[2,105]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],27:147,28:[1,70],46:[2,106],51:[2,106],54:[2,106],63:[2,106],64:[2,106],65:[2,106],68:[2,106],69:[2,106],70:[2,106],71:[2,106],74:[2,106],80:[2,106],81:[2,106],82:[2,106],87:[2,106],89:[2,106],98:[2,106],100:[2,106],101:[2,106],102:[2,106],106:[2,106],114:[2,106],122:[2,106],124:[2,106],125:[2,106],128:[2,106],129:[2,106],130:[2,106],131:[2,106],132:[2,106],133:[2,106]},{25:[2,47]},{25:[2,48]},{1:[2,62],6:[2,62],25:[2,62],26:[2,62],37:[2,62],46:[2,62],51:[2,62],54:[2,62],63:[2,62],64:[2,62],65:[2,62],68:[2,62],69:[2,62],70:[2,62],71:[2,62],74:[2,62],76:[2,62],80:[2,62],81:[2,62],82:[2,62],87:[2,62],89:[2,62],98:[2,62],100:[2,62],101:[2,62],102:[2,62],106:[2,62],114:[2,62],122:[2,62],124:[2,62],125:[2,62],126:[2,62],127:[2,62],128:[2,62],129:[2,62],130:[2,62],131:[2,62],132:[2,62],133:[2,62],134:[2,62]},{1:[2,65],6:[2,65],25:[2,65],26:[2,65],37:[2,65],46:[2,65],51:[2,65],54:[2,65],63:[2,65],64:[2,65],65:[2,65],68:[2,65],69:[2,65],70:[2,65],71:[2,65],74:[2,65],76:[2,65],80:[2,65],81:[2,65],82:[2,65],87:[2,65],89:[2,65],98:[2,65],100:[2,65],101:[2,65],102:[2,65],106:[2,65],114:[2,65],122:[2,65],124:[2,65],125:[2,65],126:[2,65],127:[2,65],128:[2,65],129:[2,65],130:[2,65],131:[2,65],132:[2,65],133:[2,65],134:[2,65]},{8:148,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:149,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:150,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{5:151,8:152,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{27:157,28:[1,70],55:158,56:159,61:153,72:[1,67],86:[1,54],109:154,110:[1,155],111:156},{108:160,112:[1,161],113:[1,162]},{6:[2,84],12:166,25:[2,84],27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:164,39:165,41:169,43:[1,46],51:[2,84],73:163,74:[2,84],85:[1,112]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],40:[2,27],46:[2,27],51:[2,27],54:[2,27],63:[2,27],64:[2,27],65:[2,27],68:[2,27],69:[2,27],70:[2,27],71:[2,27],74:[2,27],80:[2,27],81:[2,27],82:[2,27],87:[2,27],89:[2,27],98:[2,27],100:[2,27],101:[2,27],102:[2,27],106:[2,27],114:[2,27],122:[2,27],124:[2,27],125:[2,27],128:[2,27],129:[2,27],130:[2,27],131:[2,27],132:[2,27],133:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],40:[2,28],46:[2,28],51:[2,28],54:[2,28],63:[2,28],64:[2,28],65:[2,28],68:[2,28],69:[2,28],70:[2,28],71:[2,28],74:[2,28],80:[2,28],81:[2,28],82:[2,28],87:[2,28],89:[2,28],98:[2,28],100:[2,28],101:[2,28],102:[2,28],106:[2,28],114:[2,28],122:[2,28],124:[2,28],125:[2,28],128:[2,28],129:[2,28],130:[2,28],131:[2,28],132:[2,28],133:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],37:[2,26],40:[2,26],46:[2,26],51:[2,26],54:[2,26],63:[2,26],64:[2,26],65:[2,26],68:[2,26],69:[2,26],70:[2,26],71:[2,26],74:[2,26],76:[2,26],80:[2,26],81:[2,26],82:[2,26],87:[2,26],89:[2,26],98:[2,26],100:[2,26],101:[2,26],102:[2,26],106:[2,26],112:[2,26],113:[2,26],114:[2,26],122:[2,26],124:[2,26],125:[2,26],126:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26]},{1:[2,6],6:[2,6],7:170,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[2,6],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],98:[2,6],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],46:[2,24],51:[2,24],54:[2,24],69:[2,24],74:[2,24],82:[2,24],87:[2,24],89:[2,24],94:[2,24],95:[2,24],98:[2,24],100:[2,24],101:[2,24],102:[2,24],106:[2,24],114:[2,24],117:[2,24],119:[2,24],122:[2,24],124:[2,24],125:[2,24],128:[2,24],129:[2,24],130:[2,24],131:[2,24],132:[2,24],133:[2,24]},{6:[1,71],26:[1,171]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],46:[2,183],51:[2,183],54:[2,183],69:[2,183],74:[2,183],82:[2,183],87:[2,183],89:[2,183],98:[2,183],100:[2,183],101:[2,183],102:[2,183],106:[2,183],114:[2,183],122:[2,183],124:[2,183],125:[2,183],128:[2,183],129:[2,183],130:[2,183],131:[2,183],132:[2,183],133:[2,183]},{8:172,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:173,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:174,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:175,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:176,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:177,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:178,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:179,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],46:[2,139],51:[2,139],54:[2,139],69:[2,139],74:[2,139],82:[2,139],87:[2,139],89:[2,139],98:[2,139],100:[2,139],101:[2,139],102:[2,139],106:[2,139],114:[2,139],122:[2,139],124:[2,139],125:[2,139],128:[2,139],129:[2,139],130:[2,139],131:[2,139],132:[2,139],133:[2,139]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],46:[2,144],51:[2,144],54:[2,144],69:[2,144],74:[2,144],82:[2,144],87:[2,144],89:[2,144],98:[2,144],100:[2,144],101:[2,144],102:[2,144],106:[2,144],114:[2,144],122:[2,144],124:[2,144],125:[2,144],128:[2,144],129:[2,144],130:[2,144],131:[2,144],132:[2,144],133:[2,144]},{8:180,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],46:[2,138],51:[2,138],54:[2,138],69:[2,138],74:[2,138],82:[2,138],87:[2,138],89:[2,138],98:[2,138],100:[2,138],101:[2,138],102:[2,138],106:[2,138],114:[2,138],122:[2,138],124:[2,138],125:[2,138],128:[2,138],129:[2,138],130:[2,138],131:[2,138],132:[2,138],133:[2,138]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],46:[2,143],51:[2,143],54:[2,143],69:[2,143],74:[2,143],82:[2,143],87:[2,143],89:[2,143],98:[2,143],100:[2,143],101:[2,143],102:[2,143],106:[2,143],114:[2,143],122:[2,143],124:[2,143],125:[2,143],128:[2,143],129:[2,143],130:[2,143],131:[2,143],132:[2,143],133:[2,143]},{78:181,81:[1,104]},{1:[2,63],6:[2,63],25:[2,63],26:[2,63],37:[2,63],46:[2,63],51:[2,63],54:[2,63],63:[2,63],64:[2,63],65:[2,63],68:[2,63],69:[2,63],70:[2,63],71:[2,63],74:[2,63],76:[2,63],80:[2,63],81:[2,63],82:[2,63],87:[2,63],89:[2,63],98:[2,63],100:[2,63],101:[2,63],102:[2,63],106:[2,63],114:[2,63],122:[2,63],124:[2,63],125:[2,63],126:[2,63],127:[2,63],128:[2,63],129:[2,63],130:[2,63],131:[2,63],132:[2,63],133:[2,63],134:[2,63]},{81:[2,102]},{27:182,28:[1,70]},{27:183,28:[1,70]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],27:184,28:[1,70],37:[2,77],46:[2,77],51:[2,77],54:[2,77],63:[2,77],64:[2,77],65:[2,77],68:[2,77],69:[2,77],70:[2,77],71:[2,77],74:[2,77],76:[2,77],80:[2,77],81:[2,77],82:[2,77],87:[2,77],89:[2,77],98:[2,77],100:[2,77],101:[2,77],102:[2,77],106:[2,77],114:[2,77],122:[2,77],124:[2,77],125:[2,77],126:[2,77],127:[2,77],128:[2,77],129:[2,77],130:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],37:[2,78],46:[2,78],51:[2,78],54:[2,78],63:[2,78],64:[2,78],65:[2,78],68:[2,78],69:[2,78],70:[2,78],71:[2,78],74:[2,78],76:[2,78],80:[2,78],81:[2,78],82:[2,78],87:[2,78],89:[2,78],98:[2,78],100:[2,78],101:[2,78],102:[2,78],106:[2,78],114:[2,78],122:[2,78],124:[2,78],125:[2,78],126:[2,78],127:[2,78],128:[2,78],129:[2,78],130:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],37:[2,79],46:[2,79],51:[2,79],54:[2,79],63:[2,79],64:[2,79],65:[2,79],68:[2,79],69:[2,79],70:[2,79],71:[2,79],74:[2,79],76:[2,79],80:[2,79],81:[2,79],82:[2,79],87:[2,79],89:[2,79],98:[2,79],100:[2,79],101:[2,79],102:[2,79],106:[2,79],114:[2,79],122:[2,79],124:[2,79],125:[2,79],126:[2,79],127:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79]},{8:185,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],54:[1,188],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],88:186,89:[1,187],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{66:189,68:[1,190],70:[1,98],71:[1,99]},{66:191,68:[1,190],70:[1,98],71:[1,99]},{78:192,81:[1,104]},{1:[2,64],6:[2,64],25:[2,64],26:[2,64],37:[2,64],46:[2,64],51:[2,64],54:[2,64],63:[2,64],64:[2,64],65:[2,64],68:[2,64],69:[2,64],70:[2,64],71:[2,64],74:[2,64],76:[2,64],80:[2,64],81:[2,64],82:[2,64],87:[2,64],89:[2,64],98:[2,64],100:[2,64],101:[2,64],102:[2,64],106:[2,64],114:[2,64],122:[2,64],124:[2,64],125:[2,64],126:[2,64],127:[2,64],128:[2,64],129:[2,64],130:[2,64],131:[2,64],132:[2,64],133:[2,64],134:[2,64]},{8:193,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,194],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],46:[2,100],51:[2,100],54:[2,100],63:[2,100],64:[2,100],65:[2,100],68:[2,100],69:[2,100],70:[2,100],71:[2,100],74:[2,100],80:[2,100],81:[2,100],82:[2,100],87:[2,100],89:[2,100],98:[2,100],100:[2,100],101:[2,100],102:[2,100],106:[2,100],114:[2,100],122:[2,100],124:[2,100],125:[2,100],128:[2,100],129:[2,100],130:[2,100],131:[2,100],132:[2,100],133:[2,100]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],82:[1,195],83:196,84:[1,55],85:[1,56],86:[1,54],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{46:[1,198],51:[1,199]},{46:[2,52],51:[2,52]},{37:[1,201],46:[2,54],51:[2,54],54:[1,200]},{37:[2,57],46:[2,57],51:[2,57],54:[2,57]},{37:[2,58],46:[2,58],51:[2,58],54:[2,58]},{37:[2,59],46:[2,59],51:[2,59],54:[2,59]},{37:[2,60],46:[2,60],51:[2,60],54:[2,60]},{27:147,28:[1,70]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:143,84:[1,55],85:[1,56],86:[1,54],87:[1,142],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,46],6:[2,46],25:[2,46],26:[2,46],46:[2,46],51:[2,46],54:[2,46],69:[2,46],74:[2,46],82:[2,46],87:[2,46],89:[2,46],98:[2,46],100:[2,46],101:[2,46],102:[2,46],106:[2,46],114:[2,46],122:[2,46],124:[2,46],125:[2,46],128:[2,46],129:[2,46],130:[2,46],131:[2,46],132:[2,46],133:[2,46]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],46:[2,176],51:[2,176],54:[2,176],69:[2,176],74:[2,176],82:[2,176],87:[2,176],89:[2,176],98:[2,176],99:84,100:[2,176],101:[2,176],102:[2,176],105:85,106:[2,176],107:66,114:[2,176],122:[2,176],124:[2,176],125:[2,176],128:[1,75],129:[2,176],130:[2,176],131:[2,176],132:[2,176],133:[2,176]},{99:87,100:[1,62],102:[1,63],105:88,106:[1,65],107:66,122:[1,86]},{1:[2,177],6:[2,177],25:[2,177],26:[2,177],46:[2,177],51:[2,177],54:[2,177],69:[2,177],74:[2,177],82:[2,177],87:[2,177],89:[2,177],98:[2,177],99:84,100:[2,177],101:[2,177],102:[2,177],105:85,106:[2,177],107:66,114:[2,177],122:[2,177],124:[2,177],125:[2,177],128:[1,75],129:[2,177],130:[2,177],131:[2,177],132:[2,177],133:[2,177]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],46:[2,178],51:[2,178],54:[2,178],69:[2,178],74:[2,178],82:[2,178],87:[2,178],89:[2,178],98:[2,178],99:84,100:[2,178],101:[2,178],102:[2,178],105:85,106:[2,178],107:66,114:[2,178],122:[2,178],124:[2,178],125:[2,178],128:[1,75],129:[2,178],130:[2,178],131:[2,178],132:[2,178],133:[2,178]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],46:[2,179],51:[2,179],54:[2,179],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,179],70:[2,66],71:[2,66],74:[2,179],80:[2,66],81:[2,66],82:[2,179],87:[2,179],89:[2,179],98:[2,179],100:[2,179],101:[2,179],102:[2,179],106:[2,179],114:[2,179],122:[2,179],124:[2,179],125:[2,179],128:[2,179],129:[2,179],130:[2,179],131:[2,179],132:[2,179],133:[2,179]},{59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],70:[1,98],71:[1,99],77:89,80:[1,91],81:[2,101]},{59:101,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],70:[1,98],71:[1,99],77:100,80:[1,91],81:[2,101]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],68:[2,69],69:[2,69],70:[2,69],71:[2,69],74:[2,69],80:[2,69],81:[2,69],82:[2,69],87:[2,69],89:[2,69],98:[2,69],100:[2,69],101:[2,69],102:[2,69],106:[2,69],114:[2,69],122:[2,69],124:[2,69],125:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],46:[2,180],51:[2,180],54:[2,180],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,180],70:[2,66],71:[2,66],74:[2,180],80:[2,66],81:[2,66],82:[2,180],87:[2,180],89:[2,180],98:[2,180],100:[2,180],101:[2,180],102:[2,180],106:[2,180],114:[2,180],122:[2,180],124:[2,180],125:[2,180],128:[2,180],129:[2,180],130:[2,180],131:[2,180],132:[2,180],133:[2,180]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],46:[2,181],51:[2,181],54:[2,181],69:[2,181],74:[2,181],82:[2,181],87:[2,181],89:[2,181],98:[2,181],100:[2,181],101:[2,181],102:[2,181],106:[2,181],114:[2,181],122:[2,181],124:[2,181],125:[2,181],128:[2,181],129:[2,181],130:[2,181],131:[2,181],132:[2,181],133:[2,181]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],46:[2,182],51:[2,182],54:[2,182],69:[2,182],74:[2,182],82:[2,182],87:[2,182],89:[2,182],98:[2,182],100:[2,182],101:[2,182],102:[2,182],106:[2,182],114:[2,182],122:[2,182],124:[2,182],125:[2,182],128:[2,182],129:[2,182],130:[2,182],131:[2,182],132:[2,182],133:[2,182]},{8:202,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,203],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:204,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{5:205,25:[1,5],121:[1,206]},{1:[2,125],6:[2,125],25:[2,125],26:[2,125],46:[2,125],51:[2,125],54:[2,125],69:[2,125],74:[2,125],82:[2,125],87:[2,125],89:[2,125],93:207,94:[1,208],95:[1,209],98:[2,125],100:[2,125],101:[2,125],102:[2,125],106:[2,125],114:[2,125],122:[2,125],124:[2,125],125:[2,125],128:[2,125],129:[2,125],130:[2,125],131:[2,125],132:[2,125],133:[2,125]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],46:[2,137],51:[2,137],54:[2,137],69:[2,137],74:[2,137],82:[2,137],87:[2,137],89:[2,137],98:[2,137],100:[2,137],101:[2,137],102:[2,137],106:[2,137],114:[2,137],122:[2,137],124:[2,137],125:[2,137],128:[2,137],129:[2,137],130:[2,137],131:[2,137],132:[2,137],133:[2,137]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],46:[2,145],51:[2,145],54:[2,145],69:[2,145],74:[2,145],82:[2,145],87:[2,145],89:[2,145],98:[2,145],100:[2,145],101:[2,145],102:[2,145],106:[2,145],114:[2,145],122:[2,145],124:[2,145],125:[2,145],128:[2,145],129:[2,145],130:[2,145],131:[2,145],132:[2,145],133:[2,145]},{25:[1,210],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{116:211,118:212,119:[1,213]},{1:[2,90],6:[2,90],25:[2,90],26:[2,90],46:[2,90],51:[2,90],54:[2,90],69:[2,90],74:[2,90],82:[2,90],87:[2,90],89:[2,90],98:[2,90],100:[2,90],101:[2,90],102:[2,90],106:[2,90],114:[2,90],122:[2,90],124:[2,90],125:[2,90],128:[2,90],129:[2,90],130:[2,90],131:[2,90],132:[2,90],133:[2,90]},{14:214,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:215,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{1:[2,93],5:216,6:[2,93],25:[1,5],26:[2,93],46:[2,93],51:[2,93],54:[2,93],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,93],70:[2,66],71:[2,66],74:[2,93],76:[1,217],80:[2,66],81:[2,66],82:[2,93],87:[2,93],89:[2,93],98:[2,93],100:[2,93],101:[2,93],102:[2,93],106:[2,93],114:[2,93],122:[2,93],124:[2,93],125:[2,93],128:[2,93],129:[2,93],130:[2,93],131:[2,93],132:[2,93],133:[2,93]},{1:[2,42],6:[2,42],26:[2,42],98:[2,42],99:84,100:[2,42],102:[2,42],105:85,106:[2,42],107:66,122:[2,42],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,130],6:[2,130],26:[2,130],98:[2,130],99:84,100:[2,130],102:[2,130],105:85,106:[2,130],107:66,122:[2,130],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,71],98:[1,218]},{4:219,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,121],25:[2,121],51:[2,121],54:[1,221],87:[2,121],88:220,89:[1,187],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,108],6:[2,108],25:[2,108],26:[2,108],37:[2,108],46:[2,108],51:[2,108],54:[2,108],63:[2,108],64:[2,108],65:[2,108],68:[2,108],69:[2,108],70:[2,108],71:[2,108],74:[2,108],80:[2,108],81:[2,108],82:[2,108],87:[2,108],89:[2,108],98:[2,108],100:[2,108],101:[2,108],102:[2,108],106:[2,108],112:[2,108],113:[2,108],114:[2,108],122:[2,108],124:[2,108],125:[2,108],128:[2,108],129:[2,108],130:[2,108],131:[2,108],132:[2,108],133:[2,108]},{6:[2,49],25:[2,49],50:222,51:[1,223],87:[2,49]},{6:[2,116],25:[2,116],26:[2,116],51:[2,116],82:[2,116],87:[2,116]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:224,84:[1,55],85:[1,56],86:[1,54],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,122],25:[2,122],26:[2,122],51:[2,122],82:[2,122],87:[2,122]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],37:[2,107],40:[2,107],46:[2,107],51:[2,107],54:[2,107],63:[2,107],64:[2,107],65:[2,107],68:[2,107],69:[2,107],70:[2,107],71:[2,107],74:[2,107],76:[2,107],80:[2,107],81:[2,107],82:[2,107],87:[2,107],89:[2,107],98:[2,107],100:[2,107],101:[2,107],102:[2,107],106:[2,107],114:[2,107],122:[2,107],124:[2,107],125:[2,107],126:[2,107],127:[2,107],128:[2,107],129:[2,107],130:[2,107],131:[2,107],132:[2,107],133:[2,107],134:[2,107]},{5:225,25:[1,5],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],46:[2,133],51:[2,133],54:[2,133],69:[2,133],74:[2,133],82:[2,133],87:[2,133],89:[2,133],98:[2,133],99:84,100:[1,62],101:[1,226],102:[1,63],105:85,106:[1,65],107:66,114:[2,133],122:[2,133],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],46:[2,135],51:[2,135],54:[2,135],69:[2,135],74:[2,135],82:[2,135],87:[2,135],89:[2,135],98:[2,135],99:84,100:[1,62],101:[1,227],102:[1,63],105:85,106:[1,65],107:66,114:[2,135],122:[2,135],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],46:[2,141],51:[2,141],54:[2,141],69:[2,141],74:[2,141],82:[2,141],87:[2,141],89:[2,141],98:[2,141],100:[2,141],101:[2,141],102:[2,141],106:[2,141],114:[2,141],122:[2,141],124:[2,141],125:[2,141],128:[2,141],129:[2,141],130:[2,141],131:[2,141],132:[2,141],133:[2,141]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],46:[2,142],51:[2,142],54:[2,142],69:[2,142],74:[2,142],82:[2,142],87:[2,142],89:[2,142],98:[2,142],99:84,100:[1,62],101:[2,142],102:[1,63],105:85,106:[1,65],107:66,114:[2,142],122:[2,142],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],46:[2,146],51:[2,146],54:[2,146],69:[2,146],74:[2,146],82:[2,146],87:[2,146],89:[2,146],98:[2,146],100:[2,146],101:[2,146],102:[2,146],106:[2,146],114:[2,146],122:[2,146],124:[2,146],125:[2,146],128:[2,146],129:[2,146],130:[2,146],131:[2,146],132:[2,146],133:[2,146]},{112:[2,148],113:[2,148]},{27:157,28:[1,70],55:158,56:159,72:[1,67],86:[1,113],109:228,111:156},{51:[1,229],112:[2,153],113:[2,153]},{51:[2,150],112:[2,150],113:[2,150]},{51:[2,151],112:[2,151],113:[2,151]},{51:[2,152],112:[2,152],113:[2,152]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],46:[2,147],51:[2,147],54:[2,147],69:[2,147],74:[2,147],82:[2,147],87:[2,147],89:[2,147],98:[2,147],100:[2,147],101:[2,147],102:[2,147],106:[2,147],114:[2,147],122:[2,147],124:[2,147],125:[2,147],128:[2,147],129:[2,147],130:[2,147],131:[2,147],132:[2,147],133:[2,147]},{8:230,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:231,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,49],25:[2,49],50:232,51:[1,233],74:[2,49]},{6:[2,85],25:[2,85],26:[2,85],51:[2,85],74:[2,85]},{6:[2,35],25:[2,35],26:[2,35],40:[1,234],51:[2,35],74:[2,35]},{6:[2,38],25:[2,38],26:[2,38],51:[2,38],74:[2,38]},{6:[2,39],25:[2,39],26:[2,39],40:[2,39],51:[2,39],74:[2,39]},{6:[2,40],25:[2,40],26:[2,40],40:[2,40],51:[2,40],74:[2,40]},{6:[2,41],25:[2,41],26:[2,41],40:[2,41],51:[2,41],74:[2,41]},{1:[2,5],6:[2,5],26:[2,5],98:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],46:[2,25],51:[2,25],54:[2,25],69:[2,25],74:[2,25],82:[2,25],87:[2,25],89:[2,25],94:[2,25],95:[2,25],98:[2,25],100:[2,25],101:[2,25],102:[2,25],106:[2,25],114:[2,25],117:[2,25],119:[2,25],122:[2,25],124:[2,25],125:[2,25],128:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],46:[2,184],51:[2,184],54:[2,184],69:[2,184],74:[2,184],82:[2,184],87:[2,184],89:[2,184],98:[2,184],99:84,100:[2,184],101:[2,184],102:[2,184],105:85,106:[2,184],107:66,114:[2,184],122:[2,184],124:[2,184],125:[2,184],128:[1,75],129:[1,78],130:[2,184],131:[2,184],132:[2,184],133:[2,184]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],46:[2,185],51:[2,185],54:[2,185],69:[2,185],74:[2,185],82:[2,185],87:[2,185],89:[2,185],98:[2,185],99:84,100:[2,185],101:[2,185],102:[2,185],105:85,106:[2,185],107:66,114:[2,185],122:[2,185],124:[2,185],125:[2,185],128:[1,75],129:[1,78],130:[2,185],131:[2,185],132:[2,185],133:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],46:[2,186],51:[2,186],54:[2,186],69:[2,186],74:[2,186],82:[2,186],87:[2,186],89:[2,186],98:[2,186],99:84,100:[2,186],101:[2,186],102:[2,186],105:85,106:[2,186],107:66,114:[2,186],122:[2,186],124:[2,186],125:[2,186],128:[1,75],129:[2,186],130:[2,186],131:[2,186],132:[2,186],133:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],46:[2,187],51:[2,187],54:[2,187],69:[2,187],74:[2,187],82:[2,187],87:[2,187],89:[2,187],98:[2,187],99:84,100:[2,187],101:[2,187],102:[2,187],105:85,106:[2,187],107:66,114:[2,187],122:[2,187],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[2,187],131:[2,187],132:[2,187],133:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],46:[2,188],51:[2,188],54:[2,188],69:[2,188],74:[2,188],82:[2,188],87:[2,188],89:[2,188],98:[2,188],99:84,100:[2,188],101:[2,188],102:[2,188],105:85,106:[2,188],107:66,114:[2,188],122:[2,188],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[2,188],132:[2,188],133:[1,82]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],46:[2,189],51:[2,189],54:[2,189],69:[2,189],74:[2,189],82:[2,189],87:[2,189],89:[2,189],98:[2,189],99:84,100:[2,189],101:[2,189],102:[2,189],105:85,106:[2,189],107:66,114:[2,189],122:[2,189],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[2,189],133:[1,82]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],46:[2,190],51:[2,190],54:[2,190],69:[2,190],74:[2,190],82:[2,190],87:[2,190],89:[2,190],98:[2,190],99:84,100:[2,190],101:[2,190],102:[2,190],105:85,106:[2,190],107:66,114:[2,190],122:[2,190],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[2,190],132:[2,190],133:[2,190]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],46:[2,175],51:[2,175],54:[2,175],69:[2,175],74:[2,175],82:[2,175],87:[2,175],89:[2,175],98:[2,175],99:84,100:[1,62],101:[2,175],102:[1,63],105:85,106:[1,65],107:66,114:[2,175],122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],46:[2,174],51:[2,174],54:[2,174],69:[2,174],74:[2,174],82:[2,174],87:[2,174],89:[2,174],98:[2,174],99:84,100:[1,62],101:[2,174],102:[1,63],105:85,106:[1,65],107:66,114:[2,174],122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,97],6:[2,97],25:[2,97],26:[2,97],46:[2,97],51:[2,97],54:[2,97],63:[2,97],64:[2,97],65:[2,97],68:[2,97],69:[2,97],70:[2,97],71:[2,97],74:[2,97],80:[2,97],81:[2,97],82:[2,97],87:[2,97],89:[2,97],98:[2,97],100:[2,97],101:[2,97],102:[2,97],106:[2,97],114:[2,97],122:[2,97],124:[2,97],125:[2,97],128:[2,97],129:[2,97],130:[2,97],131:[2,97],132:[2,97],133:[2,97]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],37:[2,74],46:[2,74],51:[2,74],54:[2,74],63:[2,74],64:[2,74],65:[2,74],68:[2,74],69:[2,74],70:[2,74],71:[2,74],74:[2,74],76:[2,74],80:[2,74],81:[2,74],82:[2,74],87:[2,74],89:[2,74],98:[2,74],100:[2,74],101:[2,74],102:[2,74],106:[2,74],114:[2,74],122:[2,74],124:[2,74],125:[2,74],126:[2,74],127:[2,74],128:[2,74],129:[2,74],130:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],37:[2,75],46:[2,75],51:[2,75],54:[2,75],63:[2,75],64:[2,75],65:[2,75],68:[2,75],69:[2,75],70:[2,75],71:[2,75],74:[2,75],76:[2,75],80:[2,75],81:[2,75],82:[2,75],87:[2,75],89:[2,75],98:[2,75],100:[2,75],101:[2,75],102:[2,75],106:[2,75],114:[2,75],122:[2,75],124:[2,75],125:[2,75],126:[2,75],127:[2,75],128:[2,75],129:[2,75],130:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],37:[2,76],46:[2,76],51:[2,76],54:[2,76],63:[2,76],64:[2,76],65:[2,76],68:[2,76],69:[2,76],70:[2,76],71:[2,76],74:[2,76],76:[2,76],80:[2,76],81:[2,76],82:[2,76],87:[2,76],89:[2,76],98:[2,76],100:[2,76],101:[2,76],102:[2,76],106:[2,76],114:[2,76],122:[2,76],124:[2,76],125:[2,76],126:[2,76],127:[2,76],128:[2,76],129:[2,76],130:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76]},{54:[1,188],69:[1,235],88:236,89:[1,187],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:237,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{13:[2,110],28:[2,110],30:[2,110],31:[2,110],33:[2,110],34:[2,110],35:[2,110],42:[2,110],43:[2,110],44:[2,110],48:[2,110],49:[2,110],69:[2,110],72:[2,110],75:[2,110],79:[2,110],84:[2,110],85:[2,110],86:[2,110],92:[2,110],96:[2,110],97:[2,110],100:[2,110],102:[2,110],104:[2,110],106:[2,110],115:[2,110],121:[2,110],123:[2,110],124:[2,110],125:[2,110],126:[2,110],127:[2,110]},{13:[2,111],28:[2,111],30:[2,111],31:[2,111],33:[2,111],34:[2,111],35:[2,111],42:[2,111],43:[2,111],44:[2,111],48:[2,111],49:[2,111],69:[2,111],72:[2,111],75:[2,111],79:[2,111],84:[2,111],85:[2,111],86:[2,111],92:[2,111],96:[2,111],97:[2,111],100:[2,111],102:[2,111],104:[2,111],106:[2,111],115:[2,111],121:[2,111],123:[2,111],124:[2,111],125:[2,111],126:[2,111],127:[2,111]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],37:[2,81],46:[2,81],51:[2,81],54:[2,81],63:[2,81],64:[2,81],65:[2,81],68:[2,81],69:[2,81],70:[2,81],71:[2,81],74:[2,81],76:[2,81],80:[2,81],81:[2,81],82:[2,81],87:[2,81],89:[2,81],98:[2,81],100:[2,81],101:[2,81],102:[2,81],106:[2,81],114:[2,81],122:[2,81],124:[2,81],125:[2,81],126:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81]},{8:238,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],37:[2,82],46:[2,82],51:[2,82],54:[2,82],63:[2,82],64:[2,82],65:[2,82],68:[2,82],69:[2,82],70:[2,82],71:[2,82],74:[2,82],76:[2,82],80:[2,82],81:[2,82],82:[2,82],87:[2,82],89:[2,82],98:[2,82],100:[2,82],101:[2,82],102:[2,82],106:[2,82],114:[2,82],122:[2,82],124:[2,82],125:[2,82],126:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],46:[2,98],51:[2,98],54:[2,98],63:[2,98],64:[2,98],65:[2,98],68:[2,98],69:[2,98],70:[2,98],71:[2,98],74:[2,98],80:[2,98],81:[2,98],82:[2,98],87:[2,98],89:[2,98],98:[2,98],100:[2,98],101:[2,98],102:[2,98],106:[2,98],114:[2,98],122:[2,98],124:[2,98],125:[2,98],128:[2,98],129:[2,98],130:[2,98],131:[2,98],132:[2,98],133:[2,98]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],46:[2,33],51:[2,33],54:[2,33],69:[2,33],74:[2,33],82:[2,33],87:[2,33],89:[2,33],98:[2,33],99:84,100:[2,33],101:[2,33],102:[2,33],105:85,106:[2,33],107:66,114:[2,33],122:[2,33],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:239,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],46:[2,103],51:[2,103],54:[2,103],63:[2,103],64:[2,103],65:[2,103],68:[2,103],69:[2,103],70:[2,103],71:[2,103],74:[2,103],80:[2,103],81:[2,103],82:[2,103],87:[2,103],89:[2,103],98:[2,103],100:[2,103],101:[2,103],102:[2,103],106:[2,103],114:[2,103],122:[2,103],124:[2,103],125:[2,103],128:[2,103],129:[2,103],130:[2,103],131:[2,103],132:[2,103],133:[2,103]},{6:[2,49],25:[2,49],50:240,51:[1,223],82:[2,49]},{6:[2,121],25:[2,121],26:[2,121],51:[2,121],54:[1,241],82:[2,121],87:[2,121],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{47:242,48:[1,57],49:[1,58]},{27:108,28:[1,70],41:109,52:243,53:107,55:110,56:111,72:[1,67],85:[1,112],86:[1,113]},{46:[2,55],51:[2,55]},{8:244,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],46:[2,191],51:[2,191],54:[2,191],69:[2,191],74:[2,191],82:[2,191],87:[2,191],89:[2,191],98:[2,191],99:84,100:[2,191],101:[2,191],102:[2,191],105:85,106:[2,191],107:66,114:[2,191],122:[2,191],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:245,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],46:[2,193],51:[2,193],54:[2,193],69:[2,193],74:[2,193],82:[2,193],87:[2,193],89:[2,193],98:[2,193],99:84,100:[2,193],101:[2,193],102:[2,193],105:85,106:[2,193],107:66,114:[2,193],122:[2,193],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],46:[2,173],51:[2,173],54:[2,173],69:[2,173],74:[2,173],82:[2,173],87:[2,173],89:[2,173],98:[2,173],100:[2,173],101:[2,173],102:[2,173],106:[2,173],114:[2,173],122:[2,173],124:[2,173],125:[2,173],128:[2,173],129:[2,173],130:[2,173],131:[2,173],132:[2,173],133:[2,173]},{8:246,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,126],6:[2,126],25:[2,126],26:[2,126],46:[2,126],51:[2,126],54:[2,126],69:[2,126],74:[2,126],82:[2,126],87:[2,126],89:[2,126],94:[1,247],98:[2,126],100:[2,126],101:[2,126],102:[2,126],106:[2,126],114:[2,126],122:[2,126],124:[2,126],125:[2,126],128:[2,126],129:[2,126],130:[2,126],131:[2,126],132:[2,126],133:[2,126]},{5:248,25:[1,5]},{27:249,28:[1,70]},{116:250,118:212,119:[1,213]},{26:[1,251],117:[1,252],118:253,119:[1,213]},{26:[2,166],117:[2,166],119:[2,166]},{8:255,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],91:254,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,91],5:256,6:[2,91],25:[1,5],26:[2,91],46:[2,91],51:[2,91],54:[2,91],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,91],70:[1,98],71:[1,99],74:[2,91],77:89,80:[1,91],81:[2,101],82:[2,91],87:[2,91],89:[2,91],98:[2,91],100:[2,91],101:[2,91],102:[2,91],106:[2,91],114:[2,91],122:[2,91],124:[2,91],125:[2,91],128:[2,91],129:[2,91],130:[2,91],131:[2,91],132:[2,91],133:[2,91]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,66],70:[2,66],71:[2,66],74:[2,66],80:[2,66],81:[2,66],82:[2,66],87:[2,66],89:[2,66],98:[2,66],100:[2,66],101:[2,66],102:[2,66],106:[2,66],114:[2,66],122:[2,66],124:[2,66],125:[2,66],128:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66]},{1:[2,94],6:[2,94],25:[2,94],26:[2,94],46:[2,94],51:[2,94],54:[2,94],69:[2,94],74:[2,94],82:[2,94],87:[2,94],89:[2,94],98:[2,94],100:[2,94],101:[2,94],102:[2,94],106:[2,94],114:[2,94],122:[2,94],124:[2,94],125:[2,94],128:[2,94],129:[2,94],130:[2,94],131:[2,94],132:[2,94],133:[2,94]},{14:257,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:215,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{1:[2,131],6:[2,131],25:[2,131],26:[2,131],46:[2,131],51:[2,131],54:[2,131],63:[2,131],64:[2,131],65:[2,131],68:[2,131],69:[2,131],70:[2,131],71:[2,131],74:[2,131],80:[2,131],81:[2,131],82:[2,131],87:[2,131],89:[2,131],98:[2,131],100:[2,131],101:[2,131],102:[2,131],106:[2,131],114:[2,131],122:[2,131],124:[2,131],125:[2,131],128:[2,131],129:[2,131],130:[2,131],131:[2,131],132:[2,131],133:[2,131]},{6:[1,71],26:[1,258]},{8:259,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,61],13:[2,111],25:[2,61],28:[2,111],30:[2,111],31:[2,111],33:[2,111],34:[2,111],35:[2,111],42:[2,111],43:[2,111],44:[2,111],48:[2,111],49:[2,111],51:[2,61],72:[2,111],75:[2,111],79:[2,111],84:[2,111],85:[2,111],86:[2,111],87:[2,61],92:[2,111],96:[2,111],97:[2,111],100:[2,111],102:[2,111],104:[2,111],106:[2,111],115:[2,111],121:[2,111],123:[2,111],124:[2,111],125:[2,111],126:[2,111],127:[2,111]},{6:[1,261],25:[1,262],87:[1,260]},{6:[2,50],8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[2,50],26:[2,50],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],82:[2,50],84:[1,55],85:[1,56],86:[1,54],87:[2,50],90:263,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,49],25:[2,49],26:[2,49],50:264,51:[1,223]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],46:[2,170],51:[2,170],54:[2,170],69:[2,170],74:[2,170],82:[2,170],87:[2,170],89:[2,170],98:[2,170],100:[2,170],101:[2,170],102:[2,170],106:[2,170],114:[2,170],117:[2,170],122:[2,170],124:[2,170],125:[2,170],128:[2,170],129:[2,170],130:[2,170],131:[2,170],132:[2,170],133:[2,170]},{8:265,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:266,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{112:[2,149],113:[2,149]},{27:157,28:[1,70],55:158,56:159,72:[1,67],86:[1,113],111:267},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],46:[2,155],51:[2,155],54:[2,155],69:[2,155],74:[2,155],82:[2,155],87:[2,155],89:[2,155],98:[2,155],99:84,100:[2,155],101:[1,268],102:[2,155],105:85,106:[2,155],107:66,114:[1,269],122:[2,155],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],46:[2,156],51:[2,156],54:[2,156],69:[2,156],74:[2,156],82:[2,156],87:[2,156],89:[2,156],98:[2,156],99:84,100:[2,156],101:[1,270],102:[2,156],105:85,106:[2,156],107:66,114:[2,156],122:[2,156],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,272],25:[1,273],74:[1,271]},{6:[2,50],12:166,25:[2,50],26:[2,50],27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:274,39:165,41:169,43:[1,46],74:[2,50],85:[1,112]},{8:275,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,276],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],37:[2,80],46:[2,80],51:[2,80],54:[2,80],63:[2,80],64:[2,80],65:[2,80],68:[2,80],69:[2,80],70:[2,80],71:[2,80],74:[2,80],76:[2,80],80:[2,80],81:[2,80],82:[2,80],87:[2,80],89:[2,80],98:[2,80],100:[2,80],101:[2,80],102:[2,80],106:[2,80],114:[2,80],122:[2,80],124:[2,80],125:[2,80],126:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80]},{8:277,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,69:[1,278],72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{69:[1,279],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{69:[1,235],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{26:[1,280],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,261],25:[1,262],82:[1,281]},{6:[2,61],25:[2,61],26:[2,61],51:[2,61],82:[2,61],87:[2,61]},{5:282,25:[1,5]},{46:[2,53],51:[2,53]},{46:[2,56],51:[2,56],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{26:[1,283],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{5:284,25:[1,5],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{5:285,25:[1,5]},{1:[2,127],6:[2,127],25:[2,127],26:[2,127],46:[2,127],51:[2,127],54:[2,127],69:[2,127],74:[2,127],82:[2,127],87:[2,127],89:[2,127],98:[2,127],100:[2,127],101:[2,127],102:[2,127],106:[2,127],114:[2,127],122:[2,127],124:[2,127],125:[2,127],128:[2,127],129:[2,127],130:[2,127],131:[2,127],132:[2,127],133:[2,127]},{5:286,25:[1,5]},{26:[1,287],117:[1,288],118:253,119:[1,213]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],46:[2,164],51:[2,164],54:[2,164],69:[2,164],74:[2,164],82:[2,164],87:[2,164],89:[2,164],98:[2,164],100:[2,164],101:[2,164],102:[2,164],106:[2,164],114:[2,164],122:[2,164],124:[2,164],125:[2,164],128:[2,164],129:[2,164],130:[2,164],131:[2,164],132:[2,164],133:[2,164]},{5:289,25:[1,5]},{26:[2,167],117:[2,167],119:[2,167]},{5:290,25:[1,5],51:[1,291]},{25:[2,123],51:[2,123],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,92],6:[2,92],25:[2,92],26:[2,92],46:[2,92],51:[2,92],54:[2,92],69:[2,92],74:[2,92],82:[2,92],87:[2,92],89:[2,92],98:[2,92],100:[2,92],101:[2,92],102:[2,92],106:[2,92],114:[2,92],122:[2,92],124:[2,92],125:[2,92],128:[2,92],129:[2,92],130:[2,92],131:[2,92],132:[2,92],133:[2,92]},{1:[2,95],5:292,6:[2,95],25:[1,5],26:[2,95],46:[2,95],51:[2,95],54:[2,95],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,95],70:[1,98],71:[1,99],74:[2,95],77:89,80:[1,91],81:[2,101],82:[2,95],87:[2,95],89:[2,95],98:[2,95],100:[2,95],101:[2,95],102:[2,95],106:[2,95],114:[2,95],122:[2,95],124:[2,95],125:[2,95],128:[2,95],129:[2,95],130:[2,95],131:[2,95],132:[2,95],133:[2,95]},{98:[1,293]},{87:[1,294],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],37:[2,109],46:[2,109],51:[2,109],54:[2,109],63:[2,109],64:[2,109],65:[2,109],68:[2,109],69:[2,109],70:[2,109],71:[2,109],74:[2,109],80:[2,109],81:[2,109],82:[2,109],87:[2,109],89:[2,109],98:[2,109],100:[2,109],101:[2,109],102:[2,109],106:[2,109],112:[2,109],113:[2,109],114:[2,109],122:[2,109],124:[2,109],125:[2,109],128:[2,109],129:[2,109],130:[2,109],131:[2,109],132:[2,109],133:[2,109]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],90:295,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:296,84:[1,55],85:[1,56],86:[1,54],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,117],25:[2,117],26:[2,117],51:[2,117],82:[2,117],87:[2,117]},{6:[1,261],25:[1,262],26:[1,297]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],46:[2,134],51:[2,134],54:[2,134],69:[2,134],74:[2,134],82:[2,134],87:[2,134],89:[2,134],98:[2,134],99:84,100:[1,62],101:[2,134],102:[1,63],105:85,106:[1,65],107:66,114:[2,134],122:[2,134],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],46:[2,136],51:[2,136],54:[2,136],69:[2,136],74:[2,136],82:[2,136],87:[2,136],89:[2,136],98:[2,136],99:84,100:[1,62],101:[2,136],102:[1,63],105:85,106:[1,65],107:66,114:[2,136],122:[2,136],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{112:[2,154],113:[2,154]},{8:298,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:299,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:300,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],37:[2,83],46:[2,83],51:[2,83],54:[2,83],63:[2,83],64:[2,83],65:[2,83],68:[2,83],69:[2,83],70:[2,83],71:[2,83],74:[2,83],80:[2,83],81:[2,83],82:[2,83],87:[2,83],89:[2,83],98:[2,83],100:[2,83],101:[2,83],102:[2,83],106:[2,83],112:[2,83],113:[2,83],114:[2,83],122:[2,83],124:[2,83],125:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83]},{12:166,27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:301,39:165,41:169,43:[1,46],85:[1,112]},{6:[2,84],12:166,25:[2,84],26:[2,84],27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:164,39:165,41:169,43:[1,46],51:[2,84],73:302,85:[1,112]},{6:[2,86],25:[2,86],26:[2,86],51:[2,86],74:[2,86]},{6:[2,36],25:[2,36],26:[2,36],51:[2,36],74:[2,36],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:303,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{69:[1,304],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],37:[2,114],46:[2,114],51:[2,114],54:[2,114],63:[2,114],64:[2,114],65:[2,114],68:[2,114],69:[2,114],70:[2,114],71:[2,114],74:[2,114],76:[2,114],80:[2,114],81:[2,114],82:[2,114],87:[2,114],89:[2,114],98:[2,114],100:[2,114],101:[2,114],102:[2,114],106:[2,114],114:[2,114],122:[2,114],124:[2,114],125:[2,114],126:[2,114],127:[2,114],128:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],37:[2,115],46:[2,115],51:[2,115],54:[2,115],63:[2,115],64:[2,115],65:[2,115],68:[2,115],69:[2,115],70:[2,115],71:[2,115],74:[2,115],76:[2,115],80:[2,115],81:[2,115],82:[2,115],87:[2,115],89:[2,115],98:[2,115],100:[2,115],101:[2,115],102:[2,115],106:[2,115],114:[2,115],122:[2,115],124:[2,115],125:[2,115],126:[2,115],127:[2,115],128:[2,115],129:[2,115],130:[2,115],131:[2,115],132:[2,115],133:[2,115],134:[2,115]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],46:[2,34],51:[2,34],54:[2,34],69:[2,34],74:[2,34],82:[2,34],87:[2,34],89:[2,34],98:[2,34],100:[2,34],101:[2,34],102:[2,34],106:[2,34],114:[2,34],122:[2,34],124:[2,34],125:[2,34],128:[2,34],129:[2,34],130:[2,34],131:[2,34],132:[2,34],133:[2,34]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],46:[2,104],51:[2,104],54:[2,104],63:[2,104],64:[2,104],65:[2,104],68:[2,104],69:[2,104],70:[2,104],71:[2,104],74:[2,104],80:[2,104],81:[2,104],82:[2,104],87:[2,104],89:[2,104],98:[2,104],100:[2,104],101:[2,104],102:[2,104],106:[2,104],114:[2,104],122:[2,104],124:[2,104],125:[2,104],128:[2,104],129:[2,104],130:[2,104],131:[2,104],132:[2,104],133:[2,104]},{1:[2,45],6:[2,45],25:[2,45],26:[2,45],46:[2,45],51:[2,45],54:[2,45],69:[2,45],74:[2,45],82:[2,45],87:[2,45],89:[2,45],98:[2,45],100:[2,45],101:[2,45],102:[2,45],106:[2,45],114:[2,45],122:[2,45],124:[2,45],125:[2,45],128:[2,45],129:[2,45],130:[2,45],131:[2,45],132:[2,45],133:[2,45]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],46:[2,192],51:[2,192],54:[2,192],69:[2,192],74:[2,192],82:[2,192],87:[2,192],89:[2,192],98:[2,192],100:[2,192],101:[2,192],102:[2,192],106:[2,192],114:[2,192],122:[2,192],124:[2,192],125:[2,192],128:[2,192],129:[2,192],130:[2,192],131:[2,192],132:[2,192],133:[2,192]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],46:[2,171],51:[2,171],54:[2,171],69:[2,171],74:[2,171],82:[2,171],87:[2,171],89:[2,171],98:[2,171],100:[2,171],101:[2,171],102:[2,171],106:[2,171],114:[2,171],117:[2,171],122:[2,171],124:[2,171],125:[2,171],128:[2,171],129:[2,171],130:[2,171],131:[2,171],132:[2,171],133:[2,171]},{1:[2,128],6:[2,128],25:[2,128],26:[2,128],46:[2,128],51:[2,128],54:[2,128],69:[2,128],74:[2,128],82:[2,128],87:[2,128],89:[2,128],98:[2,128],100:[2,128],101:[2,128],102:[2,128],106:[2,128],114:[2,128],122:[2,128],124:[2,128],125:[2,128],128:[2,128],129:[2,128],130:[2,128],131:[2,128],132:[2,128],133:[2,128]},{1:[2,129],6:[2,129],25:[2,129],26:[2,129],46:[2,129],51:[2,129],54:[2,129],69:[2,129],74:[2,129],82:[2,129],87:[2,129],89:[2,129],94:[2,129],98:[2,129],100:[2,129],101:[2,129],102:[2,129],106:[2,129],114:[2,129],122:[2,129],124:[2,129],125:[2,129],128:[2,129],129:[2,129],130:[2,129],131:[2,129],132:[2,129],133:[2,129]},{1:[2,162],6:[2,162],25:[2,162],26:[2,162],46:[2,162],51:[2,162],54:[2,162],69:[2,162],74:[2,162],82:[2,162],87:[2,162],89:[2,162],98:[2,162],100:[2,162],101:[2,162],102:[2,162],106:[2,162],114:[2,162],122:[2,162],124:[2,162],125:[2,162],128:[2,162],129:[2,162],130:[2,162],131:[2,162],132:[2,162],133:[2,162]},{5:305,25:[1,5]},{26:[1,306]},{6:[1,307],26:[2,168],117:[2,168],119:[2,168]},{8:308,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],46:[2,96],51:[2,96],54:[2,96],69:[2,96],74:[2,96],82:[2,96],87:[2,96],89:[2,96],98:[2,96],100:[2,96],101:[2,96],102:[2,96],106:[2,96],114:[2,96],122:[2,96],124:[2,96],125:[2,96],128:[2,96],129:[2,96],130:[2,96],131:[2,96],132:[2,96],133:[2,96]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],46:[2,132],51:[2,132],54:[2,132],63:[2,132],64:[2,132],65:[2,132],68:[2,132],69:[2,132],70:[2,132],71:[2,132],74:[2,132],80:[2,132],81:[2,132],82:[2,132],87:[2,132],89:[2,132],98:[2,132],100:[2,132],101:[2,132],102:[2,132],106:[2,132],114:[2,132],122:[2,132],124:[2,132],125:[2,132],128:[2,132],129:[2,132],130:[2,132],131:[2,132],132:[2,132],133:[2,132]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],46:[2,112],51:[2,112],54:[2,112],63:[2,112],64:[2,112],65:[2,112],68:[2,112],69:[2,112],70:[2,112],71:[2,112],74:[2,112],80:[2,112],81:[2,112],82:[2,112],87:[2,112],89:[2,112],98:[2,112],100:[2,112],101:[2,112],102:[2,112],106:[2,112],114:[2,112],122:[2,112],124:[2,112],125:[2,112],128:[2,112],129:[2,112],130:[2,112],131:[2,112],132:[2,112],133:[2,112]},{6:[2,118],25:[2,118],26:[2,118],51:[2,118],82:[2,118],87:[2,118]},{6:[2,49],25:[2,49],26:[2,49],50:309,51:[1,223]},{6:[2,119],25:[2,119],26:[2,119],51:[2,119],82:[2,119],87:[2,119]},{1:[2,157],6:[2,157],25:[2,157],26:[2,157],46:[2,157],51:[2,157],54:[2,157],69:[2,157],74:[2,157],82:[2,157],87:[2,157],89:[2,157],98:[2,157],99:84,100:[2,157],101:[2,157],102:[2,157],105:85,106:[2,157],107:66,114:[1,310],122:[2,157],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,159],6:[2,159],25:[2,159],26:[2,159],46:[2,159],51:[2,159],54:[2,159],69:[2,159],74:[2,159],82:[2,159],87:[2,159],89:[2,159],98:[2,159],99:84,100:[2,159],101:[1,311],102:[2,159],105:85,106:[2,159],107:66,114:[2,159],122:[2,159],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,158],6:[2,158],25:[2,158],26:[2,158],46:[2,158],51:[2,158],54:[2,158],69:[2,158],74:[2,158],82:[2,158],87:[2,158],89:[2,158],98:[2,158],99:84,100:[2,158],101:[2,158],102:[2,158],105:85,106:[2,158],107:66,114:[2,158],122:[2,158],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[2,87],25:[2,87],26:[2,87],51:[2,87],74:[2,87]},{6:[2,49],25:[2,49],26:[2,49],50:312,51:[1,233]},{26:[1,313],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],37:[2,113],46:[2,113],51:[2,113],54:[2,113],63:[2,113],64:[2,113],65:[2,113],68:[2,113],69:[2,113],70:[2,113],71:[2,113],74:[2,113],76:[2,113],80:[2,113],81:[2,113],82:[2,113],87:[2,113],89:[2,113],98:[2,113],100:[2,113],101:[2,113],102:[2,113],106:[2,113],114:[2,113],122:[2,113],124:[2,113],125:[2,113],126:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113]},{26:[1,314]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],46:[2,165],51:[2,165],54:[2,165],69:[2,165],74:[2,165],82:[2,165],87:[2,165],89:[2,165],98:[2,165],100:[2,165],101:[2,165],102:[2,165],106:[2,165],114:[2,165],122:[2,165],124:[2,165],125:[2,165],128:[2,165],129:[2,165],130:[2,165],131:[2,165],132:[2,165],133:[2,165]},{26:[2,169],117:[2,169],119:[2,169]},{25:[2,124],51:[2,124],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,261],25:[1,262],26:[1,315]},{8:316,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:317,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[1,272],25:[1,273],26:[1,318]},{6:[2,37],25:[2,37],26:[2,37],51:[2,37],74:[2,37]},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],46:[2,163],51:[2,163],54:[2,163],69:[2,163],74:[2,163],82:[2,163],87:[2,163],89:[2,163],98:[2,163],100:[2,163],101:[2,163],102:[2,163],106:[2,163],114:[2,163],122:[2,163],124:[2,163],125:[2,163],128:[2,163],129:[2,163],130:[2,163],131:[2,163],132:[2,163],133:[2,163]},{6:[2,120],25:[2,120],26:[2,120],51:[2,120],82:[2,120],87:[2,120]},{1:[2,160],6:[2,160],25:[2,160],26:[2,160],46:[2,160],51:[2,160],54:[2,160],69:[2,160],74:[2,160],82:[2,160],87:[2,160],89:[2,160],98:[2,160],99:84,100:[2,160],101:[2,160],102:[2,160],105:85,106:[2,160],107:66,114:[2,160],122:[2,160],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,161],6:[2,161],25:[2,161],26:[2,161],46:[2,161],51:[2,161],54:[2,161],69:[2,161],74:[2,161],82:[2,161],87:[2,161],89:[2,161],98:[2,161],99:84,100:[2,161],101:[2,161],102:[2,161],105:85,106:[2,161],107:66,114:[2,161],122:[2,161],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[2,88],25:[2,88],26:[2,88],51:[2,88],74:[2,88]}],defaultActions:{57:[2,47],58:[2,48],72:[2,3],91:[2,102]},parseError:function d(a,b){throw new Error(a)},parse:function e(a){function m(){var a;a=b.lexer.lex()||1,typeof a!==\"number\"&&(a=b.symbols_[a]||a);return a}function l(a){c.length=c.length-2*a,d.length=d.length-a}var b=this,c=[0],d=[null],e=this.table,f=\"\",g=0,h=0,i=0,j=2,k=1;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.yy.parseError===\"function\"&&(this.parseError=this.yy.parseError);var n,o,p,q,r,s,t={},u,v,w,x;while(!0){p=c[c.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(n==null&&(n=m()),q=e[p]&&e[p][n]);if(typeof q===\"undefined\"||!q.length||!q[0]){if(!i){x=[];for(u in e[p])this.terminals_[u]&&u>2&&x.push(\"'\"+this.terminals_[u]+\"'\");var y=\"\";this.lexer.showPosition?y=\"Parse error on line \"+(g+1)+\":\\n\"+this.lexer.showPosition()+\"\\nExpecting \"+x.join(\", \"):y=\"Parse error on line \"+(g+1)+\": Unexpected \"+(n==1?\"end of input\":\"'\"+(this.terminals_[n]||n)+\"'\"),this.parseError(y,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,expected:x})}if(i==3){if(n==k)throw new Error(y||\"Parsing halted.\");h=this.lexer.yyleng,f=this.lexer.yytext,g=this.lexer.yylineno,n=m()}while(1){if(j.toString()in e[p])break;if(p==0)throw new Error(y||\"Parsing halted.\");l(1),p=c[c.length-1]}o=n,n=j,p=c[c.length-1],q=e[p]&&e[p][j],i=3}if(q[0]instanceof Array&&q.length>1)throw new Error(\"Parse Error: multiple actions possible at state: \"+p+\", token: \"+n);switch(q[0]){case 1:c.push(n),d.push(this.lexer.yytext),c.push(q[1]),n=null,o?(n=o,o=null):(h=this.lexer.yyleng,f=this.lexer.yytext,g=this.lexer.yylineno,i>0&&i--);break;case 2:v=this.productions_[q[1]][1],t.$=d[d.length-v],s=this.performAction.call(t,f,h,g,this.yy,q[1],d);if(typeof s!==\"undefined\")return s;v&&(c=c.slice(0,-1*v*2),d=d.slice(0,-1*v)),c.push(this.productions_[q[1]][0]),d.push(t.$),w=e[c[c.length-2]][c[c.length-1]],c.push(w);break;case 3:return!0}}return!0}};return a}();typeof require!==\"undefined\"&&(a.parser=b,a.parse=function(){return b.parse.apply(b,arguments)},a.main=function c(b){if(!b[1])throw new Error(\"Usage: \"+b[0]+\" FILE\");if(typeof process!==\"undefined\")var c=require(\"fs\").readFileSync(require(\"path\").join(process.cwd(),b[1]),\"utf8\");else var d=require(\"file\").path(require(\"file\").cwd()),c=d.join(b[1]).read({charset:\"utf-8\"});return a.parser.parse(c)},typeof module!==\"undefined\"&&require.main===module&&a.main(typeof process!==\"undefined\"?process.argv.slice(1):require(\"system\").args))},require[\"./scope\"]=new function(){var a=this;(function(){var b,c,d,e;e=require(\"./helpers\"),c=e.extend,d=e.last,a.Scope=b=function(){function a(b,c,d){this.parent=b,this.expressions=c,this.method=d,this.variables=[{name:\"arguments\",type:\"arguments\"}],this.positions={},this.parent||(a.root=this)}a.root=null,a.prototype.add=function(a,b,c){var d;if(this.shared&&!c)return this.parent.add(a,b,c);return typeof (d=this.positions[a])===\"number\"?this.variables[d].type=b:this.positions[a]=this.variables.push({name:a,type:b})-1},a.prototype.find=function(a,b){if(this.check(a,b))return!0;this.add(a,\"var\");return!1},a.prototype.parameter=function(a){if(!this.shared||!this.parent.check(a,!0))return this.add(a,\"param\")},a.prototype.check=function(a,b){var c,d;c=!!this.type(a);if(c||b)return c;return!!((d=this.parent)!=null?d.check(a):void 0)},a.prototype.temporary=function(a,b){return a.length>1?\"_\"+a+(b>1?b:\"\"):\"_\"+(b+parseInt(a,36)).toString(36).replace(/\\d/g,\"a\")},a.prototype.type=function(a){var b,c,d,e;e=this.variables;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.name===a)return b.type}return null},a.prototype.freeVariable=function(a){var b,c;b=0;while(this.check(c=this.temporary(a,b),!0))b++;this.add(c,\"var\",!0);return c},a.prototype.assign=function(a,b){this.add(a,{value:b,assigned:!0});return this.hasAssignments=!0},a.prototype.hasDeclarations=function(){return!!this.declaredVariables().length},a.prototype.declaredVariables=function(){var a,b,c,d,e,f;a=[],b=[],f=this.variables;for(d=0,e=f.length;d<e;d++)c=f[d],c.type===\"var\"&&(c.name.charAt(0)===\"_\"?b:a).push(c.name);return a.sort().concat(b.sort())},a.prototype.assignedVariables=function(){var a,b,c,d,e;d=this.variables,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],a.type.assigned&&e.push(\"\"+a.name+\" = \"+a.type.value);return e};return a}()}).call(this)},require[\"./nodes\"]=new function(){var a=this;(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ba,bb,bc,bd,be,bf,bg,bh=Object.prototype.hasOwnProperty,bi=function(a,b){function d(){this.constructor=a}for(var c in b)bh.call(b,c)&&(a[c]=b[c]);d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype;return a},bj=function(a,b){return function(){return a.apply(b,arguments)}};K=require(\"./scope\").Scope,bg=require(\"./helpers\"),X=bg.compact,_=bg.flatten,$=bg.extend,bb=bg.merge,Y=bg.del,bd=bg.starts,Z=bg.ends,ba=bg.last,a.extend=$,W=function(){return!0},B=function(){return!1},P=function(){return this},A=function(){this.negated=!this.negated;return this},a.Base=e=function(){function a(){}a.prototype.compile=function(a,b){var c;a=$({},a),b&&(a.level=b),c=this.unfoldSoak(a)||this,c.tab=a.indent;return a.level!==y&&c.isStatement(a)?c.compileClosure(a):c.compileNode(a)},a.prototype.compileClosure=function(a){if(this.jumps())throw SyntaxError(\"cannot use a pure statement in an expression.\");a.sharedScope=!0;return i.wrap(this).compileNode(a)},a.prototype.cache=function(a,b,c){var e,f;if(this.isComplex()){e=new z(c||a.scope.freeVariable(\"ref\")),f=new d(e,this);return b?[f.compile(a,b),e.value]:[f,e]}e=b?this.compile(a,b):this;return[e,e]},a.prototype.compileLoopReference=function(a,b){var c,d,e;c=d=this.compile(a,v),-Infinity<(e=+c)&&e<Infinity||o.test(c)&&a.scope.check(c,!0)||(c=\"\"+(d=a.scope.freeVariable(b))+\" = \"+c);return[c,d]},a.prototype.makeReturn=function(){return new I(this)},a.prototype.contains=function(a){var b;b=!1,this.traverseChildren(!1,function(c){if(a(c)){b=!0;return!1}});return b},a.prototype.containsType=function(a){return this instanceof a||this.contains(function(b){return b instanceof a})},a.prototype.lastNonComment=function(a){var b;b=a.length;while(b--)if(!(a[b]instanceof k))return a[b];return null},a.prototype.toString=function(a,b){var c;a==null&&(a=\"\"),b==null&&(b=this.constructor.name),c=\"\\n\"+a+b,this.soak&&(c+=\"?\"),this.eachChild(function(b){return c+=b.toString(a+O)});return c},a.prototype.eachChild=function(a){var b,c,d,e,f,g,h,i;if(!this.children)return this;h=this.children;for(d=0,f=h.length;d<f;d++){b=h[d];if(this[b]){i=_([this[b]]);for(e=0,g=i.length;e<g;e++){c=i[e];if(a(c)===!1)return this}}}return this},a.prototype.traverseChildren=function(a,b){return this.eachChild(function(c){if(b(c)===!1)return!1;return c.traverseChildren(a,b)})},a.prototype.invert=function(){return new D(\"!\",this)},a.prototype.unwrapAll=function(){var a;a=this;while(a!==(a=a.unwrap()))continue;return a},a.prototype.children=[],a.prototype.isStatement=B,a.prototype.jumps=B,a.prototype.isComplex=W,a.prototype.isChainable=B,a.prototype.isAssignable=B,a.prototype.unwrap=P,a.prototype.unfoldSoak=B,a.prototype.assigns=B;return a}(),a.Block=f=function(){function a(a){this.expressions=X(_(a||[]))}bi(a,e),a.prototype.children=[\"expressions\"],a.prototype.push=function(a){this.expressions.push(a);return this},a.prototype.pop=function(){return this.expressions.pop()},a.prototype.unshift=function(a){this.expressions.unshift(a);return this},a.prototype.unwrap=function(){return this.expressions.length===1?this.expressions[0]:this},a.prototype.isEmpty=function(){return!this.expressions.length},a.prototype.isStatement=function(a){var b,c,d,e;e=this.expressions;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.isStatement(a))return!0}return!1},a.prototype.jumps=function(a){var b,c,d,e;e=this.expressions;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.jumps(a))return b}},a.prototype.makeReturn=function(){var a,b;b=this.expressions.length;while(b--){a=this.expressions[b];if(!(a instanceof k)){this.expressions[b]=a.makeReturn(),a instanceof I&&!a.expression&&this.expressions.splice(b,1);break}}return this},a.prototype.compile=function(b,c){b==null&&(b={});return b.scope?a.__super__.compile.call(this,b,c):this.compileRoot(b)},a.prototype.compileNode=function(a){var b,c,d,e,f,g,h;this.tab=a.indent,e=a.level===y,c=[],h=this.expressions;for(f=0,g=h.length;f<g;f++)d=h[f],d=d.unwrapAll(),d=d.unfoldSoak(a)||d,e?(d.front=!0,b=d.compile(a),c.push(d.isStatement(a)?b:this.tab+b+\";\")):c.push(d.compile(a,v));if(e)return c.join(\"\\n\");b=c.join(\", \")||\"void 0\";return c.length>1&&a.level>=v?\"(\"+b+\")\":b},a.prototype.compileRoot=function(a){var b;a.indent=this.tab=a.bare?\"\":O,a.scope=new K(null,this,null),a.level=y,b=this.compileWithDeclarations(a),b=b.replace(Q,\"\");return a.bare?b:\"(function() {\\n\"+b+\"\\n}).call(this);\\n\"},a.prototype.compileWithDeclarations=function(a){var b,c,d,e,f,g,h,i;b=e=\"\",i=this.expressions;for(d=0,h=i.length;d<h;d++){c=i[d],c=c.unwrap();if(!(c instanceof k||c instanceof z))break}a=bb(a,{level:y}),d&&(f=this.expressions.splice(d,this.expressions.length),b=this.compileNode(a),this.expressions=f),e=this.compileNode(a),g=a.scope,g.expressions===this&&(!a.globals&&a.scope.hasDeclarations()&&(b+=\"\"+this.tab+\"var \"+g.declaredVariables().join(\", \")+\";\\n\"),g.hasAssignments&&(b+=\"\"+this.tab+\"var \"+bc(g.assignedVariables().join(\", \"),this.tab)+\";\\n\"));return b+e},a.wrap=function(b){if(b.length===1&&b[0]instanceof a)return b[0];return new a(b)};return a}(),a.Literal=z=function(){function a(a){this.value=a}bi(a,e),a.prototype.makeReturn=function(){return this.isStatement()?this:new I(this)},a.prototype.isAssignable=function(){return o.test(this.value)},a.prototype.isStatement=function(){var a;return(a=this.value)===\"break\"||a===\"continue\"||a===\"debugger\"},a.prototype.isComplex=B,a.prototype.assigns=function(a){return a===this.value},a.prototype.jumps=function(a){if(!this.isStatement())return!1;return a&&(a.loop||a.block&&this.value!==\"continue\")?!1:this},a.prototype.compileNode=function(a){var b;b=this.isUndefined?a.level>=t?\"(void 0)\":\"void 0\":this.value.reserved?'\"'+this.value+'\"':this.value;return this.isStatement()?\"\"+this.tab+b+\";\":b},a.prototype.toString=function(){return' \"'+this.value+'\"'};return a}(),a.Return=I=function(){function a(a){a&&!a.unwrap().isUndefined&&(this.expression=a)}bi(a,e),a.prototype.children=[\"expression\"],a.prototype.isStatement=W,a.prototype.makeReturn=P,a.prototype.jumps=P,a.prototype.compile=function(b,c){var d,e;d=(e=this.expression)!=null?e.makeReturn():void 0;return!d||d instanceof a?a.__super__.compile.call(this,b,c):d.compile(b,c)},a.prototype.compileNode=function(a){return this.tab+(\"return\"+(this.expression?\" \"+this.expression.compile(a,x):\"\")+\";\")};return a}(),a.Value=U=function(){function a(b,c,d){if(!c&&b instanceof a)return b;this.base=b,this.properties=c||[],d&&(this[d]=!0);return this}bi(a,e),a.prototype.children=[\"base\",\"properties\"],a.prototype.push=function(a){this.properties.push(a);return this},a.prototype.hasProperties=function(){return!!this.properties.length},a.prototype.isArray=function(){return!this.properties.length&&this.base instanceof c},a.prototype.isComplex=function(){return this.hasProperties()||this.base.isComplex()},a.prototype.isAssignable=function(){return this.hasProperties()||this.base.isAssignable()},a.prototype.isSimpleNumber=function(){return this.base instanceof z&&J.test(this.base.value)},a.prototype.isAtomic=function(){var a,b,c,d;d=this.properties.concat(this.base);for(b=0,c=d.length;b<c;b++){a=d[b];if(a.soak||a instanceof g)return!1}return!0},a.prototype.isStatement=function(a){return!this.properties.length&&this.base.isStatement(a)},a.prototype.assigns=function(a){return!this.properties.length&&this.base.assigns(a)},a.prototype.jumps=function(a){return!this.properties.length&&this.base.jumps(a)},a.prototype.isObject=function(a){if(this.properties.length)return!1;return this.base instanceof C&&(!a||this.base.generated)},a.prototype.isSplice=function(){return ba(this.properties)instanceof L},a.prototype.makeReturn=function(){return this.properties.length?a.__super__.makeReturn.call(this):this.base.makeReturn()},a.prototype.unwrap=function(){return this.properties.length?this:this.base},a.prototype.cacheReference=function(b){var c,e,f,g;f=ba(this.properties);if(this.properties.length<2&&!this.base.isComplex()&&!(f!=null?f.isComplex():void 0))return[this,this];c=new a(this.base,this.properties.slice(0,-1)),c.isComplex()&&(e=new z(b.scope.freeVariable(\"base\")),c=new a(new F(new d(e,c))));if(!f)return[c,e];f.isComplex()&&(g=new z(b.scope.freeVariable(\"name\")),f=new s(new d(g,f.index)),g=new s(g));return[c.push(f),new a(e||c.base,[g||f])]},a.prototype.compileNode=function(a){var c,d,e,f,g;this.base.front=this.front,e=this.properties,c=this.base.compile(a,e.length?t:null),e[0]instanceof b&&this.isSimpleNumber()&&(c=\"(\"+c+\")\");for(f=0,g=e.length;f<g;f++)d=e[f],c+=d.compile(a);return c},a.prototype.unfoldSoak=function(b){var c,e,f,g,h,i,j,k;if(f=this.base.unfoldSoak(b)){Array.prototype.push.apply(f.body.properties,this.properties);return f}k=this.properties;for(e=0,j=k.length;e<j;e++){g=k[e];if(g.soak){g.soak=!1,c=new a(this.base,this.properties.slice(0,e)),i=new a(this.base,this.properties.slice(e)),c.isComplex()&&(h=new z(b.scope.freeVariable(\"ref\")),c=new F(new d(h,c)),i.base=h);return new q(new l(c),i,{soak:!0})}}return null};return a}(),a.Comment=k=function(){function a(a){this.comment=a}bi(a,e),a.prototype.isStatement=W,a.prototype.makeReturn=P,a.prototype.compileNode=function(a,b){var c;c=\"/*\"+bc(this.comment,this.tab)+\"*/\",(b||a.level)===y&&(c=a.indent+c);return c};return a}(),a.Call=g=function(){function a(a,b,c){this.args=b!=null?b:[],this.soak=c,this.isNew=!1,this.isSuper=a===\"super\",this.variable=this.isSuper?null:a}bi(a,e),a.prototype.children=[\"variable\",\"args\"],a.prototype.newInstance=function(){var b;b=this.variable.base||this.variable,b instanceof a?b.newInstance():this.isNew=!0;return this},a.prototype.superReference=function(a){var b,c;b=a.scope.method;if(!b)throw SyntaxError(\"cannot call super outside of a function.\");c=b.name;if(!c)throw SyntaxError(\"cannot call super on an anonymous function.\");return b.klass?\"\"+b.klass+\".__super__.\"+c:\"\"+c+\".__super__.constructor\"},a.prototype.unfoldSoak=function(b){var c,d,e,f,g,h,i,j,k;if(this.soak){if(this.variable){if(d=be(b,this,\"variable\"))return d;j=(new U(this.variable)).cacheReference(b),e=j[0],g=j[1]}else e=new z(this.superReference(b)),g=new U(e);g=new a(g,this.args),g.isNew=this.isNew,e=new z(\"typeof \"+e.compile(b)+' == \"function\"');return new q(e,new U(g),{soak:!0})}c=this,f=[];while(!0){if(c.variable instanceof a){f.push(c),c=c.variable;continue}if(!(c.variable instanceof U))break;f.push(c);if(!((c=c.variable.base)instanceof a))break}k=f.reverse();for(h=0,i=k.length;h<i;h++)c=k[h],d&&(c.variable instanceof a?c.variable=d:c.variable.base=d),d=be(b,c,\"variable\");return d},a.prototype.compileNode=function(a){var b,c,d,e;(e=this.variable)!=null&&(e.front=this.front);if(d=M.compileSplattedArray(a,this.args,!0))return this.compileSplat(a,d);c=function(){var c,d,e,f;e=this.args,f=[];for(c=0,d=e.length;c<d;c++)b=e[c],f.push(b.compile(a,v));return f}.call(this).join(\", \");return this.isSuper?this.superReference(a)+(\".call(this\"+(c&&\", \"+c)+\")\"):(this.isNew?\"new \":\"\")+this.variable.compile(a,t)+(\"(\"+c+\")\")},a.prototype.compileSuper=function(a,b){return\"\"+this.superReference(b)+\".call(this\"+(a.length?\", \":\"\")+a+\")\"},a.prototype.compileSplat=function(a,b){var c,d,e,f,g;if(this.isSuper)return\"\"+this.superReference(a)+\".apply(this, \"+b+\")\";if(this.isNew){e=this.tab+O;return\"(function(func, args, ctor) {\\n\"+e+\"ctor.prototype = func.prototype;\\n\"+e+\"var child = new ctor, result = func.apply(child, args);\\n\"+e+'return typeof result == \"object\" ? result : child;\\n'+this.tab+\"})(\"+this.variable.compile(a,v)+\", \"+b+\", function() {})\"}c=new U(this.variable),(f=c.properties.pop())&&c.isComplex()?(g=a.scope.freeVariable(\"ref\"),d=\"(\"+g+\" = \"+c.compile(a,v)+\")\"+f.compile(a)):(d=c.compile(a,t),J.test(d)&&(d=\"(\"+d+\")\"),f?(g=d,d+=f.compile(a)):g=\"null\");return\"\"+d+\".apply(\"+g+\", \"+b+\")\"};return a}(),a.Extends=m=function(){function a(a,b){this.child=a,this.parent=b}bi(a,e),a.prototype.children=[\"child\",\"parent\"],a.prototype.compile=function(a){bf(\"hasProp\");return(new g(new U(new z(bf(\"extends\"))),[this.child,this.parent])).compile(a)};return a}(),a.Access=b=function(){function a(a,b){this.name=a,this.name.asKey=!0,this.proto=b===\"proto\"?\".prototype\":\"\",this.soak=b===\"soak\"}bi(a,e),a.prototype.children=[\"name\"],a.prototype.compile=function(a){var b;b=this.name.compile(a);return this.proto+(p.test(b)?\"[\"+b+\"]\":\".\"+b)},a.prototype.isComplex=B;return a}(),a.Index=s=function(){function a(a){this.index=a}bi(a,e),a.prototype.children=[\"index\"],a.prototype.compile=function(a){return(this.proto?\".prototype\":\"\")+(\"[\"+this.index.compile(a,x)+\"]\")},a.prototype.isComplex=function(){return this.index.isComplex()};return a}(),a.Range=H=function(){function a(a,b,c){this.from=a,this.to=b,this.exclusive=c===\"exclusive\",this.equals=this.exclusive?\"\":\"=\"}bi(a,e),a.prototype.children=[\"from\",\"to\"],a.prototype.compileVariables=function(a){var b,c,d,e;a=bb(a,{top:!0}),c=this.from.cache(a,v),this.from=c[0],this.fromVar=c[1],d=this.to.cache(a,v),this.to=d[0],this.toVar=d[1],e=[this.fromVar.match(J),this.toVar.match(J)],this.fromNum=e[0],this.toNum=e[1],b=[],this.from!==this.fromVar&&b.push(this.from);if(this.to!==this.toVar)return b.push(this.to)},a.prototype.compileNode=function(a){var b,c,d,e,f,g,h;this.compileVariables(a);if(!a.index)return this.compileArray(a);if(this.fromNum&&this.toNum)return this.compileSimple(a);c=Y(a,\"index\"),f=Y(a,\"step\"),h=\"\"+c+\" = \"+this.from+(this.to!==this.toVar?\", \"+this.to:\"\"),e=\"(\"+this.fromVar+\" <= \"+this.toVar+\" ? \"+c,b=\"\"+e+\" <\"+this.equals+\" \"+this.toVar+\" : \"+c+\" >\"+this.equals+\" \"+this.toVar+\")\",g=f?f.compile(a):\"1\",d=f?\"\"+c+\" += \"+g:\"\"+e+\" += \"+g+\" : \"+c+\" -= \"+g+\")\";return\"\"+h+\"; \"+b+\"; \"+d},a.prototype.compileSimple=function(a){var b,c,d,e,f;f=[+this.fromNum,+this.toNum],b=f[0],e=f[1],c=Y(a,\"index\"),d=Y(a,\"step\"),d&&(d=\"\"+c+\" += \"+d.compile(a));return b>e?\"\"+c+\" = \"+b+\"; \"+c+\" >\"+this.equals+\" \"+e+\"; \"+(d||\"\"+c+\"--\"):\"\"+c+\" = \"+b+\"; \"+c+\" <\"+this.equals+\" \"+e+\"; \"+(d||\"\"+c+\"++\")},a.prototype.compileArray=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;if(this.fromNum&&this.toNum&&Math.abs(this.fromNum-this.toNum)<=20){h=function(){n=[];for(var a=l=+this.fromNum,b=+this.toNum;l<=b?a<=b:a>=b;l<=b?a+=1:a-=1)n.push(a);return n}.apply(this,arguments),this.exclusive&&h.pop();return\"[\"+h.join(\", \")+\"]\"}e=this.tab+O,d=a.scope.freeVariable(\"i\"),i=a.scope.freeVariable(\"results\"),g=\"\\n\"+e+i+\" = [];\",this.fromNum&&this.toNum?(a.index=d,b=this.compileSimple(a)):(j=\"\"+d+\" = \"+this.from+(this.to!==this.toVar?\", \"+this.to:\"\"),c=\"\"+this.fromVar+\" <= \"+this.toVar+\" ?\",b=\"var \"+j+\"; \"+c+\" \"+d+\" <\"+this.equals+\" \"+this.toVar+\" : \"+d+\" >\"+this.equals+\" \"+this.toVar+\"; \"+c+\" \"+d+\" += 1 : \"+d+\" -= 1\"),f=\"{ \"+i+\".push(\"+d+\"); }\\n\"+e+\"return \"+i+\";\\n\"+a.indent;return\"(function() {\"+g+\"\\n\"+e+\"for (\"+b+\")\"+f+\"}).apply(this, arguments)\"};return a}(),a.Slice=L=function(){function a(b){this.range=b,a.__super__.constructor.call(this)}bi(a,e),a.prototype.children=[\"range\"],a.prototype.compileNode=function(a){var b,c,d,e,f,g;g=this.range,e=g.to,c=g.from,d=c&&c.compile(a,x)||\"0\",b=e&&e.compile(a,x),e&&(this.range.exclusive||+b!==-1)&&(f=\", \"+(this.range.exclusive?b:J.test(b)?(+b+1).toString():\"(\"+b+\" + 1) || 9e9\"));return\".slice(\"+d+(f||\"\")+\")\"};return a}(),a.Obj=C=function(){function a(a,b){this.generated=b!=null?b:!1,this.objects=this.properties=a||[]}bi(a,e),a.prototype.children=[\"properties\"],a.prototype.compileNode=function(a){var b,c,e,f,g,h,i,j;j=this.properties;if(!j.length)return this.front?\"({})\":\"{}\";c=a.indent+=O,g=this.lastNonComment(this.properties),j=function(){var h,l;l=[];for(b=0,h=j.length;b<h;b++)i=j[b],f=b===j.length-1?\"\":i===g||i instanceof k?\"\\n\":\",\\n\",e=i instanceof k?\"\":c,i instanceof U&&i[\"this\"]&&(i=new d(i.properties[0].name,i,\"object\")),i instanceof k||(i instanceof d||(i=new d(i,i,\"object\")),(i.variable.base||i.variable).asKey=!0),l.push(e+i.compile(a,y)+f);return l}(),j=j.join(\"\"),h=\"{\"+(j&&\"\\n\"+j+\"\\n\"+this.tab)+\"}\";return this.front?\"(\"+h+\")\":h},a.prototype.assigns=function(a){var b,c,d,e;e=this.properties;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.assigns(a))return!0}return!1};return a}(),a.Arr=c=function(){function a(a){this.objects=a||[]}bi(a,e),a.prototype.children=[\"objects\"],a.prototype.compileNode=function(a){var b,c;if(!this.objects.length)return\"[]\";a.indent+=O;if(b=M.compileSplattedArray(a,this.objects))return b;b=function(){var b,d,e,f;e=this.objects,f=[];for(b=0,d=e.length;b<d;b++)c=e[b],f.push(c.compile(a,v));return f}.call(this).join(\", \");return b.indexOf(\"\\n\")<0?\"[\"+b+\"]\":\"[\\n\"+a.indent+b+\"\\n\"+this.tab+\"]\"},a.prototype.assigns=function(a){var b,c,d,e;e=this.objects;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.assigns(a))return!0}return!1};return a}(),a.Class=h=function(){function a(a,b,c){this.variable=a,this.parent=b,this.body=c!=null?c:new f,this.boundFuncs=[],this.body.classBody=!0}bi(a,e),a.prototype.children=[\"variable\",\"parent\",\"body\"],a.prototype.determineName=function(){var a,c;if(!this.variable)return null;a=(c=ba(this.variable.properties))?c instanceof b&&c.name.value:this.variable.base.value;return a&&(a=o.test(a)&&a)},a.prototype.setContext=function(a){return this.body.traverseChildren(!1,function(b){if(b.classBody)return!1;if(b instanceof z&&b.value===\"this\")return b.value=a;if(b instanceof j){b.klass=a;if(b.bound)return b.context=a}})},a.prototype.addBoundFunctions=function(a){var b,c,d,e,f,g;if(this.boundFuncs.length){f=this.boundFuncs,g=[];for(d=0,e=f.length;d<e;d++)c=f[d],b=c.compile(a),g.push(this.ctor.body.unshift(new z(\"this.\"+b+\" = \"+bf(\"bind\")+\"(this.\"+b+\", this);\")));return g}},a.prototype.addProperties=function(a,c){var e,f,g,h,i;h=a.base.properties.slice(0),i=[];while(e=h.shift()){if(e instanceof d){f=e.variable.base,delete e.context,g=e.value;if(f.value===\"constructor\"){if(this.ctor)throw new Error(\"cannot define more than one constructor in a class\");if(g.bound)throw new Error(\"cannot define a constructor as a bound function\");g instanceof j?e=this.ctor=g:e=this.ctor=new d(new U(new z(c)),g)}else e.variable[\"this\"]||(e.variable=new U(new z(c),[new b(f,\"proto\")])),g instanceof j&&g.bound&&(this.boundFuncs.push(f),g.bound=!1)}i.push(e)}return i},a.prototype.walkBody=function(b){return this.traverseChildren(!1,bj(function(c){var d,e,g,h,i;if(c instanceof a)return!1;if(c instanceof f){i=d=c.expressions;for(e=0,h=i.length;e<h;e++)g=i[e],g instanceof U&&g.isObject(!0)&&(d[e]=this.addProperties(g,b));return c.expressions=d=_(d)}},this))},a.prototype.ensureConstructor=function(a){this.ctor||(this.ctor=new j,this.parent&&this.ctor.body.push(new g(\"super\",[new M(new z(\"arguments\"))])),this.body.expressions.unshift(this.ctor)),this.ctor.ctor=this.ctor.name=a,this.ctor.klass=null;return this.ctor.noReturn=!0},a.prototype.compileNode=function(a){var b,c,e,f;b=this.determineName(),f=b||this.name||\"_Class\",e=new z(f),this.setContext(f),this.walkBody(f),this.parent&&this.body.expressions.unshift(new m(e,this.parent)),this.ensureConstructor(f),this.body.expressions.push(e),this.addBoundFunctions(a),c=new F(i.wrap(this.body),!0),this.variable&&(c=new d(this.variable,c));return c.compile(a)};return a}(),a.Assign=d=function(){function a(a,b,c,d){this.variable=a,this.value=b,this.context=c,this.param=d&&d.param}bi(a,e),a.prototype.METHOD_DEF=/^(?:(\\S+)\\.prototype\\.|\\S+?)?\\b([$A-Za-z_][$\\w\\x7f-\\uffff]*)$/,a.prototype.children=[\"variable\",\"value\"],a.prototype.assigns=function(a){return this[this.context===\"object\"?\"value\":\"variable\"].assigns(a)},a.prototype.unfoldSoak=function(a){return be(a,this,\"variable\")},a.prototype.compileNode=function(a){var b,c,d,e,f;if(b=this.variable instanceof U){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(a);if(this.variable.isSplice())return this.compileSplice(a);if((f=this.context)===\"||=\"||f===\"&&=\"||f===\"?=\")return this.compileConditional(a)}d=this.variable.compile(a,v),this.value instanceof j&&(c=this.METHOD_DEF.exec(d))&&(this.value.name=c[2],c[1]&&(this.value.klass=c[1])),e=this.value.compile(a,v);if(this.context===\"object\")return\"\"+d+\": \"+e;if(!this.variable.isAssignable())throw SyntaxError('\"'+this.variable.compile(a)+'\" cannot be assigned.');this.context||b&&(this.variable.namespaced||this.variable.hasProperties())||(this.param?a.scope.add(d,\"var\"):a.scope.find(d)),e=d+(\" \"+(this.context||\"=\")+\" \")+e;return a.level>v?\"(\"+e+\")\":e},a.prototype.compilePatternMatch=function(c){var d,e,f,g,h,i,j,k,l,m,n,p,q,r,t,u,x,A,B,C,D,E;r=c.level===y,u=this.value,l=this.variable.base.objects;if(!(m=l.length)){if(r)return!1;f=u.compile(c);return c.level<w?f:\"(\"+f+\")\"}i=this.variable.isObject();if(r&&m===1&&!((k=l[0])instanceof M)){k instanceof a?(B=k,h=B.variable.base,k=B.value):k.base instanceof F?(C=(new U(k.unwrapAll())).cacheReference(c),k=C[0],h=C[1]):h=i?k[\"this\"]?k.properties[0].name:k:new z(0),d=o.test(h.unwrap().value||0),u=new U(u),u.properties.push(new(d?b:s)(h));return(new a(k,u)).compile(c)}x=u.compile(c,v),e=[],q=!1;if(!o.test(x)||this.variable.assigns(x))e.push(\"\"+(n=c.scope.freeVariable(\"ref\"))+\" = \"+x),x=n;for(g=0,A=l.length;g<A;g++){k=l[g],h=g,i&&(k instanceof a?(D=k,h=D.variable.base,k=D.value):k.base instanceof F?(E=(new U(k.unwrapAll())).cacheReference(c),k=E[0],h=E[1]):h=k[\"this\"]?k.properties[0].name:k);if(!q&&k instanceof M)t=\"\"+m+\" <= \"+x+\".length ? \"+bf(\"slice\")+\".call(\"+x+\", \"+g,(p=m-g-1)?(j=c.scope.freeVariable(\"i\"),t+=\", \"+j+\" = \"+x+\".length - \"+p+\") : (\"+j+\" = \"+g+\", [])\"):t+=\") : []\",t=new z(t),q=\"\"+j+\"++\";else{if(k instanceof M){k=k.name.compile(c);throw SyntaxError(\"multiple splats are disallowed in an assignment: \"+k+\" ...\")}typeof h===\"number\"?(h=new z(q||h),d=!1):d=i&&o.test(h.unwrap().value||0),t=new U(new z(x),[new(d?b:s)(h)])}e.push((new a(k,t,null,{param:this.param})).compile(c,y))}r||e.push(x),f=X(e).join(\", \");return c.level<v?f:\"(\"+f+\")\"},a.prototype.compileConditional=function(b){var c,d,e;e=this.variable.cacheReference(b),c=e[0],d=e[1];return(new D(this.context.slice(0,-1),c,new a(d,this.value,\"=\"))).compile(b)},a.prototype.compileSplice=function(a){var b,c,d,e,f,g,h,i,j,k,l,m;k=this.variable.properties.pop().range,d=k.from,h=k.to,c=k.exclusive,g=this.variable.compile(a),l=(d!=null?d.cache(a,w):void 0)||[\"0\",\"0\"],e=l[0],f=l[1],h?(d!=null?d.isSimpleNumber():void 0)&&h.isSimpleNumber()?(h=+h.compile(a)- +f,c||(h+=1)):(h=h.compile(a)+\" - \"+f,c||(h+=\" + 1\")):h=\"9e9\",m=this.value.cache(a,v),i=m[0],j=m[1],b=\"[].splice.apply(\"+g+\", [\"+e+\", \"+h+\"].concat(\"+i+\")), \"+j;return a.level>y?\"(\"+b+\")\":b};return a}(),a.Code=j=function(){function a(a,b,c){this.params=a||[],this.body=b||new f,this.bound=c===\"boundfunc\",this.bound&&(this.context=\"this\")}bi(a,e),a.prototype.children=[\"params\",\"body\"],a.prototype.isStatement=function(){return!!this.ctor},a.prototype.jumps=B,a.prototype.compileNode=function(a){var b,e,f,g,h,i,j,k,l,m,n,o,p,r,s,u,v,w,x,y,A;a.scope=new K(a.scope,this.body,this),a.scope.shared=Y(a,\"sharedScope\"),a.indent+=O,delete a.bare,delete a.globals,o=[],e=[],x=this.params;for(r=0,u=x.length;r<u;r++){j=x[r];if(j.splat){l=new d(new U(new c(function(){var b,c,d,e;d=this.params,e=[];for(b=0,c=d.length;b<c;b++)i=d[b],e.push(i.asReference(a));return e}.call(this))),new U(new z(\"arguments\")));break}}y=this.params;for(s=0,v=y.length;s<v;s++)j=y[s],j.isComplex()?(n=k=j.asReference(a),j.value&&(n=new D(\"?\",k,j.value)),e.push(new d(new U(j.name),n,\"=\",{param:!0}))):(k=j,j.value&&(h=new z(k.name.value+\" == null\"),n=new d(new U(j.name),j.value,\"=\"),e.push(new q(h,n)))),l||o.push(k);p=this.body.isEmpty(),l&&e.unshift(l),e.length&&(A=this.body.expressions).unshift.apply(A,e);if(!l)for(f=0,w=o.length;f<w;f++)m=o[f],a.scope.parameter(o[f]=m.compile(a));!p&&!this.noReturn&&this.body.makeReturn(),g=a.indent,b=\"function\",this.ctor&&(b+=\" \"+this.name),b+=\"(\"+o.join(\", \")+\") {\",this.body.isEmpty()||(b+=\"\\n\"+this.body.compileWithDeclarations(a)+\"\\n\"+this.tab),b+=\"}\";if(this.ctor)return this.tab+b;if(this.bound)return bf(\"bind\")+(\"(\"+b+\", \"+this.context+\")\");return this.front||a.level>=t?\"(\"+b+\")\":b},a.prototype.traverseChildren=function(b,c){if(b)return a.__super__.traverseChildren.call(this,b,c)};return a}(),a.Param=E=function(){function a(a,b,c){this.name=a,this.value=b,this.splat=c}bi(a,e),a.prototype.children=[\"name\",\"value\"],a.prototype.compile=function(a){return this.name.compile(a,v)},a.prototype.asReference=function(a){var b;if(this.reference)return this.reference;b=this.name,b[\"this\"]?(b=b.properties[0].name,b.value.reserved&&(b=new z(\"_\"+b.value))):b.isComplex()&&(b=new z(a.scope.freeVariable(\"arg\"))),b=new U(b),this.splat&&(b=new M(b));return this.reference=b},a.prototype.isComplex=function(){return this.name.isComplex()};return a}(),a.Splat=M=function(){function a(a){this.name=a.compile?a:new z(a)}bi(a,e),a.prototype.children=[\"name\"],a.prototype.isAssignable=W,a.prototype.assigns=function(a){return this.name.assigns(a)},a.prototype.compile=function(a){return this.index!=null?this.compileParam(a):this.name.compile(a)},a.compileSplattedArray=function(b,c,d){var e,f,g,h,i,j,k;i=-1;while((j=c[++i])&&!(j instanceof a))continue;if(i>=c.length)return\"\";if(c.length===1){g=c[0].compile(b,v);if(d)return g;return\"\"+bf(\"slice\")+\".call(\"+g+\")\"}e=c.slice(i);for(h=0,k=e.length;h<k;h++)j=e[h],g=j.compile(b,v),e[h]=j instanceof a?\"\"+bf(\"slice\")+\".call(\"+g+\")\":\"[\"+g+\"]\";if(i===0)return e[0]+(\".concat(\"+e.slice(1).join(\", \")+\")\");f=function(){var a,d,e,f;e=c.slice(0,i),f=[];for(a=0,d=e.length;a<d;a++)j=e[a],f.push(j.compile(b,v));return f}();return\"[\"+f.join(\", \")+\"].concat(\"+e.join(\", \")+\")\"};return a}(),a.While=V=function(){function a(a,b){this.condition=(b!=null?b.invert:void 0)?a.invert():a,this.guard=b!=null?b.guard:void 0}bi(a,e),a.prototype.children=[\"condition\",\"guard\",\"body\"],a.prototype.isStatement=W,a.prototype.makeReturn=function(){this.returns=!0;return this},a.prototype.addBody=function(a){this.body=a;return this},a.prototype.jumps=function(){var a,b,c,d;a=this.body.expressions;if(!a.length)return!1;for(c=0,d=a.length;c<d;c++){b=a[c];if(b.jumps({loop:!0}))return b}return!1},a.prototype.compileNode=function(a){var b,c,d,e;a.indent+=O,e=\"\",b=this.body;if(b.isEmpty())b=\"\";else{if(a.level>y||this.returns)d=a.scope.freeVariable(\"results\"),e=\"\"+this.tab+d+\" = [];\\n\",b&&(b=G.wrap(d,b));this.guard&&(b=f.wrap([new q(this.guard,b)])),b=\"\\n\"+b.compile(a,y)+\"\\n\"+this.tab}c=e+this.tab+(\"while (\"+this.condition.compile(a,x)+\") {\"+b+\"}\"),this.returns&&(c+=\"\\n\"+this.tab+\"return \"+d+\";\");return c};return a}(),a.Op=D=function(){function c(b,c,d,e){if(b===\"in\")return new r(c,d);if(b===\"do\")return new g(c,c.params||[]);if(b===\"new\"){if(c instanceof g)return c.newInstance();c instanceof j&&c.bound&&(c=new F(c))}this.operator=a[b]||b,this.first=c,this.second=d,this.flip=!!e;return this}var a,b;bi(c,e),a={\"==\":\"===\",\"!=\":\"!==\",of:\"in\"},b={\"!==\":\"===\",\"===\":\"!==\"},c.prototype.children=[\"first\",\"second\"],c.prototype.isSimpleNumber=B,c.prototype.isUnary=function(){return!this.second},c.prototype.isChainable=function(){var a;return(a=this.operator)===\"<\"||a===\">\"||a===\">=\"||a===\"<=\"||a===\"===\"||a===\"!==\"},c.prototype.invert=function(){var a,d,e,f,g;if(this.isChainable()&&this.first.isChainable()){a=!0,d=this;while(d&&d.operator)a&&(a=d.operator in b),d=d.first;if(!a)return(new F(this)).invert();d=this;while(d&&d.operator)d.invert=!d.invert,d.operator=b[d.operator],d=d.first;return this}if(f=b[this.operator]){this.operator=f,this.first.unwrap()instanceof c&&this.first.invert();return this}return this.second?(new F(this)).invert():this.operator===\"!\"&&(e=this.first.unwrap())instanceof c&&((g=e.operator)===\"!\"||g===\"in\"||g===\"instanceof\")?e:new c(\"!\",this)},c.prototype.unfoldSoak=function(a){var b;return((b=this.operator)===\"++\"||b===\"--\"||b===\"delete\")&&be(a,this,\"first\")},c.prototype.compileNode=function(a){var b;if(this.isUnary())return this.compileUnary(a);if(this.isChainable()&&this.first.isChainable())return this.compileChain(a);if(this.operator===\"?\")return this.compileExistence(a);this.first.front=this.front,b=this.first.compile(a,w)+\" \"+this.operator+\" \"+this.second.compile(a,w);return a.level>w?\"(\"+b+\")\":b},c.prototype.compileChain=function(a){var b,c,d,e;e=this.first.second.cache(a),this.first.second=e[0],d=e[1],c=this.first.compile(a,w),b=\"\"+c+\" \"+(this.invert?\"&&\":\"||\")+\" \"+d.compile(a)+\" \"+this.operator+\" \"+this.second.compile(a,w);return\"(\"+b+\")\"},c.prototype.compileExistence=function(a){var b,c;this.first.isComplex()?(c=a.scope.freeVariable(\"ref\"),b=new F(new d(new z(c),this.first))):(b=this.first,c=b.compile(a));return(new l(b)).compile(a)+(\" ? \"+c+\" : \"+this.second.compile(a,v))},c.prototype.compileUnary=function(a){var b,d;d=[b=this.operator],(b===\"new\"||b===\"typeof\"||b===\"delete\"||(b===\"+\"||b===\"-\")&&this.first instanceof c&&this.first.operator===b)&&d.push(\" \"),d.push(this.first.compile(a,w)),this.flip&&d.reverse();return d.join(\"\")},c.prototype.toString=function(a){return c.__super__.toString.call(this,a,this.constructor.name+\" \"+this.operator)};return c}(),a.In=r=function(){function a(a,b){this.object=a,this.array=b}bi(a,e),a.prototype.children=[\"object\",\"array\"],a.prototype.invert=A,a.prototype.compileNode=function(a){return this.array instanceof U&&this.array.isArray()?this.compileOrTest(a):this.compileLoopTest(a)},a.prototype.compileOrTest=function(a){var b,c,d,e,f,g,h,i,j;i=this.object.cache(a,w),g=i[0],f=i[1],j=this.negated?[\" !== \",\" && \"]:[\" === \",\" || \"],b=j[0],c=j[1],h=function(){var c,h,i;h=this.array.base.objects,i=[];for(d=0,c=h.length;d<c;d++)e=h[d],i.push((d?f:g)+b+e.compile(a,w));return i}.call(this),h=h.join(c);return a.level<w?h:\"(\"+h+\")\"},a.prototype.compileLoopTest=function(a){var b,c,d,e;e=this.object.cache(a,v),d=e[0],c=e[1],b=bf(\"indexOf\")+(\".call(\"+this.array.compile(a,v)+\", \"+c+\") \")+(this.negated?\"< 0\":\">= 0\");if(d===c)return b;b=d+\", \"+b;return a.level<v?b:\"(\"+b+\")\"},a.prototype.toString=function(b){return a.__super__.toString.call(this,b,this.constructor.name+(this.negated?\"!\":\"\"))};return a}(),a.Try=S=function(){function a(a,b,c,d){this.attempt=a,this.error=b,this.recovery=c,this.ensure=d}bi(a,e),a.prototype.children=[\"attempt\",\"recovery\",\"ensure\"],a.prototype.isStatement=W,a.prototype.jumps=function(a){var b;return this.attempt.jumps(a)||((b=this.recovery)!=null?b.jumps(a):void 0)},a.prototype.makeReturn=function(){this.attempt&&(this.attempt=this.attempt.makeReturn()),this.recovery&&(this.recovery=this.recovery.makeReturn());return this},a.prototype.compileNode=function(a){var b,c;a.indent+=O,c=this.error?\" (\"+this.error.compile(a)+\") \":\" \",b=this.recovery?\" catch\"+c+\"{\\n\"+this.recovery.compile(a,y)+\"\\n\"+this.tab+\"}\":!this.ensure&&!this.recovery?\" catch (_e) {}\":void 0;return\"\"+this.tab+\"try {\\n\"+this.attempt.compile(a,y)+\"\\n\"+this.tab+\"}\"+(b||\"\")+(this.ensure?\" finally {\\n\"+this.ensure.compile(a,y)+\"\\n\"+this.tab+\"}\":\"\")};return a}(),a.Throw=R=function(){function a(a){this.expression=a}bi(a,e),a.prototype.children=[\"expression\"],a.prototype.isStatement=W,a.prototype.jumps=B,a.prototype.makeReturn=P,a.prototype.compileNode=function(a){return this.tab+(\"throw \"+this.expression.compile(a)+\";\")};return a}(),a.Existence=l=function(){function a(a){this.expression=a}bi(a,e),a.prototype.children=[\"expression\"],a.prototype.invert=A,a.prototype.compileNode=function(a){var b,c;b=this.expression.compile(a,w),b=o.test(b)&&!a.scope.check(b)?this.negated?\"typeof \"+b+' == \"undefined\" || '+b+\" === null\":\"typeof \"+b+' != \"undefined\" && '+b+\" !== null\":(c=this.negated?\"==\":\"!=\",\"\"+b+\" \"+c+\" null\");return a.level>u?\"(\"+b+\")\":b};return a}(),a.Parens=F=function(){function a(a){this.body=a}bi(a,e),a.prototype.children=[\"body\"],a.prototype.unwrap=function(){return this.body},a.prototype.isComplex=function(){return this.body.isComplex()},a.prototype.makeReturn=function(){return this.body.makeReturn()},a.prototype.compileNode=function(a){var b,c,d;d=this.body.unwrap();if(d instanceof U&&d.isAtomic()){d.front=this.front;return d.compile(a)}c=d.compile(a,x),b=a.level<w&&(d instanceof D||d instanceof g||d instanceof n&&d.returns);return b?c:\"(\"+c+\")\"};return a}(),a.For=n=function(){function a(a,b){var c;this.source=b.source,this.guard=b.guard,this.step=b.step,this.name=b.name,this.index=b.index,this.body=f.wrap([a]),this.own=!!b.own,this.object=!!b.object,this.object&&(c=[this.index,this.name],this.name=c[0],this.index=c[1]);if(this.index instanceof U)throw SyntaxError(\"index cannot be a pattern matching expression\");this.range=this.source instanceof U&&this.source.base instanceof H&&!this.source.properties.length,this.pattern=this.name instanceof U;if(this.range&&this.index)throw SyntaxError(\"indexes do not apply to range loops\");if(this.range&&this.pattern)throw SyntaxError(\"cannot pattern match over range loops\");this.returns=!1}bi(a,e),a.prototype.children=[\"body\",\"source\",\"guard\",\"step\"],a.prototype.isStatement=W,a.prototype.jumps=V.prototype.jumps,a.prototype.makeReturn=function(){this.returns=!0;return this},a.prototype.compileNode=function(a){var b,c,e,g,h,i,j,k,l,m,n,p,r,s,t,u,x,A,B,C,D;b=f.wrap([this.body]),k=(D=ba(b.expressions))!=null?D.jumps():void 0,k&&k instanceof I&&(this.returns=!1),x=this.range?this.source.base:this.source,u=a.scope,m=this.name&&this.name.compile(a,v),i=this.index&&this.index.compile(a,v),m&&!this.pattern&&u.find(m,{immediate:!0}),i&&u.find(i,{immediate:!0}),this.returns&&(t=u.freeVariable(\"results\")),j=(this.range?m:i)||u.freeVariable(\"i\"),this.pattern&&(m=j),C=\"\",g=\"\",c=\"\",h=this.tab+O,this.range?e=x.compile(bb(a,{index:j,step:this.step})):(B=this.source.compile(a,v),(m||this.own)&&!o.test(B)&&(c=\"\"+this.tab+(p=u.freeVariable(\"ref\"))+\" = \"+B+\";\\n\",B=p),m&&!this.pattern&&(n=\"\"+m+\" = \"+B+\"[\"+j+\"]\"),this.object||(l=u.freeVariable(\"len\"),A=this.step?\"\"+j+\" += \"+this.step.compile(a,w):\"\"+j+\"++\",e=\"\"+j+\" = 0, \"+l+\" = \"+B+\".length; \"+j+\" < \"+l+\"; \"+A)),this.returns&&(r=\"\"+this.tab+t+\" = [];\\n\",s=\"\\n\"+this.tab+\"return \"+t+\";\",b=G.wrap(t,b)),this.guard&&(b=f.wrap([new q(this.guard,b)])),this.pattern&&b.expressions.unshift(new d(this.name,new z(\"\"+B+\"[\"+j+\"]\"))),c+=this.pluckDirectCall(a,b),n&&(C=\"\\n\"+h+n+\";\"),this.object&&(e=\"\"+j+\" in \"+B,this.own&&(g=\"\\n\"+h+\"if (!\"+bf(\"hasProp\")+\".call(\"+B+\", \"+j+\")) continue;\")),b=b.compile(bb(a,{indent:h}),y),b&&(b=\"\\n\"+b+\"\\n\");return\"\"+c+(r||\"\")+this.tab+\"for (\"+e+\") {\"+g+C+b+this.tab+\"}\"+(s||\"\")},a.prototype.pluckDirectCall=function(a,b){var c,e,f,h,i,k,l,m,n,o,p,q,r,s;e=\"\",n=b.expressions;for(i=0,m=n.length;i<m;i++){f=n[i],f=f.unwrapAll();if(!(f instanceof g))continue;l=f.variable.unwrapAll();if(!(l instanceof j||l instanceof U&&((o=l.base)!=null?o.unwrapAll():void 0)instanceof j&&l.properties.length===1&&((p=(q=l.properties[0].name)!=null?q.value:void 0)===\"call\"||p===\"apply\")))continue;h=((r=l.base)!=null?r.unwrapAll():void 0)||l,k=new z(a.scope.freeVariable(\"fn\")),c=new U(k),l.base&&(s=[c,l],l.base=s[0],c=s[1],args.unshift(new z(\"this\"))),b.expressions[i]=new g(c,f.args),e+=this.tab+(new d(k,h)).compile(a,y)+\";\\n\"}return e};return a}(),a.Switch=N=function(){function a(a,b,c){this.subject=a,this.cases=b,this.otherwise=c}bi(a,e),a.prototype.children=[\"subject\",\"cases\",\"otherwise\"],a.prototype.isStatement=W,a.prototype.jumps=function(a){var b,c,d,e,f,g,h;a==null&&(a={block:!0}),f=this.cases;for(d=0,e=f.length;d<e;d++){g=f[d],c=g[0],b=g[1];if(b.jumps(a))return b}return(h=this.otherwise)!=null?h.jumps(a):void 0},a.prototype.makeReturn=function(){var a,b,c,d,e;d=this.cases;for(b=0,c=d.length;b<c;b++)a=d[b],a[1].makeReturn();(e=this.otherwise)!=null&&e.makeReturn();return this},a.prototype.compileNode=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;i=a.indent+O,j=a.indent=i+O,d=this.tab+(\"switch (\"+(((n=this.subject)!=null?n.compile(a,x):void 0)||!1)+\") {\\n\"),o=this.cases;for(h=0,l=o.length;h<l;h++){p=o[h],f=p[0],b=p[1],q=_([f]);for(k=0,m=q.length;k<m;k++)e=q[k],this.subject||(e=e.invert()),d+=i+(\"case \"+e.compile(a,x)+\":\\n\");if(c=b.compile(a,y))d+=c+\"\\n\";if(h===this.cases.length-1&&!this.otherwise)break;g=this.lastNonComment(b.expressions);if(g instanceof I||g instanceof z&&g.jumps()&&g.value!==\"debugger\")continue;d+=j+\"break;\\n\"}this.otherwise&&this.otherwise.expressions.length&&(d+=i+(\"default:\\n\"+this.otherwise.compile(a,y)+\"\\n\"));return d+this.tab+\"}\"};return a}(),a.If=q=function(){function a(a,b,c){this.body=b,c==null&&(c={}),this.condition=c.type===\"unless\"?a.invert():a,this.elseBody=null,this.isChain=!1,this.soak=c.soak}bi(a,e),a.prototype.children=[\"condition\",\"body\",\"elseBody\"],a.prototype.bodyNode=function(){var a;return(a=this.body)!=null?a.unwrap():void 0},a.prototype.elseBodyNode=function(){var a;return(a=this.elseBody)!=null?a.unwrap():void 0},a.prototype.addElse=function(b){this.isChain?this.elseBodyNode().addElse(b):(this.isChain=b instanceof a,this.elseBody=this.ensureBlock(b));return this},a.prototype.isStatement=function(a){var b;return(a!=null?a.level:void 0)===y||this.bodyNode().isStatement(a)||((b=this.elseBodyNode())!=null?b.isStatement(a):void 0)},a.prototype.jumps=function(a){var b;return this.body.jumps(a)||((b=this.elseBody)!=null?b.jumps(a):void 0)},a.prototype.compileNode=function(a){return this.isStatement(a)?this.compileStatement(a):this.compileExpression(a)},a.prototype.makeReturn=function(){this.body&&(this.body=new f([this.body.makeReturn()])),this.elseBody&&(this.elseBody=new f([this.elseBody.makeReturn()]));return this},a.prototype.ensureBlock=function(a){return a instanceof f?a:new f([a])},a.prototype.compileStatement=function(a){var b,c,d,e;c=Y(a,\"chainChild\"),d=this.condition.compile(a,x),a.indent+=O,b=this.ensureBlock(this.body).compile(a),b&&(b=\"\\n\"+b+\"\\n\"+this.tab),e=\"if (\"+d+\") {\"+b+\"}\",c||(e=this.tab+e);if(!this.elseBody)return e;return e+\" else \"+(this.isChain?(a.indent=this.tab,a.chainChild=!0,this.elseBody.unwrap().compile(a,y)):\"{\\n\"+this.elseBody.compile(a,y)+\"\\n\"+this.tab+\"}\")},a.prototype.compileExpression=function(a){var b,c,d,e;e=this.condition.compile(a,u),c=this.bodyNode().compile(a,v),b=this.elseBodyNode()?this.elseBodyNode().compile(a,v):\"void 0\",d=\"\"+e+\" ? \"+c+\" : \"+b;return a.level<u?d:\"(\"+d+\")\"},a.prototype.unfoldSoak=function(){return this.soak&&this};return a}(),G={wrap:function(a,c){if(c.isEmpty()||ba(c.expressions).jumps())return c;return c.push(new g(new U(new z(a),[new b(new z(\"push\"))]),[c.pop()]))}},i={wrap:function(a,c,d){var e,h,i,k,l;if(a.jumps())return a;i=new j([],f.wrap([a])),e=[];if((k=a.contains(this.literalArgs))||a.contains(this.literalThis))l=new z(k?\"apply\":\"call\"),e=[new z(\"this\")],k&&e.push(new z(\"arguments\")),i=new U(i,[new b(l)]);i.noReturn=d,h=new g(i,e);return c?f.wrap([h]):h},literalArgs:function(a){return a instanceof z&&a.value===\"arguments\"&&!a.asKey},literalThis:function(a){return a instanceof z&&a.value===\"this\"&&!a.asKey||a instanceof j&&a.bound}},be=function(a,b,c){var d;if(d=b[c].unfoldSoak(a)){b[c]=d.body,d.body=new U(b);return d}},T={\"extends\":\"function(child, parent) {\\n for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }\\n function ctor() { this.constructor = child; }\\n ctor.prototype = parent.prototype;\\n child.prototype = new ctor;\\n child.__super__ = parent.prototype;\\n return child;\\n}\",bind:\"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }\",indexOf:\"Array.prototype.indexOf || function(item) {\\n for (var i = 0, l = this.length; i < l; i++) {\\n if (this[i] === item) return i;\\n }\\n return -1;\\n}\",hasProp:\"Object.prototype.hasOwnProperty\",slice:\"Array.prototype.slice\"},y=1,x=2,v=3,u=4,w=5,t=6,O=\" \",Q=/[ \\t]+$/gm,o=/^[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*$/,J=/^[+-]?\\d+$/,p=/^['\"]/,bf=function(a){var b;b=\"__\"+a,K.root.assign(b,T[a]);return b},bc=function(a,b){return a.replace(/\\n/g,\"$&\"+b)}}).call(this)},require[\"./coffee-script\"]=new function(){var exports=this;(function(){var Lexer,RESERVED,compile,fs,lexer,parser,path,_ref;fs=require(\"fs\"),path=require(\"path\"),_ref=require(\"./lexer\"),Lexer=_ref.Lexer,RESERVED=_ref.RESERVED,parser=require(\"./parser\").parser,require.extensions?require.extensions[\".coffee\"]=function(a,b){var c;c=compile(fs.readFileSync(b,\"utf8\"));return a._compile(c,b)}:require.registerExtension&&require.registerExtension(\".coffee\",function(a){return compile(a)}),exports.VERSION=\"1.0.1\",exports.RESERVED=RESERVED,exports.helpers=require(\"./helpers\"),exports.compile=compile=function(a,b){b==null&&(b={});try{return parser.parse(lexer.tokenize(a)).compile(b)}catch(c){b.filename&&(c.message=\"In \"+b.filename+\", \"+c.message);throw c}},exports.tokens=function(a,b){return lexer.tokenize(a,b)},exports.nodes=function(a,b){return typeof a===\"string\"?parser.parse(lexer.tokenize(a,b)):parser.parse(a)},exports.run=function(a,b){var c;c=module;while(c.parent)c=c.parent;c.filename=b.filename?fs.realpathSync(b.filename):\".\",c.moduleCache&&(c.moduleCache={});return path.extname(c.filename)!==\".coffee\"||require.extensions?c._compile(compile(a,b),c.filename):c._compile(a,c.filename)},exports.eval=function(code,options){var __dirname,__filename;__filename=module.filename=options.filename,__dirname=path.dirname(__filename);return eval(compile(code,options))},lexer=new Lexer,parser.lexer={lex:function(){var a,b;b=this.tokens[this.pos++]||[\"\"],a=b[0],this.yytext=b[1],this.yylineno=b[2];return a},setInput:function(a){this.tokens=a;return this.pos=0},upcomingInput:function(){return\"\"}},parser.yy=require(\"./nodes\")}).call(this)},require[\"./browser\"]=new function(){var exports=this;(function(){var CoffeeScript,runScripts;CoffeeScript=require(\"./coffee-script\"),CoffeeScript.require=require,CoffeeScript.eval=function(code,options){return eval(CoffeeScript.compile(code,options))},CoffeeScript.run=function(a,b){b==null&&(b={}),b.bare=!0;return Function(CoffeeScript.compile(a,b))()};typeof window!=\"undefined\"&&window!==null&&(CoffeeScript.load=function(a,b){var c;c=new(window.ActiveXObject||XMLHttpRequest)(\"Microsoft.XMLHTTP\"),c.open(\"GET\",a,!0),\"overrideMimeType\"in c&&c.overrideMimeType(\"text/plain\"),c.onreadystatechange=function(){if(c.readyState===4)return CoffeeScript.run(c.responseText,b)};return c.send(null)},runScripts=function(){var a,b,c,d;d=document.getElementsByTagName(\"script\");for(b=0,c=d.length;b<c;b++)a=d[b],a.type===\"text/coffeescript\"&&(a.src?CoffeeScript.load(a.src):CoffeeScript.run(a.innerHTML));return null},window.addEventListener?addEventListener(\"DOMContentLoaded\",runScripts,!1):attachEvent(\"onload\",runScripts))}).call(this)};return require[\"./coffee-script\"]}()\n;\nvar __slice = Array.prototype.slice;\n(function() {\n var hslParser, hslToRgb, lookup, names, normalizeKey, parseHSL, parseHex, parseRGB, rgbParser, shiftLightness;\n rgbParser = /^rgba?\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3}),?\\s*(\\d?\\.?\\d*)?\\)$/;\n hslParser = /^hsla?\\((\\d{1,3}),\\s*(\\d?\\.?\\d*),\\s*(\\d?\\.?\\d*),?\\s*(\\d?\\.?\\d*)?\\)$/;\n parseHex = function(hexString) {\n var _result, i, rgb;\n hexString = hexString.replace(/#/, '');\n switch (hexString.length) {\n case 3:\n case 4:\n rgb = (function() {\n _result = [];\n for (i = 0; i <= 2; i++) {\n _result.push(parseInt(hexString.substr(i, 1), 16) * 0x11);\n }\n return _result;\n })();\n return rgb.concat(hexString.substr(3, 1).length ? (parseInt(hexString.substr(3, 1), 16) * 0x11) / 255.0 : 1.0);\n case 6:\n case 8:\n rgb = (function() {\n _result = [];\n for (i = 0; i <= 2; i++) {\n _result.push(parseInt(hexString.substr(2 * i, 2), 16));\n }\n return _result;\n })();\n return rgb.concat(hexString.substr(6, 2).length ? parseInt(hexString.substr(6, 2), 16) / 255.0 : 1.0);\n default:\n return undefined;\n }\n };\n parseRGB = function(colorString) {\n var _ref, bits, rgbMap;\n if (!(bits = rgbParser.exec(colorString))) {\n return undefined;\n }\n rgbMap = bits.splice(1, 3).map(function(channel) {\n return parseFloat(channel);\n });\n return rgbMap.concat((typeof (_ref = bits[1]) !== \"undefined\" && _ref !== null) ? parseFloat(bits[1]) : 1.0);\n };\n parseHSL = function(colorString) {\n var _ref, bits, hslMap;\n if (!(bits = hslParser.exec(colorString))) {\n return undefined;\n }\n hslMap = bits.splice(1, 3).map(function(channel) {\n return parseFloat(channel);\n });\n return hslToRgb(hslMap.concat((typeof (_ref = bits[1]) !== \"undefined\" && _ref !== null) ? parseFloat(bits[1]) : 1.0));\n };\n shiftLightness = function(amount, obj) {\n var hsl;\n hsl = obj.toHsl();\n hsl[2] = hsl[2] + amount;\n return Color(hslToRgb(hsl));\n };\n hslToRgb = function(hsl) {\n var a, b, g, h, hueToRgb, l, p, q, r, rgbMap, s;\n h = hsl[0] / 360.0;\n s = hsl[1];\n l = hsl[2];\n a = (hsl[3] ? parseFloat(hsl[3]) : 1.0);\n r = (g = (b = null));\n hueToRgb = function(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * 6 * t;\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n };\n if (s === 0) {\n r = (g = (b = l));\n } else {\n q = (l < 0.5 ? l * (1 + s) : l + s - l * s);\n p = 2 * l - q;\n r = hueToRgb(p, q, h + 1 / 3);\n g = hueToRgb(p, q, h);\n b = hueToRgb(p, q, h - 1 / 3);\n rgbMap = [r, g, b].map(function(channel) {\n return channel * 0xFF;\n });\n }\n return rgbMap.concat(a);\n };\n normalizeKey = function(key) {\n return key.toString().toLowerCase().split(' ').join('');\n };\n window.Color = function() {\n var _ref, alpha, args, arr, channels, color, parsedColor, rgbMap, self;\n args = __slice.call(arguments, 0);\n color = args.first();\n if ((typeof color === \"undefined\" || color === null) ? undefined : color.channels) {\n return Color(color.channels());\n }\n parsedColor = null;\n if (args.length === 0) {\n parsedColor = [0, 0, 0, 1];\n } else if (args.length === 1 && Object.isArray(args.first())) {\n arr = args.first();\n rgbMap = arr.splice(0, 3).map(function(channel) {\n return parseFloat(channel);\n });\n alpha = (typeof (_ref = arr[0]) !== \"undefined\" && _ref !== null) ? parseFloat(arr[0]) : 1.0;\n parsedColor = rgbMap.concat(alpha);\n } else if (args.length === 2) {\n color = args[0];\n alpha = args[1];\n if (Object.isArray(color)) {\n rgbMap = color.splice(0, 3).map(function(channel) {\n return parseFloat(channel);\n });\n parsedColor = rgbMap.concat(parseFloat(alpha));\n } else {\n parsedColor = lookup[normalizeKey(color)] || parseHex(color) || parseRGB(color) || parseHSL(color);\n parsedColor[3] = alpha;\n }\n } else if (args.length > 2) {\n rgbMap = args.splice(0, 3).map(function(channel) {\n return parseFloat(channel);\n });\n alpha = (typeof (_ref = args.first()) !== \"undefined\" && _ref !== null) ? args.first() : 1.0;\n parsedColor = rgbMap.concat(parseFloat(alpha));\n } else {\n color = args.first();\n parsedColor = lookup[normalizeKey(color)] || parseHex(color) || parseRGB(color) || parseHSL(color);\n }\n if (!(parsedColor)) {\n throw (\"\" + (args.join(',')) + \" is an unknown color\");\n }\n rgbMap = parsedColor.splice(0, 3).map(function(channel) {\n return channel.round();\n });\n alpha = ((typeof (_ref = parsedColor.first()) !== \"undefined\" && _ref !== null) ? parseFloat(parsedColor.first()) : 1.0);\n channels = rgbMap.concat(alpha);\n self = {\n channels: function() {\n return channels.copy();\n },\n r: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[0] = val;\n return self;\n } else {\n return channels[0];\n }\n },\n g: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[1] = val;\n return self;\n } else {\n return channels[1];\n }\n },\n b: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[2] = val;\n return self;\n } else {\n return channels[2];\n }\n },\n a: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[3] = val;\n return self;\n } else {\n return channels[3];\n }\n },\n equals: function(other) {\n return other.r() === self.r() && other.g() === self.g() && other.b() === self.b() && other.a() === self.a();\n },\n lighten: function(amount) {\n return shiftLightness(amount, self);\n },\n darken: function(amount) {\n return shiftLightness(-amount, self);\n },\n rgba: function() {\n return \"rgba(\" + (self.r()) + \", \" + (self.g()) + \", \" + (self.b()) + \", \" + (self.a()) + \")\";\n },\n desaturate: function(amount) {\n var hsl;\n hsl = self.toHsl();\n hsl[1] -= amount;\n return Color(hslToRgb(hsl));\n },\n saturate: function(amount) {\n var hsl;\n hsl = self.toHsl();\n hsl[1] += amount;\n return Color(hslToRgb(hsl));\n },\n grayscale: function() {\n var g, hsl;\n hsl = self.toHsl();\n g = hsl[2] * 255;\n return Color(g, g, g);\n },\n hue: function(degrees) {\n var hsl;\n hsl = self.toHsl();\n hsl[0] = (hsl[0] + degrees) % 360;\n return Color(hslToRgb(hsl));\n },\n complement: function() {\n var hsl;\n hsl = self.toHsl();\n return self.hue(180);\n },\n toHex: function() {\n var hexFromNumber, hexString, padString;\n hexString = function(number) {\n return number.toString(16);\n };\n padString = function(hexString) {\n var pad;\n if (hexString.length === 1) {\n pad = \"0\";\n }\n return (pad || \"\") + hexString;\n };\n hexFromNumber = function(number) {\n return padString(hexString(number));\n };\n return \"#\" + (hexFromNumber(channels[0])) + (hexFromNumber(channels[1])) + (hexFromNumber(channels[2]));\n },\n toHsl: function() {\n var _ref2, b, delta, g, hue, lightness, max, min, r, saturation;\n _ref2 = channels.map(function(channel) {\n return channel / 255.0;\n });\n r = _ref2[0];\n g = _ref2[1];\n b = _ref2[2];\n min = Math.min(r, g, b);\n max = Math.max(r, g, b);\n hue = (saturation = (lightness = (max + min) / 2.0));\n if (max === min) {\n hue = (saturation = 0);\n } else {\n delta = max - min;\n saturation = (lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min));\n switch (max) {\n case r:\n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g:\n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n hue *= 60;\n }\n return [hue, saturation, lightness, channels[3]];\n },\n toString: function() {\n return self.rgba();\n }\n };\n return self;\n };\n lookup = {};\n names = [[\"000000\", \"Black\"], [\"000080\", \"Navy Blue\"], [\"0000C8\", \"Dark Blue\"], [\"0000FF\", \"Blue\"], [\"000741\", \"Stratos\"], [\"001B1C\", \"Swamp\"], [\"002387\", \"Resolution Blue\"], [\"002900\", \"Deep Fir\"], [\"002E20\", \"Burnham\"], [\"002FA7\", \"International Klein Blue\"], [\"003153\", \"Prussian Blue\"], [\"003366\", \"Midnight Blue\"], [\"003399\", \"Smalt\"], [\"003532\", \"Deep Teal\"], [\"003E40\", \"Cyprus\"], [\"004620\", \"Kaitoke Green\"], [\"0047AB\", \"Cobalt\"], [\"004816\", \"Crusoe\"], [\"004950\", \"Sherpa Blue\"], [\"0056A7\", \"Endeavour\"], [\"00581A\", \"Camarone\"], [\"0066CC\", \"Science Blue\"], [\"0066FF\", \"Blue Ribbon\"], [\"00755E\", \"Tropical Rain Forest\"], [\"0076A3\", \"Allports\"], [\"007BA7\", \"Deep Cerulean\"], [\"007EC7\", \"Lochmara\"], [\"007FFF\", \"Azure Radiance\"], [\"008080\", \"Teal\"], [\"0095B6\", \"Bondi Blue\"], [\"009DC4\", \"Pacific Blue\"], [\"00A693\", \"Persian Green\"], [\"00A86B\", \"Jade\"], [\"00CC99\", \"Caribbean Green\"], [\"00CCCC\", \"Robin's Egg Blue\"], [\"00FF00\", \"Green\"], [\"00FF7F\", \"Spring Green\"], [\"00FFFF\", \"Cyan / Aqua\"], [\"010D1A\", \"Blue Charcoal\"], [\"011635\", \"Midnight\"], [\"011D13\", \"Holly\"], [\"012731\", \"Daintree\"], [\"01361C\", \"Cardin Green\"], [\"01371A\", \"County Green\"], [\"013E62\", \"Astronaut Blue\"], [\"013F6A\", \"Regal Blue\"], [\"014B43\", \"Aqua Deep\"], [\"015E85\", \"Orient\"], [\"016162\", \"Blue Stone\"], [\"016D39\", \"Fun Green\"], [\"01796F\", \"Pine Green\"], [\"017987\", \"Blue Lagoon\"], [\"01826B\", \"Deep Sea\"], [\"01A368\", \"Green Haze\"], [\"022D15\", \"English Holly\"], [\"02402C\", \"Sherwood Green\"], [\"02478E\", \"Congress Blue\"], [\"024E46\", \"Evening Sea\"], [\"026395\", \"Bahama Blue\"], [\"02866F\", \"Observatory\"], [\"02A4D3\", \"Cerulean\"], [\"03163C\", \"Tangaroa\"], [\"032B52\", \"Green Vogue\"], [\"036A6E\", \"Mosque\"], [\"041004\", \"Midnight Moss\"], [\"041322\", \"Black Pearl\"], [\"042E4C\", \"Blue Whale\"], [\"044022\", \"Zuccini\"], [\"044259\", \"Teal Blue\"], [\"051040\", \"Deep Cove\"], [\"051657\", \"Gulf Blue\"], [\"055989\", \"Venice Blue\"], [\"056F57\", \"Watercourse\"], [\"062A78\", \"Catalina Blue\"], [\"063537\", \"Tiber\"], [\"069B81\", \"Gossamer\"], [\"06A189\", \"Niagara\"], [\"073A50\", \"Tarawera\"], [\"080110\", \"Jaguar\"], [\"081910\", \"Black Bean\"], [\"082567\", \"Deep Sapphire\"], [\"088370\", \"Elf Green\"], [\"08E8DE\", \"Bright Turquoise\"], [\"092256\", \"Downriver\"], [\"09230F\", \"Palm Green\"], [\"09255D\", \"Madison\"], [\"093624\", \"Bottle Green\"], [\"095859\", \"Deep Sea Green\"], [\"097F4B\", \"Salem\"], [\"0A001C\", \"Black Russian\"], [\"0A480D\", \"Dark Fern\"], [\"0A6906\", \"Japanese Laurel\"], [\"0A6F75\", \"Atoll\"], [\"0B0B0B\", \"Cod Gray\"], [\"0B0F08\", \"Marshland\"], [\"0B1107\", \"Gordons Green\"], [\"0B1304\", \"Black Forest\"], [\"0B6207\", \"San Felix\"], [\"0BDA51\", \"Malachite\"], [\"0C0B1D\", \"Ebony\"], [\"0C0D0F\", \"Woodsmoke\"], [\"0C1911\", \"Racing Green\"], [\"0C7A79\", \"Surfie Green\"], [\"0C8990\", \"Blue Chill\"], [\"0D0332\", \"Black Rock\"], [\"0D1117\", \"Bunker\"], [\"0D1C19\", \"Aztec\"], [\"0D2E1C\", \"Bush\"], [\"0E0E18\", \"Cinder\"], [\"0E2A30\", \"Firefly\"], [\"0F2D9E\", \"Torea Bay\"], [\"10121D\", \"Vulcan\"], [\"101405\", \"Green Waterloo\"], [\"105852\", \"Eden\"], [\"110C6C\", \"Arapawa\"], [\"120A8F\", \"Ultramarine\"], [\"123447\", \"Elephant\"], [\"126B40\", \"Jewel\"], [\"130000\", \"Diesel\"], [\"130A06\", \"Asphalt\"], [\"13264D\", \"Blue Zodiac\"], [\"134F19\", \"Parsley\"], [\"140600\", \"Nero\"], [\"1450AA\", \"Tory Blue\"], [\"151F4C\", \"Bunting\"], [\"1560BD\", \"Denim\"], [\"15736B\", \"Genoa\"], [\"161928\", \"Mirage\"], [\"161D10\", \"Hunter Green\"], [\"162A40\", \"Big Stone\"], [\"163222\", \"Celtic\"], [\"16322C\", \"Timber Green\"], [\"163531\", \"Gable Green\"], [\"171F04\", \"Pine Tree\"], [\"175579\", \"Chathams Blue\"], [\"182D09\", \"Deep Forest Green\"], [\"18587A\", \"Blumine\"], [\"19330E\", \"Palm Leaf\"], [\"193751\", \"Nile Blue\"], [\"1959A8\", \"Fun Blue\"], [\"1A1A68\", \"Lucky Point\"], [\"1AB385\", \"Mountain Meadow\"], [\"1B0245\", \"Tolopea\"], [\"1B1035\", \"Haiti\"], [\"1B127B\", \"Deep Koamaru\"], [\"1B1404\", \"Acadia\"], [\"1B2F11\", \"Seaweed\"], [\"1B3162\", \"Biscay\"], [\"1B659D\", \"Matisse\"], [\"1C1208\", \"Crowshead\"], [\"1C1E13\", \"Rangoon Green\"], [\"1C39BB\", \"Persian Blue\"], [\"1C402E\", \"Everglade\"], [\"1C7C7D\", \"Elm\"], [\"1D6142\", \"Green Pea\"], [\"1E0F04\", \"Creole\"], [\"1E1609\", \"Karaka\"], [\"1E1708\", \"El Paso\"], [\"1E385B\", \"Cello\"], [\"1E433C\", \"Te Papa Green\"], [\"1E90FF\", \"Dodger Blue\"], [\"1E9AB0\", \"Eastern Blue\"], [\"1F120F\", \"Night Rider\"], [\"1FC2C2\", \"Java\"], [\"20208D\", \"Jacksons Purple\"], [\"202E54\", \"Cloud Burst\"], [\"204852\", \"Blue Dianne\"], [\"211A0E\", \"Eternity\"], [\"220878\", \"Deep Blue\"], [\"228B22\", \"Forest Green\"], [\"233418\", \"Mallard\"], [\"240A40\", \"Violet\"], [\"240C02\", \"Kilamanjaro\"], [\"242A1D\", \"Log Cabin\"], [\"242E16\", \"Black Olive\"], [\"24500F\", \"Green House\"], [\"251607\", \"Graphite\"], [\"251706\", \"Cannon Black\"], [\"251F4F\", \"Port Gore\"], [\"25272C\", \"Shark\"], [\"25311C\", \"Green Kelp\"], [\"2596D1\", \"Curious Blue\"], [\"260368\", \"Paua\"], [\"26056A\", \"Paris M\"], [\"261105\", \"Wood Bark\"], [\"261414\", \"Gondola\"], [\"262335\", \"Steel Gray\"], [\"26283B\", \"Ebony Clay\"], [\"273A81\", \"Bay of Many\"], [\"27504B\", \"Plantation\"], [\"278A5B\", \"Eucalyptus\"], [\"281E15\", \"Oil\"], [\"283A77\", \"Astronaut\"], [\"286ACD\", \"Mariner\"], [\"290C5E\", \"Violent Violet\"], [\"292130\", \"Bastille\"], [\"292319\", \"Zeus\"], [\"292937\", \"Charade\"], [\"297B9A\", \"Jelly Bean\"], [\"29AB87\", \"Jungle Green\"], [\"2A0359\", \"Cherry Pie\"], [\"2A140E\", \"Coffee Bean\"], [\"2A2630\", \"Baltic Sea\"], [\"2A380B\", \"Turtle Green\"], [\"2A52BE\", \"Cerulean Blue\"], [\"2B0202\", \"Sepia Black\"], [\"2B194F\", \"Valhalla\"], [\"2B3228\", \"Heavy Metal\"], [\"2C0E8C\", \"Blue Gem\"], [\"2C1632\", \"Revolver\"], [\"2C2133\", \"Bleached Cedar\"], [\"2C8C84\", \"Lochinvar\"], [\"2D2510\", \"Mikado\"], [\"2D383A\", \"Outer Space\"], [\"2D569B\", \"St Tropaz\"], [\"2E0329\", \"Jacaranda\"], [\"2E1905\", \"Jacko Bean\"], [\"2E3222\", \"Rangitoto\"], [\"2E3F62\", \"Rhino\"], [\"2E8B57\", \"Sea Green\"], [\"2EBFD4\", \"Scooter\"], [\"2F270E\", \"Onion\"], [\"2F3CB3\", \"Governor Bay\"], [\"2F519E\", \"Sapphire\"], [\"2F5A57\", \"Spectra\"], [\"2F6168\", \"Casal\"], [\"300529\", \"Melanzane\"], [\"301F1E\", \"Cocoa Brown\"], [\"302A0F\", \"Woodrush\"], [\"304B6A\", \"San Juan\"], [\"30D5C8\", \"Turquoise\"], [\"311C17\", \"Eclipse\"], [\"314459\", \"Pickled Bluewood\"], [\"315BA1\", \"Azure\"], [\"31728D\", \"Calypso\"], [\"317D82\", \"Paradiso\"], [\"32127A\", \"Persian Indigo\"], [\"32293A\", \"Blackcurrant\"], [\"323232\", \"Mine Shaft\"], [\"325D52\", \"Stromboli\"], [\"327C14\", \"Bilbao\"], [\"327DA0\", \"Astral\"], [\"33036B\", \"Christalle\"], [\"33292F\", \"Thunder\"], [\"33CC99\", \"Shamrock\"], [\"341515\", \"Tamarind\"], [\"350036\", \"Mardi Gras\"], [\"350E42\", \"Valentino\"], [\"350E57\", \"Jagger\"], [\"353542\", \"Tuna\"], [\"354E8C\", \"Chambray\"], [\"363050\", \"Martinique\"], [\"363534\", \"Tuatara\"], [\"363C0D\", \"Waiouru\"], [\"36747D\", \"Ming\"], [\"368716\", \"La Palma\"], [\"370202\", \"Chocolate\"], [\"371D09\", \"Clinker\"], [\"37290E\", \"Brown Tumbleweed\"], [\"373021\", \"Birch\"], [\"377475\", \"Oracle\"], [\"380474\", \"Blue Diamond\"], [\"381A51\", \"Grape\"], [\"383533\", \"Dune\"], [\"384555\", \"Oxford Blue\"], [\"384910\", \"Clover\"], [\"394851\", \"Limed Spruce\"], [\"396413\", \"Dell\"], [\"3A0020\", \"Toledo\"], [\"3A2010\", \"Sambuca\"], [\"3A2A6A\", \"Jacarta\"], [\"3A686C\", \"William\"], [\"3A6A47\", \"Killarney\"], [\"3AB09E\", \"Keppel\"], [\"3B000B\", \"Temptress\"], [\"3B0910\", \"Aubergine\"], [\"3B1F1F\", \"Jon\"], [\"3B2820\", \"Treehouse\"], [\"3B7A57\", \"Amazon\"], [\"3B91B4\", \"Boston Blue\"], [\"3C0878\", \"Windsor\"], [\"3C1206\", \"Rebel\"], [\"3C1F76\", \"Meteorite\"], [\"3C2005\", \"Dark Ebony\"], [\"3C3910\", \"Camouflage\"], [\"3C4151\", \"Bright Gray\"], [\"3C4443\", \"Cape Cod\"], [\"3C493A\", \"Lunar Green\"], [\"3D0C02\", \"Bean \"], [\"3D2B1F\", \"Bistre\"], [\"3D7D52\", \"Goblin\"], [\"3E0480\", \"Kingfisher Daisy\"], [\"3E1C14\", \"Cedar\"], [\"3E2B23\", \"English Walnut\"], [\"3E2C1C\", \"Black Marlin\"], [\"3E3A44\", \"Ship Gray\"], [\"3EABBF\", \"Pelorous\"], [\"3F2109\", \"Bronze\"], [\"3F2500\", \"Cola\"], [\"3F3002\", \"Madras\"], [\"3F307F\", \"Minsk\"], [\"3F4C3A\", \"Cabbage Pont\"], [\"3F583B\", \"Tom Thumb\"], [\"3F5D53\", \"Mineral Green\"], [\"3FC1AA\", \"Puerto Rico\"], [\"3FFF00\", \"Harlequin\"], [\"401801\", \"Brown Pod\"], [\"40291D\", \"Cork\"], [\"403B38\", \"Masala\"], [\"403D19\", \"Thatch Green\"], [\"405169\", \"Fiord\"], [\"40826D\", \"Viridian\"], [\"40A860\", \"Chateau Green\"], [\"410056\", \"Ripe Plum\"], [\"411F10\", \"Paco\"], [\"412010\", \"Deep Oak\"], [\"413C37\", \"Merlin\"], [\"414257\", \"Gun Powder\"], [\"414C7D\", \"East Bay\"], [\"4169E1\", \"Royal Blue\"], [\"41AA78\", \"Ocean Green\"], [\"420303\", \"Burnt Maroon\"], [\"423921\", \"Lisbon Brown\"], [\"427977\", \"Faded Jade\"], [\"431560\", \"Scarlet Gum\"], [\"433120\", \"Iroko\"], [\"433E37\", \"Armadillo\"], [\"434C59\", \"River Bed\"], [\"436A0D\", \"Green Leaf\"], [\"44012D\", \"Barossa\"], [\"441D00\", \"Morocco Brown\"], [\"444954\", \"Mako\"], [\"454936\", \"Kelp\"], [\"456CAC\", \"San Marino\"], [\"45B1E8\", \"Picton Blue\"], [\"460B41\", \"Loulou\"], [\"462425\", \"Crater Brown\"], [\"465945\", \"Gray Asparagus\"], [\"4682B4\", \"Steel Blue\"], [\"480404\", \"Rustic Red\"], [\"480607\", \"Bulgarian Rose\"], [\"480656\", \"Clairvoyant\"], [\"481C1C\", \"Cocoa Bean\"], [\"483131\", \"Woody Brown\"], [\"483C32\", \"Taupe\"], [\"49170C\", \"Van Cleef\"], [\"492615\", \"Brown Derby\"], [\"49371B\", \"Metallic Bronze\"], [\"495400\", \"Verdun Green\"], [\"496679\", \"Blue Bayoux\"], [\"497183\", \"Bismark\"], [\"4A2A04\", \"Bracken\"], [\"4A3004\", \"Deep Bronze\"], [\"4A3C30\", \"Mondo\"], [\"4A4244\", \"Tundora\"], [\"4A444B\", \"Gravel\"], [\"4A4E5A\", \"Trout\"], [\"4B0082\", \"Pigment Indigo\"], [\"4B5D52\", \"Nandor\"], [\"4C3024\", \"Saddle\"], [\"4C4F56\", \"Abbey\"], [\"4D0135\", \"Blackberry\"], [\"4D0A18\", \"Cab Sav\"], [\"4D1E01\", \"Indian Tan\"], [\"4D282D\", \"Cowboy\"], [\"4D282E\", \"Livid Brown\"], [\"4D3833\", \"Rock\"], [\"4D3D14\", \"Punga\"], [\"4D400F\", \"Bronzetone\"], [\"4D5328\", \"Woodland\"], [\"4E0606\", \"Mahogany\"], [\"4E2A5A\", \"Bossanova\"], [\"4E3B41\", \"Matterhorn\"], [\"4E420C\", \"Bronze Olive\"], [\"4E4562\", \"Mulled Wine\"], [\"4E6649\", \"Axolotl\"], [\"4E7F9E\", \"Wedgewood\"], [\"4EABD1\", \"Shakespeare\"], [\"4F1C70\", \"Honey Flower\"], [\"4F2398\", \"Daisy Bush\"], [\"4F69C6\", \"Indigo\"], [\"4F7942\", \"Fern Green\"], [\"4F9D5D\", \"Fruit Salad\"], [\"4FA83D\", \"Apple\"], [\"504351\", \"Mortar\"], [\"507096\", \"Kashmir Blue\"], [\"507672\", \"Cutty Sark\"], [\"50C878\", \"Emerald\"], [\"514649\", \"Emperor\"], [\"516E3D\", \"Chalet Green\"], [\"517C66\", \"Como\"], [\"51808F\", \"Smalt Blue\"], [\"52001F\", \"Castro\"], [\"520C17\", \"Maroon Oak\"], [\"523C94\", \"Gigas\"], [\"533455\", \"Voodoo\"], [\"534491\", \"Victoria\"], [\"53824B\", \"Hippie Green\"], [\"541012\", \"Heath\"], [\"544333\", \"Judge Gray\"], [\"54534D\", \"Fuscous Gray\"], [\"549019\", \"Vida Loca\"], [\"55280C\", \"Cioccolato\"], [\"555B10\", \"Saratoga\"], [\"556D56\", \"Finlandia\"], [\"5590D9\", \"Havelock Blue\"], [\"56B4BE\", \"Fountain Blue\"], [\"578363\", \"Spring Leaves\"], [\"583401\", \"Saddle Brown\"], [\"585562\", \"Scarpa Flow\"], [\"587156\", \"Cactus\"], [\"589AAF\", \"Hippie Blue\"], [\"591D35\", \"Wine Berry\"], [\"592804\", \"Brown Bramble\"], [\"593737\", \"Congo Brown\"], [\"594433\", \"Millbrook\"], [\"5A6E9C\", \"Waikawa Gray\"], [\"5A87A0\", \"Horizon\"], [\"5B3013\", \"Jambalaya\"], [\"5C0120\", \"Bordeaux\"], [\"5C0536\", \"Mulberry Wood\"], [\"5C2E01\", \"Carnaby Tan\"], [\"5C5D75\", \"Comet\"], [\"5D1E0F\", \"Redwood\"], [\"5D4C51\", \"Don Juan\"], [\"5D5C58\", \"Chicago\"], [\"5D5E37\", \"Verdigris\"], [\"5D7747\", \"Dingley\"], [\"5DA19F\", \"Breaker Bay\"], [\"5E483E\", \"Kabul\"], [\"5E5D3B\", \"Hemlock\"], [\"5F3D26\", \"Irish Coffee\"], [\"5F5F6E\", \"Mid Gray\"], [\"5F6672\", \"Shuttle Gray\"], [\"5FA777\", \"Aqua Forest\"], [\"5FB3AC\", \"Tradewind\"], [\"604913\", \"Horses Neck\"], [\"605B73\", \"Smoky\"], [\"606E68\", \"Corduroy\"], [\"6093D1\", \"Danube\"], [\"612718\", \"Espresso\"], [\"614051\", \"Eggplant\"], [\"615D30\", \"Costa Del Sol\"], [\"61845F\", \"Glade Green\"], [\"622F30\", \"Buccaneer\"], [\"623F2D\", \"Quincy\"], [\"624E9A\", \"Butterfly Bush\"], [\"625119\", \"West Coast\"], [\"626649\", \"Finch\"], [\"639A8F\", \"Patina\"], [\"63B76C\", \"Fern\"], [\"6456B7\", \"Blue Violet\"], [\"646077\", \"Dolphin\"], [\"646463\", \"Storm Dust\"], [\"646A54\", \"Siam\"], [\"646E75\", \"Nevada\"], [\"6495ED\", \"Cornflower Blue\"], [\"64CCDB\", \"Viking\"], [\"65000B\", \"Rosewood\"], [\"651A14\", \"Cherrywood\"], [\"652DC1\", \"Purple Heart\"], [\"657220\", \"Fern Frond\"], [\"65745D\", \"Willow Grove\"], [\"65869F\", \"Hoki\"], [\"660045\", \"Pompadour\"], [\"660099\", \"Purple\"], [\"66023C\", \"Tyrian Purple\"], [\"661010\", \"Dark Tan\"], [\"66B58F\", \"Silver Tree\"], [\"66FF00\", \"Bright Green\"], [\"66FF66\", \"Screamin' Green\"], [\"67032D\", \"Black Rose\"], [\"675FA6\", \"Scampi\"], [\"676662\", \"Ironside Gray\"], [\"678975\", \"Viridian Green\"], [\"67A712\", \"Christi\"], [\"683600\", \"Nutmeg Wood Finish\"], [\"685558\", \"Zambezi\"], [\"685E6E\", \"Salt Box\"], [\"692545\", \"Tawny Port\"], [\"692D54\", \"Finn\"], [\"695F62\", \"Scorpion\"], [\"697E9A\", \"Lynch\"], [\"6A442E\", \"Spice\"], [\"6A5D1B\", \"Himalaya\"], [\"6A6051\", \"Soya Bean\"], [\"6B2A14\", \"Hairy Heath\"], [\"6B3FA0\", \"Royal Purple\"], [\"6B4E31\", \"Shingle Fawn\"], [\"6B5755\", \"Dorado\"], [\"6B8BA2\", \"Bermuda Gray\"], [\"6B8E23\", \"Olive Drab\"], [\"6C3082\", \"Eminence\"], [\"6CDAE7\", \"Turquoise Blue\"], [\"6D0101\", \"Lonestar\"], [\"6D5E54\", \"Pine Cone\"], [\"6D6C6C\", \"Dove Gray\"], [\"6D9292\", \"Juniper\"], [\"6D92A1\", \"Gothic\"], [\"6E0902\", \"Red Oxide\"], [\"6E1D14\", \"Moccaccino\"], [\"6E4826\", \"Pickled Bean\"], [\"6E4B26\", \"Dallas\"], [\"6E6D57\", \"Kokoda\"], [\"6E7783\", \"Pale Sky\"], [\"6F440C\", \"Cafe Royale\"], [\"6F6A61\", \"Flint\"], [\"6F8E63\", \"Highland\"], [\"6F9D02\", \"Limeade\"], [\"6FD0C5\", \"Downy\"], [\"701C1C\", \"Persian Plum\"], [\"704214\", \"Sepia\"], [\"704A07\", \"Antique Bronze\"], [\"704F50\", \"Ferra\"], [\"706555\", \"Coffee\"], [\"708090\", \"Slate Gray\"], [\"711A00\", \"Cedar Wood Finish\"], [\"71291D\", \"Metallic Copper\"], [\"714693\", \"Affair\"], [\"714AB2\", \"Studio\"], [\"715D47\", \"Tobacco Brown\"], [\"716338\", \"Yellow Metal\"], [\"716B56\", \"Peat\"], [\"716E10\", \"Olivetone\"], [\"717486\", \"Storm Gray\"], [\"718080\", \"Sirocco\"], [\"71D9E2\", \"Aquamarine Blue\"], [\"72010F\", \"Venetian Red\"], [\"724A2F\", \"Old Copper\"], [\"726D4E\", \"Go Ben\"], [\"727B89\", \"Raven\"], [\"731E8F\", \"Seance\"], [\"734A12\", \"Raw Umber\"], [\"736C9F\", \"Kimberly\"], [\"736D58\", \"Crocodile\"], [\"737829\", \"Crete\"], [\"738678\", \"Xanadu\"], [\"74640D\", \"Spicy Mustard\"], [\"747D63\", \"Limed Ash\"], [\"747D83\", \"Rolling Stone\"], [\"748881\", \"Blue Smoke\"], [\"749378\", \"Laurel\"], [\"74C365\", \"Mantis\"], [\"755A57\", \"Russett\"], [\"7563A8\", \"Deluge\"], [\"76395D\", \"Cosmic\"], [\"7666C6\", \"Blue Marguerite\"], [\"76BD17\", \"Lima\"], [\"76D7EA\", \"Sky Blue\"], [\"770F05\", \"Dark Burgundy\"], [\"771F1F\", \"Crown of Thorns\"], [\"773F1A\", \"Walnut\"], [\"776F61\", \"Pablo\"], [\"778120\", \"Pacifika\"], [\"779E86\", \"Oxley\"], [\"77DD77\", \"Pastel Green\"], [\"780109\", \"Japanese Maple\"], [\"782D19\", \"Mocha\"], [\"782F16\", \"Peanut\"], [\"78866B\", \"Camouflage Green\"], [\"788A25\", \"Wasabi\"], [\"788BBA\", \"Ship Cove\"], [\"78A39C\", \"Sea Nymph\"], [\"795D4C\", \"Roman Coffee\"], [\"796878\", \"Old Lavender\"], [\"796989\", \"Rum\"], [\"796A78\", \"Fedora\"], [\"796D62\", \"Sandstone\"], [\"79DEEC\", \"Spray\"], [\"7A013A\", \"Siren\"], [\"7A58C1\", \"Fuchsia Blue\"], [\"7A7A7A\", \"Boulder\"], [\"7A89B8\", \"Wild Blue Yonder\"], [\"7AC488\", \"De York\"], [\"7B3801\", \"Red Beech\"], [\"7B3F00\", \"Cinnamon\"], [\"7B6608\", \"Yukon Gold\"], [\"7B7874\", \"Tapa\"], [\"7B7C94\", \"Waterloo \"], [\"7B8265\", \"Flax Smoke\"], [\"7B9F80\", \"Amulet\"], [\"7BA05B\", \"Asparagus\"], [\"7C1C05\", \"Kenyan Copper\"], [\"7C7631\", \"Pesto\"], [\"7C778A\", \"Topaz\"], [\"7C7B7A\", \"Concord\"], [\"7C7B82\", \"Jumbo\"], [\"7C881A\", \"Trendy Green\"], [\"7CA1A6\", \"Gumbo\"], [\"7CB0A1\", \"Acapulco\"], [\"7CB7BB\", \"Neptune\"], [\"7D2C14\", \"Pueblo\"], [\"7DA98D\", \"Bay Leaf\"], [\"7DC8F7\", \"Malibu\"], [\"7DD8C6\", \"Bermuda\"], [\"7E3A15\", \"Copper Canyon\"], [\"7F1734\", \"Claret\"], [\"7F3A02\", \"Peru Tan\"], [\"7F626D\", \"Falcon\"], [\"7F7589\", \"Mobster\"], [\"7F76D3\", \"Moody Blue\"], [\"7FFF00\", \"Chartreuse\"], [\"7FFFD4\", \"Aquamarine\"], [\"800000\", \"Maroon\"], [\"800B47\", \"Rose Bud Cherry\"], [\"801818\", \"Falu Red\"], [\"80341F\", \"Red Robin\"], [\"803790\", \"Vivid Violet\"], [\"80461B\", \"Russet\"], [\"807E79\", \"Friar Gray\"], [\"808000\", \"Olive\"], [\"808080\", \"Gray\"], [\"80B3AE\", \"Gulf Stream\"], [\"80B3C4\", \"Glacier\"], [\"80CCEA\", \"Seagull\"], [\"81422C\", \"Nutmeg\"], [\"816E71\", \"Spicy Pink\"], [\"817377\", \"Empress\"], [\"819885\", \"Spanish Green\"], [\"826F65\", \"Sand Dune\"], [\"828685\", \"Gunsmoke\"], [\"828F72\", \"Battleship Gray\"], [\"831923\", \"Merlot\"], [\"837050\", \"Shadow\"], [\"83AA5D\", \"Chelsea Cucumber\"], [\"83D0C6\", \"Monte Carlo\"], [\"843179\", \"Plum\"], [\"84A0A0\", \"Granny Smith\"], [\"8581D9\", \"Chetwode Blue\"], [\"858470\", \"Bandicoot\"], [\"859FAF\", \"Bali Hai\"], [\"85C4CC\", \"Half Baked\"], [\"860111\", \"Red Devil\"], [\"863C3C\", \"Lotus\"], [\"86483C\", \"Ironstone\"], [\"864D1E\", \"Bull Shot\"], [\"86560A\", \"Rusty Nail\"], [\"868974\", \"Bitter\"], [\"86949F\", \"Regent Gray\"], [\"871550\", \"Disco\"], [\"87756E\", \"Americano\"], [\"877C7B\", \"Hurricane\"], [\"878D91\", \"Oslo Gray\"], [\"87AB39\", \"Sushi\"], [\"885342\", \"Spicy Mix\"], [\"886221\", \"Kumera\"], [\"888387\", \"Suva Gray\"], [\"888D65\", \"Avocado\"], [\"893456\", \"Camelot\"], [\"893843\", \"Solid Pink\"], [\"894367\", \"Cannon Pink\"], [\"897D6D\", \"Makara\"], [\"8A3324\", \"Burnt Umber\"], [\"8A73D6\", \"True V\"], [\"8A8360\", \"Clay Creek\"], [\"8A8389\", \"Monsoon\"], [\"8A8F8A\", \"Stack\"], [\"8AB9F1\", \"Jordy Blue\"], [\"8B00FF\", \"Electric Violet\"], [\"8B0723\", \"Monarch\"], [\"8B6B0B\", \"Corn Harvest\"], [\"8B8470\", \"Olive Haze\"], [\"8B847E\", \"Schooner\"], [\"8B8680\", \"Natural Gray\"], [\"8B9C90\", \"Mantle\"], [\"8B9FEE\", \"Portage\"], [\"8BA690\", \"Envy\"], [\"8BA9A5\", \"Cascade\"], [\"8BE6D8\", \"Riptide\"], [\"8C055E\", \"Cardinal Pink\"], [\"8C472F\", \"Mule Fawn\"], [\"8C5738\", \"Potters Clay\"], [\"8C6495\", \"Trendy Pink\"], [\"8D0226\", \"Paprika\"], [\"8D3D38\", \"Sanguine Brown\"], [\"8D3F3F\", \"Tosca\"], [\"8D7662\", \"Cement\"], [\"8D8974\", \"Granite Green\"], [\"8D90A1\", \"Manatee\"], [\"8DA8CC\", \"Polo Blue\"], [\"8E0000\", \"Red Berry\"], [\"8E4D1E\", \"Rope\"], [\"8E6F70\", \"Opium\"], [\"8E775E\", \"Domino\"], [\"8E8190\", \"Mamba\"], [\"8EABC1\", \"Nepal\"], [\"8F021C\", \"Pohutukawa\"], [\"8F3E33\", \"El Salva\"], [\"8F4B0E\", \"Korma\"], [\"8F8176\", \"Squirrel\"], [\"8FD6B4\", \"Vista Blue\"], [\"900020\", \"Burgundy\"], [\"901E1E\", \"Old Brick\"], [\"907874\", \"Hemp\"], [\"907B71\", \"Almond Frost\"], [\"908D39\", \"Sycamore\"], [\"92000A\", \"Sangria\"], [\"924321\", \"Cumin\"], [\"926F5B\", \"Beaver\"], [\"928573\", \"Stonewall\"], [\"928590\", \"Venus\"], [\"9370DB\", \"Medium Purple\"], [\"93CCEA\", \"Cornflower\"], [\"93DFB8\", \"Algae Green\"], [\"944747\", \"Copper Rust\"], [\"948771\", \"Arrowtown\"], [\"950015\", \"Scarlett\"], [\"956387\", \"Strikemaster\"], [\"959396\", \"Mountain Mist\"], [\"960018\", \"Carmine\"], [\"964B00\", \"Brown\"], [\"967059\", \"Leather\"], [\"9678B6\", \"Purple Mountain's Majesty\"], [\"967BB6\", \"Lavender Purple\"], [\"96A8A1\", \"Pewter\"], [\"96BBAB\", \"Summer Green\"], [\"97605D\", \"Au Chico\"], [\"9771B5\", \"Wisteria\"], [\"97CD2D\", \"Atlantis\"], [\"983D61\", \"Vin Rouge\"], [\"9874D3\", \"Lilac Bush\"], [\"98777B\", \"Bazaar\"], [\"98811B\", \"Hacienda\"], [\"988D77\", \"Pale Oyster\"], [\"98FF98\", \"Mint Green\"], [\"990066\", \"Fresh Eggplant\"], [\"991199\", \"Violet Eggplant\"], [\"991613\", \"Tamarillo\"], [\"991B07\", \"Totem Pole\"], [\"996666\", \"Copper Rose\"], [\"9966CC\", \"Amethyst\"], [\"997A8D\", \"Mountbatten Pink\"], [\"9999CC\", \"Blue Bell\"], [\"9A3820\", \"Prairie Sand\"], [\"9A6E61\", \"Toast\"], [\"9A9577\", \"Gurkha\"], [\"9AB973\", \"Olivine\"], [\"9AC2B8\", \"Shadow Green\"], [\"9B4703\", \"Oregon\"], [\"9B9E8F\", \"Lemon Grass\"], [\"9C3336\", \"Stiletto\"], [\"9D5616\", \"Hawaiian Tan\"], [\"9DACB7\", \"Gull Gray\"], [\"9DC209\", \"Pistachio\"], [\"9DE093\", \"Granny Smith Apple\"], [\"9DE5FF\", \"Anakiwa\"], [\"9E5302\", \"Chelsea Gem\"], [\"9E5B40\", \"Sepia Skin\"], [\"9EA587\", \"Sage\"], [\"9EA91F\", \"Citron\"], [\"9EB1CD\", \"Rock Blue\"], [\"9EDEE0\", \"Morning Glory\"], [\"9F381D\", \"Cognac\"], [\"9F821C\", \"Reef Gold\"], [\"9F9F9C\", \"Star Dust\"], [\"9FA0B1\", \"Santas Gray\"], [\"9FD7D3\", \"Sinbad\"], [\"9FDD8C\", \"Feijoa\"], [\"A02712\", \"Tabasco\"], [\"A1750D\", \"Buttered Rum\"], [\"A1ADB5\", \"Hit Gray\"], [\"A1C50A\", \"Citrus\"], [\"A1DAD7\", \"Aqua Island\"], [\"A1E9DE\", \"Water Leaf\"], [\"A2006D\", \"Flirt\"], [\"A23B6C\", \"Rouge\"], [\"A26645\", \"Cape Palliser\"], [\"A2AAB3\", \"Gray Chateau\"], [\"A2AEAB\", \"Edward\"], [\"A3807B\", \"Pharlap\"], [\"A397B4\", \"Amethyst Smoke\"], [\"A3E3ED\", \"Blizzard Blue\"], [\"A4A49D\", \"Delta\"], [\"A4A6D3\", \"Wistful\"], [\"A4AF6E\", \"Green Smoke\"], [\"A50B5E\", \"Jazzberry Jam\"], [\"A59B91\", \"Zorba\"], [\"A5CB0C\", \"Bahia\"], [\"A62F20\", \"Roof Terracotta\"], [\"A65529\", \"Paarl\"], [\"A68B5B\", \"Barley Corn\"], [\"A69279\", \"Donkey Brown\"], [\"A6A29A\", \"Dawn\"], [\"A72525\", \"Mexican Red\"], [\"A7882C\", \"Luxor Gold\"], [\"A85307\", \"Rich Gold\"], [\"A86515\", \"Reno Sand\"], [\"A86B6B\", \"Coral Tree\"], [\"A8989B\", \"Dusty Gray\"], [\"A899E6\", \"Dull Lavender\"], [\"A8A589\", \"Tallow\"], [\"A8AE9C\", \"Bud\"], [\"A8AF8E\", \"Locust\"], [\"A8BD9F\", \"Norway\"], [\"A8E3BD\", \"Chinook\"], [\"A9A491\", \"Gray Olive\"], [\"A9ACB6\", \"Aluminium\"], [\"A9B2C3\", \"Cadet Blue\"], [\"A9B497\", \"Schist\"], [\"A9BDBF\", \"Tower Gray\"], [\"A9BEF2\", \"Perano\"], [\"A9C6C2\", \"Opal\"], [\"AA375A\", \"Night Shadz\"], [\"AA4203\", \"Fire\"], [\"AA8B5B\", \"Muesli\"], [\"AA8D6F\", \"Sandal\"], [\"AAA5A9\", \"Shady Lady\"], [\"AAA9CD\", \"Logan\"], [\"AAABB7\", \"Spun Pearl\"], [\"AAD6E6\", \"Regent St Blue\"], [\"AAF0D1\", \"Magic Mint\"], [\"AB0563\", \"Lipstick\"], [\"AB3472\", \"Royal Heath\"], [\"AB917A\", \"Sandrift\"], [\"ABA0D9\", \"Cold Purple\"], [\"ABA196\", \"Bronco\"], [\"AC8A56\", \"Limed Oak\"], [\"AC91CE\", \"East Side\"], [\"AC9E22\", \"Lemon Ginger\"], [\"ACA494\", \"Napa\"], [\"ACA586\", \"Hillary\"], [\"ACA59F\", \"Cloudy\"], [\"ACACAC\", \"Silver Chalice\"], [\"ACB78E\", \"Swamp Green\"], [\"ACCBB1\", \"Spring Rain\"], [\"ACDD4D\", \"Conifer\"], [\"ACE1AF\", \"Celadon\"], [\"AD781B\", \"Mandalay\"], [\"ADBED1\", \"Casper\"], [\"ADDFAD\", \"Moss Green\"], [\"ADE6C4\", \"Padua\"], [\"ADFF2F\", \"Green Yellow\"], [\"AE4560\", \"Hippie Pink\"], [\"AE6020\", \"Desert\"], [\"AE809E\", \"Bouquet\"], [\"AF4035\", \"Medium Carmine\"], [\"AF4D43\", \"Apple Blossom\"], [\"AF593E\", \"Brown Rust\"], [\"AF8751\", \"Driftwood\"], [\"AF8F2C\", \"Alpine\"], [\"AF9F1C\", \"Lucky\"], [\"AFA09E\", \"Martini\"], [\"AFB1B8\", \"Bombay\"], [\"AFBDD9\", \"Pigeon Post\"], [\"B04C6A\", \"Cadillac\"], [\"B05D54\", \"Matrix\"], [\"B05E81\", \"Tapestry\"], [\"B06608\", \"Mai Tai\"], [\"B09A95\", \"Del Rio\"], [\"B0E0E6\", \"Powder Blue\"], [\"B0E313\", \"Inch Worm\"], [\"B10000\", \"Bright Red\"], [\"B14A0B\", \"Vesuvius\"], [\"B1610B\", \"Pumpkin Skin\"], [\"B16D52\", \"Santa Fe\"], [\"B19461\", \"Teak\"], [\"B1E2C1\", \"Fringy Flower\"], [\"B1F4E7\", \"Ice Cold\"], [\"B20931\", \"Shiraz\"], [\"B2A1EA\", \"Biloba Flower\"], [\"B32D29\", \"Tall Poppy\"], [\"B35213\", \"Fiery Orange\"], [\"B38007\", \"Hot Toddy\"], [\"B3AF95\", \"Taupe Gray\"], [\"B3C110\", \"La Rioja\"], [\"B43332\", \"Well Read\"], [\"B44668\", \"Blush\"], [\"B4CFD3\", \"Jungle Mist\"], [\"B57281\", \"Turkish Rose\"], [\"B57EDC\", \"Lavender\"], [\"B5A27F\", \"Mongoose\"], [\"B5B35C\", \"Olive Green\"], [\"B5D2CE\", \"Jet Stream\"], [\"B5ECDF\", \"Cruise\"], [\"B6316C\", \"Hibiscus\"], [\"B69D98\", \"Thatch\"], [\"B6B095\", \"Heathered Gray\"], [\"B6BAA4\", \"Eagle\"], [\"B6D1EA\", \"Spindle\"], [\"B6D3BF\", \"Gum Leaf\"], [\"B7410E\", \"Rust\"], [\"B78E5C\", \"Muddy Waters\"], [\"B7A214\", \"Sahara\"], [\"B7A458\", \"Husk\"], [\"B7B1B1\", \"Nobel\"], [\"B7C3D0\", \"Heather\"], [\"B7F0BE\", \"Madang\"], [\"B81104\", \"Milano Red\"], [\"B87333\", \"Copper\"], [\"B8B56A\", \"Gimblet\"], [\"B8C1B1\", \"Green Spring\"], [\"B8C25D\", \"Celery\"], [\"B8E0F9\", \"Sail\"], [\"B94E48\", \"Chestnut\"], [\"B95140\", \"Crail\"], [\"B98D28\", \"Marigold\"], [\"B9C46A\", \"Wild Willow\"], [\"B9C8AC\", \"Rainee\"], [\"BA0101\", \"Guardsman Red\"], [\"BA450C\", \"Rock Spray\"], [\"BA6F1E\", \"Bourbon\"], [\"BA7F03\", \"Pirate Gold\"], [\"BAB1A2\", \"Nomad\"], [\"BAC7C9\", \"Submarine\"], [\"BAEEF9\", \"Charlotte\"], [\"BB3385\", \"Medium Red Violet\"], [\"BB8983\", \"Brandy Rose\"], [\"BBD009\", \"Rio Grande\"], [\"BBD7C1\", \"Surf\"], [\"BCC9C2\", \"Powder Ash\"], [\"BD5E2E\", \"Tuscany\"], [\"BD978E\", \"Quicksand\"], [\"BDB1A8\", \"Silk\"], [\"BDB2A1\", \"Malta\"], [\"BDB3C7\", \"Chatelle\"], [\"BDBBD7\", \"Lavender Gray\"], [\"BDBDC6\", \"French Gray\"], [\"BDC8B3\", \"Clay Ash\"], [\"BDC9CE\", \"Loblolly\"], [\"BDEDFD\", \"French Pass\"], [\"BEA6C3\", \"London Hue\"], [\"BEB5B7\", \"Pink Swan\"], [\"BEDE0D\", \"Fuego\"], [\"BF5500\", \"Rose of Sharon\"], [\"BFB8B0\", \"Tide\"], [\"BFBED8\", \"Blue Haze\"], [\"BFC1C2\", \"Silver Sand\"], [\"BFC921\", \"Key Lime Pie\"], [\"BFDBE2\", \"Ziggurat\"], [\"BFFF00\", \"Lime\"], [\"C02B18\", \"Thunderbird\"], [\"C04737\", \"Mojo\"], [\"C08081\", \"Old Rose\"], [\"C0C0C0\", \"Silver\"], [\"C0D3B9\", \"Pale Leaf\"], [\"C0D8B6\", \"Pixie Green\"], [\"C1440E\", \"Tia Maria\"], [\"C154C1\", \"Fuchsia Pink\"], [\"C1A004\", \"Buddha Gold\"], [\"C1B7A4\", \"Bison Hide\"], [\"C1BAB0\", \"Tea\"], [\"C1BECD\", \"Gray Suit\"], [\"C1D7B0\", \"Sprout\"], [\"C1F07C\", \"Sulu\"], [\"C26B03\", \"Indochine\"], [\"C2955D\", \"Twine\"], [\"C2BDB6\", \"Cotton Seed\"], [\"C2CAC4\", \"Pumice\"], [\"C2E8E5\", \"Jagged Ice\"], [\"C32148\", \"Maroon Flush\"], [\"C3B091\", \"Indian Khaki\"], [\"C3BFC1\", \"Pale Slate\"], [\"C3C3BD\", \"Gray Nickel\"], [\"C3CDE6\", \"Periwinkle Gray\"], [\"C3D1D1\", \"Tiara\"], [\"C3DDF9\", \"Tropical Blue\"], [\"C41E3A\", \"Cardinal\"], [\"C45655\", \"Fuzzy Wuzzy Brown\"], [\"C45719\", \"Orange Roughy\"], [\"C4C4BC\", \"Mist Gray\"], [\"C4D0B0\", \"Coriander\"], [\"C4F4EB\", \"Mint Tulip\"], [\"C54B8C\", \"Mulberry\"], [\"C59922\", \"Nugget\"], [\"C5994B\", \"Tussock\"], [\"C5DBCA\", \"Sea Mist\"], [\"C5E17A\", \"Yellow Green\"], [\"C62D42\", \"Brick Red\"], [\"C6726B\", \"Contessa\"], [\"C69191\", \"Oriental Pink\"], [\"C6A84B\", \"Roti\"], [\"C6C3B5\", \"Ash\"], [\"C6C8BD\", \"Kangaroo\"], [\"C6E610\", \"Las Palmas\"], [\"C7031E\", \"Monza\"], [\"C71585\", \"Red Violet\"], [\"C7BCA2\", \"Coral Reef\"], [\"C7C1FF\", \"Melrose\"], [\"C7C4BF\", \"Cloud\"], [\"C7C9D5\", \"Ghost\"], [\"C7CD90\", \"Pine Glade\"], [\"C7DDE5\", \"Botticelli\"], [\"C88A65\", \"Antique Brass\"], [\"C8A2C8\", \"Lilac\"], [\"C8A528\", \"Hokey Pokey\"], [\"C8AABF\", \"Lily\"], [\"C8B568\", \"Laser\"], [\"C8E3D7\", \"Edgewater\"], [\"C96323\", \"Piper\"], [\"C99415\", \"Pizza\"], [\"C9A0DC\", \"Light Wisteria\"], [\"C9B29B\", \"Rodeo Dust\"], [\"C9B35B\", \"Sundance\"], [\"C9B93B\", \"Earls Green\"], [\"C9C0BB\", \"Silver Rust\"], [\"C9D9D2\", \"Conch\"], [\"C9FFA2\", \"Reef\"], [\"C9FFE5\", \"Aero Blue\"], [\"CA3435\", \"Flush Mahogany\"], [\"CABB48\", \"Turmeric\"], [\"CADCD4\", \"Paris White\"], [\"CAE00D\", \"Bitter Lemon\"], [\"CAE6DA\", \"Skeptic\"], [\"CB8FA9\", \"Viola\"], [\"CBCAB6\", \"Foggy Gray\"], [\"CBD3B0\", \"Green Mist\"], [\"CBDBD6\", \"Nebula\"], [\"CC3333\", \"Persian Red\"], [\"CC5500\", \"Burnt Orange\"], [\"CC7722\", \"Ochre\"], [\"CC8899\", \"Puce\"], [\"CCCAA8\", \"Thistle Green\"], [\"CCCCFF\", \"Periwinkle\"], [\"CCFF00\", \"Electric Lime\"], [\"CD5700\", \"Tenn\"], [\"CD5C5C\", \"Chestnut Rose\"], [\"CD8429\", \"Brandy Punch\"], [\"CDF4FF\", \"Onahau\"], [\"CEB98F\", \"Sorrell Brown\"], [\"CEBABA\", \"Cold Turkey\"], [\"CEC291\", \"Yuma\"], [\"CEC7A7\", \"Chino\"], [\"CFA39D\", \"Eunry\"], [\"CFB53B\", \"Old Gold\"], [\"CFDCCF\", \"Tasman\"], [\"CFE5D2\", \"Surf Crest\"], [\"CFF9F3\", \"Humming Bird\"], [\"CFFAF4\", \"Scandal\"], [\"D05F04\", \"Red Stage\"], [\"D06DA1\", \"Hopbush\"], [\"D07D12\", \"Meteor\"], [\"D0BEF8\", \"Perfume\"], [\"D0C0E5\", \"Prelude\"], [\"D0F0C0\", \"Tea Green\"], [\"D18F1B\", \"Geebung\"], [\"D1BEA8\", \"Vanilla\"], [\"D1C6B4\", \"Soft Amber\"], [\"D1D2CA\", \"Celeste\"], [\"D1D2DD\", \"Mischka\"], [\"D1E231\", \"Pear\"], [\"D2691E\", \"Hot Cinnamon\"], [\"D27D46\", \"Raw Sienna\"], [\"D29EAA\", \"Careys Pink\"], [\"D2B48C\", \"Tan\"], [\"D2DA97\", \"Deco\"], [\"D2F6DE\", \"Blue Romance\"], [\"D2F8B0\", \"Gossip\"], [\"D3CBBA\", \"Sisal\"], [\"D3CDC5\", \"Swirl\"], [\"D47494\", \"Charm\"], [\"D4B6AF\", \"Clam Shell\"], [\"D4BF8D\", \"Straw\"], [\"D4C4A8\", \"Akaroa\"], [\"D4CD16\", \"Bird Flower\"], [\"D4D7D9\", \"Iron\"], [\"D4DFE2\", \"Geyser\"], [\"D4E2FC\", \"Hawkes Blue\"], [\"D54600\", \"Grenadier\"], [\"D591A4\", \"Can Can\"], [\"D59A6F\", \"Whiskey\"], [\"D5D195\", \"Winter Hazel\"], [\"D5F6E3\", \"Granny Apple\"], [\"D69188\", \"My Pink\"], [\"D6C562\", \"Tacha\"], [\"D6CEF6\", \"Moon Raker\"], [\"D6D6D1\", \"Quill Gray\"], [\"D6FFDB\", \"Snowy Mint\"], [\"D7837F\", \"New York Pink\"], [\"D7C498\", \"Pavlova\"], [\"D7D0FF\", \"Fog\"], [\"D84437\", \"Valencia\"], [\"D87C63\", \"Japonica\"], [\"D8BFD8\", \"Thistle\"], [\"D8C2D5\", \"Maverick\"], [\"D8FCFA\", \"Foam\"], [\"D94972\", \"Cabaret\"], [\"D99376\", \"Burning Sand\"], [\"D9B99B\", \"Cameo\"], [\"D9D6CF\", \"Timberwolf\"], [\"D9DCC1\", \"Tana\"], [\"D9E4F5\", \"Link Water\"], [\"D9F7FF\", \"Mabel\"], [\"DA3287\", \"Cerise\"], [\"DA5B38\", \"Flame Pea\"], [\"DA6304\", \"Bamboo\"], [\"DA6A41\", \"Red Damask\"], [\"DA70D6\", \"Orchid\"], [\"DA8A67\", \"Copperfield\"], [\"DAA520\", \"Golden Grass\"], [\"DAECD6\", \"Zanah\"], [\"DAF4F0\", \"Iceberg\"], [\"DAFAFF\", \"Oyster Bay\"], [\"DB5079\", \"Cranberry\"], [\"DB9690\", \"Petite Orchid\"], [\"DB995E\", \"Di Serria\"], [\"DBDBDB\", \"Alto\"], [\"DBFFF8\", \"Frosted Mint\"], [\"DC143C\", \"Crimson\"], [\"DC4333\", \"Punch\"], [\"DCB20C\", \"Galliano\"], [\"DCB4BC\", \"Blossom\"], [\"DCD747\", \"Wattle\"], [\"DCD9D2\", \"Westar\"], [\"DCDDCC\", \"Moon Mist\"], [\"DCEDB4\", \"Caper\"], [\"DCF0EA\", \"Swans Down\"], [\"DDD6D5\", \"Swiss Coffee\"], [\"DDF9F1\", \"White Ice\"], [\"DE3163\", \"Cerise Red\"], [\"DE6360\", \"Roman\"], [\"DEA681\", \"Tumbleweed\"], [\"DEBA13\", \"Gold Tips\"], [\"DEC196\", \"Brandy\"], [\"DECBC6\", \"Wafer\"], [\"DED4A4\", \"Sapling\"], [\"DED717\", \"Barberry\"], [\"DEE5C0\", \"Beryl Green\"], [\"DEF5FF\", \"Pattens Blue\"], [\"DF73FF\", \"Heliotrope\"], [\"DFBE6F\", \"Apache\"], [\"DFCD6F\", \"Chenin\"], [\"DFCFDB\", \"Lola\"], [\"DFECDA\", \"Willow Brook\"], [\"DFFF00\", \"Chartreuse Yellow\"], [\"E0B0FF\", \"Mauve\"], [\"E0B646\", \"Anzac\"], [\"E0B974\", \"Harvest Gold\"], [\"E0C095\", \"Calico\"], [\"E0FFFF\", \"Baby Blue\"], [\"E16865\", \"Sunglo\"], [\"E1BC64\", \"Equator\"], [\"E1C0C8\", \"Pink Flare\"], [\"E1E6D6\", \"Periglacial Blue\"], [\"E1EAD4\", \"Kidnapper\"], [\"E1F6E8\", \"Tara\"], [\"E25465\", \"Mandy\"], [\"E2725B\", \"Terracotta\"], [\"E28913\", \"Golden Bell\"], [\"E292C0\", \"Shocking\"], [\"E29418\", \"Dixie\"], [\"E29CD2\", \"Light Orchid\"], [\"E2D8ED\", \"Snuff\"], [\"E2EBED\", \"Mystic\"], [\"E2F3EC\", \"Apple Green\"], [\"E30B5C\", \"Razzmatazz\"], [\"E32636\", \"Alizarin Crimson\"], [\"E34234\", \"Cinnabar\"], [\"E3BEBE\", \"Cavern Pink\"], [\"E3F5E1\", \"Peppermint\"], [\"E3F988\", \"Mindaro\"], [\"E47698\", \"Deep Blush\"], [\"E49B0F\", \"Gamboge\"], [\"E4C2D5\", \"Melanie\"], [\"E4CFDE\", \"Twilight\"], [\"E4D1C0\", \"Bone\"], [\"E4D422\", \"Sunflower\"], [\"E4D5B7\", \"Grain Brown\"], [\"E4D69B\", \"Zombie\"], [\"E4F6E7\", \"Frostee\"], [\"E4FFD1\", \"Snow Flurry\"], [\"E52B50\", \"Amaranth\"], [\"E5841B\", \"Zest\"], [\"E5CCC9\", \"Dust Storm\"], [\"E5D7BD\", \"Stark White\"], [\"E5D8AF\", \"Hampton\"], [\"E5E0E1\", \"Bon Jour\"], [\"E5E5E5\", \"Mercury\"], [\"E5F9F6\", \"Polar\"], [\"E64E03\", \"Trinidad\"], [\"E6BE8A\", \"Gold Sand\"], [\"E6BEA5\", \"Cashmere\"], [\"E6D7B9\", \"Double Spanish White\"], [\"E6E4D4\", \"Satin Linen\"], [\"E6F2EA\", \"Harp\"], [\"E6F8F3\", \"Off Green\"], [\"E6FFE9\", \"Hint of Green\"], [\"E6FFFF\", \"Tranquil\"], [\"E77200\", \"Mango Tango\"], [\"E7730A\", \"Christine\"], [\"E79F8C\", \"Tonys Pink\"], [\"E79FC4\", \"Kobi\"], [\"E7BCB4\", \"Rose Fog\"], [\"E7BF05\", \"Corn\"], [\"E7CD8C\", \"Putty\"], [\"E7ECE6\", \"Gray Nurse\"], [\"E7F8FF\", \"Lily White\"], [\"E7FEFF\", \"Bubbles\"], [\"E89928\", \"Fire Bush\"], [\"E8B9B3\", \"Shilo\"], [\"E8E0D5\", \"Pearl Bush\"], [\"E8EBE0\", \"Green White\"], [\"E8F1D4\", \"Chrome White\"], [\"E8F2EB\", \"Gin\"], [\"E8F5F2\", \"Aqua Squeeze\"], [\"E96E00\", \"Clementine\"], [\"E97451\", \"Burnt Sienna\"], [\"E97C07\", \"Tahiti Gold\"], [\"E9CECD\", \"Oyster Pink\"], [\"E9D75A\", \"Confetti\"], [\"E9E3E3\", \"Ebb\"], [\"E9F8ED\", \"Ottoman\"], [\"E9FFFD\", \"Clear Day\"], [\"EA88A8\", \"Carissma\"], [\"EAAE69\", \"Porsche\"], [\"EAB33B\", \"Tulip Tree\"], [\"EAC674\", \"Rob Roy\"], [\"EADAB8\", \"Raffia\"], [\"EAE8D4\", \"White Rock\"], [\"EAF6EE\", \"Panache\"], [\"EAF6FF\", \"Solitude\"], [\"EAF9F5\", \"Aqua Spring\"], [\"EAFFFE\", \"Dew\"], [\"EB9373\", \"Apricot\"], [\"EBC2AF\", \"Zinnwaldite\"], [\"ECA927\", \"Fuel Yellow\"], [\"ECC54E\", \"Ronchi\"], [\"ECC7EE\", \"French Lilac\"], [\"ECCDB9\", \"Just Right\"], [\"ECE090\", \"Wild Rice\"], [\"ECEBBD\", \"Fall Green\"], [\"ECEBCE\", \"Aths Special\"], [\"ECF245\", \"Starship\"], [\"ED0A3F\", \"Red Ribbon\"], [\"ED7A1C\", \"Tango\"], [\"ED9121\", \"Carrot Orange\"], [\"ED989E\", \"Sea Pink\"], [\"EDB381\", \"Tacao\"], [\"EDC9AF\", \"Desert Sand\"], [\"EDCDAB\", \"Pancho\"], [\"EDDCB1\", \"Chamois\"], [\"EDEA99\", \"Primrose\"], [\"EDF5DD\", \"Frost\"], [\"EDF5F5\", \"Aqua Haze\"], [\"EDF6FF\", \"Zumthor\"], [\"EDF9F1\", \"Narvik\"], [\"EDFC84\", \"Honeysuckle\"], [\"EE82EE\", \"Lavender Magenta\"], [\"EEC1BE\", \"Beauty Bush\"], [\"EED794\", \"Chalky\"], [\"EED9C4\", \"Almond\"], [\"EEDC82\", \"Flax\"], [\"EEDEDA\", \"Bizarre\"], [\"EEE3AD\", \"Double Colonial White\"], [\"EEEEE8\", \"Cararra\"], [\"EEEF78\", \"Manz\"], [\"EEF0C8\", \"Tahuna Sands\"], [\"EEF0F3\", \"Athens Gray\"], [\"EEF3C3\", \"Tusk\"], [\"EEF4DE\", \"Loafer\"], [\"EEF6F7\", \"Catskill White\"], [\"EEFDFF\", \"Twilight Blue\"], [\"EEFF9A\", \"Jonquil\"], [\"EEFFE2\", \"Rice Flower\"], [\"EF863F\", \"Jaffa\"], [\"EFEFEF\", \"Gallery\"], [\"EFF2F3\", \"Porcelain\"], [\"F091A9\", \"Mauvelous\"], [\"F0D52D\", \"Golden Dream\"], [\"F0DB7D\", \"Golden Sand\"], [\"F0DC82\", \"Buff\"], [\"F0E2EC\", \"Prim\"], [\"F0E68C\", \"Khaki\"], [\"F0EEFD\", \"Selago\"], [\"F0EEFF\", \"Titan White\"], [\"F0F8FF\", \"Alice Blue\"], [\"F0FCEA\", \"Feta\"], [\"F18200\", \"Gold Drop\"], [\"F19BAB\", \"Wewak\"], [\"F1E788\", \"Sahara Sand\"], [\"F1E9D2\", \"Parchment\"], [\"F1E9FF\", \"Blue Chalk\"], [\"F1EEC1\", \"Mint Julep\"], [\"F1F1F1\", \"Seashell\"], [\"F1F7F2\", \"Saltpan\"], [\"F1FFAD\", \"Tidal\"], [\"F1FFC8\", \"Chiffon\"], [\"F2552A\", \"Flamingo\"], [\"F28500\", \"Tangerine\"], [\"F2C3B2\", \"Mandys Pink\"], [\"F2F2F2\", \"Concrete\"], [\"F2FAFA\", \"Black Squeeze\"], [\"F34723\", \"Pomegranate\"], [\"F3AD16\", \"Buttercup\"], [\"F3D69D\", \"New Orleans\"], [\"F3D9DF\", \"Vanilla Ice\"], [\"F3E7BB\", \"Sidecar\"], [\"F3E9E5\", \"Dawn Pink\"], [\"F3EDCF\", \"Wheatfield\"], [\"F3FB62\", \"Canary\"], [\"F3FBD4\", \"Orinoco\"], [\"F3FFD8\", \"Carla\"], [\"F400A1\", \"Hollywood Cerise\"], [\"F4A460\", \"Sandy brown\"], [\"F4C430\", \"Saffron\"], [\"F4D81C\", \"Ripe Lemon\"], [\"F4EBD3\", \"Janna\"], [\"F4F2EE\", \"Pampas\"], [\"F4F4F4\", \"Wild Sand\"], [\"F4F8FF\", \"Zircon\"], [\"F57584\", \"Froly\"], [\"F5C85C\", \"Cream Can\"], [\"F5C999\", \"Manhattan\"], [\"F5D5A0\", \"Maize\"], [\"F5DEB3\", \"Wheat\"], [\"F5E7A2\", \"Sandwisp\"], [\"F5E7E2\", \"Pot Pourri\"], [\"F5E9D3\", \"Albescent White\"], [\"F5EDEF\", \"Soft Peach\"], [\"F5F3E5\", \"Ecru White\"], [\"F5F5DC\", \"Beige\"], [\"F5FB3D\", \"Golden Fizz\"], [\"F5FFBE\", \"Australian Mint\"], [\"F64A8A\", \"French Rose\"], [\"F653A6\", \"Brilliant Rose\"], [\"F6A4C9\", \"Illusion\"], [\"F6F0E6\", \"Merino\"], [\"F6F7F7\", \"Black Haze\"], [\"F6FFDC\", \"Spring Sun\"], [\"F7468A\", \"Violet Red\"], [\"F77703\", \"Chilean Fire\"], [\"F77FBE\", \"Persian Pink\"], [\"F7B668\", \"Rajah\"], [\"F7C8DA\", \"Azalea\"], [\"F7DBE6\", \"We Peep\"], [\"F7F2E1\", \"Quarter Spanish White\"], [\"F7F5FA\", \"Whisper\"], [\"F7FAF7\", \"Snow Drift\"], [\"F8B853\", \"Casablanca\"], [\"F8C3DF\", \"Chantilly\"], [\"F8D9E9\", \"Cherub\"], [\"F8DB9D\", \"Marzipan\"], [\"F8DD5C\", \"Energy Yellow\"], [\"F8E4BF\", \"Givry\"], [\"F8F0E8\", \"White Linen\"], [\"F8F4FF\", \"Magnolia\"], [\"F8F6F1\", \"Spring Wood\"], [\"F8F7DC\", \"Coconut Cream\"], [\"F8F7FC\", \"White Lilac\"], [\"F8F8F7\", \"Desert Storm\"], [\"F8F99C\", \"Texas\"], [\"F8FACD\", \"Corn Field\"], [\"F8FDD3\", \"Mimosa\"], [\"F95A61\", \"Carnation\"], [\"F9BF58\", \"Saffron Mango\"], [\"F9E0ED\", \"Carousel Pink\"], [\"F9E4BC\", \"Dairy Cream\"], [\"F9E663\", \"Portica\"], [\"F9E6F4\", \"Underage Pink\"], [\"F9EAF3\", \"Amour\"], [\"F9F8E4\", \"Rum Swizzle\"], [\"F9FF8B\", \"Dolly\"], [\"F9FFF6\", \"Sugar Cane\"], [\"FA7814\", \"Ecstasy\"], [\"FA9D5A\", \"Tan Hide\"], [\"FAD3A2\", \"Corvette\"], [\"FADFAD\", \"Peach Yellow\"], [\"FAE600\", \"Turbo\"], [\"FAEAB9\", \"Astra\"], [\"FAECCC\", \"Champagne\"], [\"FAF0E6\", \"Linen\"], [\"FAF3F0\", \"Fantasy\"], [\"FAF7D6\", \"Citrine White\"], [\"FAFAFA\", \"Alabaster\"], [\"FAFDE4\", \"Hint of Yellow\"], [\"FAFFA4\", \"Milan\"], [\"FB607F\", \"Brink Pink\"], [\"FB8989\", \"Geraldine\"], [\"FBA0E3\", \"Lavender Rose\"], [\"FBA129\", \"Sea Buckthorn\"], [\"FBAC13\", \"Sun\"], [\"FBAED2\", \"Lavender Pink\"], [\"FBB2A3\", \"Rose Bud\"], [\"FBBEDA\", \"Cupid\"], [\"FBCCE7\", \"Classic Rose\"], [\"FBCEB1\", \"Apricot Peach\"], [\"FBE7B2\", \"Banana Mania\"], [\"FBE870\", \"Marigold Yellow\"], [\"FBE96C\", \"Festival\"], [\"FBEA8C\", \"Sweet Corn\"], [\"FBEC5D\", \"Candy Corn\"], [\"FBF9F9\", \"Hint of Red\"], [\"FBFFBA\", \"Shalimar\"], [\"FC0FC0\", \"Shocking Pink\"], [\"FC80A5\", \"Tickle Me Pink\"], [\"FC9C1D\", \"Tree Poppy\"], [\"FCC01E\", \"Lightning Yellow\"], [\"FCD667\", \"Goldenrod\"], [\"FCD917\", \"Candlelight\"], [\"FCDA98\", \"Cherokee\"], [\"FCF4D0\", \"Double Pearl Lusta\"], [\"FCF4DC\", \"Pearl Lusta\"], [\"FCF8F7\", \"Vista White\"], [\"FCFBF3\", \"Bianca\"], [\"FCFEDA\", \"Moon Glow\"], [\"FCFFE7\", \"China Ivory\"], [\"FCFFF9\", \"Ceramic\"], [\"FD0E35\", \"Torch Red\"], [\"FD5B78\", \"Wild Watermelon\"], [\"FD7B33\", \"Crusta\"], [\"FD7C07\", \"Sorbus\"], [\"FD9FA2\", \"Sweet Pink\"], [\"FDD5B1\", \"Light Apricot\"], [\"FDD7E4\", \"Pig Pink\"], [\"FDE1DC\", \"Cinderella\"], [\"FDE295\", \"Golden Glow\"], [\"FDE910\", \"Lemon\"], [\"FDF5E6\", \"Old Lace\"], [\"FDF6D3\", \"Half Colonial White\"], [\"FDF7AD\", \"Drover\"], [\"FDFEB8\", \"Pale Prim\"], [\"FDFFD5\", \"Cumulus\"], [\"FE28A2\", \"Persian Rose\"], [\"FE4C40\", \"Sunset Orange\"], [\"FE6F5E\", \"Bittersweet\"], [\"FE9D04\", \"California\"], [\"FEA904\", \"Yellow Sea\"], [\"FEBAAD\", \"Melon\"], [\"FED33C\", \"Bright Sun\"], [\"FED85D\", \"Dandelion\"], [\"FEDB8D\", \"Salomie\"], [\"FEE5AC\", \"Cape Honey\"], [\"FEEBF3\", \"Remy\"], [\"FEEFCE\", \"Oasis\"], [\"FEF0EC\", \"Bridesmaid\"], [\"FEF2C7\", \"Beeswax\"], [\"FEF3D8\", \"Bleach White\"], [\"FEF4CC\", \"Pipi\"], [\"FEF4DB\", \"Half Spanish White\"], [\"FEF4F8\", \"Wisp Pink\"], [\"FEF5F1\", \"Provincial Pink\"], [\"FEF7DE\", \"Half Dutch White\"], [\"FEF8E2\", \"Solitaire\"], [\"FEF8FF\", \"White Pointer\"], [\"FEF9E3\", \"Off Yellow\"], [\"FEFCED\", \"Orange White\"], [\"FF0000\", \"Red\"], [\"FF007F\", \"Rose\"], [\"FF00CC\", \"Purple Pizzazz\"], [\"FF00FF\", \"Magenta / Fuchsia\"], [\"FF2400\", \"Scarlet\"], [\"FF3399\", \"Wild Strawberry\"], [\"FF33CC\", \"Razzle Dazzle Rose\"], [\"FF355E\", \"Radical Red\"], [\"FF3F34\", \"Red Orange\"], [\"FF4040\", \"Coral Red\"], [\"FF4D00\", \"Vermilion\"], [\"FF4F00\", \"International Orange\"], [\"FF6037\", \"Outrageous Orange\"], [\"FF6600\", \"Blaze Orange\"], [\"FF66FF\", \"Pink Flamingo\"], [\"FF681F\", \"Orange\"], [\"FF69B4\", \"Hot Pink\"], [\"FF6B53\", \"Persimmon\"], [\"FF6FFF\", \"Blush Pink\"], [\"FF7034\", \"Burning Orange\"], [\"FF7518\", \"Pumpkin\"], [\"FF7D07\", \"Flamenco\"], [\"FF7F00\", \"Flush Orange\"], [\"FF7F50\", \"Coral\"], [\"FF8C69\", \"Salmon\"], [\"FF9000\", \"Pizazz\"], [\"FF910F\", \"West Side\"], [\"FF91A4\", \"Pink Salmon\"], [\"FF9933\", \"Neon Carrot\"], [\"FF9966\", \"Atomic Tangerine\"], [\"FF9980\", \"Vivid Tangerine\"], [\"FF9E2C\", \"Sunshade\"], [\"FFA000\", \"Orange Peel\"], [\"FFA194\", \"Mona Lisa\"], [\"FFA500\", \"Web Orange\"], [\"FFA6C9\", \"Carnation Pink\"], [\"FFAB81\", \"Hit Pink\"], [\"FFAE42\", \"Yellow Orange\"], [\"FFB0AC\", \"Cornflower Lilac\"], [\"FFB1B3\", \"Sundown\"], [\"FFB31F\", \"My Sin\"], [\"FFB555\", \"Texas Rose\"], [\"FFB7D5\", \"Cotton Candy\"], [\"FFB97B\", \"Macaroni and Cheese\"], [\"FFBA00\", \"Selective Yellow\"], [\"FFBD5F\", \"Koromiko\"], [\"FFBF00\", \"Amber\"], [\"FFC0A8\", \"Wax Flower\"], [\"FFC0CB\", \"Pink\"], [\"FFC3C0\", \"Your Pink\"], [\"FFC901\", \"Supernova\"], [\"FFCBA4\", \"Flesh\"], [\"FFCC33\", \"Sunglow\"], [\"FFCC5C\", \"Golden Tainoi\"], [\"FFCC99\", \"Peach Orange\"], [\"FFCD8C\", \"Chardonnay\"], [\"FFD1DC\", \"Pastel Pink\"], [\"FFD2B7\", \"Romantic\"], [\"FFD38C\", \"Grandis\"], [\"FFD700\", \"Gold\"], [\"FFD800\", \"School bus Yellow\"], [\"FFD8D9\", \"Cosmos\"], [\"FFDB58\", \"Mustard\"], [\"FFDCD6\", \"Peach Schnapps\"], [\"FFDDAF\", \"Caramel\"], [\"FFDDCD\", \"Tuft Bush\"], [\"FFDDCF\", \"Watusi\"], [\"FFDDF4\", \"Pink Lace\"], [\"FFDEAD\", \"Navajo White\"], [\"FFDEB3\", \"Frangipani\"], [\"FFE1DF\", \"Pippin\"], [\"FFE1F2\", \"Pale Rose\"], [\"FFE2C5\", \"Negroni\"], [\"FFE5A0\", \"Cream Brulee\"], [\"FFE5B4\", \"Peach\"], [\"FFE6C7\", \"Tequila\"], [\"FFE772\", \"Kournikova\"], [\"FFEAC8\", \"Sandy Beach\"], [\"FFEAD4\", \"Karry\"], [\"FFEC13\", \"Broom\"], [\"FFEDBC\", \"Colonial White\"], [\"FFEED8\", \"Derby\"], [\"FFEFA1\", \"Vis Vis\"], [\"FFEFC1\", \"Egg White\"], [\"FFEFD5\", \"Papaya Whip\"], [\"FFEFEC\", \"Fair Pink\"], [\"FFF0DB\", \"Peach Cream\"], [\"FFF0F5\", \"Lavender blush\"], [\"FFF14F\", \"Gorse\"], [\"FFF1B5\", \"Buttermilk\"], [\"FFF1D8\", \"Pink Lady\"], [\"FFF1EE\", \"Forget Me Not\"], [\"FFF1F9\", \"Tutu\"], [\"FFF39D\", \"Picasso\"], [\"FFF3F1\", \"Chardon\"], [\"FFF46E\", \"Paris Daisy\"], [\"FFF4CE\", \"Barley White\"], [\"FFF4DD\", \"Egg Sour\"], [\"FFF4E0\", \"Sazerac\"], [\"FFF4E8\", \"Serenade\"], [\"FFF4F3\", \"Chablis\"], [\"FFF5EE\", \"Seashell Peach\"], [\"FFF5F3\", \"Sauvignon\"], [\"FFF6D4\", \"Milk Punch\"], [\"FFF6DF\", \"Varden\"], [\"FFF6F5\", \"Rose White\"], [\"FFF8D1\", \"Baja White\"], [\"FFF9E2\", \"Gin Fizz\"], [\"FFF9E6\", \"Early Dawn\"], [\"FFFACD\", \"Lemon Chiffon\"], [\"FFFAF4\", \"Bridal Heath\"], [\"FFFBDC\", \"Scotch Mist\"], [\"FFFBF9\", \"Soapstone\"], [\"FFFC99\", \"Witch Haze\"], [\"FFFCEA\", \"Buttery White\"], [\"FFFCEE\", \"Island Spice\"], [\"FFFDD0\", \"Cream\"], [\"FFFDE6\", \"Chilean Heath\"], [\"FFFDE8\", \"Travertine\"], [\"FFFDF3\", \"Orchid White\"], [\"FFFDF4\", \"Quarter Pearl Lusta\"], [\"FFFEE1\", \"Half and Half\"], [\"FFFEEC\", \"Apricot White\"], [\"FFFEF0\", \"Rice Cake\"], [\"FFFEF6\", \"Black White\"], [\"FFFEFD\", \"Romance\"], [\"FFFF00\", \"Yellow\"], [\"FFFF66\", \"Laser Lemon\"], [\"FFFF99\", \"Pale Canary\"], [\"FFFFB4\", \"Portafino\"], [\"FFFFF0\", \"Ivory\"], [\"FFFFFF\", \"White\"], [\"acc2d9\", \"cloudy blue\"], [\"56ae57\", \"dark pastel green\"], [\"b2996e\", \"dust\"], [\"a8ff04\", \"electric lime\"], [\"69d84f\", \"fresh green\"], [\"894585\", \"light eggplant\"], [\"70b23f\", \"nasty green\"], [\"d4ffff\", \"really light blue\"], [\"65ab7c\", \"tea\"], [\"952e8f\", \"warm purple\"], [\"fcfc81\", \"yellowish tan\"], [\"a5a391\", \"cement\"], [\"388004\", \"dark grass green\"], [\"4c9085\", \"dusty teal\"], [\"5e9b8a\", \"grey teal\"], [\"efb435\", \"macaroni and cheese\"], [\"d99b82\", \"pinkish tan\"], [\"0a5f38\", \"spruce\"], [\"0c06f7\", \"strong blue\"], [\"61de2a\", \"toxic green\"], [\"3778bf\", \"windows blue\"], [\"2242c7\", \"blue blue\"], [\"533cc6\", \"blue with a hint of purple\"], [\"9bb53c\", \"booger\"], [\"05ffa6\", \"bright sea green\"], [\"1f6357\", \"dark green blue\"], [\"017374\", \"deep turquoise\"], [\"0cb577\", \"green teal\"], [\"ff0789\", \"strong pink\"], [\"afa88b\", \"bland\"], [\"08787f\", \"deep aqua\"], [\"dd85d7\", \"lavender pink\"], [\"a6c875\", \"light moss green\"], [\"a7ffb5\", \"light seafoam green\"], [\"c2b709\", \"olive yellow\"], [\"e78ea5\", \"pig pink\"], [\"966ebd\", \"deep lilac\"], [\"ccad60\", \"desert\"], [\"ac86a8\", \"dusty lavender\"], [\"947e94\", \"purpley grey\"], [\"983fb2\", \"purply\"], [\"ff63e9\", \"candy pink\"], [\"b2fba5\", \"light pastel green\"], [\"63b365\", \"boring green\"], [\"8ee53f\", \"kiwi green\"], [\"b7e1a1\", \"light grey green\"], [\"ff6f52\", \"orange pink\"], [\"bdf8a3\", \"tea green\"], [\"d3b683\", \"very light brown\"], [\"fffcc4\", \"egg shell\"], [\"430541\", \"eggplant purple\"], [\"ffb2d0\", \"powder pink\"], [\"997570\", \"reddish grey\"], [\"ad900d\", \"baby shit brown\"], [\"c48efd\", \"liliac\"], [\"507b9c\", \"stormy blue\"], [\"7d7103\", \"ugly brown\"], [\"fffd78\", \"custard\"], [\"da467d\", \"darkish pink\"], [\"410200\", \"deep brown\"], [\"c9d179\", \"greenish beige\"], [\"fffa86\", \"manilla\"], [\"5684ae\", \"off blue\"], [\"6b7c85\", \"battleship grey\"], [\"6f6c0a\", \"browny green\"], [\"7e4071\", \"bruise\"], [\"009337\", \"kelley green\"], [\"d0e429\", \"sickly yellow\"], [\"fff917\", \"sunny yellow\"], [\"1d5dec\", \"azul\"], [\"054907\", \"darkgreen\"], [\"b5ce08\", \"green/yellow\"], [\"8fb67b\", \"lichen\"], [\"c8ffb0\", \"light light green\"], [\"fdde6c\", \"pale gold\"], [\"ffdf22\", \"sun yellow\"], [\"a9be70\", \"tan green\"], [\"6832e3\", \"burple\"], [\"fdb147\", \"butterscotch\"], [\"c7ac7d\", \"toupe\"], [\"fff39a\", \"dark cream\"], [\"850e04\", \"indian red\"], [\"efc0fe\", \"light lavendar\"], [\"40fd14\", \"poison green\"], [\"b6c406\", \"baby puke green\"], [\"9dff00\", \"bright yellow green\"], [\"3c4142\", \"charcoal grey\"], [\"f2ab15\", \"squash\"], [\"ac4f06\", \"cinnamon\"], [\"c4fe82\", \"light pea green\"], [\"2cfa1f\", \"radioactive green\"], [\"9a6200\", \"raw sienna\"], [\"ca9bf7\", \"baby purple\"], [\"875f42\", \"cocoa\"], [\"3a2efe\", \"light royal blue\"], [\"fd8d49\", \"orangeish\"], [\"8b3103\", \"rust brown\"], [\"cba560\", \"sand brown\"], [\"698339\", \"swamp\"], [\"0cdc73\", \"tealish green\"], [\"b75203\", \"burnt siena\"], [\"7f8f4e\", \"camo\"], [\"26538d\", \"dusk blue\"], [\"63a950\", \"fern\"], [\"c87f89\", \"old rose\"], [\"b1fc99\", \"pale light green\"], [\"ff9a8a\", \"peachy pink\"], [\"f6688e\", \"rosy pink\"], [\"76fda8\", \"light bluish green\"], [\"53fe5c\", \"light bright green\"], [\"4efd54\", \"light neon green\"], [\"a0febf\", \"light seafoam\"], [\"7bf2da\", \"tiffany blue\"], [\"bcf5a6\", \"washed out green\"], [\"ca6b02\", \"browny orange\"], [\"107ab0\", \"nice blue\"], [\"2138ab\", \"sapphire\"], [\"719f91\", \"greyish teal\"], [\"fdb915\", \"orangey yellow\"], [\"fefcaf\", \"parchment\"], [\"fcf679\", \"straw\"], [\"1d0200\", \"very dark brown\"], [\"cb6843\", \"terracota\"], [\"31668a\", \"ugly blue\"], [\"247afd\", \"clear blue\"], [\"ffffb6\", \"creme\"], [\"90fda9\", \"foam green\"], [\"86a17d\", \"grey/green\"], [\"fddc5c\", \"light gold\"], [\"78d1b6\", \"seafoam blue\"], [\"13bbaf\", \"topaz\"], [\"fb5ffc\", \"violet pink\"], [\"20f986\", \"wintergreen\"], [\"ffe36e\", \"yellow tan\"], [\"9d0759\", \"dark fuchsia\"], [\"3a18b1\", \"indigo blue\"], [\"c2ff89\", \"light yellowish green\"], [\"d767ad\", \"pale magenta\"], [\"720058\", \"rich purple\"], [\"ffda03\", \"sunflower yellow\"], [\"01c08d\", \"green/blue\"], [\"ac7434\", \"leather\"], [\"014600\", \"racing green\"], [\"9900fa\", \"vivid purple\"], [\"02066f\", \"dark royal blue\"], [\"8e7618\", \"hazel\"], [\"d1768f\", \"muted pink\"], [\"96b403\", \"booger green\"], [\"fdff63\", \"canary\"], [\"95a3a6\", \"cool grey\"], [\"7f684e\", \"dark taupe\"], [\"751973\", \"darkish purple\"], [\"089404\", \"true green\"], [\"ff6163\", \"coral pink\"], [\"598556\", \"dark sage\"], [\"214761\", \"dark slate blue\"], [\"3c73a8\", \"flat blue\"], [\"ba9e88\", \"mushroom\"], [\"021bf9\", \"rich blue\"], [\"734a65\", \"dirty purple\"], [\"23c48b\", \"greenblue\"], [\"8fae22\", \"icky green\"], [\"e6f2a2\", \"light khaki\"], [\"4b57db\", \"warm blue\"], [\"d90166\", \"dark hot pink\"], [\"015482\", \"deep sea blue\"], [\"9d0216\", \"carmine\"], [\"728f02\", \"dark yellow green\"], [\"ffe5ad\", \"pale peach\"], [\"4e0550\", \"plum purple\"], [\"f9bc08\", \"golden rod\"], [\"ff073a\", \"neon red\"], [\"c77986\", \"old pink\"], [\"d6fffe\", \"very pale blue\"], [\"fe4b03\", \"blood orange\"], [\"fd5956\", \"grapefruit\"], [\"fce166\", \"sand yellow\"], [\"b2713d\", \"clay brown\"], [\"1f3b4d\", \"dark blue grey\"], [\"699d4c\", \"flat green\"], [\"56fca2\", \"light green blue\"], [\"fb5581\", \"warm pink\"], [\"3e82fc\", \"dodger blue\"], [\"a0bf16\", \"gross green\"], [\"d6fffa\", \"ice\"], [\"4f738e\", \"metallic blue\"], [\"ffb19a\", \"pale salmon\"], [\"5c8b15\", \"sap green\"], [\"54ac68\", \"algae\"], [\"89a0b0\", \"bluey grey\"], [\"7ea07a\", \"greeny grey\"], [\"1bfc06\", \"highlighter green\"], [\"cafffb\", \"light light blue\"], [\"b6ffbb\", \"light mint\"], [\"a75e09\", \"raw umber\"], [\"152eff\", \"vivid blue\"], [\"8d5eb7\", \"deep lavender\"], [\"5f9e8f\", \"dull teal\"], [\"63f7b4\", \"light greenish blue\"], [\"606602\", \"mud green\"], [\"fc86aa\", \"pinky\"], [\"8c0034\", \"red wine\"], [\"758000\", \"shit green\"], [\"ab7e4c\", \"tan brown\"], [\"030764\", \"darkblue\"], [\"fe86a4\", \"rosa\"], [\"d5174e\", \"lipstick\"], [\"fed0fc\", \"pale mauve\"], [\"680018\", \"claret\"], [\"fedf08\", \"dandelion\"], [\"fe420f\", \"orangered\"], [\"6f7c00\", \"poop green\"], [\"ca0147\", \"ruby\"], [\"1b2431\", \"dark\"], [\"00fbb0\", \"greenish turquoise\"], [\"db5856\", \"pastel red\"], [\"ddd618\", \"piss yellow\"], [\"41fdfe\", \"bright cyan\"], [\"cf524e\", \"dark coral\"], [\"21c36f\", \"algae green\"], [\"a90308\", \"darkish red\"], [\"6e1005\", \"reddy brown\"], [\"fe828c\", \"blush pink\"], [\"4b6113\", \"camouflage green\"], [\"4da409\", \"lawn green\"], [\"beae8a\", \"putty\"], [\"0339f8\", \"vibrant blue\"], [\"a88f59\", \"dark sand\"], [\"5d21d0\", \"purple/blue\"], [\"feb209\", \"saffron\"], [\"4e518b\", \"twilight\"], [\"964e02\", \"warm brown\"], [\"85a3b2\", \"bluegrey\"], [\"ff69af\", \"bubble gum pink\"], [\"c3fbf4\", \"duck egg blue\"], [\"2afeb7\", \"greenish cyan\"], [\"005f6a\", \"petrol\"], [\"0c1793\", \"royal\"], [\"ffff81\", \"butter\"], [\"f0833a\", \"dusty orange\"], [\"f1f33f\", \"off yellow\"], [\"b1d27b\", \"pale olive green\"], [\"fc824a\", \"orangish\"], [\"71aa34\", \"leaf\"], [\"b7c9e2\", \"light blue grey\"], [\"4b0101\", \"dried blood\"], [\"a552e6\", \"lightish purple\"], [\"af2f0d\", \"rusty red\"], [\"8b88f8\", \"lavender blue\"], [\"9af764\", \"light grass green\"], [\"a6fbb2\", \"light mint green\"], [\"ffc512\", \"sunflower\"], [\"750851\", \"velvet\"], [\"c14a09\", \"brick orange\"], [\"fe2f4a\", \"lightish red\"], [\"0203e2\", \"pure blue\"], [\"0a437a\", \"twilight blue\"], [\"a50055\", \"violet red\"], [\"ae8b0c\", \"yellowy brown\"], [\"fd798f\", \"carnation\"], [\"bfac05\", \"muddy yellow\"], [\"3eaf76\", \"dark seafoam green\"], [\"c74767\", \"deep rose\"], [\"b9484e\", \"dusty red\"], [\"647d8e\", \"grey/blue\"], [\"bffe28\", \"lemon lime\"], [\"d725de\", \"purple/pink\"], [\"b29705\", \"brown yellow\"], [\"673a3f\", \"purple brown\"], [\"a87dc2\", \"wisteria\"], [\"fafe4b\", \"banana yellow\"], [\"c0022f\", \"lipstick red\"], [\"0e87cc\", \"water blue\"], [\"8d8468\", \"brown grey\"], [\"ad03de\", \"vibrant purple\"], [\"8cff9e\", \"baby green\"], [\"94ac02\", \"barf green\"], [\"c4fff7\", \"eggshell blue\"], [\"fdee73\", \"sandy yellow\"], [\"33b864\", \"cool green\"], [\"fff9d0\", \"pale\"], [\"758da3\", \"blue/grey\"], [\"f504c9\", \"hot magenta\"], [\"77a1b5\", \"greyblue\"], [\"8756e4\", \"purpley\"], [\"889717\", \"baby shit green\"], [\"c27e79\", \"brownish pink\"], [\"017371\", \"dark aquamarine\"], [\"9f8303\", \"diarrhea\"], [\"f7d560\", \"light mustard\"], [\"bdf6fe\", \"pale sky blue\"], [\"75b84f\", \"turtle green\"], [\"9cbb04\", \"bright olive\"], [\"29465b\", \"dark grey blue\"], [\"696006\", \"greeny brown\"], [\"adf802\", \"lemon green\"], [\"c1c6fc\", \"light periwinkle\"], [\"35ad6b\", \"seaweed green\"], [\"fffd37\", \"sunshine yellow\"], [\"a442a0\", \"ugly purple\"], [\"f36196\", \"medium pink\"], [\"947706\", \"puke brown\"], [\"fff4f2\", \"very light pink\"], [\"1e9167\", \"viridian\"], [\"b5c306\", \"bile\"], [\"feff7f\", \"faded yellow\"], [\"cffdbc\", \"very pale green\"], [\"0add08\", \"vibrant green\"], [\"87fd05\", \"bright lime\"], [\"1ef876\", \"spearmint\"], [\"7bfdc7\", \"light aquamarine\"], [\"bcecac\", \"light sage\"], [\"bbf90f\", \"yellowgreen\"], [\"ab9004\", \"baby poo\"], [\"1fb57a\", \"dark seafoam\"], [\"00555a\", \"deep teal\"], [\"a484ac\", \"heather\"], [\"c45508\", \"rust orange\"], [\"3f829d\", \"dirty blue\"], [\"548d44\", \"fern green\"], [\"c95efb\", \"bright lilac\"], [\"3ae57f\", \"weird green\"], [\"016795\", \"peacock blue\"], [\"87a922\", \"avocado green\"], [\"f0944d\", \"faded orange\"], [\"5d1451\", \"grape purple\"], [\"25ff29\", \"hot green\"], [\"d0fe1d\", \"lime yellow\"], [\"ffa62b\", \"mango\"], [\"01b44c\", \"shamrock\"], [\"ff6cb5\", \"bubblegum\"], [\"6b4247\", \"purplish brown\"], [\"c7c10c\", \"vomit yellow\"], [\"b7fffa\", \"pale cyan\"], [\"aeff6e\", \"key lime\"], [\"ec2d01\", \"tomato red\"], [\"76ff7b\", \"lightgreen\"], [\"730039\", \"merlot\"], [\"040348\", \"night blue\"], [\"df4ec8\", \"purpleish pink\"], [\"6ecb3c\", \"apple\"], [\"8f9805\", \"baby poop green\"], [\"5edc1f\", \"green apple\"], [\"d94ff5\", \"heliotrope\"], [\"c8fd3d\", \"yellow/green\"], [\"070d0d\", \"almost black\"], [\"4984b8\", \"cool blue\"], [\"51b73b\", \"leafy green\"], [\"ac7e04\", \"mustard brown\"], [\"4e5481\", \"dusk\"], [\"876e4b\", \"dull brown\"], [\"58bc08\", \"frog green\"], [\"2fef10\", \"vivid green\"], [\"2dfe54\", \"bright light green\"], [\"0aff02\", \"fluro green\"], [\"9cef43\", \"kiwi\"], [\"18d17b\", \"seaweed\"], [\"35530a\", \"navy green\"], [\"1805db\", \"ultramarine blue\"], [\"6258c4\", \"iris\"], [\"ff964f\", \"pastel orange\"], [\"ffab0f\", \"yellowish orange\"], [\"8f8ce7\", \"perrywinkle\"], [\"24bca8\", \"tealish\"], [\"3f012c\", \"dark plum\"], [\"cbf85f\", \"pear\"], [\"ff724c\", \"pinkish orange\"], [\"280137\", \"midnight purple\"], [\"b36ff6\", \"light urple\"], [\"48c072\", \"dark mint\"], [\"bccb7a\", \"greenish tan\"], [\"a8415b\", \"light burgundy\"], [\"06b1c4\", \"turquoise blue\"], [\"cd7584\", \"ugly pink\"], [\"f1da7a\", \"sandy\"], [\"ff0490\", \"electric pink\"], [\"805b87\", \"muted purple\"], [\"50a747\", \"mid green\"], [\"a8a495\", \"greyish\"], [\"cfff04\", \"neon yellow\"], [\"ffff7e\", \"banana\"], [\"ff7fa7\", \"carnation pink\"], [\"ef4026\", \"tomato\"], [\"3c9992\", \"sea\"], [\"886806\", \"muddy brown\"], [\"04f489\", \"turquoise green\"], [\"fef69e\", \"buff\"], [\"cfaf7b\", \"fawn\"], [\"3b719f\", \"muted blue\"], [\"fdc1c5\", \"pale rose\"], [\"20c073\", \"dark mint green\"], [\"9b5fc0\", \"amethyst\"], [\"0f9b8e\", \"blue/green\"], [\"742802\", \"chestnut\"], [\"9db92c\", \"sick green\"], [\"a4bf20\", \"pea\"], [\"cd5909\", \"rusty orange\"], [\"ada587\", \"stone\"], [\"be013c\", \"rose red\"], [\"b8ffeb\", \"pale aqua\"], [\"dc4d01\", \"deep orange\"], [\"a2653e\", \"earth\"], [\"638b27\", \"mossy green\"], [\"419c03\", \"grassy green\"], [\"b1ff65\", \"pale lime green\"], [\"9dbcd4\", \"light grey blue\"], [\"fdfdfe\", \"pale grey\"], [\"77ab56\", \"asparagus\"], [\"464196\", \"blueberry\"], [\"990147\", \"purple red\"], [\"befd73\", \"pale lime\"], [\"32bf84\", \"greenish teal\"], [\"af6f09\", \"caramel\"], [\"a0025c\", \"deep magenta\"], [\"ffd8b1\", \"light peach\"], [\"7f4e1e\", \"milk chocolate\"], [\"bf9b0c\", \"ocher\"], [\"6ba353\", \"off green\"], [\"f075e6\", \"purply pink\"], [\"7bc8f6\", \"lightblue\"], [\"475f94\", \"dusky blue\"], [\"f5bf03\", \"golden\"], [\"fffeb6\", \"light beige\"], [\"fffd74\", \"butter yellow\"], [\"895b7b\", \"dusky purple\"], [\"436bad\", \"french blue\"], [\"d0c101\", \"ugly yellow\"], [\"c6f808\", \"greeny yellow\"], [\"f43605\", \"orangish red\"], [\"02c14d\", \"shamrock green\"], [\"b25f03\", \"orangish brown\"], [\"2a7e19\", \"tree green\"], [\"490648\", \"deep violet\"], [\"536267\", \"gunmetal\"], [\"5a06ef\", \"blue/purple\"], [\"cf0234\", \"cherry\"], [\"c4a661\", \"sandy brown\"], [\"978a84\", \"warm grey\"], [\"1f0954\", \"dark indigo\"], [\"03012d\", \"midnight\"], [\"2bb179\", \"bluey green\"], [\"c3909b\", \"grey pink\"], [\"a66fb5\", \"soft purple\"], [\"770001\", \"blood\"], [\"922b05\", \"brown red\"], [\"7d7f7c\", \"medium grey\"], [\"990f4b\", \"berry\"], [\"8f7303\", \"poo\"], [\"c83cb9\", \"purpley pink\"], [\"fea993\", \"light salmon\"], [\"acbb0d\", \"snot\"], [\"c071fe\", \"easter purple\"], [\"ccfd7f\", \"light yellow green\"], [\"00022e\", \"dark navy blue\"], [\"828344\", \"drab\"], [\"ffc5cb\", \"light rose\"], [\"ab1239\", \"rouge\"], [\"b0054b\", \"purplish red\"], [\"99cc04\", \"slime green\"], [\"937c00\", \"baby poop\"], [\"019529\", \"irish green\"], [\"ef1de7\", \"pink/purple\"], [\"000435\", \"dark navy\"], [\"42b395\", \"greeny blue\"], [\"9d5783\", \"light plum\"], [\"c8aca9\", \"pinkish grey\"], [\"c87606\", \"dirty orange\"], [\"aa2704\", \"rust red\"], [\"e4cbff\", \"pale lilac\"], [\"fa4224\", \"orangey red\"], [\"0804f9\", \"primary blue\"], [\"5cb200\", \"kermit green\"], [\"76424e\", \"brownish purple\"], [\"6c7a0e\", \"murky green\"], [\"fbdd7e\", \"wheat\"], [\"2a0134\", \"very dark purple\"], [\"044a05\", \"bottle green\"], [\"fd4659\", \"watermelon\"], [\"0d75f8\", \"deep sky blue\"], [\"fe0002\", \"fire engine red\"], [\"cb9d06\", \"yellow ochre\"], [\"fb7d07\", \"pumpkin orange\"], [\"b9cc81\", \"pale olive\"], [\"edc8ff\", \"light lilac\"], [\"61e160\", \"lightish green\"], [\"8ab8fe\", \"carolina blue\"], [\"920a4e\", \"mulberry\"], [\"fe02a2\", \"shocking pink\"], [\"9a3001\", \"auburn\"], [\"65fe08\", \"bright lime green\"], [\"befdb7\", \"celadon\"], [\"b17261\", \"pinkish brown\"], [\"885f01\", \"poo brown\"], [\"02ccfe\", \"bright sky blue\"], [\"c1fd95\", \"celery\"], [\"836539\", \"dirt brown\"], [\"fb2943\", \"strawberry\"], [\"84b701\", \"dark lime\"], [\"b66325\", \"copper\"], [\"7f5112\", \"medium brown\"], [\"5fa052\", \"muted green\"], [\"6dedfd\", \"robin's egg\"], [\"0bf9ea\", \"bright aqua\"], [\"c760ff\", \"bright lavender\"], [\"ffffcb\", \"ivory\"], [\"f6cefc\", \"very light purple\"], [\"155084\", \"light navy\"], [\"f5054f\", \"pink red\"], [\"645403\", \"olive brown\"], [\"7a5901\", \"poop brown\"], [\"a8b504\", \"mustard green\"], [\"3d9973\", \"ocean green\"], [\"000133\", \"very dark blue\"], [\"76a973\", \"dusty green\"], [\"2e5a88\", \"light navy blue\"], [\"0bf77d\", \"minty green\"], [\"bd6c48\", \"adobe\"], [\"ac1db8\", \"barney\"], [\"2baf6a\", \"jade green\"], [\"26f7fd\", \"bright light blue\"], [\"aefd6c\", \"light lime\"], [\"9b8f55\", \"dark khaki\"], [\"ffad01\", \"orange yellow\"], [\"c69c04\", \"ocre\"], [\"f4d054\", \"maize\"], [\"de9dac\", \"faded pink\"], [\"05480d\", \"british racing green\"], [\"c9ae74\", \"sandstone\"], [\"60460f\", \"mud brown\"], [\"98f6b0\", \"light sea green\"], [\"8af1fe\", \"robin egg blue\"], [\"2ee8bb\", \"aqua marine\"], [\"11875d\", \"dark sea green\"], [\"fdb0c0\", \"soft pink\"], [\"b16002\", \"orangey brown\"], [\"f7022a\", \"cherry red\"], [\"d5ab09\", \"burnt yellow\"], [\"86775f\", \"brownish grey\"], [\"c69f59\", \"camel\"], [\"7a687f\", \"purplish grey\"], [\"042e60\", \"marine\"], [\"c88d94\", \"greyish pink\"], [\"a5fbd5\", \"pale turquoise\"], [\"fffe71\", \"pastel yellow\"], [\"6241c7\", \"bluey purple\"], [\"fffe40\", \"canary yellow\"], [\"d3494e\", \"faded red\"], [\"985e2b\", \"sepia\"], [\"a6814c\", \"coffee\"], [\"ff08e8\", \"bright magenta\"], [\"9d7651\", \"mocha\"], [\"feffca\", \"ecru\"], [\"98568d\", \"purpleish\"], [\"9e003a\", \"cranberry\"], [\"287c37\", \"darkish green\"], [\"b96902\", \"brown orange\"], [\"ba6873\", \"dusky rose\"], [\"ff7855\", \"melon\"], [\"94b21c\", \"sickly green\"], [\"c5c9c7\", \"silver\"], [\"661aee\", \"purply blue\"], [\"6140ef\", \"purpleish blue\"], [\"9be5aa\", \"hospital green\"], [\"7b5804\", \"shit brown\"], [\"276ab3\", \"mid blue\"], [\"feb308\", \"amber\"], [\"8cfd7e\", \"easter green\"], [\"6488ea\", \"soft blue\"], [\"056eee\", \"cerulean blue\"], [\"b27a01\", \"golden brown\"], [\"0ffef9\", \"bright turquoise\"], [\"fa2a55\", \"red pink\"], [\"820747\", \"red purple\"], [\"7a6a4f\", \"greyish brown\"], [\"f4320c\", \"vermillion\"], [\"a13905\", \"russet\"], [\"6f828a\", \"steel grey\"], [\"a55af4\", \"lighter purple\"], [\"ad0afd\", \"bright violet\"], [\"004577\", \"prussian blue\"], [\"658d6d\", \"slate green\"], [\"ca7b80\", \"dirty pink\"], [\"005249\", \"dark blue green\"], [\"2b5d34\", \"pine\"], [\"bff128\", \"yellowy green\"], [\"b59410\", \"dark gold\"], [\"2976bb\", \"bluish\"], [\"014182\", \"darkish blue\"], [\"bb3f3f\", \"dull red\"], [\"fc2647\", \"pinky red\"], [\"a87900\", \"bronze\"], [\"82cbb2\", \"pale teal\"], [\"667c3e\", \"military green\"], [\"fe46a5\", \"barbie pink\"], [\"fe83cc\", \"bubblegum pink\"], [\"94a617\", \"pea soup green\"], [\"a88905\", \"dark mustard\"], [\"7f5f00\", \"shit\"], [\"9e43a2\", \"medium purple\"], [\"062e03\", \"very dark green\"], [\"8a6e45\", \"dirt\"], [\"cc7a8b\", \"dusky pink\"], [\"9e0168\", \"red violet\"], [\"fdff38\", \"lemon yellow\"], [\"c0fa8b\", \"pistachio\"], [\"eedc5b\", \"dull yellow\"], [\"7ebd01\", \"dark lime green\"], [\"3b5b92\", \"denim blue\"], [\"01889f\", \"teal blue\"], [\"3d7afd\", \"lightish blue\"], [\"5f34e7\", \"purpley blue\"], [\"6d5acf\", \"light indigo\"], [\"748500\", \"swamp green\"], [\"706c11\", \"brown green\"], [\"3c0008\", \"dark maroon\"], [\"cb00f5\", \"hot purple\"], [\"002d04\", \"dark forest green\"], [\"658cbb\", \"faded blue\"], [\"749551\", \"drab green\"], [\"b9ff66\", \"light lime green\"], [\"9dc100\", \"snot green\"], [\"faee66\", \"yellowish\"], [\"7efbb3\", \"light blue green\"], [\"7b002c\", \"bordeaux\"], [\"c292a1\", \"light mauve\"], [\"017b92\", \"ocean\"], [\"fcc006\", \"marigold\"], [\"657432\", \"muddy green\"], [\"d8863b\", \"dull orange\"], [\"738595\", \"steel\"], [\"aa23ff\", \"electric purple\"], [\"08ff08\", \"fluorescent green\"], [\"9b7a01\", \"yellowish brown\"], [\"f29e8e\", \"blush\"], [\"6fc276\", \"soft green\"], [\"ff5b00\", \"bright orange\"], [\"fdff52\", \"lemon\"], [\"866f85\", \"purple grey\"], [\"8ffe09\", \"acid green\"], [\"eecffe\", \"pale lavender\"], [\"510ac9\", \"violet blue\"], [\"4f9153\", \"light forest green\"], [\"9f2305\", \"burnt red\"], [\"728639\", \"khaki green\"], [\"de0c62\", \"cerise\"], [\"916e99\", \"faded purple\"], [\"ffb16d\", \"apricot\"], [\"3c4d03\", \"dark olive green\"], [\"7f7053\", \"grey brown\"], [\"77926f\", \"green grey\"], [\"010fcc\", \"true blue\"], [\"ceaefa\", \"pale violet\"], [\"8f99fb\", \"periwinkle blue\"], [\"c6fcff\", \"light sky blue\"], [\"5539cc\", \"blurple\"], [\"544e03\", \"green brown\"], [\"017a79\", \"bluegreen\"], [\"01f9c6\", \"bright teal\"], [\"c9b003\", \"brownish yellow\"], [\"929901\", \"pea soup\"], [\"0b5509\", \"forest\"], [\"a00498\", \"barney purple\"], [\"2000b1\", \"ultramarine\"], [\"94568c\", \"purplish\"], [\"c2be0e\", \"puke yellow\"], [\"748b97\", \"bluish grey\"], [\"665fd1\", \"dark periwinkle\"], [\"9c6da5\", \"dark lilac\"], [\"c44240\", \"reddish\"], [\"a24857\", \"light maroon\"], [\"825f87\", \"dusty purple\"], [\"c9643b\", \"terra cotta\"], [\"90b134\", \"avocado\"], [\"01386a\", \"marine blue\"], [\"25a36f\", \"teal green\"], [\"59656d\", \"slate grey\"], [\"75fd63\", \"lighter green\"], [\"21fc0d\", \"electric green\"], [\"5a86ad\", \"dusty blue\"], [\"fec615\", \"golden yellow\"], [\"fffd01\", \"bright yellow\"], [\"dfc5fe\", \"light lavender\"], [\"b26400\", \"umber\"], [\"7f5e00\", \"poop\"], [\"de7e5d\", \"dark peach\"], [\"048243\", \"jungle green\"], [\"ffffd4\", \"eggshell\"], [\"3b638c\", \"denim\"], [\"b79400\", \"yellow brown\"], [\"84597e\", \"dull purple\"], [\"411900\", \"chocolate brown\"], [\"7b0323\", \"wine red\"], [\"04d9ff\", \"neon blue\"], [\"667e2c\", \"dirty green\"], [\"fbeeac\", \"light tan\"], [\"d7fffe\", \"ice blue\"], [\"4e7496\", \"cadet blue\"], [\"874c62\", \"dark mauve\"], [\"d5ffff\", \"very light blue\"], [\"826d8c\", \"grey purple\"], [\"ffbacd\", \"pastel pink\"], [\"d1ffbd\", \"very light green\"], [\"448ee4\", \"dark sky blue\"], [\"05472a\", \"evergreen\"], [\"d5869d\", \"dull pink\"], [\"3d0734\", \"aubergine\"], [\"4a0100\", \"mahogany\"], [\"f8481c\", \"reddish orange\"], [\"02590f\", \"deep green\"], [\"89a203\", \"vomit green\"], [\"e03fd8\", \"purple pink\"], [\"d58a94\", \"dusty pink\"], [\"7bb274\", \"faded green\"], [\"526525\", \"camo green\"], [\"c94cbe\", \"pinky purple\"], [\"db4bda\", \"pink purple\"], [\"9e3623\", \"brownish red\"], [\"b5485d\", \"dark rose\"], [\"735c12\", \"mud\"], [\"9c6d57\", \"brownish\"], [\"028f1e\", \"emerald green\"], [\"b1916e\", \"pale brown\"], [\"49759c\", \"dull blue\"], [\"a0450e\", \"burnt umber\"], [\"39ad48\", \"medium green\"], [\"b66a50\", \"clay\"], [\"8cffdb\", \"light aqua\"], [\"a4be5c\", \"light olive green\"], [\"cb7723\", \"brownish orange\"], [\"05696b\", \"dark aqua\"], [\"ce5dae\", \"purplish pink\"], [\"c85a53\", \"dark salmon\"], [\"96ae8d\", \"greenish grey\"], [\"1fa774\", \"jade\"], [\"7a9703\", \"ugly green\"], [\"ac9362\", \"dark beige\"], [\"01a049\", \"emerald\"], [\"d9544d\", \"pale red\"], [\"fa5ff7\", \"light magenta\"], [\"82cafc\", \"sky\"], [\"acfffc\", \"light cyan\"], [\"fcb001\", \"yellow orange\"], [\"910951\", \"reddish purple\"], [\"fe2c54\", \"reddish pink\"], [\"c875c4\", \"orchid\"], [\"cdc50a\", \"dirty yellow\"], [\"fd411e\", \"orange red\"], [\"9a0200\", \"deep red\"], [\"be6400\", \"orange brown\"], [\"030aa7\", \"cobalt blue\"], [\"fe019a\", \"neon pink\"], [\"f7879a\", \"rose pink\"], [\"887191\", \"greyish purple\"], [\"b00149\", \"raspberry\"], [\"12e193\", \"aqua green\"], [\"fe7b7c\", \"salmon pink\"], [\"ff9408\", \"tangerine\"], [\"6a6e09\", \"brownish green\"], [\"8b2e16\", \"red brown\"], [\"696112\", \"greenish brown\"], [\"e17701\", \"pumpkin\"], [\"0a481e\", \"pine green\"], [\"343837\", \"charcoal\"], [\"ffb7ce\", \"baby pink\"], [\"6a79f7\", \"cornflower\"], [\"5d06e9\", \"blue violet\"], [\"3d1c02\", \"chocolate\"], [\"82a67d\", \"greyish green\"], [\"be0119\", \"scarlet\"], [\"c9ff27\", \"green yellow\"], [\"373e02\", \"dark olive\"], [\"a9561e\", \"sienna\"], [\"caa0ff\", \"pastel purple\"], [\"ca6641\", \"terracotta\"], [\"02d8e9\", \"aqua blue\"], [\"88b378\", \"sage green\"], [\"980002\", \"blood red\"], [\"cb0162\", \"deep pink\"], [\"5cac2d\", \"grass\"], [\"769958\", \"moss\"], [\"a2bffe\", \"pastel blue\"], [\"10a674\", \"bluish green\"], [\"06b48b\", \"green blue\"], [\"af884a\", \"dark tan\"], [\"0b8b87\", \"greenish blue\"], [\"ffa756\", \"pale orange\"], [\"a2a415\", \"vomit\"], [\"154406\", \"forrest green\"], [\"856798\", \"dark lavender\"], [\"34013f\", \"dark violet\"], [\"632de9\", \"purple blue\"], [\"0a888a\", \"dark cyan\"], [\"6f7632\", \"olive drab\"], [\"d46a7e\", \"pinkish\"], [\"1e488f\", \"cobalt\"], [\"bc13fe\", \"neon purple\"], [\"7ef4cc\", \"light turquoise\"], [\"76cd26\", \"apple green\"], [\"74a662\", \"dull green\"], [\"80013f\", \"wine\"], [\"b1d1fc\", \"powder blue\"], [\"ffffe4\", \"off white\"], [\"0652ff\", \"electric blue\"], [\"045c5a\", \"dark turquoise\"], [\"5729ce\", \"blue purple\"], [\"069af3\", \"azure\"], [\"ff000d\", \"bright red\"], [\"f10c45\", \"pinkish red\"], [\"5170d7\", \"cornflower blue\"], [\"acbf69\", \"light olive\"], [\"6c3461\", \"grape\"], [\"5e819d\", \"greyish blue\"], [\"601ef9\", \"purplish blue\"], [\"b0dd16\", \"yellowish green\"], [\"cdfd02\", \"greenish yellow\"], [\"2c6fbb\", \"medium blue\"], [\"c0737a\", \"dusty rose\"], [\"d6b4fc\", \"light violet\"], [\"020035\", \"midnight blue\"], [\"703be7\", \"bluish purple\"], [\"fd3c06\", \"red orange\"], [\"960056\", \"dark magenta\"], [\"40a368\", \"greenish\"], [\"03719c\", \"ocean blue\"], [\"fc5a50\", \"coral\"], [\"ffffc2\", \"cream\"], [\"7f2b0a\", \"reddish brown\"], [\"b04e0f\", \"burnt sienna\"], [\"a03623\", \"brick\"], [\"87ae73\", \"sage\"], [\"789b73\", \"grey green\"], [\"ffffff\", \"white\"], [\"98eff9\", \"robin's egg blue\"], [\"658b38\", \"moss green\"], [\"5a7d9a\", \"steel blue\"], [\"380835\", \"eggplant\"], [\"fffe7a\", \"light yellow\"], [\"5ca904\", \"leaf green\"], [\"d8dcd6\", \"light grey\"], [\"a5a502\", \"puke\"], [\"d648d7\", \"pinkish purple\"], [\"047495\", \"sea blue\"], [\"b790d4\", \"pale purple\"], [\"5b7c99\", \"slate blue\"], [\"607c8e\", \"blue grey\"], [\"0b4008\", \"hunter green\"], [\"ed0dd9\", \"fuchsia\"], [\"8c000f\", \"crimson\"], [\"ffff84\", \"pale yellow\"], [\"bf9005\", \"ochre\"], [\"d2bd0a\", \"mustard yellow\"], [\"ff474c\", \"light red\"], [\"0485d1\", \"cerulean\"], [\"ffcfdc\", \"pale pink\"], [\"040273\", \"deep blue\"], [\"a83c09\", \"rust\"], [\"90e4c1\", \"light teal\"], [\"516572\", \"slate\"], [\"fac205\", \"goldenrod\"], [\"d5b60a\", \"dark yellow\"], [\"363737\", \"dark grey\"], [\"4b5d16\", \"army green\"], [\"6b8ba4\", \"grey blue\"], [\"80f9ad\", \"seafoam\"], [\"a57e52\", \"puce\"], [\"a9f971\", \"spring green\"], [\"c65102\", \"dark orange\"], [\"e2ca76\", \"sand\"], [\"b0ff9d\", \"pastel green\"], [\"9ffeb0\", \"mint\"], [\"fdaa48\", \"light orange\"], [\"fe01b1\", \"bright pink\"], [\"c1f80a\", \"chartreuse\"], [\"36013f\", \"deep purple\"], [\"341c02\", \"dark brown\"], [\"b9a281\", \"taupe\"], [\"8eab12\", \"pea green\"], [\"9aae07\", \"puke green\"], [\"02ab2e\", \"kelly green\"], [\"7af9ab\", \"seafoam green\"], [\"137e6d\", \"blue green\"], [\"aaa662\", \"khaki\"], [\"610023\", \"burgundy\"], [\"014d4e\", \"dark teal\"], [\"8f1402\", \"brick red\"], [\"4b006e\", \"royal purple\"], [\"580f41\", \"plum\"], [\"8fff9f\", \"mint green\"], [\"dbb40c\", \"gold\"], [\"a2cffe\", \"baby blue\"], [\"c0fb2d\", \"yellow green\"], [\"be03fd\", \"bright purple\"], [\"840000\", \"dark red\"], [\"d0fefe\", \"pale blue\"], [\"3f9b0b\", \"grass green\"], [\"01153e\", \"navy\"], [\"04d8b2\", \"aquamarine\"], [\"c04e01\", \"burnt orange\"], [\"0cff0c\", \"neon green\"], [\"0165fc\", \"bright blue\"], [\"cf6275\", \"rose\"], [\"ffd1df\", \"light pink\"], [\"ceb301\", \"mustard\"], [\"380282\", \"indigo\"], [\"aaff32\", \"lime\"], [\"53fca1\", \"sea green\"], [\"8e82fe\", \"periwinkle\"], [\"cb416b\", \"dark pink\"], [\"677a04\", \"olive green\"], [\"ffb07c\", \"peach\"], [\"c7fdb5\", \"pale green\"], [\"ad8150\", \"light brown\"], [\"ff028d\", \"hot pink\"], [\"000000\", \"black\"], [\"cea2fd\", \"lilac\"], [\"001146\", \"navy blue\"], [\"0504aa\", \"royal blue\"], [\"e6daa6\", \"beige\"], [\"ff796c\", \"salmon\"], [\"6e750e\", \"olive\"], [\"650021\", \"maroon\"], [\"01ff07\", \"bright green\"], [\"35063e\", \"dark purple\"], [\"ae7181\", \"mauve\"], [\"06470c\", \"forest green\"], [\"13eac9\", \"aqua\"], [\"00ffff\", \"cyan\"], [\"d1b26f\", \"tan\"], [\"00035b\", \"dark blue\"], [\"c79fef\", \"lavender\"], [\"06c2ac\", \"turquoise\"], [\"033500\", \"dark green\"], [\"9a0eea\", \"violet\"], [\"bf77f6\", \"light purple\"], [\"89fe05\", \"lime green\"], [\"929591\", \"grey\"], [\"75bbfd\", \"sky blue\"], [\"ffff14\", \"yellow\"], [\"c20078\", \"magenta\"], [\"96f97b\", \"light green\"], [\"f97306\", \"orange\"], [\"029386\", \"teal\"], [\"95d0fc\", \"light blue\"], [\"e50000\", \"red\"], [\"653700\", \"brown\"], [\"ff81c0\", \"pink\"], [\"0343df\", \"blue\"], [\"15b01a\", \"green\"], [\"7e1e9c\", \"purple\"], [\"00000000\", \"transparent\"]];\n names.each(function(element) {\n return (lookup[normalizeKey(element[1])] = parseHex(element[0]));\n });\n window.Color.random = function() {\n return Color(rand(256), rand(256), rand(256), 1);\n };\n return (window.Color.mix = function(color1, color2, amount) {\n var new_colors;\n amount || (amount = 0.5);\n new_colors = color1.channels().zip(color2.channels()).map(function(array) {\n return (array[0] * amount) + (array[1] * (1 - amount));\n });\n return Color(new_colors);\n });\n})();;\nvar Core;\nvar __slice = Array.prototype.slice;\n/***\nThe Core class is used to add extended functionality to objects without\nextending the object class directly. Inherit from Core to gain its utility\nmethods.\n\n@name Core\n@constructor\n\n@param {Object} I Instance variables\n*/\n/***\n@name I\n@memberOf Core#\n*/\nCore = function(I) {\n var self;\n I || (I = {});\n return (self = {\n I: I,\n /***\n Generates a public jQuery style getter / setter method for each\n String argument.\n\n @name attrAccessor\n @methodOf Core#\n */\n attrAccessor: function() {\n var attrNames;\n attrNames = __slice.call(arguments, 0);\n return attrNames.each(function(attrName) {\n return (self[attrName] = function(newValue) {\n if (typeof newValue !== \"undefined\" && newValue !== null) {\n I[attrName] = newValue;\n return self;\n } else {\n return I[attrName];\n }\n });\n });\n },\n /***\n Generates a public jQuery style getter method for each String argument.\n\n @name attrReader\n @methodOf Core#\n */\n attrReader: function() {\n var attrNames;\n attrNames = __slice.call(arguments, 0);\n return attrNames.each(function(attrName) {\n return (self[attrName] = function() {\n return I[attrName];\n });\n });\n },\n /***\n Extends this object with methods from the passed in object. `before` and\n `after` are special option names that glue functionality before or after\n existing methods.\n\n @name extend\n @methodOf Core#\n */\n extend: function(options) {\n var afterMethods, beforeMethods;\n afterMethods = options.after;\n beforeMethods = options.before;\n delete options.after;\n delete options.before;\n $.extend(self, options);\n if (beforeMethods) {\n $.each(beforeMethods, function(name, fn) {\n return (self[name] = self[name].withBefore(fn));\n });\n }\n if (afterMethods) {\n $.each(afterMethods, function(name, fn) {\n return (self[name] = self[name].withAfter(fn));\n });\n }\n return self;\n },\n /***\n Includes a module in this object.\n\n @name include\n @methodOf Core#\n\n @param {Module} Module the module to include. A module is a constructor\n that takes two parameters, I and self, and returns an object containing the\n public methods to extend the including object with.\n */\n include: function(Module) {\n return self.extend(Module(I, self));\n }\n });\n};;\nvar DebugConsole;\nDebugConsole = function() {\n var REPL, container, input, output, repl, runButton;\n REPL = function(input, output) {\n var print;\n print = function(message) {\n return output.append($(\"<li />\", {\n text: message\n }));\n };\n return {\n run: function() {\n var code, result, source;\n source = input.val();\n try {\n code = CoffeeScript.compile(source, {\n noWrap: true\n });\n result = eval(code);\n print(\" => \" + (result));\n return input.val('');\n } catch (error) {\n return error.stack ? print(error.stack) : print(error.toString());\n }\n }\n };\n };\n container = $(\"<div />\", {\n \"class\": \"console\"\n });\n input = $(\"<textarea />\");\n output = $(\"<ul />\");\n runButton = $(\"<button />\", {\n text: \"Run\"\n });\n repl = REPL(input, output);\n container.append(output).append(input).append(runButton);\n return $(function() {\n runButton.click(function() {\n return repl.run();\n });\n return $(\"body\").append(container);\n });\n};;\nFunction.prototype.withBefore = function(interception) {\n var method;\n method = this;\n return function() {\n interception.apply(this, arguments);\n return method.apply(this, arguments);\n };\n};\nFunction.prototype.withAfter = function(interception) {\n var method;\n method = this;\n return function() {\n var result;\n result = method.apply(this, arguments);\n interception.apply(this, arguments);\n return result;\n };\n};;\n/***\n * jQuery Hotkeys Plugin\n * Copyright 2010, John Resig\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Based upon the plugin by Tzury Bar Yochay:\n * http://github.com/tzuryby/hotkeys\n *\n * Original idea by:\n * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/\n*/\n(function(jQuery) {\n var keyHandler;\n jQuery.hotkeys = {\n version: \"0.8\",\n specialKeys: {\n 8: \"backspace\",\n 9: \"tab\",\n 13: \"return\",\n 16: \"shift\",\n 17: \"ctrl\",\n 18: \"alt\",\n 19: \"pause\",\n 20: \"capslock\",\n 27: \"esc\",\n 32: \"space\",\n 33: \"pageup\",\n 34: \"pagedown\",\n 35: \"end\",\n 36: \"home\",\n 37: \"left\",\n 38: \"up\",\n 39: \"right\",\n 40: \"down\",\n 45: \"insert\",\n 46: \"del\",\n 96: \"0\",\n 97: \"1\",\n 98: \"2\",\n 99: \"3\",\n 100: \"4\",\n 101: \"5\",\n 102: \"6\",\n 103: \"7\",\n 104: \"8\",\n 105: \"9\",\n 106: \"*\",\n 107: \"+\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 112: \"f1\",\n 113: \"f2\",\n 114: \"f3\",\n 115: \"f4\",\n 116: \"f5\",\n 117: \"f6\",\n 118: \"f7\",\n 119: \"f8\",\n 120: \"f9\",\n 121: \"f10\",\n 122: \"f11\",\n 123: \"f12\",\n 144: \"numlock\",\n 145: \"scroll\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n 224: \"meta\"\n },\n shiftNums: {\n \"`\": \"~\",\n \"1\": \"!\",\n \"2\": \"@\",\n \"3\": \"#\",\n \"4\": \"$\",\n \"5\": \"%\",\n \"6\": \"^\",\n \"7\": \"&\",\n \"8\": \"*\",\n \"9\": \"(\",\n \"0\": \")\",\n \"-\": \"_\",\n \"=\": \"+\",\n \";\": \":\",\n \"'\": \"\\\"\",\n \",\": \"<\",\n \".\": \">\",\n \"/\": \"?\",\n \"\\\\\": \"|\"\n }\n };\n keyHandler = function(handleObj) {\n var keys, origHandler;\n if (typeof handleObj.data !== \"string\") {\n return null;\n }\n origHandler = handleObj.handler;\n keys = handleObj.data.toLowerCase().split(\" \");\n return (handleObj.handler = function(event) {\n var _i, _len, _ref, _result, character, key, modif, possible, special;\n if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) || event.target.type === \"text\" || event.target.type === \"password\")) {\n return null;\n }\n special = event.type !== \"keypress\" && jQuery.hotkeys.specialKeys[event.which];\n character = String.fromCharCode(event.which).toLowerCase();\n modif = \"\";\n possible = {};\n if (event.altKey && special !== \"alt\") {\n modif += \"alt+\";\n }\n if (event.ctrlKey && special !== \"ctrl\") {\n modif += \"ctrl+\";\n }\n if (event.metaKey && !event.ctrlKey && special !== \"meta\") {\n modif += \"meta+\";\n }\n if (event.shiftKey && special !== \"shift\") {\n modif += \"shift+\";\n }\n if (special) {\n possible[modif + special] = true;\n } else {\n possible[modif + character] = true;\n possible[modif + jQuery.hotkeys.shiftNums[character]] = true;\n if (modif === \"shift+\") {\n possible[jQuery.hotkeys.shiftNums[character]] = true;\n }\n }\n _result = []; _ref = keys;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n key = _ref[_i];\n if (possible[key]) {\n return origHandler.apply(this, arguments);\n }\n }\n return _result;\n });\n };\n return jQuery.each([\"keydown\", \"keyup\", \"keypress\"], function() {\n return (jQuery.event.special[this] = {\n add: keyHandler\n });\n });\n})(jQuery);;\nvar __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;\n/***\n * Merges properties from objects into target without overiding.\n * First come, first served.\n * @return target\n*/\njQuery.extend({\n reverseMerge: function(target) {\n var _i, _j, _len, _ref, _ref2, name, object, objects;\n objects = __slice.call(arguments, 1);\n _ref = objects;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n object = _ref[_i];\n _ref2 = object;\n for (name in _ref2) {\n if (!__hasProp.call(_ref2, name)) continue;\n _j = _ref2[name];\n if (!(target.hasOwnProperty(name))) {\n target[name] = object[name];\n }\n }\n }\n return target;\n }\n});;\n$(function() {\n var keyName;\n /***\n The global keydown property lets your query the status of keys.\n\n <pre>\n if keydown.left\n moveLeft()\n </pre>\n\n @name keydown\n @namespace\n */\n window.keydown = {};\n keyName = function(event) {\n return jQuery.hotkeys.specialKeys[event.which] || String.fromCharCode(event.which).toLowerCase();\n };\n $(document).bind(\"keydown\", function(event) {\n return (keydown[keyName(event)] = true);\n });\n return $(document).bind(\"keyup\", function(event) {\n return (keydown[keyName(event)] = false);\n });\n});;\n$(function() {\n return [\"log\", \"info\", \"warn\", \"error\"].each(function(name) {\n return typeof console !== \"undefined\" ? (window[name] = function(message) {\n return console[name] ? console[name](message) : null;\n }) : (window[name] = $.noop);\n });\n});;\n/***\n* Matrix.js v1.3.0pre\n*\n* Copyright (c) 2010 STRd6\n*\n* Permission is hereby granted, free of charge, to any person obtaining a copy\n* of this software and associated documentation files (the \"Software\"), to deal\n* in the Software without restriction, including without limitation the rights\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the Software is\n* furnished to do so, subject to the following conditions:\n*\n* The above copyright notice and this permission notice shall be included in\n* all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n* THE SOFTWARE.\n*\n* Loosely based on flash:\n* http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/geom/Matrix.html\n*/\n(function() {\n var Matrix, Point;\n /***\n * Create a new point with given x and y coordinates. If no arguments are given\n * defaults to (0, 0).\n * @name Point\n * @param {Number} [x]\n * @param {Number} [y]\n * @constructor\n */\n Point = function(x, y) {\n return {\n /***\n * The x coordinate of this point.\n * @name x\n * @fieldOf Point#\n */\n x: x || 0,\n /***\n * The y coordinate of this point.\n * @name y\n * @fieldOf Point#\n */\n y: y || 0,\n /***\n * Adds a point to this one and returns the new point.\n * @name add\n * @methodOf Point#\n *\n * @param {Point} other The point to add this point to.\n * @returns A new point, the sum of both.\n * @type Point\n */\n add: function(other) {\n return Point(this.x + other.x, this.y + other.y);\n },\n /***\n * Subtracts a point to this one and returns the new point.\n * @name subtract\n * @methodOf Point#\n *\n * @param {Point} other The point to subtract from this point.\n * @returns A new point, this - other.\n * @type Point\n */\n subtract: function(other) {\n return Point(this.x - other.x, this.y - other.y);\n },\n /***\n * Scale this Point (Vector) by a constant amount.\n * @name scale\n * @methodOf Point#\n *\n * @param {Number} scalar The amount to scale this point by.\n * @returns A new point, this * scalar.\n * @type Point\n */\n scale: function(scalar) {\n return Point(this.x * scalar, this.y * scalar);\n },\n /***\n * Determine whether this point is equal to another point.\n * @name equal\n * @methodOf Point#\n *\n * @param {Point} other The point to check for equality.\n * @returns true if the other point has the same x, y coordinates, false otherwise.\n * @type Boolean\n */\n equal: function(other) {\n return this.x === other.x && this.y === other.y;\n },\n /***\n * Calculate the magnitude of this Point (Vector).\n * @name magnitude\n * @methodOf Point#\n *\n * @returns The magnitude of this point as if it were a vector from (0, 0) -> (x, y).\n * @type Number\n */\n magnitude: function() {\n return Point.distance(Point(0, 0), this);\n },\n /***\n * Calculate the dot product of this point and another point (Vector).\n * @name dot\n * @methodOf Point#\n *\n * @param {Point} other The point to dot with this point.\n * @returns The dot product of this point dot other as a scalar value.\n * @type Number\n */\n dot: function(other) {\n return this.x * other.x + this.y * other.y;\n },\n /***\n * Calculate the cross product of this point and another point (Vector).\n * Usually cross products are thought of as only applying to three dimensional vectors,\n * but z can be treated as zero. The result of this method is interpreted as the magnitude\n * of the vector result of the cross product between [x1, y1, 0] x [x2, y2, 0]\n * perpendicular to the xy plane.\n * @name cross\n * @methodOf Point#\n *\n * @param {Point} other The point to cross with this point.\n * @returns The cross product of this point with the other point as scalar value.\n * @type Number\n */\n cross: function(other) {\n return this.x * other.y - other.x * this.y;\n },\n /***\n * The norm of a vector is the unit vector pointing in the same direction. This method\n * treats the point as though it is a vector from the origin to (x, y).\n * @name norm\n * @methodOf Point#\n *\n * @returns The unit vector pointing in the same direction as this vector.\n * @type Point\n */\n norm: function() {\n return this.scale(1.0 / this.length());\n },\n /***\n * Computed the length of this point as though it were a vector from (0,0) to (x,y)\n * @name length\n * @methodOf Point#\n *\n * @returns The length of the vector from the origin to this point.\n * @type Number\n */\n length: function() {\n return Math.sqrt(this.dot(this));\n },\n /***\n * Computed the Euclidean between this point and another point.\n * @name distance\n * @methodOf Point#\n *\n * @param {Point} other The point to compute the distance to.\n * @returns The distance between this point and another point.\n * @type Number\n */\n distance: function(other) {\n return Point.distance(this, other);\n }\n };\n };\n /***\n * @param {Point} p1\n * @param {Point} p2\n * @type Number\n * @returns The Euclidean distance between two points.\n */\n Point.distance = function(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n };\n /***\n * Construct a point on the unit circle for the given angle.\n *\n * @param {Number} angle The angle in radians\n * @type Point\n * @returns The point on the unit circle.\n */\n Point.fromAngle = function(angle) {\n return Point(Math.cos(angle), Math.sin(angle));\n };\n /***\n * If you have two dudes, one standing at point p1, and the other\n * standing at point p2, then this method will return the direction\n * that the dude standing at p1 will need to face to look at p2.\n * @param {Point} p1 The starting point.\n * @param {Point} p2 The ending point.\n * @returns The direction from p1 to p2 in radians.\n */\n Point.direction = function(p1, p2) {\n return Math.atan2(p2.y - p1.y, p2.x - p1.x);\n };\n /***\n * <pre>\n * _ _\n * | a c tx |\n * | b d ty |\n * |_0 0 1 _|\n * </pre>\n * Creates a matrix for 2d affine transformations.\n *\n * concat, inverse, rotate, scale and translate return new matrices with the\n * transformations applied. The matrix is not modified in place.\n *\n * Returns the identity matrix when called with no arguments.\n * @name Matrix\n * @param {Number} [a]\n * @param {Number} [b]\n * @param {Number} [c]\n * @param {Number} [d]\n * @param {Number} [tx]\n * @param {Number} [ty]\n * @constructor\n */\n Matrix = function(a, b, c, d, tx, ty) {\n a = (typeof a !== \"undefined\" && a !== null) ? a : 1;\n d = (typeof d !== \"undefined\" && d !== null) ? d : 1;\n return {\n /***\n * @name a\n * @fieldOf Matrix#\n */\n a: a,\n /***\n * @name b\n * @fieldOf Matrix#\n */\n b: b || 0,\n /***\n * @name c\n * @fieldOf Matrix#\n */\n c: c || 0,\n /***\n * @name d\n * @fieldOf Matrix#\n */\n d: d,\n /***\n * @name tx\n * @fieldOf Matrix#\n */\n tx: tx || 0,\n /***\n * @name ty\n * @fieldOf Matrix#\n */\n ty: ty || 0,\n /***\n * Returns the result of this matrix multiplied by another matrix\n * combining the geometric effects of the two. In mathematical terms,\n * concatenating two matrixes is the same as combining them using matrix multiplication.\n * If this matrix is A and the matrix passed in is B, the resulting matrix is A x B\n * http://mathworld.wolfram.com/MatrixMultiplication.html\n * @name concat\n * @methodOf Matrix#\n *\n * @param {Matrix} matrix The matrix to multiply this matrix by.\n * @returns The result of the matrix multiplication, a new matrix.\n * @type Matrix\n */\n concat: function(matrix) {\n return Matrix(this.a * matrix.a + this.c * matrix.b, this.b * matrix.a + this.d * matrix.b, this.a * matrix.c + this.c * matrix.d, this.b * matrix.c + this.d * matrix.d, this.a * matrix.tx + this.c * matrix.ty + this.tx, this.b * matrix.tx + this.d * matrix.ty + this.ty);\n },\n /***\n * Given a point in the pretransform coordinate space, returns the coordinates of\n * that point after the transformation occurs. Unlike the standard transformation\n * applied using the transformPoint() method, the deltaTransformPoint() method\n * does not consider the translation parameters tx and ty.\n * @name deltaTransformPoint\n * @methodOf Matrix#\n * @see #transformPoint\n *\n * @return A new point transformed by this matrix ignoring tx and ty.\n * @type Point\n */\n deltaTransformPoint: function(point) {\n return Point(this.a * point.x + this.c * point.y, this.b * point.x + this.d * point.y);\n },\n /***\n * Returns the inverse of the matrix.\n * http://mathworld.wolfram.com/MatrixInverse.html\n * @name inverse\n * @methodOf Matrix#\n *\n * @returns A new matrix that is the inverse of this matrix.\n * @type Matrix\n */\n inverse: function() {\n var determinant;\n determinant = this.a * this.d - this.b * this.c;\n return Matrix(this.d / determinant, -this.b / determinant, -this.c / determinant, this.a / determinant, (this.c * this.ty - this.d * this.tx) / determinant, (this.b * this.tx - this.a * this.ty) / determinant);\n },\n /***\n * Returns a new matrix that corresponds this matrix multiplied by a\n * a rotation matrix.\n * @name rotate\n * @methodOf Matrix#\n * @see Matrix.rotation\n *\n * @param {Number} theta Amount to rotate in radians.\n * @param {Point} [aboutPoint] The point about which this rotation occurs. Defaults to (0,0).\n * @returns A new matrix, rotated by the specified amount.\n * @type Matrix\n */\n rotate: function(theta, aboutPoint) {\n return this.concat(Matrix.rotation(theta, aboutPoint));\n },\n /***\n * Returns a new matrix that corresponds this matrix multiplied by a\n * a scaling matrix.\n * @name scale\n * @methodOf Matrix#\n * @see Matrix.scale\n *\n * @param {Number} sx\n * @param {Number} [sy]\n * @param {Point} [aboutPoint] The point that remains fixed during the scaling\n * @type Matrix\n */\n scale: function(sx, sy, aboutPoint) {\n return this.concat(Matrix.scale(sx, sy, aboutPoint));\n },\n /***\n * Returns the result of applying the geometric transformation represented by the\n * Matrix object to the specified point.\n * @name transformPoint\n * @methodOf Matrix#\n * @see #deltaTransformPoint\n *\n * @returns A new point with the transformation applied.\n * @type Point\n */\n transformPoint: function(point) {\n return Point(this.a * point.x + this.c * point.y + this.tx, this.b * point.x + this.d * point.y + this.ty);\n },\n /***\n * Translates the matrix along the x and y axes, as specified by the tx and ty parameters.\n * @name translate\n * @methodOf Matrix#\n * @see Matrix.translation\n *\n * @param {Number} tx The translation along the x axis.\n * @param {Number} ty The translation along the y axis.\n * @returns A new matrix with the translation applied.\n * @type Matrix\n */\n translate: function(tx, ty) {\n return this.concat(Matrix.translation(tx, ty));\n }\n };\n };\n /***\n * Creates a matrix transformation that corresponds to the given rotation,\n * around (0,0) or the specified point.\n * @see Matrix#rotate\n *\n * @param {Number} theta Rotation in radians.\n * @param {Point} [aboutPoint] The point about which this rotation occurs. Defaults to (0,0).\n * @returns\n * @type Matrix\n */\n Matrix.rotation = function(theta, aboutPoint) {\n var rotationMatrix;\n rotationMatrix = Matrix(Math.cos(theta), Math.sin(theta), -Math.sin(theta), Math.cos(theta));\n if (typeof aboutPoint !== \"undefined\" && aboutPoint !== null) {\n rotationMatrix = Matrix.translation(aboutPoint.x, aboutPoint.y).concat(rotationMatrix).concat(Matrix.translation(-aboutPoint.x, -aboutPoint.y));\n }\n return rotationMatrix;\n };\n /***\n * Returns a matrix that corresponds to scaling by factors of sx, sy along\n * the x and y axis respectively.\n * If only one parameter is given the matrix is scaled uniformly along both axis.\n * If the optional aboutPoint parameter is given the scaling takes place\n * about the given point.\n * @see Matrix#scale\n *\n * @param {Number} sx The amount to scale by along the x axis or uniformly if no sy is given.\n * @param {Number} [sy] The amount to scale by along the y axis.\n * @param {Point} [aboutPoint] The point about which the scaling occurs. Defaults to (0,0).\n * @returns A matrix transformation representing scaling by sx and sy.\n * @type Matrix\n */\n Matrix.scale = function(sx, sy, aboutPoint) {\n var scaleMatrix;\n sy = sy || sx;\n scaleMatrix = Matrix(sx, 0, 0, sy);\n if (aboutPoint) {\n scaleMatrix = Matrix.translation(aboutPoint.x, aboutPoint.y).concat(scaleMatrix).concat(Matrix.translation(-aboutPoint.x, -aboutPoint.y));\n }\n return scaleMatrix;\n };\n /***\n * Returns a matrix that corresponds to a translation of tx, ty.\n * @see Matrix#translate\n *\n * @param {Number} tx The amount to translate in the x direction.\n * @param {Number} ty The amount to translate in the y direction.\n * @return A matrix transformation representing a translation by tx and ty.\n * @type Matrix\n */\n Matrix.translation = function(tx, ty) {\n return Matrix(1, 0, 0, 1, tx, ty);\n };\n /***\n * A constant representing the identity matrix.\n * @name IDENTITY\n * @fieldOf Matrix\n */\n Matrix.IDENTITY = Matrix();\n /***\n * A constant representing the horizontal flip transformation matrix.\n * @name HORIZONTAL_FLIP\n * @fieldOf Matrix\n */\n Matrix.HORIZONTAL_FLIP = Matrix(-1, 0, 0, 1);\n /***\n * A constant representing the vertical flip transformation matrix.\n * @name VERTICAL_FLIP\n * @fieldOf Matrix\n */\n Matrix.VERTICAL_FLIP = Matrix(1, 0, 0, -1);\n window[\"Point\"] = Point;\n return (window[\"Matrix\"] = Matrix);\n})();;\nwindow.Mouse = (function() {\n var Mouse, buttons, set_button;\n Mouse = {\n left: false,\n right: false,\n middle: false,\n location: Point(0, 0)\n };\n buttons = [null, \"left\", \"middle\", \"right\"];\n set_button = function(index, state) {\n var button_name;\n button_name = buttons[index];\n return button_name ? (Mouse[button_name] = state) : null;\n };\n $(document).mousedown(function(event) {\n return set_button(event.which, true);\n });\n $(document).mouseup(function(event) {\n return set_button(event.which, false);\n });\n $(document).mousemove(function(event) {\n var x, y;\n x = event.pageX;\n y = event.pageY;\n Mouse.location = Point(x, y);\n Mouse.x = x;\n return (Mouse.y = y);\n });\n return Mouse;\n})();;\n/***\nReturns the absolute value of this number.\n\n@name abs\n@methodOf Number#\n\n@type Number\n@returns The absolute value of the number.\n*/\nNumber.prototype.abs = function() {\n return Math.abs(this);\n};\n/***\nReturns the mathematical ceiling of this number.\n\n@name ceil\n@methodOf Number#\n\n@type Number\n@returns The number truncated to the nearest integer of greater than or equal value.\n\n(4.9).ceil() # => 5\n(4.2).ceil() # => 5\n(-1.2).ceil() # => -1\n*/\nNumber.prototype.ceil = function() {\n return Math.ceil(this);\n};\n/***\nReturns the mathematical floor of this number.\n\n@name floor\n@methodOf Number#\n\n@type Number\n@returns The number truncated to the nearest integer of less than or equal value.\n\n(4.9).floor() # => 4\n(4.2).floor() # => 4\n(-1.2).floor() # => -2\n*/\nNumber.prototype.floor = function() {\n return Math.floor(this);\n};\n/***\nReturns this number rounded to the nearest integer.\n\n@name round\n@methodOf Number#\n\n@type Number\n@returns The number rounded to the nearest integer.\n\n(4.5).round() # => 5\n(4.4).round() # => 4\n*/\nNumber.prototype.round = function() {\n return Math.round(this);\n};\n/***\nReturns a number whose value is limited to the given range.\n\nExample: limit the output of this computation to between 0 and 255\n<pre>\n(x * 255).clamp(0, 255)\n</pre>\n\n@name clamp\n@methodOf Number#\n\n@param {Number} min The lower boundary of the output range\n@param {Number} max The upper boundary of the output range\n\n@returns A number in the range [min, max]\n@type Number\n*/\nNumber.prototype.clamp = function(min, max) {\n return Math.min(Math.max(this, min), max);\n};\n/***\nA mod method useful for array wrapping. The range of the function is\nconstrained to remain in bounds of array indices.\n\n<pre>\nExample:\n(-1).mod(5) == 4\n</pre>\n\n@name mod\n@methodOf Number#\n\n@param {Number} base\n@returns An integer between 0 and (base - 1) if base is positive.\n@type Number\n*/\nNumber.prototype.mod = function(base) {\n var result;\n result = this % base;\n if (result < 0 && base > 0) {\n result += base;\n }\n return result;\n};\n/***\nGet the sign of this number as an integer (1, -1, or 0).\n\n@name sign\n@methodOf Number#\n\n@type Number\n@returns The sign of this number, 0 if the number is 0.\n*/\nNumber.prototype.sign = function() {\n if (this > 0) {\n return 1;\n } else if (this < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n/***\nCalls iterator the specified number of times, passing in the number of the\ncurrent iteration as a parameter: 0 on first call, 1 on the second call, etc.\n\n@name times\n@methodOf Number#\n\n@param {Function} iterator The iterator takes a single parameter, the number\nof the current iteration.\n@param {Object} [context] The optional context parameter specifies an object\nto treat as <code>this</code> in the iterator block.\n\n@returns The number of times the iterator was called.\n@type Number\n*/\nNumber.prototype.times = function(iterator, context) {\n var i;\n i = -1;\n while (++i < this) {\n iterator.call(context, i);\n }\n return i;\n};\n/***\nReturns the the nearest grid resolution less than or equal to the number.\n\n EX:\n (7).snap(8) => 0\n (4).snap(8) => 0\n (12).snap(8) => 8\n\n@name snap\n@methodOf Number#\n\n@param {Number} resolution The grid resolution to snap to.\n@returns The nearest multiple of resolution lower than the number.\n@type Number\n*/\nNumber.prototype.snap = function(resolution) {\n var n;\n n = this / resolution;\n 1 / 1;\n return n.floor() * resolution;\n};\nNumber.prototype.toColorPart = function() {\n var s;\n s = parseInt(this.clamp(0, 255), 10).toString(16);\n if (s.length === 1) {\n s = '0' + s;\n }\n return s;\n};\nNumber.prototype.approach = function(target, maxDelta) {\n return (target - this).clamp(-maxDelta, maxDelta) + this;\n};\nNumber.prototype.approachByRatio = function(target, ratio) {\n return this.approach(target, this * ratio);\n};\nNumber.prototype.approachRotation = function(target, maxDelta) {\n while (target > this + Math.PI) {\n target -= Math.TAU;\n }\n while (target < this - Math.PI) {\n target += Math.TAU;\n }\n return (target - this).clamp(-maxDelta, maxDelta) + this;\n};\n/***\nConstrains a rotation to between -PI and PI.\n\n@name constrainRotation\n@methodOf Number#\n\n@returns This number constrained between -PI and PI.\n@type Number\n*/\nNumber.prototype.constrainRotation = function() {\n var target;\n target = this;\n while (target > Math.PI) {\n target -= Math.TAU;\n }\n while (target < -Math.PI) {\n target += MATH.TAU;\n }\n return target;\n};\nNumber.prototype.d = function(sides) {\n var sum;\n sum = 0;\n this.times(function() {\n return sum += rand(sides) + 1;\n });\n return sum;\n};\n/***\nThe mathematical circle constant of 1 turn.\n\n@name TAU\n@fieldOf Math\n*/\nMath.TAU = 2 * Math.PI;;\n/***\n* Checks whether an object is an array.\n*\n* @type Object\n* @returns A boolean expressing whether the object is an instance of Array\n*/\nObject.isArray = function(object) {\n return Object.prototype.toString.call(object) === '[object Array]';\n};;\nvar __hasProp = Object.prototype.hasOwnProperty, __slice = Array.prototype.slice;\n(function($) {\n return ($.fn.powerCanvas = function(options) {\n var $canvas, canvas, context;\n options || (options = {});\n canvas = this.get(0);\n context = undefined;\n /***\n * PowerCanvas provides a convenient wrapper for working with Context2d.\n * @name PowerCanvas\n * @constructor\n */\n $canvas = $(canvas).extend({\n /***\n * Passes this canvas to the block with the given matrix transformation\n * applied. All drawing methods called within the block will draw\n * into the canvas with the transformation applied. The transformation\n * is removed at the end of the block, even if the block throws an error.\n *\n * @name withTransform\n * @methodOf PowerCanvas#\n *\n * @param {Matrix} matrix\n * @param {Function} block\n * @returns this\n */\n withTransform: function(matrix, block) {\n context.save();\n context.transform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n try {\n block(this);\n } finally {\n context.restore();\n }\n return this;\n },\n clear: function() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n return this;\n },\n clearRect: function(x, y, width, height) {\n context.clearRect(x, y, width, height);\n return this;\n },\n context: function() {\n return context;\n },\n element: function() {\n return canvas;\n },\n globalAlpha: function(newVal) {\n if (typeof newVal !== \"undefined\" && newVal !== null) {\n context.globalAlpha = newVal;\n return this;\n } else {\n return context.globalAlpha;\n }\n },\n compositeOperation: function(newVal) {\n if (typeof newVal !== \"undefined\" && newVal !== null) {\n context.globalCompositeOperation = newVal;\n return this;\n } else {\n return context.globalCompositeOperation;\n }\n },\n createLinearGradient: function(x0, y0, x1, y1) {\n return context.createLinearGradient(x0, y0, x1, y1);\n },\n createRadialGradient: function(x0, y0, r0, x1, y1, r1) {\n return context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n },\n buildRadialGradient: function(c1, c2, stops) {\n var _ref, color, gradient, position;\n gradient = context.createRadialGradient(c1.x, c1.y, c1.radius, c2.x, c2.y, c2.radius);\n _ref = stops;\n for (position in _ref) {\n if (!__hasProp.call(_ref, position)) continue;\n color = _ref[position];\n gradient.addColorStop(position, color);\n }\n return gradient;\n },\n createPattern: function(image, repitition) {\n return context.createPattern(image, repitition);\n },\n drawImage: function(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {\n context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\n return this;\n },\n drawLine: function(x1, y1, x2, y2, width) {\n if (arguments.length === 3) {\n width = x2;\n x2 = y1.x;\n y2 = y1.y;\n y1 = x1.y;\n x1 = x1.x;\n }\n width || (width = 3);\n context.lineWidth = width;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n context.closePath();\n context.stroke();\n return this;\n },\n fill: function(color) {\n $canvas.fillColor(color);\n context.fillRect(0, 0, canvas.width, canvas.height);\n return this;\n },\n /***\n * Fills a circle at the specified position with the specified\n * radius and color.\n *\n * @name fillCircle\n * @methodOf PowerCanvas#\n *\n * @param {Number} x\n * @param {Number} y\n * @param {Number} radius\n * @param {Number} color\n * @see PowerCanvas#fillColor\n * @returns this\n */\n fillCircle: function(x, y, radius, color) {\n $canvas.fillColor(color);\n context.beginPath();\n context.arc(x, y, radius, 0, Math.TAU, true);\n context.closePath();\n context.fill();\n return this;\n },\n /***\n * Fills a rectangle with the current fillColor\n * at the specified position with the specified\n * width and height\n\n * @name fillRect\n * @methodOf PowerCanvas#\n *\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n * @see PowerCanvas#fillColor\n * @returns this\n */\n fillRect: function(x, y, width, height) {\n context.fillRect(x, y, width, height);\n return this;\n },\n fillShape: function() {\n var points;\n points = __slice.call(arguments, 0);\n context.beginPath();\n points.each(function(point, i) {\n return i === 0 ? context.moveTo(point.x, point.y) : context.lineTo(point.x, point.y);\n });\n context.lineTo(points[0].x, points[0].y);\n return context.fill();\n },\n /***\n * Adapted from http://js-bits.blogspot.com/2010/07/canvas-rounded-corner-rectangles.html\n */\n fillRoundRect: function(x, y, width, height, radius, strokeWidth) {\n radius || (radius = 5);\n context.beginPath();\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n context.closePath();\n if (strokeWidth) {\n context.lineWidth = strokeWidth;\n context.stroke();\n }\n context.fill();\n return this;\n },\n fillText: function(text, x, y) {\n context.fillText(text, x, y);\n return this;\n },\n centerText: function(text, y) {\n var textWidth;\n textWidth = $canvas.measureText(text);\n return $canvas.fillText(text, (canvas.width - textWidth) / 2, y);\n },\n fillWrappedText: function(text, x, y, width) {\n var lineHeight, tokens, tokens2;\n tokens = text.split(\" \");\n tokens2 = text.split(\" \");\n lineHeight = 16;\n if ($canvas.measureText(text) > width) {\n if (tokens.length % 2 === 0) {\n tokens2 = tokens.splice(tokens.length / 2, tokens.length / 2, \"\");\n } else {\n tokens2 = tokens.splice(tokens.length / 2 + 1, (tokens.length / 2) + 1, \"\");\n }\n context.fillText(tokens.join(\" \"), x, y);\n return context.fillText(tokens2.join(\" \"), x, y + lineHeight);\n } else {\n return context.fillText(tokens.join(\" \"), x, y + lineHeight);\n }\n },\n fillColor: function(color) {\n if (color) {\n if (color.channels) {\n context.fillStyle = color.toString();\n } else {\n context.fillStyle = color;\n }\n return this;\n } else {\n return context.fillStyle;\n }\n },\n font: function(font) {\n if (typeof font !== \"undefined\" && font !== null) {\n context.font = font;\n return this;\n } else {\n return context.font;\n }\n },\n measureText: function(text) {\n return context.measureText(text).width;\n },\n putImageData: function(imageData, x, y) {\n context.putImageData(imageData, x, y);\n return this;\n },\n strokeColor: function(color) {\n if (color) {\n if (color.channels) {\n context.strokeStyle = color.toString();\n } else {\n context.strokeStyle = color;\n }\n return this;\n } else {\n return context.strokeStyle;\n }\n },\n strokeRect: function(x, y, width, height) {\n context.strokeRect(x, y, width, height);\n return this;\n },\n textAlign: function(textAlign) {\n context.textAlign = textAlign;\n return this;\n },\n height: function() {\n return canvas.height;\n },\n width: function() {\n return canvas.width;\n }\n });\n if ((typeof canvas === \"undefined\" || canvas === null) ? undefined : canvas.getContext) {\n context = canvas.getContext('2d');\n if (options.init) {\n options.init($canvas);\n }\n return $canvas;\n }\n });\n})(jQuery);;\n(function(window) {\n var Node, QuadTree;\n QuadTree = function(I) {\n var root, self;\n I || (I = {});\n $.reverseMerge(I, {\n bounds: {\n x: 0,\n y: 0,\n width: 480,\n height: 320\n },\n maxChildren: 5,\n maxDepth: 4\n });\n root = Node({\n bounds: I.bounds,\n maxDepth: I.maxDepth,\n maxChildren: I.maxChildren\n });\n self = {\n I: I,\n root: function() {\n return root;\n },\n clear: function() {\n return root.clear();\n },\n insert: function(obj) {\n return Object.isArray(obj) ? obj.each(function(item) {\n return root.insert(item);\n }) : root.insert(obj);\n },\n retrieve: function(item) {\n return root.retrieve(item).copy();\n }\n };\n return self;\n };\n Node = function(I) {\n var BOTTOM_LEFT, BOTTOM_RIGHT, TOP_LEFT, TOP_RIGHT, findQuadrant, halfHeight, halfWidth, self, subdivide;\n I || (I = {});\n $.reverseMerge(I, {\n bounds: {\n x: 0,\n y: 0,\n width: 120,\n height: 80\n },\n children: [],\n depth: 0,\n maxChildren: 5,\n maxDepth: 4,\n nodes: []\n });\n TOP_LEFT = 0;\n TOP_RIGHT = 1;\n BOTTOM_LEFT = 2;\n BOTTOM_RIGHT = 3;\n findQuadrant = function(item) {\n var bounds, index, left, top, x, x_midpoint, y, y_midpoint;\n bounds = I.bounds;\n x = bounds.x;\n y = bounds.y;\n x_midpoint = x + halfWidth();\n y_midpoint = y + halfHeight();\n left = item.x <= x_midpoint;\n top = item.y <= y_midpoint;\n index = TOP_LEFT;\n if (left) {\n if (!top) {\n index = BOTTOM_LEFT;\n }\n } else {\n if (top) {\n index = TOP_RIGHT;\n } else {\n index = BOTTOM_RIGHT;\n }\n }\n return index;\n };\n halfWidth = function() {\n return (I.bounds.width / 2).floor();\n };\n halfHeight = function() {\n return (I.bounds.height / 2).floor();\n };\n subdivide = function() {\n var half_height, half_width, increased_depth;\n increased_depth = I.depth + 1;\n half_width = halfWidth();\n half_height = halfHeight();\n return (4).times(function(n) {\n return (I.nodes[n] = Node({\n bounds: {\n x: half_width * (n % 2),\n y: half_height * (n < 2 ? 0 : 1),\n width: half_width,\n height: half_height\n },\n depth: increased_depth,\n maxChildren: I.maxChildren,\n maxDepth: I.maxDepth\n }));\n });\n };\n self = {\n I: I,\n clear: function() {\n I.children.clear();\n I.nodes.invoke('clear');\n return I.nodes.clear();\n },\n insert: function(item) {\n var index;\n if (I.nodes.length) {\n index = findQuadrant(item);\n I.nodes[index].insert(item);\n return true;\n }\n I.children.push(item);\n if ((I.depth < I.maxDepth) && (I.children.length > I.maxChildren)) {\n subdivide();\n I.children.each(function(child) {\n return self.insert(child);\n });\n return I.children.clear();\n }\n },\n retrieve: function(item) {\n var index;\n index = findQuadrant(item);\n return (I.nodes[index] == null ? undefined : I.nodes[index].retrieve(item)) || I.children;\n }\n };\n return self;\n };\n return (window.QuadTree = QuadTree);\n})(window);;\n(function($) {\n window.Random = $.extend(window.Random, {\n angle: function() {\n return rand() * Math.TAU;\n },\n color: function() {\n return Color.random();\n },\n often: function() {\n return rand(3);\n },\n sometimes: function() {\n return !rand(3);\n }\n });\n /***\n Returns random integers from [0, n) if n is given.\n Otherwise returns random float between 0 and 1.\n\n @param {Number} n\n */\n return (window.rand = function(n) {\n return n ? Math.floor(n * Math.random()) : Math.random();\n });\n})(jQuery);;\n(function($) {\n var retrieve, store;\n /***\n @name Local\n @namespace\n */\n /***\n Store an object in local storage.\n\n @name set\n @methodOf Local\n\n @param {String} key\n @param {Object} value\n @type Object\n @returns value\n */\n store = function(key, value) {\n localStorage[key] = JSON.stringify(value);\n return value;\n };\n /***\n Retrieve an object from local storage.\n\n @name get\n @methodOf Local\n\n @param {String} key\n @type Object\n @returns The object that was stored or undefined if no object was stored.\n */\n retrieve = function(key) {\n var value;\n value = localStorage[key];\n return (typeof value !== \"undefined\" && value !== null) ? JSON.parse(value) : null;\n };\n return (window.Local = $.extend(window.Local, {\n get: retrieve,\n set: store,\n put: store,\n /***\n Access an instance of Local with a specified prefix.\n\n @name new\n @methodOf Local\n\n @param {String} prefix\n @type Local\n @returns An interface to local storage with the given prefix applied.\n */\n \"new\": function(prefix) {\n prefix || (prefix = \"\");\n return {\n get: function(key) {\n return retrieve(\"\" + (prefix) + \"_key\");\n },\n set: function(key, value) {\n return store(\"\" + (prefix) + \"_key\", value);\n },\n put: function(key, value) {\n return store(\"\" + (prefix) + \"_key\", value);\n }\n };\n }\n }));\n})(jQuery);;\n/***\nReturn the class or constant named in this string.\n\n@name constantize\n@methodOf String#\n\n@returns The class or constant named in this string.\n@type Object\n*/\nString.prototype.constantize = function() {\n if (this.match(/[A-Z][A-Za-z0-9]*/)) {\n eval(\"var that = \" + (this));\n return that;\n } else {\n return undefined;\n }\n};\n/***\nParse this string as though it is JSON and return the object it represents. If it\nis not valid JSON returns the string itself.\n\n@name parse\n@methodOf String#\n\n@returns Returns an object from the JSON this string contains. If it\nis not valid JSON returns the string itself.\n@type Object\n*/\nString.prototype.parse = function() {\n try {\n return JSON.parse(this);\n } catch (e) {\n return this;\n }\n};\n/***\nReturns true if this string only contains whitespace characters.\n\n@name blank\n@methodOf String#\n\n@returns Whether or not this string is blank.\n@type Boolean\n*/\nString.prototype.blank = function() {\n return /^\\s*$/.test(this);\n};;\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Boolean#\n*/\n/***\nReturns a string representing the specified Boolean object.\n\n<code><em>bool</em>.toString()</code>\n\n@name toString\n@methodOf Boolean#\n*/\n/***\nReturns the primitive value of a Boolean object.\n\n<code><em>bool</em>.valueOf()</code>\n\n@name valueOf\n@methodOf Boolean#\n*/\n/***\nReturns a string representing the Number object in exponential notation\n\n<code><i>number</i>.toExponential( [<em>fractionDigits</em>] )</code>\n@param fractionDigits\nAn integer specifying the number of digits after the decimal point. Defaults\nto as many digits as necessary to specify the number.\n@name toExponential\n@methodOf Number#\n*/\n/***\nFormats a number using fixed-point notation\n\n<code><i>number</i>.toFixed( [<em>digits</em>] )</code>\n@param digits The number of digits to appear after the decimal point; this\nmay be a value between 0 and 20, inclusive, and implementations may optionally\nsupport a larger range of values. If this argument is omitted, it is treated as\n0.\n@name toFixed\n@methodOf Number#\n*/\n/***\nnumber.toLocaleString();\n\n\n\n@name toLocaleString\n@methodOf Number#\n*/\n/***\nReturns a string representing the Number object to the specified precision.\n\n<code><em>number</em>.toPrecision( [ <em>precision</em> ] )</code>\n@param precision An integer specifying the number of significant digits.\n@name toPrecision\n@methodOf Number#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Number#\n*/\n/***\nReturns a string representing the specified Number object\n\n<code><i>number</i>.toString( [<em>radix</em>] )</code>\n@param radix\nAn integer between 2 and 36 specifying the base to use for representing\nnumeric values.\n@name toString\n@methodOf Number#\n*/\n/***\nReturns the primitive value of a Number object.\n\n\n\n@name valueOf\n@methodOf Number#\n*/\n/***\nReturns the specified character from a string.\n\n<code><em>string</em>.charAt(<em>index</em>)</code>\n@param index\u00a0 An integer between 0 and 1 less than the length of the string.\n@name charAt\n@methodOf String#\n*/\n/***\nReturns the numeric Unicode value of the character at the given index (except\nfor unicode codepoints > 0x10000).\n\n\n@param index\u00a0 An integer greater than 0 and less than the length of the string;\nif it is not a number, it defaults to 0.\n@name charCodeAt\n@methodOf String#\n*/\n/***\nCombines the text of two or more strings and returns a new string.\n\n<code><em>string</em>.concat(<em>string2</em>, <em>string3</em>[, ..., <em>stringN</em>])</code>\n@param string2...stringN\u00a0 Strings to concatenate to this string.\n@name concat\n@methodOf String#\n*/\n/***\nReturns the index within the calling String object of the first occurrence of\nthe specified value, starting the search at fromIndex,\nreturns -1 if the value is not found.\n\n<code><em>string</em>.indexOf(<em>searchValue</em>[, <em>fromIndex</em>]</code>\n@param searchValue\u00a0 A string representing the value to search for.\n@param fromIndex\u00a0 The location within the calling string to start the search\nfrom. It can be any integer between 0 and the length of the string. The default\nvalue is 0.\n@name indexOf\n@methodOf String#\n*/\n/***\nReturns the index within the calling String object of the last occurrence of the\nspecified value, or -1 if not found. The calling string is searched backward,\nstarting at fromIndex.\n\n<code><em>string</em>.lastIndexOf(<em>searchValue</em>[, <em>fromIndex</em>])</code>\n@param searchValue\u00a0 A string representing the value to search for.\n@param fromIndex\u00a0 The location within the calling string to start the search\nfrom, indexed from left to right. It can be any integer between 0 and the length\nof the string. The default value is the length of the string.\n@name lastIndexOf\n@methodOf String#\n*/\n/***\nReturns a number indicating whether a reference string comes before or after or\nis the same as the given string in sort order.\n\n<code> localeCompare(compareString) </code>\n\n@name localeCompare\n@methodOf String#\n*/\n/***\nUsed to retrieve the matches when matching a string against a regular\nexpression.\n\n<code><em>string</em>.match(<em>regexp</em>)</code>\n@param regexp A regular expression object. If a non-RegExp object obj is passed,\nit is implicitly converted to a RegExp by using new RegExp(obj).\n@name match\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name quote\n@methodOf String#\n*/\n/***\nReturns a new string with some or all matches of a pattern replaced by a\nreplacement.\u00a0 The pattern can be a string or a RegExp, and the replacement can\nbe a string or a function to be called for each match.\n\n<code><em>str</em>.replace(<em>regexp|substr</em>, <em>newSubStr|function[</em>, </code><code><em>flags]</em>);</code>\n@param regexp\u00a0 A RegExp object. The match is replaced by the return value of\nparameter #2.\n@param substr\u00a0 A String that is to be replaced by newSubStr.\n@param newSubStr\u00a0 The String that replaces the substring received from parameter\n#1. A number of special replacement patterns are supported; see the \"Specifying\na string as a parameter\" section below.\n@param function\u00a0 A function to be invoked to create the new substring (to put in\nplace of the substring received from parameter #1). The arguments supplied to\nthis function are described in the \"Specifying a function as a parameter\"\nsection below.\n@param flags\u00a0gimy\n\nNon-standardThe use of the flags parameter in the String.replace method is\nnon-standard. For cross-browser compatibility, use a RegExp object with\ncorresponding flags.A string containing any combination of the RegExp flags: g\nglobal match i ignore case m match over multiple lines y Non-standard\nsticky global matchignore casematch over multiple linesNon-standard sticky\n@name replace\n@methodOf String#\n*/\n/***\nExecutes the search for a match between a regular expression and this String\nobject.\n\n<code><em>string</em>.search(<em>regexp</em>)</code>\n@param regexp\u00a0 A regular expression object. If a non-RegExp object obj is\npassed, it is implicitly converted to a RegExp by using new RegExp(obj).\n@name search\n@methodOf String#\n*/\n/***\nExtracts a section of a string and returns a new string.\n\n<code><em>string</em>.slice(<em>beginslice</em>[, <em>endSlice</em>])</code>\n@param beginSlice\u00a0 The zero-based index at which to begin extraction.\n@param endSlice\u00a0 The zero-based index at which to end extraction. If omitted,\nslice extracts to the end of the string.\n@name slice\n@methodOf String#\n*/\n/***\nSplits a String object into an array of strings by separating the string into\nsubstrings.\n\n<code><em>string</em>.split([<em>separator</em>][, <em>limit</em>])</code>\n@param separator\u00a0 Specifies the character to use for separating the string. The\nseparator is treated as a string or a regular expression. If separator is\nomitted, the array returned contains one element consisting of the entire\nstring.\n@param limit\u00a0 Integer specifying a limit on the number of splits to be found.\n@name split\n@methodOf String#\n*/\n/***\nReturns the characters in a string beginning at the specified location through\nthe specified number of characters.\n\n<code><em>string</em>.substr(<em>start</em>[, <em>length</em>])</code>\n@param start\u00a0 Location at which to begin extracting characters.\n@param length\u00a0 The number of characters to extract.\n@name substr\n@methodOf String#\n*/\n/***\nReturns a subset of a string between one index and another, or through the end\nof the string.\n\n<code><em>string</em>.substring(<em>indexA</em>[, <em>indexB</em>])</code>\n@param indexA\u00a0 An integer between 0 and one less than the length of the string.\n@param indexB\u00a0 (optional) An integer between 0 and the length of the string.\n@name substring\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to lower case, according to any\nlocale-specific case mappings.\n\n<code> toLocaleLowerCase() </code>\n\n@name toLocaleLowerCase\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to upper case, according to any\nlocale-specific case mappings.\n\n<code> toLocaleUpperCase() </code>\n\n@name toLocaleUpperCase\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to lowercase.\n\n<code><em>string</em>.toLowerCase()</code>\n\n@name toLowerCase\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf String#\n*/\n/***\nReturns a string representing the specified object.\n\n<code><em>string</em>.toString()</code>\n\n@name toString\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to uppercase.\n\n<code><em>string</em>.toUpperCase()</code>\n\n@name toUpperCase\n@methodOf String#\n*/\n/***\nRemoves whitespace from both ends of the string.\n\n<code><em>string</em>.trim()</code>\n\n@name trim\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name trimLeft\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name trimRight\n@methodOf String#\n*/\n/***\nReturns the primitive value of a String object.\n\n<code><em>string</em>.valueOf()</code>\n\n@name valueOf\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name anchor\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name big\n@methodOf String#\n*/\n/***\nNon-standard\n\n<code>BLINK</code>\n\n@name blink\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name bold\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name fixed\n@methodOf String#\n*/\n/***\nNon-standard\n\n<code><FONT COLOR=\"<i>color</i>\"></code>\n\n@name fontcolor\n@methodOf String#\n*/\n/***\nNon-standard\n\n<code><FONT SIZE=\"<i>size</i>\"></code>\n\n@name fontsize\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name italics\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name link\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name small\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name strike\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name sub\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name sup\n@methodOf String#\n*/\n/***\nRemoves the last element from an array and returns that element.\n\n<code>\n<i>array</i>.pop()\n</code>\n\n@name pop\n@methodOf Array#\n*/\n/***\nMutates an array by appending the given elements and returning the new length of\nthe array.\n\n<code><em>array</em>.push(<em>element1</em>, ..., <em>elementN</em>)</code>\n@param element1, ..., elementN The elements to add to the end of the array.\n@name push\n@methodOf Array#\n*/\n/***\nReverses an array in place.\u00a0 The first array element becomes the last and the\nlast becomes the first.\n\n<code><em>array</em>.reverse()</code>\n\n@name reverse\n@methodOf Array#\n*/\n/***\nRemoves the first element from an array and returns that element. This method\nchanges the length of the array.\n\n<code><em>array</em>.shift()</code>\n\n@name shift\n@methodOf Array#\n*/\n/***\nSorts the elements of an array in place.\n\n<code><em>array</em>.sort([<em>compareFunction</em>])</code>\n@param compareFunction\u00a0 Specifies a function that defines the sort order. If\nomitted, the array is sorted lexicographically (in dictionary order) according\nto the string conversion of each element.\n@name sort\n@methodOf Array#\n*/\n/***\nChanges the content of an array, adding new elements while removing old\nelements.\n\n<code><em>array</em>.splice(<em>index</em>, <em>howMany</em>[, <em>element1</em>[, ...[, <em>elementN</em>]]])</code>\n@param index\u00a0 Index at which to start changing the array. If negative, will\nbegin that many elements from the end.\n@param howMany\u00a0 An integer indicating the number of old array elements to\nremove. If howMany is 0, no elements are removed. In this case, you should\nspecify at least one new element. If no howMany parameter is specified (second\nsyntax above, which is a SpiderMonkey extension), all elements after index are\nremoved.\n@param element1, ..., elementN\u00a0 The elements to add to the array. If you don't\nspecify any elements, splice simply removes elements from the array.\n@name splice\n@methodOf Array#\n*/\n/***\nAdds one or more elements to the beginning of an array and returns the new\nlength of the array.\n\n<code><em>arrayName</em>.unshift(<em>element1</em>, ..., <em>elementN</em>) </code>\n@param element1, ..., elementN The elements to add to the front of the array.\n@name unshift\n@methodOf Array#\n*/\n/***\nReturns a new array comprised of this array joined with other array(s) and/or\nvalue(s).\n\n<code><em>array</em>.concat(<em>value1</em>, <em>value2</em>, ..., <em>valueN</em>)</code>\n@param valueN\u00a0 Arrays and/or values to concatenate to the resulting array.\n@name concat\n@methodOf Array#\n*/\n/***\nJoins all elements of an array into a string.\n\n<code><em>array</em>.join(<em>separator</em>)</code>\n@param separator\u00a0 Specifies a string to separate each element of the array. The\nseparator is converted to a string if necessary. If omitted, the array elements\nare separated with a comma.\n@name join\n@methodOf Array#\n*/\n/***\nReturns a one-level deep copy of a portion of an array.\n\n<code><em>array</em>.slice(<em>begin</em>[, <em>end</em>])</code>\n@param begin\u00a0 Zero-based index at which to begin extraction.As a negative index,\nstart indicates an offset from the end of the sequence. slice(-2) extracts the\nsecond-to-last element and the last element in the sequence.\n@param end\u00a0 Zero-based index at which to end extraction. slice extracts up to\nbut not including end.slice(1,4) extracts the second element through the fourth\nelement (elements indexed 1, 2, and 3).As a negative index, end indicates an\noffset from the end of the sequence. slice(2,-1) extracts the third element\nthrough the second-to-last element in the sequence.If end is omitted, slice\nextracts to the end of the sequence.\n@name slice\n@methodOf Array#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Array#\n*/\n/***\nReturns a string representing the specified array and its elements.\n\n<code><em>array</em>.toString()</code>\n\n@name toString\n@methodOf Array#\n*/\n/***\nReturns the first index at which a given element can be found in the array, or\n-1 if it is not present.\n\n<code><em>array</em>.indexOf(<em>searchElement</em>[, <em>fromIndex</em>])</code>\n@param searchElement\u00a0fromIndex\u00a0 Element to locate in the array.The index at\nwhich to begin the search. Defaults to 0, i.e. the whole array will be searched.\nIf the index is greater than or equal to the length of the array, -1 is\nreturned, i.e. the array will not be searched. If negative, it is taken as the\noffset from the end of the array. Note that even when the index is negative, the\narray is still searched from front to back. If the calculated index is less than\n0, the whole array will be searched.\n@name indexOf\n@methodOf Array#\n*/\n/***\nReturns the last index at which a given element can be found in the array, or -1\nif it is not present. The array is searched backwards, starting at fromIndex.\n\n<code><em>array</em>.lastIndexOf(<em>searchElement</em>[, <em>fromIndex</em>])</code>\n@param searchElement\u00a0fromIndex\u00a0 Element to locate in the array.The index at\nwhich to start searching backwards. Defaults to the array's length, i.e. the\nwhole array will be searched. If the index is greater than or equal to the\nlength of the array, the whole array will be searched. If negative, it is taken\nas the offset from the end of the array. Note that even when the index is\nnegative, the array is still searched from back to front. If the calculated\nindex is less than 0, -1 is returned, i.e. the array will not be searched.\n@name lastIndexOf\n@methodOf Array#\n*/\n/***\nCreates a new array with all elements that pass the test implemented by the\nprovided function.\n\n<code><em>array</em>.filter(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callback\u00a0thisObject\u00a0 Function to test each element of the array.Object to\nuse as this when executing callback.\n@name filter\n@methodOf Array#\n*/\n/***\nExecutes a provided function once per array element.\n\n<code><em>array</em>.forEach(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callback\u00a0thisObject\u00a0 Function to execute for each element.Object to use\nas this when executing callback.\n@name forEach\n@methodOf Array#\n*/\n/***\nTests whether all elements in the array pass the test implemented by the\nprovided function.\n\n<code><em>array</em>.every(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callbackthisObject Function to test for each element.Object to use as\nthis when executing callback.\n@name every\n@methodOf Array#\n*/\n/***\nCreates a new array with the results of calling a provided function on every\nelement in this array.\n\n<code><em>array</em>.map(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callbackthisObject Function that produces an element of the new Array\nfrom an element of the current one.Object to use as this when executing\ncallback.\n@name map\n@methodOf Array#\n*/\n/***\nTests whether some element in the array passes the test implemented by the\nprovided function.\n\n<code><em>array</em>.some(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callback\u00a0thisObject\u00a0 Function to test for each element.Object to use as\nthis when executing callback.\n@name some\n@methodOf Array#\n*/\n/***\nApply a function against an accumulator and each value of the array (from\nleft-to-right) as to reduce it to a single value.\n\n<code><em>array</em>.reduce(<em>callback</em>[, <em>initialValue</em>])</code>\n@param callbackinitialValue Function to execute on each value in the\narray.Object to use as the first argument to the first call of the callback.\n@name reduce\n@methodOf Array#\n*/\n/***\nApply a function simultaneously against two values of the array (from\nright-to-left) as to reduce it to a single value.\n\n<code><em>array</em>.reduceRight(<em>callback</em>[, <em>initialValue</em>])</code>\n@param callback\u00a0initialValue\u00a0 Function to execute on each value in the\narray.Object to use as the first argument to the first call of the callback.\n@name reduceRight\n@methodOf Array#\n*/\n/***\nReturns a boolean indicating whether the object has the specified property.\n\n<code><em>obj</em>.hasOwnProperty(<em>prop</em>)</code>\n@param prop The name of the property to test.\n@name hasOwnProperty\n@methodOf Object#\n*/\n/***\nCalls a function with a given this value and arguments provided as an array.\n\n<code><em>fun</em>.apply(<em>thisArg</em>[, <em>argsArray</em>])</code>\n@param thisArg\u00a0 Determines the value of this inside fun. If thisArg is null or\nundefined, this will be the global object. Otherwise, this will be equal to\nObject(thisArg) (which is thisArg if thisArg is already an object, or a String,\nBoolean, or Number if thisArg is a primitive value of the corresponding type).\nTherefore, it is always true that typeof this == \"object\" when the function\nexecutes.\n@param argsArray\u00a0 An argument array for the object, specifying the arguments\nwith which fun should be called, or null or undefined if no arguments should be\nprovided to the function.\n@name apply\n@methodOf Function#\n*/\n/***\nCreates a new function that, when called, itself calls this function in the\ncontext of the provided this value, with a given sequence of arguments preceding\nany provided when the new function was called.\n\n<code><em>fun</em>.bind(<em>thisArg</em>[, <em>arg1</em>[, <em>arg2</em>[, ...]]])</code>\n@param thisValuearg1, arg2, ... The value to be passed as the this parameter to\nthe target function when the bound function is called. \u00a0The value is ignored if\nthe bound function is constructed using the new operator.Arguments to prepend to\narguments provided to the bound function when invoking the target function.\n@name bind\n@methodOf Function#\n*/\n/***\nCalls a function with a given this value and arguments provided individually.\n\n<code><em>fun</em>.call(<em>thisArg</em>[, <em>arg1</em>[, <em>arg2</em>[, ...]]])</code>\n@param thisArg\u00a0 Determines the value of this inside fun. If thisArg is null or\nundefined, this will be the global object. Otherwise, this will be equal to\nObject(thisArg) (which is thisArg if thisArg is already an object, or a String,\nBoolean, or Number if thisArg is a primitive value of the corresponding type).\nTherefore, it is always true that typeof this == \"object\" when the function\nexecutes.\n@param arg1, arg2, ...\u00a0 Arguments for the object.\n@name call\n@methodOf Function#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Function#\n*/\n/***\nReturns a string representing the source code of the function.\n\n<code><em>function</em>.toString(<em>indentation</em>)</code>\n@param indentation Non-standard The amount of spaces to indent the string\nrepresentation of the source code. If indentation is less than or equal to -1,\nmost unnecessary spaces are removed.\n@name toString\n@methodOf Function#\n*/\n/***\nExecutes a search for a match in a specified string. Returns a result array, or\nnull.\n\n\n@param regexp\u00a0 The name of the regular expression. It can be a variable name or\na literal.\n@param str\u00a0 The string against which to match the regular expression.\n@name exec\n@methodOf RegExp#\n*/\n/***\nExecutes the search for a match between a regular expression and a specified\nstring. Returns true or false.\n\n<code> <em>regexp</em>.test([<em>str</em>]) </code>\n@param regexp\u00a0 The name of the regular expression. It can be a variable name or\na literal.\n@param str\u00a0 The string against which to match the regular expression.\n@name test\n@methodOf RegExp#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf RegExp#\n*/\n/***\nReturns a string representing the specified object.\n\n<code><i>regexp</i>.toString()</code>\n\n@name toString\n@methodOf RegExp#\n*/\n/***\nReturns a reference to the Date function that created the instance's prototype.\nNote that the value of this property is a reference to the function itself, not\na string containing the function's name.\n\n\n\n@name constructor\n@methodOf Date#\n*/\n/***\nReturns the day of the month for the specified date according to local time.\n\n<code>\ngetDate()\n</code>\n\n@name getDate\n@methodOf Date#\n*/\n/***\nReturns the day of the week for the specified date according to local time.\n\n<code>\ngetDay()\n</code>\n\n@name getDay\n@methodOf Date#\n*/\n/***\nReturns the year of the specified date according to local time.\n\n<code>\ngetFullYear()\n</code>\n\n@name getFullYear\n@methodOf Date#\n*/\n/***\nReturns the hour for the specified date according to local time.\n\n<code>\ngetHours()\n</code>\n\n@name getHours\n@methodOf Date#\n*/\n/***\nReturns the milliseconds in the specified date according to local time.\n\n<code>\ngetMilliseconds()\n</code>\n\n@name getMilliseconds\n@methodOf Date#\n*/\n/***\nReturns the minutes in the specified date according to local time.\n\n<code>\ngetMinutes()\n</code>\n\n@name getMinutes\n@methodOf Date#\n*/\n/***\nReturns the month in the specified date according to local time.\n\n<code>\ngetMonth()\n</code>\n\n@name getMonth\n@methodOf Date#\n*/\n/***\nReturns the seconds in the specified date according to local time.\n\n<code>\ngetSeconds()\n</code>\n\n@name getSeconds\n@methodOf Date#\n*/\n/***\nReturns the numeric value corresponding to the time for the specified date\naccording to universal time.\n\n<code> getTime() </code>\n\n@name getTime\n@methodOf Date#\n*/\n/***\nReturns the time-zone offset from UTC, in minutes, for the current locale.\n\n<code> getTimezoneOffset() </code>\n\n@name getTimezoneOffset\n@methodOf Date#\n*/\n/***\nReturns the day (date) of the month in the specified date according to universal\ntime.\n\n<code>\ngetUTCDate()\n</code>\n\n@name getUTCDate\n@methodOf Date#\n*/\n/***\nReturns the day of the week in the specified date according to universal time.\n\n<code>\ngetUTCDay()\n</code>\n\n@name getUTCDay\n@methodOf Date#\n*/\n/***\nReturns the year in the specified date according to universal time.\n\n<code>\ngetUTCFullYear()\n</code>\n\n@name getUTCFullYear\n@methodOf Date#\n*/\n/***\nReturns the hours in the specified date according to universal time.\n\n<code>\ngetUTCHours\n</code>\n\n@name getUTCHours\n@methodOf Date#\n*/\n/***\nReturns the milliseconds in the specified date according to universal time.\n\n<code>\ngetUTCMilliseconds()\n</code>\n\n@name getUTCMilliseconds\n@methodOf Date#\n*/\n/***\nReturns the minutes in the specified date according to universal time.\n\n<code>\ngetUTCMinutes()\n</code>\n\n@name getUTCMinutes\n@methodOf Date#\n*/\n/***\nReturns the month of the specified date according to universal time.\n\n<code>\ngetUTCMonth()\n</code>\n\n@name getUTCMonth\n@methodOf Date#\n*/\n/***\nReturns the seconds in the specified date according to universal time.\n\n<code>\ngetUTCSeconds()\n</code>\n\n@name getUTCSeconds\n@methodOf Date#\n*/\n/***\nDeprecated\n\n\n\n@name getYear\n@methodOf Date#\n*/\n/***\nSets the day of the month for a specified date according to local time.\n\n<code> setDate(<em>dayValue</em>) </code>\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setDate\n@methodOf Date#\n*/\n/***\nSets the full year for a specified date according to local time.\n\n<code>\nsetFullYear(<i>yearValue</i>[, <i>monthValue</i>[, <em>dayValue</em>]])\n</code>\n@param yearValue\u00a0 An integer specifying the numeric value of the year, for\nexample, 1995.\n@param monthValue\u00a0 An integer between 0 and 11 representing the months January\nthrough December.\n@param dayValue\u00a0 An integer between 1 and 31 representing the day of the\nmonth. If you specify the dayValue parameter, you must also specify the\nmonthValue.\n@name setFullYear\n@methodOf Date#\n*/\n/***\nSets the hours for a specified date according to local time.\n\n<code>\nsetHours(<i>hoursValue</i>[, <i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]]])\n</code>\n@param hoursValue\u00a0 An integer between 0 and 23, representing the hour.\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setHours\n@methodOf Date#\n*/\n/***\nSets the milliseconds for a specified date according to local time.\n\n<code>\nsetMilliseconds(<i>millisecondsValue</i>)\n</code>\n@param millisecondsValue\u00a0 A number between 0 and 999, representing the\nmilliseconds.\n@name setMilliseconds\n@methodOf Date#\n*/\n/***\nSets the minutes for a specified date according to local time.\n\n<code>\nsetMinutes(<i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]])\n</code>\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setMinutes\n@methodOf Date#\n*/\n/***\nSet the month for a specified date according to local time.\n\n<code>\nsetMonth(<i>monthValue</i>[, <em>dayValue</em>])\n</code>\n@param monthValue\u00a0 An integer between 0 and 11 (representing the months\nJanuary through December).\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setMonth\n@methodOf Date#\n*/\n/***\nSets the seconds for a specified date according to local time.\n\n<code>\nsetSeconds(<i>secondsValue</i>[, <em>msValue</em>])\n</code>\n@param secondsValue\u00a0 An integer between 0 and 59.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds.\n@name setSeconds\n@methodOf Date#\n*/\n/***\nSets the Date object to the time represented by a number of milliseconds since\nJanuary 1, 1970, 00:00:00 UTC.\n\n<code>\nsetTime(<i>timeValue</i>)\n</code>\n@param timeValue\u00a0 An integer representing the number of milliseconds since 1\nJanuary 1970, 00:00:00 UTC.\n@name setTime\n@methodOf Date#\n*/\n/***\nSets the day of the month for a specified date according to universal time.\n\n<code>\nsetUTCDate(<i>dayValue</i>)\n</code>\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setUTCDate\n@methodOf Date#\n*/\n/***\nSets the full year for a specified date according to universal time.\n\n<code>\nsetUTCFullYear(<i>yearValue</i>[, <i>monthValue</i>[, <em>dayValue</em>]])\n</code>\n@param yearValue\u00a0 An integer specifying the numeric value of the year, for\nexample, 1995.\n@param monthValue\u00a0 An integer between 0 and 11 representing the months January\nthrough December.\n@param dayValue\u00a0 An integer between 1 and 31 representing the day of the\nmonth. If you specify the dayValue parameter, you must also specify the\nmonthValue.\n@name setUTCFullYear\n@methodOf Date#\n*/\n/***\nSets the hour for a specified date according to universal time.\n\n<code>\nsetUTCHours(<i>hoursValue</i>[, <i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]]])\n</code>\n@param hoursValue\u00a0 An integer between 0 and 23, representing the hour.\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setUTCHours\n@methodOf Date#\n*/\n/***\nSets the milliseconds for a specified date according to universal time.\n\n<code>\nsetUTCMilliseconds(<i>millisecondsValue</i>)\n</code>\n@param millisecondsValue\u00a0 A number between 0 and 999, representing the\nmilliseconds.\n@name setUTCMilliseconds\n@methodOf Date#\n*/\n/***\nSets the minutes for a specified date according to universal time.\n\n<code>\nsetUTCMinutes(<i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]])\n</code>\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setUTCMinutes\n@methodOf Date#\n*/\n/***\nSets the month for a specified date according to universal time.\n\n<code>\nsetUTCMonth(<i>monthValue</i>[, <em>dayValue</em>])\n</code>\n@param monthValue\u00a0 An integer between 0 and 11, representing the months\nJanuary through December.\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setUTCMonth\n@methodOf Date#\n*/\n/***\nSets the seconds for a specified date according to universal time.\n\n<code>\nsetUTCSeconds(<i>secondsValue</i>[, <em>msValue</em>])\n</code>\n@param secondsValue\u00a0 An integer between 0 and 59.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds.\n@name setUTCSeconds\n@methodOf Date#\n*/\n/***\nDeprecated\n\n\n\n@name setYear\n@methodOf Date#\n*/\n/***\nReturns the date portion of a Date object in human readable form in American\nEnglish.\n\n<code><em>date</em>.toDateString()</code>\n\n@name toDateString\n@methodOf Date#\n*/\n/***\nReturns a JSON representation of the Date object.\n\n<code><em>date</em>.prototype.toJSON()</code>\n\n@name toJSON\n@methodOf Date#\n*/\n/***\nDeprecated\n\n\n\n@name toGMTString\n@methodOf Date#\n*/\n/***\nConverts a date to a string, returning the \"date\" portion using the operating\nsystem's locale's conventions.\n\n<code>\ntoLocaleDateString()\n</code>\n\n@name toLocaleDateString\n@methodOf Date#\n*/\n/***\nNon-standard\n\n\n\n@name toLocaleFormat\n@methodOf Date#\n*/\n/***\nConverts a date to a string, using the operating system's locale's conventions.\n\n<code>\ntoLocaleString()\n</code>\n\n@name toLocaleString\n@methodOf Date#\n*/\n/***\nConverts a date to a string, returning the \"time\" portion using the current\nlocale's conventions.\n\n<code> toLocaleTimeString() </code>\n\n@name toLocaleTimeString\n@methodOf Date#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Date#\n*/\n/***\nReturns a string representing the specified Date object.\n\n<code> toString() </code>\n\n@name toString\n@methodOf Date#\n*/\n/***\nReturns the time portion of a Date object in human readable form in American\nEnglish.\n\n<code><em>date</em>.toTimeString()</code>\n\n@name toTimeString\n@methodOf Date#\n*/\n/***\nConverts a date to a string, using the universal time convention.\n\n<code> toUTCString() </code>\n\n@name toUTCString\n@methodOf Date#\n*/\n/***\nReturns the primitive value of a Date object.\n\n<code>\nvalueOf()\n</code>\n\n@name valueOf\n@methodOf Date#\n*/;\n;\n(function() {\n var Animation, fromPixieId;\n Animation = function(data) {\n var activeAnimation, advanceFrame, currentSprite, spriteLookup;\n spriteLookup = {};\n activeAnimation = data.animations[0];\n currentSprite = data.animations[0].frames[0];\n advanceFrame = function(animation) {\n var frames;\n frames = animation.frames;\n return (currentSprite = frames[(frames.indexOf(currentSprite) + 1) % frames.length]);\n };\n data.tileset.each(function(spriteData, i) {\n return (spriteLookup[i] = Sprite.fromURL(spriteData.src));\n });\n return $.extend(data, {\n currentSprite: function() {\n return currentSprite;\n },\n draw: function(canvas, x, y) {\n return canvas.withTransform(Matrix.translation(x, y), function() {\n return spriteLookup[currentSprite].draw(canvas, 0, 0);\n });\n },\n frames: function() {\n return activeAnimation.frames;\n },\n update: function() {\n return advanceFrame(activeAnimation);\n },\n active: function(name) {\n if (name !== undefined) {\n return data.animations[name] ? (currentSprite = data.animations[name].frames[0]) : null;\n } else {\n return activeAnimation;\n }\n }\n });\n };\n window.Animation = function(name, callback) {\n return fromPixieId(App.Animations[name], callback);\n };\n fromPixieId = function(id, callback) {\n var proxy, url;\n url = (\"http://pixie.strd6.com/s3/animations/\" + (id) + \"/data.json\");\n proxy = {\n active: $.noop,\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Animation(data));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n return (window.Animation.fromPixieId = fromPixieId);\n})();;\nvar __slice = Array.prototype.slice;\n(function($) {\n var Bindable;\n /***\n Bindable module\n @name Bindable\n @module\n @constructor\n */\n Bindable = function() {\n var eventCallbacks;\n eventCallbacks = {};\n return {\n /***\n The bind method adds a function as an event listener.\n\n @name bind\n @methodOf Bindable#\n\n @param {String} event The event to listen to.\n @param {Function} callback The function to be called when the specified event\n is triggered.\n */\n bind: function(event, callback) {\n eventCallbacks[event] = eventCallbacks[event] || [];\n return eventCallbacks[event].push(callback);\n },\n /***\n The unbind method removes a specific event listener, or all event listeners if\n no specific listener is given.\n\n @name unbind\n @methodOf Bindable#\n\n @param {String} event The event to remove the listener from.\n @param {Function} [callback] The listener to remove.\n */\n unbind: function(event, callback) {\n eventCallbacks[event] = eventCallbacks[event] || [];\n return callback ? eventCallbacks.remove(callback) : (eventCallbacks[event] = []);\n },\n /***\n The trigger method calls all listeners attached to the specified event.\n\n @name trigger\n @methodOf Bindable#\n\n @param {String} event The event to trigger.\n @param {Array} [parameters] Additional parameters to pass to the event listener.\n */\n trigger: function(event) {\n var callbacks, parameters, self;\n parameters = __slice.call(arguments, 1);\n callbacks = eventCallbacks[event];\n if (callbacks && callbacks.length) {\n self = this;\n return callbacks.each(function(callback) {\n return callback.apply(self, parameters);\n });\n }\n }\n };\n };\n return (window.Bindable = Bindable);\n})(jQuery);;\nvar Bounded;\n/***\nThe Bounded module is used to provide basic data about the\nlocation and dimensions of the including object\n\nBounded module\n@name Bounded\n@module\n@constructor\n\n@param {Object} I Instance variables\n@param {Object} self Reference to including object\n*/\nBounded = function(I) {\n I || (I = {});\n $.reverseMerge(I, {\n x: 0,\n y: 0,\n width: 8,\n height: 8\n });\n return {\n /***\n The position of this game object, the top left point in the local transform.\n\n @returns The position of this object\n @type Point\n */\n position: function() {\n return Point(I.x, I.y);\n },\n collides: function(bounds) {\n return Collision.rectangular(I, bounds);\n },\n /***\n The bounds method returns infomation about the location\n of the object and its dimensions with optional offsets\n\n @name bounds\n @methodOf Bounded#\n\n @param {number} xOffset the amount to shift the x position\n @param {number} yOffset the amount to shift the y position\n */\n bounds: function(xOffset, yOffset) {\n return {\n x: I.x + (xOffset || 0),\n y: I.y + (yOffset || 0),\n width: I.width,\n height: I.height\n };\n },\n /***\n The centeredBounds method returns infomation about the center\n of the object along with the midpoint of the width and height\n\n @name centeredBounds\n @methodOf Bounded#\n */\n centeredBounds: function() {\n return {\n x: I.x + I.width / 2,\n y: I.y + I.height / 2,\n xw: I.width / 2,\n yw: I.height / 2\n };\n },\n /***\n The center method returns the {@link Point} that is\n the center of the object\n\n @name center\n @methodOf Bounded#\n */\n center: function() {\n return Point(I.x + I.width / 2, I.y + I.height / 2);\n }\n };\n};;\nvar CellularAutomata;\nCellularAutomata = function(I) {\n var currentState, get, neighbors, nextState, self;\n I || (I = {});\n $.reverseMerge(I, {\n cellUpdate: function(row, col, value, neighbors) {\n var neighborCounts;\n neighborCounts = neighbors.sum();\n return +((value + neighborCounts) >= 5);\n },\n initializeCell: function(row, col) {\n return rand() < 0.45;\n },\n outsideValue: function(row, col) {\n return 1;\n },\n width: 32,\n height: 32\n });\n currentState = [];\n nextState = [];\n get = function(row, col) {\n if (((0 <= row) && (row < I.height)) && ((0 <= col) && (col < I.width))) {\n return currentState[row][col];\n } else {\n return I.outsideValue(row, col);\n }\n };\n neighbors = function(row, col) {\n return [get(row - 1, col - 1), get(row - 1, col), get(row - 1, col + 1), get(row, col - 1), get(row, col + 1), get(row + 1, col - 1), get(row + 1, col), get(row + 1, col + 1)];\n };\n I.height.times(function(row) {\n currentState[row] = [];\n return I.width.times(function(col) {\n return (currentState[row][col] = I.initializeCell(row, col));\n });\n });\n self = {\n data: function() {\n return currentState;\n },\n get: function(row, col) {\n return currentState[row][col];\n },\n update: function(updateFn) {\n I.height.times(function(row) {\n return (nextState[row] = currentState[row].map(function(value, col) {\n return updateFn ? updateFn(row, col, value, neighbors(row, col)) : I.cellUpdate(row, col, value, neighbors(row, col));\n }));\n });\n currentState = nextState;\n return (nextState = []);\n }\n };\n return self;\n};;\nvar Collidable;\nCollidable = function(I) {\n I || (I = {});\n return {\n solid_collision: function(other) {\n if (other.solid && other.bounds) {\n if (Collision.rectangular(self, other)) {\n self.trigger('collision');\n return other.trigger('collision');\n }\n }\n },\n collides_with: function(other) {\n var nearby, quadTree;\n if (other.solid && other.bounds) {\n if (Object.isArray(other)) {\n quadTree = QuadTree();\n other.each(function(collidable) {\n return quadTree.insert(collidable);\n });\n nearby = quadTree.retrieve(self);\n return nearby.each(function(close_collider) {\n return self.solid_collision(close_collider);\n });\n } else {\n return solid_collision(other);\n }\n }\n }\n };\n};;\nvar Collision;\n/***\nCollision holds many methods useful for checking geometric overlap of various objects.\n\n@name Collision\n@namespace\n*/\nCollision = {\n rectangular: function(a, b) {\n return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;\n },\n circular: function(a, b) {\n var dx, dy, r;\n r = a.radius + b.radius;\n dx = b.x - a.x;\n dy = b.y - a.y;\n return r * r >= dx * dx + dy * dy;\n },\n rayCircle: function(source, direction, target) {\n var dt, hit, intersection, intersectionToTarget, intersectionToTargetLength, laserToTarget, projection, projectionLength, radius;\n radius = target.radius();\n target = target.position();\n laserToTarget = target.subtract(source);\n projectionLength = direction.dot(laserToTarget);\n if (projectionLength < 0) {\n return false;\n }\n projection = direction.scale(projectionLength);\n intersection = source.add(projection);\n intersectionToTarget = target.subtract(intersection);\n intersectionToTargetLength = intersectionToTarget.length();\n if (intersectionToTargetLength < radius) {\n hit = true;\n }\n if (hit) {\n dt = Math.sqrt(radius * radius - intersectionToTargetLength * intersectionToTargetLength);\n return (hit = direction.scale(projectionLength - dt).add(source));\n }\n },\n rayRectangle: function(source, direction, target) {\n var areaPQ0, areaPQ1, hit, p0, p1, t, tX, tY, xval, xw, yval, yw;\n xw = target.xw;\n yw = target.yw;\n if (source.x < target.x) {\n xval = target.x - xw;\n } else {\n xval = target.x + xw;\n }\n if (source.y < target.y) {\n yval = target.y - yw;\n } else {\n yval = target.y + yw;\n }\n if (direction.x === 0) {\n p0 = Point(target.x - xw, yval);\n p1 = Point(target.x + xw, yval);\n t = (yval - source.y) / direction.y;\n } else if (direction.y === 0) {\n p0 = Point(xval, target.y - yw);\n p1 = Point(xval, target.y + yw);\n t = (xval - source.x) / direction.x;\n } else {\n tX = (xval - source.x) / direction.x;\n tY = (yval - source.y) / direction.y;\n if ((tX < tY || ((-xw < source.x - target.x) && (source.x - target.x < xw))) && !((-yw < source.y - target.y) && (source.y - target.y < yw))) {\n p0 = Point(target.x - xw, yval);\n p1 = Point(target.x + xw, yval);\n t = tY;\n } else {\n p0 = Point(xval, target.y - yw);\n p1 = Point(xval, target.y + yw);\n t = tX;\n }\n }\n if (t > 0) {\n areaPQ0 = direction.cross(p0.subtract(source));\n areaPQ1 = direction.cross(p1.subtract(source));\n return areaPQ0 * areaPQ1 < 0 ? (hit = direction.scale(t).add(source)) : null;\n }\n }\n};;\nvar DebugConsole;\nDebugConsole = function() {\n var REPL, container, input, output, repl, runButton;\n REPL = function(input, output) {\n var print;\n print = function(message) {\n return output.append($(\"<li />\", {\n text: message\n }));\n };\n return {\n run: function() {\n var code, result, source;\n source = input.val();\n try {\n code = CoffeeScript.compile(source, {\n bare: true\n });\n if (code.indexOf(\"var\") === 0) {\n code = code.substring(code.indexOf(\"\\n\"));\n }\n result = eval(code);\n print(\" => \" + (result));\n return input.val('');\n } catch (error) {\n return error.stack ? print(error.stack) : print(error.toString());\n }\n }\n };\n };\n container = $(\"<div />\", {\n \"class\": \"console\"\n });\n input = $(\"<textarea />\");\n output = $(\"<ul />\");\n runButton = $(\"<button />\", {\n text: \"Run\"\n });\n repl = REPL(input, output);\n container.append(output).append(input).append(runButton);\n return $(function() {\n runButton.click(function() {\n return repl.run();\n });\n return $(\"body\").append(container);\n });\n};;\nfunction DialogBox(I) {\n I = I || {};\n \n $.reverseMerge(I, {\n backgroundColor: \"#000\",\n blinkRate: 8,\n cursor: true,\n cursorWidth: 10,\n height: 480,\n lineHeight: 16,\n paddingX: 24,\n paddingY: 24,\n text: \"\",\n textColor: \"#080\",\n width: 640,\n x: 0,\n y: 0\n });\n \n I.textWidth = I.width - 2*(I.paddingX);\n I.textHeight = I.height - 2*(I.paddingY);\n \n var blinkCount = 0;\n var cursorOn = true;\n \n var pageOffset = 0;\n var displayChars = 0;\n \n return {\n complete: function() {\n return displayChars >= I.text.length - 1;\n },\n \n draw: function(canvas) {\n //TODO: A lot of the logic in here should be moved into the\n // update method and pre-computed.\n var textStart = Point(I.paddingX, I.paddingY + I.lineHeight);\n \n canvas.withTransform(Matrix.translation(I.x, I.y), function() {\n canvas.fillColor(I.backgroundColor);\n canvas.fillRect(0, 0, I.width, I.height);\n \n canvas.fillColor(I.textColor);\n \n var pageCharCount = 0;\n var displayText = I.text.substr(pageOffset, displayChars);\n \n var piecesRemaining = displayText.split(' ');\n var lineWidth = 0;\n var line = 0;\n \n while(piecesRemaining.length > 0) {\n var currentLine = piecesRemaining.shift();\n \n while((canvas.measureText(currentLine) <= I.textWidth) && (piecesRemaining.length > 0)) {\n var proposedLine = currentLine + \" \" + piecesRemaining[0];\n \n if(canvas.measureText(proposedLine) <= I.textWidth) {\n piecesRemaining.shift();\n currentLine = proposedLine;\n } else {\n break;\n ;//NOOP\n }\n }\n \n pageCharCount += currentLine.length;\n \n canvas.fillText(currentLine, textStart.x, textStart.y + line * I.lineHeight);\n lineWidth = canvas.measureText(currentLine);\n \n if(line * I.lineHeight < I.textHeight) {\n line += 1;\n } else {\n pageOffset += pageCharCount + line;\n line = 0;\n pageCharCount = 0;\n displayChars = 0;\n break;\n ;\n }\n }\n \n if(cursorOn && I.cursor) {\n canvas.fillRect(textStart.x + lineWidth, textStart.y + (line - 2) *I.lineHeight, I.cursorWidth, I.lineHeight);\n }\n });\n \n },\n \n flush: function() {\n displayChars = I.text.length;\n },\n \n setText: function(text) {\n pageOffset = 0;\n displayChars = 0;\n I.text = text;\n },\n \n update: function() {\n displayChars += 1;\n blinkCount += 1;\n \n if(blinkCount >= I.blinkRate) {\n blinkCount = 0;\n cursorOn = !cursorOn;\n }\n }\n };\n};\nvar Drawable;\n/**\nThe Drawable module is used to provide a simple draw method to the including\nobject.\n\nBinds a default draw listener to draw a rectangle or a sprite, if one exists.\n\nBinds a step listener to update the transform of the object.\n\nAutoloads the sprite specified in I.spriteName, if any.\n\n@name Drawable\n@module\n@constructor\n\n@param {Object} I Instance variables\n@param {Object} self Reference to including object\n*/\nDrawable = function(I, self) {\n I || (I = {});\n $.reverseMerge(I, {\n color: \"#196\",\n spriteName: null\n });\n if (I.spriteName) {\n I.sprite = Sprite(I.spriteName, function(sprite) {\n I.width = sprite.width;\n return (I.height = sprite.height);\n });\n }\n self.bind('step', function() {\n var center;\n center = self.center();\n return I.rotation ? (I.transform = Matrix.translation(center.x, center.y).concat(Matrix.rotation(I.rotation)).concat(Matrix.translation(-I.width / 2, -I.height / 2))) : (I.transform = Matrix.translation(I.x, I.y));\n });\n self.bind('draw', function(canvas) {\n if (I.sprite) {\n return I.sprite.draw(canvas, 0, 0);\n } else {\n canvas.fillColor(I.color);\n return canvas.fillRect(0, 0, I.width, I.height);\n }\n });\n return {};\n};;\nvar Durable;\n/***\nThe Durable module deactives GameObjects after a specified duration.\nIf a duration is specified the object will update that many times. If -1 is\nspecified the object will have an unlimited duration.\n\n@name Durable\n@module\n@constructor\n\n@param {Object} I Instance variables\n*/\nDurable = function(I) {\n $.reverseMerge(I, {\n duration: -1\n });\n return {\n before: {\n update: function() {\n return I.duration !== -1 && (I.age >= I.duration) ? (I.active = false) : null;\n }\n }\n };\n};;\nvar Emitter;\nEmitter = function(I) {\n var self;\n self = GameObject(I);\n return self.include(Emitterable);\n};;\nvar Emitterable;\nEmitterable = function(I, self) {\n var n, particles;\n I || (I = {});\n $.reverseMerge(I, {\n batchSize: 1,\n emissionRate: 1,\n color: \"blue\",\n width: 0,\n height: 0,\n generator: {},\n particleCount: Infinity,\n particleData: {\n acceleration: Point(0, 0.1),\n age: 0,\n color: \"blue\",\n duration: 30,\n height: 2,\n maxSpeed: 2,\n offset: Point(0, 0),\n sprite: false,\n spriteName: false,\n velocity: Point(-0.25, 1),\n width: 2\n }\n });\n particles = [];\n n = 0;\n return {\n before: {\n draw: function(canvas) {\n return particles.invoke(\"draw\", canvas);\n },\n update: function() {\n I.batchSize.times(function() {\n var center, particleProperties;\n if (n < I.particleCount && rand() < I.emissionRate) {\n center = self.center();\n particleProperties = $.reverseMerge({\n x: center.x,\n y: center.y\n }, I.particleData);\n $.each(I.generator, function(key, value) {\n return I.generator[key].call ? (particleProperties[key] = I.generator[key](n, I)) : (particleProperties[key] = I.generator[key]);\n });\n particleProperties.x += particleProperties.offset.x;\n particleProperties.y += particleProperties.offset.y;\n particles.push(GameObject(particleProperties));\n return n += 1;\n }\n });\n particles = particles.select(function(particle) {\n return particle.update();\n });\n return n === I.particleCount && !particles.length ? (I.active = false) : null;\n }\n }\n };\n};;\n(function($) {\n var defaults;\n defaults = {\n FPS: 33.3333,\n age: 0,\n ambientLight: 1,\n backgroundColor: \"#FFFFFF\",\n cameraTransform: Matrix.IDENTITY,\n excludedModules: [],\n includedModules: [],\n paused: false,\n showFPS: false\n };\n /***\n The Engine controls the game world and manages game state. Once you\n set it up and let it run it pretty much takes care of itself.\n\n You can use the engine to add or remove objects from the game world.\n\n There are several modules that can include to add additional capabilities\n to the engine.\n\n The engine fires events that you may bind listeners to. Event listeners\n may be bound with <code>engine.bind(eventName, callback)</code>\n\n @name Engine\n @constructor\n @param I\n */\n /***\n Observe or modify the\n entity data before it is added to the engine.\n @name beforeAdd\n @methodOf Engine#\n @event\n\n @param {Object} entityData\n */\n /***\n Observe or configure a <code>gameObject</code> that has been added\n to the engine.\n @name afterAdd\n @methodOf Engine#\n @event\n\n @param {GameObject} object The object that has just been added to the\n engine.\n */\n /***\n Called when the engine updates all the game objects.\n\n @name update\n @methodOf Engine#\n @event\n */\n /***\n Called after the engine completes an update. Here it is\n safe to modify the game objects array.\n\n @name afterUpdate\n @methodOf Engine#\n @event\n */\n /***\n Called before the engine draws the game objects on the canvas.\n\n The current camera transform <b>is</b> applied.\n\n @name preDraw\n @methodOf Engine#\n @event\n */\n /***\n Called after the engine draws on the canvas.\n\n The current camera transform <b>is not</b> applied, you may\n choose to apply it yourself using <code>I.cameraTransform</code>.\n\n @name draw\n @methodOf Engine#\n @event\n */\n return (window.Engine = function(I) {\n var canvas, defaultModules, draw, frameAdvance, framerate, intervalId, modules, queuedObjects, self, step, update;\n I || (I = {});\n $.reverseMerge(I, {\n objects: []\n }, defaults);\n intervalId = null;\n frameAdvance = false;\n queuedObjects = [];\n framerate = Framerate({\n noDOM: true\n });\n update = function() {\n var _ref, toRemove;\n self.trigger(\"update\");\n _ref = I.objects.partition(function(object) {\n return object.update();\n });\n I.objects = _ref[0];\n toRemove = _ref[1];\n toRemove.invoke(\"trigger\", \"remove\");\n I.objects = I.objects.concat(queuedObjects);\n queuedObjects = [];\n return self.trigger(\"afterUpdate\");\n };\n draw = function() {\n canvas.withTransform(I.cameraTransform, function(canvas) {\n if (I.backgroundColor) {\n canvas.fill(I.backgroundColor);\n }\n self.trigger(\"preDraw\", canvas);\n return I.objects.invoke(\"draw\", canvas);\n });\n self.trigger(\"draw\", canvas);\n if (I.showFPS) {\n canvas.font(\"bold 9pt consolas, 'Courier New', 'andale mono', 'lucida console', monospace\");\n canvas.fillColor(\"#FFF\");\n canvas.fillText(\"fps: \" + framerate.fps, 6, 18);\n }\n return framerate.rendered();\n };\n step = function() {\n if (!I.paused || frameAdvance) {\n update();\n I.age += 1;\n }\n return draw();\n };\n canvas = I.canvas || $(\"<canvas />\").powerCanvas();\n self = Core(I).extend({\n /***\n The add method creates and adds an object to the game world.\n\n Events triggered:\n <code>beforeAdd(entityData)</code>\n <code>afterAdd(gameObject)</code>\n\n @name add\n @methodOf Engine#\n @param entityData The data used to create the game object.\n @type GameObject\n */\n add: function(entityData) {\n var obj;\n self.trigger(\"beforeAdd\", entityData);\n obj = GameObject.construct(entityData);\n self.trigger(\"afterAdd\", obj);\n if (intervalId && !I.paused) {\n queuedObjects.push(obj);\n } else {\n I.objects.push(obj);\n }\n return obj;\n },\n /***\n Returns a reference to the canvas.\n\n @name canvas\n @methodOf Engine#\n */\n canvas: function() {\n return canvas;\n },\n objects: function() {\n return I.objects;\n },\n objectAt: function(x, y) {\n var bounds, targetObject;\n targetObject = null;\n bounds = {\n x: x,\n y: y,\n width: 1,\n height: 1\n };\n self.eachObject(function(object) {\n if (object.collides(bounds)) {\n return (targetObject = object);\n }\n });\n return targetObject;\n },\n eachObject: function(iterator) {\n return I.objects.each(iterator);\n },\n /***\n Start the game simulation.\n @methodOf Engine#\n @name start\n */\n start: function() {\n return !(intervalId) ? (intervalId = setInterval(function() {\n return step();\n }, 1000 / I.FPS)) : null;\n },\n /***\n Stop the simulation.\n @methodOf Engine#\n @name stop\n */\n stop: function() {\n clearInterval(intervalId);\n return (intervalId = null);\n },\n frameAdvance: function() {\n I.paused = true;\n frameAdvance = true;\n step();\n return (frameAdvance = false);\n },\n play: function() {\n return (I.paused = false);\n },\n /***\n Pause the simulation\n @methodOf Engine#\n @name pause\n */\n pause: function() {\n return (I.paused = true);\n },\n paused: function() {\n return I.paused;\n },\n setFramerate: function(newFPS) {\n I.FPS = newFPS;\n self.stop();\n return self.start();\n }\n });\n self.attrAccessor(\"ambientLight\");\n self.attrAccessor(\"backgroundColor\");\n self.attrAccessor(\"cameraTransform\");\n self.include(Bindable);\n defaultModules = [\"Shadows\", \"HUD\", \"Developer\", \"SaveState\", \"Selector\", \"Collision\"];\n modules = defaultModules.concat(I.includedModules);\n modules = modules.without(I.excludedModules);\n modules.each(function(moduleName) {\n if (!(Engine[moduleName])) {\n throw \"#Engine.{moduleName} is not a valid engine module\";\n }\n return self.include(Engine[moduleName]);\n });\n return self;\n });\n})(jQuery);;\n/***\nThe <code>Tilemap</code> module provides a way to load tilemaps in the engine.\n\n@name Tilemap\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Tilemap = function(I, self) {\n var map;\n map = null;\n self.bind(\"preDraw\", function(canvas) {\n return (typeof map === \"undefined\" || map === null) ? undefined : map.draw(canvas);\n });\n return {\n loadMap: function(name, complete) {\n return (map = Tilemap.load({\n name: name,\n complete: complete,\n entity: self.add\n }));\n }\n };\n};;\n/***\nThe <code>Collision</code> module provides some simple collision detection methods to engine.\n\n@name Collision\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Collision = function(I, self) {\n return {\n /***\n Detects collisions between a bounds and the game objects.\n\n @name collides\n @methodOf Engine.Collision#\n @param bounds The bounds to check collisions with.\n @param [sourceObject] An object to exclude from the results.\n */\n collides: function(bounds, sourceObject) {\n return I.objects.inject(false, function(collided, object) {\n return collided || (object.solid() && (object !== sourceObject) && object.collides(bounds));\n });\n },\n /***\n Detects collisions between a ray and the game objects.\n\n @name rayCollides\n @methodOf Engine.Collision#\n @param source The origin point\n @param direction A point representing the direction of the ray\n @param [sourceObject] An object to exclude from the results.\n */\n rayCollides: function(source, direction, sourceObject) {\n var hits, nearestDistance, nearestHit;\n hits = I.objects.map(function(object) {\n var hit;\n hit = object.solid() && (object !== sourceObject) && Collision.rayRectangle(source, direction, object.centeredBounds());\n if (hit) {\n hit.object = object;\n }\n return hit;\n });\n nearestDistance = Infinity;\n nearestHit = null;\n hits.each(function(hit) {\n var d;\n if (hit && (d = hit.distance(source)) < nearestDistance) {\n nearestDistance = d;\n return (nearestHit = hit);\n }\n });\n return nearestHit;\n }\n };\n};;\nvar _i, _ref, developerMode, fn, key, objectToUpdate;\nvar __hasProp = Object.prototype.hasOwnProperty;\n/***\nThe <code>Developer</code> module provides a debug overlay and methods for debugging and live coding.\n\n@name Developer\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Developer = function(I, self) {\n self.bind(\"draw\", function(canvas) {\n if (I.paused) {\n canvas.withTransform(I.cameraTransform, function(canvas) {\n return I.objects.each(function(object) {\n canvas.fillColor('rgba(255, 0, 0, 0.5)');\n return canvas.fillRect(object.bounds().x, object.bounds().y, object.bounds().width, object.bounds().height);\n });\n });\n canvas.fillColor('rgba(0, 0, 0, 0.5)');\n canvas.fillRect(430, 10, 200, 60);\n canvas.fillColor('#fff');\n canvas.fillText(\"Developer Mode. Press Esc to resume\", 440, 25);\n canvas.fillText(\"Shift+Left click to add boxes\", 440, 43);\n return canvas.fillText(\"Right click red boxes to edit properties\", 440, 60);\n }\n });\n return {};\n};\ndeveloperMode = false;\nobjectToUpdate = null;\nwindow.updateObjectProperties = function(newProperties) {\n return objectToUpdate ? $.extend(objectToUpdate, GameObject.construct(newProperties)) : null;\n};\nif (window.developerModeMousedown) {\n $(document).unbind(window.developerModeMousedown);\n}\nif (window.developerHotkeys) {\n _ref = developerHotkeys;\n for (key in _ref) {\n if (!__hasProp.call(_ref, key)) continue;\n fn = _ref[key];\n $(document).unbind(\"keydown\", key, fn);\n }\n}\nwindow.developerModeMousedown = function(event) {\n var object;\n if (developerMode) {\n console.log(event.which);\n if (event.which === 3) {\n if (object = engine.objectAt(event.pageX, event.pageY)) {\n parent.editProperties(object.I);\n objectToUpdate = object;\n }\n return console.log(object);\n } else if (event.which === 2 || keydown.shift) {\n return (typeof window.developerAddObject === \"function\" ? window.developerAddObject(event) : undefined);\n }\n }\n};\n$(document).mousedown(window.developerModeMousedown);\nwindow.developerHotkeys = {\n esc: function() {\n developerMode = !developerMode;\n return developerMode ? engine.pause() : engine.play();\n },\n f3: function() {\n return Local.set(\"level\", engine.saveState());\n },\n f4: function() {\n return engine.loadState(Local.get(\"level\"));\n },\n f5: function() {\n return engine.reload();\n }\n};\n_ref = window.developerHotkeys;\nfor (_i in _ref) {\n if (!__hasProp.call(_ref, _i)) continue;\n (function() {\n var key = _i;\n var fn = _ref[_i];\n return (window.developerHotkeys[key] = function(event) {\n event.preventDefault();\n return fn();\n });\n })();\n}\n_ref = window.developerHotkeys;\nfor (key in _ref) {\n if (!__hasProp.call(_ref, key)) continue;\n fn = _ref[key];\n $(document).bind(\"keydown\", key, fn);\n};\n/***\nThe <code>HUD</code> module provides an extra canvas to draw to. GameObjects that respond to the\n<code>drawHUD</code> method will draw to the HUD canvas. The HUD canvas is not cleared each frame, it is\nthe responsibility of the objects drawing on it to manage that themselves.\n\n@name HUD\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.HUD = function(I, self) {\n var hudCanvas;\n hudCanvas = $(\"<canvas width=640 height=480 />\").powerCanvas();\n hudCanvas.font(\"bold 9pt consolas, 'Courier New', 'andale mono', 'lucida console', monospace\");\n self.bind(\"draw\", function(canvas) {\n var hud;\n I.objects.each(function(object) {\n return (typeof object.drawHUD === \"function\" ? object.drawHUD(hudCanvas) : undefined);\n });\n hud = hudCanvas.element();\n return canvas.drawImage(hud, 0, 0, hud.width, hud.height, 0, 0, hud.width, hud.height);\n });\n return {};\n};;\n(function($) {\n var _ref, b2DebugDraw, b2World;\n _ref = Box2D.Dynamics;\n b2World = _ref.b2World;\n b2DebugDraw = _ref.b2DebugDraw;\n /***\n (Module) The <code>Box2D</code> module provides physics integration via Box2D.\n\n @name Box2D\n @fieldOf Engine\n\n @param {Object} I Instance variables\n @param {Object} self Reference to the engine\n */\n return (Engine.Box2D = function(I, self) {\n var debugCanvas, debugDraw, debugElement, destroyPhysicsBodies, fireCollisionEvents, pendingCollisions, pendingDestructions, world;\n $.reverseMerge(I, {\n scale: 0.1,\n gravity: Point(0, 98),\n PHYSICS_DEBUG_DRAW: false\n });\n world = new b2World(new Box2D.Common.Math.b2Vec2(I.gravity.x, I.gravity.y), true);\n debugDraw = null;\n debugElement = null;\n debugCanvas = null;\n pendingCollisions = [];\n pendingDestructions = [];\n world.SetContactListener({\n BeginContact: function(contact) {\n var a, b;\n a = contact.GetFixtureA().GetBody().GetUserData();\n b = contact.GetFixtureB().GetBody().GetUserData();\n return pendingCollisions.push([a, b, contact]);\n },\n EndContact: function(contact) {},\n PreSolve: function(contact, oldManifold) {},\n PostSolve: function(contact, impulse) {}\n });\n fireCollisionEvents = function() {\n pendingCollisions.each(function(event) {\n var _ref2, a, b, contact;\n _ref2 = event;\n a = _ref2[0];\n b = _ref2[1];\n contact = _ref2[2];\n a.trigger(\"collision\", b, contact);\n return b.trigger(\"collision\", a, contact);\n });\n return (pendingCollisions = []);\n };\n destroyPhysicsBodies = function() {\n pendingDestructions.each(function(body) {\n return world.DestroyBody(body);\n });\n return (pendingDestructions = []);\n };\n self.bind(\"update\", function() {\n world.Step(1 / I.FPS, 10, 10);\n world.ClearForces();\n fireCollisionEvents();\n return destroyPhysicsBodies();\n });\n self.bind(\"draw\", function(canvas) {\n if (I.PHYSICS_DEBUG_DRAW) {\n if (!(debugDraw)) {\n debugElement = $(\"<canvas width=640 height=480 />\").get(0);\n debugCanvas = debugElement.getContext(\"2d\");\n debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(debugCanvas);\n debugDraw.SetDrawScale(10);\n debugDraw.SetFillAlpha(0.3);\n debugDraw.SetLineThickness(1.0);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n world.SetDebugDraw(debugDraw);\n }\n world.DrawDebugData();\n return canvas.withTransform(I.cameraTransform, function(canvas) {\n return canvas.drawImage(debugElement, 0, 0, debugElement.width, debugElement.height, 0, 0, debugElement.width, debugElement.height);\n });\n }\n });\n self.bind(\"beforeAdd\", function(entityData) {\n return (entityData.world = world);\n });\n self.bind(\"afterAdd\", function(object) {\n return object.bind(\"remove\", function() {\n return pendingDestructions.push(object.body());\n });\n });\n return {};\n });\n})(jQuery);;\n/***\nThe <code>SaveState</code> module provides methods to save and restore the current engine state.\n\n@name SaveState\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.SaveState = function(I, self) {\n var savedState;\n savedState = null;\n return {\n rewind: function() {},\n /***\n Save the current game state and returns a JSON object representing that state.\n\n @name saveState\n @methodOf Engine.SaveState#\n */\n saveState: function() {\n return (savedState = I.objects.map(function(object) {\n return $.extend({}, object.I);\n }));\n },\n /***\n Loads the game state passed in, or the last saved state, if any.\n\n @name loadState\n @methodOf Engine.SaveState#\n @param [newState] The game state to load.\n */\n loadState: function(newState) {\n if (newState || (newState = savedState)) {\n I.objects.invoke(\"trigger\", \"remove\");\n I.objects = [];\n return newState.each(function(objectData) {\n return self.add($.extend({}, objectData));\n });\n }\n },\n /***\n Reloads the current engine state, useful for hotswapping code.\n\n @name reload\n @methodOf Engine.SaveState#\n */\n reload: function() {\n var oldObjects;\n oldObjects = I.objects;\n I.objects = [];\n return oldObjects.each(function(object) {\n object.trigger(\"remove\");\n return self.add(object.I);\n });\n }\n };\n};;\n/***\nThe <code>Selector</code> module provides methods to query the engine to find game objects.\n\n@name Selector\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Selector = function(I, self) {\n var instanceMethods;\n instanceMethods = {\n set: function(attr, value) {\n return this.each(function(item) {\n return (item.I[attr] = value);\n });\n }\n };\n return {\n /***\n Get a selection of GameObjects that match the specified selector criteria. The selector language\n can select objects by id, class, or attributes.\n\n To select an object by id use \"#anId\"\n\n To select objects by class use \"MyClass\"\n\n To select objects by properties use \".someProperty\" or \".someProperty=someValue\"\n\n You may mix and match selectors. \"Wall.x=0\" to select all objects of class Wall with an x property of 0.\n\n @name find\n @methodOf Engine#\n @param {String} selector\n @type Array\n */\n find: function(selector) {\n var matcher, results;\n results = [];\n matcher = Engine.Selector.generate(selector);\n I.objects.each(function(object) {\n if (matcher.match(object)) {\n return results.push(object);\n }\n });\n return $.extend(results, instanceMethods);\n }\n };\n};\n$.extend(Engine.Selector, {\n parse: function(selector) {\n return selector.split(\",\").invoke(\"trim\");\n },\n process: function(item) {\n var result;\n result = /^(\\w+)?#?([\\w\\-]+)?\\.?([\\w\\-]+)?=?([\\w\\-]+)?/.exec(item);\n if (result) {\n if (result[4]) {\n result[4] = result[4].parse();\n }\n return result.splice(1);\n } else {\n return [];\n }\n },\n generate: function(selector) {\n var ATTR, ATTR_VALUE, ID, TYPE, components;\n components = Engine.Selector.parse(selector).map(function(piece) {\n return Engine.Selector.process(piece);\n });\n TYPE = 0;\n ID = 1;\n ATTR = 2;\n ATTR_VALUE = 3;\n return {\n match: function(object) {\n var _i, _len, _ref, _ref2, attr, attrMatch, component, idMatch, typeMatch, value;\n _ref = components;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n component = _ref[_i];\n idMatch = (component[ID] === object.I.id) || !component[ID];\n typeMatch = (component[TYPE] === object.I[\"class\"]) || !component[TYPE];\n if (attr = component[ATTR]) {\n if (typeof (_ref2 = (value = component[ATTR_VALUE])) !== \"undefined\" && _ref2 !== null) {\n attrMatch = (object.I[attr] === value);\n } else {\n attrMatch = object.I[attr];\n }\n } else {\n attrMatch = true;\n }\n if (idMatch && typeMatch && attrMatch) {\n return true;\n }\n }\n return false;\n }\n };\n }\n});;\n/***\nThe <code>Shadows</code> module provides a lighting extension to the Engine. Objects that have\nan illuminate method will add light to the scene. Objects that have an true opaque attribute will cast\nshadows.\n\n@name Shadows\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Shadows = function(I, self) {\n var shadowCanvas;\n shadowCanvas = $(\"<canvas width=640 height=480 />\").powerCanvas();\n self.bind(\"draw\", function(canvas) {\n var shadows;\n if (I.ambientLight < 1) {\n shadowCanvas.compositeOperation(\"source-over\");\n shadowCanvas.clear();\n shadowCanvas.fill(\"rgba(0, 0, 0, \" + (1 - I.ambientLight) + \")\");\n shadowCanvas.compositeOperation(\"destination-out\");\n shadowCanvas.withTransform(I.cameraTransform, function(shadowCanvas) {\n return I.objects.each(function(object, i) {\n if (object.illuminate) {\n shadowCanvas.globalAlpha(1);\n return object.illuminate(shadowCanvas);\n }\n });\n });\n shadows = shadowCanvas.element();\n return canvas.drawImage(shadows, 0, 0, shadows.width, shadows.height, 0, 0, shadows.width, shadows.height);\n }\n });\n return {};\n};;\nvar Framerate;\n/***\n@name Framerate\n@constructor\n\nThis object keeps track of framerate and displays it by creating and appending an\nhtml element to the DOM.\n\nOnce created you call snapshot at the end of every rendering cycle.\n*/\nFramerate = function(options) {\n var element, framerateUpdateInterval, framerates, numFramerates, renderTime, self, updateFramerate;\n options || (options = {});\n if (!(options.noDOM)) {\n element = $(\"<div>\", {\n css: {\n color: \"#FFF\",\n fontFamily: \"consolas, 'Courier New', 'andale mono', 'lucida console', monospace\",\n fontWeight: \"bold\",\n paddingLeft: 4,\n position: \"fixed\",\n top: 0,\n left: 0\n }\n }).appendTo('body').get(0);\n }\n numFramerates = 15;\n framerateUpdateInterval = 250;\n renderTime = -1;\n framerates = [];\n updateFramerate = function() {\n var _i, _len, _ref, framerate, rate, tot;\n tot = 0;\n _ref = framerates;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n rate = _ref[_i];\n tot += rate;\n }\n framerate = (tot / framerates.length).round();\n self.fps = framerate;\n if (element) {\n return (element.innerHTML = \"fps: \" + framerate);\n }\n };\n setInterval(updateFramerate, framerateUpdateInterval);\n /***\n @name rendered\n @methodOf Framerate#\n\n Call this method everytime you render.\n */\n return (self = {\n rendered: function() {\n var framerate, newTime, t;\n if (renderTime < 0) {\n return (renderTime = new Date().getTime());\n } else {\n newTime = new Date().getTime();\n t = newTime - renderTime;\n framerate = 1000 / t;\n framerates.push(framerate);\n while ((framerates.length > numFramerates)) {\n framerates.shift();\n }\n return (renderTime = newTime);\n }\n }\n });\n};;\nvar GameObject;\n/***\nThe default base class for all objects you can add to the engine.\n\nGameObjects fire events that you may bind listeners to. Event listeners\nmay be bound with <code>object.bind(eventName, callback)</code>\n\n@name GameObject\n@extends Core\n@constructor\n@instanceVariables age, active, created, destroyed, solid, includedModules, excludedModules\n*/\n/***\nTriggered when the object is created.\n@name create\n@methodOf GameObject#\n@event\n*/\n/***\nTriggered when object is destroyed. Use\nthe destroy event to add particle effects, play sounds, etc.\n\n@name destroy\n@methodOf GameObject#\n@event\n*/\n/***\nTriggered every update step.\n\n@name step\n@methodOf GameObject#\n@event\n*/\n/***\nTriggered when the object is removed from\nthe engine. Use the remove event to handle any clean up.\n\n@name remove\n@methodOf GameObject#\n@event\n*/\nGameObject = function(I) {\n var autobindEvents, defaultModules, modules, self;\n I || (I = {});\n /***\n @name I\n @memberOf GameObject#\n */\n $.reverseMerge(I, {\n age: 0,\n active: true,\n created: false,\n destroyed: false,\n solid: false,\n includedModules: [],\n excludedModules: []\n });\n self = Core(I).extend({\n /***\n Update the game object. This is generally called by the engine.\n\n @name update\n @methodOf GameObject#\n */\n update: function() {\n if (I.active) {\n self.trigger('step');\n I.age += 1;\n }\n return I.active;\n },\n draw: function(canvas) {\n return I.transform ? canvas.withTransform(I.transform, function(canvas) {\n return self.trigger('draw', canvas);\n }) : canvas.withTransform(Matrix.translation(I.x, I.y), function(canvas) {\n return self.trigger('draw', canvas);\n });\n },\n /***\n Destroys the object and triggers the destroyed callback.\n\n @name destroy\n @methodOf GameObject#\n */\n destroy: function() {\n if (!(I.destroyed)) {\n self.trigger('destroy');\n }\n I.destroyed = true;\n return (I.active = false);\n }\n });\n defaultModules = [Bindable, Bounded, Drawable, Durable, Movable];\n modules = defaultModules.concat(I.includedModules.invoke('constantize'));\n modules = modules.without(I.excludedModules.invoke('constantize'));\n modules.each(function(Module) {\n return self.include(Module);\n });\n self.attrAccessor(\"solid\");\n autobindEvents = ['create', 'destroy', 'step'];\n autobindEvents.each(function(eventName) {\n var event;\n return (event = I[eventName]) ? (typeof event === \"function\" ? self.bind(eventName, event) : self.bind(eventName, eval(\"(function() {\" + (event) + \"})\"))) : null;\n });\n if (!(I.created)) {\n self.trigger('create');\n }\n I.created = true;\n return self;\n};\n/***\nConstruct an object instance from the given entity data.\n@name construct\n@memberOf GameObject\n@param {Object} entityData\n*/\nGameObject.construct = function(entityData) {\n return entityData[\"class\"] ? entityData[\"class\"].constantize()(entityData) : GameObject(entityData);\n};;\nvar GameUtil;\nGameUtil = {\n readImageData: function(data, callback) {\n var ctx, getPixelColor, img;\n getPixelColor = function(imageData, x, y) {\n var index;\n index = (x + y * imageData.width) * 4;\n return [imageData.data[index + 0], imageData.data[index + 1], imageData.data[index + 2]].invoke(\"toColorPart\").join('');\n };\n ctx = document.createElement('canvas').getContext('2d');\n img = new Image();\n img.onload = function() {\n var colors, imageData;\n ctx.drawImage(img, 0, 0);\n imageData = ctx.getImageData(0, 0, img.width, img.height);\n colors = [];\n img.height.times(function(y) {\n return img.width.times(function(x) {\n return colors.push(getPixelColor(imageData, x, y));\n });\n });\n return callback({\n colors: colors,\n width: img.width,\n height: img.height\n });\n };\n return (img.src = data);\n }\n};;\nvar Heavy;\nHeavy = function(I) {\n I || (I = {});\n $.reverseMerge(I, {\n gravity: 0.2,\n maxSpeed: 5\n });\n return {\n before: {\n update: function() {\n return (I.velocity = I.velocity.add(Point(0, I.gravity)));\n }\n }\n };\n};;\nvar Hittable;\nHittable = function(I, self) {\n I || (I = {});\n $.reverseMerge(I, {\n health: 25\n });\n return {\n hit: function() {\n I.health--;\n if (I.health < 0) {\n return self.destroy();\n }\n }\n };\n};;\nvar Movable;\nMovable = function(I) {\n $.reverseMerge(I, {\n acceleration: Point(0, 0),\n velocity: Point(0, 0)\n });\n I.acceleration = Point(I.acceleration.x, I.acceleration.y);\n I.velocity = Point(I.velocity.x, I.velocity.y);\n return {\n before: {\n update: function() {\n var _ref, currentSpeed;\n I.velocity = I.velocity.add(I.acceleration);\n if (typeof (_ref = I.maxSpeed) !== \"undefined\" && _ref !== null) {\n currentSpeed = I.velocity.magnitude();\n if (currentSpeed > I.maxSpeed) {\n I.velocity = I.velocity.scale(I.maxSpeed / currentSpeed);\n }\n }\n I.x += I.velocity.x;\n return I.y += I.velocity.y;\n }\n }\n };\n};;\n(function($) {\n var SCALE, _ref, b2Body, b2BodyDef, b2CircleShape, b2Fixture, b2FixtureDef, b2MassData, b2PolygonShape, b2Vec2, b2World;\n SCALE = 0.1;\n _ref = Box2D.Common.Math;\n b2Vec2 = _ref.b2Vec2;\n _ref = Box2D.Dynamics;\n b2BodyDef = _ref.b2BodyDef;\n b2Body = _ref.b2Body;\n b2FixtureDef = _ref.b2FixtureDef;\n b2Fixture = _ref.b2Fixture;\n b2World = _ref.b2World;\n _ref = Box2D.Collision.Shapes;\n b2PolygonShape = _ref.b2PolygonShape;\n b2CircleShape = _ref.b2CircleShape;\n b2MassData = _ref.b2MassData;\n /***\n The Physical module, when included in a GameObject, gives the object a\n physical presence in the Box2D physics simulation of the engine.\n\n @name Physical\n @module\n @constructor\n\n @param {Object} I Instance variables\n @param {Object} self Reference to including object\n */\n return (window.Physical = function(I, self) {\n var body, bodyDef, center, fixDef;\n $.reverseMerge(I, {\n density: 1.0,\n dynamic: false,\n friction: 0.1,\n restitution: 0.5,\n rotatable: false\n });\n fixDef = new b2FixtureDef();\n fixDef.density = I.density;\n fixDef.friction = I.friction;\n fixDef.restitution = I.restitution;\n fixDef.shape = new b2PolygonShape();\n fixDef.shape.SetAsBox(I.width / 2 * SCALE, I.height / 2 * SCALE);\n bodyDef = new b2BodyDef();\n if (I.dynamic) {\n bodyDef.type = b2Body.b2_dynamicBody;\n bodyDef.fixedRotation = !I.rotatable;\n } else {\n bodyDef.type = b2Body.b2_staticBody;\n }\n center = self.center().scale(SCALE);\n bodyDef.position = new b2Vec2(center.x, center.y);\n if (I.rotation) {\n bodyDef.angle = I.rotation;\n }\n body = I.world.CreateBody(bodyDef);\n body.CreateFixture(fixDef);\n body.SetUserData(self);\n self.bind(\"step\", function() {\n I.x = (body.GetPosition().x / SCALE) - (I.width / 2);\n I.y = (body.GetPosition().y / SCALE) - (I.height / 2);\n return (I.rotation = body.GetAngle());\n });\n return {\n applyImpulse: function(vector) {\n return body.ApplyImpulse(new b2Vec2(vector.x, vector.y), body.GetPosition());\n },\n body: function() {\n return body;\n }\n };\n });\n})(jQuery);;\nvar Rotatable;\nRotatable = function(I) {\n I || (I = {});\n $.reverseMerge(I, {\n rotation: 0,\n rotationalVelocity: 0\n });\n return {\n before: {\n update: function() {\n return I.rotation += I.rotationalVelocity;\n }\n }\n };\n};;\nvar SpeechBox;\nSpeechBox = function(I) {\n var addLine, chars, counter, grad, line, self, stringLine, text;\n I || (I = {});\n $.reverseMerge(I, {\n backgroundColor: 'rgb(175, 175, 175)',\n strokeColor: '#000',\n strokeWidth: 5,\n textColor: 'rgb(0, 0, 0)',\n textDelay: 1,\n gradient: true,\n height: 50,\n padding: 15,\n width: 400,\n text: \"This is a test blah blah blh blah This is a test blah blah blah blah This is a test blah blah blah blah This is a test blah blah blah blah\",\n x: 50,\n y: 40\n });\n chars = I.text.split(\"\");\n text = [[]];\n line = 1;\n addLine = function() {\n line++;\n return (text[line - 1] = []);\n };\n stringLine = function(line) {\n return text[line - 1].join(\"\");\n };\n counter = 0;\n if (I.gradient) {\n grad = Game.canvas.createLinearGradient(0, 0, 0, 3 * I.height);\n grad.addColorStop(0, I.backgroundColor);\n grad.addColorStop(1, 'rgb(0, 0, 0)');\n }\n return (self = {\n draw: function(canvas) {\n if (I.gradient) {\n canvas.context().fillStyle = grad;\n } else {\n canvas.fillColor(I.backgroundColor);\n }\n canvas.strokeColor(I.strokeColor);\n canvas.fillRoundRect(I.x + I.strokeWidth / 2, I.y + I.strokeWidth / 2, I.width - I.strokeWidth, I.height, 20, I.strokeWidth);\n canvas.fillColor(I.textColor);\n return (line).times(function(i) {\n return canvas.fillText(stringLine(i + 1), I.x + I.padding, I.y + (15 * (i + 1)));\n });\n },\n update: function() {\n var currentChar;\n counter = (counter + 1) % I.textDelay;\n if (counter <= 0) {\n currentChar = chars.shift();\n text[line - 1].push(currentChar);\n return Game.canvas.measureText(stringLine(line)) > I.width - I.padding * 2 ? addLine() : null;\n }\n }\n });\n};;\n/***\n@name Sprite\n@constructor\n*/\n(function() {\n var LoaderProxy, Sprite, fromPixieId, pixieSpriteImagePath;\n LoaderProxy = function() {\n return {\n draw: $.noop,\n fill: $.noop,\n frame: $.noop,\n update: $.noop,\n width: null,\n height: null\n };\n };\n Sprite = function(image, sourceX, sourceY, width, height) {\n sourceX || (sourceX = 0);\n sourceY || (sourceY = 0);\n width || (width = image.width);\n height || (height = image.height);\n return {\n /***\n Draw this sprite on the given canvas at the given position.\n\n @name draw\n @methodOf Sprite#\n\n @param canvas\n @param x\n @param y\n */\n draw: function(canvas, x, y) {\n return canvas.drawImage(image, sourceX, sourceY, width, height, x, y, width, height);\n },\n fill: function(canvas, x, y, width, height, repeat) {\n var pattern;\n repeat || (repeat = \"repeat\");\n pattern = canvas.createPattern(image, repeat);\n canvas.fillColor(pattern);\n return canvas.fillRect(x, y, width, height);\n },\n width: width,\n height: height\n };\n };\n Sprite.load = function(url, loadedCallback) {\n var img, proxy;\n img = new Image();\n proxy = LoaderProxy();\n img.onload = function() {\n var tile;\n tile = Sprite(this);\n $.extend(proxy, tile);\n return loadedCallback ? loadedCallback(proxy) : null;\n };\n img.src = url;\n return proxy;\n };\n pixieSpriteImagePath = \"http://pixieengine.com/s3/sprites/\";\n fromPixieId = function(id, callback) {\n return Sprite.load(pixieSpriteImagePath + id + \"/original.png\", callback);\n };\n window.Sprite = function(name, callback) {\n var id;\n if (App.Sprites) {\n id = App.Sprites[name];\n return id ? fromPixieId(id, callback) : warn(\"Could not find sprite named: '\" + name + \"' in App.\");\n } else {\n return window.Sprite.fromURL(name, callback);\n }\n };\n /***\n A sprite that draws nothing.\n\n @name EMPTY\n @fieldOf Sprite\n @constant\n @type Sprite\n */\n /***\n A sprite that draws nothing.\n\n @name NONE\n @fieldOf Sprite\n @constant\n @type Sprite\n */\n window.Sprite.EMPTY = (window.Sprite.NONE = LoaderProxy());\n /***\n Loads a sprite with the given pixie id.\n\n @name fromPixieId\n @methodOf Sprite\n\n @param id\n @param [callback]\n\n @type Sprite\n */\n window.Sprite.fromPixieId = fromPixieId;\n /***\n Loads a sprite from a given url.\n\n @name fromURL\n @methodOf Sprite\n\n @param {String} url\n @param [callback]\n\n @type Sprite\n */\n window.Sprite.fromURL = Sprite.load;\n /***\n Loads a sprite with the given name.\n\n @name loadByName\n @methodOf Sprite\n\n @param {String} name\n @param [callback]\n\n @type Sprite\n */\n return (window.Sprite.loadByName = function(name, callback) {\n var url;\n url = (\"\" + (BASE_URL) + \"/images/\" + (name) + \".png\");\n return Sprite.load(url, callback);\n });\n})();;\n(function() {\n var Map, fromPixieId, loadByName;\n Map = function(data, entityCallback) {\n var loadEntities, spriteLookup, tileHeight, tileWidth;\n tileHeight = data.tileHeight;\n tileWidth = data.tileWidth;\n spriteLookup = {};\n data.tileset.each(function(tileData, i) {\n return (spriteLookup[i] = Sprite.fromURL(tileData.src));\n });\n loadEntities = function() {\n if (!(entityCallback)) {\n return null;\n }\n return data.layers.each(function(layer, layerIndex) {\n if (!(layer.name.match(/entities/i))) {\n return null;\n }\n return layer.tiles.each(function(row, y) {\n return row.each(function(tileIndex, x) {\n var entityData;\n if (spriteLookup[tileIndex]) {\n entityData = $.extend({\n layer: layerIndex,\n sprite: spriteLookup[tileIndex],\n tileIndex: tileIndex,\n x: x * tileWidth,\n y: y * tileHeight\n }, data.tileset[tileIndex] == null ? undefined : data.tileset[tileIndex].properties);\n return entityCallback(entityData);\n }\n });\n });\n });\n };\n loadEntities();\n return $.extend(data, {\n draw: function(canvas, x, y) {\n return canvas.withTransform(Matrix.translation(x, y), function() {\n return data.layers.each(function(layer) {\n if (layer.name.match(/entities/i)) {\n return null;\n }\n return layer.tiles.each(function(row, y) {\n return row.each(function(tileIndex, x) {\n var sprite;\n return (sprite = spriteLookup[tileIndex]) ? sprite.draw(canvas, x * tileWidth, y * tileHeight) : null;\n });\n });\n });\n });\n }\n });\n };\n window.Tilemap = function(name, callback, entityCallback) {\n return fromPixieId(App.Tilemaps[name], callback, entityCallback);\n };\n fromPixieId = function(id, callback, entityCallback) {\n var proxy, url;\n url = (\"http://pixieengine.com/s3/tilemaps/\" + (id) + \"/data.json\");\n proxy = {\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Map(data, entityCallback));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n loadByName = function(name, callback, entityCallback) {\n var proxy, url;\n url = (\"\" + (BASE_URL) + \"/data/\" + (name) + \".tilemap\");\n proxy = {\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Map(data, entityCallback));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n window.Tilemap.fromPixieId = fromPixieId;\n return (window.Tilemap.load = function(options) {\n if (options.pixieId) {\n return fromPixieId(options.pixieId, options.complete, options.entity);\n } else if (options.name) {\n return loadByName(options.name, options.complete, options.entity);\n }\n });\n})();;\n;$(function(){ undefined });","docSelector":"#file_lib_gamelib_js","extension":"js","language":"javascript","hidden":false,"type":"text","size":870895,"mtime":1304142717}]},{"name":"data","files":[{"name":"final_cave","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApklEQVRYR2MsYWb/zzCAgHHQOMAvPJyu4bBp5UqwffAQsBQTYxB1dKS5I66/eMagKSHFgNUBNLcdaAHMk6MOGA2B0RAYDYHREBgNgdEQGA2BwRcCoNYQqFlGazB4W0QDHgL2OjoMV69eZVAVFaVpLOCMggEPAXokQJAniQ6B269f0yQ6cDoAlAYOXrkCzorHX71iQOdTM4RAjsAoiGia8vAYPuC9YwB+XJjBwEHLkAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB90lEQVRYR62XO04EMRBEdxO+EhIBByLkDByBjIOQcQTOQMiBCJCQ+Cag1tKjmnKV3V4xye6O7a7X1W3P7HbzD9fz4dnPxdfrdp9QclEEzGAcmMfU3LyHax1kA4ABA4KD9LLMuQiQwi6pFQCLzwCEuILHzJUzXYBR9ijK2TN8/J4GwCCuNGw3l0iBYdzGAZeJs7fS+emUckyWQNWzIqTmTDuwr5Bb55JJsOEumAU6vfvevN0eLMumALBTOVAFJNbEhQA9Z2JscQAPjAyEwTh4AiIoQ7skcHuvAEIQxRkgM0MY/q7muK25ciDtD7r3+6PlWRABVfYODsXQJZzfdSBdQGElplzg+nN5FIQtgcrcwbHFqgnV7miaUPWAyirvcb+4plVNbc8BFbQSWG03LuN0CZwjlTNBucQH1LAEvKWqwjjP9VJTAncQVUWPry43H49PdrrKXp4DGcH1AiqkaHzmNQvRfRg5CM4WAQIkIJQj6YI8iGIhv3QogBTDTPEeusJuBAC/ZUsHepm7ImfWPJ4Q5R7o1Z5rzdZjH7BTZQC3953YaJdgGaZ6AJ2oiI9KkKAnN5+rsst/RlwGC3B+vYv78rD7jN/5/U+RHeg2YVLi+0DeayBSHGvQEY9pnH1zEGEsBRHjC8gAoLIFuwAxOIQQHehOQpV9LP8Fxxb0MGXNZGgAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"width\":96,\"destinationPosition\":{\"x\":136,\"y\":96},\"destination\":\"house\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sFAQYTLwrCriAAAAHlSURBVFjD7ZQ/aBNRHMc/Zw3Nn0tuiIlFaKF2UxGFIKGWBpeAi11chCzZI24ZhIAYXBRcqqW3mCFDIEOlupUsLjWIIoiCS6kG0obrFdu7tF7Q8hwkD0P904MLLveZHu/3eN/v+73ve+Dj4+Pj4+Pj8w9qmZQY5v7HhmGinE2L/9IFw6ir5WxatOrz9lH3Pu7WjGEYqp67ZpdWmophPFb1XFWK6bmH5IsFFOur6rmBcjYtSitNJcECAO0lXei5CvligdFgVK7rOTYiFpLrPcmAMzkmTSjJO9132ngUIF8sSNE+11/e9T6EwfUOUTUk83D5wLSfLFYGBHuOTc+xeX7lwUBHPDFw48VrRYtFiKohksk4p53vTGsalfuPBgTDG8uHOuJZBoLrHZgcYz9xgsinzUN19aOB8zZA0Fpj8Vmdo9w/gOLmKaqXziE+rLGd1JjY+wbA6u4uAPmFe4SXVjmYPg9AYmZO8fwZmlsmE5EwJ1vbdOMxtJ19rhJgb/Yio52uFH9z87a3GejnoD8eGfnpeyMAmxemsCyL5vJTKf4lFvLeQD8HrUiAz2fG2TkVRzk7hbllAtB99Z7EzJziRtw17UZV/O5brmVScr6WSYl2oyqG0gGA2dKtv87/qT5U2o2qq1P/yg+s+bvB4+/33AAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAeElEQVRYR+2W0QrAIAhF8/8/umXQi2xd0ZgQ19ea93CQpbTikuL8RoB7DfRRMgrNGLygjVCT3TmC2AJkwxUsBaANMhAofAJG9VowT9hbFgHuMeCZeM4ADdDAUQP2nfj9V0wAGlgT7d39vvaO8GsYXWTsdwSggXIDD95jVCHXCwcPAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Text\",\"message\":\"Meow's meow meow meow meow! Meow meow.\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABz0lEQVQ4T2NsrUv4X920gJGBTMAIMgCklxRDCrOD/vdPXQe2FEwQ64pXr/bztDdO/lzi4PZFOjSDF6sBr169AirK+Ayy4dWrqUD23s/IvisuzGZgvHSPQTooFdUFt+8+Y1iwdBfj/1cNPEWNlz6XOLsz9OzdyQDSwM4pCDfjx/ePYHZf/2QGkCVwL4AMAAGQIVlZWTzVLvqf/+mpAf34DywOM0QuTYDh1sQHQAOmoBrw5u0nhvcfvoAVCwrwgGmQ7er5igw3J96HuwBmUFtbC8IAWECCDAEBEWE+Bhi7qqoGLPbz+3sGrmMzGP46VzL8+P4B1QUwA0C0sLAwWMO7d28ZXr/5xFCUl83AwSPIwLr+AMOP82cYOAxNGBqvHwHbDo8FmAHS0tIMT58+BRsAY8NcAvIO17pjDN+CrBh+/fnHoKThimkAzKMwV3BwcICFQHwdHR0wm4OTn6GrqxPTBcjeQHcJzBATU2uwZlAYwVIuSh6AJWuYC0Aa3759yyAlJc3w7NlTsKaWunhwwqppWohIiTCnP7mz9//CRYsx8gXI4P8M/7+ANIEMSIiL45FRcUYNA5AhIANANEwSZjDIgPi4WLA4uhqisjEug0EWAAAnc+IRnlsPrAAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB0klEQVQ4T2Ncbm/yP/LgGUYGMgEjyACQXlIMaXaz+F+76wTYUjBBrCtevVrFMzOm73NCSuwX2bBsXqwGvHr1CqjI7zPIhlevpgLZiz8j+y6xLIeB8dN3BumgVFQX3GFnYQBp+v+qgaclZsfnpIxEhnkz5jOANLBzgC0Dg58/IObN75oCVg82ZX6Cz/8nz96AJUCCoaGhPBMiXT7/5+OGa4QZ4ru/lGGNZR2qAaAweCnMy/D5y3cGlZ9/GGBskO0hx5vAGmAAZtCMpnaEC2Cu+PjpK4MuMxvD16/fGLi5uRiOffzIkFFXCXc617ONDH+VYsDeQPECLCZ+KEowiIiKMHA9eA7WhGwA64W7DD/On2HgMDRhmLxpFdh2eCzADOAx02H4f/Uuw1sxfga5r7/hhoAYidNaGbjWHWP4a6UHFhe18cc0AOQCkEaet58YvgjzMfB/+AZW/NXOkEHL0RkeDmdzqxg8zl9FNQAWDiADQBo/CnCBw4JRWxmu0cI/kAGk+T0fJzzlouQBUGyAXMHHzwfWxMbGxvDm9RtwuHw5dQWsCT3poxjwdM/i/4eaJ2LkC2RNILZdbT6DtEssphdABoBshknC3I6sCV0NUdkYl8EgCwDQ+vARGsMjowAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sFAQYZOp3wokEAAACmSURBVFjD7dIxCsJAEIXhH8khvMUKOYKQ3CJlrhEE+1Rb5A4prL2DxfTTBrFNYyOM1dpniQZkvmar5T0eA8459y9U1bxETolireC2bS2EsPhfsVY4gIj8rsA0Dna63gAIISAi5Cywyy1webyYm/4T3lUlIrJ4hawCMUYDOO/v1HXN3PQ8D0cAuqr8/qVP42DpVVVTVYsxWiq2iXSIm0mrOOecc0u9AYhXSeEiEmvHAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAc0lEQVRYR+2WSQ7AIAgAofFXfX9/1WjVlMSY1ptwGU7cmAxhUQkODa4vAGAAAxjAAAYwgAE9j1SufPe/pOZSc1crrViZvyJPkE8ATxu/AK+V7e1YAni0AgAMYKCv4jbzto7HregyhgZghUeQEID5Luw+Tg+E0T4hlpFxMwAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"end\",\"destinationPosition\":{\"x\":232,\"y\":152},\"mouse\":true,\"keepSprite\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sFARYDJiX6p6UAAACYSURBVCjPpY8xCsJAEEUfkkN4ixVyBCF7i5R7jSDYp9oid0hh7R0spp82iG0aG2FSbTCKSySvGWb4f/4MZFBV4182m4qcMIRgzrnFrMiJAUTkt2HoOztdbwA45xARPhN2783l8WKs21ncVCUiskiZDTFGAzjv73jvGeuW5+EIQFOV3zcPfWepqqqpqsUYLS1aRXp8NSl1ExPS70nhZhd3YgAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Item\",\"cat\":true,\"name\":\"mouse\"}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,5,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,2,-1,-1,4,-1,-1,2,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,10,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1],[1,1,1,1,1,1,3,-1,-1,1,1,1,1,1,1]]}]}","docSelector":"#file_data_final_cave_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":7071,"mtime":1304289996},{"name":"forest","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"http://images.pixie.strd6.com/sprites/7988/original.png?1285018156\"},{\"src\":\"http://images.pixie.strd6.com/sprites/7990/original.png?1285018631\"},{\"src\":\"http://images.pixie.strd6.com/sprites/7992/original.png?1285021850\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlUlEQVRYR+2U2w2AIAxFZTsGdJju4CCOoYkJJmqaPqgt0fILhZPTS8u6zNsUuMpvAADg8Fxrvfh2M5AA4QZa4+8gbhlIgG4DWIh6hyg7AwkQbgALkVsGEmAYA1TPpWFlzwHqYa2hE0BKjgFJ7/kegLQV5gbUANJCKpTcLDx+AbdweAAKsO2/ZkANwC20Omc+CaVgCbADgL3IwaJdTVQAAAAASUVORK5CYII=\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2MMO/q1nmEAAeOoA0ZDgKIQyF/QwDAxoYGSNExeIgRZjAwocATpDkC3HOQQujkAm+V0cQAui2HRQNMQwBXkyOI0cwC+xEZ3B6D7ki4OAMUxrrxONwfgKmVGHTAaAqMhMBoCdA0BQrUhemFFQuVEuEFCquUkVtGEHQCrD0hp+FE1BAhZTGHDlLgQIOQICuRHHTAaAgDN7aABKT3UzwAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"start\",\"autoPosition\":true,\"height\":64}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABfUlEQVRYR2NkGGDASK79Fs1q/0F6T9TeItsMkH6iNdeuLfq/+9oWot1LrMOIcgDMtyDblUXVGO6+vsXgquUDdgzIUSA2NpqYECLoAGyWIwcDzHJksahDXxiW2fHAhfCFBl4HIFuOzwJQqIAAKGRAlruf+8aw04iL4XVGBDhkyHIAuuUwnyJbAPIlLEpgNMgh6CGALyqwhgAun8NCAZsFMDn0KIE5DFco4HQAskHIvkPPBsjBD5ODicGiheQQAGkgFArE5keyQgCbA/AFO3Lwi85YgZIDYHIkRQG6A9ATHnL0ILPRcwCsnCArCrA5Ajlv44oCXCFFcgjALMCVFrAlTGyFEqHSkGBJSGmCJFQnEOUAUh1xvOYmAyMQEJNTiFKEbhAsWgS3ssCltp+4RpZZZGkC2eppoQVuD4CAEB83w9Jdp8kyiyxNIEuj3UzhDgDxRx0wGgKjITAaAnQNAfRCCFYikuMIkktCXJaT64ih5wBiqlhS1JAcAqQYToxaAFyK8CHng9N5AAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3ElEQVRYR+2WyxHCMAxESZOc0wElQAt0kGYoiTtjBofAmOxHYpKDc8pB1j6t5M9wvN3Phw2/oQN0B2wHTtNlnt3r+P4XB5obwqXYmoABggFY8QomQqwDIPEi1ooRIH4DfCdGSdX4l2McABKv9huD+T+AAkWAtwFMO59GiC5gB4gqPnZmGoB4oMzhmwIYrcMHkeKEWH1JnQdgVJ8HYIrnAATEYwDBO6COljcDSeKeA4niOkCw360dzbUgueolCAZAjxJ0UIG7JPYiQuLEM23nDrAVBuKwA4HkzNIO8ACHgqkB8FidPQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"forest-1\",\"height\":64,\"autoPosition\":true}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[7,7,7,7,4,4,4,4,4,4,4,4,4,4,4],[7,7,7,-1,-1,-1,-1,4,4,4,4,4,4,4,4],[7,7,-1,-1,-1,7,-1,-1,-1,-1,4,4,4,4,4],[7,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,4,4],[7,-1,-1,-1,7,-1,-1,-1,-1,-1,7,-1,-1,-1,4],[7,-1,7,-1,-1,-1,-1,7,-1,-1,-1,-1,-1,-1,6],[7,-1,-1,-1,-1,-1,-1,-1,-1,7,-1,-1,-1,-1,-1],[8,-1,-1,-1,7,7,-1,-1,-1,-1,-1,-1,-1,-1,4],[-1,-1,7,7,7,7,7,7,7,7,7,-1,-1,4,4],[7,7,7,7,7,7,7,7,7,7,7,7,4,4,4]]}]}","docSelector":"#file_data_forest_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":4030,"mtime":1304222312},{"name":"stream","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlUlEQVRYR+2U2w2AIAxFZTsGdJju4CCOoYkJJmqaPqgt0fILhZPTS8u6zNsUuMpvAADg8Fxrvfh2M5AA4QZa4+8gbhlIgG4DWIh6hyg7AwkQbgALkVsGEmAYA1TPpWFlzwHqYa2hE0BKjgFJ7/kegLQV5gbUANJCKpTcLDx+AbdweAAKsO2/ZkANwC20Omc+CaVgCbADgL3IwaJdTVQAAAAASUVORK5CYII=\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAm0lEQVRYR2Nkcnv8n2EAAeOoA4Z1CITVCTGsanqHN4XRLA2ALAcBihxArCGUZCKsIQCzmBgfUGI5SC/NooBYh406YDQEhn4IEFPa4csRFIUApZZjLQeoYSixZcBoQUTXEMAVtRQlQmLjGr1WRXYMXRxAs2xIbAiMOoCkEBjwggg5xdLDMVTNBeQ4nmoOwGY5Ma1qqjmA3Cw56gAAiiR7YYZ+cF4AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":0,\"y\":1}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB1UlEQVRYR8VWO04FQQx7DzpKam5CDzdA4jIUXAbp3YADcBKoKekQKCt55edxZjOzSEyznzeZOLaTfceLu/efwz+uIwA8PF0fTs+fKxR9rmCciVkAIDC7VpNjHxeSxSLXykAlydZhVQZiH9ZuAL2k2W8lACOecImQJJOjK0EWXKV4RE4rwUxFI0l577AH/pqFdA64itg80HYGEMfYOdCjk4MdoC0p2F9xPyyBJphhYJcHtiocAVhiQMfz1jTk3yuxXQkq9M74ACC/X29yD+jB2WyofHgca5E8VsMA09b7usUBl/cfB1yd9vHOAeTYKQmAnpMGGCxmL9693F4tYGNxbLxrAACdSoBAPsgxgH2Pb19LwkiOpbGNBIpOdVcQSrvKwucFICfHGQMKAJSh0njGvR7oYhEPNtz4XgH0TMVGi3skzxgCUGaIz+dCFgDVyl07MUtcMap1huVzLAANYodrVdoJW6ywj84GkfazdkNUpDQyldqGykBWROMBV0Fo7tpJ6dc+V8nSNtR2icCoAGB6Dtced57gPekgykYqgnuDCHu43ZhJ7SIG1EgwQytaE5MPkmn/czGQo+kCdfUWA72ucPNAfVFiIOt/97430Nz+3f8JR8C5vb/trAoD7gdYqQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"destination\":\"start\",\"autoPosition\":true,\"width\":64}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAr0lEQVRYR+2WsQ2AMAwEyZLUbMAIsAIbsAwj0aMUQIRI9G9bWEJORRHx5/c7Seq3feocVwqAcCAcEDkwrvM1uctwfwvGmRvDUrgUU0DgAG9VP4EEIBhAy3IlBAfQqvAEIV3AAJBwCYNpB5AhBS78CMC9Ba4AQvEcG5sMuAJ8chDVzgGluK4FCtvLevgMGFQtBzAW51tQew/UMgJcTFwL3AGQW5HcwzlA/hzZHgDhwAH8NpQBF3UsLAAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATElEQVRYR+3RwQ0AIAhDUdh/aL0b0pBgrIfPAm0fGeZLc35QoCOwhm+SGV8XmC4/4cqxSsBW4HawlKgEKIAAAggggAACCCCAAAJPBTZR9RwhrtG+2gAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"cave2\",\"destinationTarget\":{\"x\":32,\"y\":128},\"cat\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAU0lEQVRYR+3WMQ4AIAhDUbj/oWVxciAlDo3xO5u0vDCQYX5pzg8KIIAAAggggMBTAmt4O0jDSZ92sK3ANPiEaodUBChgE7gNlnah2wEKIIDAHwIFrXUPIe5MJAEAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"destination\":\"cave2\",\"destinationPosition\":{\"x\":32,\"y\":128},\"cat\":true,\"keepSprite\":true}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,3,3,1,1,1],[1,1,1,1,1,1,1,1,1,-1,2,2,-1,7,1],[1,1,1,1,1,1,1,1,-1,-1,2,2,-1,-1,1],[1,1,1,1,1,1,-1,-1,-1,-1,2,2,-1,-1,1],[1,1,1,1,1,-1,-1,-1,-1,-1,2,2,-1,-1,1],[1,1,1,-1,-1,-1,-1,-1,-1,-1,2,2,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,2,2,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,2,2,1,1,1],[1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,2,1,1,1],[1,1,1,1,1,1,1,4,-1,1,3,3,1,1,1]]}]}","docSelector":"#file_data_stream_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":4487,"mtime":1304275746},{"name":"cave2-1","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApklEQVRYR2MsYWb/zzCAgHHQOMAvPJyu4bBp5UqwffAQsBQTYxB1dKS5I66/eMagKSHFgNUBNLcdaAHMk6MOGA2B0RAYDYHREBgNgdEQGA2BwRcCoNYQqFlGazB4W0QDHgL2OjoMV69eZVAVFaVpLOCMggEPAXokQJAniQ6B269f0yQ6cDoAlAYOXrkCzorHX71iQOdTM4RAjsAoiGia8vAYPuC9YwB+XJjBwEHLkAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABJ0lEQVRYR8WWOw4CMQxENw0gIXFYDkLHKamhoFmUSJZC1r+xw7IlRPHzeOy4PI6X9Xx7L8/rYdnzqzHrV17300qB/wFRsgpQJlH4BqBJr5WHgmcUVAH6AH2GPdTuCkhQURXNEnAXI11jAYcA0HbVgFkAJEMUZjy/AbAky5bEBKgHEAUQYO7eKR7wAEugbRR7ppgniOUHVgF6CzQIRGYLYuOBPRXg4NIeyJYmNQcipRmB03OAU0BShQNOKSANJe15NhWQXIzUGjnrMmGk1t52dAGg49kbvC2l2Z1wDIZuSFO34siOKCqAGKlXAVaA24p/YTopIXEOZFZtyRf19/HRE7sgWgJ0jrjbEL3Y24opgBleYR8jz4ZEGVqlsv7/ApiREdeSnPno3AcG5wE2JpiEBgAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Lava\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAU0lEQVRYR+3WMQ4AIAhDUbj/oWVxciAlDo3xO5u0vDCQYX5pzg8KIIAAAggggMBTAmt4O0jDSZ92sK3ANPiEaodUBChgE7gNlnah2wEKIIDAHwIFrXUPIe5MJAEAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"keepSprite\":true,\"destination\":\"cave2-2\",\"destinationPosition\":{\"x\":160,\"y\":96}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABCUlEQVRYR+2VMQ6DMAxFzcTGVomNY0XqATgCC3MWjkCFqi5VcxTuwMKG1K0bUyojGWWoiAmuWJKRJP6PF0MSOHkkJ+dDBIgGooFoIBqIBsQNvNPM4gWXXhVk95u3vnfBntvSDad9Poi/AJCB+WngMn82M0QByrK0+vFapfnCcaEYQNd1tu/7JbxtW3Zd9sKtXggNFzFwJPwwgNbajuO4W7trM/gIJMKDDAzDYJumWV9iT8P96iOWAfy8iqKAPM9hmiZQSgFCVFUFxpjlOQ2cr+uaVZdlAMOpOELQmWO4awLn3MGF2CR1w7m/ZILkHo04AIGKAGCxEAvccFYPcNWHrmN3a2iAb9/pAF/m8Wghn8cm3wAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Lever\",\"id\":\"lavaLever\"}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[0,0,0,0,0,0,2,0,0,0,0,0,0,0,0],[0,-1,-1,-1,-1,-1,2,-1,-1,-1,-1,0,-1,0,0],[0,-1,2,2,2,-1,2,2,2,2,-1,-1,-1,0,0],[0,-1,-1,2,-1,-1,-1,0,-1,-1,-1,2,-1,-1,0],[0,0,-1,2,2,2,-1,-1,-1,2,2,2,-1,-1,0],[0,0,-1,-1,-1,2,-1,2,2,2,-1,-1,-1,0,0],[0,-1,-1,0,4,2,-1,2,-1,-1,-1,0,-1,-1,0],[3,-1,-1,2,2,2,2,2,-1,0,-1,-1,2,2,2],[0,0,-1,2,-1,-1,-1,-1,-1,0,0,-1,-1,2,2],[0,0,0,2,0,0,0,0,0,0,0,0,2,2,2]]}]}","docSelector":"#file_data_cave2-1_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":3371,"mtime":1304285354},{"name":"house","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAuklEQVRYR9XV3Q2AIAwEYBjKFVzC+VzCFRxKIZHEGH969Q6CCW8oH7ScMYSwpdHsidM4UAHzsob0TfOG6IC8MoKQABCEDGBFSAEWhBzwhagCeEPELnIAuVbmADgmmkugQpgBX82E7rzMhwAKBAxgI1wAJsINYCH6yAFvh5f33q7wrxIgsCdENcBTz1QF3CGqA66IJoAzohmgIPrIAdWvOJ+CuQQqhBnAyv5reEEABQIGsBEuABPhBrAQO61qipPS+AxuAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApklEQVRYR2MsYWb/zzCAgHHQOMAvPJyu4bBp5UqwffAQsBQTYxB1dKS5I66/eMagKSHFgNUBNLcdaAHMk6MOGA2B0RAYDYHREBgNgdEQGA2BwRcCoNYQqFlGazB4W0QDHgL2OjoMV69eZVAVFaVpLOCMggEPAXokQJAniQ6B269f0yQ6cDoAlAYOXrkCzorHX71iQOdTM4RAjsAoiGia8vAYPuC9YwB+XJjBwEHLkAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB90lEQVRYR62XO04EMRBEdxO+EhIBByLkDByBjIOQcQTOQMiBCJCQ+Cag1tKjmnKV3V4xye6O7a7X1W3P7HbzD9fz4dnPxdfrdp9QclEEzGAcmMfU3LyHax1kA4ABA4KD9LLMuQiQwi6pFQCLzwCEuILHzJUzXYBR9ijK2TN8/J4GwCCuNGw3l0iBYdzGAZeJs7fS+emUckyWQNWzIqTmTDuwr5Bb55JJsOEumAU6vfvevN0eLMumALBTOVAFJNbEhQA9Z2JscQAPjAyEwTh4AiIoQ7skcHuvAEIQxRkgM0MY/q7muK25ciDtD7r3+6PlWRABVfYODsXQJZzfdSBdQGElplzg+nN5FIQtgcrcwbHFqgnV7miaUPWAyirvcb+4plVNbc8BFbQSWG03LuN0CZwjlTNBucQH1LAEvKWqwjjP9VJTAncQVUWPry43H49PdrrKXp4DGcH1AiqkaHzmNQvRfRg5CM4WAQIkIJQj6YI8iGIhv3QogBTDTPEeusJuBAC/ZUsHepm7ImfWPJ4Q5R7o1Z5rzdZjH7BTZQC3953YaJdgGaZ6AJ2oiI9KkKAnN5+rsst/RlwGC3B+vYv78rD7jN/5/U+RHeg2YVLi+0DeayBSHGvQEY9pnH1zEGEsBRHjC8gAoLIFuwAxOIQQHehOQpV9LP8Fxxb0MGXNZGgAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABHElEQVRYR+2W4Q3CIBCFIQ6iU5iYuIZ7dJTu4RomJk5RBzE1r8kZCicHB9iYwM9Ced/dPTis2XjYjfVNB/jPDNyuw3w6Hsz9MZnzZSwKIutnEnaNCwgMLUgSgBsxxBC9P7QgUQAuYgiTWA0QFiAl4logKwBNxKUgC0CNiLUgNuZsrsaSkDTvm5UFIIfHzCYJSfN0h3xK8O14SRuVzAPiZx7gQAMALNrth6UsrTNCV/kqAwRAHmgJEniAHI8M+NdsbRCIQw9a0Qy0AEHToqOfDaAtjd+2iwFyQLg2HQBgw9dznLn6B32X+eB7RHqosAApQrE1BIE10uOkGUDsJLnwACDIpBdRSnbcppZTyg7QM1AtA9q7pCpAymnx17wBOuMryjTuIcUAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAU0lEQVRYR+3WMQ4AIAhDUbj/oWVxciAlDo3xO5u0vDCQYX5pzg8KIIAAAggggMBTAmt4O0jDSZ92sK3ANPiEaodUBChgE7gNlnah2wEKIIDAHwIFrXUPIe5MJAEAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"destination\":\"final_cave\",\"destinationPosition\":{\"x\":240,\"y\":256},\"keepSprite\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApElEQVRYR2NkGGDAOMD2M4w6YDQERkNgNATgIfD34YT/zPIFdA8RsIV3D9X9V5AXAheK9HbEqANGQwAjBFjD1ehaQ486ADMEUoMZGD5dZmDg00WNCnLF0PWh8bE7gI6pAL8DyPU1yAMEfA6TH6QhQAefw2J58IUAHdMf2CqMEBhQBzx4+I7e9qOGAMgBynZNdG0VoUTBgDkAFO4D2iake8QjWQgA8cV/4JXPkp0AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAp0lEQVRYR2NkGGDAOMD2M4w6YDQERkNgNAQGJAT+Ppzwn1m+AGw33R1w91DdfwV5IXABDHLEqANGQ4CRyWLbf3pXyb9X3kIkwlEHMLk9RkTBp8sMDHy6iBghxAepRFdDSAyoHjUKkB1Aj8SA1QGEfEqqL5E9gsXsQRgCMBfTIyQGXRoAVY30SHvY7ADXhgPuAFD9TM8QgLUFRtsDAxYCIIsHtE2Int4AUfGNIVPt7a0AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"width\":96,\"destination\":\"hills\",\"destinationPosition\":{\"x\":352,\"y\":160}}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],[3,3,3,0,0,0,3,3,3,0,0,0,3,3,3],[3,3,3,0,0,0,0,0,0,0,0,0,3,3,3],[3,3,3,0,0,0,0,0,0,0,0,0,3,3,3],[3,3,3,0,0,0,0,0,0,0,0,0,3,3,3],[3,3,3,0,0,0,0,0,0,0,0,0,3,3,3],[3,3,3,0,0,0,0,0,0,0,0,0,3,3,3],[3,3,3,3,3,0,0,0,0,0,3,3,3,3,3]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[-1,-1,-1,-1,-1,1,1,1,1,1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,3,1,1,1,1,1,-1,-1,-1,-1,-1],[-1,-1,4,4,6,1,1,1,1,1,4,4,4,-1,-1],[-1,-1,4,-1,-1,1,2,2,2,1,7,8,4,-1,-1],[-1,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,-1,-1],[-1,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,-1,-1],[-1,-1,4,-1,5,-1,-1,-1,-1,-1,5,-1,4,-1,-1],[-1,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,4,-1,-1],[-1,-1,4,4,4,4,-1,-1,-1,4,4,4,4,-1,-1],[-1,-1,-1,-1,-1,4,9,-1,-1,4,-1,-1,-1,-1,-1]]}]}","docSelector":"#file_data_house_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":5404,"mtime":1304236148},{"name":"forest-1","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABfUlEQVRYR2NkGGDASK79Fs1q/0F6T9TeItsMkH6iNdeuLfq/+9oWot1LrMOIcgDMtyDblUXVGO6+vsXgquUDdgzIUSA2NpqYECLoAGyWIwcDzHJksahDXxiW2fHAhfCFBl4HIFuOzwJQqIAAKGRAlruf+8aw04iL4XVGBDhkyHIAuuUwnyJbAPIlLEpgNMgh6CGALyqwhgAun8NCAZsFMDn0KIE5DFco4HQAskHIvkPPBsjBD5ODicGiheQQAGkgFArE5keyQgCbA/AFO3Lwi85YgZIDYHIkRQG6A9ATHnL0ILPRcwCsnCArCrA5Ajlv44oCXCFFcgjALMCVFrAlTGyFEqHSkGBJSGmCJFQnEOUAUh1xvOYmAyMQEJNTiFKEbhAsWgS3ssCltp+4RpZZZGkC2eppoQVuD4CAEB83w9Jdp8kyiyxNIEuj3UzhDgDxRx0wGgKjITAaAnQNAfRCCFYikuMIkktCXJaT64ih5wBiqlhS1JAcAqQYToxaAFyK8CHng9N5AAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlUlEQVRYR+2U2w2AIAxFZTsGdJju4CCOoYkJJmqaPqgt0fILhZPTS8u6zNsUuMpvAADg8Fxrvfh2M5AA4QZa4+8gbhlIgG4DWIh6hyg7AwkQbgALkVsGEmAYA1TPpWFlzwHqYa2hE0BKjgFJ7/kegLQV5gbUANJCKpTcLDx+AbdweAAKsO2/ZkANwC20Omc+CaVgCbADgL3IwaJdTVQAAAAASUVORK5CYII=\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmUlEQVRYR2MMO/q1nmEAAeOoA0ZDgOIQyF/QwDAxoYHcdExZIgRZDgNkOmKIOgDZ53QPAWyWgxxBlyjAZTldHIDP8gFxACjI6Z4L0PM83R2AXtoMKgeQmQ4oK4hAllIYCqMOGA2B0RAgLQQI1QfIBRWRtSPxDiDFchLaCMQ7AL3QIdQIpHoIELKQTHnSQoBMS/BpG3XAaAgAANu3lwFGOfHaAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"autoPosition\":true,\"height\":64,\"destination\":\"forest\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAjUlEQVQ4T2NkoBAwEtIf7Wb6H6Zm6a7TGOrxGgDSjKwJnQ8yGJ8B/4EaGIAG4FWH1wCY0xmVixj+3+3Dqha7oHIR3N/oYYRuEGag4NEMMwzZEKIM2L80C6zXMXoamMZpANCvOJ0OMgRmALIhKC7AZwCusKCuAeAIp0Ug4otK6qcDZNuQvUNSSiSUQ5HlAfO3QhEJVSs/AAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Item\",\"name\":\"bomb\",\"message\":\"Press 'Enter' to plant bombs.\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABJklEQVRYR+2WPQ4CIRCF2Suo2VgaKys7K3tLL+D5vIClvZWdlZWxNEa9wm7G5BlCYGBYWGKyNNvAvm/e/EClCq+qsL4aAAYH/sOB3WbVxHbL/nhmg/Q6APHt4iliOFzr334OggWIFYcyIDoD4IcSF5I6IPLesjmZA/Tv0aRWn5esHuicC8JbA/fHW82m429cJI4VAoGz0Q6sl/MG4hAOhSBxrNPl5gyUdaA4gDmA9OgpOl8a4EKUAxBHHvENheicAgLQC9BWA5wLSQBIwITo1QFzppjivjpIWgNFUlC0BjADXJMwZCJ2SgEBkAg3CbN2AQBMiN66wOZAr11gqwHzRsyeAl/+s84B200Y6wAFIn6QuLpA8jDRW1gM4LqM9Inou46xl3sRtasf/SFUtqSBAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA00lEQVRYR2NkwAGi3Uz/g6QevHjLoCAhDKeFRMRQdLx78wqrCSB9MHD00j1GXPbglAA5AGY5sma6OgA5BGCOoLsD8PkeJIcrCmCOB9FkR8GAh8CApgFrPaX/yKkfFBro8U/TKAA5AGQByBEDkgtgDkB3BN1yAbYQoHsUoKcBbOmAZiUhLBEOWDkAshhWH1CSCPEVQiBzcdYFMEsJOQJfSbh012mC5hNUgOx7ZMeAEiSy5cRYhq1GJMkBuKpUSsRHHTAaAqMhMBoCoyEwGgKjITAaAgCQNaghvOv0oAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\",\"height\":12}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,-1,-1,0,0,0,0,-1,-1,0,0,0,0],[0,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,0,0,0],[0,-1,-1,0,-1,-1,-1,-1,-1,0,-1,-1,-1,0,0],[0,0,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,0,0],[0,0,0,5,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,0],[0,0,-1,6,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,0],[0,-1,4,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,3],[0,0,-1,0,0,0,0,0,0,-1,0,-1,-1,-1,-1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","docSelector":"#file_data_forest-1_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":4323,"mtime":1304292766},{"name":"cave2-2a","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAi0lEQVRYR2Nk1Gz5zzCAgHHQOCA2Noau4bB48RKwffAQ0NbWZjAyMqS5I86dOw+2B6sDaG470AKYJ0cdMBoCoyEwGgKjITAaAqMhMBoCgy8EQK0hULOM1mDwtogGRQhcvXqV5tGAMwoGRQjQOgGCzCc6BGgVHXhzAcxSXDS1Qghrz4hahpNqzoD3jgGFuZ7BvgvVAAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB1UlEQVRYR8VWO04FQQx7DzpKam5CDzdA4jIUXAbp3YADcBKoKekQKCt55edxZjOzSEyznzeZOLaTfceLu/efwz+uIwA8PF0fTs+fKxR9rmCciVkAIDC7VpNjHxeSxSLXykAlydZhVQZiH9ZuAL2k2W8lACOecImQJJOjK0EWXKV4RE4rwUxFI0l577AH/pqFdA64itg80HYGEMfYOdCjk4MdoC0p2F9xPyyBJphhYJcHtiocAVhiQMfz1jTk3yuxXQkq9M74ACC/X29yD+jB2WyofHgca5E8VsMA09b7usUBl/cfB1yd9vHOAeTYKQmAnpMGGCxmL9693F4tYGNxbLxrAACdSoBAPsgxgH2Pb19LwkiOpbGNBIpOdVcQSrvKwucFICfHGQMKAJSh0njGvR7oYhEPNtz4XgH0TMVGi3skzxgCUGaIz+dCFgDVyl07MUtcMap1huVzLAANYodrVdoJW6ywj84GkfazdkNUpDQyldqGykBWROMBV0Fo7tpJ6dc+V8nSNtR2icCoAGB6Dtced57gPekgykYqgnuDCHu43ZhJ7SIG1EgwQytaE5MPkmn/czGQo+kCdfUWA72ucPNAfVFiIOt/97430Nz+3f8JR8C5vb/trAoD7gdYqQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"destination\":\"cave2-2\",\"autoPosition\":true,\"width\":192}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAm0lEQVRYR2Nkcnv8n2EAAeOoA4Z1CITVCTGsanqHN4XRLA2ALAcBihxArCGUZCKsIQCzmBgfUGI5SC/NooBYh406YDQEhn4IEFPa4csRFIUApZZjLQeoYSixZcBoQUTXEMAVtRQlQmLjGr1WRXYMXRxAs2xIbAiMOoCkEBjwggg5xdLDMVTNBeQ4nmoOwGY5Ma1qqjmA3Cw56gAAiiR7YYZ+cF4AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":0,\"y\":-0.2}}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1,1,1],[1,-1,-1,-1,-1,-1,1,1,-1,1,-1,-1,-1,-1,1],[1,1,-1,-1,-1,1,1,-1,-1,-1,1,-1,-1,-1,1],[1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,1],[1,1,1,1,-1,-1,-1,1,-1,-1,-1,1,-1,1,1],[1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1],[1,1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,1],[1,1,1,1,1,3,-1,2,2,-1,-1,1,1,1,1]]}]}","docSelector":"#file_data_cave2-2a_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":3338,"mtime":1304283596},{"name":"bridge_room","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"http://images.pixie.strd6.com/sprites/7988/original.png?1285018156\"},{\"src\":\"http://images.pixie.strd6.com/sprites/7990/original.png?1285018631\"},{\"src\":\"http://images.pixie.strd6.com/sprites/7992/original.png?1285021850\"},{\"src\":\"http://images.pixie.strd6.com/sprites/8023/original.png?1285032379\"},{\"src\":\"http://images.pixie.strd6.com/sprites/7995/original.png?1285025870\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAuklEQVRYR9XV3Q2AIAwEYBjKFVzC+VzCFRxKIZHEGH969Q6CCW8oH7ScMYSwpdHsidM4UAHzsob0TfOG6IC8MoKQABCEDGBFSAEWhBzwhagCeEPELnIAuVbmADgmmkugQpgBX82E7rzMhwAKBAxgI1wAJsINYCH6yAFvh5f33q7wrxIgsCdENcBTz1QF3CGqA66IJoAzohmgIPrIAdWvOJ+CuQQqhBnAyv5reEEABQIGsBEuABPhBrAQO61qipPS+AxuAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABCUlEQVRYR+2VMQ6DMAxFzcTGVomNY0XqATgCC3MWjkCFqi5VcxTuwMKG1K0bUyojGWWoiAmuWJKRJP6PF0MSOHkkJ+dDBIgGooFoIBqIBsQNvNPM4gWXXhVk95u3vnfBntvSDad9Poi/AJCB+WngMn82M0QByrK0+vFapfnCcaEYQNd1tu/7JbxtW3Zd9sKtXggNFzFwJPwwgNbajuO4W7trM/gIJMKDDAzDYJumWV9iT8P96iOWAfy8iqKAPM9hmiZQSgFCVFUFxpjlOQ2cr+uaVZdlAMOpOELQmWO4awLn3MGF2CR1w7m/ZILkHo04AIGKAGCxEAvccFYPcNWHrmN3a2iAb9/pAF/m8Wghn8cm3wAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Lever\",\"id\":\"bridgeLever\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB5klEQVRYR+2VWUvEQBCEd1G87/u+T8QX//8PERQUF8H1WK9FPJBYH1RLCOpDEtmXDBQ9mYSp6uqeSb3W4VHvMH+tElA5UDlQOVA5UDnw7w4kSTL3xw+vXZoAEQ1liCAe9NqU44Dii+fEm8ICTAx5CIB0V+gTLgVILxwh5fl7FBJge9OZp8nHzPLq+KDIGs/EdeEutwBnHvVt24F9xflUgjOa9/rduyJA8IYwIrTKEBDkq9rwyIRPitMWsqT44Tn20w8Iw61GGQKCaFsbUnfAIMNJEzHHdtwY9RrfHBcVcJjKjOmiiUJUj9+TMcABgJA34ayogE1vGN2NoKg7BIDSUALq3m1BXRbRLEMANb0VOHo0JS48C9cCAqk19vPu0QImLOC+DAEr2qzfG0OEA5Bz3GYF6h+d39ScvuCbYSG/AAh1FLcUOHrjJmQZETTilYD9ZJ09njt24Dy3AxZAZtR92aRkHaR0ewzKtOcHGpDv6Yf8TRg7+zbkVgsRlIR7ADGIgBDbWaf2nwJ9gvjTQg78IIK7gLozOAHUn0EzQo5ISkLJKFXxn1FKBBlBxGmIPiB7RHAfUAIEtAQakCs7/zEM4mxM/f8P9I5LByK6HnFrAn9IBCwI+X9GvwlIr2fEIAAHTvwN5Wp8Ab5seI7u58EbAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"destination\":\"hills\",\"destinationPosition\":{\"x\":256,\"y\":224},\"keepSprite\":true,\"cat\":true}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[7,7,7,7,7,6,6,6,6,6,7,7,7,7,7],[7,7,7,7,7,6,6,6,6,6,7,7,7,7,7],[7,7,7,7,7,6,6,6,6,6,7,7,7,7,7],[7,7,7,7,7,6,6,6,6,6,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,6,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,5,5,5,5,5,5,5,-1,-1,-1,-1],[-1,-1,-1,-1,5,-1,-1,-1,-1,-1,5,-1,-1,-1,-1],[-1,-1,-1,-1,5,-1,8,-1,-1,-1,5,-1,-1,-1,-1],[-1,-1,-1,-1,5,-1,-1,-1,-1,-1,5,-1,-1,-1,-1],[-1,-1,-1,-1,5,-1,-1,-1,-1,-1,9,-1,-1,-1,-1],[-1,-1,-1,-1,5,5,5,5,5,5,5,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]}]}","docSelector":"#file_data_bridge_room_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":4149,"mtime":1304275382},{"name":"cave2-2","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAi0lEQVRYR2Nk1Gz5zzCAgHHQOCA2Noau4bB48RKwffAQ0NbWZjAyMqS5I86dOw+2B6sDaG470AKYJ0cdMBoCoyEwGgKjITAaAqMhMBoCgy8EQK0hULOM1mDwtogGRQhcvXqV5tGAMwoGRQjQOgGCzCc6BGgVHXhzAcxSXDS1Qghrz4hahpNqzoD3jgGFuZ7BvgvVAAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAm0lEQVRYR2Nkcnv8n2EAAeOoA4Z1CITVCTGsanqHN4XRLA2ALAcBihxArCGUZCKsIQCzmBgfUGI5SC/NooBYh406YDQEhn4IEFPa4csRFIUApZZjLQeoYSixZcBoQUTXEMAVtRQlQmLjGr1WRXYMXRxAs2xIbAiMOoCkEBjwggg5xdLDMVTNBeQ4nmoOwGY5Ma1qqjmA3Cw56gAAiiR7YYZ+cF4AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":0.125,\"y\":0.125}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB1UlEQVRYR8VWO04FQQx7DzpKam5CDzdA4jIUXAbp3YADcBKoKekQKCt55edxZjOzSEyznzeZOLaTfceLu/efwz+uIwA8PF0fTs+fKxR9rmCciVkAIDC7VpNjHxeSxSLXykAlydZhVQZiH9ZuAL2k2W8lACOecImQJJOjK0EWXKV4RE4rwUxFI0l577AH/pqFdA64itg80HYGEMfYOdCjk4MdoC0p2F9xPyyBJphhYJcHtiocAVhiQMfz1jTk3yuxXQkq9M74ACC/X29yD+jB2WyofHgca5E8VsMA09b7usUBl/cfB1yd9vHOAeTYKQmAnpMGGCxmL9693F4tYGNxbLxrAACdSoBAPsgxgH2Pb19LwkiOpbGNBIpOdVcQSrvKwucFICfHGQMKAJSh0njGvR7oYhEPNtz4XgH0TMVGi3skzxgCUGaIz+dCFgDVyl07MUtcMap1huVzLAANYodrVdoJW6ywj84GkfazdkNUpDQyldqGykBWROMBV0Fo7tpJ6dc+V8nSNtR2icCoAGB6Dtced57gPekgykYqgnuDCHu43ZhJ7SIG1EgwQytaE5MPkmn/czGQo+kCdfUWA72ucPNAfVFiIOt/97430Nz+3f8JR8C5vb/trAoD7gdYqQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACG0lEQVRYR8VXMVIDMQx0SEcJLc+go6CDmiYzvIIfUPADHsEwQ0NNScFLoIUyHQMnY5mVLNk6wiTXZOL4pNVqtXYWe2evX2mHz+KvAFbXB+nh5iMEvbe3ApgTMJS1swlzDRmgzfSMqo3u07iGADatdvT+1gFoprYOwGyB27/355QOT0csbvR7ZmA0AQyQxcj7cf3+ZD9dvqxDgkXE3RZwAgq+PH9LHhAKiL/h1IymwwSgGRkxFO2BFacBoKsMBTe0ottEPmKxIQD06LL6bZqTA4YL0e80VlxpgkAIDGnUfe85Ju21hNowoBEKVhgUfdJDI1rWTBF2xpgLEQyw2nNwCJxB6aQ9cUzAzHYqVimuz8C0eXV78XMIcfKSVKyzUak9xA4K0WJWANCI6/erx99aS1DuJfZUiAzYwt5bohUtyCKihKWqz6ejtDy+k/0m05mY0WbTjBm2rBhVZRPsvQLIySa3q4/VAhCdaIshxlotxHGNiGnK1arDpxGTqkzrg96vxSjhauao2L4VqxHDM4Fa1YjRmhzFjmtETH0z9zzvMHbuzKM+ULwlRvgsYEGZ8w/jRXGt6cH+V8NyfKN7GAlrdVyt6qcc101yYEUYXQHk3ges0wwdkp2yKUwBHZ2u4QsJ33YEK5wdkzqHmOfcsy6llr/rCueckO4Yemhx3aKW19iihR6cy+1O/pphIbNaEGEmuqe5D0Rf/M99BOIbIaThVtoR+y8AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"keepSprite\":true,\"destination\":\"stream\",\"destinationPosition\":{\"x\":336,\"y\":32}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3ElEQVRYR2Nkcnv8n2EAAeOoA4Z1CITVCTGsanqHN4XRLA2ALAcBihxArCGUZCKsIQCzmBgfUGI5SC/NooBYh1HsgH+7ZBmAOYlY+zDUUeQAkOUwQK4jyHYAzOfoNKlBQZYDkIMdF5tYh5DsAPQ4J8Qn5BCSHYBu4IAmQlB5scKGm7q5gJjyGzkUBjQEQA4ZdQCxIYAraumSC9BrVWTH0MUB+MoCih1AqKAhJD/qAIwQILUgIhTEhOSxOgDWFKOHY6iaBpCzG7GOp5oDsFlOTKuaag4gFNe45EcdAADGv65hOb3vFAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":0,\"y\":-0.25}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA30lEQVRYR+3WzQ2DMAwFYOgI3LsOI3ScHhiHEbpO7x0BqA+WIkii5/hBJBQuXCD+4p9A/xi/a1fx6hvg1hl4vYdunn7ZDjutByS4XC4AuohniKIZ0MDIDjzB5d3TSoDCIMDyeUbX+08QGif5nBnACBpqYIAElkxUA4RqJgLKgATX3Ws/sBBmgGLkLgjktMt1ahFgj/CMwgFg2RGjHHAGUrv0ItwAbzkoAASRKi0NkGvE/Vc1xFwCoIyhZ9QawJQBy0HEKEv0JNRfsSsw1CkIxw3F0wCx4MhfNQ1Q2g8NsAHrMqVhdIwKKAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":-0.125,\"y\":-0.125}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAyklEQVRYR2Nkcnv8n2EAAeOoA4Z1CITVCTGsanqHN4XRLA2ALAcBihxArCGUZCKsIQCzmBgfUGI5SC/NooBYh406YGiHwL9dsjijGljAEZUMqB4CMEfRzQHIpR1yiNDFATDL0S0G8cl2ADHlN3LkYgtyihxAVMqBKsIV3zR3AKG4pqkDSE3lsBDFFbUkZUNKLEeu2JAdQ5IDSEkfxKoddcDgCwFSCyJi4xqXOowQQG4H0sMxVI0CchxPNQdgs5yYVjXVHEBuWhh1AADDkKJhFzQcHwAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":0.125,\"y\":-0.125}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA0klEQVRYR+2Wyw2EMAxEYUvgTjtbwpbDgXIogXa4UwIfI1mKwARPYlgJmSsm8zz+kPLzHebij0/pAK924NdURdeO0Q67rQdInJ4sAO0hOUMkOsDCmgxyxOnb20qgBXMAdyDZgamvtz5bN6m238S4JAASZ2HNtosRwgCW4uIeiGXEtqOex8oEORBmj0KcxUMAdIg1BAzAEOgEnJU2CQC1f/9XDWEeATAdQzT7q3h34OBA7mq9snz/XgTgq9gTMKY9EI6bFt4MQBLX3KrNANDac7wDLEsHkGGMUoP1AAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Stream\",\"flow\":{\"x\":-0.2,\"y\":0}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"destination\":\"cave2-2a\",\"autoPosition\":true,\"width\":196}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[1,1,1,1,1,9,-1,3,3,-1,-1,1,1,1,1],[1,1,1,-1,-1,-1,-1,2,2,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,2,2,2,2,-1,-1,-1,-1,1],[1,-1,-1,-1,-1,2,2,2,2,2,2,-1,-1,-1,1],[1,1,-1,-1,2,2,2,2,2,2,2,2,-1,1,1],[1,1,-1,-1,-1,2,2,2,2,2,4,8,-1,1,1],[1,1,-1,1,-1,-1,2,2,-1,7,5,6,-1,-1,1],[1,1,1,1,-1,-1,-1,-1,-1,1,5,-1,-1,-1,1],[1,1,1,1,1,-1,-1,-1,1,1,1,-1,-1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]}]}","docSelector":"#file_data_cave2-2_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":6121,"mtime":1304283545},{"name":"end","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAbklEQVRYR+2WSQoAIAwD7f8f7XIQRIQ2eijC9GpswoBEK8ljyf6FABD4g0DtE30t1ieqHTpXrJhPYyWEG2AsVUIo5iECJ5xrINVw3xcisF8iAAQgAAEIQGA25GsRXbeh8uHwtFdt6C1VzgkAAQg0AOZEIQBuhJIAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Text\",\"message\":\"Congratulations!\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAdElEQVRYR+2WQQoAIQgA8/+PbvMQRFSaLUQwXiudhsQkXQ65XD8BgIE3DOQSbbdIib+6x0zUFx8VVqDVvhWwCaAFPRCWkRmEC6BPvgt0bGB2uxYk+i5CBioQABjAAAYwgAEM1M9KdBTr+aNxbP2CPOsAYOADAKFUIc5KB0UAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Text\",\"message\":\"A game created by Daniel X. Moore for Ludum Dare 20\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB20lEQVRYR9WWMS9EQRSFdyMSROUHUAi1kkoiotVp/AGi06v0OlmdSqNTaYSoKNVkC36ASqxEZOWMHLl73TtvZt7KY5vNe3fenO+euXNn2q2Gf+2G9Vv/D2Bxf76f4trt3n1SckmDpGBjAKnC2p0qJ1wHXg/H+hM7byFeKo5vawNo8YWLbrQE7lZnzThBZGIYGHUAA1aepwcmrAMAcUxGZ5MACFElrNPWTlxOPYUhUvxvA4AOlu2evgfyg43R8D++/Rj+e52ZgaT1e35HJ7Id4OxbyyNh3QgwefYQQi/rcwMA+r0FoO2PLgGCFC8BkHSWMOPuLpDiJUtQC0CK6zXU1R575jIcXX+4iZqBYQBQnIAeRDIAJ2I14xkiLE7phBZH7NcAZH0QwgLwILIdsJyoyj62DCYAezY+1GdBDMDLPBsAHxACk3onHM4HGYudF1k1QGJrN0i7JUCJeGUnxF1ATsxs+U4/Wz0h1gOSADBIZwfhm82vi8fSSfdHnCAYV3wjqroJdY7Xgk7v/Oo7cVmEdGdoAFSRbnhNSBdtDMLt0XL9vV0guyIBrW2bDaBPQkxuWVrVL7hLsgAsca+NAsBrVHKpkk9DT9wDoO2yYL1+UNSIrH3tvdM9I7UnfAJXfDEwteGUTQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Player\",\"items\":{\"kitten\":false,\"bomb\":true},\"state\":{\"cat\":true}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABz0lEQVQ4T2NsrUv4X920gJGBTMAIMgCklxRDCrOD/vdPXQe2FEwQ64pXr/bztDdO/lzi4PZFOjSDF6sBr169AirK+Ayy4dWrqUD23s/IvisuzGZgvHSPQTooFdUFt+8+Y1iwdBfj/1cNPEWNlz6XOLsz9OzdyQDSwM4pCDfjx/ePYHZf/2QGkCVwL4AMAAGQIVlZWTzVLvqf/+mpAf34DywOM0QuTYDh1sQHQAOmoBrw5u0nhvcfvoAVCwrwgGmQ7er5igw3J96HuwBmUFtbC8IAWECCDAEBEWE+Bhi7qqoGLPbz+3sGrmMzGP46VzL8+P4B1QUwA0C0sLAwWMO7d28ZXr/5xFCUl83AwSPIwLr+AMOP82cYOAxNGBqvHwHbDo8FmAHS0tIMT58+BRsAY8NcAvIO17pjDN+CrBh+/fnHoKThimkAzKMwV3BwcICFQHwdHR0wm4OTn6GrqxPTBcjeQHcJzBATU2uwZlAYwVIuSh6AJWuYC0Aa3759yyAlJc3w7NlTsKaWunhwwqppWohIiTCnP7mz9//CRYsx8gXI4P8M/7+ANIEMSIiL45FRcUYNA5AhIANANEwSZjDIgPi4WLA4uhqisjEug0EWAAAnc+IRnlsPrAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Cat\",\"state\":{\"mouse\":true}}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,3,-1,-1,-1,-1,-1,4,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,2,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]}]}","docSelector":"#file_data_end_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":3969,"mtime":1304289985},{"name":"hills","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlUlEQVRYR+2U2w2AIAxFZTsGdJju4CCOoYkJJmqaPqgt0fILhZPTS8u6zNsUuMpvAADg8Fxrvfh2M5AA4QZa4+8gbhlIgG4DWIh6hyg7AwkQbgALkVsGEmAYA1TPpWFlzwHqYa2hE0BKjgFJ7/kegLQV5gbUANJCKpTcLDx+AbdweAAKsO2/ZkANwC20Omc+CaVgCbADgL3IwaJdTVQAAAAASUVORK5CYII=\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATElEQVRYR+3RwQ0AIAhDUdh/aL0b0pBgrIfPAm0fGeZLc35QoCOwhm+SGV8XmC4/4cqxSsBW4HawlKgEKIAAAggggAACCCCAAAJPBTZR9RwhrtG+2gAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"house\",\"destinationPosition\":{\"x\":224,\"y\":256},\"keepSprite\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAd0lEQVRYR2NkGGDAOMD2M4w6YDQERkNgcIbACTae//QqH7CGwKgDBjwEQPGP7AhlRiayksTd///g+nCZgTMXjGwH0Mv3oPghmA1pGf+D0wH0DH6sITCyHUBv32NEwch2wED4HiUKRrYDBsr38CgY2Q4YSN+DogAA1C5mcu7hj8oAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAh0lEQVRYR2NkGGDAOMD2M4w6YDQERkNg4EPgBBvP/4EsCxhHHTDgIfCanQ9rGrj7/x88aSgzMpGVTIgxg3HUAdhCgJigIxQnxJqBNQqI1YzPEcSaMfgcQKzLqeF7kBkYITCyHUBv32NEwch2wED4HiUKRrYDBsr38CgY2Q5AbpLRsuWDq+4AAMa1nHIPO8MLAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlUlEQVRYR2MMO/q1nmEAAeOoA0ZDgOIQyF/QwDAxoYHcdExZIgRZDgNkOoJ8ByBbToEjhqgDqOR7UMCRHgLYLAeZRJc0gMtyujgA3XKQj+maC7BZRlcHgIIZvdChuwPQi7tRB4yGwGgIjIbAyAwBfDUiGS0j0toDxFhOoiNIcwCsQiLUBCahcUK6AwhZTqL8qAMGPAQAwGmgAbpL0nwAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"destination\":\"start\",\"autoPosition\":true,\"height\":64}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABMUlEQVRYR9WXMRaCMAyGyxEcHJy8g1sdcfIO7h4CRzmTk6ycw9lDqPW9+vpiQ/42FLQTICTf/ycNUq22i4eZcVU/A9A0p0l9aNvzO9/HgfV+aQ6bY3GIrruaut6ZKEDx7K8EXmQWwO1yN84pzfpvAKdc64LKAQRAAlQDSBAcgL9eFEBK7uAhgCEbJYvp7+7cLb97IADOZil5+BxN7LcuDOCDhXsenQFDoDBALAjigNSkMAA37aT+COsdi6EGiCnk6j0JAFqWrCYMFVCVKarDOFklCFX641TlageoG+iWpH2Q5UCsmUZ3QNo+FIKWBX1+dAdSnWABUAXaXmABrLWm7/uk/3yp6gdfxzkOSHO/2CTUlAHuAdRe9D5xEIU94ILS89zBw5Xh68OEe/2Wvj771/ETcnkfkHsnv28AAAAASUVORK5CYII=\",\"properties\":{\"class\":\"BombDoor\",\"cat\":true,\"destination\":\"tunnel\",\"destinationPosition\":{\"x\":32,\"y\":160}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABMElEQVRYR92WzQ3CMAyFm4ofCSGW4MII7MASjNYl2IERuDABV8QBUItc1Sg1bvMCSVrRS6vWir+8Z7sx2cCXQfMX00WFxu4fN3hdKFAm35i8ZjlVZcbPDEfv6EIhvAFcyek7QQQH4IVD2wArwABScs2KKArwzjXPtXf/bYFW/bYVXhYcZ0tnf3Nrddkg66ALkOK292ur7gwK4NsFWrF+DcA7pDtahEkAXLUgZ4aUn76by3yl1sC5GakUtG5G76F8QnNol0/qOHsNTX5vACi7FSQB1BrwUSAZgCZ/iOSwAjEBJIRahIMChE5OHdTXDR8KxADoa8lxAcTaPaxATAAJwWO5ZUFKAG7HN0Ds5F02JAXQIMYBkEJ+/pfIoVQrkBJA2jA8gH0o5ZPPL79eZA1b8RdtI1lGzanhYgAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABvUlEQVRYR7VXIVIDQRDcfIMqEAgEAoNGYc6ieAGviM4PcLwAhT0BColDIBAIBBSvgJoUQw1T3bM7e5uYZPdy2U7PdE/f6vPp+nue5zJNU9HX88tbOTk+LLqv678v/H5Yb27KZn1V9Lp/l/vvH7/8bf/WKwUguxaErD0w2fOHRCA+3l/bAcjh6EC755mQ9e3dQ7m8ON8ytogBD8AexkqkjDAQaQYY7YgZW0jGRKoHbP1rpfCHC/2oF9IM+O737etVUWvIbgZsKaJeqKkixcDewdG2k+2rVgqkf9uQ3QygUjAmGAgxqG4ArSwwB1RVnJ3u54yIeWZUighEqgfUipHbyQ+pTO31obOAWbGyglgQAMyGBWiKgciKPQhL+9BZUJuAbDoOnQUMBCqFMsF6oVuGteGDRvSQWWCtNfJ9VcVOZ0FrKaKGTKuATT+fFXWNaF88C7wRRbmQ+YCAWDwLamM4imPKTFoFLH6jeF4zIwHRPYwQkAjEEB9AzwW++ZD+IzNKqyCK30iWw32g5oAoKw73AQHh8yGT5s4yIdO+MGAfWlEqtg8pqR6w/7q1FHoP64W0D6AwiiKaxvcoEbX6wA+o/+XuanwU9wAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAANElEQVRYR+3QQREAAAQAQUKpoIT+OYjhs5fgZnO6Nh5LAwQIECBAgAABAgQIECBAgMC3wAH1yTrBOXJV7gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QMQ0AAAjAMPhwjQq08iKDp1OwNHeq47E0QIAAAQIECBAgQIAAAQIECHwLHJMYQoH4n7d4AAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Drawbridge\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAANElEQVRYR+3QQREAAAQAQTrJoo4U+orhs5fgZrNrJx5LAwQIECBAgAABAgQIECBAgMC3wAHqIjPh9RX9mQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\",\"invisible\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAU0lEQVRYR+3WMQ4AIAhDUbj/oWVxciAlDo3xO5u0vDCQYX5pzg8KIIAAAggggMBTAmt4O0jDSZ92sK3ANPiEaodUBChgE7gNlnah2wEKIIDAHwIFrXUPIe5MJAEAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"cat\":true,\"destination\":\"bridge_room\",\"keepSprite\":true,\"destinationPosition\":{\"x\":288,\"y\":192}}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAXklEQVRYR+3WMRIAEAxEUU6Q+x8zJ0ChUmQ2o8D46oxdj0Ith1c9nF8ogAACCCCAAALvCJhZc/fM90E6nDQ0U1smfcxKeytD2eC1Z5hBgasFdu9eeguRAAUQQOAPgQ7ScxIh/AQlggAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"tunnel\",\"cat\":true,\"destinationPosition\":{\"x\":394,\"y\":128},\"keepSprite\":true}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,9,10,1,1,1,1,1,1,1],[1,1,1,1,1,1,9,10,1,1,1,1,1,1,1],[1,1,1,1,1,1,9,10,1,1,1,1,1,1,1],[1,1,1,1,1,1,9,10,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1],[-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,-1,-1,0,14,-1,-1,-1,-1,-1,-1,0],[0,0,7,0,0,-1,12,12,-1,3,4,4,8,-1,0],[0,0,-1,-1,-1,-1,11,11,-1,0,0,0,0,-1,0],[0,-1,-1,-1,-1,-1,11,11,-1,0,0,2,0,-1,0],[6,-1,-1,-1,-1,-1,12,12,-1,-1,-1,-1,-1,-1,0],[-1,-1,-1,-1,-1,-1,0,0,-1,-1,-1,-1,-1,-1,0],[0,-1,-1,-1,-1,0,0,13,-1,0,0,-1,-1,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,-1,-1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]}]}","docSelector":"#file_data_hills_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":6817,"mtime":1304285647},{"name":"first_cave","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApklEQVRYR2MsYWb/zzCAgHHQOMAvPJyu4bBp5UqwffAQsBQTYxB1dKS5I66/eMagKSHFgNUBNLcdaAHMk6MOGA2B0RAYDYHREBgNgdEQGA2BwRcCoNYQqFlGazB4W0QDHgL2OjoMV69eZVAVFaVpLOCMggEPAXokQJAniQ6B269f0yQ6cDoAlAYOXrkCzorHX71iQOdTM4RAjsAoiGia8vAYPuC9YwB+XJjBwEHLkAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB90lEQVRYR62XO04EMRBEdxO+EhIBByLkDByBjIOQcQTOQMiBCJCQ+Cag1tKjmnKV3V4xye6O7a7X1W3P7HbzD9fz4dnPxdfrdp9QclEEzGAcmMfU3LyHax1kA4ABA4KD9LLMuQiQwi6pFQCLzwCEuILHzJUzXYBR9ijK2TN8/J4GwCCuNGw3l0iBYdzGAZeJs7fS+emUckyWQNWzIqTmTDuwr5Bb55JJsOEumAU6vfvevN0eLMumALBTOVAFJNbEhQA9Z2JscQAPjAyEwTh4AiIoQ7skcHuvAEIQxRkgM0MY/q7muK25ciDtD7r3+6PlWRABVfYODsXQJZzfdSBdQGElplzg+nN5FIQtgcrcwbHFqgnV7miaUPWAyirvcb+4plVNbc8BFbQSWG03LuN0CZwjlTNBucQH1LAEvKWqwjjP9VJTAncQVUWPry43H49PdrrKXp4DGcH1AiqkaHzmNQvRfRg5CM4WAQIkIJQj6YI8iGIhv3QogBTDTPEeusJuBAC/ZUsHepm7ImfWPJ4Q5R7o1Z5rzdZjH7BTZQC3953YaJdgGaZ6AJ2oiI9KkKAnN5+rsst/RlwGC3B+vYv78rD7jN/5/U+RHeg2YVLi+0DeayBSHGvQEY9pnH1zEGEsBRHjC8gAoLIFuwAxOIQQHehOQpV9LP8Fxxb0MGXNZGgAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAjklEQVRYR+2WQRKAIAhF4WbdrOlm3oykaVoYmTiULj5r7b95SMo0uHhwPgEABpoMiMjae1iZeavtbQbIH3IzZHCKBFgyQfJQRAN4so+1oQBWetkWDSwrpAVWuB5MC+At8Abo9npuAAAMzGTg+kG1zD2m4AsD2gKthBbAwO8GHq7o6hMsbAp6b1EAwMB0BnZlQ4khAE31UQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Text\",\"message\":\"It's dangerous to go alone! Take this.\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABz0lEQVQ4T2NsrUv4X920gJGBTMAIMgCklxRDCrOD/vdPXQe2FEwQ64pXr/bztDdO/lzi4PZFOjSDF6sBr169AirK+Ayy4dWrqUD23s/IvisuzGZgvHSPQTooFdUFt+8+Y1iwdBfj/1cNPEWNlz6XOLsz9OzdyQDSwM4pCDfjx/ePYHZf/2QGkCVwL4AMAAGQIVlZWTzVLvqf/+mpAf34DywOM0QuTYDh1sQHQAOmoBrw5u0nhvcfvoAVCwrwgGmQ7er5igw3J96HuwBmUFtbC8IAWECCDAEBEWE+Bhi7qqoGLPbz+3sGrmMzGP46VzL8+P4B1QUwA0C0sLAwWMO7d28ZXr/5xFCUl83AwSPIwLr+AMOP82cYOAxNGBqvHwHbDo8FmAHS0tIMT58+BRsAY8NcAvIO17pjDN+CrBh+/fnHoKThimkAzKMwV3BwcICFQHwdHR0wm4OTn6GrqxPTBcjeQHcJzBATU2uwZlAYwVIuSh6AJWuYC0Aa3759yyAlJc3w7NlTsKaWunhwwqppWohIiTCnP7mz9//CRYsx8gXI4P8M/7+ANIEMSIiL45FRcUYNA5AhIANANEwSZjDIgPi4WLA4uhqisjEug0EWAAAnc+IRnlsPrAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Item\",\"name\":\"kitten\",\"message\":\"Press 'Space' to deploy kitten!\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABnklEQVRYR92XsU7DQAyGLwKVTnSBBR4LNiRG+gAVT4F4ABiR2OCxYIEFplKBUnyKqXPx2f8FTiBuqZRc8n/277PTJvzyakr1n3Z2W++Z/bdX+L3wRhJFxBkOhYABSsRLIIoB9pYv8f2P99cDJw6OzuK15+ks/iJZKAZY3V6Ew+N5eLi7GgDI65OT83oAXhHS/f8HwKeALKDFfstsyLqolgEuQsuGakWYijfNpobbdtOfGODmYxUW70uz0KFTcLk9bU+3JgGJnjODQkAAsgmhEAzg9QMXgKOXniMQEsCyYhQAwVgQUtxryy5AbgbkADRxgshlwQTwBlAKkRO3svAtALbCEx4F4EWPzIN0jzYdsxmwAMhP6gvasu4VA3w+QF9BA52xAFpPUDNA0ZM4rxTCAuCKTzPEwaRZgAC6SRh5PHFtTxqMhCgCQMQ5a7xXinMgLkC3sWeDzAJ6Arrm07MSskB4H2dsrhhRkJz/9PzoVoyKW03o7wPQKCbKXNMpyULuP4JqAQv/lDgfTe3zrAdQQ1hmSRvJXwA1hk9qkWbDGnRECTD+JGu6AAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Door\",\"destination\":\"start\",\"destinationPosition\":{\"x\":128,\"y\":64},\"width\":96}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,3,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,2,-1,-1,5,-1,-1,2,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,4,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,1,1,1,1,-1,-1,-1,1,1,1,1,1,1],[1,1,1,1,1,1,6,-1,-1,1,1,1,1,1,1]]}]}","docSelector":"#file_data_first_cave_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":5008,"mtime":1304292688},{"name":"cave2","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAU0lEQVRYR+3WMQ4AIAhDUbj/oWVxciAlDo3xO5u0vDCQYX5pzg8KIIAAAggggMBTAmt4O0jDSZ92sK3ANPiEaodUBChgE7gNlnah2wEKIIDAHwIFrXUPIe5MJAEAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"destination\":\"cave2-1\",\"cat\":true,\"destinationPosition\":{\"x\":384,\"y\":256},\"keepSprite\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAc0lEQVRYR2OcsrX3P8MAgNbWFrCtjCPWAbBAH7AQGHUA1UMAlqqrq2tIylNUSwMD7gCSvI2kmGohMOqA0RAYfiFAbr4mNSRwZsMBdwCpPiFX/WhBNBoCoyEwNEOAmoUUWSEw4A4gt9TDpo+sEBh1wLAKAQB97G/d9BG2CAAAAABJRU5ErkJggg==\"}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,3,3,3,0,0,0,0,0,0,0,0,0,0,0],[0,3,3,3,3,3,3,3,0,0,0,0,0,0,0],[0,3,3,3,3,3,3,3,3,3,0,0,0,0,0],[0,0,0,3,3,3,3,3,3,3,3,3,0,0,0],[0,0,0,0,0,0,3,3,3,3,3,3,3,3,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,-1,-1,-1,1,1,1,1,1,-1,-1,-1,-1,-1,-1],[1,-1,-1,-1,-1,-1,-1,-1,1,1,1,-1,-1,-1,-1],[1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,1,1,-1,-1],[1,1,1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,1,1],[-1,-1,1,1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,2],[-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1,1,1]]}]}","docSelector":"#file_data_cave2_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":2601,"mtime":1304285458},{"name":"tunnel","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAApklEQVRYR2MsYWb/zzCAgHHQOMAvPJyu4bBp5UqwffAQsBQTYxB1dKS5I66/eMagKSHFgNUBNLcdaAHMk6MOGA2B0RAYDYHREBgNgdEQGA2BwRcCoNYQqFlGazB4W0QDHgL2OjoMV69eZVAVFaVpLOCMggEPAXokQJAniQ6B269f0yQ6cDoAlAYOXrkCzorHX71iQOdTM4RAjsAoiGia8vAYPuC9YwB+XJjBwEHLkAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QwQ0AAAgCMdh/aHULPyW5P2mTzPW2OkCAAAECBAgQIECAAAECBAh8CyywJyABJlvz9gAAAABJRU5ErkJggg==\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAoUlEQVRYR+2Wuw3AIAxE7VlgNkZgCEZgNpjFCUWQEn5SEkKKs4Qo792TCzMRyf6WDQMABmAABmAABmAABmBgZCCEQM45stbe+r333XOveZIZY26HXmF7EAXA08Y9U1rrwkYB8GbzGswV4gSQ2s+coYGv26ey2cCK9ieAFe0zwKr2GUBEKMY4bf9qy3eE8R4us8KVUsSc1qw9/wCY5X7UPuVuITMHEFlWkSkAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"destination\":\"hills\",\"destinationPosition\":{\"x\":80,\"y\":96},\"keepSprite\":true,\"cat\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA70lEQVRYR+2VwQ3DIAxFySZskAHYgg2zAFKGyADcObBJWw5GDjgBt4FeHCkSMuD//I1gUUq9Pv/fvkUAxAFxQBwQB8QBceAJB9Z1ZT3n3vu8nv0cU2Ja6wogxqioOF6477vqAihFqcTW2pzbOZfHOE7Z1AQA8ZYoqwdo8S3AlThVlTEmpz2OI49xHIIwn+ZIAGw5rrwljF1IIpR46VQFQFXNEea2ggSAqkcKA+gJAFc/QzxBVABX1ff0k2v/CSBVP1u8C2BU5ZdnoHRhKkCiglbAIZwOANZs29Z1kXxz8PCe26s4hPBr/ub+5mM0GuINt4daS/no4zIAAAAASUVORK5CYII=\",\"properties\":{\"class\":\"Door\",\"keepSprite\":true,\"destination\":\"hills\",\"destinationPosition\":{\"x\":256,\"y\":32},\"cat\":true}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,0,0,0,0,0,0,0,0,0,0,-1,-1,-1],[-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1],[0,-1,-1,0,0,0,0,0,0,0,0,-1,-1,0,-1],[0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,0,3,-1,-1],[0,2,0,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]}]}","docSelector":"#file_data_tunnel_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":3016,"mtime":1304274803},{"name":"start","contents":"{\"title\":\"Tilemap\",\"version\":\"1.0\",\"orientation\":\"orthogonal\",\"width\":15,\"height\":10,\"tileWidth\":32,\"tileHeight\":32,\"tileset\":[{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATElEQVRYR+3RwQ0AIAhDUdh/aL0b0pBgrIfPAm0fGeZLc35QoCOwhm+SGV8XmC4/4cqxSsBW4HawlKgEKIAAAggggAACCCCAAAJPBTZR9RwhrtG+2gAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"first_cave\",\"destinationPosition\":{\"x\":224,\"y\":256},\"keepSprite\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAmklEQVRYR2OUtBL8zzCAgHHQOKC6uoau4dDa2gK2Dx4C8p6iDDFG6TR3xL59exmcnJwZsDqA5rYDLYB5ctQBoyEwGgKjITAaAqMhMBoCoyEw+EIA1BoCNctoDQZvi2jAQ8DS0pLh+PHjNI8GnFEw4CFAjwQI8iTRIfBw+2uaRAdOByCnAZDl6HxqhhDIERgFEa3zPy7zB7x3DAAshZWB7lbnbAAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Wall\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlUlEQVRYR+2U2w2AIAxFZTsGdJju4CCOoYkJJmqaPqgt0fILhZPTS8u6zNsUuMpvAADg8Fxrvfh2M5AA4QZa4+8gbhlIgG4DWIh6hyg7AwkQbgALkVsGEmAYA1TPpWFlzwHqYa2hE0BKjgFJ7/kegLQV5gbUANJCKpTcLDx+AbdweAAKsO2/ZkANwC20Omc+CaVgCbADgL3IwaJdTVQAAAAASUVORK5CYII=\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAB20lEQVRYR9WWMS9EQRSFdyMSROUHUAi1kkoiotVp/AGi06v0OlmdSqNTaYSoKNVkC36ASqxEZOWMHLl73TtvZt7KY5vNe3fenO+euXNn2q2Gf+2G9Vv/D2Bxf76f4trt3n1SckmDpGBjAKnC2p0qJ1wHXg/H+hM7byFeKo5vawNo8YWLbrQE7lZnzThBZGIYGHUAA1aepwcmrAMAcUxGZ5MACFElrNPWTlxOPYUhUvxvA4AOlu2evgfyg43R8D++/Rj+e52ZgaT1e35HJ7Id4OxbyyNh3QgwefYQQi/rcwMA+r0FoO2PLgGCFC8BkHSWMOPuLpDiJUtQC0CK6zXU1R575jIcXX+4iZqBYQBQnIAeRDIAJ2I14xkiLE7phBZH7NcAZH0QwgLwILIdsJyoyj62DCYAezY+1GdBDMDLPBsAHxACk3onHM4HGYudF1k1QGJrN0i7JUCJeGUnxF1ATsxs+U4/Wz0h1gOSADBIZwfhm82vi8fSSfdHnCAYV3wjqroJdY7Xgk7v/Oo7cVmEdGdoAFSRbnhNSBdtDMLt0XL9vV0guyIBrW2bDaBPQkxuWVrVL7hLsgAsca+NAsBrVHKpkk9DT9wDoO2yYL1+UNSIrH3tvdM9I7UnfAJXfDEwteGUTQAAAABJRU5ErkJggg==\",\"properties\":{\"playerStart\":true,\"spriteName\":\"empty\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAM0lEQVRYR+3QQREAAAQAQVpqI51I/mL47CW42azZjsfSAAECBAgQIECAAAECBAgQIPAtcD2lUkGDYVWCAAAAAElFTkSuQmCC\"},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAi0lEQVRYR2MMO/q1nmEAAeOoAygOgfwFDQwTExrIjUXKogBkOQyQ6QjyHYBsOcgRdHUAuuV0cwA2i+kWBfgsp3kIYItvuqcBmIXIiW1AcwEo2EcdMBoCoyEwGgKjITAgIUCoViSxZiStRUSM5SS2D0hzAHoFhKslSkLzjHQHkNv8xaFv1AGjITAaAgAewpoBGVqFcQAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"destination\":\"stream\",\"autoPosition\":true,\"width\":64}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAlklEQVRYR+2XwQ4AMQREt///0bsniQjGpuXQTK9FXoai68nPq64XsLXXJV8UtBQkACv5EuCPAqI08hG74ymwqUYg7QBIkTGACOQ4gEiuA3sv0LML07WTRwSi4VoAvGqPmmUrQAVkBCADGQVoa0SoYDkNqcD9CqDp164A9wG0ldtGxX2A+8CYAtn7h70DjdhSJfNvuKPAByz6QiFnjkKgAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Gate\",\"lever\":\"lavaLever\"}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAA3ElEQVRYR+2WzQ2AIAyFdUnPbuAIuoIbuIwjeVcSMUiQvkdrjAmeS/v19c+2W7ex+fBrK0BV4J8KDMskDs7cyzaHE24KkMAhGQCBA7DBPYgAgQGkguccx/YZWxmAcHbri/CdGQBQ0wvCDMB5dM6Y4P4N0AdyCcR5SxgQZXsfwGQKGBWI7J1bOwXYUT2TsgEoDG6jgCK4DkAZ2LcVX4Knm8DuiaIeMMo6HCpMAeOsOQD0DL9WAhQgt6xU1zA+LMxWBP6OsB5IQYRZSSqpFSjNGniHKwA4KzGpAJ8rsAOI8qABWeitYgAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"height\":64,\"destination\":\"forest\",\"autoPosition\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAxElEQVRYR+2WzQ2AIAyFZUnPbuAIuoIbuIwjeVcSSQhB+h6WcLCem77P1x/qxuNcho6fMwDKgXlfxWptkxwTJcFKgAjHZASEDMCKBxAQQgbwCWOIUuIUFoDAAMTCRwEkhD4A49gdawD6DnTvAXRinr7lHWD2gvoYKot7E9o5APx9HUDYOZIbzQFy25FswG8OGIA58D8H/IgpX0P4GJZeuNxCApdQPUDpRCPEcYD0zHoDIMU5gNIbUCEc0vGvIXMhA7EGcAFMwqkBYNw3BwAAAABJRU5ErkJggg==\",\"properties\":{\"class\":\"Door\",\"height\":64,\"destination\":\"hills\",\"autoPosition\":true}},{\"src\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABKUlEQVRYR+2XuxGDMBBERS/ExBRDTAkUQQlURExML/acx+u5OXRIDFo5sIkYC1mPvc8eTTi/Hlgex/F1O03TZ8c8z9Hd27aFdV31WuMd4y68NxwA8EcAsRByeNd1YVkWLsAZSBUFrKRWkeIK2FyIAUg4ANK2bdkQ2AORlDoUyAdKCLws1tUhALQkTJRr2Pc9UBXAm5rkOnD1fV+nDFMghozTiETyTBAeAN40AcIHSIDcB9BZDlOKmRGtDKUKdLuV+6+5oeeEogxVgZQBYZ3Sim3v1zBakaoKxCDkt2EY+BORZ8eoEJode6FAVdBC8J8HrswD8mzxmTB3HpDnqvSBTBuGcPfNyBtCM0F4AL8zD5x9B+gKoTWiXABYcvGvY5mI5MIQ4g0kVxV4AtTsGTAhkSYeAAAAAElFTkSuQmCC\",\"properties\":{\"class\":\"Gate\",\"lever\":\"lavaLever\"}}],\"layers\":[{\"name\":\" Layer 1 \",\"tiles\":[[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2],[2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]]},{\"name\":\" Layer 2 \",\"tiles\":[[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]]},{\"name\":\" Entities \",\"tiles\":[[1,1,1,1,1,1,1,5,-1,1,1,1,1,1,1],[1,1,1,1,0,1,1,-1,-1,1,1,1,1,1,1],[1,1,1,1,-1,-1,-1,-1,-1,1,1,1,1,1,1],[1,1,1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1],[1,1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1],[7,9,-1,-1,-1,3,-1,-1,-1,-1,-1,-1,-1,-1,8],[-1,9,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]}]}","docSelector":"#file_data_start_tilemap","extension":"tilemap","language":null,"hidden":false,"type":"tilemap","size":5716,"mtime":1304280973}]},{"name":"README","contents":"A game for LD 20.","docSelector":"#file_README","extension":"","language":null,"hidden":false,"type":"text","size":17,"mtime":1304130621},{"name":"game","contents":"/*\n* Copyright (c) 2006-2007 Erin Catto http://www.gphysics.com\n*\n* This software is provided 'as-is', without any express or implied\n* warranty. In no event will the authors be held liable for any damages\n* arising from the use of this software.\n* Permission is granted to anyone to use this software for any purpose,\n* including commercial applications, and to alter it and redistribute it\n* freely, subject to the following restrictions:\n* 1. The origin of this software must not be misrepresented; you must not\n* claim that you wrote the original software. If you use this software\n* in a product, an acknowledgment in the product documentation would be\n* appreciated but is not required.\n* 2. Altered source versions must be plainly marked as such, and must not be\n* misrepresented as being the original software.\n* 3. This notice may not be removed or altered from any source distribution.\n*/\nvar a2j = {};\n\n(function (a2j, window) {\n\n if(!window.flash) window.flash = {utils: {Dictionary: Object} };\n else if(!window.flash.utils) window.flash.utils = {Dictionary: Object};\n else if(!window.flash.utils.Dictionary) window.flash.utils.Dictionary = Object;\n\n window.Vector = window.Array;\n\n Function.prototype.inherit = function (base) {\n var tmpCtr = this;\n var empty = Function.prototype.inherit.empty;\n empty.prototype = base.prototype;\n this.prototype = new empty();\n this.prototype.constructor = tmpCtr;\n };\n Function.prototype.inherit.empty = function () {};\n\n window.trace = function () {\n if (window.console && (window.console.log instanceof Function)) window.console.log.apply(window.console, arguments);\n };\n window.assert = function () {\n if (window.console && (window.console.assert instanceof Function)) window.console.assert.apply(window.console, arguments);\n };\n\n a2j.warn = function warn() {\n if (window.console) console.warn.apply(console, arguments);\n };\n\n a2j.generateCallback = function generateCallback(context, cb) {\n return function () {\n cb.apply(context, arguments);\n };\n };\n\n a2j.NVector = function NVector(length) {\n if (length === undefined) length = 0;\n var tmp = new Array(length || 0);\n for (var i = 0; i < length; ++i)\n tmp[i] = 0;\n return tmp;\n };\n\n a2j.is = function is(o1, o2) {\n if (o1 === null) return false;\n if ((o2 instanceof Function) && (o1 instanceof o2)) return true;\n if ((o1.constructor.__implements != undefined) && (o1.constructor.__implements[o2])) return true;\n return false;\n };\n\n a2j.parseUInt = function(v) {\n return Math.abs(parseInt(v));\n }\n\n})(a2j, window, undefined);\n\nvar Vector_a2j_Number = a2j.NVector;\n//package structure\nif (!window.Box2D) Box2D = {};\nif (!window.Box2D.Collision) Box2D.Collision = {};\nif (!window.Box2D.Collision.Shapes) Box2D.Collision.Shapes = {};\nif (!window.Box2D.Common) Box2D.Common = {};\nif (!window.Box2D.Common.Math) Box2D.Common.Math = {};\nif (!window.Box2D.Dynamics) Box2D.Dynamics = {};\nif (!window.Box2D.Dynamics.Contacts) Box2D.Dynamics.Contacts = {};\nif (!window.Box2D.Dynamics.Controllers) Box2D.Dynamics.Controllers = {};\nif (!window.Box2D.Dynamics.Joints) Box2D.Dynamics.Joints = {};\n//pre-definitions\n(function () {\n Box2D.Collision.IBroadPhase = 'Box2D.Collision.IBroadPhase';\n\n function b2AABB() {\n b2AABB.b2AABB.apply(this, arguments);\n };\n Box2D.Collision.b2AABB = b2AABB;\n\n function b2Bound() {\n b2Bound.b2Bound.apply(this, arguments);\n };\n Box2D.Collision.b2Bound = b2Bound;\n\n function b2BoundValues() {\n b2BoundValues.b2BoundValues.apply(this, arguments);\n if (this.constructor === b2BoundValues) this.b2BoundValues.apply(this, arguments);\n };\n Box2D.Collision.b2BoundValues = b2BoundValues;\n\n function b2BroadPhase() {\n b2BroadPhase.b2BroadPhase.apply(this, arguments);\n if (this.constructor === b2BroadPhase) this.b2BroadPhase.apply(this, arguments);\n };\n Box2D.Collision.b2BroadPhase = b2BroadPhase;\n\n function b2Collision() {\n b2Collision.b2Collision.apply(this, arguments);\n };\n Box2D.Collision.b2Collision = b2Collision;\n\n function b2ContactID() {\n b2ContactID.b2ContactID.apply(this, arguments);\n if (this.constructor === b2ContactID) this.b2ContactID.apply(this, arguments);\n };\n Box2D.Collision.b2ContactID = b2ContactID;\n\n function b2ContactPoint() {\n b2ContactPoint.b2ContactPoint.apply(this, arguments);\n };\n Box2D.Collision.b2ContactPoint = b2ContactPoint;\n\n function b2Distance() {\n b2Distance.b2Distance.apply(this, arguments);\n };\n Box2D.Collision.b2Distance = b2Distance;\n\n function b2DistanceInput() {\n b2DistanceInput.b2DistanceInput.apply(this, arguments);\n };\n Box2D.Collision.b2DistanceInput = b2DistanceInput;\n\n function b2DistanceOutput() {\n b2DistanceOutput.b2DistanceOutput.apply(this, arguments);\n };\n Box2D.Collision.b2DistanceOutput = b2DistanceOutput;\n\n function b2DistanceProxy() {\n b2DistanceProxy.b2DistanceProxy.apply(this, arguments);\n };\n Box2D.Collision.b2DistanceProxy = b2DistanceProxy;\n\n function b2DynamicTree() {\n b2DynamicTree.b2DynamicTree.apply(this, arguments);\n if (this.constructor === b2DynamicTree) this.b2DynamicTree.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTree = b2DynamicTree;\n\n function b2DynamicTreeBroadPhase() {\n b2DynamicTreeBroadPhase.b2DynamicTreeBroadPhase.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTreeBroadPhase = b2DynamicTreeBroadPhase;\n\n function b2DynamicTreeNode() {\n b2DynamicTreeNode.b2DynamicTreeNode.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTreeNode = b2DynamicTreeNode;\n\n function b2DynamicTreePair() {\n b2DynamicTreePair.b2DynamicTreePair.apply(this, arguments);\n };\n Box2D.Collision.b2DynamicTreePair = b2DynamicTreePair;\n\n function b2Manifold() {\n b2Manifold.b2Manifold.apply(this, arguments);\n if (this.constructor === b2Manifold) this.b2Manifold.apply(this, arguments);\n };\n Box2D.Collision.b2Manifold = b2Manifold;\n\n function b2ManifoldPoint() {\n b2ManifoldPoint.b2ManifoldPoint.apply(this, arguments);\n if (this.constructor === b2ManifoldPoint) this.b2ManifoldPoint.apply(this, arguments);\n };\n Box2D.Collision.b2ManifoldPoint = b2ManifoldPoint;\n\n function b2OBB() {\n b2OBB.b2OBB.apply(this, arguments);\n };\n Box2D.Collision.b2OBB = b2OBB;\n\n function b2Pair() {\n b2Pair.b2Pair.apply(this, arguments);\n };\n Box2D.Collision.b2Pair = b2Pair;\n\n function b2PairManager() {\n b2PairManager.b2PairManager.apply(this, arguments);\n if (this.constructor === b2PairManager) this.b2PairManager.apply(this, arguments);\n };\n Box2D.Collision.b2PairManager = b2PairManager;\n\n function b2Point() {\n b2Point.b2Point.apply(this, arguments);\n };\n Box2D.Collision.b2Point = b2Point;\n\n function b2Proxy() {\n b2Proxy.b2Proxy.apply(this, arguments);\n };\n Box2D.Collision.b2Proxy = b2Proxy;\n\n function b2RayCastInput() {\n b2RayCastInput.b2RayCastInput.apply(this, arguments);\n if (this.constructor === b2RayCastInput) this.b2RayCastInput.apply(this, arguments);\n };\n Box2D.Collision.b2RayCastInput = b2RayCastInput;\n\n function b2RayCastOutput() {\n b2RayCastOutput.b2RayCastOutput.apply(this, arguments);\n };\n Box2D.Collision.b2RayCastOutput = b2RayCastOutput;\n\n function b2Segment() {\n b2Segment.b2Segment.apply(this, arguments);\n };\n Box2D.Collision.b2Segment = b2Segment;\n\n function b2SeparationFunction() {\n b2SeparationFunction.b2SeparationFunction.apply(this, arguments);\n };\n Box2D.Collision.b2SeparationFunction = b2SeparationFunction;\n\n function b2Simplex() {\n b2Simplex.b2Simplex.apply(this, arguments);\n if (this.constructor === b2Simplex) this.b2Simplex.apply(this, arguments);\n };\n Box2D.Collision.b2Simplex = b2Simplex;\n\n function b2SimplexCache() {\n b2SimplexCache.b2SimplexCache.apply(this, arguments);\n };\n Box2D.Collision.b2SimplexCache = b2SimplexCache;\n\n function b2SimplexVertex() {\n b2SimplexVertex.b2SimplexVertex.apply(this, arguments);\n };\n Box2D.Collision.b2SimplexVertex = b2SimplexVertex;\n\n function b2TimeOfImpact() {\n b2TimeOfImpact.b2TimeOfImpact.apply(this, arguments);\n };\n Box2D.Collision.b2TimeOfImpact = b2TimeOfImpact;\n\n function b2TOIInput() {\n b2TOIInput.b2TOIInput.apply(this, arguments);\n };\n Box2D.Collision.b2TOIInput = b2TOIInput;\n\n function b2WorldManifold() {\n b2WorldManifold.b2WorldManifold.apply(this, arguments);\n if (this.constructor === b2WorldManifold) this.b2WorldManifold.apply(this, arguments);\n };\n Box2D.Collision.b2WorldManifold = b2WorldManifold;\n\n function ClipVertex() {\n ClipVertex.ClipVertex.apply(this, arguments);\n };\n Box2D.Collision.ClipVertex = ClipVertex;\n\n function Features() {\n Features.Features.apply(this, arguments);\n };\n Box2D.Collision.Features = Features;\n\n function b2CircleShape() {\n b2CircleShape.b2CircleShape.apply(this, arguments);\n if (this.constructor === b2CircleShape) this.b2CircleShape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2CircleShape = b2CircleShape;\n\n function b2EdgeChainDef() {\n b2EdgeChainDef.b2EdgeChainDef.apply(this, arguments);\n if (this.constructor === b2EdgeChainDef) this.b2EdgeChainDef.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2EdgeChainDef = b2EdgeChainDef;\n\n function b2EdgeShape() {\n b2EdgeShape.b2EdgeShape.apply(this, arguments);\n if (this.constructor === b2EdgeShape) this.b2EdgeShape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2EdgeShape = b2EdgeShape;\n\n function b2MassData() {\n b2MassData.b2MassData.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2MassData = b2MassData;\n\n function b2PolygonShape() {\n b2PolygonShape.b2PolygonShape.apply(this, arguments);\n if (this.constructor === b2PolygonShape) this.b2PolygonShape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2PolygonShape = b2PolygonShape;\n\n function b2Shape() {\n b2Shape.b2Shape.apply(this, arguments);\n if (this.constructor === b2Shape) this.b2Shape.apply(this, arguments);\n };\n Box2D.Collision.Shapes.b2Shape = b2Shape;\n Box2D.Common.b2internal = 'Box2D.Common.b2internal';\n\n function b2Color() {\n b2Color.b2Color.apply(this, arguments);\n if (this.constructor === b2Color) this.b2Color.apply(this, arguments);\n };\n Box2D.Common.b2Color = b2Color;\n\n function b2Settings() {\n b2Settings.b2Settings.apply(this, arguments);\n };\n Box2D.Common.b2Settings = b2Settings;\n\n function b2Mat22() {\n b2Mat22.b2Mat22.apply(this, arguments);\n if (this.constructor === b2Mat22) this.b2Mat22.apply(this, arguments);\n };\n Box2D.Common.Math.b2Mat22 = b2Mat22;\n\n function b2Mat33() {\n b2Mat33.b2Mat33.apply(this, arguments);\n if (this.constructor === b2Mat33) this.b2Mat33.apply(this, arguments);\n };\n Box2D.Common.Math.b2Mat33 = b2Mat33;\n\n function b2Math() {\n b2Math.b2Math.apply(this, arguments);\n };\n Box2D.Common.Math.b2Math = b2Math;\n\n function b2Sweep() {\n b2Sweep.b2Sweep.apply(this, arguments);\n };\n Box2D.Common.Math.b2Sweep = b2Sweep;\n\n function b2Transform() {\n b2Transform.b2Transform.apply(this, arguments);\n if (this.constructor === b2Transform) this.b2Transform.apply(this, arguments);\n };\n Box2D.Common.Math.b2Transform = b2Transform;\n\n function b2Vec2() {\n b2Vec2.b2Vec2.apply(this, arguments);\n if (this.constructor === b2Vec2) this.b2Vec2.apply(this, arguments);\n };\n Box2D.Common.Math.b2Vec2 = b2Vec2;\n\n function b2Vec3() {\n b2Vec3.b2Vec3.apply(this, arguments);\n if (this.constructor === b2Vec3) this.b2Vec3.apply(this, arguments);\n };\n Box2D.Common.Math.b2Vec3 = b2Vec3;\n\n function b2Body() {\n b2Body.b2Body.apply(this, arguments);\n if (this.constructor === b2Body) this.b2Body.apply(this, arguments);\n };\n Box2D.Dynamics.b2Body = b2Body;\n\n function b2BodyDef() {\n b2BodyDef.b2BodyDef.apply(this, arguments);\n if (this.constructor === b2BodyDef) this.b2BodyDef.apply(this, arguments);\n };\n Box2D.Dynamics.b2BodyDef = b2BodyDef;\n\n function b2ContactFilter() {\n b2ContactFilter.b2ContactFilter.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactFilter = b2ContactFilter;\n\n function b2ContactImpulse() {\n b2ContactImpulse.b2ContactImpulse.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactImpulse = b2ContactImpulse;\n\n function b2ContactListener() {\n b2ContactListener.b2ContactListener.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactListener = b2ContactListener;\n\n function b2ContactManager() {\n b2ContactManager.b2ContactManager.apply(this, arguments);\n if (this.constructor === b2ContactManager) this.b2ContactManager.apply(this, arguments);\n };\n Box2D.Dynamics.b2ContactManager = b2ContactManager;\n\n function b2DebugDraw() {\n b2DebugDraw.b2DebugDraw.apply(this, arguments);\n if (this.constructor === b2DebugDraw) this.b2DebugDraw.apply(this, arguments);\n };\n Box2D.Dynamics.b2DebugDraw = b2DebugDraw;\n\n function b2DestructionListener() {\n b2DestructionListener.b2DestructionListener.apply(this, arguments);\n };\n Box2D.Dynamics.b2DestructionListener = b2DestructionListener;\n\n function b2FilterData() {\n b2FilterData.b2FilterData.apply(this, arguments);\n };\n Box2D.Dynamics.b2FilterData = b2FilterData;\n\n function b2Fixture() {\n b2Fixture.b2Fixture.apply(this, arguments);\n if (this.constructor === b2Fixture) this.b2Fixture.apply(this, arguments);\n };\n Box2D.Dynamics.b2Fixture = b2Fixture;\n\n function b2FixtureDef() {\n b2FixtureDef.b2FixtureDef.apply(this, arguments);\n if (this.constructor === b2FixtureDef) this.b2FixtureDef.apply(this, arguments);\n };\n Box2D.Dynamics.b2FixtureDef = b2FixtureDef;\n\n function b2Island() {\n b2Island.b2Island.apply(this, arguments);\n if (this.constructor === b2Island) this.b2Island.apply(this, arguments);\n };\n Box2D.Dynamics.b2Island = b2Island;\n\n function b2TimeStep() {\n b2TimeStep.b2TimeStep.apply(this, arguments);\n };\n Box2D.Dynamics.b2TimeStep = b2TimeStep;\n\n function b2World() {\n b2World.b2World.apply(this, arguments);\n if (this.constructor === b2World) this.b2World.apply(this, arguments);\n };\n Box2D.Dynamics.b2World = b2World;\n\n function b2CircleContact() {\n b2CircleContact.b2CircleContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2CircleContact = b2CircleContact;\n\n function b2Contact() {\n b2Contact.b2Contact.apply(this, arguments);\n if (this.constructor === b2Contact) this.b2Contact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2Contact = b2Contact;\n\n function b2ContactConstraint() {\n b2ContactConstraint.b2ContactConstraint.apply(this, arguments);\n if (this.constructor === b2ContactConstraint) this.b2ContactConstraint.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactConstraint = b2ContactConstraint;\n\n function b2ContactConstraintPoint() {\n b2ContactConstraintPoint.b2ContactConstraintPoint.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactConstraintPoint = b2ContactConstraintPoint;\n\n function b2ContactEdge() {\n b2ContactEdge.b2ContactEdge.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactEdge = b2ContactEdge;\n\n function b2ContactFactory() {\n b2ContactFactory.b2ContactFactory.apply(this, arguments);\n if (this.constructor === b2ContactFactory) this.b2ContactFactory.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactFactory = b2ContactFactory;\n\n function b2ContactRegister() {\n b2ContactRegister.b2ContactRegister.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactRegister = b2ContactRegister;\n\n function b2ContactResult() {\n b2ContactResult.b2ContactResult.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactResult = b2ContactResult;\n\n function b2ContactSolver() {\n b2ContactSolver.b2ContactSolver.apply(this, arguments);\n if (this.constructor === b2ContactSolver) this.b2ContactSolver.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2ContactSolver = b2ContactSolver;\n\n function b2EdgeAndCircleContact() {\n b2EdgeAndCircleContact.b2EdgeAndCircleContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2EdgeAndCircleContact = b2EdgeAndCircleContact;\n\n function b2NullContact() {\n b2NullContact.b2NullContact.apply(this, arguments);\n if (this.constructor === b2NullContact) this.b2NullContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2NullContact = b2NullContact;\n\n function b2PolyAndCircleContact() {\n b2PolyAndCircleContact.b2PolyAndCircleContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PolyAndCircleContact = b2PolyAndCircleContact;\n\n function b2PolyAndEdgeContact() {\n b2PolyAndEdgeContact.b2PolyAndEdgeContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PolyAndEdgeContact = b2PolyAndEdgeContact;\n\n function b2PolygonContact() {\n b2PolygonContact.b2PolygonContact.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PolygonContact = b2PolygonContact;\n\n function b2PositionSolverManifold() {\n b2PositionSolverManifold.b2PositionSolverManifold.apply(this, arguments);\n if (this.constructor === b2PositionSolverManifold) this.b2PositionSolverManifold.apply(this, arguments);\n };\n Box2D.Dynamics.Contacts.b2PositionSolverManifold = b2PositionSolverManifold;\n\n function b2BuoyancyController() {\n b2BuoyancyController.b2BuoyancyController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2BuoyancyController = b2BuoyancyController;\n\n function b2ConstantAccelController() {\n b2ConstantAccelController.b2ConstantAccelController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2ConstantAccelController = b2ConstantAccelController;\n\n function b2ConstantForceController() {\n b2ConstantForceController.b2ConstantForceController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2ConstantForceController = b2ConstantForceController;\n\n function b2Controller() {\n b2Controller.b2Controller.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2Controller = b2Controller;\n\n function b2ControllerEdge() {\n b2ControllerEdge.b2ControllerEdge.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2ControllerEdge = b2ControllerEdge;\n\n function b2GravityController() {\n b2GravityController.b2GravityController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2GravityController = b2GravityController;\n\n function b2TensorDampingController() {\n b2TensorDampingController.b2TensorDampingController.apply(this, arguments);\n };\n Box2D.Dynamics.Controllers.b2TensorDampingController = b2TensorDampingController;\n\n function b2DistanceJoint() {\n b2DistanceJoint.b2DistanceJoint.apply(this, arguments);\n if (this.constructor === b2DistanceJoint) this.b2DistanceJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2DistanceJoint = b2DistanceJoint;\n\n function b2DistanceJointDef() {\n b2DistanceJointDef.b2DistanceJointDef.apply(this, arguments);\n if (this.constructor === b2DistanceJointDef) this.b2DistanceJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2DistanceJointDef = b2DistanceJointDef;\n\n function b2FrictionJoint() {\n b2FrictionJoint.b2FrictionJoint.apply(this, arguments);\n if (this.constructor === b2FrictionJoint) this.b2FrictionJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2FrictionJoint = b2FrictionJoint;\n\n function b2FrictionJointDef() {\n b2FrictionJointDef.b2FrictionJointDef.apply(this, arguments);\n if (this.constructor === b2FrictionJointDef) this.b2FrictionJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2FrictionJointDef = b2FrictionJointDef;\n\n function b2GearJoint() {\n b2GearJoint.b2GearJoint.apply(this, arguments);\n if (this.constructor === b2GearJoint) this.b2GearJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2GearJoint = b2GearJoint;\n\n function b2GearJointDef() {\n b2GearJointDef.b2GearJointDef.apply(this, arguments);\n if (this.constructor === b2GearJointDef) this.b2GearJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2GearJointDef = b2GearJointDef;\n\n function b2Jacobian() {\n b2Jacobian.b2Jacobian.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2Jacobian = b2Jacobian;\n\n function b2Joint() {\n b2Joint.b2Joint.apply(this, arguments);\n if (this.constructor === b2Joint) this.b2Joint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2Joint = b2Joint;\n\n function b2JointDef() {\n b2JointDef.b2JointDef.apply(this, arguments);\n if (this.constructor === b2JointDef) this.b2JointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2JointDef = b2JointDef;\n\n function b2JointEdge() {\n b2JointEdge.b2JointEdge.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2JointEdge = b2JointEdge;\n\n function b2LineJoint() {\n b2LineJoint.b2LineJoint.apply(this, arguments);\n if (this.constructor === b2LineJoint) this.b2LineJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2LineJoint = b2LineJoint;\n\n function b2LineJointDef() {\n b2LineJointDef.b2LineJointDef.apply(this, arguments);\n if (this.constructor === b2LineJointDef) this.b2LineJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2LineJointDef = b2LineJointDef;\n\n function b2MouseJoint() {\n b2MouseJoint.b2MouseJoint.apply(this, arguments);\n if (this.constructor === b2MouseJoint) this.b2MouseJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2MouseJoint = b2MouseJoint;\n\n function b2MouseJointDef() {\n b2MouseJointDef.b2MouseJointDef.apply(this, arguments);\n if (this.constructor === b2MouseJointDef) this.b2MouseJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2MouseJointDef = b2MouseJointDef;\n\n function b2PrismaticJoint() {\n b2PrismaticJoint.b2PrismaticJoint.apply(this, arguments);\n if (this.constructor === b2PrismaticJoint) this.b2PrismaticJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PrismaticJoint = b2PrismaticJoint;\n\n function b2PrismaticJointDef() {\n b2PrismaticJointDef.b2PrismaticJointDef.apply(this, arguments);\n if (this.constructor === b2PrismaticJointDef) this.b2PrismaticJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PrismaticJointDef = b2PrismaticJointDef;\n\n function b2PulleyJoint() {\n b2PulleyJoint.b2PulleyJoint.apply(this, arguments);\n if (this.constructor === b2PulleyJoint) this.b2PulleyJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PulleyJoint = b2PulleyJoint;\n\n function b2PulleyJointDef() {\n b2PulleyJointDef.b2PulleyJointDef.apply(this, arguments);\n if (this.constructor === b2PulleyJointDef) this.b2PulleyJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2PulleyJointDef = b2PulleyJointDef;\n\n function b2RevoluteJoint() {\n b2RevoluteJoint.b2RevoluteJoint.apply(this, arguments);\n if (this.constructor === b2RevoluteJoint) this.b2RevoluteJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2RevoluteJoint = b2RevoluteJoint;\n\n function b2RevoluteJointDef() {\n b2RevoluteJointDef.b2RevoluteJointDef.apply(this, arguments);\n if (this.constructor === b2RevoluteJointDef) this.b2RevoluteJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2RevoluteJointDef = b2RevoluteJointDef;\n\n function b2WeldJoint() {\n b2WeldJoint.b2WeldJoint.apply(this, arguments);\n if (this.constructor === b2WeldJoint) this.b2WeldJoint.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2WeldJoint = b2WeldJoint;\n\n function b2WeldJointDef() {\n b2WeldJointDef.b2WeldJointDef.apply(this, arguments);\n if (this.constructor === b2WeldJointDef) this.b2WeldJointDef.apply(this, arguments);\n };\n Box2D.Dynamics.Joints.b2WeldJointDef = b2WeldJointDef;\n})(); //definitions\n_A2J_postDefs = []; /* source: disabled*/\n(function () {\n var Dictionary = flash.utils.Dictionary;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2internal = Box2D.Common.b2internal;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2internal = Box2D.Common.b2internal;\n var b2internal = Box2D.Common.b2internal;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n b2AABB.b2AABB = function () {\n this.lowerBound = new b2Vec2();\n this.upperBound = new b2Vec2();\n };\n b2AABB.prototype.IsValid = function () {\n var dX = this.upperBound.x - this.lowerBound.x;\n var dY = this.upperBound.y - this.lowerBound.y;\n var valid = dX >= 0.0 && dY >= 0.0;\n valid = valid && this.lowerBound.IsValid() && this.upperBound.IsValid();\n return valid;\n }\n b2AABB.prototype.GetCenter = function () {\n return new b2Vec2((this.lowerBound.x + this.upperBound.x) / 2, (this.lowerBound.y + this.upperBound.y) / 2);\n }\n b2AABB.prototype.GetExtents = function () {\n return new b2Vec2((this.upperBound.x - this.lowerBound.x) / 2, (this.upperBound.y - this.lowerBound.y) / 2);\n }\n b2AABB.prototype.Contains = function (aabb) {\n var result = true;\n result = result && this.lowerBound.x <= aabb.lowerBound.x;\n result = result && this.lowerBound.y <= aabb.lowerBound.y;\n result = result && aabb.upperBound.x <= this.upperBound.x;\n result = result && aabb.upperBound.y <= this.upperBound.y;\n return result;\n }\n b2AABB.prototype.RayCast = function (output, input) {\n var tmin = (-Number.MAX_VALUE);\n var tmax = Number.MAX_VALUE;\n var pX = input.p1.x;\n var pY = input.p1.y;\n var dX = input.p2.x - input.p1.x;\n var dY = input.p2.y - input.p1.y;\n var absDX = Math.abs(dX);\n var absDY = Math.abs(dY);\n var normal = output.normal;\n var inv_d = 0;\n var t1 = 0;\n var t2 = 0;\n var t3 = 0;\n var s = 0; {\n if (absDX < Number.MIN_VALUE) {\n if (pX < this.lowerBound.x || this.upperBound.x < pX) return false;\n }\n else {\n inv_d = 1.0 / dX;\n t1 = (this.lowerBound.x - pX) * inv_d;\n t2 = (this.upperBound.x - pX) * inv_d;\n s = (-1.0);\n if (t1 > t2) {\n t3 = t1;\n t1 = t2;\n t2 = t3;\n s = 1.0;\n }\n if (t1 > tmin) {\n normal.x = s;\n normal.y = 0;\n tmin = t1;\n }\n tmax = Math.min(tmax, t2);\n if (tmin > tmax) return false;\n }\n } {\n if (absDY < Number.MIN_VALUE) {\n if (pY < this.lowerBound.y || this.upperBound.y < pY) return false;\n }\n else {\n inv_d = 1.0 / dY;\n t1 = (this.lowerBound.y - pY) * inv_d;\n t2 = (this.upperBound.y - pY) * inv_d;\n s = (-1.0);\n if (t1 > t2) {\n t3 = t1;\n t1 = t2;\n t2 = t3;\n s = 1.0;\n }\n if (t1 > tmin) {\n normal.y = s;\n normal.x = 0;\n tmin = t1;\n }\n tmax = Math.min(tmax, t2);\n if (tmin > tmax) return false;\n }\n }\n output.fraction = tmin;\n return true;\n }\n b2AABB.prototype.TestOverlap = function (other) {\n var d1X = other.lowerBound.x - this.upperBound.x;\n var d1Y = other.lowerBound.y - this.upperBound.y;\n var d2X = this.lowerBound.x - other.upperBound.x;\n var d2Y = this.lowerBound.y - other.upperBound.y;\n if (d1X > 0.0 || d1Y > 0.0) return false;\n if (d2X > 0.0 || d2Y > 0.0) return false;\n return true;\n }\n b2AABB.prototype.Combine = function (aabb1, aabb2) {\n var aabb = new b2AABB();\n if (this.constructor === Box2D.Collision.b2AABB) this._a2j__Combine(aabb1, aabb2);\n else aabb._a2j__Combine(aabb1, aabb2);\n return aabb;\n }\n b2AABB.Combine = b2AABB.prototype.Combine;\n b2AABB.prototype._a2j__Combine = function (aabb1, aabb2) {\n this.lowerBound.x = Math.min(aabb1.lowerBound.x, aabb2.lowerBound.x);\n this.lowerBound.y = Math.min(aabb1.lowerBound.y, aabb2.lowerBound.y);\n this.upperBound.x = Math.max(aabb1.upperBound.x, aabb2.upperBound.x);\n this.upperBound.y = Math.max(aabb1.upperBound.y, aabb2.upperBound.y);\n }\n b2Bound.b2Bound = function () {};\n b2Bound.prototype.IsLower = function () {\n return (this.value & 1) == 0;\n }\n b2Bound.prototype.IsUpper = function () {\n return (this.value & 1) == 1;\n }\n b2Bound.prototype.Swap = function (b) {\n var tempValue = this.value;\n var tempProxy = this.proxy;\n var tempStabbingCount = this.stabbingCount;\n this.value = b.value;\n this.proxy = b.proxy;\n this.stabbingCount = b.stabbingCount;\n b.value = tempValue;\n b.proxy = tempProxy;\n b.stabbingCount = tempStabbingCount;\n }\n b2BoundValues.b2BoundValues = function () {};\n b2BoundValues.prototype.b2BoundValues = function () {\n this.lowerValues = new Vector_a2j_Number();\n this.lowerValues[0] = 0.0;\n this.lowerValues[1] = 0.0;\n this.upperValues = new Vector_a2j_Number();\n this.upperValues[0] = 0.0;\n this.upperValues[1] = 0.0;\n }\n b2BroadPhase.b2BroadPhase = function () {\n this.m_pairManager = new b2PairManager();\n this.m_proxyPool = new Array();\n this.m_querySortKeys = new Array();\n this.m_queryResults = new Array();\n this.m_quantizationFactor = new b2Vec2();\n };\n b2BroadPhase.prototype.b2BroadPhase = function (worldAABB) {\n var i = 0;\n this.m_pairManager.Initialize(this);\n this.m_worldAABB = worldAABB;\n this.m_proxyCount = 0;\n this.m_bounds = new Vector();\n for (i = 0;\n i < 2; i++) {\n this.m_bounds[i] = new Vector();\n }\n var dX = worldAABB.upperBound.x - worldAABB.lowerBound.x;\n var dY = worldAABB.upperBound.y - worldAABB.lowerBound.y;\n this.m_quantizationFactor.x = b2Settings.USHRT_MAX / dX;\n this.m_quantizationFactor.y = b2Settings.USHRT_MAX / dY;\n this.m_timeStamp = 1;\n this.m_queryResultCount = 0;\n }\n b2BroadPhase.prototype.InRange = function (aabb) {\n var dX = 0;\n var dY = 0;\n var d2X = 0;\n var d2Y = 0;\n dX = aabb.lowerBound.x;\n dY = aabb.lowerBound.y;\n dX -= this.m_worldAABB.upperBound.x;\n dY -= this.m_worldAABB.upperBound.y;\n d2X = this.m_worldAABB.lowerBound.x;\n d2Y = this.m_worldAABB.lowerBound.y;\n d2X -= aabb.upperBound.x;\n d2Y -= aabb.upperBound.y;\n dX = b2Math.Max(dX, d2X);\n dY = b2Math.Max(dY, d2Y);\n return b2Math.Max(dX, dY) < 0.0;\n }\n b2BroadPhase.prototype.CreateProxy = function (aabb, userData) {\n var index = 0;\n var proxy;\n var i = 0;\n var j = 0;\n if (!this.m_freeProxy) {\n this.m_freeProxy = this.m_proxyPool[this.m_proxyCount] = new b2Proxy();\n this.m_freeProxy.next = null;\n this.m_freeProxy.timeStamp = 0;\n this.m_freeProxy.overlapCount = b2BroadPhase.b2_invalid;\n this.m_freeProxy.userData = null;\n for (i = 0;\n i < 2; i++) {\n j = this.m_proxyCount * 2;\n this.m_bounds[i][j++] = new b2Bound();\n this.m_bounds[i][j] = new b2Bound();\n }\n }\n proxy = this.m_freeProxy;\n this.m_freeProxy = proxy.next;\n proxy.overlapCount = 0;\n proxy.userData = userData;\n var boundCount = 2 * this.m_proxyCount;\n var lowerValues = new Vector_a2j_Number();\n var upperValues = new Vector_a2j_Number();\n this.ComputeBounds(lowerValues, upperValues, aabb);\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var lowerIndex = 0;\n var upperIndex = 0;\n var lowerIndexOut = new Vector_a2j_Number();\n lowerIndexOut.push(lowerIndex);\n var upperIndexOut = new Vector_a2j_Number();\n upperIndexOut.push(upperIndex);\n this.QueryAxis(lowerIndexOut, upperIndexOut, lowerValues[axis], upperValues[axis], bounds, boundCount, axis);\n lowerIndex = lowerIndexOut[0];\n upperIndex = upperIndexOut[0];\n bounds.splice(upperIndex, 0, bounds[bounds.length - 1]);\n bounds.length--;\n bounds.splice(lowerIndex, 0, bounds[bounds.length - 1]);\n bounds.length--;\n ++upperIndex;\n var tBound1 = bounds[lowerIndex];\n var tBound2 = bounds[upperIndex];\n tBound1.value = lowerValues[axis];\n tBound1.proxy = proxy;\n tBound2.value = upperValues[axis];\n tBound2.proxy = proxy;\n var tBoundAS3 = bounds[parseInt(lowerIndex - 1)];\n tBound1.stabbingCount = lowerIndex == 0 ? 0 : tBoundAS3.stabbingCount;\n tBoundAS3 = bounds[parseInt(upperIndex - 1)];\n tBound2.stabbingCount = tBoundAS3.stabbingCount;\n for (index = lowerIndex;\n index < upperIndex; ++index) {\n tBoundAS3 = bounds[index];\n tBoundAS3.stabbingCount++;\n }\n for (index = lowerIndex;\n index < boundCount + 2; ++index) {\n tBound1 = bounds[index];\n var proxy2 = tBound1.proxy;\n if (tBound1.IsLower()) {\n proxy2.lowerBounds[axis] = index;\n }\n else {\n proxy2.upperBounds[axis] = index;\n }\n }\n }++this.m_proxyCount;\n for (i = 0;\n i < this.m_queryResultCount; ++i) {\n this.m_pairManager.AddBufferedPair(proxy, this.m_queryResults[i]);\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n return proxy;\n }\n b2BroadPhase.prototype.DestroyProxy = function (proxy_) {\n var proxy = (proxy_ instanceof b2Proxy ? proxy_ : null);\n var tBound1;\n var tBound2;\n var boundCount = parseInt(2 * this.m_proxyCount);\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var lowerIndex = proxy.lowerBounds[axis];\n var upperIndex = proxy.upperBounds[axis];\n tBound1 = bounds[lowerIndex];\n var lowerValue = tBound1.value;\n tBound2 = bounds[upperIndex];\n var upperValue = tBound2.value;\n bounds.splice(upperIndex, 1);\n bounds.splice(lowerIndex, 1);\n bounds.push(tBound1);\n bounds.push(tBound2);\n var tEnd = parseInt(boundCount - 2);\n for (var index = lowerIndex; index < tEnd; ++index) {\n tBound1 = bounds[index];\n var proxy2 = tBound1.proxy;\n if (tBound1.IsLower()) {\n proxy2.lowerBounds[axis] = index;\n }\n else {\n proxy2.upperBounds[axis] = index;\n }\n }\n tEnd = upperIndex - 1;\n for (var index2 = parseInt(lowerIndex); index2 < tEnd; ++index2) {\n tBound1 = bounds[index2];\n tBound1.stabbingCount--;\n }\n var ignore = new Vector_a2j_Number();\n this.QueryAxis(ignore, ignore, lowerValue, upperValue, bounds, boundCount - 2, axis);\n }\n for (var i = 0; i < this.m_queryResultCount; ++i) {\n this.m_pairManager.RemoveBufferedPair(proxy, this.m_queryResults[i]);\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n proxy.userData = null;\n proxy.overlapCount = b2BroadPhase.b2_invalid;\n proxy.lowerBounds[0] = b2BroadPhase.b2_invalid;\n proxy.lowerBounds[1] = b2BroadPhase.b2_invalid;\n proxy.upperBounds[0] = b2BroadPhase.b2_invalid;\n proxy.upperBounds[1] = b2BroadPhase.b2_invalid;\n proxy.next = this.m_freeProxy;\n this.m_freeProxy = proxy;\n --this.m_proxyCount;\n }\n b2BroadPhase.prototype.MoveProxy = function (proxy_, aabb, displacement) {\n var proxy = (proxy_ instanceof b2Proxy ? proxy_ : null);\n var as3arr;\n var as3int = 0;\n var axis = 0;\n var index = 0;\n var bound;\n var prevBound;\n var nextBound;\n var nextProxyId = 0;\n var nextProxy;\n if (proxy == null) {\n return;\n }\n if (aabb.IsValid() == false) {\n return;\n }\n var boundCount = 2 * this.m_proxyCount;\n var newValues = new b2BoundValues();\n this.ComputeBounds(newValues.lowerValues, newValues.upperValues, aabb);\n var oldValues = new b2BoundValues();\n for (axis = 0;\n axis < 2; ++axis) {\n bound = this.m_bounds[axis][proxy.lowerBounds[axis]];\n oldValues.lowerValues[axis] = bound.value;\n bound = this.m_bounds[axis][proxy.upperBounds[axis]];\n oldValues.upperValues[axis] = bound.value;\n }\n for (axis = 0;\n axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var lowerIndex = proxy.lowerBounds[axis];\n var upperIndex = proxy.upperBounds[axis];\n var lowerValue = newValues.lowerValues[axis];\n var upperValue = newValues.upperValues[axis];\n bound = bounds[lowerIndex];\n var deltaLower = parseInt(lowerValue - bound.value);\n bound.value = lowerValue;\n bound = bounds[upperIndex];\n var deltaUpper = parseInt(upperValue - bound.value);\n bound.value = upperValue;\n if (deltaLower < 0) {\n index = lowerIndex;\n while (index > 0 && lowerValue < ((bounds[parseInt(index - 1)] instanceof b2Bound ? bounds[parseInt(index - 1)] : null)).value) {\n bound = bounds[index];\n prevBound = bounds[parseInt(index - 1)];\n var prevProxy = prevBound.proxy;\n prevBound.stabbingCount++;\n if (prevBound.IsUpper() == true) {\n if (this.TestOverlapBound(newValues, prevProxy)) {\n this.m_pairManager.AddBufferedPair(proxy, prevProxy);\n }\n as3arr = prevProxy.upperBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n else {\n as3arr = prevProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n as3arr = proxy.lowerBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.Swap(prevBound);\n --index;\n }\n }\n if (deltaUpper > 0) {\n index = upperIndex;\n while (index < boundCount - 1 && ((bounds[parseInt(index + 1)] instanceof b2Bound ? bounds[parseInt(index + 1)] : null)).value <= upperValue) {\n bound = bounds[index];\n nextBound = bounds[parseInt(index + 1)];\n nextProxy = nextBound.proxy;\n nextBound.stabbingCount++;\n if (nextBound.IsLower() == true) {\n if (this.TestOverlapBound(newValues, nextProxy)) {\n this.m_pairManager.AddBufferedPair(proxy, nextProxy);\n }\n as3arr = nextProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n else {\n as3arr = nextProxy.upperBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n as3arr = proxy.upperBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.Swap(nextBound);\n index++;\n }\n }\n if (deltaLower > 0) {\n index = lowerIndex;\n while (index < boundCount - 1 && ((bounds[parseInt(index + 1)] instanceof b2Bound ? bounds[parseInt(index + 1)] : null)).value <= lowerValue) {\n bound = bounds[index];\n nextBound = bounds[parseInt(index + 1)];\n nextProxy = nextBound.proxy;\n nextBound.stabbingCount--;\n if (nextBound.IsUpper()) {\n if (this.TestOverlapBound(oldValues, nextProxy)) {\n this.m_pairManager.RemoveBufferedPair(proxy, nextProxy);\n }\n as3arr = nextProxy.upperBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n else {\n as3arr = nextProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n as3arr = proxy.lowerBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.Swap(nextBound);\n index++;\n }\n }\n if (deltaUpper < 0) {\n index = upperIndex;\n while (index > 0 && upperValue < ((bounds[parseInt(index - 1)] instanceof b2Bound ? bounds[parseInt(index - 1)] : null)).value) {\n bound = bounds[index];\n prevBound = bounds[parseInt(index - 1)];\n prevProxy = prevBound.proxy;\n prevBound.stabbingCount--;\n if (prevBound.IsLower() == true) {\n if (this.TestOverlapBound(oldValues, prevProxy)) {\n this.m_pairManager.RemoveBufferedPair(proxy, prevProxy);\n }\n as3arr = prevProxy.lowerBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount--;\n }\n else {\n as3arr = prevProxy.upperBounds;\n as3int = as3arr[axis];\n as3int++;\n as3arr[axis] = as3int;\n bound.stabbingCount++;\n }\n as3arr = proxy.upperBounds;\n as3int = as3arr[axis];\n as3int--;\n as3arr[axis] = as3int;\n bound.Swap(prevBound);\n index--;\n }\n }\n }\n }\n b2BroadPhase.prototype.UpdatePairs = function (callback) {\n this.m_pairManager.Commit(callback);\n }\n b2BroadPhase.prototype.TestOverlap = function (proxyA, proxyB) {\n var proxyA_ = (proxyA instanceof b2Proxy ? proxyA : null);\n var proxyB_ = (proxyB instanceof b2Proxy ? proxyB : null);\n if (proxyA_.lowerBounds[0] > proxyB_.upperBounds[0]) return false;\n if (proxyB_.lowerBounds[0] > proxyA_.upperBounds[0]) return false;\n if (proxyA_.lowerBounds[1] > proxyB_.upperBounds[1]) return false;\n if (proxyB_.lowerBounds[1] > proxyA_.upperBounds[1]) return false;\n return true;\n }\n b2BroadPhase.prototype.GetUserData = function (proxy) {\n return ((proxy instanceof b2Proxy ? proxy : null)).userData;\n }\n b2BroadPhase.prototype.GetFatAABB = function (proxy_) {\n var aabb = new b2AABB();\n var proxy = (proxy_ instanceof b2Proxy ? proxy_ : null);\n aabb.lowerBound.x = this.m_worldAABB.lowerBound.x + this.m_bounds[0][proxy.lowerBounds[0]].value / this.m_quantizationFactor.x;\n aabb.lowerBound.y = this.m_worldAABB.lowerBound.y + this.m_bounds[1][proxy.lowerBounds[1]].value / this.m_quantizationFactor.y;\n aabb.upperBound.x = this.m_worldAABB.lowerBound.x + this.m_bounds[0][proxy.upperBounds[0]].value / this.m_quantizationFactor.x;\n aabb.upperBound.y = this.m_worldAABB.lowerBound.y + this.m_bounds[1][proxy.upperBounds[1]].value / this.m_quantizationFactor.y;\n return aabb;\n }\n b2BroadPhase.prototype.GetProxyCount = function () {\n return this.m_proxyCount;\n }\n b2BroadPhase.prototype.Query = function (callback, aabb) {\n var lowerValues = new Vector_a2j_Number();\n var upperValues = new Vector_a2j_Number();\n this.ComputeBounds(lowerValues, upperValues, aabb);\n var lowerIndex = 0;\n var upperIndex = 0;\n var lowerIndexOut = new Vector_a2j_Number();\n lowerIndexOut.push(lowerIndex);\n var upperIndexOut = new Vector_a2j_Number();\n upperIndexOut.push(upperIndex);\n this.QueryAxis(lowerIndexOut, upperIndexOut, lowerValues[0], upperValues[0], this.m_bounds[0], 2 * this.m_proxyCount, 0);\n this.QueryAxis(lowerIndexOut, upperIndexOut, lowerValues[1], upperValues[1], this.m_bounds[1], 2 * this.m_proxyCount, 1);\n for (var i = 0; i < this.m_queryResultCount; ++i) {\n var proxy = this.m_queryResults[i];\n if (!callback(proxy)) {\n break;\n }\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n }\n b2BroadPhase.prototype.Validate = function () {\n var pair;\n var proxy1;\n var proxy2;\n var overlap;\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var boundCount = 2 * this.m_proxyCount;\n var stabbingCount = 0;\n for (var i = 0; i < boundCount; ++i) {\n var bound = bounds[i];\n if (bound.IsLower() == true) {\n stabbingCount++;\n }\n else {\n stabbingCount--;\n }\n }\n }\n }\n b2BroadPhase.prototype.Rebalance = function (iterations) {\n if (iterations === undefined) iterations = 0;\n }\n b2BroadPhase.prototype.RayCast = function (callback, input) {\n var subInput = new b2RayCastInput();\n subInput.p1.SetV(input.p1);\n subInput.p2.SetV(input.p2);\n subInput.maxFraction = input.maxFraction;\n var dx = (input.p2.x - input.p1.x) * this.m_quantizationFactor.x;\n var dy = (input.p2.y - input.p1.y) * this.m_quantizationFactor.y;\n var sx = parseInt(dx < (-Number.MIN_VALUE ? (-1) : (dx > Number.MIN_VALUE ? 1 : 0)));\n var sy = parseInt(dy < (-Number.MIN_VALUE ? (-1) : (dy > Number.MIN_VALUE ? 1 : 0)));\n var p1x = this.m_quantizationFactor.x * (input.p1.x - this.m_worldAABB.lowerBound.x);\n var p1y = this.m_quantizationFactor.y * (input.p1.y - this.m_worldAABB.lowerBound.y);\n var startValues = new Array();\n var startValues2 = new Array();\n startValues[0] = a2j.parseUInt(p1x) & (b2Settings.USHRT_MAX - 1);\n startValues[1] = a2j.parseUInt(p1y) & (b2Settings.USHRT_MAX - 1);\n startValues2[0] = startValues[0] + 1;\n startValues2[1] = startValues[1] + 1;\n var startIndices = new Array();\n var xIndex = 0;\n var yIndex = 0;\n var proxy;\n var lowerIndex = 0;\n var upperIndex = 0;\n var lowerIndexOut = new Vector_a2j_Number();\n lowerIndexOut.push(lowerIndex);\n var upperIndexOut = new Vector_a2j_Number();\n upperIndexOut.push(upperIndex);\n this.QueryAxis(lowerIndexOut, upperIndexOut, startValues[0], startValues2[0], this.m_bounds[0], 2 * this.m_proxyCount, 0);\n if (sx >= 0) xIndex = upperIndexOut[0] - 1;\n else xIndex = lowerIndexOut[0];\n this.QueryAxis(lowerIndexOut, upperIndexOut, startValues[1], startValues2[1], this.m_bounds[1], 2 * this.m_proxyCount, 1);\n if (sy >= 0) yIndex = upperIndexOut[0] - 1;\n else yIndex = lowerIndexOut[0];\n for (var i = 0; i < this.m_queryResultCount; i++) {\n subInput.maxFraction = callback(subInput, this.m_queryResults[i]);\n }\n for (;;) {\n var xProgress = 0;\n var yProgress = 0;\n xIndex += sx >= 0 ? 1 : (-1);\n if (xIndex < 0 || xIndex >= this.m_proxyCount * 2) break;\n if (sx != 0) {\n xProgress = (this.m_bounds[0][xIndex].value - p1x) / dx;\n }\n yIndex += sy >= 0 ? 1 : (-1);\n if (yIndex < 0 || yIndex >= this.m_proxyCount * 2) break;\n if (sy != 0) {\n yProgress = (this.m_bounds[1][yIndex].value - p1y) / dy;\n }\n for (;;) {\n if (sy == 0 || (sx != 0 && xProgress < yProgress)) {\n if (xProgress > subInput.maxFraction) break;\n if (sx > 0 ? this.m_bounds[0][xIndex].IsLower() : this.m_bounds[0][xIndex].IsUpper()) {\n proxy = this.m_bounds[0][xIndex].proxy;\n if (sy >= 0) {\n if (proxy.lowerBounds[1] <= yIndex - 1 && proxy.upperBounds[1] >= yIndex) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n else {\n if (proxy.lowerBounds[1] <= yIndex && proxy.upperBounds[1] >= yIndex + 1) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n }\n if (subInput.maxFraction == 0) break;\n if (sx > 0) {\n xIndex++;\n if (xIndex == this.m_proxyCount * 2) break;\n }\n else {\n xIndex--;\n if (xIndex < 0) break;\n }\n xProgress = (this.m_bounds[0][xIndex].value - p1x) / dx;\n }\n else {\n if (yProgress > subInput.maxFraction) break;\n if (sy > 0 ? this.m_bounds[1][yIndex].IsLower() : this.m_bounds[1][yIndex].IsUpper()) {\n proxy = this.m_bounds[1][yIndex].proxy;\n if (sx >= 0) {\n if (proxy.lowerBounds[0] <= xIndex - 1 && proxy.upperBounds[0] >= xIndex) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n else {\n if (proxy.lowerBounds[0] <= xIndex && proxy.upperBounds[0] >= xIndex + 1) {\n subInput.maxFraction = callback(subInput, proxy);\n }\n }\n }\n if (subInput.maxFraction == 0) break;\n if (sy > 0) {\n yIndex++;\n if (yIndex == this.m_proxyCount * 2) break;\n }\n else {\n yIndex--;\n if (yIndex < 0) break;\n }\n yProgress = (this.m_bounds[1][yIndex].value - p1y) / dy;\n }\n }\n break;\n }\n this.m_queryResultCount = 0;\n this.IncrementTimeStamp();\n return;\n }\n b2BroadPhase.prototype.ComputeBounds = function (lowerValues, upperValues, aabb) {\n var minVertexX = aabb.lowerBound.x;\n var minVertexY = aabb.lowerBound.y;\n minVertexX = b2Math.Min(minVertexX, this.m_worldAABB.upperBound.x);\n minVertexY = b2Math.Min(minVertexY, this.m_worldAABB.upperBound.y);\n minVertexX = b2Math.Max(minVertexX, this.m_worldAABB.lowerBound.x);\n minVertexY = b2Math.Max(minVertexY, this.m_worldAABB.lowerBound.y);\n var maxVertexX = aabb.upperBound.x;\n var maxVertexY = aabb.upperBound.y;\n maxVertexX = b2Math.Min(maxVertexX, this.m_worldAABB.upperBound.x);\n maxVertexY = b2Math.Min(maxVertexY, this.m_worldAABB.upperBound.y);\n maxVertexX = b2Math.Max(maxVertexX, this.m_worldAABB.lowerBound.x);\n maxVertexY = b2Math.Max(maxVertexY, this.m_worldAABB.lowerBound.y);\n lowerValues[0] = a2j.parseUInt(this.m_quantizationFactor.x * (minVertexX - this.m_worldAABB.lowerBound.x)) & (b2Settings.USHRT_MAX - 1);\n upperValues[0] = (a2j.parseUInt(this.m_quantizationFactor.x * (maxVertexX - this.m_worldAABB.lowerBound.x)) & 0x0000ffff) | 1;\n lowerValues[1] = a2j.parseUInt(this.m_quantizationFactor.y * (minVertexY - this.m_worldAABB.lowerBound.y)) & (b2Settings.USHRT_MAX - 1);\n upperValues[1] = (a2j.parseUInt(this.m_quantizationFactor.y * (maxVertexY - this.m_worldAABB.lowerBound.y)) & 0x0000ffff) | 1;\n }\n b2BroadPhase.prototype.TestOverlapValidate = function (p1, p2) {\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var bound1 = bounds[p1.lowerBounds[axis]];\n var bound2 = bounds[p2.upperBounds[axis]];\n if (bound1.value > bound2.value) return false;\n bound1 = bounds[p1.upperBounds[axis]];\n bound2 = bounds[p2.lowerBounds[axis]];\n if (bound1.value < bound2.value) return false;\n }\n return true;\n }\n b2BroadPhase.prototype.TestOverlapBound = function (b, p) {\n for (var axis = 0; axis < 2; ++axis) {\n var bounds = this.m_bounds[axis];\n var bound = bounds[p.upperBounds[axis]];\n if (b.lowerValues[axis] > bound.value) return false;\n bound = bounds[p.lowerBounds[axis]];\n if (b.upperValues[axis] < bound.value) return false;\n }\n return true;\n }\n b2BroadPhase.prototype.QueryAxis = function (lowerQueryOut, upperQueryOut, lowerValue, upperValue, bounds, boundCount, axis) {\n if (lowerValue === undefined) lowerValue = 0;\n if (upperValue === undefined) upperValue = 0;\n if (boundCount === undefined) boundCount = 0;\n if (axis === undefined) axis = 0;\n var lowerQuery = this.BinarySearch(bounds, boundCount, lowerValue);\n var upperQuery = this.BinarySearch(bounds, boundCount, upperValue);\n var bound;\n for (var j = lowerQuery; j < upperQuery; ++j) {\n bound = bounds[j];\n if (bound.IsLower()) {\n this.IncrementOverlapCount(bound.proxy);\n }\n }\n if (lowerQuery > 0) {\n var i = parseInt(lowerQuery - 1);\n bound = bounds[i];\n var s = parseInt(bound.stabbingCount);\n while (s) {\n bound = bounds[i];\n if (bound.IsLower()) {\n var proxy = bound.proxy;\n if (lowerQuery <= proxy.upperBounds[axis]) {\n this.IncrementOverlapCount(bound.proxy);\n --s;\n }\n }--i;\n }\n }\n lowerQueryOut[0] = lowerQuery;\n upperQueryOut[0] = upperQuery;\n }\n b2BroadPhase.prototype.IncrementOverlapCount = function (proxy) {\n if (proxy.timeStamp < this.m_timeStamp) {\n proxy.timeStamp = this.m_timeStamp;\n proxy.overlapCount = 1;\n }\n else {\n proxy.overlapCount = 2;\n this.m_queryResults[this.m_queryResultCount] = proxy;\n ++this.m_queryResultCount;\n }\n }\n b2BroadPhase.prototype.IncrementTimeStamp = function () {\n if (this.m_timeStamp == b2Settings.USHRT_MAX) {\n for (var i = 0; i < this.m_proxyPool.length; ++i) {\n ((this.m_proxyPool[i] instanceof b2Proxy ? this.m_proxyPool[i] : null)).timeStamp = 0;\n }\n this.m_timeStamp = 1;\n }\n else {\n ++this.m_timeStamp;\n }\n }\n b2BroadPhase.prototype.BinarySearch = function (bounds, count, value) {\n if (count === undefined) count = 0;\n if (value === undefined) value = 0;\n var low = 0;\n var high = parseInt(count - 1);\n while (low <= high) {\n var mid = parseInt(((low + high) / 2));\n var bound = bounds[mid];\n if (bound.value > value) {\n high = mid - 1;\n }\n else if (bound.value < value) {\n low = mid + 1;\n }\n else {\n return a2j.parseUInt(mid);\n }\n }\n return a2j.parseUInt(low);\n }\n b2BroadPhase.BinarySearch = b2BroadPhase.prototype.BinarySearch;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2BroadPhase.s_validate = false;\n Box2D.Collision.b2BroadPhase.prototype.s_validate = Box2D.Collision.b2BroadPhase.s_validate;\n Box2D.Collision.b2BroadPhase.b2_invalid = parseInt(b2Settings.USHRT_MAX);\n Box2D.Collision.b2BroadPhase.prototype.b2_invalid = Box2D.Collision.b2BroadPhase.b2_invalid;\n Box2D.Collision.b2BroadPhase.b2_nullEdge = parseInt(b2Settings.USHRT_MAX);\n Box2D.Collision.b2BroadPhase.prototype.b2_nullEdge = Box2D.Collision.b2BroadPhase.b2_nullEdge;\n });\n b2BroadPhase.__implements = {};\n b2BroadPhase.__implements[IBroadPhase] = true;\n b2Collision.b2Collision = function () {};\n b2Collision.prototype.ClipSegmentToLine = function (vOut, vIn, normal, offset) {\n if (offset === undefined) offset = 0;\n var cv;\n var numOut = 0;\n cv = vIn[0];\n var vIn0 = cv.v;\n cv = vIn[1];\n var vIn1 = cv.v;\n var distance0 = normal.x * vIn0.x + normal.y * vIn0.y - offset;\n var distance1 = normal.x * vIn1.x + normal.y * vIn1.y - offset;\n if (distance0 <= 0.0) vOut[numOut++].Set(vIn[0]);\n if (distance1 <= 0.0) vOut[numOut++].Set(vIn[1]);\n if (distance0 * distance1 < 0.0) {\n var interp = distance0 / (distance0 - distance1);\n cv = vOut[numOut];\n var tVec = cv.v;\n tVec.x = vIn0.x + interp * (vIn1.x - vIn0.x);\n tVec.y = vIn0.y + interp * (vIn1.y - vIn0.y);\n cv = vOut[numOut];\n var cv2;\n if (distance0 > 0.0) {\n cv2 = vIn[0];\n cv.id = cv2.id;\n }\n else {\n cv2 = vIn[1];\n cv.id = cv2.id;\n }++numOut;\n }\n return numOut;\n }\n b2Collision.ClipSegmentToLine = b2Collision.prototype.ClipSegmentToLine;\n b2Collision.prototype.EdgeSeparation = function (poly1, xf1, edge1, poly2, xf2) {\n if (edge1 === undefined) edge1 = 0;\n var count1 = parseInt(poly1.m_vertexCount);\n var vertices1 = poly1.m_vertices;\n var normals1 = poly1.m_normals;\n var count2 = parseInt(poly2.m_vertexCount);\n var vertices2 = poly2.m_vertices;\n var tMat;\n var tVec;\n tMat = xf1.R;\n tVec = normals1[edge1];\n var normal1WorldX = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var normal1WorldY = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf2.R;\n var normal1X = (tMat.col1.x * normal1WorldX + tMat.col1.y * normal1WorldY);\n var normal1Y = (tMat.col2.x * normal1WorldX + tMat.col2.y * normal1WorldY);\n var index = 0;\n var minDot = Number.MAX_VALUE;\n for (var i = 0; i < count2; ++i) {\n tVec = vertices2[i];\n var dot = tVec.x * normal1X + tVec.y * normal1Y;\n if (dot < minDot) {\n minDot = dot;\n index = i;\n }\n }\n tVec = vertices1[edge1];\n tMat = xf1.R;\n var v1X = xf1.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var v1Y = xf1.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = vertices2[index];\n tMat = xf2.R;\n var v2X = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var v2Y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n v2X -= v1X;\n v2Y -= v1Y;\n var separation = v2X * normal1WorldX + v2Y * normal1WorldY;\n return separation;\n }\n b2Collision.EdgeSeparation = b2Collision.prototype.EdgeSeparation;\n b2Collision.prototype.FindMaxSeparation = function (edgeIndex, poly1, xf1, poly2, xf2) {\n var count1 = parseInt(poly1.m_vertexCount);\n var normals1 = poly1.m_normals;\n var tVec;\n var tMat;\n tMat = xf2.R;\n tVec = poly2.m_centroid;\n var dX = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var dY = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf1.R;\n tVec = poly1.m_centroid;\n dX -= xf1.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n dY -= xf1.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var dLocal1X = (dX * xf1.R.col1.x + dY * xf1.R.col1.y);\n var dLocal1Y = (dX * xf1.R.col2.x + dY * xf1.R.col2.y);\n var edge = 0;\n var maxDot = (-Number.MAX_VALUE);\n for (var i = 0; i < count1; ++i) {\n tVec = normals1[i];\n var dot = (tVec.x * dLocal1X + tVec.y * dLocal1Y);\n if (dot > maxDot) {\n maxDot = dot;\n edge = i;\n }\n }\n var s = this.EdgeSeparation(poly1, xf1, edge, poly2, xf2);\n var prevEdge = parseInt(edge - 1 >= 0 ? edge - 1 : count1 - 1);\n var sPrev = this.EdgeSeparation(poly1, xf1, prevEdge, poly2, xf2);\n var nextEdge = parseInt(edge + 1 < count1 ? edge + 1 : 0);\n var sNext = this.EdgeSeparation(poly1, xf1, nextEdge, poly2, xf2);\n var bestEdge = 0;\n var bestSeparation = 0;\n var increment = 0;\n if (sPrev > s && sPrev > sNext) {\n increment = (-1);\n bestEdge = prevEdge;\n bestSeparation = sPrev;\n }\n else if (sNext > s) {\n increment = 1;\n bestEdge = nextEdge;\n bestSeparation = sNext;\n }\n else {\n edgeIndex[0] = edge;\n return s;\n }\n while (true) {\n if (increment == (-1)) edge = bestEdge - 1 >= 0 ? bestEdge - 1 : count1 - 1;\n else edge = bestEdge + 1 < count1 ? bestEdge + 1 : 0;s = this.EdgeSeparation(poly1, xf1, edge, poly2, xf2);\n if (s > bestSeparation) {\n bestEdge = edge;\n bestSeparation = s;\n }\n else {\n break;\n }\n }\n edgeIndex[0] = bestEdge;\n return bestSeparation;\n }\n b2Collision.FindMaxSeparation = b2Collision.prototype.FindMaxSeparation;\n b2Collision.prototype.FindIncidentEdge = function (c, poly1, xf1, edge1, poly2, xf2) {\n if (edge1 === undefined) edge1 = 0;\n var count1 = parseInt(poly1.m_vertexCount);\n var normals1 = poly1.m_normals;\n var count2 = parseInt(poly2.m_vertexCount);\n var vertices2 = poly2.m_vertices;\n var normals2 = poly2.m_normals;\n var tMat;\n var tVec;\n tMat = xf1.R;\n tVec = normals1[edge1];\n var normal1X = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var normal1Y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf2.R;\n var tX = (tMat.col1.x * normal1X + tMat.col1.y * normal1Y);\n normal1Y = (tMat.col2.x * normal1X + tMat.col2.y * normal1Y);\n normal1X = tX;\n var index = 0;\n var minDot = Number.MAX_VALUE;\n for (var i = 0; i < count2; ++i) {\n tVec = normals2[i];\n var dot = (normal1X * tVec.x + normal1Y * tVec.y);\n if (dot < minDot) {\n minDot = dot;\n index = i;\n }\n }\n var tClip;\n var i1 = parseInt(index);\n var i2 = parseInt(i1 + 1 < count2 ? i1 + 1 : 0);\n tClip = c[0];\n tVec = vertices2[i1];\n tMat = xf2.R;\n tClip.v.x = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n tClip.v.y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tClip.id.features.referenceEdge = edge1;\n tClip.id.features.incidentEdge = i1;\n tClip.id.features.incidentVertex = 0;\n tClip = c[1];\n tVec = vertices2[i2];\n tMat = xf2.R;\n tClip.v.x = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n tClip.v.y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tClip.id.features.referenceEdge = edge1;\n tClip.id.features.incidentEdge = i2;\n tClip.id.features.incidentVertex = 1;\n }\n b2Collision.FindIncidentEdge = b2Collision.prototype.FindIncidentEdge;\n b2Collision.prototype.MakeClipPointVector = function () {\n var r = new Vector(2);\n r[0] = new ClipVertex();\n r[1] = new ClipVertex();\n return r;\n }\n b2Collision.MakeClipPointVector = b2Collision.prototype.MakeClipPointVector;\n b2Collision.prototype.CollidePolygons = function (manifold, polyA, xfA, polyB, xfB) {\n var cv;\n manifold.m_pointCount = 0;\n var totalRadius = polyA.m_radius + polyB.m_radius;\n var edgeA = 0;\n b2Collision.s_edgeAO[0] = edgeA;\n var separationA = this.FindMaxSeparation(b2Collision.s_edgeAO, polyA, xfA, polyB, xfB);\n edgeA = b2Collision.s_edgeAO[0];\n if (separationA > totalRadius) return;\n var edgeB = 0;\n b2Collision.s_edgeBO[0] = edgeB;\n var separationB = this.FindMaxSeparation(b2Collision.s_edgeBO, polyB, xfB, polyA, xfA);\n edgeB = b2Collision.s_edgeBO[0];\n if (separationB > totalRadius) return;\n var poly1;\n var poly2;\n var xf1;\n var xf2;\n var edge1 = 0;\n var flip = 0;\n var k_relativeTol = 0.98;\n var k_absoluteTol = 0.001;\n var tMat;\n if (separationB > k_relativeTol * separationA + k_absoluteTol) {\n poly1 = polyB;\n poly2 = polyA;\n xf1 = xfB;\n xf2 = xfA;\n edge1 = edgeB;\n manifold.m_type = b2Manifold.e_faceB;\n flip = 1;\n }\n else {\n poly1 = polyA;\n poly2 = polyB;\n xf1 = xfA;\n xf2 = xfB;\n edge1 = edgeA;\n manifold.m_type = b2Manifold.e_faceA;\n flip = 0;\n }\n var incidentEdge = b2Collision.s_incidentEdge;\n this.FindIncidentEdge(incidentEdge, poly1, xf1, edge1, poly2, xf2);\n var count1 = parseInt(poly1.m_vertexCount);\n var vertices1 = poly1.m_vertices;\n var local_v11 = vertices1[edge1];\n var local_v12;\n if (edge1 + 1 < count1) {\n local_v12 = vertices1[parseInt(edge1 + 1)];\n }\n else {\n local_v12 = vertices1[0];\n }\n var localTangent = b2Collision.s_localTangent;\n localTangent.Set(local_v12.x - local_v11.x, local_v12.y - local_v11.y);\n localTangent.Normalize();\n var localNormal = b2Collision.s_localNormal;\n localNormal.x = localTangent.y;\n localNormal.y = (-localTangent.x);\n var planePoint = b2Collision.s_planePoint;\n planePoint.Set(0.5 * (local_v11.x + local_v12.x), 0.5 * (local_v11.y + local_v12.y));\n var tangent = b2Collision.s_tangent;\n tMat = xf1.R;\n tangent.x = (tMat.col1.x * localTangent.x + tMat.col2.x * localTangent.y);\n tangent.y = (tMat.col1.y * localTangent.x + tMat.col2.y * localTangent.y);\n var tangent2 = b2Collision.s_tangent2;\n tangent2.x = (-tangent.x);\n tangent2.y = (-tangent.y);\n var normal = b2Collision.s_normal;\n normal.x = tangent.y;\n normal.y = (-tangent.x);\n var v11 = b2Collision.s_v11;\n var v12 = b2Collision.s_v12;\n v11.x = xf1.position.x + (tMat.col1.x * local_v11.x + tMat.col2.x * local_v11.y);\n v11.y = xf1.position.y + (tMat.col1.y * local_v11.x + tMat.col2.y * local_v11.y);\n v12.x = xf1.position.x + (tMat.col1.x * local_v12.x + tMat.col2.x * local_v12.y);\n v12.y = xf1.position.y + (tMat.col1.y * local_v12.x + tMat.col2.y * local_v12.y);\n var frontOffset = normal.x * v11.x + normal.y * v11.y;\n var sideOffset1 = (-tangent.x * v11.x) - tangent.y * v11.y + totalRadius;\n var sideOffset2 = tangent.x * v12.x + tangent.y * v12.y + totalRadius;\n var clipPoints1 = b2Collision.s_clipPoints1;\n var clipPoints2 = b2Collision.s_clipPoints2;\n var np = 0;\n np = this.ClipSegmentToLine(clipPoints1, incidentEdge, tangent2, sideOffset1);\n if (np < 2) return;\n np = this.ClipSegmentToLine(clipPoints2, clipPoints1, tangent, sideOffset2);\n if (np < 2) return;\n manifold.m_localPlaneNormal.SetV(localNormal);\n manifold.m_localPoint.SetV(planePoint);\n var pointCount = 0;\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; ++i) {\n cv = clipPoints2[i];\n var separation = normal.x * cv.v.x + normal.y * cv.v.y - frontOffset;\n if (separation <= totalRadius) {\n var cp = manifold.m_points[pointCount];\n tMat = xf2.R;\n var tX = cv.v.x - xf2.position.x;\n var tY = cv.v.y - xf2.position.y;\n cp.m_localPoint.x = (tX * tMat.col1.x + tY * tMat.col1.y);\n cp.m_localPoint.y = (tX * tMat.col2.x + tY * tMat.col2.y);\n cp.m_id.Set(cv.id);\n cp.m_id.features.flip = flip;\n ++pointCount;\n }\n }\n manifold.m_pointCount = pointCount;\n }\n b2Collision.CollidePolygons = b2Collision.prototype.CollidePolygons;\n b2Collision.prototype.CollideCircles = function (manifold, circle1, xf1, circle2, xf2) {\n manifold.m_pointCount = 0;\n var tMat;\n var tVec;\n tMat = xf1.R;\n tVec = circle1.m_p;\n var p1X = xf1.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var p1Y = xf1.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = xf2.R;\n tVec = circle2.m_p;\n var p2X = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var p2Y = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var distSqr = dX * dX + dY * dY;\n var radius = circle1.m_radius + circle2.m_radius;\n if (distSqr > radius * radius) {\n return;\n }\n manifold.m_type = b2Manifold.e_circles;\n manifold.m_localPoint.SetV(circle1.m_p);\n manifold.m_localPlaneNormal.SetZero();\n manifold.m_pointCount = 1;\n manifold.m_points[0].m_localPoint.SetV(circle2.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n b2Collision.CollideCircles = b2Collision.prototype.CollideCircles;\n b2Collision.prototype.CollidePolygonAndCircle = function (manifold, polygon, xf1, circle, xf2) {\n manifold.m_pointCount = 0;\n var tPoint;\n var dX = 0;\n var dY = 0;\n var positionX = 0;\n var positionY = 0;\n var tVec;\n var tMat;\n tMat = xf2.R;\n tVec = circle.m_p;\n var cX = xf2.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var cY = xf2.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n dX = cX - xf1.position.x;\n dY = cY - xf1.position.y;\n tMat = xf1.R;\n var cLocalX = (dX * tMat.col1.x + dY * tMat.col1.y);\n var cLocalY = (dX * tMat.col2.x + dY * tMat.col2.y);\n var dist = 0;\n var normalIndex = 0;\n var separation = (-Number.MAX_VALUE);\n var radius = polygon.m_radius + circle.m_radius;\n var vertexCount = parseInt(polygon.m_vertexCount);\n var vertices = polygon.m_vertices;\n var normals = polygon.m_normals;\n for (var i = 0; i < vertexCount; ++i) {\n tVec = vertices[i];\n dX = cLocalX - tVec.x;\n dY = cLocalY - tVec.y;\n tVec = normals[i];\n var s = tVec.x * dX + tVec.y * dY;\n if (s > radius) {\n return;\n }\n if (s > separation) {\n separation = s;\n normalIndex = i;\n }\n }\n var vertIndex1 = parseInt(normalIndex);\n var vertIndex2 = parseInt(vertIndex1 + 1 < vertexCount ? vertIndex1 + 1 : 0);\n var v1 = vertices[vertIndex1];\n var v2 = vertices[vertIndex2];\n if (separation < Number.MIN_VALUE) {\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.SetV(normals[normalIndex]);\n manifold.m_localPoint.x = 0.5 * (v1.x + v2.x);\n manifold.m_localPoint.y = 0.5 * (v1.y + v2.y);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n return;\n }\n var u1 = (cLocalX - v1.x) * (v2.x - v1.x) + (cLocalY - v1.y) * (v2.y - v1.y);\n var u2 = (cLocalX - v2.x) * (v1.x - v2.x) + (cLocalY - v2.y) * (v1.y - v2.y);\n if (u1 <= 0.0) {\n if ((cLocalX - v1.x) * (cLocalX - v1.x) + (cLocalY - v1.y) * (cLocalY - v1.y) > radius * radius) return;\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.x = cLocalX - v1.x;\n manifold.m_localPlaneNormal.y = cLocalY - v1.y;\n manifold.m_localPlaneNormal.Normalize();\n manifold.m_localPoint.SetV(v1);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n else if (u2 <= 0) {\n if ((cLocalX - v2.x) * (cLocalX - v2.x) + (cLocalY - v2.y) * (cLocalY - v2.y) > radius * radius) return;\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.x = cLocalX - v2.x;\n manifold.m_localPlaneNormal.y = cLocalY - v2.y;\n manifold.m_localPlaneNormal.Normalize();\n manifold.m_localPoint.SetV(v2);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n else {\n var faceCenterX = 0.5 * (v1.x + v2.x);\n var faceCenterY = 0.5 * (v1.y + v2.y);\n separation = (cLocalX - faceCenterX) * normals[vertIndex1].x + (cLocalY - faceCenterY) * normals[vertIndex1].y;\n if (separation > radius) return;\n manifold.m_pointCount = 1;\n manifold.m_type = b2Manifold.e_faceA;\n manifold.m_localPlaneNormal.x = normals[vertIndex1].x;\n manifold.m_localPlaneNormal.y = normals[vertIndex1].y;\n manifold.m_localPlaneNormal.Normalize();\n manifold.m_localPoint.Set(faceCenterX, faceCenterY);\n manifold.m_points[0].m_localPoint.SetV(circle.m_p);\n manifold.m_points[0].m_id.key = 0;\n }\n }\n b2Collision.CollidePolygonAndCircle = b2Collision.prototype.CollidePolygonAndCircle;\n b2Collision.prototype.TestOverlap = function (a, b) {\n var t1 = b.lowerBound;\n var t2 = a.upperBound;\n var d1X = t1.x - t2.x;\n var d1Y = t1.y - t2.y;\n t1 = a.lowerBound;\n t2 = b.upperBound;\n var d2X = t1.x - t2.x;\n var d2Y = t1.y - t2.y;\n if (d1X > 0.0 || d1Y > 0.0) return false;\n if (d2X > 0.0 || d2Y > 0.0) return false;\n return true;\n }\n b2Collision.TestOverlap = b2Collision.prototype.TestOverlap;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Collision.s_incidentEdge = b2Collision.MakeClipPointVector();\n Box2D.Collision.b2Collision.prototype.s_incidentEdge = Box2D.Collision.b2Collision.s_incidentEdge;\n Box2D.Collision.b2Collision.s_clipPoints1 = b2Collision.MakeClipPointVector();\n Box2D.Collision.b2Collision.prototype.s_clipPoints1 = Box2D.Collision.b2Collision.s_clipPoints1;\n Box2D.Collision.b2Collision.s_clipPoints2 = b2Collision.MakeClipPointVector();\n Box2D.Collision.b2Collision.prototype.s_clipPoints2 = Box2D.Collision.b2Collision.s_clipPoints2;\n Box2D.Collision.b2Collision.s_edgeAO = new Vector_a2j_Number(1);\n Box2D.Collision.b2Collision.prototype.s_edgeAO = Box2D.Collision.b2Collision.s_edgeAO;\n Box2D.Collision.b2Collision.s_edgeBO = new Vector_a2j_Number(1);\n Box2D.Collision.b2Collision.prototype.s_edgeBO = Box2D.Collision.b2Collision.s_edgeBO;\n Box2D.Collision.b2Collision.s_localTangent = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_localTangent = Box2D.Collision.b2Collision.s_localTangent;\n Box2D.Collision.b2Collision.s_localNormal = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_localNormal = Box2D.Collision.b2Collision.s_localNormal;\n Box2D.Collision.b2Collision.s_planePoint = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_planePoint = Box2D.Collision.b2Collision.s_planePoint;\n Box2D.Collision.b2Collision.s_normal = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_normal = Box2D.Collision.b2Collision.s_normal;\n Box2D.Collision.b2Collision.s_tangent = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_tangent = Box2D.Collision.b2Collision.s_tangent;\n Box2D.Collision.b2Collision.s_tangent2 = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_tangent2 = Box2D.Collision.b2Collision.s_tangent2;\n Box2D.Collision.b2Collision.s_v11 = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_v11 = Box2D.Collision.b2Collision.s_v11;\n Box2D.Collision.b2Collision.s_v12 = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.s_v12 = Box2D.Collision.b2Collision.s_v12;\n Box2D.Collision.b2Collision.b2CollidePolyTempVec = new b2Vec2();\n Box2D.Collision.b2Collision.prototype.b2CollidePolyTempVec = Box2D.Collision.b2Collision.b2CollidePolyTempVec;\n Box2D.Collision.b2Collision.b2_nullFeature = 0x000000ff;\n Box2D.Collision.b2Collision.prototype.b2_nullFeature = Box2D.Collision.b2Collision.b2_nullFeature;\n });\n b2ContactID.b2ContactID = function () {\n this.features = new Features();\n };\n b2ContactID.prototype.b2ContactID = function () {\n this.features._m_id = this;\n }\n b2ContactID.prototype.Set = function (id) {\n this.key = id._key;\n }\n b2ContactID.prototype.Copy = function () {\n var id = new b2ContactID();\n id.key = this.key;\n return id;\n }\n b2ContactID.prototype.__defineGetter__('key', function () {\n return this._key;\n });\n b2ContactID.prototype.__defineSetter__('key', function (value) {\n if (value === undefined) value = 0;\n this._key = value;\n this.features._referenceEdge = this._key & 0x000000ff;\n this.features._incidentEdge = ((this._key & 0x0000ff00) >> 8) & 0x000000ff;\n this.features._incidentVertex = ((this._key & 0x00ff0000) >> 16) & 0x000000ff;\n this.features._flip = ((this._key & 0xff000000) >> 24) & 0x000000ff;\n });\n b2ContactPoint.b2ContactPoint = function () {\n this.position = new b2Vec2();\n this.velocity = new b2Vec2();\n this.normal = new b2Vec2();\n this.id = new b2ContactID();\n };\n b2Distance.b2Distance = function () {};\n b2Distance.prototype.Distance = function (output, cache, input) {\n ++b2Distance.b2_gjkCalls;\n var proxyA = input.proxyA;\n var proxyB = input.proxyB;\n var transformA = input.transformA;\n var transformB = input.transformB;\n var simplex = b2Distance.s_simplex;\n simplex.ReadCache(cache, proxyA, transformA, proxyB, transformB);\n var vertices = simplex.m_vertices;\n var k_maxIters = 20;\n var saveA = b2Distance.s_saveA;\n var saveB = b2Distance.s_saveB;\n var saveCount = 0;\n var closestPoint = simplex.GetClosestPoint();\n var distanceSqr1 = closestPoint.LengthSquared();\n var distanceSqr2 = distanceSqr1;\n var i = 0;\n var p;\n var iter = 0;\n while (iter < k_maxIters) {\n saveCount = simplex.m_count;\n for (i = 0;\n i < saveCount; i++) {\n saveA[i] = vertices[i].indexA;\n saveB[i] = vertices[i].indexB;\n }\n switch (simplex.m_count) {\n case 1:\n break;\n case 2:\n simplex.Solve2();\n break;\n case 3:\n simplex.Solve3();\n break;\n default:\n b2Settings.b2Assert(false);\n }\n if (simplex.m_count == 3) {\n break;\n }\n p = simplex.GetClosestPoint();\n distanceSqr2 = p.LengthSquared();\n if (distanceSqr2 > distanceSqr1) {}\n distanceSqr1 = distanceSqr2;\n var d = simplex.GetSearchDirection();\n if (d.LengthSquared() < Number.MIN_VALUE * Number.MIN_VALUE) {\n break;\n }\n var vertex = vertices[simplex.m_count];\n vertex.indexA = proxyA.GetSupport(b2Math.MulTMV(transformA.R, d.GetNegative()));\n vertex.wA = b2Math.MulX(transformA, proxyA.GetVertex(vertex.indexA));\n vertex.indexB = proxyB.GetSupport(b2Math.MulTMV(transformB.R, d));\n vertex.wB = b2Math.MulX(transformB, proxyB.GetVertex(vertex.indexB));\n vertex.w = b2Math.SubtractVV(vertex.wB, vertex.wA);\n ++iter;\n ++b2Distance.b2_gjkIters;\n var duplicate = false;\n for (i = 0;\n i < saveCount; i++) {\n if (vertex.indexA == saveA[i] && vertex.indexB == saveB[i]) {\n duplicate = true;\n break;\n }\n }\n if (duplicate) {\n break;\n }++simplex.m_count;\n }\n b2Distance.b2_gjkMaxIters = b2Math.Max(b2Distance.b2_gjkMaxIters, iter);\n simplex.GetWitnessPoints(output.pointA, output.pointB);\n output.distance = b2Math.SubtractVV(output.pointA, output.pointB).Length();\n output.iterations = iter;\n simplex.WriteCache(cache);\n if (input.useRadii) {\n var rA = proxyA.m_radius;\n var rB = proxyB.m_radius;\n if (output.distance > rA + rB && output.distance > Number.MIN_VALUE) {\n output.distance -= rA + rB;\n var normal = b2Math.SubtractVV(output.pointB, output.pointA);\n normal.Normalize();\n output.pointA.x += rA * normal.x;\n output.pointA.y += rA * normal.y;\n output.pointB.x -= rB * normal.x;\n output.pointB.y -= rB * normal.y;\n }\n else {\n p = new b2Vec2();\n p.x = .5 * (output.pointA.x + output.pointB.x);\n p.y = .5 * (output.pointA.y + output.pointB.y);\n output.pointA.x = output.pointB.x = p.x;\n output.pointA.y = output.pointB.y = p.y;\n output.distance = 0.0;\n }\n }\n }\n b2Distance.Distance = b2Distance.prototype.Distance;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Distance.s_simplex = new b2Simplex();\n Box2D.Collision.b2Distance.prototype.s_simplex = Box2D.Collision.b2Distance.s_simplex;\n Box2D.Collision.b2Distance.s_saveA = new Vector_a2j_Number(3);\n Box2D.Collision.b2Distance.prototype.s_saveA = Box2D.Collision.b2Distance.s_saveA;\n Box2D.Collision.b2Distance.s_saveB = new Vector_a2j_Number(3);\n Box2D.Collision.b2Distance.prototype.s_saveB = Box2D.Collision.b2Distance.s_saveB;\n });\n b2DistanceInput.b2DistanceInput = function () {};\n b2DistanceOutput.b2DistanceOutput = function () {\n this.pointA = new b2Vec2();\n this.pointB = new b2Vec2();\n };\n b2DistanceProxy.b2DistanceProxy = function () {};\n b2DistanceProxy.prototype.Set = function (shape) {\n switch (shape.GetType()) {\n case b2Shape.e_circleShape:\n {\n var circle = (shape instanceof b2CircleShape ? shape : null);\n this.m_vertices = new Vector(1, true);\n this.m_vertices[0] = circle.m_p;\n this.m_count = 1;\n this.m_radius = circle.m_radius;\n }\n break;\n case b2Shape.e_polygonShape:\n {\n var polygon = (shape instanceof b2PolygonShape ? shape : null);\n this.m_vertices = polygon.m_vertices;\n this.m_count = polygon.m_vertexCount;\n this.m_radius = polygon.m_radius;\n }\n break;\n default:\n b2Settings.b2Assert(false);\n }\n }\n b2DistanceProxy.prototype.GetSupport = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_count; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return bestIndex;\n }\n b2DistanceProxy.prototype.GetSupportVertex = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_count; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return this.m_vertices[bestIndex];\n }\n b2DistanceProxy.prototype.GetVertexCount = function () {\n return this.m_count;\n }\n b2DistanceProxy.prototype.GetVertex = function (index) {\n if (index === undefined) index = 0;\n b2Settings.b2Assert(0 <= index && index < this.m_count);\n return this.m_vertices[index];\n }\n b2DynamicTree.b2DynamicTree = function () {};\n b2DynamicTree.prototype.b2DynamicTree = function () {\n this.m_root = null;\n this.m_freeList = null;\n this.m_path = 0;\n this.m_insertionCount = 0;\n }\n b2DynamicTree.prototype.CreateProxy = function (aabb, userData) {\n var node = this.AllocateNode();\n var extendX = b2Settings.b2_aabbExtension;\n var extendY = b2Settings.b2_aabbExtension;\n node.aabb.lowerBound.x = aabb.lowerBound.x - extendX;\n node.aabb.lowerBound.y = aabb.lowerBound.y - extendY;\n node.aabb.upperBound.x = aabb.upperBound.x + extendX;\n node.aabb.upperBound.y = aabb.upperBound.y + extendY;\n node.userData = userData;\n this.InsertLeaf(node);\n return node;\n }\n b2DynamicTree.prototype.DestroyProxy = function (proxy) {\n this.RemoveLeaf(proxy);\n this.FreeNode(proxy);\n }\n b2DynamicTree.prototype.MoveProxy = function (proxy, aabb, displacement) {\n b2Settings.b2Assert(proxy.IsLeaf());\n if (proxy.aabb.Contains(aabb)) {\n return false;\n }\n this.RemoveLeaf(proxy);\n var extendX = b2Settings.b2_aabbExtension + b2Settings.b2_aabbMultiplier * (displacement.x > 0 ? displacement.x : (-displacement.x));\n var extendY = b2Settings.b2_aabbExtension + b2Settings.b2_aabbMultiplier * (displacement.y > 0 ? displacement.y : (-displacement.y));\n proxy.aabb.lowerBound.x = aabb.lowerBound.x - extendX;\n proxy.aabb.lowerBound.y = aabb.lowerBound.y - extendY;\n proxy.aabb.upperBound.x = aabb.upperBound.x + extendX;\n proxy.aabb.upperBound.y = aabb.upperBound.y + extendY;\n this.InsertLeaf(proxy);\n return true;\n }\n b2DynamicTree.prototype.Rebalance = function (iterations) {\n if (iterations === undefined) iterations = 0;\n if (this.m_root == null) return;\n for (var i = 0; i < iterations; i++) {\n var node = this.m_root;\n var bit = 0;\n while (node.IsLeaf() == false) {\n node = (this.m_path >> bit) & 1 ? node.child2 : node.child1;\n bit = (bit + 1) & 31;\n }++this.m_path;\n this.RemoveLeaf(node);\n this.InsertLeaf(node);\n }\n }\n b2DynamicTree.prototype.GetFatAABB = function (proxy) {\n return proxy.aabb;\n }\n b2DynamicTree.prototype.GetUserData = function (proxy) {\n return proxy.userData;\n }\n b2DynamicTree.prototype.Query = function (callback, aabb) {\n if (this.m_root == null) return;\n var stack = new Vector();\n var count = 0;\n stack[count++] = this.m_root;\n while (count > 0) {\n var node = stack[--count];\n if (node.aabb.TestOverlap(aabb)) {\n if (node.IsLeaf()) {\n var proceed = callback(node);\n if (!proceed) return;\n }\n else {\n stack[count++] = node.child1;\n stack[count++] = node.child2;\n }\n }\n }\n }\n b2DynamicTree.prototype.RayCast = function (callback, input) {\n if (this.m_root == null) return;\n var p1 = input.p1;\n var p2 = input.p2;\n var r = b2Math.SubtractVV(p1, p2);\n r.Normalize();\n var v = b2Math.CrossFV(1.0, r);\n var abs_v = b2Math.AbsV(v);\n var maxFraction = input.maxFraction;\n var segmentAABB = new b2AABB();\n var tX = 0;\n var tY = 0; {\n tX = p1.x + maxFraction * (p2.x - p1.x);\n tY = p1.y + maxFraction * (p2.y - p1.y);\n segmentAABB.lowerBound.x = Math.min(p1.x, tX);\n segmentAABB.lowerBound.y = Math.min(p1.y, tY);\n segmentAABB.upperBound.x = Math.max(p1.x, tX);\n segmentAABB.upperBound.y = Math.max(p1.y, tY);\n }\n var stack = new Vector();\n var count = 0;\n stack[count++] = this.m_root;\n while (count > 0) {\n var node = stack[--count];\n if (node.aabb.TestOverlap(segmentAABB) == false) {\n continue;\n }\n var c = node.aabb.GetCenter();\n var h = node.aabb.GetExtents();\n var separation = Math.abs(v.x * (p1.x - c.x) + v.y * (p1.y - c.y)) - abs_v.x * h.x - abs_v.y * h.y;\n if (separation > 0.0) continue;\n if (node.IsLeaf()) {\n var subInput = new b2RayCastInput();\n subInput.p1 = input.p1;\n subInput.p2 = input.p2;\n subInput.maxFraction = input.maxFraction;\n maxFraction = callback(subInput, node);\n if (maxFraction == 0.0) return;\n if (maxFraction > 0.0) {\n tX = p1.x + maxFraction * (p2.x - p1.x);\n tY = p1.y + maxFraction * (p2.y - p1.y);\n segmentAABB.lowerBound.x = Math.min(p1.x, tX);\n segmentAABB.lowerBound.y = Math.min(p1.y, tY);\n segmentAABB.upperBound.x = Math.max(p1.x, tX);\n segmentAABB.upperBound.y = Math.max(p1.y, tY);\n }\n }\n else {\n stack[count++] = node.child1;\n stack[count++] = node.child2;\n }\n }\n }\n b2DynamicTree.prototype.AllocateNode = function () {\n if (this.m_freeList) {\n var node = this.m_freeList;\n this.m_freeList = node.parent;\n node.parent = null;\n node.child1 = null;\n node.child2 = null;\n return node;\n }\n return new b2DynamicTreeNode();\n }\n b2DynamicTree.prototype.FreeNode = function (node) {\n node.parent = this.m_freeList;\n this.m_freeList = node;\n }\n b2DynamicTree.prototype.InsertLeaf = function (leaf) {\n ++this.m_insertionCount;\n if (this.m_root == null) {\n this.m_root = leaf;\n this.m_root.parent = null;\n return;\n }\n var center = leaf.aabb.GetCenter();\n var sibling = this.m_root;\n if (sibling.IsLeaf() == false) {\n do {\n var child1 = sibling.child1;\n var child2 = sibling.child2;\n var norm1 = Math.abs((child1.aabb.lowerBound.x + child1.aabb.upperBound.x) / 2 - center.x) + Math.abs((child1.aabb.lowerBound.y + child1.aabb.upperBound.y) / 2 - center.y);\n var norm2 = Math.abs((child2.aabb.lowerBound.x + child2.aabb.upperBound.x) / 2 - center.x) + Math.abs((child2.aabb.lowerBound.y + child2.aabb.upperBound.y) / 2 - center.y);\n if (norm1 < norm2) {\n sibling = child1;\n }\n else {\n sibling = child2;\n }\n }\n while (sibling.IsLeaf() == false)\n }\n var node1 = sibling.parent;\n var node2 = this.AllocateNode();\n node2.parent = node1;\n node2.userData = null;\n node2.aabb.Combine(leaf.aabb, sibling.aabb);\n if (node1) {\n if (sibling.parent.child1 == sibling) {\n node1.child1 = node2;\n }\n else {\n node1.child2 = node2;\n }\n node2.child1 = sibling;\n node2.child2 = leaf;\n sibling.parent = node2;\n leaf.parent = node2;\n do {\n if (node1.aabb.Contains(node2.aabb)) break;\n node1.aabb.Combine(node1.child1.aabb, node1.child2.aabb);\n node2 = node1;\n node1 = node1.parent;\n }\n while (node1)\n }\n else {\n node2.child1 = sibling;\n node2.child2 = leaf;\n sibling.parent = node2;\n leaf.parent = node2;\n this.m_root = node2;\n }\n }\n b2DynamicTree.prototype.RemoveLeaf = function (leaf) {\n if (leaf == this.m_root) {\n this.m_root = null;\n return;\n }\n var node2 = leaf.parent;\n var node1 = node2.parent;\n var sibling;\n if (node2.child1 == leaf) {\n sibling = node2.child2;\n }\n else {\n sibling = node2.child1;\n }\n if (node1) {\n if (node1.child1 == node2) {\n node1.child1 = sibling;\n }\n else {\n node1.child2 = sibling;\n }\n sibling.parent = node1;\n this.FreeNode(node2);\n while (node1) {\n var oldAABB = node1.aabb;\n node1.aabb = b2AABB.Combine(node1.child1.aabb, node1.child2.aabb);\n if (oldAABB.Contains(node1.aabb)) break;\n node1 = node1.parent;\n }\n }\n else {\n this.m_root = sibling;\n sibling.parent = null;\n this.FreeNode(node2);\n }\n }\n b2DynamicTreeBroadPhase.b2DynamicTreeBroadPhase = function () {\n this.m_tree = new b2DynamicTree();\n this.m_moveBuffer = new Vector();\n this.m_pairBuffer = new Vector();\n this.m_pairCount = 0;\n };\n b2DynamicTreeBroadPhase.prototype.CreateProxy = function (aabb, userData) {\n var proxy = this.m_tree.CreateProxy(aabb, userData);\n ++this.m_proxyCount;\n this.BufferMove(proxy);\n return proxy;\n }\n b2DynamicTreeBroadPhase.prototype.DestroyProxy = function (proxy) {\n this.UnBufferMove(proxy);\n --this.m_proxyCount;\n this.m_tree.DestroyProxy(proxy);\n }\n b2DynamicTreeBroadPhase.prototype.MoveProxy = function (proxy, aabb, displacement) {\n var buffer = this.m_tree.MoveProxy(proxy, aabb, displacement);\n if (buffer) {\n this.BufferMove(proxy);\n }\n }\n b2DynamicTreeBroadPhase.prototype.TestOverlap = function (proxyA, proxyB) {\n var aabbA = this.m_tree.GetFatAABB(proxyA);\n var aabbB = this.m_tree.GetFatAABB(proxyB);\n return aabbA.TestOverlap(aabbB);\n }\n b2DynamicTreeBroadPhase.prototype.GetUserData = function (proxy) {\n return this.m_tree.GetUserData(proxy);\n }\n b2DynamicTreeBroadPhase.prototype.GetFatAABB = function (proxy) {\n return this.m_tree.GetFatAABB(proxy);\n }\n b2DynamicTreeBroadPhase.prototype.GetProxyCount = function () {\n return this.m_proxyCount;\n }\n b2DynamicTreeBroadPhase.prototype.UpdatePairs = function (callback) {\n var __this = this;\n __this.m_pairCount = 0;\n var queryProxy;\n\n var len = __this.m_moveBuffer.length\n for (var i=0; i < len; i++) {\n queryProxy = __this.m_moveBuffer[i]; {\n function QueryCallback(proxy) {\n if (proxy == queryProxy) return true;\n if (__this.m_pairCount == __this.m_pairBuffer.length) {\n __this.m_pairBuffer[__this.m_pairCount] = new b2DynamicTreePair();\n }\n var pair = __this.m_pairBuffer[__this.m_pairCount];\n pair.proxyA = proxy < queryProxy ? proxy : queryProxy;\n pair.proxyB = proxy >= queryProxy ? proxy : queryProxy;++__this.m_pairCount;\n return true;\n };\n var fatAABB = __this.m_tree.GetFatAABB(queryProxy);\n __this.m_tree.Query(QueryCallback, fatAABB);\n }\n }\n __this.m_moveBuffer.length = 0;\n for (var i = 0; i < __this.m_pairCount;) {\n var primaryPair = __this.m_pairBuffer[i];\n var userDataA = __this.m_tree.GetUserData(primaryPair.proxyA);\n var userDataB = __this.m_tree.GetUserData(primaryPair.proxyB);\n callback(userDataA, userDataB);\n ++i;\n while (i < __this.m_pairCount) {\n var pair = __this.m_pairBuffer[i];\n if (pair.proxyA != primaryPair.proxyA || pair.proxyB != primaryPair.proxyB) {\n break;\n }++i;\n }\n }\n }\n b2DynamicTreeBroadPhase.prototype.Query = function (callback, aabb) {\n this.m_tree.Query(callback, aabb);\n }\n b2DynamicTreeBroadPhase.prototype.RayCast = function (callback, input) {\n this.m_tree.RayCast(callback, input);\n }\n b2DynamicTreeBroadPhase.prototype.Validate = function () {}\n b2DynamicTreeBroadPhase.prototype.Rebalance = function (iterations) {\n if (iterations === undefined) iterations = 0;\n this.m_tree.Rebalance(iterations);\n }\n b2DynamicTreeBroadPhase.prototype.BufferMove = function (proxy) {\n this.m_moveBuffer[this.m_moveBuffer.length] = proxy;\n }\n b2DynamicTreeBroadPhase.prototype.UnBufferMove = function (proxy) {\n var i = parseInt(this.m_moveBuffer.indexOf(proxy));\n this.m_moveBuffer.splice(i, 1);\n }\n b2DynamicTreeBroadPhase.prototype.ComparePairs = function (pair1, pair2) {\n return 0;\n }\n b2DynamicTreeBroadPhase.__implements = {};\n b2DynamicTreeBroadPhase.__implements[IBroadPhase] = true;\n b2DynamicTreeNode.b2DynamicTreeNode = function () {\n this.aabb = new b2AABB();\n };\n b2DynamicTreeNode.prototype.IsLeaf = function () {\n return this.child1 == null;\n }\n b2DynamicTreePair.b2DynamicTreePair = function () {};\n b2Manifold.b2Manifold = function () {\n this.m_pointCount = 0;\n };\n b2Manifold.prototype.b2Manifold = function () {\n this.m_points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.m_points[i] = new b2ManifoldPoint();\n }\n this.m_localPlaneNormal = new b2Vec2();\n this.m_localPoint = new b2Vec2();\n }\n b2Manifold.prototype.Reset = function () {\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n ((this.m_points[i] instanceof b2ManifoldPoint ? this.m_points[i] : null)).Reset();\n }\n this.m_localPlaneNormal.SetZero();\n this.m_localPoint.SetZero();\n this.m_type = 0;\n this.m_pointCount = 0;\n }\n b2Manifold.prototype.Set = function (m) {\n this.m_pointCount = m.m_pointCount;\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n ((this.m_points[i] instanceof b2ManifoldPoint ? this.m_points[i] : null)).Set(m.m_points[i]);\n }\n this.m_localPlaneNormal.SetV(m.m_localPlaneNormal);\n this.m_localPoint.SetV(m.m_localPoint);\n this.m_type = m.m_type;\n }\n b2Manifold.prototype.Copy = function () {\n var copy = new b2Manifold();\n copy.Set(this);\n return copy;\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Manifold.e_circles = 0x0001;\n Box2D.Collision.b2Manifold.prototype.e_circles = Box2D.Collision.b2Manifold.e_circles;\n Box2D.Collision.b2Manifold.e_faceA = 0x0002;\n Box2D.Collision.b2Manifold.prototype.e_faceA = Box2D.Collision.b2Manifold.e_faceA;\n Box2D.Collision.b2Manifold.e_faceB = 0x0004;\n Box2D.Collision.b2Manifold.prototype.e_faceB = Box2D.Collision.b2Manifold.e_faceB;\n });\n b2ManifoldPoint.b2ManifoldPoint = function () {\n this.m_localPoint = new b2Vec2();\n this.m_id = new b2ContactID();\n };\n b2ManifoldPoint.prototype.b2ManifoldPoint = function () {\n this.Reset();\n }\n b2ManifoldPoint.prototype.Reset = function () {\n this.m_localPoint.SetZero();\n this.m_normalImpulse = 0.0;\n this.m_tangentImpulse = 0.0;\n this.m_id.key = 0;\n }\n b2ManifoldPoint.prototype.Set = function (m) {\n this.m_localPoint.SetV(m.m_localPoint);\n this.m_normalImpulse = m.m_normalImpulse;\n this.m_tangentImpulse = m.m_tangentImpulse;\n this.m_id.Set(m.m_id);\n }\n b2OBB.b2OBB = function () {\n this.R = new b2Mat22();\n this.center = new b2Vec2();\n this.extents = new b2Vec2();\n };\n b2Pair.b2Pair = function () {\n this.userData = null;\n };\n b2Pair.prototype.SetBuffered = function () {\n this.status |= b2Pair.e_pairBuffered;\n }\n b2Pair.prototype.ClearBuffered = function () {\n this.status &= ~b2Pair.e_pairBuffered;\n }\n b2Pair.prototype.IsBuffered = function () {\n return (this.status & b2Pair.e_pairBuffered) == b2Pair.e_pairBuffered;\n }\n b2Pair.prototype.SetRemoved = function () {\n this.status |= b2Pair.e_pairRemoved;\n }\n b2Pair.prototype.ClearRemoved = function () {\n this.status &= ~b2Pair.e_pairRemoved;\n }\n b2Pair.prototype.IsRemoved = function () {\n return (this.status & b2Pair.e_pairRemoved) == b2Pair.e_pairRemoved;\n }\n b2Pair.prototype.SetFinal = function () {\n this.status |= b2Pair.e_pairFinal;\n }\n b2Pair.prototype.IsFinal = function () {\n return (this.status & b2Pair.e_pairFinal) == b2Pair.e_pairFinal;\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2Pair.b2_nullProxy = parseInt(b2Settings.USHRT_MAX);\n Box2D.Collision.b2Pair.prototype.b2_nullProxy = Box2D.Collision.b2Pair.b2_nullProxy;\n Box2D.Collision.b2Pair.e_pairBuffered = 0x0001;\n Box2D.Collision.b2Pair.prototype.e_pairBuffered = Box2D.Collision.b2Pair.e_pairBuffered;\n Box2D.Collision.b2Pair.e_pairRemoved = 0x0002;\n Box2D.Collision.b2Pair.prototype.e_pairRemoved = Box2D.Collision.b2Pair.e_pairRemoved;\n Box2D.Collision.b2Pair.e_pairFinal = 0x0004;\n Box2D.Collision.b2Pair.prototype.e_pairFinal = Box2D.Collision.b2Pair.e_pairFinal;\n });\n b2PairManager.b2PairManager = function () {};\n b2PairManager.prototype.b2PairManager = function () {\n this.m_pairs = new Array();\n this.m_pairBuffer = new Array();\n this.m_pairCount = 0;\n this.m_pairBufferCount = 0;\n this.m_freePair = null;\n }\n b2PairManager.prototype.Initialize = function (broadPhase) {\n this.m_broadPhase = broadPhase;\n }\n b2PairManager.prototype.AddBufferedPair = function (proxy1, proxy2) {\n var pair = this.AddPair(proxy1, proxy2);\n if (pair.IsBuffered() == false) {\n pair.SetBuffered();\n this.m_pairBuffer[this.m_pairBufferCount] = pair;\n ++this.m_pairBufferCount;\n }\n pair.ClearRemoved();\n if (b2BroadPhase.s_validate) {\n this.ValidateBuffer();\n }\n }\n b2PairManager.prototype.RemoveBufferedPair = function (proxy1, proxy2) {\n var pair = this.Find(proxy1, proxy2);\n if (pair == null) {\n return;\n }\n if (pair.IsBuffered() == false) {\n pair.SetBuffered();\n this.m_pairBuffer[this.m_pairBufferCount] = pair;\n ++this.m_pairBufferCount;\n }\n pair.SetRemoved();\n if (b2BroadPhase.s_validate) {\n this.ValidateBuffer();\n }\n }\n b2PairManager.prototype.Commit = function (callback) {\n var i = 0;\n var removeCount = 0;\n for (i = 0;\n i < this.m_pairBufferCount; ++i) {\n var pair = this.m_pairBuffer[i];\n pair.ClearBuffered();\n var proxy1 = pair.proxy1;\n var proxy2 = pair.proxy2;\n if (pair.IsRemoved()) {} else {\n if (pair.IsFinal() == false) {\n callback(proxy1.userData, proxy2.userData);\n }\n }\n }\n this.m_pairBufferCount = 0;\n if (b2BroadPhase.s_validate) {\n this.ValidateTable();\n }\n }\n b2PairManager.prototype.AddPair = function (proxy1, proxy2) {\n var pair = proxy1.pairs[proxy2];\n if (pair != null) return pair;\n if (this.m_freePair == null) {\n this.m_freePair = new b2Pair();\n this.m_pairs.push(this.m_freePair);\n }\n pair = this.m_freePair;\n this.m_freePair = pair.next;\n pair.proxy1 = proxy1;\n pair.proxy2 = proxy2;\n pair.status = 0;\n pair.userData = null;\n pair.next = null;\n proxy1.pairs[proxy2] = pair;\n proxy2.pairs[proxy1] = pair;\n ++this.m_pairCount;\n return pair;\n }\n b2PairManager.prototype.RemovePair = function (proxy1, proxy2) {\n var pair = proxy1.pairs[proxy2];\n if (pair == null) {\n return null;\n }\n var userData = pair.userData;\n delete proxy1.pairs[proxy2];\n delete proxy2.pairs[proxy1];\n pair.next = this.m_freePair;\n pair.proxy1 = null;\n pair.proxy2 = null;\n pair.userData = null;\n pair.status = 0;\n this.m_freePair = pair;\n --this.m_pairCount;\n return userData;\n }\n b2PairManager.prototype.Find = function (proxy1, proxy2) {\n return proxy1.pairs[proxy2];\n }\n b2PairManager.prototype.ValidateBuffer = function () {}\n b2PairManager.prototype.ValidateTable = function () {}\n b2Point.b2Point = function () {\n this.p = new b2Vec2();\n };\n b2Point.prototype.Support = function (xf, vX, vY) {\n if (vX === undefined) vX = 0;\n if (vY === undefined) vY = 0;\n return this.p;\n }\n b2Point.prototype.GetFirstVertex = function (xf) {\n return this.p;\n }\n b2Proxy.b2Proxy = function () {\n this.lowerBounds = new Vector_a2j_Number(2);\n this.upperBounds = new Vector_a2j_Number(2);\n this.pairs = new Dictionary();\n this.userData = null;\n };\n b2Proxy.prototype.IsValid = function () {\n return this.overlapCount != b2BroadPhase.b2_invalid;\n }\n b2RayCastInput.b2RayCastInput = function () {\n this.p1 = new b2Vec2();\n this.p2 = new b2Vec2();\n };\n b2RayCastInput.prototype.b2RayCastInput = function (p1, p2, maxFraction) {\n if (p1 === undefined) p1 = null;\n if (p2 === undefined) p2 = null;\n if (maxFraction === undefined) maxFraction = 1;\n if (p1) this.p1.SetV(p1);\n if (p2) this.p2.SetV(p2);\n this.maxFraction = maxFraction;\n }\n b2RayCastOutput.b2RayCastOutput = function () {\n this.normal = new b2Vec2();\n };\n b2Segment.b2Segment = function () {\n this.p1 = new b2Vec2();\n this.p2 = new b2Vec2();\n };\n b2Segment.prototype.TestSegment = function (lambda, normal, segment, maxLambda) {\n if (maxLambda === undefined) maxLambda = 0;\n var s = segment.p1;\n var rX = segment.p2.x - s.x;\n var rY = segment.p2.y - s.y;\n var dX = this.p2.x - this.p1.x;\n var dY = this.p2.y - this.p1.y;\n var nX = dY;\n var nY = (-dX);\n var k_slop = 100.0 * Number.MIN_VALUE;\n var denom = (-(rX * nX + rY * nY));\n if (denom > k_slop) {\n var bX = s.x - this.p1.x;\n var bY = s.y - this.p1.y;\n var a = (bX * nX + bY * nY);\n if (0.0 <= a && a <= maxLambda * denom) {\n var mu2 = (-rX * bY) + rY * bX;\n if ((-k_slop * denom) <= mu2 && mu2 <= denom * (1.0 + k_slop)) {\n a /= denom;\n var nLen = Math.sqrt(nX * nX + nY * nY);\n nX /= nLen;\n nY /= nLen;\n lambda[0] = a;\n normal.Set(nX, nY);\n return true;\n }\n }\n }\n return false;\n }\n b2Segment.prototype.Extend = function (aabb) {\n this.ExtendForward(aabb);\n this.ExtendBackward(aabb);\n }\n b2Segment.prototype.ExtendForward = function (aabb) {\n var dX = this.p2.x - this.p1.x;\n var dY = this.p2.y - this.p1.y;\n var lambda = Math.min(dX > 0 ? (aabb.upperBound.x - this.p1.x) / dX : dX < 0 ? (aabb.lowerBound.x - this.p1.x) / dX : Number.POSITIVE_INFINITY,\n dY > 0 ? (aabb.upperBound.y - this.p1.y) / dY : dY < 0 ? (aabb.lowerBound.y - this.p1.y) / dY : Number.POSITIVE_INFINITY);\n this.p2.x = this.p1.x + dX * lambda;\n this.p2.y = this.p1.y + dY * lambda;\n }\n b2Segment.prototype.ExtendBackward = function (aabb) {\n var dX = (-this.p2.x) + this.p1.x;\n var dY = (-this.p2.y) + this.p1.y;\n var lambda = Math.min(dX > 0 ? (aabb.upperBound.x - this.p2.x) / dX : dX < 0 ? (aabb.lowerBound.x - this.p2.x) / dX : Number.POSITIVE_INFINITY,\n dY > 0 ? (aabb.upperBound.y - this.p2.y) / dY : dY < 0 ? (aabb.lowerBound.y - this.p2.y) / dY : Number.POSITIVE_INFINITY);\n this.p1.x = this.p2.x + dX * lambda;\n this.p1.y = this.p2.y + dY * lambda;\n }\n b2SeparationFunction.b2SeparationFunction = function () {\n this.m_localPoint = new b2Vec2();\n this.m_axis = new b2Vec2();\n };\n b2SeparationFunction.prototype.Initialize = function (cache, proxyA, transformA, proxyB, transformB) {\n this.m_proxyA = proxyA;\n this.m_proxyB = proxyB;\n var count = parseInt(cache.count);\n b2Settings.b2Assert(0 < count && count < 3);\n var localPointA;\n var localPointA1;\n var localPointA2;\n var localPointB;\n var localPointB1;\n var localPointB2;\n var pointAX = 0;\n var pointAY = 0;\n var pointBX = 0;\n var pointBY = 0;\n var normalX = 0;\n var normalY = 0;\n var tMat;\n var tVec;\n var s = 0;\n var sgn = 0;\n if (count == 1) {\n this.m_type = b2SeparationFunction.e_points;\n localPointA = this.m_proxyA.GetVertex(cache.indexA[0]);\n localPointB = this.m_proxyB.GetVertex(cache.indexB[0]);\n tVec = localPointA;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointB;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_axis.x = pointBX - pointAX;\n this.m_axis.y = pointBY - pointAY;\n this.m_axis.Normalize();\n }\n else if (cache.indexB[0] == cache.indexB[1]) {\n this.m_type = b2SeparationFunction.e_faceA;\n localPointA1 = this.m_proxyA.GetVertex(cache.indexA[0]);\n localPointA2 = this.m_proxyA.GetVertex(cache.indexA[1]);\n localPointB = this.m_proxyB.GetVertex(cache.indexB[0]);\n this.m_localPoint.x = 0.5 * (localPointA1.x + localPointA2.x);\n this.m_localPoint.y = 0.5 * (localPointA1.y + localPointA2.y);\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointA2, localPointA1), 1.0);\n this.m_axis.Normalize();\n tVec = this.m_axis;\n tMat = transformA.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointB;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n s = (pointBX - pointAX) * normalX + (pointBY - pointAY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n else if (cache.indexA[0] == cache.indexA[0]) {\n this.m_type = b2SeparationFunction.e_faceB;\n localPointB1 = this.m_proxyB.GetVertex(cache.indexB[0]);\n localPointB2 = this.m_proxyB.GetVertex(cache.indexB[1]);\n localPointA = this.m_proxyA.GetVertex(cache.indexA[0]);\n this.m_localPoint.x = 0.5 * (localPointB1.x + localPointB2.x);\n this.m_localPoint.y = 0.5 * (localPointB1.y + localPointB2.y);\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointB2, localPointB1), 1.0);\n this.m_axis.Normalize();\n tVec = this.m_axis;\n tMat = transformB.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointA;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n s = (pointAX - pointBX) * normalX + (pointAY - pointBY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n else {\n localPointA1 = this.m_proxyA.GetVertex(cache.indexA[0]);\n localPointA2 = this.m_proxyA.GetVertex(cache.indexA[1]);\n localPointB1 = this.m_proxyB.GetVertex(cache.indexB[0]);\n localPointB2 = this.m_proxyB.GetVertex(cache.indexB[1]);\n var pA = b2Math.MulX(transformA, localPointA);\n var dA = b2Math.MulMV(transformA.R, b2Math.SubtractVV(localPointA2, localPointA1));\n var pB = b2Math.MulX(transformB, localPointB);\n var dB = b2Math.MulMV(transformB.R, b2Math.SubtractVV(localPointB2, localPointB1));\n var a = dA.x * dA.x + dA.y * dA.y;\n var e = dB.x * dB.x + dB.y * dB.y;\n var r = b2Math.SubtractVV(dB, dA);\n var c = dA.x * r.x + dA.y * r.y;\n var f = dB.x * r.x + dB.y * r.y;\n var b = dA.x * dB.x + dA.y * dB.y;\n var denom = a * e - b * b;\n s = 0.0;\n if (denom != 0.0) {\n s = b2Math.Clamp((b * f - c * e) / denom, 0.0, 1.0);\n }\n var t = (b * s + f) / e;\n if (t < 0.0) {\n t = 0.0;\n s = b2Math.Clamp((b - c) / a, 0.0, 1.0);\n }\n localPointA = new b2Vec2();\n localPointA.x = localPointA1.x + s * (localPointA2.x - localPointA1.x);\n localPointA.y = localPointA1.y + s * (localPointA2.y - localPointA1.y);\n localPointB = new b2Vec2();\n localPointB.x = localPointB1.x + s * (localPointB2.x - localPointB1.x);\n localPointB.y = localPointB1.y + s * (localPointB2.y - localPointB1.y);\n if (s == 0.0 || s == 1.0) {\n this.m_type = b2SeparationFunction.e_faceB;\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointB2, localPointB1), 1.0);\n this.m_axis.Normalize();\n this.m_localPoint = localPointB;\n tVec = this.m_axis;\n tMat = transformB.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointA;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n sgn = (pointAX - pointBX) * normalX + (pointAY - pointBY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n else {\n this.m_type = b2SeparationFunction.e_faceA;\n this.m_axis = b2Math.CrossVF(b2Math.SubtractVV(localPointA2, localPointA1), 1.0);\n this.m_localPoint = localPointA;\n tVec = this.m_axis;\n tMat = transformA.R;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tVec = this.m_localPoint;\n tMat = transformA.R;\n pointAX = transformA.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointAY = transformA.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tVec = localPointB;\n tMat = transformB.R;\n pointBX = transformB.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n pointBY = transformB.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n sgn = (pointBX - pointAX) * normalX + (pointBY - pointAY) * normalY;\n if (s < 0.0) {\n this.m_axis.NegativeSelf();\n }\n }\n }\n }\n b2SeparationFunction.prototype.Evaluate = function (transformA, transformB) {\n var axisA;\n var axisB;\n var localPointA;\n var localPointB;\n var pointA;\n var pointB;\n var seperation = 0;\n var normal;\n switch (this.m_type) {\n case b2SeparationFunction.e_points:\n {\n axisA = b2Math.MulTMV(transformA.R, this.m_axis);\n axisB = b2Math.MulTMV(transformB.R, this.m_axis.GetNegative());\n localPointA = this.m_proxyA.GetSupportVertex(axisA);\n localPointB = this.m_proxyB.GetSupportVertex(axisB);\n pointA = b2Math.MulX(transformA, localPointA);\n pointB = b2Math.MulX(transformB, localPointB);\n seperation = (pointB.x - pointA.x) * this.m_axis.x + (pointB.y - pointA.y) * this.m_axis.y;\n return seperation;\n }\n case b2SeparationFunction.e_faceA:\n {\n normal = b2Math.MulMV(transformA.R, this.m_axis);\n pointA = b2Math.MulX(transformA, this.m_localPoint);\n axisB = b2Math.MulTMV(transformB.R, normal.GetNegative());\n localPointB = this.m_proxyB.GetSupportVertex(axisB);\n pointB = b2Math.MulX(transformB, localPointB);\n seperation = (pointB.x - pointA.x) * normal.x + (pointB.y - pointA.y) * normal.y;\n return seperation;\n }\n case b2SeparationFunction.e_faceB:\n {\n normal = b2Math.MulMV(transformB.R, this.m_axis);\n pointB = b2Math.MulX(transformB, this.m_localPoint);\n axisA = b2Math.MulTMV(transformA.R, normal.GetNegative());\n localPointA = this.m_proxyA.GetSupportVertex(axisA);\n pointA = b2Math.MulX(transformA, localPointA);\n seperation = (pointA.x - pointB.x) * normal.x + (pointA.y - pointB.y) * normal.y;\n return seperation;\n }\n default:\n b2Settings.b2Assert(false);\n return 0.0;\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2SeparationFunction.e_points = 0x01;\n Box2D.Collision.b2SeparationFunction.prototype.e_points = Box2D.Collision.b2SeparationFunction.e_points;\n Box2D.Collision.b2SeparationFunction.e_faceA = 0x02;\n Box2D.Collision.b2SeparationFunction.prototype.e_faceA = Box2D.Collision.b2SeparationFunction.e_faceA;\n Box2D.Collision.b2SeparationFunction.e_faceB = 0x04;\n Box2D.Collision.b2SeparationFunction.prototype.e_faceB = Box2D.Collision.b2SeparationFunction.e_faceB;\n });\n b2Simplex.b2Simplex = function () {\n this.m_v1 = new b2SimplexVertex();\n this.m_v2 = new b2SimplexVertex();\n this.m_v3 = new b2SimplexVertex();\n this.m_vertices = new Vector(3);\n };\n b2Simplex.prototype.b2Simplex = function () {\n this.m_vertices[0] = this.m_v1;\n this.m_vertices[1] = this.m_v2;\n this.m_vertices[2] = this.m_v3;\n }\n b2Simplex.prototype.ReadCache = function (cache, proxyA, transformA, proxyB, transformB) {\n b2Settings.b2Assert(0 <= cache.count && cache.count <= 3);\n var wALocal;\n var wBLocal;\n this.m_count = cache.count;\n var vertices = this.m_vertices;\n for (var i = 0; i < this.m_count; i++) {\n var v = vertices[i];\n v.indexA = cache.indexA[i];\n v.indexB = cache.indexB[i];\n wALocal = proxyA.GetVertex(v.indexA);\n wBLocal = proxyB.GetVertex(v.indexB);\n v.wA = b2Math.MulX(transformA, wALocal);\n v.wB = b2Math.MulX(transformB, wBLocal);\n v.w = b2Math.SubtractVV(v.wB, v.wA);\n v.a = 0;\n }\n if (this.m_count > 1) {\n var metric1 = cache.metric;\n var metric2 = this.GetMetric();\n if (metric2 < .5 * metric1 || 2.0 * metric1 < metric2 || metric2 < Number.MIN_VALUE) {\n this.m_count = 0;\n }\n }\n if (this.m_count == 0) {\n v = vertices[0];\n v.indexA = 0;\n v.indexB = 0;\n wALocal = proxyA.GetVertex(0);\n wBLocal = proxyB.GetVertex(0);\n v.wA = b2Math.MulX(transformA, wALocal);\n v.wB = b2Math.MulX(transformB, wBLocal);\n v.w = b2Math.SubtractVV(v.wB, v.wA);\n this.m_count = 1;\n }\n }\n b2Simplex.prototype.WriteCache = function (cache) {\n cache.metric = this.GetMetric();\n cache.count = a2j.parseUInt(this.m_count);\n var vertices = this.m_vertices;\n for (var i = 0; i < this.m_count; i++) {\n cache.indexA[i] = a2j.parseUInt(vertices[i].indexA);\n cache.indexB[i] = a2j.parseUInt(vertices[i].indexB);\n }\n }\n b2Simplex.prototype.GetSearchDirection = function () {\n switch (this.m_count) {\n case 1:\n return this.m_v1.w.GetNegative();\n case 2:\n {\n var e12 = b2Math.SubtractVV(this.m_v2.w, this.m_v1.w);\n var sgn = b2Math.CrossVV(e12, this.m_v1.w.GetNegative());\n if (sgn > 0.0) {\n return b2Math.CrossFV(1.0, e12);\n }\n else {\n return b2Math.CrossVF(e12, 1.0);\n }\n }\n default:\n b2Settings.b2Assert(false);\n return new b2Vec2();\n }\n }\n b2Simplex.prototype.GetClosestPoint = function () {\n switch (this.m_count) {\n case 0:\n b2Settings.b2Assert(false);\n return new b2Vec2();\n case 1:\n return this.m_v1.w;\n case 2:\n return new b2Vec2(this.m_v1.a * this.m_v1.w.x + this.m_v2.a * this.m_v2.w.x, this.m_v1.a * this.m_v1.w.y + this.m_v2.a * this.m_v2.w.y);\n default:\n b2Settings.b2Assert(false);\n return new b2Vec2();\n }\n }\n b2Simplex.prototype.GetWitnessPoints = function (pA, pB) {\n switch (this.m_count) {\n case 0:\n b2Settings.b2Assert(false);\n break;\n case 1:\n pA.SetV(this.m_v1.wA);\n pB.SetV(this.m_v1.wB);\n break;\n case 2:\n pA.x = this.m_v1.a * this.m_v1.wA.x + this.m_v2.a * this.m_v2.wA.x;\n pA.y = this.m_v1.a * this.m_v1.wA.y + this.m_v2.a * this.m_v2.wA.y;\n pB.x = this.m_v1.a * this.m_v1.wB.x + this.m_v2.a * this.m_v2.wB.x;\n pB.y = this.m_v1.a * this.m_v1.wB.y + this.m_v2.a * this.m_v2.wB.y;\n break;\n case 3:\n pB.x = pA.x = this.m_v1.a * this.m_v1.wA.x + this.m_v2.a * this.m_v2.wA.x + this.m_v3.a * this.m_v3.wA.x;\n pB.y = pA.y = this.m_v1.a * this.m_v1.wA.y + this.m_v2.a * this.m_v2.wA.y + this.m_v3.a * this.m_v3.wA.y;\n break;\n default:\n b2Settings.b2Assert(false);\n break;\n }\n }\n b2Simplex.prototype.GetMetric = function () {\n switch (this.m_count) {\n case 0:\n b2Settings.b2Assert(false);\n return 0.0;\n case 1:\n return 0.0;\n case 2:\n return b2Math.SubtractVV(this.m_v1.w, this.m_v2.w).Length();\n case 3:\n return b2Math.CrossVV(b2Math.SubtractVV(this.m_v2.w, this.m_v1.w), b2Math.SubtractVV(this.m_v3.w, this.m_v1.w));\n default:\n b2Settings.b2Assert(false);\n return 0.0;\n }\n }\n b2Simplex.prototype.Solve2 = function () {\n var w1 = this.m_v1.w;\n var w2 = this.m_v2.w;\n var e12 = b2Math.SubtractVV(w2, w1);\n var d12_2 = (-(w1.x * e12.x + w1.y * e12.y));\n if (d12_2 <= 0.0) {\n this.m_v1.a = 1.0;\n this.m_count = 1;\n return;\n }\n var d12_1 = (w2.x * e12.x + w2.y * e12.y);\n if (d12_1 <= 0.0) {\n this.m_v2.a = 1.0;\n this.m_count = 1;\n this.m_v1.Set(this.m_v2);\n return;\n }\n var inv_d12 = 1.0 / (d12_1 + d12_2);\n this.m_v1.a = d12_1 * inv_d12;\n this.m_v2.a = d12_2 * inv_d12;\n this.m_count = 2;\n }\n b2Simplex.prototype.Solve3 = function () {\n var w1 = this.m_v1.w;\n var w2 = this.m_v2.w;\n var w3 = this.m_v3.w;\n var e12 = b2Math.SubtractVV(w2, w1);\n var w1e12 = b2Math.Dot(w1, e12);\n var w2e12 = b2Math.Dot(w2, e12);\n var d12_1 = w2e12;\n var d12_2 = (-w1e12);\n var e13 = b2Math.SubtractVV(w3, w1);\n var w1e13 = b2Math.Dot(w1, e13);\n var w3e13 = b2Math.Dot(w3, e13);\n var d13_1 = w3e13;\n var d13_2 = (-w1e13);\n var e23 = b2Math.SubtractVV(w3, w2);\n var w2e23 = b2Math.Dot(w2, e23);\n var w3e23 = b2Math.Dot(w3, e23);\n var d23_1 = w3e23;\n var d23_2 = (-w2e23);\n var n123 = b2Math.CrossVV(e12, e13);\n var d123_1 = n123 * b2Math.CrossVV(w2, w3);\n var d123_2 = n123 * b2Math.CrossVV(w3, w1);\n var d123_3 = n123 * b2Math.CrossVV(w1, w2);\n if (d12_2 <= 0.0 && d13_2 <= 0.0) {\n this.m_v1.a = 1.0;\n this.m_count = 1;\n return;\n }\n if (d12_1 > 0.0 && d12_2 > 0.0 && d123_3 <= 0.0) {\n var inv_d12 = 1.0 / (d12_1 + d12_2);\n this.m_v1.a = d12_1 * inv_d12;\n this.m_v2.a = d12_2 * inv_d12;\n this.m_count = 2;\n return;\n }\n if (d13_1 > 0.0 && d13_2 > 0.0 && d123_2 <= 0.0) {\n var inv_d13 = 1.0 / (d13_1 + d13_2);\n this.m_v1.a = d13_1 * inv_d13;\n this.m_v3.a = d13_2 * inv_d13;\n this.m_count = 2;\n this.m_v2.Set(this.m_v3);\n return;\n }\n if (d12_1 <= 0.0 && d23_2 <= 0.0) {\n this.m_v2.a = 1.0;\n this.m_count = 1;\n this.m_v1.Set(this.m_v2);\n return;\n }\n if (d13_1 <= 0.0 && d23_1 <= 0.0) {\n this.m_v3.a = 1.0;\n this.m_count = 1;\n this.m_v1.Set(this.m_v3);\n return;\n }\n if (d23_1 > 0.0 && d23_2 > 0.0 && d123_1 <= 0.0) {\n var inv_d23 = 1.0 / (d23_1 + d23_2);\n this.m_v2.a = d23_1 * inv_d23;\n this.m_v3.a = d23_2 * inv_d23;\n this.m_count = 2;\n this.m_v1.Set(this.m_v3);\n return;\n }\n var inv_d123 = 1.0 / (d123_1 + d123_2 + d123_3);\n this.m_v1.a = d123_1 * inv_d123;\n this.m_v2.a = d123_2 * inv_d123;\n this.m_v3.a = d123_3 * inv_d123;\n this.m_count = 3;\n }\n b2SimplexCache.b2SimplexCache = function () {\n this.indexA = new Vector_a2j_Number(3);\n this.indexB = new Vector_a2j_Number(3);\n };\n b2SimplexVertex.b2SimplexVertex = function () {};\n b2SimplexVertex.prototype.Set = function (other) {\n this.wA.SetV(other.wA);\n this.wB.SetV(other.wB);\n this.w.SetV(other.w);\n this.a = other.a;\n this.indexA = other.indexA;\n this.indexB = other.indexB;\n }\n b2TimeOfImpact.b2TimeOfImpact = function () {};\n b2TimeOfImpact.prototype.TimeOfImpact = function (input) {\n ++b2TimeOfImpact.b2_toiCalls;\n var proxyA = input.proxyA;\n var proxyB = input.proxyB;\n var sweepA = input.sweepA;\n var sweepB = input.sweepB;\n b2Settings.b2Assert(sweepA.t0 == sweepB.t0);\n b2Settings.b2Assert(1.0 - sweepA.t0 > Number.MIN_VALUE);\n var radius = proxyA.m_radius + proxyB.m_radius;\n var tolerance = input.tolerance;\n var alpha = 0.0;\n var k_maxIterations = 1000;\n var iter = 0;\n var target = 0.0;\n b2TimeOfImpact.s_cache.count = 0;\n b2TimeOfImpact.s_distanceInput.useRadii = false;\n for (;;) {\n sweepA.GetTransform(b2TimeOfImpact.s_xfA, alpha);\n sweepB.GetTransform(b2TimeOfImpact.s_xfB, alpha);\n b2TimeOfImpact.s_distanceInput.proxyA = proxyA;\n b2TimeOfImpact.s_distanceInput.proxyB = proxyB;\n b2TimeOfImpact.s_distanceInput.transformA = b2TimeOfImpact.s_xfA;\n b2TimeOfImpact.s_distanceInput.transformB = b2TimeOfImpact.s_xfB;\n b2Distance.Distance(b2TimeOfImpact.s_distanceOutput, b2TimeOfImpact.s_cache, b2TimeOfImpact.s_distanceInput);\n if (b2TimeOfImpact.s_distanceOutput.distance <= 0.0) {\n alpha = 1.0;\n break;\n }\n b2TimeOfImpact.s_fcn.Initialize(b2TimeOfImpact.s_cache, proxyA, b2TimeOfImpact.s_xfA, proxyB, b2TimeOfImpact.s_xfB);\n var separation = b2TimeOfImpact.s_fcn.Evaluate(b2TimeOfImpact.s_xfA, b2TimeOfImpact.s_xfB);\n if (separation <= 0.0) {\n alpha = 1.0;\n break;\n }\n if (iter == 0) {\n if (separation > radius) {\n target = b2Math.Max(radius - tolerance, 0.75 * radius);\n }\n else {\n target = b2Math.Max(separation - tolerance, 0.02 * radius);\n }\n }\n if (separation - target < 0.5 * tolerance) {\n if (iter == 0) {\n alpha = 1.0;\n break;\n }\n break;\n }\n var newAlpha = alpha; {\n var x1 = alpha;\n var x2 = 1.0;\n var f1 = separation;\n sweepA.GetTransform(b2TimeOfImpact.s_xfA, x2);\n sweepB.GetTransform(b2TimeOfImpact.s_xfB, x2);\n var f2 = b2TimeOfImpact.s_fcn.Evaluate(b2TimeOfImpact.s_xfA, b2TimeOfImpact.s_xfB);\n if (f2 >= target) {\n alpha = 1.0;\n break;\n }\n var rootIterCount = 0;\n for (;;) {\n var x = 0;\n if (rootIterCount & 1) {\n x = x1 + (target - f1) * (x2 - x1) / (f2 - f1);\n }\n else {\n x = 0.5 * (x1 + x2);\n }\n sweepA.GetTransform(b2TimeOfImpact.s_xfA, x);\n sweepB.GetTransform(b2TimeOfImpact.s_xfB, x);\n var f = b2TimeOfImpact.s_fcn.Evaluate(b2TimeOfImpact.s_xfA, b2TimeOfImpact.s_xfB);\n if (b2Math.Abs(f - target) < 0.025 * tolerance) {\n newAlpha = x;\n break;\n }\n if (f > target) {\n x1 = x;\n f1 = f;\n }\n else {\n x2 = x;\n f2 = f;\n }++rootIterCount;\n ++b2TimeOfImpact.b2_toiRootIters;\n if (rootIterCount == 50) {\n break;\n }\n }\n b2TimeOfImpact.b2_toiMaxRootIters = b2Math.Max(b2TimeOfImpact.b2_toiMaxRootIters, rootIterCount);\n }\n if (newAlpha < (1.0 + 100.0 * Number.MIN_VALUE) * alpha) {\n break;\n }\n alpha = newAlpha;\n iter++;\n ++b2TimeOfImpact.b2_toiIters;\n if (iter == k_maxIterations) {\n break;\n }\n }\n b2TimeOfImpact.b2_toiMaxIters = b2Math.Max(b2TimeOfImpact.b2_toiMaxIters, iter);\n return alpha;\n }\n b2TimeOfImpact.TimeOfImpact = b2TimeOfImpact.prototype.TimeOfImpact;\n _A2J_postDefs.push(function () {\n Box2D.Collision.b2TimeOfImpact.b2_toiCalls = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiCalls = Box2D.Collision.b2TimeOfImpact.b2_toiCalls;\n Box2D.Collision.b2TimeOfImpact.b2_toiIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiIters = Box2D.Collision.b2TimeOfImpact.b2_toiIters;\n Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiMaxIters = Box2D.Collision.b2TimeOfImpact.b2_toiMaxIters;\n Box2D.Collision.b2TimeOfImpact.b2_toiRootIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiRootIters = Box2D.Collision.b2TimeOfImpact.b2_toiRootIters;\n Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters = 0;\n Box2D.Collision.b2TimeOfImpact.prototype.b2_toiMaxRootIters = Box2D.Collision.b2TimeOfImpact.b2_toiMaxRootIters;\n Box2D.Collision.b2TimeOfImpact.s_cache = new b2SimplexCache();\n Box2D.Collision.b2TimeOfImpact.prototype.s_cache = Box2D.Collision.b2TimeOfImpact.s_cache;\n Box2D.Collision.b2TimeOfImpact.s_distanceInput = new b2DistanceInput();\n Box2D.Collision.b2TimeOfImpact.prototype.s_distanceInput = Box2D.Collision.b2TimeOfImpact.s_distanceInput;\n Box2D.Collision.b2TimeOfImpact.s_xfA = new b2Transform();\n Box2D.Collision.b2TimeOfImpact.prototype.s_xfA = Box2D.Collision.b2TimeOfImpact.s_xfA;\n Box2D.Collision.b2TimeOfImpact.s_xfB = new b2Transform();\n Box2D.Collision.b2TimeOfImpact.prototype.s_xfB = Box2D.Collision.b2TimeOfImpact.s_xfB;\n Box2D.Collision.b2TimeOfImpact.s_fcn = new b2SeparationFunction();\n Box2D.Collision.b2TimeOfImpact.prototype.s_fcn = Box2D.Collision.b2TimeOfImpact.s_fcn;\n Box2D.Collision.b2TimeOfImpact.s_distanceOutput = new b2DistanceOutput();\n Box2D.Collision.b2TimeOfImpact.prototype.s_distanceOutput = Box2D.Collision.b2TimeOfImpact.s_distanceOutput;\n });\n b2TOIInput.b2TOIInput = function () {\n this.proxyA = new b2DistanceProxy();\n this.proxyB = new b2DistanceProxy();\n this.sweepA = new b2Sweep();\n this.sweepB = new b2Sweep();\n };\n b2WorldManifold.b2WorldManifold = function () {\n this.m_normal = new b2Vec2();\n };\n b2WorldManifold.prototype.b2WorldManifold = function () {\n this.m_points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.m_points[i] = new b2Vec2();\n }\n }\n b2WorldManifold.prototype.Initialize = function (manifold, xfA, radiusA, xfB, radiusB) {\n if (radiusA === undefined) radiusA = 0;\n if (radiusB === undefined) radiusB = 0;\n if (manifold.m_pointCount == 0) {\n return;\n }\n var i = 0;\n var tVec;\n var tMat;\n var normalX = 0;\n var normalY = 0;\n var planePointX = 0;\n var planePointY = 0;\n var clipPointX = 0;\n var clipPointY = 0;\n switch (manifold.m_type) {\n case b2Manifold.e_circles:\n {\n tMat = xfA.R;\n tVec = manifold.m_localPoint;\n var pointAX = xfA.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n var pointAY = xfA.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = xfB.R;\n tVec = manifold.m_points[0].m_localPoint;\n var pointBX = xfB.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n var pointBY = xfB.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n var dX = pointBX - pointAX;\n var dY = pointBY - pointAY;\n var d2 = dX * dX + dY * dY;\n if (d2 > Number.MIN_VALUE * Number.MIN_VALUE) {\n var d = Math.sqrt(d2);\n this.m_normal.x = dX / d;\n this.m_normal.y = dY / d;\n }\n else {\n this.m_normal.x = 1;\n this.m_normal.y = 0;\n }\n var cAX = pointAX + radiusA * this.m_normal.x;\n var cAY = pointAY + radiusA * this.m_normal.y;\n var cBX = pointBX - radiusB * this.m_normal.x;\n var cBY = pointBY - radiusB * this.m_normal.y;\n this.m_points[0].x = 0.5 * (cAX + cBX);\n this.m_points[0].y = 0.5 * (cAY + cBY);\n }\n break;\n case b2Manifold.e_faceA:\n {\n tMat = xfA.R;\n tVec = manifold.m_localPlaneNormal;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = xfA.R;\n tVec = manifold.m_localPoint;\n planePointX = xfA.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n planePointY = xfA.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_normal.x = normalX;\n this.m_normal.y = normalY;\n for (i = 0;\n i < manifold.m_pointCount; i++) {\n tMat = xfB.R;\n tVec = manifold.m_points[i].m_localPoint;\n clipPointX = xfB.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n clipPointY = xfB.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_points[i].x = clipPointX + 0.5 * (radiusA - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusB) * normalX;\n this.m_points[i].y = clipPointY + 0.5 * (radiusA - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusB) * normalY;\n }\n }\n break;\n case b2Manifold.e_faceB:\n {\n tMat = xfB.R;\n tVec = manifold.m_localPlaneNormal;\n normalX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n normalY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = xfB.R;\n tVec = manifold.m_localPoint;\n planePointX = xfB.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n planePointY = xfB.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_normal.x = (-normalX);\n this.m_normal.y = (-normalY);\n for (i = 0;\n i < manifold.m_pointCount; i++) {\n tMat = xfA.R;\n tVec = manifold.m_points[i].m_localPoint;\n clipPointX = xfA.position.x + tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n clipPointY = xfA.position.y + tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n this.m_points[i].x = clipPointX + 0.5 * (radiusB - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusA) * normalX;\n this.m_points[i].y = clipPointY + 0.5 * (radiusB - (clipPointX - planePointX) * normalX - (clipPointY - planePointY) * normalY - radiusA) * normalY;\n }\n }\n break;\n }\n }\n ClipVertex.ClipVertex = function () {\n this.v = new b2Vec2();\n this.id = new b2ContactID();\n };\n ClipVertex.prototype.Set = function (other) {\n this.v.SetV(other.v);\n this.id.Set(other.id);\n }\n Features.Features = function () {};\n Features.prototype.__defineGetter__('referenceEdge', function () {\n return this._referenceEdge;\n });\n Features.prototype.__defineSetter__('referenceEdge', function (value) {\n if (value === undefined) value = 0;\n this._referenceEdge = value;\n this._m_id._key = (this._m_id._key & 0xffffff00) | (this._referenceEdge & 0x000000ff);\n });\n Features.prototype.__defineGetter__('incidentEdge', function () {\n return this._incidentEdge;\n });\n Features.prototype.__defineSetter__('incidentEdge', function (value) {\n if (value === undefined) value = 0;\n this._incidentEdge = value;\n this._m_id._key = (this._m_id._key & 0xffff00ff) | ((this._incidentEdge << 8) & 0x0000ff00);\n });\n Features.prototype.__defineGetter__('incidentVertex', function () {\n return this._incidentVertex;\n });\n Features.prototype.__defineSetter__('incidentVertex', function (value) {\n if (value === undefined) value = 0;\n this._incidentVertex = value;\n this._m_id._key = (this._m_id._key & 0xff00ffff) | ((this._incidentVertex << 16) & 0x00ff0000);\n });\n Features.prototype.__defineGetter__('flip', function () {\n return this._flip;\n });\n Features.prototype.__defineSetter__('flip', function (value) {\n if (value === undefined) value = 0;\n this._flip = value;\n this._m_id._key = (this._m_id._key & 0x00ffffff) | ((this._flip << 24) & 0xff000000);\n });\n})(); /* source: disabled*/\n(function () {\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2internal = Box2D.Common.b2internal;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n b2CircleShape.inherit(Box2D.Collision.Shapes.b2Shape);\n b2CircleShape.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;\n b2CircleShape.b2CircleShape = function () {\n Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);\n this.m_p = new b2Vec2();\n };\n b2CircleShape.prototype.Copy = function () {\n var s = new b2CircleShape();\n s.Set(this);\n return s;\n }\n b2CircleShape.prototype.Set = function (other) {\n this.__super.Set.call(this, other);\n if (a2j.is(other, b2CircleShape)) {\n var other2 = (other instanceof b2CircleShape ? other : null);\n this.m_p.SetV(other2.m_p);\n }\n }\n b2CircleShape.prototype.TestPoint = function (transform, p) {\n var tMat = transform.R;\n var dX = transform.position.x + (tMat.col1.x * this.m_p.x + tMat.col2.x * this.m_p.y);\n var dY = transform.position.y + (tMat.col1.y * this.m_p.x + tMat.col2.y * this.m_p.y);\n dX = p.x - dX;\n dY = p.y - dY;\n return (dX * dX + dY * dY) <= this.m_radius * this.m_radius;\n }\n b2CircleShape.prototype.RayCast = function (output, input, transform) {\n var tMat = transform.R;\n var positionX = transform.position.x + (tMat.col1.x * this.m_p.x + tMat.col2.x * this.m_p.y);\n var positionY = transform.position.y + (tMat.col1.y * this.m_p.x + tMat.col2.y * this.m_p.y);\n var sX = input.p1.x - positionX;\n var sY = input.p1.y - positionY;\n var b = (sX * sX + sY * sY) - this.m_radius * this.m_radius;\n var rX = input.p2.x - input.p1.x;\n var rY = input.p2.y - input.p1.y;\n var c = (sX * rX + sY * rY);\n var rr = (rX * rX + rY * rY);\n var sigma = c * c - rr * b;\n if (sigma < 0.0 || rr < Number.MIN_VALUE) {\n return false;\n }\n var a = (-(c + Math.sqrt(sigma)));\n if (0.0 <= a && a <= input.maxFraction * rr) {\n a /= rr;\n output.fraction = a;\n output.normal.x = sX + a * rX;\n output.normal.y = sY + a * rY;\n output.normal.Normalize();\n return true;\n }\n return false;\n }\n b2CircleShape.prototype.ComputeAABB = function (aabb, transform) {\n var tMat = transform.R;\n var pX = transform.position.x + (tMat.col1.x * this.m_p.x + tMat.col2.x * this.m_p.y);\n var pY = transform.position.y + (tMat.col1.y * this.m_p.x + tMat.col2.y * this.m_p.y);\n aabb.lowerBound.Set(pX - this.m_radius, pY - this.m_radius);\n aabb.upperBound.Set(pX + this.m_radius, pY + this.m_radius);\n }\n b2CircleShape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n massData.mass = density * b2Settings.b2_pi * this.m_radius * this.m_radius;\n massData.center.SetV(this.m_p);\n massData.I = massData.mass * (0.5 * this.m_radius * this.m_radius + (this.m_p.x * this.m_p.x + this.m_p.y * this.m_p.y));\n }\n b2CircleShape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n var p = b2Math.MulX(xf, this.m_p);\n var l = (-(b2Math.Dot(normal, p) - offset));\n if (l < (-this.m_radius) + Number.MIN_VALUE) {\n return 0;\n }\n if (l > this.m_radius) {\n c.SetV(p);\n return Math.PI * this.m_radius * this.m_radius;\n }\n var r2 = this.m_radius * this.m_radius;\n var l2 = l * l;\n var area = r2 * (Math.asin(l / this.m_radius) + Math.PI / 2) + l * Math.sqrt(r2 - l2);\n var com = (-2 / 3 * Math.pow(r2 - l2, 1.5) / area);\n c.x = p.x + normal.x * com;\n c.y = p.y + normal.y * com;\n return area;\n }\n b2CircleShape.prototype.GetLocalPosition = function () {\n return this.m_p;\n }\n b2CircleShape.prototype.SetLocalPosition = function (position) {\n this.m_p.SetV(position);\n }\n b2CircleShape.prototype.GetRadius = function () {\n return this.m_radius;\n }\n b2CircleShape.prototype.SetRadius = function (radius) {\n if (radius === undefined) radius = 0;\n this.m_radius = radius;\n }\n b2CircleShape.prototype.b2CircleShape = function (radius) {\n if (radius === undefined) radius = 0;\n this.__super.b2Shape.call(this);\n this.m_type = this.e_circleShape;\n this.m_radius = radius;\n }\n b2EdgeChainDef.b2EdgeChainDef = function () {};\n b2EdgeChainDef.prototype.b2EdgeChainDef = function () {\n this.vertexCount = 0;\n this.isALoop = true;\n this.vertices = [];\n }\n b2EdgeShape.inherit(Box2D.Collision.Shapes.b2Shape);\n b2EdgeShape.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;\n b2EdgeShape.b2EdgeShape = function () {\n Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);\n this.s_supportVec = new b2Vec2();\n this.m_v1 = new b2Vec2();\n this.m_v2 = new b2Vec2();\n this.m_coreV1 = new b2Vec2();\n this.m_coreV2 = new b2Vec2();\n this.m_normal = new b2Vec2();\n this.m_direction = new b2Vec2();\n this.m_cornerDir1 = new b2Vec2();\n this.m_cornerDir2 = new b2Vec2();\n };\n b2EdgeShape.prototype.TestPoint = function (transform, p) {\n return false;\n }\n b2EdgeShape.prototype.RayCast = function (output, input, transform) {\n var tMat;\n var rX = input.p2.x - input.p1.x;\n var rY = input.p2.y - input.p1.y;\n tMat = transform.R;\n var v1X = transform.position.x + (tMat.col1.x * this.m_v1.x + tMat.col2.x * this.m_v1.y);\n var v1Y = transform.position.y + (tMat.col1.y * this.m_v1.x + tMat.col2.y * this.m_v1.y);\n var nX = transform.position.y + (tMat.col1.y * this.m_v2.x + tMat.col2.y * this.m_v2.y) - v1Y;\n var nY = (-(transform.position.x + (tMat.col1.x * this.m_v2.x + tMat.col2.x * this.m_v2.y) - v1X));\n var k_slop = 100.0 * Number.MIN_VALUE;\n var denom = (-(rX * nX + rY * nY));\n if (denom > k_slop) {\n var bX = input.p1.x - v1X;\n var bY = input.p1.y - v1Y;\n var a = (bX * nX + bY * nY);\n if (0.0 <= a && a <= input.maxFraction * denom) {\n var mu2 = (-rX * bY) + rY * bX;\n if ((-k_slop * denom) <= mu2 && mu2 <= denom * (1.0 + k_slop)) {\n a /= denom;\n output.fraction = a;\n var nLen = Math.sqrt(nX * nX + nY * nY);\n output.normal.x = nX / nLen;\n output.normal.y = nY / nLen;\n return true;\n }\n }\n }\n return false;\n }\n b2EdgeShape.prototype.ComputeAABB = function (aabb, transform) {\n var tMat = transform.R;\n var v1X = transform.position.x + (tMat.col1.x * this.m_v1.x + tMat.col2.x * this.m_v1.y);\n var v1Y = transform.position.y + (tMat.col1.y * this.m_v1.x + tMat.col2.y * this.m_v1.y);\n var v2X = transform.position.x + (tMat.col1.x * this.m_v2.x + tMat.col2.x * this.m_v2.y);\n var v2Y = transform.position.y + (tMat.col1.y * this.m_v2.x + tMat.col2.y * this.m_v2.y);\n if (v1X < v2X) {\n aabb.lowerBound.x = v1X;\n aabb.upperBound.x = v2X;\n }\n else {\n aabb.lowerBound.x = v2X;\n aabb.upperBound.x = v1X;\n }\n if (v1Y < v2Y) {\n aabb.lowerBound.y = v1Y;\n aabb.upperBound.y = v2Y;\n }\n else {\n aabb.lowerBound.y = v2Y;\n aabb.upperBound.y = v1Y;\n }\n }\n b2EdgeShape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n massData.mass = 0;\n massData.center.SetV(this.m_v1);\n massData.I = 0;\n }\n b2EdgeShape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n var v0 = new b2Vec2(normal.x * offset, normal.y * offset);\n var v1 = b2Math.MulX(xf, this.m_v1);\n var v2 = b2Math.MulX(xf, this.m_v2);\n var d1 = b2Math.Dot(normal, v1) - offset;\n var d2 = b2Math.Dot(normal, v2) - offset;\n if (d1 > 0) {\n if (d2 > 0) {\n return 0;\n }\n else {\n v1.x = (-d2 / (d1 - d2) * v1.x) + d1 / (d1 - d2) * v2.x;\n v1.y = (-d2 / (d1 - d2) * v1.y) + d1 / (d1 - d2) * v2.y;\n }\n }\n else {\n if (d2 > 0) {\n v2.x = (-d2 / (d1 - d2) * v1.x) + d1 / (d1 - d2) * v2.x;\n v2.y = (-d2 / (d1 - d2) * v1.y) + d1 / (d1 - d2) * v2.y;\n }\n else {}\n }\n c.x = (v0.x + v1.x + v2.x) / 3;\n c.y = (v0.y + v1.y + v2.y) / 3;\n return 0.5 * ((v1.x - v0.x) * (v2.y - v0.y) - (v1.y - v0.y) * (v2.x - v0.x));\n }\n b2EdgeShape.prototype.GetLength = function () {\n return this.m_length;\n }\n b2EdgeShape.prototype.GetVertex1 = function () {\n return this.m_v1;\n }\n b2EdgeShape.prototype.GetVertex2 = function () {\n return this.m_v2;\n }\n b2EdgeShape.prototype.GetCoreVertex1 = function () {\n return this.m_coreV1;\n }\n b2EdgeShape.prototype.GetCoreVertex2 = function () {\n return this.m_coreV2;\n }\n b2EdgeShape.prototype.GetNormalVector = function () {\n return this.m_normal;\n }\n b2EdgeShape.prototype.GetDirectionVector = function () {\n return this.m_direction;\n }\n b2EdgeShape.prototype.GetCorner1Vector = function () {\n return this.m_cornerDir1;\n }\n b2EdgeShape.prototype.GetCorner2Vector = function () {\n return this.m_cornerDir2;\n }\n b2EdgeShape.prototype.Corner1IsConvex = function () {\n return this.m_cornerConvex1;\n }\n b2EdgeShape.prototype.Corner2IsConvex = function () {\n return this.m_cornerConvex2;\n }\n b2EdgeShape.prototype.GetFirstVertex = function (xf) {\n var tMat = xf.R;\n return new b2Vec2(xf.position.x + (tMat.col1.x * this.m_coreV1.x + tMat.col2.x * this.m_coreV1.y), xf.position.y + (tMat.col1.y * this.m_coreV1.x + tMat.col2.y * this.m_coreV1.y));\n }\n b2EdgeShape.prototype.GetNextEdge = function () {\n return this.m_nextEdge;\n }\n b2EdgeShape.prototype.GetPrevEdge = function () {\n return this.m_prevEdge;\n }\n b2EdgeShape.prototype.Support = function (xf, dX, dY) {\n if (dX === undefined) dX = 0;\n if (dY === undefined) dY = 0;\n var tMat = xf.R;\n var v1X = xf.position.x + (tMat.col1.x * this.m_coreV1.x + tMat.col2.x * this.m_coreV1.y);\n var v1Y = xf.position.y + (tMat.col1.y * this.m_coreV1.x + tMat.col2.y * this.m_coreV1.y);\n var v2X = xf.position.x + (tMat.col1.x * this.m_coreV2.x + tMat.col2.x * this.m_coreV2.y);\n var v2Y = xf.position.y + (tMat.col1.y * this.m_coreV2.x + tMat.col2.y * this.m_coreV2.y);\n if ((v1X * dX + v1Y * dY) > (v2X * dX + v2Y * dY)) {\n this.s_supportVec.x = v1X;\n this.s_supportVec.y = v1Y;\n }\n else {\n this.s_supportVec.x = v2X;\n this.s_supportVec.y = v2Y;\n }\n return this.s_supportVec;\n }\n b2EdgeShape.prototype.b2EdgeShape = function (v1, v2) {\n this.__super.b2Shape.call(this);\n this.m_type = this.e_edgeShape;\n this.m_prevEdge = null;\n this.m_nextEdge = null;\n this.m_v1 = v1;\n this.m_v2 = v2;\n this.m_direction.Set(this.m_v2.x - this.m_v1.x, this.m_v2.y - this.m_v1.y);\n this.m_length = this.m_direction.Normalize();\n this.m_normal.Set(this.m_direction.y, (-this.m_direction.x));\n this.m_coreV1.Set((-b2Settings.b2_toiSlop * (this.m_normal.x - this.m_direction.x)) + this.m_v1.x, (-b2Settings.b2_toiSlop * (this.m_normal.y - this.m_direction.y)) + this.m_v1.y);\n this.m_coreV2.Set((-b2Settings.b2_toiSlop * (this.m_normal.x + this.m_direction.x)) + this.m_v2.x, (-b2Settings.b2_toiSlop * (this.m_normal.y + this.m_direction.y)) + this.m_v2.y);\n this.m_cornerDir1 = this.m_normal;\n this.m_cornerDir2.Set((-this.m_normal.x), (-this.m_normal.y));\n }\n b2EdgeShape.prototype.SetPrevEdge = function (edge, core, cornerDir, convex) {\n this.m_prevEdge = edge;\n this.m_coreV1 = core;\n this.m_cornerDir1 = cornerDir;\n this.m_cornerConvex1 = convex;\n }\n b2EdgeShape.prototype.SetNextEdge = function (edge, core, cornerDir, convex) {\n this.m_nextEdge = edge;\n this.m_coreV2 = core;\n this.m_cornerDir2 = cornerDir;\n this.m_cornerConvex2 = convex;\n }\n b2MassData.b2MassData = function () {\n this.mass = 0.0;\n this.center = new b2Vec2(0, 0);\n this.I = 0.0;\n };\n b2PolygonShape.inherit(Box2D.Collision.Shapes.b2Shape);\n b2PolygonShape.prototype.__super = Box2D.Collision.Shapes.b2Shape.prototype;\n b2PolygonShape.b2PolygonShape = function () {\n Box2D.Collision.Shapes.b2Shape.b2Shape.apply(this, arguments);\n };\n b2PolygonShape.prototype.Copy = function () {\n var s = new b2PolygonShape();\n s.Set(this);\n return s;\n }\n b2PolygonShape.prototype.Set = function (other) {\n this.__super.Set.call(this, other);\n if (a2j.is(other, b2PolygonShape)) {\n var other2 = (other instanceof b2PolygonShape ? other : null);\n this.m_centroid.SetV(other2.m_centroid);\n this.m_vertexCount = other2.m_vertexCount;\n this.Reserve(this.m_vertexCount);\n for (var i = 0; i < this.m_vertexCount; i++) {\n this.m_vertices[i].SetV(other2.m_vertices[i]);\n this.m_normals[i].SetV(other2.m_normals[i]);\n }\n }\n }\n b2PolygonShape.prototype.SetAsArray = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n var v = new Vector();\n var tVec;\n\n var len = vertices.length\n for (var i = 0; i < len; i++) {\n tVec = vertices[i]; {\n v.push(tVec);\n }\n }\n this.SetAsVector(v, vertexCount);\n }\n b2PolygonShape.prototype.AsArray = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsArray(vertices, vertexCount);\n return polygonShape;\n }\n b2PolygonShape.AsArray = b2PolygonShape.prototype.AsArray;\n b2PolygonShape.prototype.SetAsVector = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n if (vertexCount == 0) vertexCount = vertices.length;\n b2Settings.b2Assert(2 <= vertexCount);\n this.m_vertexCount = vertexCount;\n this.Reserve(vertexCount);\n var i = 0;\n for (i = 0;\n i < this.m_vertexCount; i++) {\n this.m_vertices[i].SetV(vertices[i]);\n }\n for (i = 0;\n i < this.m_vertexCount; ++i) {\n var i1 = parseInt(i);\n var i2 = parseInt(i + 1 < this.m_vertexCount ? i + 1 : 0);\n var edge = b2Math.SubtractVV(this.m_vertices[i2], this.m_vertices[i1]);\n b2Settings.b2Assert(edge.LengthSquared() > Number.MIN_VALUE);\n this.m_normals[i].SetV(b2Math.CrossVF(edge, 1.0));\n this.m_normals[i].Normalize();\n }\n this.m_centroid = this.ComputeCentroid(this.m_vertices, this.m_vertexCount);\n }\n b2PolygonShape.prototype.AsVector = function (vertices, vertexCount) {\n if (vertexCount === undefined) vertexCount = 0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsVector(vertices, vertexCount);\n return polygonShape;\n }\n b2PolygonShape.AsVector = b2PolygonShape.prototype.AsVector;\n b2PolygonShape.prototype.SetAsBox = function (hx, hy) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n this.m_vertexCount = 4;\n this.Reserve(4);\n this.m_vertices[0].Set((-hx), (-hy));\n this.m_vertices[1].Set(hx, (-hy));\n this.m_vertices[2].Set(hx, hy);\n this.m_vertices[3].Set((-hx), hy);\n this.m_normals[0].Set(0.0, (-1.0));\n this.m_normals[1].Set(1.0, 0.0);\n this.m_normals[2].Set(0.0, 1.0);\n this.m_normals[3].Set((-1.0), 0.0);\n this.m_centroid.SetZero();\n }\n b2PolygonShape.prototype.AsBox = function (hx, hy) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsBox(hx, hy);\n return polygonShape;\n }\n b2PolygonShape.AsBox = b2PolygonShape.prototype.AsBox;\n b2PolygonShape.prototype.SetAsOrientedBox = function (hx, hy, center, angle) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n if (center === undefined) center = null;\n if (angle === undefined) angle = 0.0;\n this.m_vertexCount = 4;\n this.Reserve(4);\n this.m_vertices[0].Set((-hx), (-hy));\n this.m_vertices[1].Set(hx, (-hy));\n this.m_vertices[2].Set(hx, hy);\n this.m_vertices[3].Set((-hx), hy);\n this.m_normals[0].Set(0.0, (-1.0));\n this.m_normals[1].Set(1.0, 0.0);\n this.m_normals[2].Set(0.0, 1.0);\n this.m_normals[3].Set((-1.0), 0.0);\n this.m_centroid = center;\n var xf = new b2Transform();\n xf.position = center;\n xf.R.Set(angle);\n for (var i = 0; i < this.m_vertexCount; ++i) {\n this.m_vertices[i] = b2Math.MulX(xf, this.m_vertices[i]);\n this.m_normals[i] = b2Math.MulMV(xf.R, this.m_normals[i]);\n }\n }\n b2PolygonShape.prototype.AsOrientedBox = function (hx, hy, center, angle) {\n if (hx === undefined) hx = 0;\n if (hy === undefined) hy = 0;\n if (center === undefined) center = null;\n if (angle === undefined) angle = 0.0;\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsOrientedBox(hx, hy, center, angle);\n return polygonShape;\n }\n b2PolygonShape.AsOrientedBox = b2PolygonShape.prototype.AsOrientedBox;\n b2PolygonShape.prototype.SetAsEdge = function (v1, v2) {\n this.m_vertexCount = 2;\n this.Reserve(2);\n this.m_vertices[0].SetV(v1);\n this.m_vertices[1].SetV(v2);\n this.m_centroid.x = 0.5 * (v1.x + v2.x);\n this.m_centroid.y = 0.5 * (v1.y + v2.y);\n this.m_normals[0] = b2Math.CrossVF(b2Math.SubtractVV(v2, v1), 1.0);\n this.m_normals[0].Normalize();\n this.m_normals[1].x = (-this.m_normals[0].x);\n this.m_normals[1].y = (-this.m_normals[0].y);\n }\n b2PolygonShape.prototype.AsEdge = function (v1, v2) {\n var polygonShape = new b2PolygonShape();\n polygonShape.SetAsEdge(v1, v2);\n return polygonShape;\n }\n b2PolygonShape.AsEdge = b2PolygonShape.prototype.AsEdge;\n b2PolygonShape.prototype.TestPoint = function (xf, p) {\n var tVec;\n var tMat = xf.R;\n var tX = p.x - xf.position.x;\n var tY = p.y - xf.position.y;\n var pLocalX = (tX * tMat.col1.x + tY * tMat.col1.y);\n var pLocalY = (tX * tMat.col2.x + tY * tMat.col2.y);\n for (var i = 0; i < this.m_vertexCount; ++i) {\n tVec = this.m_vertices[i];\n tX = pLocalX - tVec.x;\n tY = pLocalY - tVec.y;\n tVec = this.m_normals[i];\n var dot = (tVec.x * tX + tVec.y * tY);\n if (dot > 0.0) {\n return false;\n }\n }\n return true;\n }\n b2PolygonShape.prototype.RayCast = function (output, input, transform) {\n var lower = 0.0;\n var upper = input.maxFraction;\n var tX = 0;\n var tY = 0;\n var tMat;\n var tVec;\n tX = input.p1.x - transform.position.x;\n tY = input.p1.y - transform.position.y;\n tMat = transform.R;\n var p1X = (tX * tMat.col1.x + tY * tMat.col1.y);\n var p1Y = (tX * tMat.col2.x + tY * tMat.col2.y);\n tX = input.p2.x - transform.position.x;\n tY = input.p2.y - transform.position.y;\n tMat = transform.R;\n var p2X = (tX * tMat.col1.x + tY * tMat.col1.y);\n var p2Y = (tX * tMat.col2.x + tY * tMat.col2.y);\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var index = parseInt((-1));\n for (var i = 0; i < this.m_vertexCount; ++i) {\n tVec = this.m_vertices[i];\n tX = tVec.x - p1X;\n tY = tVec.y - p1Y;\n tVec = this.m_normals[i];\n var numerator = (tVec.x * tX + tVec.y * tY);\n var denominator = (tVec.x * dX + tVec.y * dY);\n if (denominator == 0.0) {\n if (numerator < 0.0) {\n return false;\n }\n }\n else {\n if (denominator < 0.0 && numerator < lower * denominator) {\n lower = numerator / denominator;\n index = i;\n }\n else if (denominator > 0.0 && numerator < upper * denominator) {\n upper = numerator / denominator;\n }\n }\n if (upper < lower - Number.MIN_VALUE) {\n return false;\n }\n }\n if (index >= 0) {\n output.fraction = lower;\n tMat = transform.R;\n tVec = this.m_normals[index];\n output.normal.x = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n output.normal.y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n return true;\n }\n return false;\n }\n b2PolygonShape.prototype.ComputeAABB = function (aabb, xf) {\n var tMat = xf.R;\n var tVec = this.m_vertices[0];\n var lowerX = xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var lowerY = xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var upperX = lowerX;\n var upperY = lowerY;\n for (var i = 1; i < this.m_vertexCount; ++i) {\n tVec = this.m_vertices[i];\n var vX = xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var vY = xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n lowerX = lowerX < vX ? lowerX : vX;\n lowerY = lowerY < vY ? lowerY : vY;\n upperX = upperX > vX ? upperX : vX;\n upperY = upperY > vY ? upperY : vY;\n }\n aabb.lowerBound.x = lowerX - this.m_radius;\n aabb.lowerBound.y = lowerY - this.m_radius;\n aabb.upperBound.x = upperX + this.m_radius;\n aabb.upperBound.y = upperY + this.m_radius;\n }\n b2PolygonShape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n if (this.m_vertexCount == 2) {\n massData.center.x = 0.5 * (this.m_vertices[0].x + this.m_vertices[1].x);\n massData.center.y = 0.5 * (this.m_vertices[0].y + this.m_vertices[1].y);\n massData.mass = 0.0;\n massData.I = 0.0;\n return;\n }\n var centerX = 0.0;\n var centerY = 0.0;\n var area = 0.0;\n var I = 0.0;\n var p1X = 0.0;\n var p1Y = 0.0;\n var k_inv3 = 1.0 / 3.0;\n for (var i = 0; i < this.m_vertexCount; ++i) {\n var p2 = this.m_vertices[i];\n var p3 = i + 1 < this.m_vertexCount ? this.m_vertices[parseInt(i + 1)] : this.m_vertices[0];\n var e1X = p2.x - p1X;\n var e1Y = p2.y - p1Y;\n var e2X = p3.x - p1X;\n var e2Y = p3.y - p1Y;\n var D = e1X * e2Y - e1Y * e2X;\n var triangleArea = 0.5 * D;area += triangleArea;\n centerX += triangleArea * k_inv3 * (p1X + p2.x + p3.x);\n centerY += triangleArea * k_inv3 * (p1Y + p2.y + p3.y);\n var px = p1X;\n var py = p1Y;\n var ex1 = e1X;\n var ey1 = e1Y;\n var ex2 = e2X;\n var ey2 = e2Y;\n var intx2 = k_inv3 * (0.25 * (ex1 * ex1 + ex2 * ex1 + ex2 * ex2) + (px * ex1 + px * ex2)) + 0.5 * px * px;\n var inty2 = k_inv3 * (0.25 * (ey1 * ey1 + ey2 * ey1 + ey2 * ey2) + (py * ey1 + py * ey2)) + 0.5 * py * py;I += D * (intx2 + inty2);\n }\n massData.mass = density * area;\n centerX *= 1.0 / area;\n centerY *= 1.0 / area;\n massData.center.Set(centerX, centerY);\n massData.I = density * I;\n }\n b2PolygonShape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n var normalL = b2Math.MulTMV(xf.R, normal);\n var offsetL = offset - b2Math.Dot(normal, xf.position);\n var depths = new Vector_a2j_Number();\n var diveCount = 0;\n var intoIndex = parseInt((-1));\n var outoIndex = parseInt((-1));\n var lastSubmerged = false;\n var i = 0;\n for (i = 0;\n i < this.m_vertexCount; ++i) {\n depths[i] = b2Math.Dot(normalL, this.m_vertices[i]) - offsetL;\n var isSubmerged = depths[i] < (-Number.MIN_VALUE);\n if (i > 0) {\n if (isSubmerged) {\n if (!lastSubmerged) {\n intoIndex = i - 1;\n diveCount++;\n }\n }\n else {\n if (lastSubmerged) {\n outoIndex = i - 1;\n diveCount++;\n }\n }\n }\n lastSubmerged = isSubmerged;\n }\n switch (diveCount) {\n case 0:\n if (lastSubmerged) {\n var md = new b2MassData();\n this.ComputeMass(md, 1);\n c.SetV(b2Math.MulX(xf, md.center));\n return md.mass;\n }\n else {\n return 0;\n }\n break;\n case 1:\n if (intoIndex == (-1)) {\n intoIndex = this.m_vertexCount - 1;\n }\n else {\n outoIndex = this.m_vertexCount - 1;\n }\n break;\n }\n var intoIndex2 = parseInt((intoIndex + 1) % this.m_vertexCount);\n var outoIndex2 = parseInt((outoIndex + 1) % this.m_vertexCount);\n var intoLamdda = (0 - depths[intoIndex]) / (depths[intoIndex2] - depths[intoIndex]);\n var outoLamdda = (0 - depths[outoIndex]) / (depths[outoIndex2] - depths[outoIndex]);\n var intoVec = new b2Vec2(this.m_vertices[intoIndex].x * (1 - intoLamdda) + this.m_vertices[intoIndex2].x * intoLamdda, this.m_vertices[intoIndex].y * (1 - intoLamdda) + this.m_vertices[intoIndex2].y * intoLamdda);\n var outoVec = new b2Vec2(this.m_vertices[outoIndex].x * (1 - outoLamdda) + this.m_vertices[outoIndex2].x * outoLamdda, this.m_vertices[outoIndex].y * (1 - outoLamdda) + this.m_vertices[outoIndex2].y * outoLamdda);\n var area = 0;\n var center = new b2Vec2();\n var p2 = this.m_vertices[intoIndex2];\n var p3;\n i = intoIndex2;\n while (i != outoIndex2) {\n i = (i + 1) % this.m_vertexCount;\n if (i == outoIndex2) p3 = outoVec;\n else p3 = this.m_vertices[i];\n var triangleArea = 0.5 * ((p2.x - intoVec.x) * (p3.y - intoVec.y) - (p2.y - intoVec.y) * (p3.x - intoVec.x));\n area += triangleArea;\n center.x += triangleArea * (intoVec.x + p2.x + p3.x) / 3;\n center.y += triangleArea * (intoVec.y + p2.y + p3.y) / 3;\n p2 = p3;\n }\n center.Multiply(1 / area);\n c.SetV(b2Math.MulX(xf, center));\n return area;\n }\n b2PolygonShape.prototype.GetVertexCount = function () {\n return this.m_vertexCount;\n }\n b2PolygonShape.prototype.GetVertices = function () {\n return this.m_vertices;\n }\n b2PolygonShape.prototype.GetNormals = function () {\n return this.m_normals;\n }\n b2PolygonShape.prototype.GetSupport = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_vertexCount; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return bestIndex;\n }\n b2PolygonShape.prototype.GetSupportVertex = function (d) {\n var bestIndex = 0;\n var bestValue = this.m_vertices[0].x * d.x + this.m_vertices[0].y * d.y;\n for (var i = 1; i < this.m_vertexCount; ++i) {\n var value = this.m_vertices[i].x * d.x + this.m_vertices[i].y * d.y;\n if (value > bestValue) {\n bestIndex = i;\n bestValue = value;\n }\n }\n return this.m_vertices[bestIndex];\n }\n b2PolygonShape.prototype.Validate = function () {\n return false;\n }\n b2PolygonShape.prototype.b2PolygonShape = function () {\n this.__super.b2Shape.call(this);\n this.m_type = this.e_polygonShape;\n this.m_centroid = new b2Vec2();\n this.m_vertices = new Vector();\n this.m_normals = new Vector();\n }\n b2PolygonShape.prototype.Reserve = function (count) {\n if (count === undefined) count = 0;\n for (var i = parseInt(this.m_vertices.length); i < count; i++) {\n this.m_vertices[i] = new b2Vec2();\n this.m_normals[i] = new b2Vec2();\n }\n }\n b2PolygonShape.prototype.ComputeCentroid = function (vs, count) {\n if (count === undefined) count = 0;\n var c = new b2Vec2();\n var area = 0.0;\n var p1X = 0.0;\n var p1Y = 0.0;\n var inv3 = 1.0 / 3.0;\n for (var i = 0; i < count; ++i) {\n var p2 = vs[i];\n var p3 = i + 1 < count ? vs[parseInt(i + 1)] : vs[0];\n var e1X = p2.x - p1X;\n var e1Y = p2.y - p1Y;\n var e2X = p3.x - p1X;\n var e2Y = p3.y - p1Y;\n var D = (e1X * e2Y - e1Y * e2X);\n var triangleArea = 0.5 * D;area += triangleArea;\n c.x += triangleArea * inv3 * (p1X + p2.x + p3.x);\n c.y += triangleArea * inv3 * (p1Y + p2.y + p3.y);\n }\n c.x *= 1.0 / area;\n c.y *= 1.0 / area;\n return c;\n }\n b2PolygonShape.ComputeCentroid = b2PolygonShape.prototype.ComputeCentroid;\n b2PolygonShape.prototype.ComputeOBB = function (obb, vs, count) {\n if (count === undefined) count = 0;\n var i = 0;\n var p = new Vector(count + 1);\n for (i = 0;\n i < count; ++i) {\n p[i] = vs[i];\n }\n p[count] = p[0];\n var minArea = Number.MAX_VALUE;\n for (i = 1;\n i <= count; ++i) {\n var root = p[parseInt(i - 1)];\n var uxX = p[i].x - root.x;\n var uxY = p[i].y - root.y;\n var length = Math.sqrt(uxX * uxX + uxY * uxY);\n uxX /= length;\n uxY /= length;\n var uyX = (-uxY);\n var uyY = uxX;\n var lowerX = Number.MAX_VALUE;\n var lowerY = Number.MAX_VALUE;\n var upperX = (-Number.MAX_VALUE);\n var upperY = (-Number.MAX_VALUE);\n for (var j = 0; j < count; ++j) {\n var dX = p[j].x - root.x;\n var dY = p[j].y - root.y;\n var rX = (uxX * dX + uxY * dY);\n var rY = (uyX * dX + uyY * dY);\n if (rX < lowerX) lowerX = rX;\n if (rY < lowerY) lowerY = rY;\n if (rX > upperX) upperX = rX;\n if (rY > upperY) upperY = rY;\n }\n var area = (upperX - lowerX) * (upperY - lowerY);\n if (area < 0.95 * minArea) {\n minArea = area;\n obb.R.col1.x = uxX;\n obb.R.col1.y = uxY;\n obb.R.col2.x = uyX;\n obb.R.col2.y = uyY;\n var centerX = 0.5 * (lowerX + upperX);\n var centerY = 0.5 * (lowerY + upperY);\n var tMat = obb.R;\n obb.center.x = root.x + (tMat.col1.x * centerX + tMat.col2.x * centerY);\n obb.center.y = root.y + (tMat.col1.y * centerX + tMat.col2.y * centerY);\n obb.extents.x = 0.5 * (upperX - lowerX);\n obb.extents.y = 0.5 * (upperY - lowerY);\n }\n }\n }\n b2PolygonShape.ComputeOBB = b2PolygonShape.prototype.ComputeOBB;\n _A2J_postDefs.push(function () {\n Box2D.Collision.Shapes.b2PolygonShape.s_mat = new b2Mat22();\n Box2D.Collision.Shapes.b2PolygonShape.prototype.s_mat = Box2D.Collision.Shapes.b2PolygonShape.s_mat;\n });\n b2Shape.b2Shape = function () {};\n b2Shape.prototype.Copy = function () {\n return null;\n }\n b2Shape.prototype.Set = function (other) {\n this.m_radius = other.m_radius;\n }\n b2Shape.prototype.GetType = function () {\n return this.m_type;\n }\n b2Shape.prototype.TestPoint = function (xf, p) {\n return false;\n }\n b2Shape.prototype.RayCast = function (output, input, transform) {\n return false;\n }\n b2Shape.prototype.ComputeAABB = function (aabb, xf) {}\n b2Shape.prototype.ComputeMass = function (massData, density) {\n if (density === undefined) density = 0;\n }\n b2Shape.prototype.ComputeSubmergedArea = function (normal, offset, xf, c) {\n if (offset === undefined) offset = 0;\n return 0;\n }\n b2Shape.prototype.TestOverlap = function (shape1, transform1, shape2, transform2) {\n var input = new b2DistanceInput();\n input.proxyA = new b2DistanceProxy();\n input.proxyA.Set(shape1);\n input.proxyB = new b2DistanceProxy();\n input.proxyB.Set(shape2);\n input.transformA = transform1;\n input.transformB = transform2;\n input.useRadii = true;\n var simplexCache = new b2SimplexCache();\n simplexCache.count = 0;\n var output = new b2DistanceOutput();\n b2Distance.Distance(output, simplexCache, input);\n return output.distance < 10.0 * Number.MIN_VALUE;\n }\n b2Shape.TestOverlap = b2Shape.prototype.TestOverlap;\n b2Shape.prototype.b2Shape = function () {\n this.m_type = b2Shape.e_unknownShape;\n this.m_radius = b2Settings.b2_linearSlop;\n }\n _A2J_postDefs.push(function () {\n Box2D.Collision.Shapes.b2Shape.e_unknownShape = parseInt((-1));\n Box2D.Collision.Shapes.b2Shape.prototype.e_unknownShape = Box2D.Collision.Shapes.b2Shape.e_unknownShape;\n Box2D.Collision.Shapes.b2Shape.e_circleShape = 0;\n Box2D.Collision.Shapes.b2Shape.prototype.e_circleShape = Box2D.Collision.Shapes.b2Shape.e_circleShape;\n Box2D.Collision.Shapes.b2Shape.e_polygonShape = 1;\n Box2D.Collision.Shapes.b2Shape.prototype.e_polygonShape = Box2D.Collision.Shapes.b2Shape.e_polygonShape;\n Box2D.Collision.Shapes.b2Shape.e_edgeShape = 2;\n Box2D.Collision.Shapes.b2Shape.prototype.e_edgeShape = Box2D.Collision.Shapes.b2Shape.e_edgeShape;\n Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount = 3;\n Box2D.Collision.Shapes.b2Shape.prototype.e_shapeTypeCount = Box2D.Collision.Shapes.b2Shape.e_shapeTypeCount;\n Box2D.Collision.Shapes.b2Shape.e_hitCollide = 1;\n Box2D.Collision.Shapes.b2Shape.prototype.e_hitCollide = Box2D.Collision.Shapes.b2Shape.e_hitCollide;\n Box2D.Collision.Shapes.b2Shape.e_missCollide = 0;\n Box2D.Collision.Shapes.b2Shape.prototype.e_missCollide = Box2D.Collision.Shapes.b2Shape.e_missCollide;\n Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide = parseInt((-1));\n Box2D.Collision.Shapes.b2Shape.prototype.e_startsInsideCollide = Box2D.Collision.Shapes.b2Shape.e_startsInsideCollide;\n });\n})(); /* source: disabled*/\n(function () {\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2internal = Box2D.Common.b2internal;\n b2Color.b2Color = function () {\n this._r = 0;\n this._g = 0;\n this._b = 0;\n };\n b2Color.prototype.b2Color = function (rr, gg, bb) {\n if (rr === undefined) rr = 0;\n if (gg === undefined) gg = 0;\n if (bb === undefined) bb = 0;\n this._r = a2j.parseUInt(255 * b2Math.Clamp(rr, 0.0, 1.0));\n this._g = a2j.parseUInt(255 * b2Math.Clamp(gg, 0.0, 1.0));\n this._b = a2j.parseUInt(255 * b2Math.Clamp(bb, 0.0, 1.0));\n }\n b2Color.prototype.Set = function (rr, gg, bb) {\n if (rr === undefined) rr = 0;\n if (gg === undefined) gg = 0;\n if (bb === undefined) bb = 0;\n this._r = a2j.parseUInt(255 * b2Math.Clamp(rr, 0.0, 1.0));\n this._g = a2j.parseUInt(255 * b2Math.Clamp(gg, 0.0, 1.0));\n this._b = a2j.parseUInt(255 * b2Math.Clamp(bb, 0.0, 1.0));\n }\n b2Color.prototype.__defineSetter__('r', function (rr) {\n if (rr === undefined) rr = 0;\n this._r = a2j.parseUInt(255 * b2Math.Clamp(rr, 0.0, 1.0));\n });\n b2Color.prototype.__defineSetter__('g', function (gg) {\n if (gg === undefined) gg = 0;\n this._g = a2j.parseUInt(255 * b2Math.Clamp(gg, 0.0, 1.0));\n });\n b2Color.prototype.__defineSetter__('b', function (bb) {\n if (bb === undefined) bb = 0;\n this._b = a2j.parseUInt(255 * b2Math.Clamp(bb, 0.0, 1.0));\n });\n b2Color.prototype.__defineGetter__('color', function () {\n return (this._r << 16) | (this._g << 8) | (this._b);\n });\n b2Settings.b2Settings = function () {};\n b2Settings.prototype.b2MixFriction = function (friction1, friction2) {\n if (friction1 === undefined) friction1 = 0;\n if (friction2 === undefined) friction2 = 0;\n return Math.sqrt(friction1 * friction2);\n }\n b2Settings.b2MixFriction = b2Settings.prototype.b2MixFriction;\n b2Settings.prototype.b2MixRestitution = function (restitution1, restitution2) {\n if (restitution1 === undefined) restitution1 = 0;\n if (restitution2 === undefined) restitution2 = 0;\n return restitution1 > restitution2 ? restitution1 : restitution2;\n }\n b2Settings.b2MixRestitution = b2Settings.prototype.b2MixRestitution;\n b2Settings.prototype.b2Assert = function (a) {\n if (!a) {\n throw \"Assertion Failed\";\n }\n }\n b2Settings.b2Assert = b2Settings.prototype.b2Assert;\n _A2J_postDefs.push(function () {\n Box2D.Common.b2Settings.VERSION = \"2.1alpha\";\n Box2D.Common.b2Settings.prototype.VERSION = Box2D.Common.b2Settings.VERSION;\n Box2D.Common.b2Settings.USHRT_MAX = 0x0000ffff;\n Box2D.Common.b2Settings.prototype.USHRT_MAX = Box2D.Common.b2Settings.USHRT_MAX;\n Box2D.Common.b2Settings.b2_pi = Math.PI;\n Box2D.Common.b2Settings.prototype.b2_pi = Box2D.Common.b2Settings.b2_pi;\n Box2D.Common.b2Settings.b2_maxManifoldPoints = 2;\n Box2D.Common.b2Settings.prototype.b2_maxManifoldPoints = Box2D.Common.b2Settings.b2_maxManifoldPoints;\n Box2D.Common.b2Settings.b2_aabbExtension = 0.1;\n Box2D.Common.b2Settings.prototype.b2_aabbExtension = Box2D.Common.b2Settings.b2_aabbExtension;\n Box2D.Common.b2Settings.b2_aabbMultiplier = 2.0;\n Box2D.Common.b2Settings.prototype.b2_aabbMultiplier = Box2D.Common.b2Settings.b2_aabbMultiplier;\n Box2D.Common.b2Settings.b2_polygonRadius = 2.0 * b2Settings.b2_linearSlop;\n Box2D.Common.b2Settings.prototype.b2_polygonRadius = Box2D.Common.b2Settings.b2_polygonRadius;\n Box2D.Common.b2Settings.b2_linearSlop = 0.005;\n Box2D.Common.b2Settings.prototype.b2_linearSlop = Box2D.Common.b2Settings.b2_linearSlop;\n Box2D.Common.b2Settings.b2_angularSlop = 2.0 / 180.0 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_angularSlop = Box2D.Common.b2Settings.b2_angularSlop;\n Box2D.Common.b2Settings.b2_toiSlop = 8.0 * b2Settings.b2_linearSlop;\n Box2D.Common.b2Settings.prototype.b2_toiSlop = Box2D.Common.b2Settings.b2_toiSlop;\n Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland = 32;\n Box2D.Common.b2Settings.prototype.b2_maxTOIContactsPerIsland = Box2D.Common.b2Settings.b2_maxTOIContactsPerIsland;\n Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland = 32;\n Box2D.Common.b2Settings.prototype.b2_maxTOIJointsPerIsland = Box2D.Common.b2Settings.b2_maxTOIJointsPerIsland;\n Box2D.Common.b2Settings.b2_velocityThreshold = 1.0;\n Box2D.Common.b2Settings.prototype.b2_velocityThreshold = Box2D.Common.b2Settings.b2_velocityThreshold;\n Box2D.Common.b2Settings.b2_maxLinearCorrection = 0.2;\n Box2D.Common.b2Settings.prototype.b2_maxLinearCorrection = Box2D.Common.b2Settings.b2_maxLinearCorrection;\n Box2D.Common.b2Settings.b2_maxAngularCorrection = 8.0 / 180.0 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_maxAngularCorrection = Box2D.Common.b2Settings.b2_maxAngularCorrection;\n Box2D.Common.b2Settings.b2_maxTranslation = 2.0;\n Box2D.Common.b2Settings.prototype.b2_maxTranslation = Box2D.Common.b2Settings.b2_maxTranslation;\n Box2D.Common.b2Settings.b2_maxTranslationSquared = b2Settings.b2_maxTranslation * b2Settings.b2_maxTranslation;\n Box2D.Common.b2Settings.prototype.b2_maxTranslationSquared = Box2D.Common.b2Settings.b2_maxTranslationSquared;\n Box2D.Common.b2Settings.b2_maxRotation = 0.5 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_maxRotation = Box2D.Common.b2Settings.b2_maxRotation;\n Box2D.Common.b2Settings.b2_maxRotationSquared = b2Settings.b2_maxRotation * b2Settings.b2_maxRotation;\n Box2D.Common.b2Settings.prototype.b2_maxRotationSquared = Box2D.Common.b2Settings.b2_maxRotationSquared;\n Box2D.Common.b2Settings.b2_contactBaumgarte = 0.2;\n Box2D.Common.b2Settings.prototype.b2_contactBaumgarte = Box2D.Common.b2Settings.b2_contactBaumgarte;\n Box2D.Common.b2Settings.b2_timeToSleep = 0.5;\n Box2D.Common.b2Settings.prototype.b2_timeToSleep = Box2D.Common.b2Settings.b2_timeToSleep;\n Box2D.Common.b2Settings.b2_linearSleepTolerance = 0.01;\n Box2D.Common.b2Settings.prototype.b2_linearSleepTolerance = Box2D.Common.b2Settings.b2_linearSleepTolerance;\n Box2D.Common.b2Settings.b2_angularSleepTolerance = 2.0 / 180.0 * b2Settings.b2_pi;\n Box2D.Common.b2Settings.prototype.b2_angularSleepTolerance = Box2D.Common.b2Settings.b2_angularSleepTolerance;\n });\n})(); /* source: disabled*/\n(function () {\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n b2Mat22.b2Mat22 = function () {\n this.col1 = new b2Vec2();\n this.col2 = new b2Vec2();\n };\n b2Mat22.prototype.b2Mat22 = function () {\n this.SetIdentity();\n }\n b2Mat22.prototype.FromAngle = function (angle) {\n if (angle === undefined) angle = 0;\n var mat = new b2Mat22();\n mat.Set(angle);\n return mat;\n }\n b2Mat22.FromAngle = b2Mat22.prototype.FromAngle;\n b2Mat22.prototype.FromVV = function (c1, c2) {\n var mat = new b2Mat22();\n mat.SetVV(c1, c2);\n return mat;\n }\n b2Mat22.FromVV = b2Mat22.prototype.FromVV;\n b2Mat22.prototype.Set = function (angle) {\n if (angle === undefined) angle = 0;\n var c = Math.cos(angle);\n var s = Math.sin(angle);\n this.col1.x = c;\n this.col2.x = (-s);\n this.col1.y = s;\n this.col2.y = c;\n }\n b2Mat22.prototype.SetVV = function (c1, c2) {\n this.col1.SetV(c1);\n this.col2.SetV(c2);\n }\n b2Mat22.prototype.Copy = function () {\n var mat = new b2Mat22();\n mat.SetM(this);\n return mat;\n }\n b2Mat22.prototype.SetM = function (m) {\n this.col1.SetV(m.col1);\n this.col2.SetV(m.col2);\n }\n b2Mat22.prototype.AddM = function (m) {\n this.col1.x += m.col1.x;\n this.col1.y += m.col1.y;\n this.col2.x += m.col2.x;\n this.col2.y += m.col2.y;\n }\n b2Mat22.prototype.SetIdentity = function () {\n this.col1.x = 1.0;\n this.col2.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 1.0;\n }\n b2Mat22.prototype.SetZero = function () {\n this.col1.x = 0.0;\n this.col2.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 0.0;\n }\n b2Mat22.prototype.GetAngle = function () {\n return Math.atan2(this.col1.y, this.col1.x);\n }\n b2Mat22.prototype.GetInverse = function (out) {\n var a = this.col1.x;\n var b = this.col2.x;\n var c = this.col1.y;\n var d = this.col2.y;\n var det = a * d - b * c;\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.col1.x = det * d;\n out.col2.x = (-det * b);\n out.col1.y = (-det * c);\n out.col2.y = det * a;\n return out;\n }\n b2Mat22.prototype.Solve = function (out, bX, bY) {\n if (bX === undefined) bX = 0;\n if (bY === undefined) bY = 0;\n var a11 = this.col1.x;\n var a12 = this.col2.x;\n var a21 = this.col1.y;\n var a22 = this.col2.y;\n var det = a11 * a22 - a12 * a21;\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.x = det * (a22 * bX - a12 * bY);\n out.y = det * (a11 * bY - a21 * bX);\n return out;\n }\n b2Mat22.prototype.Abs = function () {\n this.col1.Abs();\n this.col2.Abs();\n }\n b2Mat33.b2Mat33 = function () {\n this.col1 = new b2Vec3();\n this.col2 = new b2Vec3();\n this.col3 = new b2Vec3();\n };\n b2Mat33.prototype.b2Mat33 = function (c1, c2, c3) {\n if (c1 === undefined) c1 = null;\n if (c2 === undefined) c2 = null;\n if (c3 === undefined) c3 = null;\n if (!c1 && !c2 && !c3) {\n this.col1.SetZero();\n this.col2.SetZero();\n this.col3.SetZero();\n }\n else {\n this.col1.SetV(c1);\n this.col2.SetV(c2);\n this.col3.SetV(c3);\n }\n }\n b2Mat33.prototype.SetVVV = function (c1, c2, c3) {\n this.col1.SetV(c1);\n this.col2.SetV(c2);\n this.col3.SetV(c3);\n }\n b2Mat33.prototype.Copy = function () {\n return new b2Mat33(this.col1, this.col2, this.col3);\n }\n b2Mat33.prototype.SetM = function (m) {\n this.col1.SetV(m.col1);\n this.col2.SetV(m.col2);\n this.col3.SetV(m.col3);\n }\n b2Mat33.prototype.AddM = function (m) {\n this.col1.x += m.col1.x;\n this.col1.y += m.col1.y;\n this.col1.z += m.col1.z;\n this.col2.x += m.col2.x;\n this.col2.y += m.col2.y;\n this.col2.z += m.col2.z;\n this.col3.x += m.col3.x;\n this.col3.y += m.col3.y;\n this.col3.z += m.col3.z;\n }\n b2Mat33.prototype.SetIdentity = function () {\n this.col1.x = 1.0;\n this.col2.x = 0.0;\n this.col3.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 1.0;\n this.col3.y = 0.0;\n this.col1.z = 0.0;\n this.col2.z = 0.0;\n this.col3.z = 1.0;\n }\n b2Mat33.prototype.SetZero = function () {\n this.col1.x = 0.0;\n this.col2.x = 0.0;\n this.col3.x = 0.0;\n this.col1.y = 0.0;\n this.col2.y = 0.0;\n this.col3.y = 0.0;\n this.col1.z = 0.0;\n this.col2.z = 0.0;\n this.col3.z = 0.0;\n }\n b2Mat33.prototype.Solve22 = function (out, bX, bY) {\n if (bX === undefined) bX = 0;\n if (bY === undefined) bY = 0;\n var a11 = this.col1.x;\n var a12 = this.col2.x;\n var a21 = this.col1.y;\n var a22 = this.col2.y;\n var det = a11 * a22 - a12 * a21;\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.x = det * (a22 * bX - a12 * bY);\n out.y = det * (a11 * bY - a21 * bX);\n return out;\n }\n b2Mat33.prototype.Solve33 = function (out, bX, bY, bZ) {\n if (bX === undefined) bX = 0;\n if (bY === undefined) bY = 0;\n if (bZ === undefined) bZ = 0;\n var a11 = this.col1.x;\n var a21 = this.col1.y;\n var a31 = this.col1.z;\n var a12 = this.col2.x;\n var a22 = this.col2.y;\n var a32 = this.col2.z;\n var a13 = this.col3.x;\n var a23 = this.col3.y;\n var a33 = this.col3.z;\n var det = a11 * (a22 * a33 - a32 * a23) + a21 * (a32 * a13 - a12 * a33) + a31 * (a12 * a23 - a22 * a13);\n if (det != 0.0) {\n det = 1.0 / det;\n }\n out.x = det * (bX * (a22 * a33 - a32 * a23) + bY * (a32 * a13 - a12 * a33) + bZ * (a12 * a23 - a22 * a13));\n out.y = det * (a11 * (bY * a33 - bZ * a23) + a21 * (bZ * a13 - bX * a33) + a31 * (bX * a23 - bY * a13));\n out.z = det * (a11 * (a22 * bZ - a32 * bY) + a21 * (a32 * bX - a12 * bZ) + a31 * (a12 * bY - a22 * bX));\n return out;\n }\n b2Math.b2Math = function () {};\n b2Math.prototype.IsValid = function (x) {\n if (x === undefined) x = 0;\n return isFinite(x);\n }\n b2Math.IsValid = b2Math.prototype.IsValid;\n b2Math.prototype.Dot = function (a, b) {\n return a.x * b.x + a.y * b.y;\n }\n b2Math.Dot = b2Math.prototype.Dot;\n b2Math.prototype.CrossVV = function (a, b) {\n return a.x * b.y - a.y * b.x;\n }\n b2Math.CrossVV = b2Math.prototype.CrossVV;\n b2Math.prototype.CrossVF = function (a, s) {\n if (s === undefined) s = 0;\n var v = new b2Vec2(s * a.y, (-s * a.x));\n return v;\n }\n b2Math.CrossVF = b2Math.prototype.CrossVF;\n b2Math.prototype.CrossFV = function (s, a) {\n if (s === undefined) s = 0;\n var v = new b2Vec2((-s * a.y), s * a.x);\n return v;\n }\n b2Math.CrossFV = b2Math.prototype.CrossFV;\n b2Math.prototype.MulMV = function (A, v) {\n var u = new b2Vec2(A.col1.x * v.x + A.col2.x * v.y, A.col1.y * v.x + A.col2.y * v.y);\n return u;\n }\n b2Math.MulMV = b2Math.prototype.MulMV;\n b2Math.prototype.MulTMV = function (A, v) {\n var u = new b2Vec2(this.Dot(v, A.col1), this.Dot(v, A.col2));\n return u;\n }\n b2Math.MulTMV = b2Math.prototype.MulTMV;\n b2Math.prototype.MulX = function (T, v) {\n var a = this.MulMV(T.R, v);\n a.x += T.position.x;\n a.y += T.position.y;\n return a;\n }\n b2Math.MulX = b2Math.prototype.MulX;\n b2Math.prototype.MulXT = function (T, v) {\n var a = this.SubtractVV(v, T.position);\n var tX = (a.x * T.R.col1.x + a.y * T.R.col1.y);\n a.y = (a.x * T.R.col2.x + a.y * T.R.col2.y);\n a.x = tX;\n return a;\n }\n b2Math.MulXT = b2Math.prototype.MulXT;\n b2Math.prototype.AddVV = function (a, b) {\n var v = new b2Vec2(a.x + b.x, a.y + b.y);\n return v;\n }\n b2Math.AddVV = b2Math.prototype.AddVV;\n b2Math.prototype.SubtractVV = function (a, b) {\n var v = new b2Vec2(a.x - b.x, a.y - b.y);\n return v;\n }\n b2Math.SubtractVV = b2Math.prototype.SubtractVV;\n b2Math.prototype.Distance = function (a, b) {\n var cX = a.x - b.x;\n var cY = a.y - b.y;\n return Math.sqrt(cX * cX + cY * cY);\n }\n b2Math.Distance = b2Math.prototype.Distance;\n b2Math.prototype.DistanceSquared = function (a, b) {\n var cX = a.x - b.x;\n var cY = a.y - b.y;\n return (cX * cX + cY * cY);\n }\n b2Math.DistanceSquared = b2Math.prototype.DistanceSquared;\n b2Math.prototype.MulFV = function (s, a) {\n if (s === undefined) s = 0;\n var v = new b2Vec2(s * a.x, s * a.y);\n return v;\n }\n b2Math.MulFV = b2Math.prototype.MulFV;\n b2Math.prototype.AddMM = function (A, B) {\n var C = b2Mat22.FromVV(this.AddVV(A.col1, B.col1), this.AddVV(A.col2, B.col2));\n return C;\n }\n b2Math.AddMM = b2Math.prototype.AddMM;\n b2Math.prototype.MulMM = function (A, B) {\n var C = b2Mat22.FromVV(this.MulMV(A, B.col1), this.MulMV(A, B.col2));\n return C;\n }\n b2Math.MulMM = b2Math.prototype.MulMM;\n b2Math.prototype.MulTMM = function (A, B) {\n var c1 = new b2Vec2(this.Dot(A.col1, B.col1), this.Dot(A.col2, B.col1));\n var c2 = new b2Vec2(this.Dot(A.col1, B.col2), this.Dot(A.col2, B.col2));\n var C = b2Mat22.FromVV(c1, c2);\n return C;\n }\n b2Math.MulTMM = b2Math.prototype.MulTMM;\n b2Math.prototype.Abs = function (a) {\n if (a === undefined) a = 0;\n return a > 0.0 ? a : (-a);\n }\n b2Math.Abs = b2Math.prototype.Abs;\n b2Math.prototype.AbsV = function (a) {\n var b = new b2Vec2(this.Abs(a.x), this.Abs(a.y));\n return b;\n }\n b2Math.AbsV = b2Math.prototype.AbsV;\n b2Math.prototype.AbsM = function (A) {\n var B = b2Mat22.FromVV(this.AbsV(A.col1), this.AbsV(A.col2));\n return B;\n }\n b2Math.AbsM = b2Math.prototype.AbsM;\n b2Math.prototype.Min = function (a, b) {\n if (a === undefined) a = 0;\n if (b === undefined) b = 0;\n return a < b ? a : b;\n }\n b2Math.Min = b2Math.prototype.Min;\n b2Math.prototype.MinV = function (a, b) {\n var c = new b2Vec2(this.Min(a.x, b.x), this.Min(a.y, b.y));\n return c;\n }\n b2Math.MinV = b2Math.prototype.MinV;\n b2Math.prototype.Max = function (a, b) {\n if (a === undefined) a = 0;\n if (b === undefined) b = 0;\n return a > b ? a : b;\n }\n b2Math.Max = b2Math.prototype.Max;\n b2Math.prototype.MaxV = function (a, b) {\n var c = new b2Vec2(this.Max(a.x, b.x), this.Max(a.y, b.y));\n return c;\n }\n b2Math.MaxV = b2Math.prototype.MaxV;\n b2Math.prototype.Clamp = function (a, low, high) {\n if (a === undefined) a = 0;\n if (low === undefined) low = 0;\n if (high === undefined) high = 0;\n return a < low ? low : a > high ? high : a;\n }\n b2Math.Clamp = b2Math.prototype.Clamp;\n b2Math.prototype.ClampV = function (a, low, high) {\n return this.MaxV(low, this.MinV(a, high));\n }\n b2Math.ClampV = b2Math.prototype.ClampV;\n b2Math.prototype.Swap = function (a, b) {\n var tmp = a[0];\n a[0] = b[0];\n b[0] = tmp;\n }\n b2Math.Swap = b2Math.prototype.Swap;\n b2Math.prototype.Random = function () {\n return Math.random() * 2 - 1;\n }\n b2Math.Random = b2Math.prototype.Random;\n b2Math.prototype.RandomRange = function (lo, hi) {\n if (lo === undefined) lo = 0;\n if (hi === undefined) hi = 0;\n var r = Math.random();\n r = (hi - lo) * r + lo;\n return r;\n }\n b2Math.RandomRange = b2Math.prototype.RandomRange;\n b2Math.prototype.NextPowerOfTwo = function (x) {\n if (x === undefined) x = 0;\n x |= (x >> 1) & 0x7FFFFFFF;\n x |= (x >> 2) & 0x3FFFFFFF;\n x |= (x >> 4) & 0x0FFFFFFF;\n x |= (x >> 8) & 0x00FFFFFF;\n x |= (x >> 16) & 0x0000FFFF;\n return x + 1;\n }\n b2Math.NextPowerOfTwo = b2Math.prototype.NextPowerOfTwo;\n b2Math.prototype.IsPowerOfTwo = function (x) {\n if (x === undefined) x = 0;\n var result = x > 0 && (x & (x - 1)) == 0;\n return result;\n }\n b2Math.IsPowerOfTwo = b2Math.prototype.IsPowerOfTwo;\n _A2J_postDefs.push(function () {\n Box2D.Common.Math.b2Math.b2Vec2_zero = new b2Vec2(0.0, 0.0);\n Box2D.Common.Math.b2Math.prototype.b2Vec2_zero = Box2D.Common.Math.b2Math.b2Vec2_zero;\n Box2D.Common.Math.b2Math.b2Mat22_identity = b2Mat22.FromVV(new b2Vec2(1.0, 0.0), new b2Vec2(0.0, 1.0));\n Box2D.Common.Math.b2Math.prototype.b2Mat22_identity = Box2D.Common.Math.b2Math.b2Mat22_identity;\n Box2D.Common.Math.b2Math.b2Transform_identity = new b2Transform(b2Math.b2Vec2_zero, b2Math.b2Mat22_identity);\n Box2D.Common.Math.b2Math.prototype.b2Transform_identity = Box2D.Common.Math.b2Math.b2Transform_identity;\n });\n b2Sweep.b2Sweep = function () {\n this.localCenter = new b2Vec2();\n this.c0 = new b2Vec2;\n this.c = new b2Vec2();\n };\n b2Sweep.prototype.Set = function (other) {\n this.localCenter.SetV(other.localCenter);\n this.c0.SetV(other.c0);\n this.c.SetV(other.c);\n this.a0 = other.a0;\n this.a = other.a;\n this.t0 = other.t0;\n }\n b2Sweep.prototype.Copy = function () {\n var copy = new b2Sweep();\n copy.localCenter.SetV(this.localCenter);\n copy.c0.SetV(this.c0);\n copy.c.SetV(this.c);\n copy.a0 = this.a0;\n copy.a = this.a;\n copy.t0 = this.t0;\n return copy;\n }\n b2Sweep.prototype.GetTransform = function (xf, alpha) {\n if (alpha === undefined) alpha = 0;\n xf.position.x = (1.0 - alpha) * this.c0.x + alpha * this.c.x;\n xf.position.y = (1.0 - alpha) * this.c0.y + alpha * this.c.y;\n var angle = (1.0 - alpha) * this.a0 + alpha * this.a;\n xf.R.Set(angle);\n var tMat = xf.R;\n xf.position.x -= (tMat.col1.x * this.localCenter.x + tMat.col2.x * this.localCenter.y);\n xf.position.y -= (tMat.col1.y * this.localCenter.x + tMat.col2.y * this.localCenter.y);\n }\n b2Sweep.prototype.Advance = function (t) {\n if (t === undefined) t = 0;\n if (this.t0 < t && 1.0 - this.t0 > Number.MIN_VALUE) {\n var alpha = (t - this.t0) / (1.0 - this.t0);\n this.c0.x = (1.0 - alpha) * this.c0.x + alpha * this.c.x;\n this.c0.y = (1.0 - alpha) * this.c0.y + alpha * this.c.y;\n this.a0 = (1.0 - alpha) * this.a0 + alpha * this.a;\n this.t0 = t;\n }\n }\n b2Transform.b2Transform = function () {\n this.position = new b2Vec2;\n this.R = new b2Mat22();\n };\n b2Transform.prototype.b2Transform = function (pos, r) {\n if (pos === undefined) pos = null;\n if (r === undefined) r = null;\n if (pos) {\n this.position.SetV(pos);\n this.R.SetM(r);\n }\n }\n b2Transform.prototype.Initialize = function (pos, r) {\n this.position.SetV(pos);\n this.R.SetM(r);\n }\n b2Transform.prototype.SetIdentity = function () {\n this.position.SetZero();\n this.R.SetIdentity();\n }\n b2Transform.prototype.Set = function (x) {\n this.position.SetV(x.position);\n this.R.SetM(x.R);\n }\n b2Transform.prototype.GetAngle = function () {\n return Math.atan2(this.R.col1.y, this.R.col1.x);\n }\n b2Vec2.b2Vec2 = function () {};\n b2Vec2.prototype.b2Vec2 = function (x_, y_) {\n if (x_ === undefined) x_ = 0;\n if (y_ === undefined) y_ = 0;\n this.x = x_;\n this.y = y_;\n }\n b2Vec2.prototype.SetZero = function () {\n this.x = 0.0;\n this.y = 0.0;\n }\n b2Vec2.prototype.Set = function (x_, y_) {\n if (x_ === undefined) x_ = 0;\n if (y_ === undefined) y_ = 0;\n this.x = x_;\n this.y = y_;\n }\n b2Vec2.prototype.SetV = function (v) {\n this.x = v.x;\n this.y = v.y;\n }\n b2Vec2.prototype.GetNegative = function () {\n return new b2Vec2((-this.x), (-this.y));\n }\n b2Vec2.prototype.NegativeSelf = function () {\n this.x = (-this.x);\n this.y = (-this.y);\n }\n b2Vec2.prototype.Make = function (x_, y_) {\n if (x_ === undefined) x_ = 0;\n if (y_ === undefined) y_ = 0;\n return new b2Vec2(x_, y_);\n }\n b2Vec2.Make = b2Vec2.prototype.Make;\n b2Vec2.prototype.Copy = function () {\n return new b2Vec2(this.x, this.y);\n }\n b2Vec2.prototype.Add = function (v) {\n this.x += v.x;\n this.y += v.y;\n }\n b2Vec2.prototype.Subtract = function (v) {\n this.x -= v.x;\n this.y -= v.y;\n }\n b2Vec2.prototype.Multiply = function (a) {\n if (a === undefined) a = 0;\n this.x *= a;\n this.y *= a;\n }\n b2Vec2.prototype.MulM = function (A) {\n var tX = this.x;\n this.x = A.col1.x * tX + A.col2.x * this.y;\n this.y = A.col1.y * tX + A.col2.y * this.y;\n }\n b2Vec2.prototype.MulTM = function (A) {\n var tX = b2Math.Dot(this, A.col1);\n this.y = b2Math.Dot(this, A.col2);\n this.x = tX;\n }\n b2Vec2.prototype.CrossVF = function (s) {\n if (s === undefined) s = 0;\n var tX = this.x;\n this.x = s * this.y;\n this.y = (-s * tX);\n }\n b2Vec2.prototype.CrossFV = function (s) {\n if (s === undefined) s = 0;\n var tX = this.x;\n this.x = (-s * this.y);\n this.y = s * tX;\n }\n b2Vec2.prototype.MinV = function (b) {\n this.x = this.x < b.x ? this.x : b.x;\n this.y = this.y < b.y ? this.y : b.y;\n }\n b2Vec2.prototype.MaxV = function (b) {\n this.x = this.x > b.x ? this.x : b.x;\n this.y = this.y > b.y ? this.y : b.y;\n }\n b2Vec2.prototype.Abs = function () {\n if (this.x < 0) this.x = (-this.x);\n if (this.y < 0) this.y = (-this.y);\n }\n b2Vec2.prototype.Length = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n b2Vec2.prototype.LengthSquared = function () {\n return (this.x * this.x + this.y * this.y);\n }\n b2Vec2.prototype.Normalize = function () {\n var length = Math.sqrt(this.x * this.x + this.y * this.y);\n if (length < Number.MIN_VALUE) {\n return 0.0;\n }\n var invLength = 1.0 / length;\n this.x *= invLength;\n this.y *= invLength;\n return length;\n }\n b2Vec2.prototype.IsValid = function () {\n return b2Math.IsValid(this.x) && b2Math.IsValid(this.y);\n }\n b2Vec3.b2Vec3 = function () {};\n b2Vec3.prototype.b2Vec3 = function (x, y, z) {\n if (x === undefined) x = 0;\n if (y === undefined) y = 0;\n if (z === undefined) z = 0;\n this.x = x;\n this.y = y;\n this.z = z;\n }\n b2Vec3.prototype.SetZero = function () {\n this.x = this.y = this.z = 0.0;\n }\n b2Vec3.prototype.Set = function (x, y, z) {\n if (x === undefined) x = 0;\n if (y === undefined) y = 0;\n if (z === undefined) z = 0;\n this.x = x;\n this.y = y;\n this.z = z;\n }\n b2Vec3.prototype.SetV = function (v) {\n this.x = v.x;\n this.y = v.y;\n this.z = v.z;\n }\n b2Vec3.prototype.GetNegative = function () {\n return new b2Vec3((-this.x), (-this.y), (-this.z));\n }\n b2Vec3.prototype.NegativeSelf = function () {\n this.x = (-this.x);\n this.y = (-this.y);\n this.z = (-this.z);\n }\n b2Vec3.prototype.Copy = function () {\n return new b2Vec3(this.x, this.y, this.z);\n }\n b2Vec3.prototype.Add = function (v) {\n this.x += v.x;\n this.y += v.y;\n this.z += v.z;\n }\n b2Vec3.prototype.Subtract = function (v) {\n this.x -= v.x;\n this.y -= v.y;\n this.z -= v.z;\n }\n b2Vec3.prototype.Multiply = function (a) {\n if (a === undefined) a = 0;\n this.x *= a;\n this.y *= a;\n this.z *= a;\n }\n})(); /* source: disabled*/\n(function () {\n var b2ControllerEdge = Box2D.Dynamics.Controllers.b2ControllerEdge;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2CircleContact = Box2D.Dynamics.Contacts.b2CircleContact;\n var b2Contact = Box2D.Dynamics.Contacts.b2Contact;\n var b2ContactConstraint = Box2D.Dynamics.Contacts.b2ContactConstraint;\n var b2ContactConstraintPoint = Box2D.Dynamics.Contacts.b2ContactConstraintPoint;\n var b2ContactEdge = Box2D.Dynamics.Contacts.b2ContactEdge;\n var b2ContactFactory = Box2D.Dynamics.Contacts.b2ContactFactory;\n var b2ContactRegister = Box2D.Dynamics.Contacts.b2ContactRegister;\n var b2ContactResult = Box2D.Dynamics.Contacts.b2ContactResult;\n var b2ContactSolver = Box2D.Dynamics.Contacts.b2ContactSolver;\n var b2EdgeAndCircleContact = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact;\n var b2NullContact = Box2D.Dynamics.Contacts.b2NullContact;\n var b2PolyAndCircleContact = Box2D.Dynamics.Contacts.b2PolyAndCircleContact;\n var b2PolyAndEdgeContact = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact;\n var b2PolygonContact = Box2D.Dynamics.Contacts.b2PolygonContact;\n var b2PositionSolverManifold = Box2D.Dynamics.Contacts.b2PositionSolverManifold;\n var b2Controller = Box2D.Dynamics.Controllers.b2Controller;\n var b2ControllerEdge = Box2D.Dynamics.Controllers.b2ControllerEdge;\n var b2DistanceJoint = Box2D.Dynamics.Joints.b2DistanceJoint;\n var b2DistanceJointDef = Box2D.Dynamics.Joints.b2DistanceJointDef;\n var b2FrictionJoint = Box2D.Dynamics.Joints.b2FrictionJoint;\n var b2FrictionJointDef = Box2D.Dynamics.Joints.b2FrictionJointDef;\n var b2GearJoint = Box2D.Dynamics.Joints.b2GearJoint;\n var b2GearJointDef = Box2D.Dynamics.Joints.b2GearJointDef;\n var b2Jacobian = Box2D.Dynamics.Joints.b2Jacobian;\n var b2Joint = Box2D.Dynamics.Joints.b2Joint;\n var b2JointDef = Box2D.Dynamics.Joints.b2JointDef;\n var b2JointEdge = Box2D.Dynamics.Joints.b2JointEdge;\n var b2LineJoint = Box2D.Dynamics.Joints.b2LineJoint;\n var b2LineJointDef = Box2D.Dynamics.Joints.b2LineJointDef;\n var b2MouseJoint = Box2D.Dynamics.Joints.b2MouseJoint;\n var b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;\n var b2PrismaticJoint = Box2D.Dynamics.Joints.b2PrismaticJoint;\n var b2PrismaticJointDef = Box2D.Dynamics.Joints.b2PrismaticJointDef;\n var b2PulleyJoint = Box2D.Dynamics.Joints.b2PulleyJoint;\n var b2PulleyJointDef = Box2D.Dynamics.Joints.b2PulleyJointDef;\n var b2RevoluteJoint = Box2D.Dynamics.Joints.b2RevoluteJoint;\n var b2RevoluteJointDef = Box2D.Dynamics.Joints.b2RevoluteJointDef;\n var b2WeldJoint = Box2D.Dynamics.Joints.b2WeldJoint;\n var b2WeldJointDef = Box2D.Dynamics.Joints.b2WeldJointDef;\n var b2internal = Box2D.Common.b2internal;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n b2Body.b2Body = function () {\n this.m_xf = new b2Transform();\n this.m_sweep = new b2Sweep();\n this.m_linearVelocity = new b2Vec2();\n this.m_force = new b2Vec2();\n };\n b2Body.prototype.connectEdges = function (s1, s2, angle1) {\n if (angle1 === undefined) angle1 = 0;\n var angle2 = Math.atan2(s2.GetDirectionVector().y, s2.GetDirectionVector().x);\n var coreOffset = Math.tan((angle2 - angle1) * 0.5);\n var core = b2Math.MulFV(coreOffset, s2.GetDirectionVector());\n core = b2Math.SubtractVV(core, s2.GetNormalVector());\n core = b2Math.MulFV(b2Settings.b2_toiSlop, core);\n core = b2Math.AddVV(core, s2.GetVertex1());\n var cornerDir = b2Math.AddVV(s1.GetDirectionVector(), s2.GetDirectionVector());\n cornerDir.Normalize();\n var convex = b2Math.Dot(s1.GetDirectionVector(), s2.GetNormalVector()) > 0.0;\n s1.SetNextEdge(s2, core, cornerDir, convex);\n s2.SetPrevEdge(s1, core, cornerDir, convex);\n return angle2;\n }\n b2Body.prototype.CreateFixture = function (def) {\n if (this.m_world.IsLocked() == true) {\n return null;\n }\n var fixture = new b2Fixture();\n fixture.Create(this, this.m_xf, def);\n if (this.m_flags & b2Body.e_activeFlag) {\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n fixture.CreateProxy(broadPhase, this.m_xf);\n }\n fixture.m_next = this.m_fixtureList;\n this.m_fixtureList = fixture;\n ++this.m_fixtureCount;\n fixture.m_body = this;\n if (fixture.m_density > 0.0) {\n this.ResetMassData();\n }\n this.m_world.m_flags |= b2World.e_newFixture;\n return fixture;\n }\n b2Body.prototype.CreateFixture2 = function (shape, density) {\n if (density === undefined) density = 0.0;\n var def = new b2FixtureDef();\n def.shape = shape;\n def.density = density;\n return this.CreateFixture(def);\n }\n b2Body.prototype.DestroyFixture = function (fixture) {\n if (this.m_world.IsLocked() == true) {\n return;\n }\n var node = this.m_fixtureList;\n var ppF = null;\n var found = false;\n while (node != null) {\n if (node == fixture) {\n if (ppF) ppF.m_next = fixture.m_next;\n else this.m_fixtureList = fixture.m_next;\n found = true;\n break;\n }\n ppF = node;\n node = node.m_next;\n }\n var edge = this.m_contactList;\n while (edge) {\n var c = edge.contact;\n edge = edge.next;\n var fixtureA = c.GetFixtureA();\n var fixtureB = c.GetFixtureB();\n if (fixture == fixtureA || fixture == fixtureB) {\n this.m_world.m_contactManager.Destroy(c);\n }\n }\n if (this.m_flags & b2Body.e_activeFlag) {\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n fixture.DestroyProxy(broadPhase);\n }\n else {}\n fixture.Destroy();\n fixture.m_body = null;\n fixture.m_next = null;\n --this.m_fixtureCount;\n this.ResetMassData();\n }\n b2Body.prototype.SetPositionAndAngle = function (position, angle) {\n if (angle === undefined) angle = 0;\n var f;\n if (this.m_world.IsLocked() == true) {\n return;\n }\n this.m_xf.R.Set(angle);\n this.m_xf.position.SetV(position);\n var tMat = this.m_xf.R;\n var tVec = this.m_sweep.localCenter;\n this.m_sweep.c.x = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n this.m_sweep.c.y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_sweep.c.x += this.m_xf.position.x;\n this.m_sweep.c.y += this.m_xf.position.y;\n this.m_sweep.c0.SetV(this.m_sweep.c);\n this.m_sweep.a0 = this.m_sweep.a = angle;\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.Synchronize(broadPhase, this.m_xf, this.m_xf);\n }\n this.m_world.m_contactManager.FindNewContacts();\n }\n b2Body.prototype.SetTransform = function (xf) {\n this.SetPositionAndAngle(xf.position, xf.GetAngle());\n }\n b2Body.prototype.GetTransform = function () {\n return this.m_xf;\n }\n b2Body.prototype.GetPosition = function () {\n return this.m_xf.position;\n }\n b2Body.prototype.SetPosition = function (position) {\n this.SetPositionAndAngle(position, this.GetAngle());\n }\n b2Body.prototype.GetAngle = function () {\n return this.m_sweep.a;\n }\n b2Body.prototype.SetAngle = function (angle) {\n if (angle === undefined) angle = 0;\n this.SetPositionAndAngle(this.GetPosition(), angle);\n }\n b2Body.prototype.GetWorldCenter = function () {\n return this.m_sweep.c;\n }\n b2Body.prototype.GetLocalCenter = function () {\n return this.m_sweep.localCenter;\n }\n b2Body.prototype.SetLinearVelocity = function (v) {\n if (this.m_type == b2Body.b2_staticBody) {\n return;\n }\n this.m_linearVelocity.SetV(v);\n }\n b2Body.prototype.GetLinearVelocity = function () {\n return this.m_linearVelocity;\n }\n b2Body.prototype.SetAngularVelocity = function (omega) {\n if (omega === undefined) omega = 0;\n if (this.m_type == b2Body.b2_staticBody) {\n return;\n }\n this.m_angularVelocity = omega;\n }\n b2Body.prototype.GetAngularVelocity = function () {\n return this.m_angularVelocity;\n }\n b2Body.prototype.GetDefinition = function () {\n var bd = new b2BodyDef();\n bd.type = this.GetType();\n bd.allowSleep = (this.m_flags & b2Body.e_allowSleepFlag) == b2Body.e_allowSleepFlag;\n bd.angle = this.GetAngle();\n bd.angularDamping = this.m_angularDamping;\n bd.angularVelocity = this.m_angularVelocity;\n bd.fixedRotation = (this.m_flags & b2Body.e_fixedRotationFlag) == b2Body.e_fixedRotationFlag;\n bd.bullet = (this.m_flags & b2Body.e_bulletFlag) == b2Body.e_bulletFlag;\n bd.awake = (this.m_flags & b2Body.e_awakeFlag) == b2Body.e_awakeFlag;\n bd.linearDamping = this.m_linearDamping;\n bd.linearVelocity.SetV(this.GetLinearVelocity());\n bd.position = this.GetPosition();\n bd.userData = this.GetUserData();\n return bd;\n }\n b2Body.prototype.ApplyForce = function (force, point) {\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n if (this.IsAwake() == false) {\n this.SetAwake(true);\n }\n this.m_force.x += force.x;\n this.m_force.y += force.y;\n this.m_torque += ((point.x - this.m_sweep.c.x) * force.y - (point.y - this.m_sweep.c.y) * force.x);\n }\n b2Body.prototype.ApplyTorque = function (torque) {\n if (torque === undefined) torque = 0;\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n if (this.IsAwake() == false) {\n this.SetAwake(true);\n }\n this.m_torque += torque;\n }\n b2Body.prototype.ApplyImpulse = function (impulse, point) {\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n if (this.IsAwake() == false) {\n this.SetAwake(true);\n }\n this.m_linearVelocity.x += this.m_invMass * impulse.x;\n this.m_linearVelocity.y += this.m_invMass * impulse.y;\n this.m_angularVelocity += this.m_invI * ((point.x - this.m_sweep.c.x) * impulse.y - (point.y - this.m_sweep.c.y) * impulse.x);\n }\n b2Body.prototype.Split = function (callback) {\n var linearVelocity = this.GetLinearVelocity().Copy();\n var angularVelocity = this.GetAngularVelocity();\n var center = this.GetWorldCenter();\n var body1 = this;\n var body2 = this.m_world.CreateBody(this.GetDefinition());\n var prev;\n for (var f = body1.m_fixtureList; f;) {\n if (callback(f)) {\n var next = f.m_next;\n if (prev) {\n prev.m_next = next;\n }\n else {\n body1.m_fixtureList = next;\n }\n body1.m_fixtureCount--;\n f.m_next = body2.m_fixtureList;\n body2.m_fixtureList = f;\n body2.m_fixtureCount++;\n f.m_body = body2;\n f = next;\n }\n else {\n prev = f;\n f = f.m_next;\n }\n }\n body1.ResetMassData();\n body2.ResetMassData();\n var center1 = body1.GetWorldCenter();\n var center2 = body2.GetWorldCenter();\n var velocity1 = b2Math.AddVV(linearVelocity, b2Math.CrossFV(angularVelocity, b2Math.SubtractVV(center1, center)));\n var velocity2 = b2Math.AddVV(linearVelocity, b2Math.CrossFV(angularVelocity, b2Math.SubtractVV(center2, center)));\n body1.SetLinearVelocity(velocity1);\n body2.SetLinearVelocity(velocity2);\n body1.SetAngularVelocity(angularVelocity);\n body2.SetAngularVelocity(angularVelocity);\n body1.SynchronizeFixtures();\n body2.SynchronizeFixtures();\n return body2;\n }\n b2Body.prototype.Merge = function (other) {\n var f;\n for (f = other.m_fixtureList;\n f;) {\n var next = f.m_next;\n other.m_fixtureCount--;\n f.m_next = this.m_fixtureList;\n this.m_fixtureList = f;\n this.m_fixtureCount++;\n f.m_body = body2;\n f = next;\n }\n body1.m_fixtureCount = 0;\n var body1 = this;\n var body2 = other;\n var center1 = body1.GetWorldCenter();\n var center2 = body2.GetWorldCenter();\n var velocity1 = body1.GetLinearVelocity().Copy();\n var velocity2 = body2.GetLinearVelocity().Copy();\n var angular1 = body1.GetAngularVelocity();\n var angular = body2.GetAngularVelocity();\n body1.ResetMassData();\n this.SynchronizeFixtures();\n }\n b2Body.prototype.GetMass = function () {\n return this.m_mass;\n }\n b2Body.prototype.GetInertia = function () {\n return this.m_I;\n }\n b2Body.prototype.GetMassData = function (data) {\n data.mass = this.m_mass;\n data.I = this.m_I;\n data.center.SetV(this.m_sweep.localCenter);\n }\n b2Body.prototype.SetMassData = function (massData) {\n b2Settings.b2Assert(this.m_world.IsLocked() == false);\n if (this.m_world.IsLocked() == true) {\n return;\n }\n if (this.m_type != b2Body.b2_dynamicBody) {\n return;\n }\n this.m_invMass = 0.0;\n this.m_I = 0.0;\n this.m_invI = 0.0;\n this.m_mass = massData.mass;\n if (this.m_mass <= 0.0) {\n this.m_mass = 1.0;\n }\n this.m_invMass = 1.0 / this.m_mass;\n if (massData.I > 0.0 && (this.m_flags & b2Body.e_fixedRotationFlag) == 0) {\n this.m_I = massData.I - this.m_mass * (massData.center.x * massData.center.x + massData.center.y * massData.center.y);\n this.m_invI = 1.0 / this.m_I;\n }\n var oldCenter = this.m_sweep.c.Copy();\n this.m_sweep.localCenter.SetV(massData.center);\n this.m_sweep.c0.SetV(b2Math.MulX(this.m_xf, this.m_sweep.localCenter));\n this.m_sweep.c.SetV(this.m_sweep.c0);\n this.m_linearVelocity.x += this.m_angularVelocity * (-(this.m_sweep.c.y - oldCenter.y));\n this.m_linearVelocity.y += this.m_angularVelocity * (+(this.m_sweep.c.x - oldCenter.x));\n }\n b2Body.prototype.ResetMassData = function () {\n this.m_mass = 0.0;\n this.m_invMass = 0.0;\n this.m_I = 0.0;\n this.m_invI = 0.0;\n this.m_sweep.localCenter.SetZero();\n if (this.m_type == b2Body.b2_staticBody || this.m_type == b2Body.b2_kinematicBody) {\n return;\n }\n var center = b2Vec2.Make(0, 0);\n for (var f = this.m_fixtureList; f; f = f.m_next) {\n if (f.m_density == 0.0) {\n continue;\n }\n var massData = f.GetMassData();\n this.m_mass += massData.mass;\n center.x += massData.center.x * massData.mass;\n center.y += massData.center.y * massData.mass;\n this.m_I += massData.I;\n }\n if (this.m_mass > 0.0) {\n this.m_invMass = 1.0 / this.m_mass;\n center.x *= this.m_invMass;\n center.y *= this.m_invMass;\n }\n else {\n this.m_mass = 1.0;\n this.m_invMass = 1.0;\n }\n if (this.m_I > 0.0 && (this.m_flags & b2Body.e_fixedRotationFlag) == 0) {\n this.m_I -= this.m_mass * (center.x * center.x + center.y * center.y);\n this.m_I *= this.m_inertiaScale;\n b2Settings.b2Assert(this.m_I > 0);\n this.m_invI = 1.0 / this.m_I;\n }\n else {\n this.m_I = 0.0;\n this.m_invI = 0.0;\n }\n var oldCenter = this.m_sweep.c.Copy();\n this.m_sweep.localCenter.SetV(center);\n this.m_sweep.c0.SetV(b2Math.MulX(this.m_xf, this.m_sweep.localCenter));\n this.m_sweep.c.SetV(this.m_sweep.c0);\n this.m_linearVelocity.x += this.m_angularVelocity * (-(this.m_sweep.c.y - oldCenter.y));\n this.m_linearVelocity.y += this.m_angularVelocity * (+(this.m_sweep.c.x - oldCenter.x));\n }\n b2Body.prototype.GetWorldPoint = function (localPoint) {\n var A = this.m_xf.R;\n var u = new b2Vec2(A.col1.x * localPoint.x + A.col2.x * localPoint.y, A.col1.y * localPoint.x + A.col2.y * localPoint.y);\n u.x += this.m_xf.position.x;\n u.y += this.m_xf.position.y;\n return u;\n }\n b2Body.prototype.GetWorldVector = function (localVector) {\n return b2Math.MulMV(this.m_xf.R, localVector);\n }\n b2Body.prototype.GetLocalPoint = function (worldPoint) {\n return b2Math.MulXT(this.m_xf, worldPoint);\n }\n b2Body.prototype.GetLocalVector = function (worldVector) {\n return b2Math.MulTMV(this.m_xf.R, worldVector);\n }\n b2Body.prototype.GetLinearVelocityFromWorldPoint = function (worldPoint) {\n return new b2Vec2(this.m_linearVelocity.x - this.m_angularVelocity * (worldPoint.y - this.m_sweep.c.y), this.m_linearVelocity.y + this.m_angularVelocity * (worldPoint.x - this.m_sweep.c.x));\n }\n b2Body.prototype.GetLinearVelocityFromLocalPoint = function (localPoint) {\n var A = this.m_xf.R;\n var worldPoint = new b2Vec2(A.col1.x * localPoint.x + A.col2.x * localPoint.y, A.col1.y * localPoint.x + A.col2.y * localPoint.y);\n worldPoint.x += this.m_xf.position.x;\n worldPoint.y += this.m_xf.position.y;\n return new b2Vec2(this.m_linearVelocity.x - this.m_angularVelocity * (worldPoint.y - this.m_sweep.c.y), this.m_linearVelocity.y + this.m_angularVelocity * (worldPoint.x - this.m_sweep.c.x));\n }\n b2Body.prototype.GetLinearDamping = function () {\n return this.m_linearDamping;\n }\n b2Body.prototype.SetLinearDamping = function (linearDamping) {\n if (linearDamping === undefined) linearDamping = 0;\n this.m_linearDamping = linearDamping;\n }\n b2Body.prototype.GetAngularDamping = function () {\n return this.m_angularDamping;\n }\n b2Body.prototype.SetAngularDamping = function (angularDamping) {\n if (angularDamping === undefined) angularDamping = 0;\n this.m_angularDamping = angularDamping;\n }\n b2Body.prototype.SetType = function (type) {\n if (type === undefined) type = 0;\n if (this.m_type == type) {\n return;\n }\n this.m_type = type;\n this.ResetMassData();\n if (this.m_type == b2Body.b2_staticBody) {\n this.m_linearVelocity.SetZero();\n this.m_angularVelocity = 0.0;\n }\n this.SetAwake(true);\n this.m_force.SetZero();\n this.m_torque = 0.0;\n for (var ce = this.m_contactList; ce; ce = ce.next) {\n ce.contact.FlagForFiltering();\n }\n }\n b2Body.prototype.GetType = function () {\n return this.m_type;\n }\n b2Body.prototype.SetBullet = function (flag) {\n if (flag) {\n this.m_flags |= b2Body.e_bulletFlag;\n }\n else {\n this.m_flags &= ~b2Body.e_bulletFlag;\n }\n }\n b2Body.prototype.IsBullet = function () {\n return (this.m_flags & b2Body.e_bulletFlag) == b2Body.e_bulletFlag;\n }\n b2Body.prototype.SetSleepingAllowed = function (flag) {\n if (flag) {\n this.m_flags |= b2Body.e_allowSleepFlag;\n }\n else {\n this.m_flags &= ~b2Body.e_allowSleepFlag;\n this.SetAwake(true);\n }\n }\n b2Body.prototype.SetAwake = function (flag) {\n if (flag) {\n this.m_flags |= b2Body.e_awakeFlag;\n this.m_sleepTime = 0.0;\n }\n else {\n this.m_flags &= ~b2Body.e_awakeFlag;\n this.m_sleepTime = 0.0;\n this.m_linearVelocity.SetZero();\n this.m_angularVelocity = 0.0;\n this.m_force.SetZero();\n this.m_torque = 0.0;\n }\n }\n b2Body.prototype.IsAwake = function () {\n return (this.m_flags & b2Body.e_awakeFlag) == b2Body.e_awakeFlag;\n }\n b2Body.prototype.SetFixedRotation = function (fixed) {\n if (fixed) {\n this.m_flags |= b2Body.e_fixedRotationFlag;\n }\n else {\n this.m_flags &= ~b2Body.e_fixedRotationFlag;\n }\n this.ResetMassData();\n }\n b2Body.prototype.IsFixedRotation = function () {\n return (this.m_flags & b2Body.e_fixedRotationFlag) == b2Body.e_fixedRotationFlag;\n }\n b2Body.prototype.SetActive = function (flag) {\n if (flag == this.IsActive()) {\n return;\n }\n var broadPhase;\n var f;\n if (flag) {\n this.m_flags |= b2Body.e_activeFlag;\n broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.CreateProxy(broadPhase, this.m_xf);\n }\n }\n else {\n this.m_flags &= ~b2Body.e_activeFlag;\n broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.DestroyProxy(broadPhase);\n }\n var ce = this.m_contactList;\n while (ce) {\n var ce0 = ce;\n ce = ce.next;\n this.m_world.m_contactManager.Destroy(ce0.contact);\n }\n this.m_contactList = null;\n }\n }\n b2Body.prototype.IsActive = function () {\n return (this.m_flags & b2Body.e_activeFlag) == b2Body.e_activeFlag;\n }\n b2Body.prototype.IsSleepingAllowed = function () {\n return (this.m_flags & b2Body.e_allowSleepFlag) == b2Body.e_allowSleepFlag;\n }\n b2Body.prototype.GetFixtureList = function () {\n return this.m_fixtureList;\n }\n b2Body.prototype.GetJointList = function () {\n return this.m_jointList;\n }\n b2Body.prototype.GetControllerList = function () {\n return this.m_controllerList;\n }\n b2Body.prototype.GetContactList = function () {\n return this.m_contactList;\n }\n b2Body.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Body.prototype.GetUserData = function () {\n return this.m_userData;\n }\n b2Body.prototype.SetUserData = function (data) {\n this.m_userData = data;\n }\n b2Body.prototype.GetWorld = function () {\n return this.m_world;\n }\n b2Body.prototype.b2Body = function (bd, world) {\n this.m_flags = 0;\n if (bd.bullet) {\n this.m_flags |= b2Body.e_bulletFlag;\n }\n if (bd.fixedRotation) {\n this.m_flags |= b2Body.e_fixedRotationFlag;\n }\n if (bd.allowSleep) {\n this.m_flags |= b2Body.e_allowSleepFlag;\n }\n if (bd.awake) {\n this.m_flags |= b2Body.e_awakeFlag;\n }\n if (bd.active) {\n this.m_flags |= b2Body.e_activeFlag;\n }\n this.m_world = world;\n this.m_xf.position.SetV(bd.position);\n this.m_xf.R.Set(bd.angle);\n this.m_sweep.localCenter.SetZero();\n this.m_sweep.t0 = 1.0;\n this.m_sweep.a0 = this.m_sweep.a = bd.angle;\n var tMat = this.m_xf.R;\n var tVec = this.m_sweep.localCenter;\n this.m_sweep.c.x = (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n this.m_sweep.c.y = (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_sweep.c.x += this.m_xf.position.x;\n this.m_sweep.c.y += this.m_xf.position.y;\n this.m_sweep.c0.SetV(this.m_sweep.c);\n this.m_jointList = null;\n this.m_controllerList = null;\n this.m_contactList = null;\n this.m_controllerCount = 0;\n this.m_prev = null;\n this.m_next = null;\n this.m_linearVelocity.SetV(bd.linearVelocity);\n this.m_angularVelocity = bd.angularVelocity;\n this.m_linearDamping = bd.linearDamping;\n this.m_angularDamping = bd.angularDamping;\n this.m_force.Set(0.0, 0.0);\n this.m_torque = 0.0;\n this.m_sleepTime = 0.0;\n this.m_type = bd.type;\n if (this.m_type == b2Body.b2_dynamicBody) {\n this.m_mass = 1.0;\n this.m_invMass = 1.0;\n }\n else {\n this.m_mass = 0.0;\n this.m_invMass = 0.0;\n }\n this.m_I = 0.0;\n this.m_invI = 0.0;\n this.m_inertiaScale = bd.inertiaScale;\n this.m_userData = bd.userData;\n this.m_fixtureList = null;\n this.m_fixtureCount = 0;\n }\n b2Body.prototype.SynchronizeFixtures = function () {\n var xf1 = b2Body.s_xf1;\n xf1.R.Set(this.m_sweep.a0);\n var tMat = xf1.R;\n var tVec = this.m_sweep.localCenter;\n xf1.position.x = this.m_sweep.c0.x - (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n xf1.position.y = this.m_sweep.c0.y - (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var f;\n var broadPhase = this.m_world.m_contactManager.m_broadPhase;\n for (f = this.m_fixtureList;\n f; f = f.m_next) {\n f.Synchronize(broadPhase, xf1, this.m_xf);\n }\n }\n b2Body.prototype.SynchronizeTransform = function () {\n this.m_xf.R.Set(this.m_sweep.a);\n var tMat = this.m_xf.R;\n var tVec = this.m_sweep.localCenter;\n this.m_xf.position.x = this.m_sweep.c.x - (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n this.m_xf.position.y = this.m_sweep.c.y - (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n }\n b2Body.prototype.ShouldCollide = function (other) {\n if (this.m_type != b2Body.b2_dynamicBody && other.m_type != b2Body.b2_dynamicBody) {\n return false;\n }\n for (var jn = this.m_jointList; jn; jn = jn.next) {\n if (jn.other == other) if (jn.joint.m_collideConnected == false) {\n return false;\n }\n }\n return true;\n }\n b2Body.prototype.Advance = function (t) {\n if (t === undefined) t = 0;\n this.m_sweep.Advance(t);\n this.m_sweep.c.SetV(this.m_sweep.c0);\n this.m_sweep.a = this.m_sweep.a0;\n this.SynchronizeTransform();\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2Body.s_xf1 = new b2Transform();\n Box2D.Dynamics.b2Body.prototype.s_xf1 = Box2D.Dynamics.b2Body.s_xf1;\n Box2D.Dynamics.b2Body.e_islandFlag = 0x0001;\n Box2D.Dynamics.b2Body.prototype.e_islandFlag = Box2D.Dynamics.b2Body.e_islandFlag;\n Box2D.Dynamics.b2Body.e_awakeFlag = 0x0002;\n Box2D.Dynamics.b2Body.prototype.e_awakeFlag = Box2D.Dynamics.b2Body.e_awakeFlag;\n Box2D.Dynamics.b2Body.e_allowSleepFlag = 0x0004;\n Box2D.Dynamics.b2Body.prototype.e_allowSleepFlag = Box2D.Dynamics.b2Body.e_allowSleepFlag;\n Box2D.Dynamics.b2Body.e_bulletFlag = 0x0008;\n Box2D.Dynamics.b2Body.prototype.e_bulletFlag = Box2D.Dynamics.b2Body.e_bulletFlag;\n Box2D.Dynamics.b2Body.e_fixedRotationFlag = 0x0010;\n Box2D.Dynamics.b2Body.prototype.e_fixedRotationFlag = Box2D.Dynamics.b2Body.e_fixedRotationFlag;\n Box2D.Dynamics.b2Body.e_activeFlag = 0x0020;\n Box2D.Dynamics.b2Body.prototype.e_activeFlag = Box2D.Dynamics.b2Body.e_activeFlag;\n Box2D.Dynamics.b2Body.b2_staticBody = 0;\n Box2D.Dynamics.b2Body.prototype.b2_staticBody = Box2D.Dynamics.b2Body.b2_staticBody;\n Box2D.Dynamics.b2Body.b2_kinematicBody = 1;\n Box2D.Dynamics.b2Body.prototype.b2_kinematicBody = Box2D.Dynamics.b2Body.b2_kinematicBody;\n Box2D.Dynamics.b2Body.b2_dynamicBody = 2;\n Box2D.Dynamics.b2Body.prototype.b2_dynamicBody = Box2D.Dynamics.b2Body.b2_dynamicBody;\n });\n b2BodyDef.b2BodyDef = function () {\n this.position = new b2Vec2();\n this.linearVelocity = new b2Vec2();\n };\n b2BodyDef.prototype.b2BodyDef = function () {\n this.userData = null;\n this.position.Set(0.0, 0.0);\n this.angle = 0.0;\n this.linearVelocity.Set(0, 0);\n this.angularVelocity = 0.0;\n this.linearDamping = 0.0;\n this.angularDamping = 0.0;\n this.allowSleep = true;\n this.awake = true;\n this.fixedRotation = false;\n this.bullet = false;\n this.type = b2Body.b2_staticBody;\n this.active = true;\n this.inertiaScale = 1.0;\n }\n b2ContactFilter.b2ContactFilter = function () {};\n b2ContactFilter.prototype.ShouldCollide = function (fixtureA, fixtureB) {\n var filter1 = fixtureA.GetFilterData();\n var filter2 = fixtureB.GetFilterData();\n if (filter1.groupIndex == filter2.groupIndex && filter1.groupIndex != 0) {\n return filter1.groupIndex > 0;\n }\n var collide = (filter1.maskBits & filter2.categoryBits) != 0 && (filter1.categoryBits & filter2.maskBits) != 0;\n return collide;\n }\n b2ContactFilter.prototype.RayCollide = function (userData, fixture) {\n if (!userData) return true;\n return this.ShouldCollide((userData instanceof b2Fixture ? userData : null), fixture);\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2ContactFilter.b2_defaultFilter = new b2ContactFilter();\n Box2D.Dynamics.b2ContactFilter.prototype.b2_defaultFilter = Box2D.Dynamics.b2ContactFilter.b2_defaultFilter;\n });\n b2ContactImpulse.b2ContactImpulse = function () {\n this.normalImpulses = new Vector_a2j_Number(b2Settings.b2_maxManifoldPoints);\n this.tangentImpulses = new Vector_a2j_Number(b2Settings.b2_maxManifoldPoints);\n };\n b2ContactListener.b2ContactListener = function () {};\n b2ContactListener.prototype.BeginContact = function (contact) {}\n b2ContactListener.prototype.EndContact = function (contact) {}\n b2ContactListener.prototype.PreSolve = function (contact, oldManifold) {}\n b2ContactListener.prototype.PostSolve = function (contact, impulse) {}\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2ContactListener.b2_defaultListener = new b2ContactListener();\n Box2D.Dynamics.b2ContactListener.prototype.b2_defaultListener = Box2D.Dynamics.b2ContactListener.b2_defaultListener;\n });\n b2ContactManager.b2ContactManager = function () {};\n b2ContactManager.prototype.b2ContactManager = function () {\n this.m_world = null;\n this.m_contactCount = 0;\n this.m_contactFilter = b2ContactFilter.b2_defaultFilter;\n this.m_contactListener = b2ContactListener.b2_defaultListener;\n this.m_contactFactory = new b2ContactFactory(this.m_allocator);\n this.m_broadPhase = new b2DynamicTreeBroadPhase();\n }\n b2ContactManager.prototype.AddPair = function (proxyUserDataA, proxyUserDataB) {\n var fixtureA = (proxyUserDataA instanceof b2Fixture ? proxyUserDataA : null);\n var fixtureB = (proxyUserDataB instanceof b2Fixture ? proxyUserDataB : null);\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (bodyA == bodyB) return;\n var edge = bodyB.GetContactList();\n while (edge) {\n if (edge.other == bodyA) {\n var fA = edge.contact.GetFixtureA();\n var fB = edge.contact.GetFixtureB();\n if (fA == fixtureA && fB == fixtureB) return;\n if (fA == fixtureB && fB == fixtureA) return;\n }\n edge = edge.next;\n }\n if (bodyB.ShouldCollide(bodyA) == false) {\n return;\n }\n if (this.m_contactFilter.ShouldCollide(fixtureA, fixtureB) == false) {\n return;\n }\n var c = this.m_contactFactory.Create(fixtureA, fixtureB);\n fixtureA = c.GetFixtureA();\n fixtureB = c.GetFixtureB();\n bodyA = fixtureA.m_body;\n bodyB = fixtureB.m_body;\n c.m_prev = null;\n c.m_next = this.m_world.m_contactList;\n if (this.m_world.m_contactList != null) {\n this.m_world.m_contactList.m_prev = c;\n }\n this.m_world.m_contactList = c;\n c.m_nodeA.contact = c;\n c.m_nodeA.other = bodyB;\n c.m_nodeA.prev = null;\n c.m_nodeA.next = bodyA.m_contactList;\n if (bodyA.m_contactList != null) {\n bodyA.m_contactList.prev = c.m_nodeA;\n }\n bodyA.m_contactList = c.m_nodeA;\n c.m_nodeB.contact = c;\n c.m_nodeB.other = bodyA;\n c.m_nodeB.prev = null;\n c.m_nodeB.next = bodyB.m_contactList;\n if (bodyB.m_contactList != null) {\n bodyB.m_contactList.prev = c.m_nodeB;\n }\n bodyB.m_contactList = c.m_nodeB;\n ++this.m_world.m_contactCount;\n return;\n }\n b2ContactManager.prototype.FindNewContacts = function () {\n this.m_broadPhase.UpdatePairs(a2j.generateCallback(this, this.AddPair));\n }\n b2ContactManager.prototype.Destroy = function (c) {\n var fixtureA = c.GetFixtureA();\n var fixtureB = c.GetFixtureB();\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (c.IsTouching()) {\n this.m_contactListener.EndContact(c);\n }\n if (c.m_prev) {\n c.m_prev.m_next = c.m_next;\n }\n if (c.m_next) {\n c.m_next.m_prev = c.m_prev;\n }\n if (c == this.m_world.m_contactList) {\n this.m_world.m_contactList = c.m_next;\n }\n if (c.m_nodeA.prev) {\n c.m_nodeA.prev.next = c.m_nodeA.next;\n }\n if (c.m_nodeA.next) {\n c.m_nodeA.next.prev = c.m_nodeA.prev;\n }\n if (c.m_nodeA == bodyA.m_contactList) {\n bodyA.m_contactList = c.m_nodeA.next;\n }\n if (c.m_nodeB.prev) {\n c.m_nodeB.prev.next = c.m_nodeB.next;\n }\n if (c.m_nodeB.next) {\n c.m_nodeB.next.prev = c.m_nodeB.prev;\n }\n if (c.m_nodeB == bodyB.m_contactList) {\n bodyB.m_contactList = c.m_nodeB.next;\n }\n this.m_contactFactory.Destroy(c);\n --this.m_contactCount;\n }\n b2ContactManager.prototype.Collide = function () {\n var c = this.m_world.m_contactList;\n while (c) {\n var fixtureA = c.GetFixtureA();\n var fixtureB = c.GetFixtureB();\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (bodyA.IsAwake() == false && bodyB.IsAwake() == false) {\n c = c.GetNext();\n continue;\n }\n if (c.m_flags & b2Contact.e_filterFlag) {\n if (bodyB.ShouldCollide(bodyA) == false) {\n var cNuke = c;\n c = cNuke.GetNext();\n this.Destroy(cNuke);\n continue;\n }\n if (this.m_contactFilter.ShouldCollide(fixtureA, fixtureB) == false) {\n cNuke = c;\n c = cNuke.GetNext();\n this.Destroy(cNuke);\n continue;\n }\n c.m_flags &= ~b2Contact.e_filterFlag;\n }\n var proxyA = fixtureA.m_proxy;\n var proxyB = fixtureB.m_proxy;\n var overlap = this.m_broadPhase.TestOverlap(proxyA, proxyB);\n if (overlap == false) {\n cNuke = c;\n c = cNuke.GetNext();\n this.Destroy(cNuke);\n continue;\n }\n c.Update(this.m_contactListener);\n c = c.GetNext();\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2ContactManager.s_evalCP = new b2ContactPoint();\n Box2D.Dynamics.b2ContactManager.prototype.s_evalCP = Box2D.Dynamics.b2ContactManager.s_evalCP;\n });\n b2DebugDraw.b2DebugDraw = function () {};\n b2DebugDraw.prototype.b2DebugDraw = function () {\n m_drawFlags = 0;\n }\n b2DebugDraw.prototype.SetFlags = function (flags) {\n if (flags === undefined) flags = 0;\n }\n b2DebugDraw.prototype.GetFlags = function () {}\n b2DebugDraw.prototype.AppendFlags = function (flags) {\n if (flags === undefined) flags = 0;\n }\n b2DebugDraw.prototype.ClearFlags = function (flags) {\n if (flags === undefined) flags = 0;\n }\n b2DebugDraw.prototype.SetSprite = function (sprite) {}\n b2DebugDraw.prototype.GetSprite = function () {}\n b2DebugDraw.prototype.SetDrawScale = function (drawScale) {\n if (drawScale === undefined) drawScale = 0;\n }\n b2DebugDraw.prototype.GetDrawScale = function () {}\n b2DebugDraw.prototype.SetLineThickness = function (lineThickness) {\n if (lineThickness === undefined) lineThickness = 0;\n }\n b2DebugDraw.prototype.GetLineThickness = function () {}\n b2DebugDraw.prototype.SetAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n }\n b2DebugDraw.prototype.GetAlpha = function () {}\n b2DebugDraw.prototype.SetFillAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n }\n b2DebugDraw.prototype.GetFillAlpha = function () {}\n b2DebugDraw.prototype.SetXFormScale = function (xformScale) {\n if (xformScale === undefined) xformScale = 0;\n }\n b2DebugDraw.prototype.GetXFormScale = function () {}\n b2DebugDraw.prototype.DrawPolygon = function (vertices, vertexCount, color) {\n if (vertexCount === undefined) vertexCount = 0;\n }\n b2DebugDraw.prototype.DrawSolidPolygon = function (vertices, vertexCount, color) {\n if (vertexCount === undefined) vertexCount = 0;\n }\n b2DebugDraw.prototype.DrawCircle = function (center, radius, color) {\n if (radius === undefined) radius = 0;\n }\n b2DebugDraw.prototype.DrawSolidCircle = function (center, radius, axis, color) {\n if (radius === undefined) radius = 0;\n }\n b2DebugDraw.prototype.DrawSegment = function (p1, p2, color) {}\n b2DebugDraw.prototype.DrawTransform = function (xf) {}\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2DebugDraw.e_shapeBit = 0x0001;\n Box2D.Dynamics.b2DebugDraw.prototype.e_shapeBit = Box2D.Dynamics.b2DebugDraw.e_shapeBit;\n Box2D.Dynamics.b2DebugDraw.e_jointBit = 0x0002;\n Box2D.Dynamics.b2DebugDraw.prototype.e_jointBit = Box2D.Dynamics.b2DebugDraw.e_jointBit;\n Box2D.Dynamics.b2DebugDraw.e_aabbBit = 0x0004;\n Box2D.Dynamics.b2DebugDraw.prototype.e_aabbBit = Box2D.Dynamics.b2DebugDraw.e_aabbBit;\n Box2D.Dynamics.b2DebugDraw.e_pairBit = 0x0008;\n Box2D.Dynamics.b2DebugDraw.prototype.e_pairBit = Box2D.Dynamics.b2DebugDraw.e_pairBit;\n Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit = 0x0010;\n Box2D.Dynamics.b2DebugDraw.prototype.e_centerOfMassBit = Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit;\n Box2D.Dynamics.b2DebugDraw.e_controllerBit = 0x0020;\n Box2D.Dynamics.b2DebugDraw.prototype.e_controllerBit = Box2D.Dynamics.b2DebugDraw.e_controllerBit;\n });\n b2DestructionListener.b2DestructionListener = function () {};\n b2DestructionListener.prototype.SayGoodbyeJoint = function (joint) {}\n b2DestructionListener.prototype.SayGoodbyeFixture = function (fixture) {}\n b2FilterData.b2FilterData = function () {\n this.categoryBits = 0x0001;\n this.maskBits = 0xFFFF;\n this.groupIndex = 0;\n };\n b2FilterData.prototype.Copy = function () {\n var copy = new b2FilterData();\n copy.categoryBits = this.categoryBits;\n copy.maskBits = this.maskBits;\n copy.groupIndex = this.groupIndex;\n return copy;\n }\n b2Fixture.b2Fixture = function () {\n this.m_filter = new b2FilterData();\n };\n b2Fixture.prototype.GetType = function () {\n return this.m_shape.GetType();\n }\n b2Fixture.prototype.GetShape = function () {\n return this.m_shape;\n }\n b2Fixture.prototype.SetSensor = function (sensor) {\n if (this.m_isSensor == sensor) return;\n this.m_isSensor = sensor;\n if (this.m_body == null) return;\n var edge = this.m_body.GetContactList();\n while (edge) {\n var contact = edge.contact;\n var fixtureA = contact.GetFixtureA();\n var fixtureB = contact.GetFixtureB();\n if (fixtureA == this || fixtureB == this) contact.SetSensor(fixtureA.IsSensor() || fixtureB.IsSensor());\n edge = edge.next;\n }\n }\n b2Fixture.prototype.IsSensor = function () {\n return this.m_isSensor;\n }\n b2Fixture.prototype.SetFilterData = function (filter) {\n this.m_filter = filter.Copy();\n if (this.m_body) return;\n var edge = this.m_body.GetContactList();\n while (edge) {\n var contact = edge.contact;\n var fixtureA = contact.GetFixtureA();\n var fixtureB = contact.GetFixtureB();\n if (fixtureA == this || fixtureB == this) contact.FlagForFiltering();\n edge = edge.next;\n }\n }\n b2Fixture.prototype.GetFilterData = function () {\n return this.m_filter.Copy();\n }\n b2Fixture.prototype.GetBody = function () {\n return this.m_body;\n }\n b2Fixture.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Fixture.prototype.GetUserData = function () {\n return this.m_userData;\n }\n b2Fixture.prototype.SetUserData = function (data) {\n this.m_userData = data;\n }\n b2Fixture.prototype.TestPoint = function (p) {\n return this.m_shape.TestPoint(this.m_body.GetTransform(), p);\n }\n b2Fixture.prototype.RayCast = function (output, input) {\n return this.m_shape.RayCast(output, input, this.m_body.GetTransform());\n }\n b2Fixture.prototype.GetMassData = function (massData) {\n if (massData === undefined) massData = null;\n if (massData == null) {\n massData = new b2MassData();\n }\n this.m_shape.ComputeMass(massData, this.m_density);\n return massData;\n }\n b2Fixture.prototype.SetDensity = function (density) {\n if (density === undefined) density = 0;\n this.m_density = density;\n }\n b2Fixture.prototype.GetDensity = function () {\n return this.m_density;\n }\n b2Fixture.prototype.GetFriction = function () {\n return this.m_friction;\n }\n b2Fixture.prototype.SetFriction = function (friction) {\n if (friction === undefined) friction = 0;\n this.m_friction = friction;\n }\n b2Fixture.prototype.GetRestitution = function () {\n return this.m_restitution;\n }\n b2Fixture.prototype.SetRestitution = function (restitution) {\n if (restitution === undefined) restitution = 0;\n this.m_restitution = restitution;\n }\n b2Fixture.prototype.GetAABB = function () {\n return this.m_aabb;\n }\n b2Fixture.prototype.b2Fixture = function () {\n this.m_aabb = new b2AABB();\n this.m_userData = null;\n this.m_body = null;\n this.m_next = null;\n this.m_shape = null;\n this.m_density = 0.0;\n this.m_friction = 0.0;\n this.m_restitution = 0.0;\n }\n b2Fixture.prototype.Create = function (body, xf, def) {\n this.m_userData = def.userData;\n this.m_friction = def.friction;\n this.m_restitution = def.restitution;\n this.m_body = body;\n this.m_next = null;\n this.m_filter = def.filter.Copy();\n this.m_isSensor = def.isSensor;\n this.m_shape = def.shape.Copy();\n this.m_density = def.density;\n }\n b2Fixture.prototype.Destroy = function () {\n this.m_shape = null;\n }\n b2Fixture.prototype.CreateProxy = function (broadPhase, xf) {\n this.m_shape.ComputeAABB(this.m_aabb, xf);\n this.m_proxy = broadPhase.CreateProxy(this.m_aabb, this);\n }\n b2Fixture.prototype.DestroyProxy = function (broadPhase) {\n if (this.m_proxy == null) {\n return;\n }\n broadPhase.DestroyProxy(this.m_proxy);\n this.m_proxy = null;\n }\n b2Fixture.prototype.Synchronize = function (broadPhase, transform1, transform2) {\n if (!this.m_proxy) return;\n var aabb1 = new b2AABB();\n var aabb2 = new b2AABB();\n this.m_shape.ComputeAABB(aabb1, transform1);\n this.m_shape.ComputeAABB(aabb2, transform2);\n this.m_aabb.Combine(aabb1, aabb2);\n var displacement = b2Math.SubtractVV(transform2.position, transform1.position);\n broadPhase.MoveProxy(this.m_proxy, this.m_aabb, displacement);\n }\n b2FixtureDef.b2FixtureDef = function () {\n this.filter = new b2FilterData();\n };\n b2FixtureDef.prototype.b2FixtureDef = function () {\n this.shape = null;\n this.userData = null;\n this.friction = 0.2;\n this.restitution = 0.0;\n this.density = 0.0;\n this.filter.categoryBits = 0x0001;\n this.filter.maskBits = 0xFFFF;\n this.filter.groupIndex = 0;\n this.isSensor = false;\n }\n b2Island.b2Island = function () {};\n b2Island.prototype.b2Island = function () {\n this.m_bodies = new Vector();\n this.m_contacts = new Vector();\n this.m_joints = new Vector();\n }\n b2Island.prototype.Initialize = function (bodyCapacity, contactCapacity, jointCapacity, allocator, listener, contactSolver) {\n if (bodyCapacity === undefined) bodyCapacity = 0;\n if (contactCapacity === undefined) contactCapacity = 0;\n if (jointCapacity === undefined) jointCapacity = 0;\n var i = 0;\n this.m_bodyCapacity = bodyCapacity;\n this.m_contactCapacity = contactCapacity;\n this.m_jointCapacity = jointCapacity;\n this.m_bodyCount = 0;\n this.m_contactCount = 0;\n this.m_jointCount = 0;\n this.m_allocator = allocator;\n this.m_listener = listener;\n this.m_contactSolver = contactSolver;\n for (i = this.m_bodies.length;\n i < bodyCapacity; i++)\n this.m_bodies[i] = null;\n for (i = this.m_contacts.length;\n i < contactCapacity; i++)\n this.m_contacts[i] = null;\n for (i = this.m_joints.length;\n i < jointCapacity; i++)\n this.m_joints[i] = null;\n }\n b2Island.prototype.Clear = function () {\n this.m_bodyCount = 0;\n this.m_contactCount = 0;\n this.m_jointCount = 0;\n }\n b2Island.prototype.Solve = function (step, gravity, allowSleep) {\n var i = 0;\n var j = 0;\n var b;\n var joint;\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n if (b.GetType() != b2Body.b2_dynamicBody) continue;\n b.m_linearVelocity.x += step.dt * (gravity.x + b.m_invMass * b.m_force.x);\n b.m_linearVelocity.y += step.dt * (gravity.y + b.m_invMass * b.m_force.y);\n b.m_angularVelocity += step.dt * b.m_invI * b.m_torque;\n b.m_linearVelocity.Multiply(b2Math.Clamp(1.0 - step.dt * b.m_linearDamping, 0.0, 1.0));\n b.m_angularVelocity *= b2Math.Clamp(1.0 - step.dt * b.m_angularDamping, 0.0, 1.0);\n }\n this.m_contactSolver.Initialize(step, this.m_contacts, this.m_contactCount, this.m_allocator);\n var contactSolver = this.m_contactSolver;\n contactSolver.InitVelocityConstraints(step);\n for (i = 0;\n i < this.m_jointCount; ++i) {\n joint = this.m_joints[i];\n joint.InitVelocityConstraints(step);\n }\n for (i = 0;\n i < step.velocityIterations; ++i) {\n for (j = 0;\n j < this.m_jointCount; ++j) {\n joint = this.m_joints[j];\n joint.SolveVelocityConstraints(step);\n }\n contactSolver.SolveVelocityConstraints();\n }\n for (i = 0;\n i < this.m_jointCount; ++i) {\n joint = this.m_joints[i];\n joint.FinalizeVelocityConstraints();\n }\n contactSolver.FinalizeVelocityConstraints();\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) continue;\n var translationX = step.dt * b.m_linearVelocity.x;\n var translationY = step.dt * b.m_linearVelocity.y;\n if ((translationX * translationX + translationY * translationY) > b2Settings.b2_maxTranslationSquared) {\n b.m_linearVelocity.Normalize();\n b.m_linearVelocity.x *= b2Settings.b2_maxTranslation * step.inv_dt;\n b.m_linearVelocity.y *= b2Settings.b2_maxTranslation * step.inv_dt;\n }\n var rotation = step.dt * b.m_angularVelocity;\n if (rotation * rotation > b2Settings.b2_maxRotationSquared) {\n if (b.m_angularVelocity < 0.0) {\n b.m_angularVelocity = (-b2Settings.b2_maxRotation * step.inv_dt);\n }\n else {\n b.m_angularVelocity = b2Settings.b2_maxRotation * step.inv_dt;\n }\n }\n b.m_sweep.c0.SetV(b.m_sweep.c);\n b.m_sweep.a0 = b.m_sweep.a;\n b.m_sweep.c.x += step.dt * b.m_linearVelocity.x;\n b.m_sweep.c.y += step.dt * b.m_linearVelocity.y;\n b.m_sweep.a += step.dt * b.m_angularVelocity;\n b.SynchronizeTransform();\n }\n for (i = 0;\n i < step.positionIterations; ++i) {\n var contactsOkay = contactSolver.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);\n var jointsOkay = true;\n for (j = 0;\n j < this.m_jointCount; ++j) {\n joint = this.m_joints[j];\n var jointOkay = joint.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);\n jointsOkay = jointsOkay && jointOkay;\n }\n if (contactsOkay && jointsOkay) {\n break;\n }\n }\n this.Report(contactSolver.m_constraints);\n if (allowSleep) {\n var minSleepTime = Number.MAX_VALUE;\n var linTolSqr = b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance;\n var angTolSqr = b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance;\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n if ((b.m_flags & b2Body.e_allowSleepFlag) == 0) {\n b.m_sleepTime = 0.0;\n minSleepTime = 0.0;\n }\n if ((b.m_flags & b2Body.e_allowSleepFlag) == 0 || b.m_angularVelocity * b.m_angularVelocity > angTolSqr || b2Math.Dot(b.m_linearVelocity, b.m_linearVelocity) > linTolSqr) {\n b.m_sleepTime = 0.0;\n minSleepTime = 0.0;\n }\n else {\n b.m_sleepTime += step.dt;\n minSleepTime = b2Math.Min(minSleepTime, b.m_sleepTime);\n }\n }\n if (minSleepTime >= b2Settings.b2_timeToSleep) {\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n b = this.m_bodies[i];\n b.SetAwake(false);\n }\n }\n }\n }\n b2Island.prototype.SolveTOI = function (subStep) {\n var i = 0;\n var j = 0;\n this.m_contactSolver.Initialize(subStep, this.m_contacts, this.m_contactCount, this.m_allocator);\n var contactSolver = this.m_contactSolver;\n for (i = 0;\n i < this.m_jointCount; ++i) {\n this.m_joints[i].InitVelocityConstraints(subStep);\n }\n for (i = 0;\n i < subStep.velocityIterations; ++i) {\n contactSolver.SolveVelocityConstraints();\n for (j = 0;\n j < this.m_jointCount; ++j) {\n this.m_joints[j].SolveVelocityConstraints(subStep);\n }\n }\n for (i = 0;\n i < this.m_bodyCount; ++i) {\n var b = this.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) continue;\n var translationX = subStep.dt * b.m_linearVelocity.x;\n var translationY = subStep.dt * b.m_linearVelocity.y;\n if ((translationX * translationX + translationY * translationY) > b2Settings.b2_maxTranslationSquared) {\n b.m_linearVelocity.Normalize();\n b.m_linearVelocity.x *= b2Settings.b2_maxTranslation * subStep.inv_dt;\n b.m_linearVelocity.y *= b2Settings.b2_maxTranslation * subStep.inv_dt;\n }\n var rotation = subStep.dt * b.m_angularVelocity;\n if (rotation * rotation > b2Settings.b2_maxRotationSquared) {\n if (b.m_angularVelocity < 0.0) {\n b.m_angularVelocity = (-b2Settings.b2_maxRotation * subStep.inv_dt);\n }\n else {\n b.m_angularVelocity = b2Settings.b2_maxRotation * subStep.inv_dt;\n }\n }\n b.m_sweep.c0.SetV(b.m_sweep.c);\n b.m_sweep.a0 = b.m_sweep.a;\n b.m_sweep.c.x += subStep.dt * b.m_linearVelocity.x;\n b.m_sweep.c.y += subStep.dt * b.m_linearVelocity.y;\n b.m_sweep.a += subStep.dt * b.m_angularVelocity;\n b.SynchronizeTransform();\n }\n var k_toiBaumgarte = 0.75;\n for (i = 0;\n i < subStep.positionIterations; ++i) {\n var contactsOkay = contactSolver.SolvePositionConstraints(k_toiBaumgarte);\n var jointsOkay = true;\n for (j = 0;\n j < this.m_jointCount; ++j) {\n var jointOkay = this.m_joints[j].SolvePositionConstraints(b2Settings.b2_contactBaumgarte);\n jointsOkay = jointsOkay && jointOkay;\n }\n if (contactsOkay && jointsOkay) {\n break;\n }\n }\n this.Report(contactSolver.m_constraints);\n }\n b2Island.prototype.Report = function (constraints) {\n if (this.m_listener == null) {\n return;\n }\n for (var i = 0; i < this.m_contactCount; ++i) {\n var c = this.m_contacts[i];\n var cc = constraints[i];\n for (var j = 0; j < cc.pointCount; ++j) {\n b2Island.s_impulse.normalImpulses[j] = cc.points[j].normalImpulse;\n b2Island.s_impulse.tangentImpulses[j] = cc.points[j].tangentImpulse;\n }\n this.m_listener.PostSolve(c, b2Island.s_impulse);\n }\n }\n b2Island.prototype.AddBody = function (body) {\n body.m_islandIndex = this.m_bodyCount;\n this.m_bodies[this.m_bodyCount++] = body;\n }\n b2Island.prototype.AddContact = function (contact) {\n this.m_contacts[this.m_contactCount++] = contact;\n }\n b2Island.prototype.AddJoint = function (joint) {\n this.m_joints[this.m_jointCount++] = joint;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2Island.s_impulse = new b2ContactImpulse();\n Box2D.Dynamics.b2Island.prototype.s_impulse = Box2D.Dynamics.b2Island.s_impulse;\n });\n b2TimeStep.b2TimeStep = function () {};\n b2TimeStep.prototype.Set = function (step) {\n this.dt = step.dt;\n this.inv_dt = step.inv_dt;\n this.positionIterations = step.positionIterations;\n this.velocityIterations = step.velocityIterations;\n this.warmStarting = step.warmStarting;\n }\n b2World.b2World = function () {\n this.s_stack = new Vector();\n this.m_contactManager = new b2ContactManager();\n this.m_contactSolver = new b2ContactSolver();\n this.m_island = new b2Island();\n };\n b2World.prototype.b2World = function (gravity, doSleep) {\n this.m_destructionListener = null;\n this.m_debugDraw = null;\n this.m_bodyList = null;\n this.m_contactList = null;\n this.m_jointList = null;\n this.m_controllerList = null;\n this.m_bodyCount = 0;\n this.m_contactCount = 0;\n this.m_jointCount = 0;\n this.m_controllerCount = 0;\n b2World.m_warmStarting = true;\n b2World.m_continuousPhysics = true;\n this.m_allowSleep = doSleep;\n this.m_gravity = gravity;\n this.m_inv_dt0 = 0.0;\n this.m_contactManager.m_world = this;\n var bd = new b2BodyDef();\n this.m_groundBody = this.CreateBody(bd);\n }\n b2World.prototype.SetDestructionListener = function (listener) {\n this.m_destructionListener = listener;\n }\n b2World.prototype.SetContactFilter = function (filter) {\n this.m_contactManager.m_contactFilter = filter;\n }\n b2World.prototype.SetContactListener = function (listener) {\n this.m_contactManager.m_contactListener = listener;\n }\n b2World.prototype.SetDebugDraw = function (debugDraw) {\n this.m_debugDraw = debugDraw;\n }\n b2World.prototype.SetBroadPhase = function (broadPhase) {\n var oldBroadPhase = this.m_contactManager.m_broadPhase;\n this.m_contactManager.m_broadPhase = broadPhase;\n for (var b = this.m_bodyList; b; b = b.m_next) {\n for (var f = b.m_fixtureList; f; f = f.m_next) {\n f.m_proxy = broadPhase.CreateProxy(oldBroadPhase.GetFatAABB(f.m_proxy), f);\n }\n }\n }\n b2World.prototype.Validate = function () {\n this.m_contactManager.m_broadPhase.Validate();\n }\n b2World.prototype.GetProxyCount = function () {\n return this.m_contactManager.m_broadPhase.GetProxyCount();\n }\n b2World.prototype.CreateBody = function (def) {\n if (this.IsLocked() == true) {\n return null;\n }\n var b = new b2Body(def, this);\n b.m_prev = null;\n b.m_next = this.m_bodyList;\n if (this.m_bodyList) {\n this.m_bodyList.m_prev = b;\n }\n this.m_bodyList = b;\n ++this.m_bodyCount;\n return b;\n }\n b2World.prototype.DestroyBody = function (b) {\n if (this.IsLocked() == true) {\n return;\n }\n var jn = b.m_jointList;\n while (jn) {\n var jn0 = jn;\n jn = jn.next;\n if (this.m_destructionListener) {\n this.m_destructionListener.SayGoodbyeJoint(jn0.joint);\n }\n this.DestroyJoint(jn0.joint);\n }\n var coe = b.m_controllerList;\n while (coe) {\n var coe0 = coe;\n coe = coe.nextController;\n coe0.controller.RemoveBody(b);\n }\n var ce = b.m_contactList;\n while (ce) {\n var ce0 = ce;\n ce = ce.next;\n this.m_contactManager.Destroy(ce0.contact);\n }\n b.m_contactList = null;\n var f = b.m_fixtureList;\n while (f) {\n var f0 = f;\n f = f.m_next;\n if (this.m_destructionListener) {\n this.m_destructionListener.SayGoodbyeFixture(f0);\n }\n f0.DestroyProxy(this.m_contactManager.m_broadPhase);\n f0.Destroy();\n }\n b.m_fixtureList = null;\n b.m_fixtureCount = 0;\n if (b.m_prev) {\n b.m_prev.m_next = b.m_next;\n }\n if (b.m_next) {\n b.m_next.m_prev = b.m_prev;\n }\n if (b == this.m_bodyList) {\n this.m_bodyList = b.m_next;\n }--this.m_bodyCount;\n }\n b2World.prototype.CreateJoint = function (def) {\n var j = b2Joint.Create(def, null);\n j.m_prev = null;\n j.m_next = this.m_jointList;\n if (this.m_jointList) {\n this.m_jointList.m_prev = j;\n }\n this.m_jointList = j;\n ++this.m_jointCount;\n j.m_edgeA.joint = j;\n j.m_edgeA.other = j.m_bodyB;\n j.m_edgeA.prev = null;\n j.m_edgeA.next = j.m_bodyA.m_jointList;\n if (j.m_bodyA.m_jointList) j.m_bodyA.m_jointList.prev = j.m_edgeA;\n j.m_bodyA.m_jointList = j.m_edgeA;\n j.m_edgeB.joint = j;\n j.m_edgeB.other = j.m_bodyA;\n j.m_edgeB.prev = null;\n j.m_edgeB.next = j.m_bodyB.m_jointList;\n if (j.m_bodyB.m_jointList) j.m_bodyB.m_jointList.prev = j.m_edgeB;\n j.m_bodyB.m_jointList = j.m_edgeB;\n var bodyA = def.bodyA;\n var bodyB = def.bodyB;\n if (def.collideConnected == false) {\n var edge = bodyB.GetContactList();\n while (edge) {\n if (edge.other == bodyA) {\n edge.contact.FlagForFiltering();\n }\n edge = edge.next;\n }\n }\n return j;\n }\n b2World.prototype.DestroyJoint = function (j) {\n var collideConnected = j.m_collideConnected;\n if (j.m_prev) {\n j.m_prev.m_next = j.m_next;\n }\n if (j.m_next) {\n j.m_next.m_prev = j.m_prev;\n }\n if (j == this.m_jointList) {\n this.m_jointList = j.m_next;\n }\n var bodyA = j.m_bodyA;\n var bodyB = j.m_bodyB;\n bodyA.SetAwake(true);\n bodyB.SetAwake(true);\n if (j.m_edgeA.prev) {\n j.m_edgeA.prev.next = j.m_edgeA.next;\n }\n if (j.m_edgeA.next) {\n j.m_edgeA.next.prev = j.m_edgeA.prev;\n }\n if (j.m_edgeA == bodyA.m_jointList) {\n bodyA.m_jointList = j.m_edgeA.next;\n }\n j.m_edgeA.prev = null;\n j.m_edgeA.next = null;\n if (j.m_edgeB.prev) {\n j.m_edgeB.prev.next = j.m_edgeB.next;\n }\n if (j.m_edgeB.next) {\n j.m_edgeB.next.prev = j.m_edgeB.prev;\n }\n if (j.m_edgeB == bodyB.m_jointList) {\n bodyB.m_jointList = j.m_edgeB.next;\n }\n j.m_edgeB.prev = null;\n j.m_edgeB.next = null;\n b2Joint.Destroy(j, null);\n --this.m_jointCount;\n if (collideConnected == false) {\n var edge = bodyB.GetContactList();\n while (edge) {\n if (edge.other == bodyA) {\n edge.contact.FlagForFiltering();\n }\n edge = edge.next;\n }\n }\n }\n b2World.prototype.AddController = function (c) {\n c.m_next = this.m_controllerList;\n c.m_prev = null;\n this.m_controllerList = c;\n c.m_world = this;\n this.m_controllerCount++;\n return c;\n }\n b2World.prototype.RemoveController = function (c) {\n if (c.m_prev) c.m_prev.m_next = c.m_next;\n if (c.m_next) c.m_next.m_prev = c.m_prev;\n if (this.m_controllerList == c) this.m_controllerList = c.m_next;\n this.m_controllerCount--;\n }\n b2World.prototype.CreateController = function (controller) {\n if (controller.m_world != this) throw new Error(\"Controller can only be a member of one world\");\n controller.m_next = this.m_controllerList;\n controller.m_prev = null;\n if (this.m_controllerList) this.m_controllerList.m_prev = controller;\n this.m_controllerList = controller;\n ++this.m_controllerCount;\n controller.m_world = this;\n return controller;\n }\n b2World.prototype.DestroyController = function (controller) {\n controller.Clear();\n if (controller.m_next) controller.m_next.m_prev = controller.m_prev;\n if (controller.m_prev) controller.m_prev.m_next = controller.m_next;\n if (controller == this.m_controllerList) this.m_controllerList = controller.m_next;\n --this.m_controllerCount;\n }\n b2World.prototype.SetWarmStarting = function (flag) {\n b2World.m_warmStarting = flag;\n }\n b2World.prototype.SetContinuousPhysics = function (flag) {\n b2World.m_continuousPhysics = flag;\n }\n b2World.prototype.GetBodyCount = function () {\n return this.m_bodyCount;\n }\n b2World.prototype.GetJointCount = function () {\n return this.m_jointCount;\n }\n b2World.prototype.GetContactCount = function () {\n return this.m_contactCount;\n }\n b2World.prototype.SetGravity = function (gravity) {\n this.m_gravity = gravity;\n }\n b2World.prototype.GetGravity = function () {\n return this.m_gravity;\n }\n b2World.prototype.GetGroundBody = function () {\n return this.m_groundBody;\n }\n b2World.prototype.Step = function (dt, velocityIterations, positionIterations) {\n if (dt === undefined) dt = 0;\n if (velocityIterations === undefined) velocityIterations = 0;\n if (positionIterations === undefined) positionIterations = 0;\n if (this.m_flags & b2World.e_newFixture) {\n this.m_contactManager.FindNewContacts();\n this.m_flags &= ~b2World.e_newFixture;\n }\n this.m_flags |= b2World.e_locked;\n var step = b2World.s_timestep2;\n step.dt = dt;\n step.velocityIterations = velocityIterations;\n step.positionIterations = positionIterations;\n if (dt > 0.0) {\n step.inv_dt = 1.0 / dt;\n }\n else {\n step.inv_dt = 0.0;\n }\n step.dtRatio = this.m_inv_dt0 * dt;\n step.warmStarting = b2World.m_warmStarting;\n this.m_contactManager.Collide();\n if (step.dt > 0.0) {\n this.Solve(step);\n }\n if (b2World.m_continuousPhysics && step.dt > 0.0) {\n this.SolveTOI(step);\n }\n if (step.dt > 0.0) {\n this.m_inv_dt0 = step.inv_dt;\n }\n this.m_flags &= ~b2World.e_locked;\n }\n b2World.prototype.ClearForces = function () {\n for (var body = this.m_bodyList; body; body = body.m_next) {\n body.m_force.SetZero();\n body.m_torque = 0.0;\n }\n }\n b2World.prototype.DrawDebugData = function () {\n if (this.m_debugDraw == null) {\n return;\n }\n this.m_debugDraw.m_sprite.graphics.clear();\n var flags = this.m_debugDraw.GetFlags();\n var i = 0;\n var b;\n var f;\n var s;\n var j;\n var bp;\n var invQ = new b2Vec2;\n var x1 = new b2Vec2;\n var x2 = new b2Vec2;\n var xf;\n var b1 = new b2AABB();\n var b2 = new b2AABB();\n var vs = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];\n var color = new b2Color(0, 0, 0);\n if (flags & b2DebugDraw.e_shapeBit) {\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n xf = b.m_xf;\n for (f = b.GetFixtureList();\n f; f = f.m_next) {\n s = f.GetShape();\n if (b.IsActive() == false) {\n color.Set(0.5, 0.5, 0.3);\n this.DrawShape(s, xf, color);\n }\n else if (b.GetType() == b2Body.b2_staticBody) {\n color.Set(0.5, 0.9, 0.5);\n this.DrawShape(s, xf, color);\n }\n else if (b.GetType() == b2Body.b2_kinematicBody) {\n color.Set(0.5, 0.5, 0.9);\n this.DrawShape(s, xf, color);\n }\n else if (b.IsAwake() == false) {\n color.Set(0.6, 0.6, 0.6);\n this.DrawShape(s, xf, color);\n }\n else {\n color.Set(0.9, 0.7, 0.7);\n this.DrawShape(s, xf, color);\n }\n }\n }\n }\n if (flags & b2DebugDraw.e_jointBit) {\n for (j = this.m_jointList;\n j; j = j.m_next) {\n this.DrawJoint(j);\n }\n }\n if (flags & b2DebugDraw.e_controllerBit) {\n for (var c = this.m_controllerList; c; c = c.m_next) {\n c.Draw(this.m_debugDraw);\n }\n }\n if (flags & b2DebugDraw.e_pairBit) {\n color.Set(0.3, 0.9, 0.9);\n for (var contact = this.m_contactManager.m_contactList; contact; contact = contact.GetNext()) {\n var fixtureA = contact.GetFixtureA();\n var fixtureB = contact.GetFixtureB();\n var cA = fixtureA.GetAABB().GetCenter();\n var cB = fixtureB.GetAABB().GetCenter();\n this.m_debugDraw.DrawSegment(cA, cB, color);\n }\n }\n if (flags & b2DebugDraw.e_aabbBit) {\n bp = this.m_contactManager.m_broadPhase;\n vs = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];\n for (b = this.m_bodyList;\n b; b = b.GetNext()) {\n if (b.IsActive() == false) {\n continue;\n }\n for (f = b.GetFixtureList();\n f; f = f.GetNext()) {\n var aabb = bp.GetFatAABB(f.m_proxy);\n vs[0].Set(aabb.lowerBound.x, aabb.lowerBound.y);\n vs[1].Set(aabb.upperBound.x, aabb.lowerBound.y);\n vs[2].Set(aabb.upperBound.x, aabb.upperBound.y);\n vs[3].Set(aabb.lowerBound.x, aabb.upperBound.y);\n this.m_debugDraw.DrawPolygon(vs, 4, color);\n }\n }\n }\n if (flags & b2DebugDraw.e_centerOfMassBit) {\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n xf = b2World.s_xf;\n xf.R = b.m_xf.R;\n xf.position = b.GetWorldCenter();\n this.m_debugDraw.DrawTransform(xf);\n }\n }\n }\n b2World.prototype.QueryAABB = function (callback, aabb) {\n var __this = this;\n var broadPhase = __this.m_contactManager.m_broadPhase;\n\n function WorldQueryWrapper(proxy) {\n return callback(broadPhase.GetUserData(proxy));\n };\n broadPhase.Query(WorldQueryWrapper, aabb);\n }\n b2World.prototype.QueryShape = function (callback, shape, transform) {\n var __this = this;\n if (transform === undefined) transform = null;\n if (transform == null) {\n transform = new b2Transform();\n transform.SetIdentity();\n }\n var broadPhase = __this.m_contactManager.m_broadPhase;\n\n function WorldQueryWrapper(proxy) {\n var fixture = (broadPhase.GetUserData(proxy) instanceof b2Fixture ? broadPhase.GetUserData(proxy) : null);\n if (b2Shape.TestOverlap(shape, transform, fixture.GetShape(), fixture.GetBody().GetTransform())) return callback(fixture);\n return true;\n };\n var aabb = new b2AABB();\n shape.ComputeAABB(aabb, transform);\n broadPhase.Query(WorldQueryWrapper, aabb);\n }\n b2World.prototype.QueryPoint = function (callback, p) {\n var __this = this;\n var broadPhase = __this.m_contactManager.m_broadPhase;\n\n function WorldQueryWrapper(proxy) {\n var fixture = (broadPhase.GetUserData(proxy) instanceof b2Fixture ? broadPhase.GetUserData(proxy) : null);\n if (fixture.TestPoint(p)) return callback(fixture);\n return true;\n };\n var aabb = new b2AABB();\n aabb.lowerBound.Set(p.x - b2Settings.b2_linearSlop, p.y - b2Settings.b2_linearSlop);\n aabb.upperBound.Set(p.x + b2Settings.b2_linearSlop, p.y + b2Settings.b2_linearSlop);\n broadPhase.Query(WorldQueryWrapper, aabb);\n }\n b2World.prototype.RayCast = function (callback, point1, point2) {\n var __this = this;\n var broadPhase = __this.m_contactManager.m_broadPhase;\n var output = new b2RayCastOutput;\n\n function RayCastWrapper(input, proxy) {\n var userData = broadPhase.GetUserData(proxy);\n var fixture = (userData instanceof b2Fixture ? userData : null);\n var hit = fixture.RayCast(output, input);\n if (hit) {\n var fraction = output.fraction;\n var point = new b2Vec2((1.0 - fraction) * point1.x + fraction * point2.x, (1.0 - fraction) * point1.y + fraction * point2.y);\n return callback(fixture, point, output.normal, fraction);\n }\n return input.maxFraction;\n };\n var input = new b2RayCastInput(point1, point2);\n broadPhase.RayCast(RayCastWrapper, input);\n }\n b2World.prototype.RayCastOne = function (point1, point2) {\n var __this = this;\n var result;\n\n function RayCastOneWrapper(fixture, point, normal, fraction) {\n if (fraction === undefined) fraction = 0;\n result = fixture;\n return fraction;\n };\n __this.RayCast(RayCastOneWrapper, point1, point2);\n return result;\n }\n b2World.prototype.RayCastAll = function (point1, point2) {\n var __this = this;\n var result = new Vector();\n\n function RayCastAllWrapper(fixture, point, normal, fraction) {\n if (fraction === undefined) fraction = 0;\n result[result.length] = fixture;\n return 1;\n };\n __this.RayCast(RayCastAllWrapper, point1, point2);\n return result;\n }\n b2World.prototype.GetBodyList = function () {\n return this.m_bodyList;\n }\n b2World.prototype.GetJointList = function () {\n return this.m_jointList;\n }\n b2World.prototype.GetContactList = function () {\n return this.m_contactList;\n }\n b2World.prototype.IsLocked = function () {\n return (this.m_flags & b2World.e_locked) > 0;\n }\n b2World.prototype.Solve = function (step) {\n var b;\n for (var controller = this.m_controllerList; controller; controller = controller.m_next) {\n controller.Step(step);\n }\n var island = this.m_island;\n island.Initialize(this.m_bodyCount, this.m_contactCount, this.m_jointCount, null, this.m_contactManager.m_contactListener, this.m_contactSolver);\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n b.m_flags &= ~b2Body.e_islandFlag;\n }\n for (var c = this.m_contactList; c; c = c.m_next) {\n c.m_flags &= ~b2Contact.e_islandFlag;\n }\n for (var j = this.m_jointList; j; j = j.m_next) {\n j.m_islandFlag = false;\n }\n var stackSize = parseInt(this.m_bodyCount);\n var stack = this.s_stack;\n for (var seed = this.m_bodyList; seed; seed = seed.m_next) {\n if (seed.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n if (seed.IsAwake() == false || seed.IsActive() == false) {\n continue;\n }\n if (seed.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n island.Clear();\n var stackCount = 0;\n stack[stackCount++] = seed;\n seed.m_flags |= b2Body.e_islandFlag;\n while (stackCount > 0) {\n b = stack[--stackCount];\n island.AddBody(b);\n if (b.IsAwake() == false) {\n b.SetAwake(true);\n }\n if (b.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n var other;\n for (var ce = b.m_contactList; ce; ce = ce.next) {\n if (ce.contact.m_flags & b2Contact.e_islandFlag) {\n continue;\n }\n if (ce.contact.IsSensor() == true || ce.contact.IsEnabled() == false || ce.contact.IsTouching() == false) {\n continue;\n }\n island.AddContact(ce.contact);\n ce.contact.m_flags |= b2Contact.e_islandFlag;\n other = ce.other;\n if (other.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n stack[stackCount++] = other;\n other.m_flags |= b2Body.e_islandFlag;\n }\n for (var jn = b.m_jointList; jn; jn = jn.next) {\n if (jn.joint.m_islandFlag == true) {\n continue;\n }\n other = jn.other;\n if (other.IsActive() == false) {\n continue;\n }\n island.AddJoint(jn.joint);\n jn.joint.m_islandFlag = true;\n if (other.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n stack[stackCount++] = other;\n other.m_flags |= b2Body.e_islandFlag;\n }\n }\n island.Solve(step, this.m_gravity, this.m_allowSleep);\n for (var i = 0; i < island.m_bodyCount; ++i) {\n b = island.m_bodies[i];\n if (b.GetType() == b2Body.b2_staticBody) {\n b.m_flags &= ~b2Body.e_islandFlag;\n }\n }\n }\n for (i = 0;\n i < stack.length; ++i) {\n if (!stack[i]) break;\n stack[i] = null;\n }\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n if (b.IsAwake() == false || b.IsActive() == false) {\n continue;\n }\n if (b.GetType() == b2Body.b2_staticBody) {\n continue;\n }\n b.SynchronizeFixtures();\n }\n this.m_contactManager.FindNewContacts();\n }\n b2World.prototype.SolveTOI = function (step) {\n var b;\n var fA;\n var fB;\n var bA;\n var bB;\n var cEdge;\n var j;\n var island = this.m_island;\n island.Initialize(this.m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, b2Settings.b2_maxTOIJointsPerIsland, null, this.m_contactManager.m_contactListener, this.m_contactSolver);\n var queue = b2World.s_queue;\n for (b = this.m_bodyList;\n b; b = b.m_next) {\n b.m_flags &= ~b2Body.e_islandFlag;\n b.m_sweep.t0 = 0.0;\n }\n var c;\n for (c = this.m_contactList;\n c; c = c.m_next) {\n c.m_flags &= ~ (b2Contact.e_toiFlag | b2Contact.e_islandFlag);\n }\n for (j = this.m_jointList;\n j; j = j.m_next) {\n j.m_islandFlag = false;\n }\n for (;;) {\n var minContact = null;\n var minTOI = 1.0;\n for (c = this.m_contactList;\n c; c = c.m_next) {\n if (c.IsSensor() == true || c.IsEnabled() == false || c.IsContinuous() == false) {\n continue;\n }\n var toi = 1.0;\n if (c.m_flags & b2Contact.e_toiFlag) {\n toi = c.m_toi;\n }\n else {\n fA = c.m_fixtureA;\n fB = c.m_fixtureB;\n bA = fA.m_body;\n bB = fB.m_body;\n if ((bA.GetType() != b2Body.b2_dynamicBody || bA.IsAwake() == false) && (bB.GetType() != b2Body.b2_dynamicBody || bB.IsAwake() == false)) {\n continue;\n }\n var t0 = bA.m_sweep.t0;\n if (bA.m_sweep.t0 < bB.m_sweep.t0) {\n t0 = bB.m_sweep.t0;\n bA.m_sweep.Advance(t0);\n }\n else if (bB.m_sweep.t0 < bA.m_sweep.t0) {\n t0 = bA.m_sweep.t0;\n bB.m_sweep.Advance(t0);\n }\n toi = c.ComputeTOI(bA.m_sweep, bB.m_sweep);\n b2Settings.b2Assert(0.0 <= toi && toi <= 1.0);\n if (toi > 0.0 && toi < 1.0) {\n toi = (1.0 - toi) * t0 + toi;\n if (toi > 1) toi = 1;\n }\n c.m_toi = toi;\n c.m_flags |= b2Contact.e_toiFlag;\n }\n if (Number.MIN_VALUE < toi && toi < minTOI) {\n minContact = c;\n minTOI = toi;\n }\n }\n if (minContact == null || 1.0 - 100.0 * Number.MIN_VALUE < minTOI) {\n break;\n }\n fA = minContact.m_fixtureA;\n fB = minContact.m_fixtureB;\n bA = fA.m_body;\n bB = fB.m_body;\n b2World.s_backupA.Set(bA.m_sweep);\n b2World.s_backupB.Set(bB.m_sweep);\n bA.Advance(minTOI);\n bB.Advance(minTOI);\n minContact.Update(this.m_contactManager.m_contactListener);\n minContact.m_flags &= ~b2Contact.e_toiFlag;\n if (minContact.IsSensor() == true || minContact.IsEnabled() == false) {\n bA.m_sweep.Set(b2World.s_backupA);\n bB.m_sweep.Set(b2World.s_backupB);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n continue;\n }\n if (minContact.IsTouching() == false) {\n continue;\n }\n var seed = bA;\n if (seed.GetType() != b2Body.b2_dynamicBody) {\n seed = bB;\n }\n island.Clear();\n var queueStart = 0;\n var queueSize = 0;\n queue[queueStart + queueSize++] = seed;\n seed.m_flags |= b2Body.e_islandFlag;\n while (queueSize > 0) {\n b = queue[queueStart++];\n --queueSize;\n island.AddBody(b);\n if (b.IsAwake() == false) {\n b.SetAwake(true);\n }\n if (b.GetType() != b2Body.b2_dynamicBody) {\n continue;\n }\n for (cEdge = b.m_contactList;\n cEdge; cEdge = cEdge.next) {\n if (island.m_contactCount == island.m_contactCapacity) {\n break;\n }\n if (cEdge.contact.m_flags & b2Contact.e_islandFlag) {\n continue;\n }\n if (cEdge.contact.IsSensor() == true || cEdge.contact.IsEnabled() == false || cEdge.contact.IsTouching() == false) {\n continue;\n }\n island.AddContact(cEdge.contact);\n cEdge.contact.m_flags |= b2Contact.e_islandFlag;\n var other = cEdge.other;\n if (other.m_flags & b2Body.e_islandFlag) {\n continue;\n }\n if (other.GetType() != b2Body.b2_staticBody) {\n other.Advance(minTOI);\n other.SetAwake(true);\n }\n queue[queueStart + queueSize] = other;\n ++queueSize;\n other.m_flags |= b2Body.e_islandFlag;\n }\n for (var jEdge = b.m_jointList; jEdge; jEdge = jEdge.next) {\n if (island.m_jointCount == island.m_jointCapacity) continue;\n if (jEdge.joint.m_islandFlag == true) continue;\n other = jEdge.other;\n if (other.IsActive() == false) {\n continue;\n }\n island.AddJoint(jEdge.joint);\n jEdge.joint.m_islandFlag = true;\n if (other.m_flags & b2Body.e_islandFlag) continue;\n if (other.GetType() != b2Body.b2_staticBody) {\n other.Advance(minTOI);\n other.SetAwake(true);\n }\n queue[queueStart + queueSize] = other;\n ++queueSize;\n other.m_flags |= b2Body.e_islandFlag;\n }\n }\n var subStep = b2World.s_timestep;\n subStep.warmStarting = false;\n subStep.dt = (1.0 - minTOI) * step.dt;\n subStep.inv_dt = 1.0 / subStep.dt;\n subStep.dtRatio = 0.0;\n subStep.velocityIterations = step.velocityIterations;\n subStep.positionIterations = step.positionIterations;\n island.SolveTOI(subStep);\n var i = 0;\n for (i = 0;\n i < island.m_bodyCount; ++i) {\n b = island.m_bodies[i];\n b.m_flags &= ~b2Body.e_islandFlag;\n if (b.IsAwake() == false) {\n continue;\n }\n if (b.GetType() != b2Body.b2_dynamicBody) {\n continue;\n }\n b.SynchronizeFixtures();\n for (cEdge = b.m_contactList;\n cEdge; cEdge = cEdge.next) {\n cEdge.contact.m_flags &= ~b2Contact.e_toiFlag;\n }\n }\n for (i = 0;\n i < island.m_contactCount; ++i) {\n c = island.m_contacts[i];\n c.m_flags &= ~ (b2Contact.e_toiFlag | b2Contact.e_islandFlag);\n }\n for (i = 0;\n i < island.m_jointCount; ++i) {\n j = island.m_joints[i];\n j.m_islandFlag = false;\n }\n this.m_contactManager.FindNewContacts();\n }\n }\n b2World.prototype.DrawJoint = function (joint) {\n var b1 = joint.GetBodyA();\n var b2 = joint.GetBodyB();\n var xf1 = b1.m_xf;\n var xf2 = b2.m_xf;\n var x1 = xf1.position;\n var x2 = xf2.position;\n var p1 = joint.GetAnchorA();\n var p2 = joint.GetAnchorB();\n var color = b2World.s_jointColor;\n switch (joint.m_type) {\n case b2Joint.e_distanceJoint:\n this.m_debugDraw.DrawSegment(p1, p2, color);\n break;\n case b2Joint.e_pulleyJoint:\n {\n var pulley = ((joint instanceof b2PulleyJoint ? joint : null));\n var s1 = pulley.GetGroundAnchorA();\n var s2 = pulley.GetGroundAnchorB();\n this.m_debugDraw.DrawSegment(s1, p1, color);\n this.m_debugDraw.DrawSegment(s2, p2, color);\n this.m_debugDraw.DrawSegment(s1, s2, color);\n }\n break;\n case b2Joint.e_mouseJoint:\n this.m_debugDraw.DrawSegment(p1, p2, color);\n break;\n default:\n if (b1 != this.m_groundBody) this.m_debugDraw.DrawSegment(x1, p1, color);\n this.m_debugDraw.DrawSegment(p1, p2, color);\n if (b2 != this.m_groundBody) this.m_debugDraw.DrawSegment(x2, p2, color);\n }\n }\n b2World.prototype.DrawShape = function (shape, xf, color) {\n switch (shape.m_type) {\n case b2Shape.e_circleShape:\n {\n var circle = ((shape instanceof b2CircleShape ? shape : null));\n var center = b2Math.MulX(xf, circle.m_p);\n var radius = circle.m_radius;\n var axis = xf.R.col1;\n this.m_debugDraw.DrawSolidCircle(center, radius, axis, color);\n }\n break;\n case b2Shape.e_polygonShape:\n {\n var i = 0;\n var poly = ((shape instanceof b2PolygonShape ? shape : null));\n var vertexCount = parseInt(poly.GetVertexCount());\n var localVertices = poly.GetVertices();\n var vertices = new Vector(vertexCount);\n for (i = 0;\n i < vertexCount; ++i) {\n vertices[i] = b2Math.MulX(xf, localVertices[i]);\n }\n this.m_debugDraw.DrawSolidPolygon(vertices, vertexCount, color);\n }\n break;\n case b2Shape.e_edgeShape:\n {\n var edge = (shape instanceof b2EdgeShape ? shape : null);\n this.m_debugDraw.DrawSegment(b2Math.MulX(xf, edge.GetVertex1()), b2Math.MulX(xf, edge.GetVertex2()), color);\n }\n break;\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2World.s_timestep2 = new b2TimeStep();\n Box2D.Dynamics.b2World.prototype.s_timestep2 = Box2D.Dynamics.b2World.s_timestep2;\n Box2D.Dynamics.b2World.s_xf = new b2Transform();\n Box2D.Dynamics.b2World.prototype.s_xf = Box2D.Dynamics.b2World.s_xf;\n Box2D.Dynamics.b2World.s_backupA = new b2Sweep();\n Box2D.Dynamics.b2World.prototype.s_backupA = Box2D.Dynamics.b2World.s_backupA;\n Box2D.Dynamics.b2World.s_backupB = new b2Sweep();\n Box2D.Dynamics.b2World.prototype.s_backupB = Box2D.Dynamics.b2World.s_backupB;\n Box2D.Dynamics.b2World.s_timestep = new b2TimeStep();\n Box2D.Dynamics.b2World.prototype.s_timestep = Box2D.Dynamics.b2World.s_timestep;\n Box2D.Dynamics.b2World.s_queue = new Vector();\n Box2D.Dynamics.b2World.prototype.s_queue = Box2D.Dynamics.b2World.s_queue;\n Box2D.Dynamics.b2World.s_jointColor = new b2Color(0.5, 0.8, 0.8);\n Box2D.Dynamics.b2World.prototype.s_jointColor = Box2D.Dynamics.b2World.s_jointColor;\n Box2D.Dynamics.b2World.e_newFixture = 0x0001;\n Box2D.Dynamics.b2World.prototype.e_newFixture = Box2D.Dynamics.b2World.e_newFixture;\n Box2D.Dynamics.b2World.e_locked = 0x0002;\n Box2D.Dynamics.b2World.prototype.e_locked = Box2D.Dynamics.b2World.e_locked;\n });\n})(); /* source: disabled*/\n(function () {\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2CircleContact = Box2D.Dynamics.Contacts.b2CircleContact;\n var b2Contact = Box2D.Dynamics.Contacts.b2Contact;\n var b2ContactConstraint = Box2D.Dynamics.Contacts.b2ContactConstraint;\n var b2ContactConstraintPoint = Box2D.Dynamics.Contacts.b2ContactConstraintPoint;\n var b2ContactEdge = Box2D.Dynamics.Contacts.b2ContactEdge;\n var b2ContactFactory = Box2D.Dynamics.Contacts.b2ContactFactory;\n var b2ContactRegister = Box2D.Dynamics.Contacts.b2ContactRegister;\n var b2ContactResult = Box2D.Dynamics.Contacts.b2ContactResult;\n var b2ContactSolver = Box2D.Dynamics.Contacts.b2ContactSolver;\n var b2EdgeAndCircleContact = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact;\n var b2NullContact = Box2D.Dynamics.Contacts.b2NullContact;\n var b2PolyAndCircleContact = Box2D.Dynamics.Contacts.b2PolyAndCircleContact;\n var b2PolyAndEdgeContact = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact;\n var b2PolygonContact = Box2D.Dynamics.Contacts.b2PolygonContact;\n var b2PositionSolverManifold = Box2D.Dynamics.Contacts.b2PositionSolverManifold;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2AABB = Box2D.Collision.b2AABB;\n var b2Bound = Box2D.Collision.b2Bound;\n var b2BoundValues = Box2D.Collision.b2BoundValues;\n var b2BroadPhase = Box2D.Collision.b2BroadPhase;\n var b2Collision = Box2D.Collision.b2Collision;\n var b2ContactID = Box2D.Collision.b2ContactID;\n var b2ContactPoint = Box2D.Collision.b2ContactPoint;\n var b2Distance = Box2D.Collision.b2Distance;\n var b2DistanceInput = Box2D.Collision.b2DistanceInput;\n var b2DistanceOutput = Box2D.Collision.b2DistanceOutput;\n var b2DistanceProxy = Box2D.Collision.b2DistanceProxy;\n var b2DynamicTree = Box2D.Collision.b2DynamicTree;\n var b2DynamicTreeBroadPhase = Box2D.Collision.b2DynamicTreeBroadPhase;\n var b2DynamicTreeNode = Box2D.Collision.b2DynamicTreeNode;\n var b2DynamicTreePair = Box2D.Collision.b2DynamicTreePair;\n var b2Manifold = Box2D.Collision.b2Manifold;\n var b2ManifoldPoint = Box2D.Collision.b2ManifoldPoint;\n var b2OBB = Box2D.Collision.b2OBB;\n var b2Pair = Box2D.Collision.b2Pair;\n var b2PairManager = Box2D.Collision.b2PairManager;\n var b2Point = Box2D.Collision.b2Point;\n var b2Proxy = Box2D.Collision.b2Proxy;\n var b2RayCastInput = Box2D.Collision.b2RayCastInput;\n var b2RayCastOutput = Box2D.Collision.b2RayCastOutput;\n var b2Segment = Box2D.Collision.b2Segment;\n var b2SeparationFunction = Box2D.Collision.b2SeparationFunction;\n var b2Simplex = Box2D.Collision.b2Simplex;\n var b2SimplexCache = Box2D.Collision.b2SimplexCache;\n var b2SimplexVertex = Box2D.Collision.b2SimplexVertex;\n var b2TimeOfImpact = Box2D.Collision.b2TimeOfImpact;\n var b2TOIInput = Box2D.Collision.b2TOIInput;\n var b2WorldManifold = Box2D.Collision.b2WorldManifold;\n var ClipVertex = Box2D.Collision.ClipVertex;\n var Features = Box2D.Collision.Features;\n var IBroadPhase = Box2D.Collision.IBroadPhase;\n var b2internal = Box2D.Common.b2internal;\n var b2CircleContact = Box2D.Dynamics.Contacts.b2CircleContact;\n var b2Contact = Box2D.Dynamics.Contacts.b2Contact;\n var b2ContactConstraint = Box2D.Dynamics.Contacts.b2ContactConstraint;\n var b2ContactConstraintPoint = Box2D.Dynamics.Contacts.b2ContactConstraintPoint;\n var b2ContactEdge = Box2D.Dynamics.Contacts.b2ContactEdge;\n var b2ContactFactory = Box2D.Dynamics.Contacts.b2ContactFactory;\n var b2ContactRegister = Box2D.Dynamics.Contacts.b2ContactRegister;\n var b2ContactResult = Box2D.Dynamics.Contacts.b2ContactResult;\n var b2ContactSolver = Box2D.Dynamics.Contacts.b2ContactSolver;\n var b2EdgeAndCircleContact = Box2D.Dynamics.Contacts.b2EdgeAndCircleContact;\n var b2NullContact = Box2D.Dynamics.Contacts.b2NullContact;\n var b2PolyAndCircleContact = Box2D.Dynamics.Contacts.b2PolyAndCircleContact;\n var b2PolyAndEdgeContact = Box2D.Dynamics.Contacts.b2PolyAndEdgeContact;\n var b2PolygonContact = Box2D.Dynamics.Contacts.b2PolygonContact;\n var b2PositionSolverManifold = Box2D.Dynamics.Contacts.b2PositionSolverManifold;\n b2CircleContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2CircleContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2CircleContact.b2CircleContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2CircleContact.prototype.Create = function (allocator) {\n return new b2CircleContact();\n }\n b2CircleContact.Create = b2CircleContact.prototype.Create;\n b2CircleContact.prototype.Destroy = function (contact, allocator) {}\n b2CircleContact.Destroy = b2CircleContact.prototype.Destroy;\n b2CircleContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n }\n b2CircleContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n b2Collision.CollideCircles(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2CircleShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2CircleShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2Contact.b2Contact = function () {\n this.m_nodeA = new b2ContactEdge();\n this.m_nodeB = new b2ContactEdge();\n this.m_manifold = new b2Manifold();\n this.m_oldManifold = new b2Manifold();\n };\n b2Contact.prototype.GetManifold = function () {\n return this.m_manifold;\n }\n b2Contact.prototype.GetWorldManifold = function (worldManifold) {\n var bodyA = this.m_fixtureA.GetBody();\n var bodyB = this.m_fixtureB.GetBody();\n var shapeA = this.m_fixtureA.GetShape();\n var shapeB = this.m_fixtureB.GetShape();\n worldManifold.Initialize(this.m_manifold, bodyA.GetTransform(), shapeA.m_radius, bodyB.GetTransform(), shapeB.m_radius);\n }\n b2Contact.prototype.IsTouching = function () {\n return (this.m_flags & b2Contact.e_touchingFlag) == b2Contact.e_touchingFlag;\n }\n b2Contact.prototype.IsContinuous = function () {\n return (this.m_flags & b2Contact.e_continuousFlag) == b2Contact.e_continuousFlag;\n }\n b2Contact.prototype.SetSensor = function (sensor) {\n if (sensor) {\n this.m_flags |= b2Contact.e_sensorFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_sensorFlag;\n }\n }\n b2Contact.prototype.IsSensor = function () {\n return (this.m_flags & b2Contact.e_sensorFlag) == b2Contact.e_sensorFlag;\n }\n b2Contact.prototype.SetEnabled = function (flag) {\n if (flag) {\n this.m_flags |= b2Contact.e_enabledFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_enabledFlag;\n }\n }\n b2Contact.prototype.IsEnabled = function () {\n return (this.m_flags & b2Contact.e_enabledFlag) == b2Contact.e_enabledFlag;\n }\n b2Contact.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Contact.prototype.GetFixtureA = function () {\n return this.m_fixtureA;\n }\n b2Contact.prototype.GetFixtureB = function () {\n return this.m_fixtureB;\n }\n b2Contact.prototype.FlagForFiltering = function () {\n this.m_flags |= b2Contact.e_filterFlag;\n }\n b2Contact.prototype.b2Contact = function () {}\n b2Contact.prototype.Reset = function (fixtureA, fixtureB) {\n if (fixtureA === undefined) fixtureA = null;\n if (fixtureB === undefined) fixtureB = null;\n this.m_flags = b2Contact.e_enabledFlag;\n if (!fixtureA || !fixtureB) {\n this.m_fixtureA = null;\n this.m_fixtureB = null;\n return;\n }\n if (fixtureA.IsSensor() || fixtureB.IsSensor()) {\n this.m_flags |= b2Contact.e_sensorFlag;\n }\n var bodyA = fixtureA.GetBody();\n var bodyB = fixtureB.GetBody();\n if (bodyA.GetType() != b2Body.b2_dynamicBody || bodyA.IsBullet() || bodyB.GetType() != b2Body.b2_dynamicBody || bodyB.IsBullet()) {\n this.m_flags |= b2Contact.e_continuousFlag;\n }\n this.m_fixtureA = fixtureA;\n this.m_fixtureB = fixtureB;\n this.m_manifold.m_pointCount = 0;\n this.m_prev = null;\n this.m_next = null;\n this.m_nodeA.contact = null;\n this.m_nodeA.prev = null;\n this.m_nodeA.next = null;\n this.m_nodeA.other = null;\n this.m_nodeB.contact = null;\n this.m_nodeB.prev = null;\n this.m_nodeB.next = null;\n this.m_nodeB.other = null;\n }\n b2Contact.prototype.Update = function (listener) {\n var tManifold = this.m_oldManifold;\n this.m_oldManifold = this.m_manifold;\n this.m_manifold = tManifold;\n this.m_flags |= b2Contact.e_enabledFlag;\n var touching = false;\n var wasTouching = (this.m_flags & b2Contact.e_touchingFlag) == b2Contact.e_touchingFlag;\n var bodyA = this.m_fixtureA.m_body;\n var bodyB = this.m_fixtureB.m_body;\n var aabbOverlap = this.m_fixtureA.m_aabb.TestOverlap(this.m_fixtureB.m_aabb);\n if (this.m_flags & b2Contact.e_sensorFlag) {\n if (aabbOverlap) {\n var shapeA = this.m_fixtureA.GetShape();\n var shapeB = this.m_fixtureB.GetShape();\n var xfA = bodyA.GetTransform();\n var xfB = bodyB.GetTransform();\n touching = b2Shape.TestOverlap(shapeA, xfA, shapeB, xfB);\n }\n this.m_manifold.m_pointCount = 0;\n }\n else {\n if (bodyA.GetType() != b2Body.b2_dynamicBody || bodyA.IsBullet() || bodyB.GetType() != b2Body.b2_dynamicBody || bodyB.IsBullet()) {\n this.m_flags |= b2Contact.e_continuousFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_continuousFlag;\n }\n if (aabbOverlap) {\n this.Evaluate();\n touching = this.m_manifold.m_pointCount > 0;\n for (var i = 0; i < this.m_manifold.m_pointCount; ++i) {\n var mp2 = this.m_manifold.m_points[i];\n mp2.m_normalImpulse = 0.0;\n mp2.m_tangentImpulse = 0.0;\n var id2 = mp2.m_id;\n for (var j = 0; j < this.m_oldManifold.m_pointCount; ++j) {\n var mp1 = this.m_oldManifold.m_points[j];\n if (mp1.m_id.key == id2.key) {\n mp2.m_normalImpulse = mp1.m_normalImpulse;\n mp2.m_tangentImpulse = mp1.m_tangentImpulse;\n break;\n }\n }\n }\n }\n else {\n this.m_manifold.m_pointCount = 0;\n }\n if (touching != wasTouching) {\n bodyA.SetAwake(true);\n bodyB.SetAwake(true);\n }\n }\n if (touching) {\n this.m_flags |= b2Contact.e_touchingFlag;\n }\n else {\n this.m_flags &= ~b2Contact.e_touchingFlag;\n }\n if (wasTouching == false && touching == true) {\n listener.BeginContact(this);\n }\n if (wasTouching == true && touching == false) {\n listener.EndContact(this);\n }\n if ((this.m_flags & b2Contact.e_sensorFlag) == 0) {\n listener.PreSolve(this, this.m_oldManifold);\n }\n }\n b2Contact.prototype.Evaluate = function () {}\n b2Contact.prototype.ComputeTOI = function (sweepA, sweepB) {\n b2Contact.s_input.proxyA.Set(this.m_fixtureA.GetShape());\n b2Contact.s_input.proxyB.Set(this.m_fixtureB.GetShape());\n b2Contact.s_input.sweepA = sweepA;\n b2Contact.s_input.sweepB = sweepB;\n b2Contact.s_input.tolerance = b2Settings.b2_linearSlop;\n return b2TimeOfImpact.TimeOfImpact(b2Contact.s_input);\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag = 0x0001;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_sensorFlag = Box2D.Dynamics.Contacts.b2Contact.e_sensorFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag = 0x0002;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_continuousFlag = Box2D.Dynamics.Contacts.b2Contact.e_continuousFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_islandFlag = 0x0004;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_islandFlag = Box2D.Dynamics.Contacts.b2Contact.e_islandFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_toiFlag = 0x0008;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_toiFlag = Box2D.Dynamics.Contacts.b2Contact.e_toiFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag = 0x0010;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_touchingFlag = Box2D.Dynamics.Contacts.b2Contact.e_touchingFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag = 0x0020;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_enabledFlag = Box2D.Dynamics.Contacts.b2Contact.e_enabledFlag;\n Box2D.Dynamics.Contacts.b2Contact.e_filterFlag = 0x0040;\n Box2D.Dynamics.Contacts.b2Contact.prototype.e_filterFlag = Box2D.Dynamics.Contacts.b2Contact.e_filterFlag;\n Box2D.Dynamics.Contacts.b2Contact.s_input = new b2TOIInput();\n Box2D.Dynamics.Contacts.b2Contact.prototype.s_input = Box2D.Dynamics.Contacts.b2Contact.s_input;\n });\n b2ContactConstraint.b2ContactConstraint = function () {\n this.localPlaneNormal = new b2Vec2();\n this.localPoint = new b2Vec2();\n this.normal = new b2Vec2();\n this.normalMass = new b2Mat22();\n this.K = new b2Mat22();\n };\n b2ContactConstraint.prototype.b2ContactConstraint = function () {\n this.points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.points[i] = new b2ContactConstraintPoint();\n }\n }\n b2ContactConstraintPoint.b2ContactConstraintPoint = function () {\n this.localPoint = new b2Vec2();\n this.rA = new b2Vec2();\n this.rB = new b2Vec2();\n };\n b2ContactEdge.b2ContactEdge = function () {};\n b2ContactFactory.b2ContactFactory = function () {};\n b2ContactFactory.prototype.b2ContactFactory = function (allocator) {\n this.m_allocator = allocator;\n this.InitializeRegisters();\n }\n b2ContactFactory.prototype.AddType = function (createFcn, destroyFcn, type1, type2) {\n if (type1 === undefined) type1 = 0;\n if (type2 === undefined) type2 = 0;\n this.m_registers[type1][type2].createFcn = createFcn;\n this.m_registers[type1][type2].destroyFcn = destroyFcn;\n this.m_registers[type1][type2].primary = true;\n if (type1 != type2) {\n this.m_registers[type2][type1].createFcn = createFcn;\n this.m_registers[type2][type1].destroyFcn = destroyFcn;\n this.m_registers[type2][type1].primary = false;\n }\n }\n b2ContactFactory.prototype.InitializeRegisters = function () {\n this.m_registers = new Vector(b2Shape.e_shapeTypeCount);\n for (var i = 0; i < b2Shape.e_shapeTypeCount; i++) {\n this.m_registers[i] = new Vector(b2Shape.e_shapeTypeCount);\n for (var j = 0; j < b2Shape.e_shapeTypeCount; j++) {\n this.m_registers[i][j] = new b2ContactRegister();\n }\n }\n this.AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);\n this.AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);\n this.AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);\n this.AddType(b2EdgeAndCircleContact.Create, b2EdgeAndCircleContact.Destroy, b2Shape.e_edgeShape, b2Shape.e_circleShape);\n this.AddType(b2PolyAndEdgeContact.Create, b2PolyAndEdgeContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_edgeShape);\n }\n b2ContactFactory.prototype.Create = function (fixtureA, fixtureB) {\n var type1 = parseInt(fixtureA.GetType());\n var type2 = parseInt(fixtureB.GetType());\n var reg = this.m_registers[type1][type2];\n var c;\n if (reg.pool) {\n c = reg.pool;\n reg.pool = c.m_next;\n reg.poolCount--;\n c.Reset(fixtureA, fixtureB);\n return c;\n }\n var createFcn = reg.createFcn;\n if (createFcn != null) {\n if (reg.primary) {\n c = createFcn(this.m_allocator);\n c.Reset(fixtureA, fixtureB);\n return c;\n }\n else {\n c = createFcn(this.m_allocator);\n c.Reset(fixtureB, fixtureA);\n return c;\n }\n }\n else {\n return null;\n }\n }\n b2ContactFactory.prototype.Destroy = function (contact) {\n if (contact.m_manifold.m_pointCount > 0) {\n contact.m_fixtureA.m_body.SetAwake(true);\n contact.m_fixtureB.m_body.SetAwake(true);\n }\n var type1 = parseInt(contact.m_fixtureA.GetType());\n var type2 = parseInt(contact.m_fixtureB.GetType());\n var reg = this.m_registers[type1][type2];\n if (true) {\n reg.poolCount++;\n contact.m_next = reg.pool;\n reg.pool = contact;\n }\n var destroyFcn = reg.destroyFcn;\n destroyFcn(contact, this.m_allocator);\n }\n b2ContactRegister.b2ContactRegister = function () {};\n b2ContactResult.b2ContactResult = function () {\n this.position = new b2Vec2();\n this.normal = new b2Vec2();\n this.id = new b2ContactID();\n };\n b2ContactSolver.b2ContactSolver = function () {\n this.m_step = new b2TimeStep();\n this.m_constraints = new Vector();\n };\n b2ContactSolver.prototype.b2ContactSolver = function () {}\n b2ContactSolver.prototype.Initialize = function (step, contacts, contactCount, allocator) {\n if (contactCount === undefined) contactCount = 0;\n var contact;\n this.m_step.Set(step);\n this.m_allocator = allocator;\n var i = 0;\n var tVec;\n var tMat;\n this.m_constraintCount = contactCount;\n while (this.m_constraints.length < this.m_constraintCount) {\n this.m_constraints[this.m_constraints.length] = new b2ContactConstraint();\n }\n for (i = 0;\n i < contactCount; ++i) {\n contact = contacts[i];\n var fixtureA = contact.m_fixtureA;\n var fixtureB = contact.m_fixtureB;\n var shapeA = fixtureA.m_shape;\n var shapeB = fixtureB.m_shape;\n var radiusA = shapeA.m_radius;\n var radiusB = shapeB.m_radius;\n var bodyA = fixtureA.m_body;\n var bodyB = fixtureB.m_body;\n var manifold = contact.GetManifold();\n var friction = b2Settings.b2MixFriction(fixtureA.GetFriction(), fixtureB.GetFriction());\n var restitution = b2Settings.b2MixRestitution(fixtureA.GetRestitution(), fixtureB.GetRestitution());\n var vAX = bodyA.m_linearVelocity.x;\n var vAY = bodyA.m_linearVelocity.y;\n var vBX = bodyB.m_linearVelocity.x;\n var vBY = bodyB.m_linearVelocity.y;\n var wA = bodyA.m_angularVelocity;\n var wB = bodyB.m_angularVelocity;\n b2Settings.b2Assert(manifold.m_pointCount > 0);\n b2ContactSolver.s_worldManifold.Initialize(manifold, bodyA.m_xf, radiusA, bodyB.m_xf, radiusB);\n var normalX = b2ContactSolver.s_worldManifold.m_normal.x;\n var normalY = b2ContactSolver.s_worldManifold.m_normal.y;\n var cc = this.m_constraints[i];\n cc.bodyA = bodyA;\n cc.bodyB = bodyB;\n cc.manifold = manifold;\n cc.normal.x = normalX;\n cc.normal.y = normalY;\n cc.pointCount = manifold.m_pointCount;\n cc.friction = friction;\n cc.restitution = restitution;\n cc.localPlaneNormal.x = manifold.m_localPlaneNormal.x;\n cc.localPlaneNormal.y = manifold.m_localPlaneNormal.y;\n cc.localPoint.x = manifold.m_localPoint.x;\n cc.localPoint.y = manifold.m_localPoint.y;\n cc.radius = radiusA + radiusB;\n cc.type = manifold.m_type;\n for (var k = 0; k < cc.pointCount; ++k) {\n var cp = manifold.m_points[k];\n var ccp = cc.points[k];\n ccp.normalImpulse = cp.m_normalImpulse;\n ccp.tangentImpulse = cp.m_tangentImpulse;\n ccp.localPoint.SetV(cp.m_localPoint);\n var rAX = ccp.rA.x = b2ContactSolver.s_worldManifold.m_points[k].x - bodyA.m_sweep.c.x;\n var rAY = ccp.rA.y = b2ContactSolver.s_worldManifold.m_points[k].y - bodyA.m_sweep.c.y;\n var rBX = ccp.rB.x = b2ContactSolver.s_worldManifold.m_points[k].x - bodyB.m_sweep.c.x;\n var rBY = ccp.rB.y = b2ContactSolver.s_worldManifold.m_points[k].y - bodyB.m_sweep.c.y;\n var rnA = rAX * normalY - rAY * normalX;\n var rnB = rBX * normalY - rBY * normalX;\n rnA *= rnA;\n rnB *= rnB;\n var kNormal = bodyA.m_invMass + bodyB.m_invMass + bodyA.m_invI * rnA + bodyB.m_invI * rnB;\n ccp.normalMass = 1.0 / kNormal;\n var kEqualized = bodyA.m_mass * bodyA.m_invMass + bodyB.m_mass * bodyB.m_invMass;\n kEqualized += bodyA.m_mass * bodyA.m_invI * rnA + bodyB.m_mass * bodyB.m_invI * rnB;\n ccp.equalizedMass = 1.0 / kEqualized;\n var tangentX = normalY;\n var tangentY = (-normalX);\n var rtA = rAX * tangentY - rAY * tangentX;\n var rtB = rBX * tangentY - rBY * tangentX;\n rtA *= rtA;\n rtB *= rtB;\n var kTangent = bodyA.m_invMass + bodyB.m_invMass + bodyA.m_invI * rtA + bodyB.m_invI * rtB;\n ccp.tangentMass = 1.0 / kTangent;\n ccp.velocityBias = 0.0;\n var tX = vBX + ((-wB * rBY)) - vAX - ((-wA * rAY));\n var tY = vBY + (wB * rBX) - vAY - (wA * rAX);\n var vRel = cc.normal.x * tX + cc.normal.y * tY;\n if (vRel < (-b2Settings.b2_velocityThreshold)) {\n ccp.velocityBias += (-cc.restitution * vRel);\n }\n }\n if (cc.pointCount == 2) {\n var ccp1 = cc.points[0];\n var ccp2 = cc.points[1];\n var invMassA = bodyA.m_invMass;\n var invIA = bodyA.m_invI;\n var invMassB = bodyB.m_invMass;\n var invIB = bodyB.m_invI;\n var rn1A = ccp1.rA.x * normalY - ccp1.rA.y * normalX;\n var rn1B = ccp1.rB.x * normalY - ccp1.rB.y * normalX;\n var rn2A = ccp2.rA.x * normalY - ccp2.rA.y * normalX;\n var rn2B = ccp2.rB.x * normalY - ccp2.rB.y * normalX;\n var k11 = invMassA + invMassB + invIA * rn1A * rn1A + invIB * rn1B * rn1B;\n var k22 = invMassA + invMassB + invIA * rn2A * rn2A + invIB * rn2B * rn2B;\n var k12 = invMassA + invMassB + invIA * rn1A * rn2A + invIB * rn1B * rn2B;\n var k_maxConditionNumber = 100.0;\n if (k11 * k11 < k_maxConditionNumber * (k11 * k22 - k12 * k12)) {\n cc.K.col1.Set(k11, k12);\n cc.K.col2.Set(k12, k22);\n cc.K.GetInverse(cc.normalMass);\n }\n else {\n cc.pointCount = 1;\n }\n }\n }\n }\n b2ContactSolver.prototype.InitVelocityConstraints = function (step) {\n var tVec;\n var tVec2;\n var tMat;\n for (var i = 0; i < this.m_constraintCount; ++i) {\n var c = this.m_constraints[i];\n var bodyA = c.bodyA;\n var bodyB = c.bodyB;\n var invMassA = bodyA.m_invMass;\n var invIA = bodyA.m_invI;\n var invMassB = bodyB.m_invMass;\n var invIB = bodyB.m_invI;\n var normalX = c.normal.x;\n var normalY = c.normal.y;\n var tangentX = normalY;\n var tangentY = (-normalX);\n var tX = 0;\n var j = 0;\n var tCount = 0;\n if (step.warmStarting) {\n tCount = c.pointCount;\n for (j = 0;\n j < tCount; ++j) {\n var ccp = c.points[j];\n ccp.normalImpulse *= step.dtRatio;\n ccp.tangentImpulse *= step.dtRatio;\n var PX = ccp.normalImpulse * normalX + ccp.tangentImpulse * tangentX;\n var PY = ccp.normalImpulse * normalY + ccp.tangentImpulse * tangentY;\n bodyA.m_angularVelocity -= invIA * (ccp.rA.x * PY - ccp.rA.y * PX);\n bodyA.m_linearVelocity.x -= invMassA * PX;\n bodyA.m_linearVelocity.y -= invMassA * PY;\n bodyB.m_angularVelocity += invIB * (ccp.rB.x * PY - ccp.rB.y * PX);\n bodyB.m_linearVelocity.x += invMassB * PX;\n bodyB.m_linearVelocity.y += invMassB * PY;\n }\n }\n else {\n tCount = c.pointCount;\n for (j = 0;\n j < tCount; ++j) {\n var ccp2 = c.points[j];\n ccp2.normalImpulse = 0.0;\n ccp2.tangentImpulse = 0.0;\n }\n }\n }\n }\n b2ContactSolver.prototype.SolveVelocityConstraints = function () {\n var j = 0;\n var ccp;\n var rAX = 0;\n var rAY = 0;\n var rBX = 0;\n var rBY = 0;\n var dvX = 0;\n var dvY = 0;\n var vn = 0;\n var vt = 0;\n var lambda = 0;\n var maxFriction = 0;\n var newImpulse = 0;\n var PX = 0;\n var PY = 0;\n var dX = 0;\n var dY = 0;\n var P1X = 0;\n var P1Y = 0;\n var P2X = 0;\n var P2Y = 0;\n var tMat;\n var tVec;\n for (var i = 0; i < this.m_constraintCount; ++i) {\n var c = this.m_constraints[i];\n var bodyA = c.bodyA;\n var bodyB = c.bodyB;\n var wA = bodyA.m_angularVelocity;\n var wB = bodyB.m_angularVelocity;\n var vA = bodyA.m_linearVelocity;\n var vB = bodyB.m_linearVelocity;\n var invMassA = bodyA.m_invMass;\n var invIA = bodyA.m_invI;\n var invMassB = bodyB.m_invMass;\n var invIB = bodyB.m_invI;\n var normalX = c.normal.x;\n var normalY = c.normal.y;\n var tangentX = normalY;\n var tangentY = (-normalX);\n var friction = c.friction;\n var tX = 0;\n for (j = 0;\n j < c.pointCount; j++) {\n ccp = c.points[j];\n dvX = vB.x - wB * ccp.rB.y - vA.x + wA * ccp.rA.y;\n dvY = vB.y + wB * ccp.rB.x - vA.y - wA * ccp.rA.x;\n vt = dvX * tangentX + dvY * tangentY;\n lambda = ccp.tangentMass * (-vt);\n maxFriction = friction * ccp.normalImpulse;\n newImpulse = b2Math.Clamp(ccp.tangentImpulse + lambda, (-maxFriction), maxFriction);\n lambda = newImpulse - ccp.tangentImpulse;\n PX = lambda * tangentX;\n PY = lambda * tangentY;\n vA.x -= invMassA * PX;\n vA.y -= invMassA * PY;\n wA -= invIA * (ccp.rA.x * PY - ccp.rA.y * PX);\n vB.x += invMassB * PX;\n vB.y += invMassB * PY;\n wB += invIB * (ccp.rB.x * PY - ccp.rB.y * PX);\n ccp.tangentImpulse = newImpulse;\n }\n var tCount = parseInt(c.pointCount);\n if (c.pointCount == 1) {\n ccp = c.points[0];\n dvX = vB.x + ((-wB * ccp.rB.y)) - vA.x - ((-wA * ccp.rA.y));\n dvY = vB.y + (wB * ccp.rB.x) - vA.y - (wA * ccp.rA.x);\n vn = dvX * normalX + dvY * normalY;\n lambda = (-ccp.normalMass * (vn - ccp.velocityBias));\n newImpulse = ccp.normalImpulse + lambda;\n newImpulse = newImpulse > 0 ? newImpulse : 0.0;\n lambda = newImpulse - ccp.normalImpulse;\n PX = lambda * normalX;\n PY = lambda * normalY;\n vA.x -= invMassA * PX;\n vA.y -= invMassA * PY;\n wA -= invIA * (ccp.rA.x * PY - ccp.rA.y * PX);\n vB.x += invMassB * PX;\n vB.y += invMassB * PY;\n wB += invIB * (ccp.rB.x * PY - ccp.rB.y * PX);\n ccp.normalImpulse = newImpulse;\n }\n else {\n var cp1 = c.points[0];\n var cp2 = c.points[1];\n var aX = cp1.normalImpulse;\n var aY = cp2.normalImpulse;\n var dv1X = vB.x - wB * cp1.rB.y - vA.x + wA * cp1.rA.y;\n var dv1Y = vB.y + wB * cp1.rB.x - vA.y - wA * cp1.rA.x;\n var dv2X = vB.x - wB * cp2.rB.y - vA.x + wA * cp2.rA.y;\n var dv2Y = vB.y + wB * cp2.rB.x - vA.y - wA * cp2.rA.x;\n var vn1 = dv1X * normalX + dv1Y * normalY;\n var vn2 = dv2X * normalX + dv2Y * normalY;\n var bX = vn1 - cp1.velocityBias;\n var bY = vn2 - cp2.velocityBias;\n tMat = c.K;\n bX -= tMat.col1.x * aX + tMat.col2.x * aY;\n bY -= tMat.col1.y * aX + tMat.col2.y * aY;\n var k_errorTol = 0.001;\n for (;;) {\n tMat = c.normalMass;\n var xX = (-(tMat.col1.x * bX + tMat.col2.x * bY));\n var xY = (-(tMat.col1.y * bX + tMat.col2.y * bY));\n if (xX >= 0.0 && xY >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n xX = (-cp1.normalMass * bX);\n xY = 0.0;\n vn1 = 0.0;\n vn2 = c.K.col1.y * xX + bY;\n if (xX >= 0.0 && vn2 >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n xX = 0.0;\n xY = (-cp2.normalMass * bY);\n vn1 = c.K.col2.x * xY + bX;\n vn2 = 0.0;\n if (xY >= 0.0 && vn1 >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n xX = 0.0;\n xY = 0.0;\n vn1 = bX;\n vn2 = bY;\n if (vn1 >= 0.0 && vn2 >= 0.0) {\n dX = xX - aX;\n dY = xY - aY;\n P1X = dX * normalX;\n P1Y = dX * normalY;\n P2X = dY * normalX;\n P2Y = dY * normalY;\n vA.x -= invMassA * (P1X + P2X);\n vA.y -= invMassA * (P1Y + P2Y);\n wA -= invIA * (cp1.rA.x * P1Y - cp1.rA.y * P1X + cp2.rA.x * P2Y - cp2.rA.y * P2X);\n vB.x += invMassB * (P1X + P2X);\n vB.y += invMassB * (P1Y + P2Y);\n wB += invIB * (cp1.rB.x * P1Y - cp1.rB.y * P1X + cp2.rB.x * P2Y - cp2.rB.y * P2X);\n cp1.normalImpulse = xX;\n cp2.normalImpulse = xY;\n break;\n }\n break;\n }\n }\n bodyA.m_angularVelocity = wA;\n bodyB.m_angularVelocity = wB;\n }\n }\n b2ContactSolver.prototype.FinalizeVelocityConstraints = function () {\n for (var i = 0; i < this.m_constraintCount; ++i) {\n var c = this.m_constraints[i];\n var m = c.manifold;\n for (var j = 0; j < c.pointCount; ++j) {\n var point1 = m.m_points[j];\n var point2 = c.points[j];\n point1.m_normalImpulse = point2.normalImpulse;\n point1.m_tangentImpulse = point2.tangentImpulse;\n }\n }\n }\n b2ContactSolver.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var minSeparation = 0.0;\n for (var i = 0; i < this.m_constraintCount; i++) {\n var c = this.m_constraints[i];\n var bodyA = c.bodyA;\n var bodyB = c.bodyB;\n var invMassA = bodyA.m_mass * bodyA.m_invMass;\n var invIA = bodyA.m_mass * bodyA.m_invI;\n var invMassB = bodyB.m_mass * bodyB.m_invMass;\n var invIB = bodyB.m_mass * bodyB.m_invI;\n b2ContactSolver.s_psm.Initialize(c);\n var normal = b2ContactSolver.s_psm.m_normal;\n for (var j = 0; j < c.pointCount; j++) {\n var ccp = c.points[j];\n var point = b2ContactSolver.s_psm.m_points[j];\n var separation = b2ContactSolver.s_psm.m_separations[j];\n var rAX = point.x - bodyA.m_sweep.c.x;\n var rAY = point.y - bodyA.m_sweep.c.y;\n var rBX = point.x - bodyB.m_sweep.c.x;\n var rBY = point.y - bodyB.m_sweep.c.y;\n minSeparation = minSeparation < separation ? minSeparation : separation;\n var C = b2Math.Clamp(baumgarte * (separation + b2Settings.b2_linearSlop), (-b2Settings.b2_maxLinearCorrection), 0.0);\n var impulse = (-ccp.equalizedMass * C);\n var PX = impulse * normal.x;\n var PY = impulse * normal.y;bodyA.m_sweep.c.x -= invMassA * PX;\n bodyA.m_sweep.c.y -= invMassA * PY;\n bodyA.m_sweep.a -= invIA * (rAX * PY - rAY * PX);\n bodyA.SynchronizeTransform();\n bodyB.m_sweep.c.x += invMassB * PX;\n bodyB.m_sweep.c.y += invMassB * PY;\n bodyB.m_sweep.a += invIB * (rBX * PY - rBY * PX);\n bodyB.SynchronizeTransform();\n }\n }\n return minSeparation > (-1.5 * b2Settings.b2_linearSlop);\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold = new b2WorldManifold();\n Box2D.Dynamics.Contacts.b2ContactSolver.prototype.s_worldManifold = Box2D.Dynamics.Contacts.b2ContactSolver.s_worldManifold;\n Box2D.Dynamics.Contacts.b2ContactSolver.s_psm = new b2PositionSolverManifold();\n Box2D.Dynamics.Contacts.b2ContactSolver.prototype.s_psm = Box2D.Dynamics.Contacts.b2ContactSolver.s_psm;\n });\n b2EdgeAndCircleContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2EdgeAndCircleContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2EdgeAndCircleContact.b2EdgeAndCircleContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2EdgeAndCircleContact.prototype.Create = function (allocator) {\n return new b2EdgeAndCircleContact();\n }\n b2EdgeAndCircleContact.Create = b2EdgeAndCircleContact.prototype.Create;\n b2EdgeAndCircleContact.prototype.Destroy = function (contact, allocator) {}\n b2EdgeAndCircleContact.Destroy = b2EdgeAndCircleContact.prototype.Destroy;\n b2EdgeAndCircleContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n }\n b2EdgeAndCircleContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n this.b2CollideEdgeAndCircle(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2EdgeShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2CircleShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2EdgeAndCircleContact.prototype.b2CollideEdgeAndCircle = function (manifold, edge, xf1, circle, xf2) {}\n b2NullContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2NullContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2NullContact.b2NullContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2NullContact.prototype.b2NullContact = function () {\n this.__super.b2Contact.call(this);\n }\n b2NullContact.prototype.Evaluate = function () {}\n b2PolyAndCircleContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2PolyAndCircleContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2PolyAndCircleContact.b2PolyAndCircleContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2PolyAndCircleContact.prototype.Create = function (allocator) {\n return new b2PolyAndCircleContact();\n }\n b2PolyAndCircleContact.Create = b2PolyAndCircleContact.prototype.Create;\n b2PolyAndCircleContact.prototype.Destroy = function (contact, allocator) {}\n b2PolyAndCircleContact.Destroy = b2PolyAndCircleContact.prototype.Destroy;\n b2PolyAndCircleContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n b2Settings.b2Assert(fixtureA.GetType() == b2Shape.e_polygonShape);\n b2Settings.b2Assert(fixtureB.GetType() == b2Shape.e_circleShape);\n }\n b2PolyAndCircleContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.m_body;\n var bB = this.m_fixtureB.m_body;\n b2Collision.CollidePolygonAndCircle(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2PolygonShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2CircleShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2PolyAndEdgeContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2PolyAndEdgeContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2PolyAndEdgeContact.b2PolyAndEdgeContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2PolyAndEdgeContact.prototype.Create = function (allocator) {\n return new b2PolyAndEdgeContact();\n }\n b2PolyAndEdgeContact.Create = b2PolyAndEdgeContact.prototype.Create;\n b2PolyAndEdgeContact.prototype.Destroy = function (contact, allocator) {}\n b2PolyAndEdgeContact.Destroy = b2PolyAndEdgeContact.prototype.Destroy;\n b2PolyAndEdgeContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n b2Settings.b2Assert(fixtureA.GetType() == b2Shape.e_polygonShape);\n b2Settings.b2Assert(fixtureB.GetType() == b2Shape.e_edgeShape);\n }\n b2PolyAndEdgeContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n this.b2CollidePolyAndEdge(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2PolygonShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2EdgeShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2PolyAndEdgeContact.prototype.b2CollidePolyAndEdge = function (manifold, polygon, xf1, edge, xf2) {}\n b2PolygonContact.inherit(Box2D.Dynamics.Contacts.b2Contact);\n b2PolygonContact.prototype.__super = Box2D.Dynamics.Contacts.b2Contact.prototype;\n b2PolygonContact.b2PolygonContact = function () {\n Box2D.Dynamics.Contacts.b2Contact.b2Contact.apply(this, arguments);\n };\n b2PolygonContact.prototype.Create = function (allocator) {\n return new b2PolygonContact();\n }\n b2PolygonContact.Create = b2PolygonContact.prototype.Create;\n b2PolygonContact.prototype.Destroy = function (contact, allocator) {}\n b2PolygonContact.Destroy = b2PolygonContact.prototype.Destroy;\n b2PolygonContact.prototype.Reset = function (fixtureA, fixtureB) {\n this.__super.Reset.call(this, fixtureA, fixtureB);\n }\n b2PolygonContact.prototype.Evaluate = function () {\n var bA = this.m_fixtureA.GetBody();\n var bB = this.m_fixtureB.GetBody();\n b2Collision.CollidePolygons(this.m_manifold, (this.m_fixtureA.GetShape() instanceof b2PolygonShape ? this.m_fixtureA.GetShape() : null), bA.m_xf, (this.m_fixtureB.GetShape() instanceof b2PolygonShape ? this.m_fixtureB.GetShape() : null), bB.m_xf);\n }\n b2PositionSolverManifold.b2PositionSolverManifold = function () {};\n b2PositionSolverManifold.prototype.b2PositionSolverManifold = function () {\n this.m_normal = new b2Vec2();\n this.m_separations = new Vector_a2j_Number(b2Settings.b2_maxManifoldPoints);\n this.m_points = new Vector(b2Settings.b2_maxManifoldPoints);\n for (var i = 0; i < b2Settings.b2_maxManifoldPoints; i++) {\n this.m_points[i] = new b2Vec2();\n }\n }\n b2PositionSolverManifold.prototype.Initialize = function (cc) {\n b2Settings.b2Assert(cc.pointCount > 0);\n var i = 0;\n var clipPointX = 0;\n var clipPointY = 0;\n var tMat;\n var tVec;\n var planePointX = 0;\n var planePointY = 0;\n switch (cc.type) {\n case b2Manifold.e_circles:\n {\n tMat = cc.bodyA.m_xf.R;\n tVec = cc.localPoint;\n var pointAX = cc.bodyA.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var pointAY = cc.bodyA.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = cc.bodyB.m_xf.R;\n tVec = cc.points[0].localPoint;\n var pointBX = cc.bodyB.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n var pointBY = cc.bodyB.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n var dX = pointBX - pointAX;\n var dY = pointBY - pointAY;\n var d2 = dX * dX + dY * dY;\n if (d2 > Number.MIN_VALUE * Number.MIN_VALUE) {\n var d = Math.sqrt(d2);\n this.m_normal.x = dX / d;\n this.m_normal.y = dY / d;\n }\n else {\n this.m_normal.x = 1.0;\n this.m_normal.y = 0.0;\n }\n this.m_points[0].x = 0.5 * (pointAX + pointBX);\n this.m_points[0].y = 0.5 * (pointAY + pointBY);\n this.m_separations[0] = dX * this.m_normal.x + dY * this.m_normal.y - cc.radius;\n }\n break;\n case b2Manifold.e_faceA:\n {\n tMat = cc.bodyA.m_xf.R;\n tVec = cc.localPlaneNormal;\n this.m_normal.x = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n this.m_normal.y = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = cc.bodyA.m_xf.R;\n tVec = cc.localPoint;\n planePointX = cc.bodyA.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n planePointY = cc.bodyA.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = cc.bodyB.m_xf.R;\n for (i = 0;\n i < cc.pointCount; ++i) {\n tVec = cc.points[i].localPoint;\n clipPointX = cc.bodyB.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n clipPointY = cc.bodyB.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_separations[i] = (clipPointX - planePointX) * this.m_normal.x + (clipPointY - planePointY) * this.m_normal.y - cc.radius;\n this.m_points[i].x = clipPointX;\n this.m_points[i].y = clipPointY;\n }\n }\n break;\n case b2Manifold.e_faceB:\n {\n tMat = cc.bodyB.m_xf.R;\n tVec = cc.localPlaneNormal;\n this.m_normal.x = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n this.m_normal.y = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = cc.bodyB.m_xf.R;\n tVec = cc.localPoint;\n planePointX = cc.bodyB.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n planePointY = cc.bodyB.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n tMat = cc.bodyA.m_xf.R;\n for (i = 0;\n i < cc.pointCount; ++i) {\n tVec = cc.points[i].localPoint;\n clipPointX = cc.bodyA.m_xf.position.x + (tMat.col1.x * tVec.x + tMat.col2.x * tVec.y);\n clipPointY = cc.bodyA.m_xf.position.y + (tMat.col1.y * tVec.x + tMat.col2.y * tVec.y);\n this.m_separations[i] = (clipPointX - planePointX) * this.m_normal.x + (clipPointY - planePointY) * this.m_normal.y - cc.radius;\n this.m_points[i].Set(clipPointX, clipPointY);\n }\n this.m_normal.x *= (-1);\n this.m_normal.y *= (-1);\n }\n break;\n }\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA = new b2Vec2();\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.prototype.circlePointA = Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointA;\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB = new b2Vec2();\n Box2D.Dynamics.Contacts.b2PositionSolverManifold.prototype.circlePointB = Box2D.Dynamics.Contacts.b2PositionSolverManifold.circlePointB;\n });\n})(); /* source: disabled*/\n(function () {\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2CircleShape = Box2D.Collision.Shapes.b2CircleShape;\n var b2EdgeChainDef = Box2D.Collision.Shapes.b2EdgeChainDef;\n var b2EdgeShape = Box2D.Collision.Shapes.b2EdgeShape;\n var b2MassData = Box2D.Collision.Shapes.b2MassData;\n var b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape;\n var b2Shape = Box2D.Collision.Shapes.b2Shape;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2BuoyancyController = Box2D.Dynamics.Controllers.b2BuoyancyController;\n var b2ConstantAccelController = Box2D.Dynamics.Controllers.b2ConstantAccelController;\n var b2ConstantForceController = Box2D.Dynamics.Controllers.b2ConstantForceController;\n var b2Controller = Box2D.Dynamics.Controllers.b2Controller;\n var b2ControllerEdge = Box2D.Dynamics.Controllers.b2ControllerEdge;\n var b2GravityController = Box2D.Dynamics.Controllers.b2GravityController;\n var b2TensorDampingController = Box2D.Dynamics.Controllers.b2TensorDampingController;\n b2BuoyancyController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2BuoyancyController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2BuoyancyController.b2BuoyancyController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.normal = new b2Vec2(0, (-1));\n this.offset = 0;\n this.density = 0;\n this.velocity = new b2Vec2(0, 0);\n this.linearDrag = 2;\n this.angularDrag = 1;\n this.useDensity = false;\n this.useWorldGravity = true;\n this.gravity = null;\n };\n b2BuoyancyController.prototype.Step = function (step) {\n if (!this.m_bodyList) return;\n if (this.useWorldGravity) {\n this.gravity = this.GetWorld().GetGravity().Copy();\n }\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (body.IsAwake() == false) {\n continue;\n }\n var areac = new b2Vec2();\n var massc = new b2Vec2();\n var area = 0.0;\n var mass = 0.0;\n for (var fixture = body.GetFixtureList(); fixture; fixture = fixture.GetNext()) {\n var sc = new b2Vec2();\n var sarea = fixture.GetShape().ComputeSubmergedArea(this.normal, this.offset, body.GetTransform(), sc);\n area += sarea;\n areac.x += sarea * sc.x;\n areac.y += sarea * sc.y;\n var shapeDensity = 0;\n if (this.useDensity) {\n shapeDensity = 1;\n }\n else {\n shapeDensity = 1;\n }\n mass += sarea * shapeDensity;\n massc.x += sarea * sc.x * shapeDensity;\n massc.y += sarea * sc.y * shapeDensity;\n }\n areac.x /= area;\n areac.y /= area;\n massc.x /= mass;\n massc.y /= mass;\n if (area < Number.MIN_VALUE) continue;\n var buoyancyForce = this.gravity.GetNegative();\n buoyancyForce.Multiply(this.density * area);\n body.ApplyForce(buoyancyForce, massc);\n var dragForce = body.GetLinearVelocityFromWorldPoint(areac);\n dragForce.Subtract(this.velocity);\n dragForce.Multiply((-this.linearDrag * area));\n body.ApplyForce(dragForce, areac);\n body.ApplyTorque((-body.GetInertia() / body.GetMass() * area * body.GetAngularVelocity() * this.angularDrag));\n }\n }\n b2BuoyancyController.prototype.Draw = function (debugDraw) {\n var r = 1000;\n var p1 = new b2Vec2();\n var p2 = new b2Vec2();\n p1.x = this.normal.x * this.offset + this.normal.y * r;\n p1.y = this.normal.y * this.offset - this.normal.x * r;\n p2.x = this.normal.x * this.offset - this.normal.y * r;\n p2.y = this.normal.y * this.offset + this.normal.x * r;\n var color = new b2Color(0, 0, 1);\n debugDraw.DrawSegment(p1, p2, color);\n }\n b2ConstantAccelController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2ConstantAccelController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2ConstantAccelController.b2ConstantAccelController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.A = new b2Vec2(0, 0);\n };\n b2ConstantAccelController.prototype.Step = function (step) {\n var smallA = new b2Vec2(this.A.x * step.dt, this.A.y * step.dt);\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (!body.IsAwake()) continue;\n body.SetLinearVelocity(new b2Vec2(body.GetLinearVelocity().x + smallA.x, body.GetLinearVelocity().y + smallA.y));\n }\n }\n b2ConstantForceController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2ConstantForceController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2ConstantForceController.b2ConstantForceController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.F = new b2Vec2(0, 0);\n };\n b2ConstantForceController.prototype.Step = function (step) {\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (!body.IsAwake()) continue;\n body.ApplyForce(this.F, body.GetWorldCenter());\n }\n }\n b2Controller.b2Controller = function () {};\n b2Controller.prototype.Step = function (step) {}\n b2Controller.prototype.Draw = function (debugDraw) {}\n b2Controller.prototype.AddBody = function (body) {\n var edge = new b2ControllerEdge();\n edge.controller = this;\n edge.body = body;\n edge.nextBody = this.m_bodyList;\n edge.prevBody = null;\n this.m_bodyList = edge;\n if (edge.nextBody) edge.nextBody.prevBody = edge;\n this.m_bodyCount++;\n edge.nextController = body.m_controllerList;\n edge.prevController = null;\n body.m_controllerList = edge;\n if (edge.nextController) edge.nextController.prevController = edge;\n body.m_controllerCount++;\n }\n b2Controller.prototype.RemoveBody = function (body) {\n var edge = body.m_controllerList;\n while (edge && edge.controller != this)\n edge = edge.nextController;\n if (edge.prevBody) edge.prevBody.nextBody = edge.nextBody;\n if (edge.nextBody) edge.nextBody.prevBody = edge.prevBody;\n if (edge.nextController) edge.nextController.prevController = edge.prevController;\n if (edge.prevController) edge.prevController.nextController = edge.nextController;\n if (this.m_bodyList == edge) this.m_bodyList = edge.nextBody;\n if (body.m_controllerList == edge) body.m_controllerList = edge.nextController;\n body.m_controllerCount--;\n this.m_bodyCount--;\n }\n b2Controller.prototype.Clear = function () {\n while (this.m_bodyList)\n this.RemoveBody(this.m_bodyList.body);\n }\n b2Controller.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Controller.prototype.GetWorld = function () {\n return this.m_world;\n }\n b2Controller.prototype.GetBodyList = function () {\n return this.m_bodyList;\n }\n b2ControllerEdge.b2ControllerEdge = function () {};\n b2GravityController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2GravityController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2GravityController.b2GravityController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.G = 1;\n this.invSqr = true;\n };\n b2GravityController.prototype.Step = function (step) {\n var i = null;\n var body1 = null;\n var p1 = null;\n var mass1 = 0;\n var j = null;\n var body2 = null;\n var p2 = null;\n var dx = 0;\n var dy = 0;\n var r2 = 0;\n var f = null;\n if (this.invSqr) {\n for (i = this.m_bodyList;\n i; i = i.nextBody) {\n body1 = i.body;\n p1 = body1.GetWorldCenter();\n mass1 = body1.GetMass();\n for (j = this.m_bodyList;\n j != i; j = j.nextBody) {\n body2 = j.body;\n p2 = body2.GetWorldCenter();\n dx = p2.x - p1.x;\n dy = p2.y - p1.y;\n r2 = dx * dx + dy * dy;\n if (r2 < Number.MIN_VALUE) continue;\n f = new b2Vec2(dx, dy);\n f.Multiply(this.G / r2 / Math.sqrt(r2) * mass1 * body2.GetMass());\n if (body1.IsAwake()) body1.ApplyForce(f, p1);\n f.Multiply((-1));\n if (body2.IsAwake()) body2.ApplyForce(f, p2);\n }\n }\n }\n else {\n for (i = this.m_bodyList;\n i; i = i.nextBody) {\n body1 = i.body;\n p1 = body1.GetWorldCenter();\n mass1 = body1.GetMass();\n for (j = this.m_bodyList;\n j != i; j = j.nextBody) {\n body2 = j.body;\n p2 = body2.GetWorldCenter();\n dx = p2.x - p1.x;\n dy = p2.y - p1.y;\n r2 = dx * dx + dy * dy;\n if (r2 < Number.MIN_VALUE) continue;\n f = new b2Vec2(dx, dy);\n f.Multiply(this.G / r2 * mass1 * body2.GetMass());\n if (body1.IsAwake()) body1.ApplyForce(f, p1);\n f.Multiply((-1));\n if (body2.IsAwake()) body2.ApplyForce(f, p2);\n }\n }\n }\n }\n b2TensorDampingController.inherit(Box2D.Dynamics.Controllers.b2Controller);\n b2TensorDampingController.prototype.__super = Box2D.Dynamics.Controllers.b2Controller.prototype;\n b2TensorDampingController.b2TensorDampingController = function () {\n Box2D.Dynamics.Controllers.b2Controller.b2Controller.apply(this, arguments);\n this.T = new b2Mat22();\n this.maxTimestep = 0;\n };\n b2TensorDampingController.prototype.SetAxisAligned = function (xDamping, yDamping) {\n if (xDamping === undefined) xDamping = 0;\n if (yDamping === undefined) yDamping = 0;\n this.T.col1.x = (-xDamping);\n this.T.col1.y = 0;\n this.T.col2.x = 0;\n this.T.col2.y = (-yDamping);\n if (xDamping > 0 || yDamping > 0) {\n this.maxTimestep = 1 / Math.max(xDamping, yDamping);\n }\n else {\n this.maxTimestep = 0;\n }\n }\n b2TensorDampingController.prototype.Step = function (step) {\n var timestep = step.dt;\n if (timestep <= Number.MIN_VALUE) return;\n if (timestep > this.maxTimestep && this.maxTimestep > 0) timestep = this.maxTimestep;\n for (var i = this.m_bodyList; i; i = i.nextBody) {\n var body = i.body;\n if (!body.IsAwake()) {\n continue;\n }\n var damping = body.GetWorldVector(b2Math.MulMV(this.T, body.GetLocalVector(body.GetLinearVelocity())));\n body.SetLinearVelocity(new b2Vec2(body.GetLinearVelocity().x + damping.x * timestep, body.GetLinearVelocity().y + damping.y * timestep));\n }\n }\n})(); /* source: disabled*/\n(function () {\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2Color = Box2D.Common.b2Color;\n var b2internal = Box2D.Common.b2internal;\n var b2Settings = Box2D.Common.b2Settings;\n var b2internal = Box2D.Common.b2internal;\n var b2Mat22 = Box2D.Common.Math.b2Mat22;\n var b2Mat33 = Box2D.Common.Math.b2Mat33;\n var b2Math = Box2D.Common.Math.b2Math;\n var b2Sweep = Box2D.Common.Math.b2Sweep;\n var b2Transform = Box2D.Common.Math.b2Transform;\n var b2Vec2 = Box2D.Common.Math.b2Vec2;\n var b2Vec3 = Box2D.Common.Math.b2Vec3;\n var b2DistanceJoint = Box2D.Dynamics.Joints.b2DistanceJoint;\n var b2DistanceJointDef = Box2D.Dynamics.Joints.b2DistanceJointDef;\n var b2FrictionJoint = Box2D.Dynamics.Joints.b2FrictionJoint;\n var b2FrictionJointDef = Box2D.Dynamics.Joints.b2FrictionJointDef;\n var b2GearJoint = Box2D.Dynamics.Joints.b2GearJoint;\n var b2GearJointDef = Box2D.Dynamics.Joints.b2GearJointDef;\n var b2Jacobian = Box2D.Dynamics.Joints.b2Jacobian;\n var b2Joint = Box2D.Dynamics.Joints.b2Joint;\n var b2JointDef = Box2D.Dynamics.Joints.b2JointDef;\n var b2JointEdge = Box2D.Dynamics.Joints.b2JointEdge;\n var b2LineJoint = Box2D.Dynamics.Joints.b2LineJoint;\n var b2LineJointDef = Box2D.Dynamics.Joints.b2LineJointDef;\n var b2MouseJoint = Box2D.Dynamics.Joints.b2MouseJoint;\n var b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;\n var b2PrismaticJoint = Box2D.Dynamics.Joints.b2PrismaticJoint;\n var b2PrismaticJointDef = Box2D.Dynamics.Joints.b2PrismaticJointDef;\n var b2PulleyJoint = Box2D.Dynamics.Joints.b2PulleyJoint;\n var b2PulleyJointDef = Box2D.Dynamics.Joints.b2PulleyJointDef;\n var b2RevoluteJoint = Box2D.Dynamics.Joints.b2RevoluteJoint;\n var b2RevoluteJointDef = Box2D.Dynamics.Joints.b2RevoluteJointDef;\n var b2WeldJoint = Box2D.Dynamics.Joints.b2WeldJoint;\n var b2WeldJointDef = Box2D.Dynamics.Joints.b2WeldJointDef;\n var b2Body = Box2D.Dynamics.b2Body;\n var b2BodyDef = Box2D.Dynamics.b2BodyDef;\n var b2ContactFilter = Box2D.Dynamics.b2ContactFilter;\n var b2ContactImpulse = Box2D.Dynamics.b2ContactImpulse;\n var b2ContactListener = Box2D.Dynamics.b2ContactListener;\n var b2ContactManager = Box2D.Dynamics.b2ContactManager;\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n var b2DestructionListener = Box2D.Dynamics.b2DestructionListener;\n var b2FilterData = Box2D.Dynamics.b2FilterData;\n var b2Fixture = Box2D.Dynamics.b2Fixture;\n var b2FixtureDef = Box2D.Dynamics.b2FixtureDef;\n var b2Island = Box2D.Dynamics.b2Island;\n var b2TimeStep = Box2D.Dynamics.b2TimeStep;\n var b2World = Box2D.Dynamics.b2World;\n var b2internal = Box2D.Common.b2internal;\n var b2DistanceJoint = Box2D.Dynamics.Joints.b2DistanceJoint;\n var b2DistanceJointDef = Box2D.Dynamics.Joints.b2DistanceJointDef;\n var b2FrictionJoint = Box2D.Dynamics.Joints.b2FrictionJoint;\n var b2FrictionJointDef = Box2D.Dynamics.Joints.b2FrictionJointDef;\n var b2GearJoint = Box2D.Dynamics.Joints.b2GearJoint;\n var b2GearJointDef = Box2D.Dynamics.Joints.b2GearJointDef;\n var b2Jacobian = Box2D.Dynamics.Joints.b2Jacobian;\n var b2Joint = Box2D.Dynamics.Joints.b2Joint;\n var b2JointDef = Box2D.Dynamics.Joints.b2JointDef;\n var b2JointEdge = Box2D.Dynamics.Joints.b2JointEdge;\n var b2LineJoint = Box2D.Dynamics.Joints.b2LineJoint;\n var b2LineJointDef = Box2D.Dynamics.Joints.b2LineJointDef;\n var b2MouseJoint = Box2D.Dynamics.Joints.b2MouseJoint;\n var b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;\n var b2PrismaticJoint = Box2D.Dynamics.Joints.b2PrismaticJoint;\n var b2PrismaticJointDef = Box2D.Dynamics.Joints.b2PrismaticJointDef;\n var b2PulleyJoint = Box2D.Dynamics.Joints.b2PulleyJoint;\n var b2PulleyJointDef = Box2D.Dynamics.Joints.b2PulleyJointDef;\n var b2RevoluteJoint = Box2D.Dynamics.Joints.b2RevoluteJoint;\n var b2RevoluteJointDef = Box2D.Dynamics.Joints.b2RevoluteJointDef;\n var b2WeldJoint = Box2D.Dynamics.Joints.b2WeldJoint;\n var b2WeldJointDef = Box2D.Dynamics.Joints.b2WeldJointDef;\n b2DistanceJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2DistanceJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2DistanceJoint.b2DistanceJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_u = new b2Vec2();\n };\n b2DistanceJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2DistanceJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2DistanceJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse * this.m_u.x, inv_dt * this.m_impulse * this.m_u.y);\n }\n b2DistanceJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2DistanceJoint.prototype.GetLength = function () {\n return this.m_length;\n }\n b2DistanceJoint.prototype.SetLength = function (length) {\n if (length === undefined) length = 0;\n this.m_length = length;\n }\n b2DistanceJoint.prototype.GetFrequency = function () {\n return this.m_frequencyHz;\n }\n b2DistanceJoint.prototype.SetFrequency = function (hz) {\n if (hz === undefined) hz = 0;\n this.m_frequencyHz = hz;\n }\n b2DistanceJoint.prototype.GetDampingRatio = function () {\n return this.m_dampingRatio;\n }\n b2DistanceJoint.prototype.SetDampingRatio = function (ratio) {\n if (ratio === undefined) ratio = 0;\n this.m_dampingRatio = ratio;\n }\n b2DistanceJoint.prototype.b2DistanceJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_length = def.length;\n this.m_frequencyHz = def.frequencyHz;\n this.m_dampingRatio = def.dampingRatio;\n this.m_impulse = 0.0;\n this.m_gamma = 0.0;\n this.m_bias = 0.0;\n }\n b2DistanceJoint.prototype.InitVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n this.m_u.x = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n this.m_u.y = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n var length = Math.sqrt(this.m_u.x * this.m_u.x + this.m_u.y * this.m_u.y);\n if (length > b2Settings.b2_linearSlop) {\n this.m_u.Multiply(1.0 / length);\n }\n else {\n this.m_u.SetZero();\n }\n var cr1u = (r1X * this.m_u.y - r1Y * this.m_u.x);\n var cr2u = (r2X * this.m_u.y - r2Y * this.m_u.x);\n var invMass = bA.m_invMass + bA.m_invI * cr1u * cr1u + bB.m_invMass + bB.m_invI * cr2u * cr2u;\n this.m_mass = invMass != 0.0 ? 1.0 / invMass : 0.0;\n if (this.m_frequencyHz > 0.0) {\n var C = length - this.m_length;\n var omega = 2.0 * Math.PI * this.m_frequencyHz;\n var d = 2.0 * this.m_mass * this.m_dampingRatio * omega;\n var k = this.m_mass * omega * omega;\n this.m_gamma = step.dt * (d + step.dt * k);\n this.m_gamma = this.m_gamma != 0.0 ? 1 / this.m_gamma : 0.0;\n this.m_bias = C * step.dt * k * this.m_gamma;\n this.m_mass = invMass + this.m_gamma;\n this.m_mass = this.m_mass != 0.0 ? 1.0 / this.m_mass : 0.0;\n }\n if (step.warmStarting) {\n this.m_impulse *= step.dtRatio;\n var PX = this.m_impulse * this.m_u.x;\n var PY = this.m_impulse * this.m_u.y;\n bA.m_linearVelocity.x -= bA.m_invMass * PX;\n bA.m_linearVelocity.y -= bA.m_invMass * PY;\n bA.m_angularVelocity -= bA.m_invI * (r1X * PY - r1Y * PX);\n bB.m_linearVelocity.x += bB.m_invMass * PX;\n bB.m_linearVelocity.y += bB.m_invMass * PY;\n bB.m_angularVelocity += bB.m_invI * (r2X * PY - r2Y * PX);\n }\n else {\n this.m_impulse = 0.0;\n }\n }\n b2DistanceJoint.prototype.SolveVelocityConstraints = function (step) {\n var tMat;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var v1X = bA.m_linearVelocity.x + ((-bA.m_angularVelocity * r1Y));\n var v1Y = bA.m_linearVelocity.y + (bA.m_angularVelocity * r1X);\n var v2X = bB.m_linearVelocity.x + ((-bB.m_angularVelocity * r2Y));\n var v2Y = bB.m_linearVelocity.y + (bB.m_angularVelocity * r2X);\n var Cdot = (this.m_u.x * (v2X - v1X) + this.m_u.y * (v2Y - v1Y));\n var impulse = (-this.m_mass * (Cdot + this.m_bias + this.m_gamma * this.m_impulse));\n this.m_impulse += impulse;\n var PX = impulse * this.m_u.x;\n var PY = impulse * this.m_u.y;\n bA.m_linearVelocity.x -= bA.m_invMass * PX;\n bA.m_linearVelocity.y -= bA.m_invMass * PY;\n bA.m_angularVelocity -= bA.m_invI * (r1X * PY - r1Y * PX);\n bB.m_linearVelocity.x += bB.m_invMass * PX;\n bB.m_linearVelocity.y += bB.m_invMass * PY;\n bB.m_angularVelocity += bB.m_invI * (r2X * PY - r2Y * PX);\n }\n b2DistanceJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var tMat;\n if (this.m_frequencyHz > 0.0) {\n return true;\n }\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var dY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n var length = Math.sqrt(dX * dX + dY * dY);\n dX /= length;\n dY /= length;\n var C = length - this.m_length;\n C = b2Math.Clamp(C, (-b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);\n var impulse = (-this.m_mass * C);\n this.m_u.Set(dX, dY);\n var PX = impulse * this.m_u.x;\n var PY = impulse * this.m_u.y;\n bA.m_sweep.c.x -= bA.m_invMass * PX;\n bA.m_sweep.c.y -= bA.m_invMass * PY;\n bA.m_sweep.a -= bA.m_invI * (r1X * PY - r1Y * PX);\n bB.m_sweep.c.x += bB.m_invMass * PX;\n bB.m_sweep.c.y += bB.m_invMass * PY;\n bB.m_sweep.a += bB.m_invI * (r2X * PY - r2Y * PX);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return b2Math.Abs(C) < b2Settings.b2_linearSlop;\n }\n b2DistanceJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2DistanceJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2DistanceJointDef.b2DistanceJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2DistanceJointDef.prototype.b2DistanceJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_distanceJoint;\n this.length = 1.0;\n this.frequencyHz = 0.0;\n this.dampingRatio = 0.0;\n }\n b2DistanceJointDef.prototype.Initialize = function (bA, bB, anchorA, anchorB) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchorA));\n this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchorB));\n var dX = anchorB.x - anchorA.x;\n var dY = anchorB.y - anchorA.y;\n this.length = Math.sqrt(dX * dX + dY * dY);\n this.frequencyHz = 0.0;\n this.dampingRatio = 0.0;\n }\n b2FrictionJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2FrictionJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2FrictionJoint.b2FrictionJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchorA = new b2Vec2();\n this.m_localAnchorB = new b2Vec2();\n this.m_linearMass = new b2Mat22();\n this.m_linearImpulse = new b2Vec2();\n };\n b2FrictionJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchorA);\n }\n b2FrictionJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchorB);\n }\n b2FrictionJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_linearImpulse.x, inv_dt * this.m_linearImpulse.y);\n }\n b2FrictionJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_angularImpulse;\n }\n b2FrictionJoint.prototype.SetMaxForce = function (force) {\n if (force === undefined) force = 0;\n this.m_maxForce = force;\n }\n b2FrictionJoint.prototype.GetMaxForce = function () {\n return this.m_maxForce;\n }\n b2FrictionJoint.prototype.SetMaxTorque = function (torque) {\n if (torque === undefined) torque = 0;\n this.m_maxTorque = torque;\n }\n b2FrictionJoint.prototype.GetMaxTorque = function () {\n return this.m_maxTorque;\n }\n b2FrictionJoint.prototype.b2FrictionJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_localAnchorA.SetV(def.localAnchorA);\n this.m_localAnchorB.SetV(def.localAnchorB);\n this.m_linearMass.SetZero();\n this.m_angularMass = 0.0;\n this.m_linearImpulse.SetZero();\n this.m_angularImpulse = 0.0;\n this.m_maxForce = def.maxForce;\n this.m_maxTorque = def.maxTorque;\n }\n b2FrictionJoint.prototype.InitVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n var K = new b2Mat22();\n K.col1.x = mA + mB;\n K.col2.x = 0.0;\n K.col1.y = 0.0;\n K.col2.y = mA + mB;\n K.col1.x += iA * rAY * rAY;\n K.col2.x += (-iA * rAX * rAY);\n K.col1.y += (-iA * rAX * rAY);\n K.col2.y += iA * rAX * rAX;\n K.col1.x += iB * rBY * rBY;\n K.col2.x += (-iB * rBX * rBY);\n K.col1.y += (-iB * rBX * rBY);\n K.col2.y += iB * rBX * rBX;\n K.GetInverse(this.m_linearMass);\n this.m_angularMass = iA + iB;\n if (this.m_angularMass > 0.0) {\n this.m_angularMass = 1.0 / this.m_angularMass;\n }\n if (step.warmStarting) {\n this.m_linearImpulse.x *= step.dtRatio;\n this.m_linearImpulse.y *= step.dtRatio;\n this.m_angularImpulse *= step.dtRatio;\n var P = this.m_linearImpulse;\n bA.m_linearVelocity.x -= mA * P.x;\n bA.m_linearVelocity.y -= mA * P.y;\n bA.m_angularVelocity -= iA * (rAX * P.y - rAY * P.x + this.m_angularImpulse);\n bB.m_linearVelocity.x += mB * P.x;\n bB.m_linearVelocity.y += mB * P.y;\n bB.m_angularVelocity += iB * (rBX * P.y - rBY * P.x + this.m_angularImpulse);\n }\n else {\n this.m_linearImpulse.SetZero();\n this.m_angularImpulse = 0.0;\n }\n }\n b2FrictionJoint.prototype.SolveVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var vA = bA.m_linearVelocity;\n var wA = bA.m_angularVelocity;\n var vB = bB.m_linearVelocity;\n var wB = bB.m_angularVelocity;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var maxImpulse = 0; {\n var Cdot = wB - wA;\n var impulse = (-this.m_angularMass * Cdot);\n var oldImpulse = this.m_angularImpulse;\n maxImpulse = step.dt * this.m_maxTorque;\n this.m_angularImpulse = b2Math.Clamp(this.m_angularImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_angularImpulse - oldImpulse;\n wA -= iA * impulse;\n wB += iB * impulse;\n } {\n var CdotX = vB.x - wB * rBY - vA.x + wA * rAY;\n var CdotY = vB.y + wB * rBX - vA.y - wA * rAX;\n var impulseV = b2Math.MulMV(this.m_linearMass, new b2Vec2((-CdotX), (-CdotY)));\n var oldImpulseV = this.m_linearImpulse.Copy();\n this.m_linearImpulse.Add(impulseV);\n maxImpulse = step.dt * this.m_maxForce;\n if (this.m_linearImpulse.LengthSquared() > maxImpulse * maxImpulse) {\n this.m_linearImpulse.Normalize();\n this.m_linearImpulse.Multiply(maxImpulse);\n }\n impulseV = b2Math.SubtractVV(this.m_linearImpulse, oldImpulseV);\n vA.x -= mA * impulseV.x;\n vA.y -= mA * impulseV.y;\n wA -= iA * (rAX * impulseV.y - rAY * impulseV.x);\n vB.x += mB * impulseV.x;\n vB.y += mB * impulseV.y;\n wB += iB * (rBX * impulseV.y - rBY * impulseV.x);\n }\n bA.m_angularVelocity = wA;\n bB.m_angularVelocity = wB;\n }\n b2FrictionJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n return true;\n }\n b2FrictionJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2FrictionJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2FrictionJointDef.b2FrictionJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2FrictionJointDef.prototype.b2FrictionJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_frictionJoint;\n this.maxForce = 0.0;\n this.maxTorque = 0.0;\n }\n b2FrictionJointDef.prototype.Initialize = function (bA, bB, anchor) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchor));\n this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchor));\n }\n b2GearJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2GearJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2GearJoint.b2GearJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_groundAnchor1 = new b2Vec2();\n this.m_groundAnchor2 = new b2Vec2();\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_J = new b2Jacobian();\n };\n b2GearJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2GearJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2GearJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse * this.m_J.linearB.x, inv_dt * this.m_impulse * this.m_J.linearB.y);\n }\n b2GearJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n var tMat = this.m_bodyB.m_xf.R;\n var rX = this.m_localAnchor1.x - this.m_bodyB.m_sweep.localCenter.x;\n var rY = this.m_localAnchor1.y - this.m_bodyB.m_sweep.localCenter.y;\n var tX = tMat.col1.x * rX + tMat.col2.x * rY;\n rY = tMat.col1.y * rX + tMat.col2.y * rY;\n rX = tX;\n var PX = this.m_impulse * this.m_J.linearB.x;\n var PY = this.m_impulse * this.m_J.linearB.y;\n return inv_dt * (this.m_impulse * this.m_J.angularB - rX * PY + rY * PX);\n }\n b2GearJoint.prototype.GetRatio = function () {\n return this.m_ratio;\n }\n b2GearJoint.prototype.SetRatio = function (ratio) {\n if (ratio === undefined) ratio = 0;\n this.m_ratio = ratio;\n }\n b2GearJoint.prototype.b2GearJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var type1 = parseInt(def.joint1.m_type);\n var type2 = parseInt(def.joint2.m_type);\n this.m_revolute1 = null;\n this.m_prismatic1 = null;\n this.m_revolute2 = null;\n this.m_prismatic2 = null;\n var coordinate1 = 0;\n var coordinate2 = 0;\n this.m_ground1 = def.joint1.GetBodyA();\n this.m_bodyA = def.joint1.GetBodyB();\n if (type1 == b2Joint.e_revoluteJoint) {\n this.m_revolute1 = (def.joint1 instanceof b2RevoluteJoint ? def.joint1 : null);\n this.m_groundAnchor1.SetV(this.m_revolute1.m_localAnchor1);\n this.m_localAnchor1.SetV(this.m_revolute1.m_localAnchor2);\n coordinate1 = this.m_revolute1.GetJointAngle();\n }\n else {\n this.m_prismatic1 = (def.joint1 instanceof b2PrismaticJoint ? def.joint1 : null);\n this.m_groundAnchor1.SetV(this.m_prismatic1.m_localAnchor1);\n this.m_localAnchor1.SetV(this.m_prismatic1.m_localAnchor2);\n coordinate1 = this.m_prismatic1.GetJointTranslation();\n }\n this.m_ground2 = def.joint2.GetBodyA();\n this.m_bodyB = def.joint2.GetBodyB();\n if (type2 == b2Joint.e_revoluteJoint) {\n this.m_revolute2 = (def.joint2 instanceof b2RevoluteJoint ? def.joint2 : null);\n this.m_groundAnchor2.SetV(this.m_revolute2.m_localAnchor1);\n this.m_localAnchor2.SetV(this.m_revolute2.m_localAnchor2);\n coordinate2 = this.m_revolute2.GetJointAngle();\n }\n else {\n this.m_prismatic2 = (def.joint2 instanceof b2PrismaticJoint ? def.joint2 : null);\n this.m_groundAnchor2.SetV(this.m_prismatic2.m_localAnchor1);\n this.m_localAnchor2.SetV(this.m_prismatic2.m_localAnchor2);\n coordinate2 = this.m_prismatic2.GetJointTranslation();\n }\n this.m_ratio = def.ratio;\n this.m_constant = coordinate1 + this.m_ratio * coordinate2;\n this.m_impulse = 0.0;\n }\n b2GearJoint.prototype.InitVelocityConstraints = function (step) {\n var g1 = this.m_ground1;\n var g2 = this.m_ground2;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var ugX = 0;\n var ugY = 0;\n var rX = 0;\n var rY = 0;\n var tMat;\n var tVec;\n var crug = 0;\n var tX = 0;\n var K = 0.0;\n this.m_J.SetZero();\n if (this.m_revolute1) {\n this.m_J.angularA = (-1.0);\n K += bA.m_invI;\n }\n else {\n tMat = g1.m_xf.R;\n tVec = this.m_prismatic1.m_localXAxis1;\n ugX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n ugY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = bA.m_xf.R;\n rX = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n rY = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = tMat.col1.x * rX + tMat.col2.x * rY;\n rY = tMat.col1.y * rX + tMat.col2.y * rY;\n rX = tX;\n crug = rX * ugY - rY * ugX;\n this.m_J.linearA.Set((-ugX), (-ugY));\n this.m_J.angularA = (-crug);\n K += bA.m_invMass + bA.m_invI * crug * crug;\n }\n if (this.m_revolute2) {\n this.m_J.angularB = (-this.m_ratio);\n K += this.m_ratio * this.m_ratio * bB.m_invI;\n }\n else {\n tMat = g2.m_xf.R;\n tVec = this.m_prismatic2.m_localXAxis1;\n ugX = tMat.col1.x * tVec.x + tMat.col2.x * tVec.y;\n ugY = tMat.col1.y * tVec.x + tMat.col2.y * tVec.y;\n tMat = bB.m_xf.R;\n rX = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n rY = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = tMat.col1.x * rX + tMat.col2.x * rY;\n rY = tMat.col1.y * rX + tMat.col2.y * rY;\n rX = tX;\n crug = rX * ugY - rY * ugX;\n this.m_J.linearB.Set((-this.m_ratio * ugX), (-this.m_ratio * ugY));\n this.m_J.angularB = (-this.m_ratio * crug);\n K += this.m_ratio * this.m_ratio * (bB.m_invMass + bB.m_invI * crug * crug);\n }\n this.m_mass = K > 0.0 ? 1.0 / K : 0.0;\n if (step.warmStarting) {\n bA.m_linearVelocity.x += bA.m_invMass * this.m_impulse * this.m_J.linearA.x;\n bA.m_linearVelocity.y += bA.m_invMass * this.m_impulse * this.m_J.linearA.y;\n bA.m_angularVelocity += bA.m_invI * this.m_impulse * this.m_J.angularA;\n bB.m_linearVelocity.x += bB.m_invMass * this.m_impulse * this.m_J.linearB.x;\n bB.m_linearVelocity.y += bB.m_invMass * this.m_impulse * this.m_J.linearB.y;\n bB.m_angularVelocity += bB.m_invI * this.m_impulse * this.m_J.angularB;\n }\n else {\n this.m_impulse = 0.0;\n }\n }\n b2GearJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var Cdot = this.m_J.Compute(bA.m_linearVelocity, bA.m_angularVelocity, bB.m_linearVelocity, bB.m_angularVelocity);\n var impulse = (-this.m_mass * Cdot);\n this.m_impulse += impulse;\n bA.m_linearVelocity.x += bA.m_invMass * impulse * this.m_J.linearA.x;\n bA.m_linearVelocity.y += bA.m_invMass * impulse * this.m_J.linearA.y;\n bA.m_angularVelocity += bA.m_invI * impulse * this.m_J.angularA;\n bB.m_linearVelocity.x += bB.m_invMass * impulse * this.m_J.linearB.x;\n bB.m_linearVelocity.y += bB.m_invMass * impulse * this.m_J.linearB.y;\n bB.m_angularVelocity += bB.m_invI * impulse * this.m_J.angularB;\n }\n b2GearJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var linearError = 0.0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var coordinate1 = 0;\n var coordinate2 = 0;\n if (this.m_revolute1) {\n coordinate1 = this.m_revolute1.GetJointAngle();\n }\n else {\n coordinate1 = this.m_prismatic1.GetJointTranslation();\n }\n if (this.m_revolute2) {\n coordinate2 = this.m_revolute2.GetJointAngle();\n }\n else {\n coordinate2 = this.m_prismatic2.GetJointTranslation();\n }\n var C = this.m_constant - (coordinate1 + this.m_ratio * coordinate2);\n var impulse = (-this.m_mass * C);\n bA.m_sweep.c.x += bA.m_invMass * impulse * this.m_J.linearA.x;\n bA.m_sweep.c.y += bA.m_invMass * impulse * this.m_J.linearA.y;\n bA.m_sweep.a += bA.m_invI * impulse * this.m_J.angularA;\n bB.m_sweep.c.x += bB.m_invMass * impulse * this.m_J.linearB.x;\n bB.m_sweep.c.y += bB.m_invMass * impulse * this.m_J.linearB.y;\n bB.m_sweep.a += bB.m_invI * impulse * this.m_J.angularB;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return linearError < b2Settings.b2_linearSlop;\n }\n b2GearJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2GearJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2GearJointDef.b2GearJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n };\n b2GearJointDef.prototype.b2GearJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_gearJoint;\n this.joint1 = null;\n this.joint2 = null;\n this.ratio = 1.0;\n }\n b2Jacobian.b2Jacobian = function () {\n this.linearA = new b2Vec2();\n this.linearB = new b2Vec2();\n };\n b2Jacobian.prototype.SetZero = function () {\n this.linearA.SetZero();\n this.angularA = 0.0;\n this.linearB.SetZero();\n this.angularB = 0.0;\n }\n b2Jacobian.prototype.Set = function (x1, a1, x2, a2) {\n if (a1 === undefined) a1 = 0;\n if (a2 === undefined) a2 = 0;\n this.linearA.SetV(x1);\n this.angularA = a1;\n this.linearB.SetV(x2);\n this.angularB = a2;\n }\n b2Jacobian.prototype.Compute = function (x1, a1, x2, a2) {\n if (a1 === undefined) a1 = 0;\n if (a2 === undefined) a2 = 0;\n return (this.linearA.x * x1.x + this.linearA.y * x1.y) + this.angularA * a1 + (this.linearB.x * x2.x + this.linearB.y * x2.y) + this.angularB * a2;\n }\n b2Joint.b2Joint = function () {\n this.m_edgeA = new b2JointEdge();\n this.m_edgeB = new b2JointEdge();\n this.m_localCenterA = new b2Vec2();\n this.m_localCenterB = new b2Vec2();\n };\n b2Joint.prototype.GetType = function () {\n return this.m_type;\n }\n b2Joint.prototype.GetAnchorA = function () {\n return null;\n }\n b2Joint.prototype.GetAnchorB = function () {\n return null;\n }\n b2Joint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return null;\n }\n b2Joint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2Joint.prototype.GetBodyA = function () {\n return this.m_bodyA;\n }\n b2Joint.prototype.GetBodyB = function () {\n return this.m_bodyB;\n }\n b2Joint.prototype.GetNext = function () {\n return this.m_next;\n }\n b2Joint.prototype.GetUserData = function () {\n return this.m_userData;\n }\n b2Joint.prototype.SetUserData = function (data) {\n this.m_userData = data;\n }\n b2Joint.prototype.IsActive = function () {\n return this.m_bodyA.IsActive() && this.m_bodyB.IsActive();\n }\n b2Joint.prototype.Create = function (def, allocator) {\n var joint = null;\n switch (def.type) {\n case b2Joint.e_distanceJoint:\n {\n joint = new b2DistanceJoint((def instanceof b2DistanceJointDef ? def : null));\n }\n break;\n case b2Joint.e_mouseJoint:\n {\n joint = new b2MouseJoint((def instanceof b2MouseJointDef ? def : null));\n }\n break;\n case b2Joint.e_prismaticJoint:\n {\n joint = new b2PrismaticJoint((def instanceof b2PrismaticJointDef ? def : null));\n }\n break;\n case b2Joint.e_revoluteJoint:\n {\n joint = new b2RevoluteJoint((def instanceof b2RevoluteJointDef ? def : null));\n }\n break;\n case b2Joint.e_pulleyJoint:\n {\n joint = new b2PulleyJoint((def instanceof b2PulleyJointDef ? def : null));\n }\n break;\n case b2Joint.e_gearJoint:\n {\n joint = new b2GearJoint((def instanceof b2GearJointDef ? def : null));\n }\n break;\n case b2Joint.e_lineJoint:\n {\n joint = new b2LineJoint((def instanceof b2LineJointDef ? def : null));\n }\n break;\n case b2Joint.e_weldJoint:\n {\n joint = new b2WeldJoint((def instanceof b2WeldJointDef ? def : null));\n }\n break;\n case b2Joint.e_frictionJoint:\n {\n joint = new b2FrictionJoint((def instanceof b2FrictionJointDef ? def : null));\n }\n break;\n default:\n break;\n }\n return joint;\n }\n b2Joint.Create = b2Joint.prototype.Create;\n b2Joint.prototype.Destroy = function (joint, allocator) {}\n b2Joint.Destroy = b2Joint.prototype.Destroy;\n b2Joint.prototype.b2Joint = function (def) {\n b2Settings.b2Assert(def.bodyA != def.bodyB);\n this.m_type = def.type;\n this.m_prev = null;\n this.m_next = null;\n this.m_bodyA = def.bodyA;\n this.m_bodyB = def.bodyB;\n this.m_collideConnected = def.collideConnected;\n this.m_islandFlag = false;\n this.m_userData = def.userData;\n }\n b2Joint.prototype.InitVelocityConstraints = function (step) {}\n b2Joint.prototype.SolveVelocityConstraints = function (step) {}\n b2Joint.prototype.FinalizeVelocityConstraints = function () {}\n b2Joint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n return false;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Joints.b2Joint.e_unknownJoint = 0;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_unknownJoint = Box2D.Dynamics.Joints.b2Joint.e_unknownJoint;\n Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint = 1;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_revoluteJoint = Box2D.Dynamics.Joints.b2Joint.e_revoluteJoint;\n Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint = 2;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_prismaticJoint = Box2D.Dynamics.Joints.b2Joint.e_prismaticJoint;\n Box2D.Dynamics.Joints.b2Joint.e_distanceJoint = 3;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_distanceJoint = Box2D.Dynamics.Joints.b2Joint.e_distanceJoint;\n Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint = 4;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_pulleyJoint = Box2D.Dynamics.Joints.b2Joint.e_pulleyJoint;\n Box2D.Dynamics.Joints.b2Joint.e_mouseJoint = 5;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_mouseJoint = Box2D.Dynamics.Joints.b2Joint.e_mouseJoint;\n Box2D.Dynamics.Joints.b2Joint.e_gearJoint = 6;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_gearJoint = Box2D.Dynamics.Joints.b2Joint.e_gearJoint;\n Box2D.Dynamics.Joints.b2Joint.e_lineJoint = 7;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_lineJoint = Box2D.Dynamics.Joints.b2Joint.e_lineJoint;\n Box2D.Dynamics.Joints.b2Joint.e_weldJoint = 8;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_weldJoint = Box2D.Dynamics.Joints.b2Joint.e_weldJoint;\n Box2D.Dynamics.Joints.b2Joint.e_frictionJoint = 9;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_frictionJoint = Box2D.Dynamics.Joints.b2Joint.e_frictionJoint;\n Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit = 0;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_inactiveLimit = Box2D.Dynamics.Joints.b2Joint.e_inactiveLimit;\n Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit = 1;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_atLowerLimit = Box2D.Dynamics.Joints.b2Joint.e_atLowerLimit;\n Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit = 2;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_atUpperLimit = Box2D.Dynamics.Joints.b2Joint.e_atUpperLimit;\n Box2D.Dynamics.Joints.b2Joint.e_equalLimits = 3;\n Box2D.Dynamics.Joints.b2Joint.prototype.e_equalLimits = Box2D.Dynamics.Joints.b2Joint.e_equalLimits;\n });\n b2JointDef.b2JointDef = function () {};\n b2JointDef.prototype.b2JointDef = function () {\n this.type = b2Joint.e_unknownJoint;\n this.userData = null;\n this.bodyA = null;\n this.bodyB = null;\n this.collideConnected = false;\n }\n b2JointEdge.b2JointEdge = function () {};\n b2LineJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2LineJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2LineJoint.b2LineJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_localXAxis1 = new b2Vec2();\n this.m_localYAxis1 = new b2Vec2();\n this.m_axis = new b2Vec2();\n this.m_perp = new b2Vec2();\n this.m_K = new b2Mat22();\n this.m_impulse = new b2Vec2();\n };\n b2LineJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2LineJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2LineJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * (this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.x), inv_dt * (this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.y));\n }\n b2LineJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.y;\n }\n b2LineJoint.prototype.GetJointTranslation = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var p1 = bA.GetWorldPoint(this.m_localAnchor1);\n var p2 = bB.GetWorldPoint(this.m_localAnchor2);\n var dX = p2.x - p1.x;\n var dY = p2.y - p1.y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var translation = axis.x * dX + axis.y * dY;\n return translation;\n }\n b2LineJoint.prototype.GetJointSpeed = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var p1X = bA.m_sweep.c.x + r1X;\n var p1Y = bA.m_sweep.c.y + r1Y;\n var p2X = bB.m_sweep.c.x + r2X;\n var p2Y = bB.m_sweep.c.y + r2Y;\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var v1 = bA.m_linearVelocity;\n var v2 = bB.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var w2 = bB.m_angularVelocity;\n var speed = (dX * ((-w1 * axis.y)) + dY * (w1 * axis.x)) + (axis.x * (((v2.x + ((-w2 * r2Y))) - v1.x) - ((-w1 * r1Y))) + axis.y * (((v2.y + (w2 * r2X)) - v1.y) - (w1 * r1X)));\n return speed;\n }\n b2LineJoint.prototype.IsLimitEnabled = function () {\n return this.m_enableLimit;\n }\n b2LineJoint.prototype.EnableLimit = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableLimit = flag;\n }\n b2LineJoint.prototype.GetLowerLimit = function () {\n return this.m_lowerTranslation;\n }\n b2LineJoint.prototype.GetUpperLimit = function () {\n return this.m_upperTranslation;\n }\n b2LineJoint.prototype.SetLimits = function (lower, upper) {\n if (lower === undefined) lower = 0;\n if (upper === undefined) upper = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_lowerTranslation = lower;\n this.m_upperTranslation = upper;\n }\n b2LineJoint.prototype.IsMotorEnabled = function () {\n return this.m_enableMotor;\n }\n b2LineJoint.prototype.EnableMotor = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableMotor = flag;\n }\n b2LineJoint.prototype.SetMotorSpeed = function (speed) {\n if (speed === undefined) speed = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_motorSpeed = speed;\n }\n b2LineJoint.prototype.GetMotorSpeed = function () {\n return this.m_motorSpeed;\n }\n b2LineJoint.prototype.SetMaxMotorForce = function (force) {\n if (force === undefined) force = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_maxMotorForce = force;\n }\n b2LineJoint.prototype.GetMaxMotorForce = function () {\n return this.m_maxMotorForce;\n }\n b2LineJoint.prototype.GetMotorForce = function () {\n return this.m_motorImpulse;\n }\n b2LineJoint.prototype.b2LineJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_localXAxis1.SetV(def.localAxisA);\n this.m_localYAxis1.x = (-this.m_localXAxis1.y);\n this.m_localYAxis1.y = this.m_localXAxis1.x;\n this.m_impulse.SetZero();\n this.m_motorMass = 0.0;\n this.m_motorImpulse = 0.0;\n this.m_lowerTranslation = def.lowerTranslation;\n this.m_upperTranslation = def.upperTranslation;\n this.m_maxMotorForce = def.maxMotorForce;\n this.m_motorSpeed = def.motorSpeed;\n this.m_enableLimit = def.enableLimit;\n this.m_enableMotor = def.enableMotor;\n this.m_limitState = this.e_inactiveLimit;\n this.m_axis.SetZero();\n this.m_perp.SetZero();\n }\n b2LineJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n this.m_localCenterA.SetV(bA.GetLocalCenter());\n this.m_localCenterB.SetV(bB.GetLocalCenter());\n var xf1 = bA.GetTransform();\n var xf2 = bB.GetTransform();\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var dY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n this.m_invMassA = bA.m_invMass;\n this.m_invMassB = bB.m_invMass;\n this.m_invIA = bA.m_invI;\n this.m_invIB = bB.m_invI; {\n this.m_axis.SetV(b2Math.MulMV(xf1.R, this.m_localXAxis1));\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n this.m_motorMass = this.m_invMassA + this.m_invMassB + this.m_invIA * this.m_a1 * this.m_a1 + this.m_invIB * this.m_a2 * this.m_a2;\n this.m_motorMass = this.m_motorMass > Number.MIN_VALUE ? 1.0 / this.m_motorMass : 0.0;\n } {\n this.m_perp.SetV(b2Math.MulMV(xf1.R, this.m_localYAxis1));\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var m1 = this.m_invMassA;\n var m2 = this.m_invMassB;\n var i1 = this.m_invIA;\n var i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n }\n if (this.m_enableLimit) {\n var jointTransition = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n this.m_limitState = this.e_equalLimits;\n }\n else if (jointTransition <= this.m_lowerTranslation) {\n if (this.m_limitState != this.e_atLowerLimit) {\n this.m_limitState = this.e_atLowerLimit;\n this.m_impulse.y = 0.0;\n }\n }\n else if (jointTransition >= this.m_upperTranslation) {\n if (this.m_limitState != this.e_atUpperLimit) {\n this.m_limitState = this.e_atUpperLimit;\n this.m_impulse.y = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n this.m_impulse.y = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n }\n if (this.m_enableMotor == false) {\n this.m_motorImpulse = 0.0;\n }\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_motorImpulse *= step.dtRatio;\n var PX = this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.x;\n var PY = this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.y) * this.m_axis.y;\n var L1 = this.m_impulse.x * this.m_s1 + (this.m_motorImpulse + this.m_impulse.y) * this.m_a1;\n var L2 = this.m_impulse.x * this.m_s2 + (this.m_motorImpulse + this.m_impulse.y) * this.m_a2;\n bA.m_linearVelocity.x -= this.m_invMassA * PX;\n bA.m_linearVelocity.y -= this.m_invMassA * PY;\n bA.m_angularVelocity -= this.m_invIA * L1;\n bB.m_linearVelocity.x += this.m_invMassB * PX;\n bB.m_linearVelocity.y += this.m_invMassB * PY;\n bB.m_angularVelocity += this.m_invIB * L2;\n }\n else {\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n }\n }\n b2LineJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var v1 = bA.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var v2 = bB.m_linearVelocity;\n var w2 = bB.m_angularVelocity;\n var PX = 0;\n var PY = 0;\n var L1 = 0;\n var L2 = 0;\n if (this.m_enableMotor && this.m_limitState != this.e_equalLimits) {\n var Cdot = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var impulse = this.m_motorMass * (this.m_motorSpeed - Cdot);\n var oldImpulse = this.m_motorImpulse;\n var maxImpulse = step.dt * this.m_maxMotorForce;\n this.m_motorImpulse = b2Math.Clamp(this.m_motorImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_motorImpulse - oldImpulse;\n PX = impulse * this.m_axis.x;\n PY = impulse * this.m_axis.y;\n L1 = impulse * this.m_a1;\n L2 = impulse * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n var Cdot1 = this.m_perp.x * (v2.x - v1.x) + this.m_perp.y * (v2.y - v1.y) + this.m_s2 * w2 - this.m_s1 * w1;\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n var Cdot2 = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var f1 = this.m_impulse.Copy();\n var df = this.m_K.Solve(new b2Vec2(), (-Cdot1), (-Cdot2));\n this.m_impulse.Add(df);\n if (this.m_limitState == this.e_atLowerLimit) {\n this.m_impulse.y = b2Math.Max(this.m_impulse.y, 0.0);\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n this.m_impulse.y = b2Math.Min(this.m_impulse.y, 0.0);\n }\n var b = (-Cdot1) - (this.m_impulse.y - f1.y) * this.m_K.col2.x;\n var f2r = 0;\n if (this.m_K.col1.x != 0.0) {\n f2r = b / this.m_K.col1.x + f1.x;\n }\n else {\n f2r = f1.x;\n }\n this.m_impulse.x = f2r;\n df.x = this.m_impulse.x - f1.x;\n df.y = this.m_impulse.y - f1.y;\n PX = df.x * this.m_perp.x + df.y * this.m_axis.x;\n PY = df.x * this.m_perp.y + df.y * this.m_axis.y;\n L1 = df.x * this.m_s1 + df.y * this.m_a1;\n L2 = df.x * this.m_s2 + df.y * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n else {\n var df2 = 0;\n if (this.m_K.col1.x != 0.0) {\n df2 = ((-Cdot1)) / this.m_K.col1.x;\n }\n else {\n df2 = 0.0;\n }\n this.m_impulse.x += df2;\n PX = df2 * this.m_perp.x;\n PY = df2 * this.m_perp.y;\n L1 = df2 * this.m_s1;\n L2 = df2 * this.m_s2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n bA.m_linearVelocity.SetV(v1);\n bA.m_angularVelocity = w1;\n bB.m_linearVelocity.SetV(v2);\n bB.m_angularVelocity = w2;\n }\n b2LineJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var limitC = 0;\n var oldLimitImpulse = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var c1 = bA.m_sweep.c;\n var a1 = bA.m_sweep.a;\n var c2 = bB.m_sweep.c;\n var a2 = bB.m_sweep.a;\n var tMat;\n var tX = 0;\n var m1 = 0;\n var m2 = 0;\n var i1 = 0;\n var i2 = 0;\n var linearError = 0.0;\n var angularError = 0.0;\n var active = false;\n var C2 = 0.0;\n var R1 = b2Mat22.FromAngle(a1);\n var R2 = b2Mat22.FromAngle(a2);\n tMat = R1;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = R2;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = c2.x + r2X - c1.x - r1X;\n var dY = c2.y + r2Y - c1.y - r1Y;\n if (this.m_enableLimit) {\n this.m_axis = b2Math.MulMV(R1, this.m_localXAxis1);\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n var translation = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n C2 = b2Math.Clamp(translation, (-b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);\n linearError = b2Math.Abs(translation);\n active = true;\n }\n else if (translation <= this.m_lowerTranslation) {\n C2 = b2Math.Clamp(translation - this.m_lowerTranslation + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n linearError = this.m_lowerTranslation - translation;\n active = true;\n }\n else if (translation >= this.m_upperTranslation) {\n C2 = b2Math.Clamp(translation - this.m_upperTranslation + b2Settings.b2_linearSlop, 0.0, b2Settings.b2_maxLinearCorrection);\n linearError = translation - this.m_upperTranslation;\n active = true;\n }\n }\n this.m_perp = b2Math.MulMV(R1, this.m_localYAxis1);\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var impulse = new b2Vec2();\n var C1 = this.m_perp.x * dX + this.m_perp.y * dY;\n linearError = b2Math.Max(linearError, b2Math.Abs(C1));\n angularError = 0.0;\n if (active) {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n this.m_K.Solve(impulse, (-C1), (-C2));\n }\n else {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n var k11 = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n var impulse1 = 0;\n if (k11 != 0.0) {\n impulse1 = ((-C1)) / k11;\n }\n else {\n impulse1 = 0.0;\n }\n impulse.x = impulse1;\n impulse.y = 0.0;\n }\n var PX = impulse.x * this.m_perp.x + impulse.y * this.m_axis.x;\n var PY = impulse.x * this.m_perp.y + impulse.y * this.m_axis.y;\n var L1 = impulse.x * this.m_s1 + impulse.y * this.m_a1;\n var L2 = impulse.x * this.m_s2 + impulse.y * this.m_a2;\n c1.x -= this.m_invMassA * PX;\n c1.y -= this.m_invMassA * PY;\n a1 -= this.m_invIA * L1;\n c2.x += this.m_invMassB * PX;\n c2.y += this.m_invMassB * PY;\n a2 += this.m_invIB * L2;\n bA.m_sweep.a = a1;\n bB.m_sweep.a = a2;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return linearError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n b2LineJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2LineJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2LineJointDef.b2LineJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n this.localAxisA = new b2Vec2();\n };\n b2LineJointDef.prototype.b2LineJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_lineJoint;\n this.localAxisA.Set(1.0, 0.0);\n this.enableLimit = false;\n this.lowerTranslation = 0.0;\n this.upperTranslation = 0.0;\n this.enableMotor = false;\n this.maxMotorForce = 0.0;\n this.motorSpeed = 0.0;\n }\n b2LineJointDef.prototype.Initialize = function (bA, bB, anchor, axis) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA = this.bodyA.GetLocalPoint(anchor);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchor);\n this.localAxisA = this.bodyA.GetLocalVector(axis);\n }\n b2MouseJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2MouseJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2MouseJoint.b2MouseJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.K = new b2Mat22();\n this.K1 = new b2Mat22();\n this.K2 = new b2Mat22();\n this.m_localAnchor = new b2Vec2();\n this.m_target = new b2Vec2();\n this.m_impulse = new b2Vec2();\n this.m_mass = new b2Mat22();\n this.m_C = new b2Vec2();\n };\n b2MouseJoint.prototype.GetAnchorA = function () {\n return this.m_target;\n }\n b2MouseJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor);\n }\n b2MouseJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse.x, inv_dt * this.m_impulse.y);\n }\n b2MouseJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2MouseJoint.prototype.GetTarget = function () {\n return this.m_target;\n }\n b2MouseJoint.prototype.SetTarget = function (target) {\n if (this.m_bodyB.IsAwake() == false) {\n this.m_bodyB.SetAwake(true);\n }\n this.m_target = target;\n }\n b2MouseJoint.prototype.GetMaxForce = function () {\n return this.m_maxForce;\n }\n b2MouseJoint.prototype.SetMaxForce = function (maxForce) {\n if (maxForce === undefined) maxForce = 0;\n this.m_maxForce = maxForce;\n }\n b2MouseJoint.prototype.GetFrequency = function () {\n return this.m_frequencyHz;\n }\n b2MouseJoint.prototype.SetFrequency = function (hz) {\n if (hz === undefined) hz = 0;\n this.m_frequencyHz = hz;\n }\n b2MouseJoint.prototype.GetDampingRatio = function () {\n return this.m_dampingRatio;\n }\n b2MouseJoint.prototype.SetDampingRatio = function (ratio) {\n if (ratio === undefined) ratio = 0;\n this.m_dampingRatio = ratio;\n }\n b2MouseJoint.prototype.b2MouseJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_target.SetV(def.target);\n var tX = this.m_target.x - this.m_bodyB.m_xf.position.x;\n var tY = this.m_target.y - this.m_bodyB.m_xf.position.y;\n var tMat = this.m_bodyB.m_xf.R;\n this.m_localAnchor.x = (tX * tMat.col1.x + tY * tMat.col1.y);\n this.m_localAnchor.y = (tX * tMat.col2.x + tY * tMat.col2.y);\n this.m_maxForce = def.maxForce;\n this.m_impulse.SetZero();\n this.m_frequencyHz = def.frequencyHz;\n this.m_dampingRatio = def.dampingRatio;\n this.m_beta = 0.0;\n this.m_gamma = 0.0;\n }\n b2MouseJoint.prototype.InitVelocityConstraints = function (step) {\n var b = this.m_bodyB;\n var mass = b.GetMass();\n var omega = 2.0 * Math.PI * this.m_frequencyHz;\n var d = 2.0 * mass * this.m_dampingRatio * omega;\n var k = mass * omega * omega;\n this.m_gamma = step.dt * (d + step.dt * k);\n this.m_gamma = this.m_gamma != 0 ? 1 / this.m_gamma : 0.0;\n this.m_beta = step.dt * k * this.m_gamma;\n var tMat;tMat = b.m_xf.R;\n var rX = this.m_localAnchor.x - b.m_sweep.localCenter.x;\n var rY = this.m_localAnchor.y - b.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * rX + tMat.col2.x * rY);rY = (tMat.col1.y * rX + tMat.col2.y * rY);\n rX = tX;\n var invMass = b.m_invMass;\n var invI = b.m_invI;this.K1.col1.x = invMass;\n this.K1.col2.x = 0.0;\n this.K1.col1.y = 0.0;\n this.K1.col2.y = invMass;\n this.K2.col1.x = invI * rY * rY;\n this.K2.col2.x = (-invI * rX * rY);\n this.K2.col1.y = (-invI * rX * rY);\n this.K2.col2.y = invI * rX * rX;\n this.K.SetM(this.K1);\n this.K.AddM(this.K2);\n this.K.col1.x += this.m_gamma;\n this.K.col2.y += this.m_gamma;\n this.K.GetInverse(this.m_mass);\n this.m_C.x = b.m_sweep.c.x + rX - this.m_target.x;\n this.m_C.y = b.m_sweep.c.y + rY - this.m_target.y;\n b.m_angularVelocity *= 0.98;\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n b.m_linearVelocity.x += invMass * this.m_impulse.x;\n b.m_linearVelocity.y += invMass * this.m_impulse.y;\n b.m_angularVelocity += invI * (rX * this.m_impulse.y - rY * this.m_impulse.x);\n }\n b2MouseJoint.prototype.SolveVelocityConstraints = function (step) {\n var b = this.m_bodyB;\n var tMat;\n var tX = 0;\n var tY = 0;\n tMat = b.m_xf.R;\n var rX = this.m_localAnchor.x - b.m_sweep.localCenter.x;\n var rY = this.m_localAnchor.y - b.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rX + tMat.col2.x * rY);\n rY = (tMat.col1.y * rX + tMat.col2.y * rY);\n rX = tX;\n var CdotX = b.m_linearVelocity.x + ((-b.m_angularVelocity * rY));\n var CdotY = b.m_linearVelocity.y + (b.m_angularVelocity * rX);\n tMat = this.m_mass;\n tX = CdotX + this.m_beta * this.m_C.x + this.m_gamma * this.m_impulse.x;\n tY = CdotY + this.m_beta * this.m_C.y + this.m_gamma * this.m_impulse.y;\n var impulseX = (-(tMat.col1.x * tX + tMat.col2.x * tY));\n var impulseY = (-(tMat.col1.y * tX + tMat.col2.y * tY));\n var oldImpulseX = this.m_impulse.x;\n var oldImpulseY = this.m_impulse.y;\n this.m_impulse.x += impulseX;\n this.m_impulse.y += impulseY;\n var maxImpulse = step.dt * this.m_maxForce;\n if (this.m_impulse.LengthSquared() > maxImpulse * maxImpulse) {\n this.m_impulse.Multiply(maxImpulse / this.m_impulse.Length());\n }\n impulseX = this.m_impulse.x - oldImpulseX;\n impulseY = this.m_impulse.y - oldImpulseY;\n b.m_linearVelocity.x += b.m_invMass * impulseX;\n b.m_linearVelocity.y += b.m_invMass * impulseY;\n b.m_angularVelocity += b.m_invI * (rX * impulseY - rY * impulseX);\n }\n b2MouseJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n return true;\n }\n b2MouseJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2MouseJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2MouseJointDef.b2MouseJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.target = new b2Vec2();\n };\n b2MouseJointDef.prototype.b2MouseJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_mouseJoint;\n this.maxForce = 0.0;\n this.frequencyHz = 5.0;\n this.dampingRatio = 0.7;\n }\n b2PrismaticJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2PrismaticJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2PrismaticJoint.b2PrismaticJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_localXAxis1 = new b2Vec2();\n this.m_localYAxis1 = new b2Vec2();\n this.m_axis = new b2Vec2();\n this.m_perp = new b2Vec2();\n this.m_K = new b2Mat33();\n this.m_impulse = new b2Vec3();\n };\n b2PrismaticJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2PrismaticJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2PrismaticJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * (this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.x), inv_dt * (this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.y));\n }\n b2PrismaticJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.y;\n }\n b2PrismaticJoint.prototype.GetJointTranslation = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var p1 = bA.GetWorldPoint(this.m_localAnchor1);\n var p2 = bB.GetWorldPoint(this.m_localAnchor2);\n var dX = p2.x - p1.x;\n var dY = p2.y - p1.y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var translation = axis.x * dX + axis.y * dY;\n return translation;\n }\n b2PrismaticJoint.prototype.GetJointSpeed = function () {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var p1X = bA.m_sweep.c.x + r1X;\n var p1Y = bA.m_sweep.c.y + r1Y;\n var p2X = bB.m_sweep.c.x + r2X;\n var p2Y = bB.m_sweep.c.y + r2Y;\n var dX = p2X - p1X;\n var dY = p2Y - p1Y;\n var axis = bA.GetWorldVector(this.m_localXAxis1);\n var v1 = bA.m_linearVelocity;\n var v2 = bB.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var w2 = bB.m_angularVelocity;\n var speed = (dX * ((-w1 * axis.y)) + dY * (w1 * axis.x)) + (axis.x * (((v2.x + ((-w2 * r2Y))) - v1.x) - ((-w1 * r1Y))) + axis.y * (((v2.y + (w2 * r2X)) - v1.y) - (w1 * r1X)));\n return speed;\n }\n b2PrismaticJoint.prototype.IsLimitEnabled = function () {\n return this.m_enableLimit;\n }\n b2PrismaticJoint.prototype.EnableLimit = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableLimit = flag;\n }\n b2PrismaticJoint.prototype.GetLowerLimit = function () {\n return this.m_lowerTranslation;\n }\n b2PrismaticJoint.prototype.GetUpperLimit = function () {\n return this.m_upperTranslation;\n }\n b2PrismaticJoint.prototype.SetLimits = function (lower, upper) {\n if (lower === undefined) lower = 0;\n if (upper === undefined) upper = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_lowerTranslation = lower;\n this.m_upperTranslation = upper;\n }\n b2PrismaticJoint.prototype.IsMotorEnabled = function () {\n return this.m_enableMotor;\n }\n b2PrismaticJoint.prototype.EnableMotor = function (flag) {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_enableMotor = flag;\n }\n b2PrismaticJoint.prototype.SetMotorSpeed = function (speed) {\n if (speed === undefined) speed = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_motorSpeed = speed;\n }\n b2PrismaticJoint.prototype.GetMotorSpeed = function () {\n return this.m_motorSpeed;\n }\n b2PrismaticJoint.prototype.SetMaxMotorForce = function (force) {\n if (force === undefined) force = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_maxMotorForce = force;\n }\n b2PrismaticJoint.prototype.GetMotorForce = function () {\n return this.m_motorImpulse;\n }\n b2PrismaticJoint.prototype.b2PrismaticJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_localXAxis1.SetV(def.localAxisA);\n this.m_localYAxis1.x = (-this.m_localXAxis1.y);\n this.m_localYAxis1.y = this.m_localXAxis1.x;\n this.m_refAngle = def.referenceAngle;\n this.m_impulse.SetZero();\n this.m_motorMass = 0.0;\n this.m_motorImpulse = 0.0;\n this.m_lowerTranslation = def.lowerTranslation;\n this.m_upperTranslation = def.upperTranslation;\n this.m_maxMotorForce = def.maxMotorForce;\n this.m_motorSpeed = def.motorSpeed;\n this.m_enableLimit = def.enableLimit;\n this.m_enableMotor = def.enableMotor;\n this.m_limitState = this.e_inactiveLimit;\n this.m_axis.SetZero();\n this.m_perp.SetZero();\n }\n b2PrismaticJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n this.m_localCenterA.SetV(bA.GetLocalCenter());\n this.m_localCenterB.SetV(bB.GetLocalCenter());\n var xf1 = bA.GetTransform();\n var xf2 = bB.GetTransform();\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var dY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n this.m_invMassA = bA.m_invMass;\n this.m_invMassB = bB.m_invMass;\n this.m_invIA = bA.m_invI;\n this.m_invIB = bB.m_invI; {\n this.m_axis.SetV(b2Math.MulMV(xf1.R, this.m_localXAxis1));\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n this.m_motorMass = this.m_invMassA + this.m_invMassB + this.m_invIA * this.m_a1 * this.m_a1 + this.m_invIB * this.m_a2 * this.m_a2;\n if (this.m_motorMass > Number.MIN_VALUE) this.m_motorMass = 1.0 / this.m_motorMass;\n } {\n this.m_perp.SetV(b2Math.MulMV(xf1.R, this.m_localYAxis1));\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var m1 = this.m_invMassA;\n var m2 = this.m_invMassB;\n var i1 = this.m_invIA;\n var i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 + i2 * this.m_s2;\n this.m_K.col1.z = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = i1 + i2;\n this.m_K.col2.z = i1 * this.m_a1 + i2 * this.m_a2;\n this.m_K.col3.x = this.m_K.col1.z;\n this.m_K.col3.y = this.m_K.col2.z;\n this.m_K.col3.z = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n }\n if (this.m_enableLimit) {\n var jointTransition = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n this.m_limitState = this.e_equalLimits;\n }\n else if (jointTransition <= this.m_lowerTranslation) {\n if (this.m_limitState != this.e_atLowerLimit) {\n this.m_limitState = this.e_atLowerLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else if (jointTransition >= this.m_upperTranslation) {\n if (this.m_limitState != this.e_atUpperLimit) {\n this.m_limitState = this.e_atUpperLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n }\n if (this.m_enableMotor == false) {\n this.m_motorImpulse = 0.0;\n }\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_motorImpulse *= step.dtRatio;\n var PX = this.m_impulse.x * this.m_perp.x + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.x;\n var PY = this.m_impulse.x * this.m_perp.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_axis.y;\n var L1 = this.m_impulse.x * this.m_s1 + this.m_impulse.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_a1;\n var L2 = this.m_impulse.x * this.m_s2 + this.m_impulse.y + (this.m_motorImpulse + this.m_impulse.z) * this.m_a2;\n bA.m_linearVelocity.x -= this.m_invMassA * PX;\n bA.m_linearVelocity.y -= this.m_invMassA * PY;\n bA.m_angularVelocity -= this.m_invIA * L1;\n bB.m_linearVelocity.x += this.m_invMassB * PX;\n bB.m_linearVelocity.y += this.m_invMassB * PY;\n bB.m_angularVelocity += this.m_invIB * L2;\n }\n else {\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n }\n }\n b2PrismaticJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var v1 = bA.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var v2 = bB.m_linearVelocity;\n var w2 = bB.m_angularVelocity;\n var PX = 0;\n var PY = 0;\n var L1 = 0;\n var L2 = 0;\n if (this.m_enableMotor && this.m_limitState != this.e_equalLimits) {\n var Cdot = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var impulse = this.m_motorMass * (this.m_motorSpeed - Cdot);\n var oldImpulse = this.m_motorImpulse;\n var maxImpulse = step.dt * this.m_maxMotorForce;\n this.m_motorImpulse = b2Math.Clamp(this.m_motorImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_motorImpulse - oldImpulse;\n PX = impulse * this.m_axis.x;\n PY = impulse * this.m_axis.y;\n L1 = impulse * this.m_a1;\n L2 = impulse * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n var Cdot1X = this.m_perp.x * (v2.x - v1.x) + this.m_perp.y * (v2.y - v1.y) + this.m_s2 * w2 - this.m_s1 * w1;\n var Cdot1Y = w2 - w1;\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n var Cdot2 = this.m_axis.x * (v2.x - v1.x) + this.m_axis.y * (v2.y - v1.y) + this.m_a2 * w2 - this.m_a1 * w1;\n var f1 = this.m_impulse.Copy();\n var df = this.m_K.Solve33(new b2Vec3(), (-Cdot1X), (-Cdot1Y), (-Cdot2));\n this.m_impulse.Add(df);\n if (this.m_limitState == this.e_atLowerLimit) {\n this.m_impulse.z = b2Math.Max(this.m_impulse.z, 0.0);\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n this.m_impulse.z = b2Math.Min(this.m_impulse.z, 0.0);\n }\n var bX = (-Cdot1X) - (this.m_impulse.z - f1.z) * this.m_K.col3.x;\n var bY = (-Cdot1Y) - (this.m_impulse.z - f1.z) * this.m_K.col3.y;\n var f2r = this.m_K.Solve22(new b2Vec2(), bX, bY);\n f2r.x += f1.x;\n f2r.y += f1.y;\n this.m_impulse.x = f2r.x;\n this.m_impulse.y = f2r.y;\n df.x = this.m_impulse.x - f1.x;\n df.y = this.m_impulse.y - f1.y;\n df.z = this.m_impulse.z - f1.z;\n PX = df.x * this.m_perp.x + df.z * this.m_axis.x;\n PY = df.x * this.m_perp.y + df.z * this.m_axis.y;\n L1 = df.x * this.m_s1 + df.y + df.z * this.m_a1;\n L2 = df.x * this.m_s2 + df.y + df.z * this.m_a2;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n else {\n var df2 = this.m_K.Solve22(new b2Vec2(), (-Cdot1X), (-Cdot1Y));\n this.m_impulse.x += df2.x;\n this.m_impulse.y += df2.y;\n PX = df2.x * this.m_perp.x;\n PY = df2.x * this.m_perp.y;\n L1 = df2.x * this.m_s1 + df2.y;\n L2 = df2.x * this.m_s2 + df2.y;\n v1.x -= this.m_invMassA * PX;\n v1.y -= this.m_invMassA * PY;\n w1 -= this.m_invIA * L1;\n v2.x += this.m_invMassB * PX;\n v2.y += this.m_invMassB * PY;\n w2 += this.m_invIB * L2;\n }\n bA.m_linearVelocity.SetV(v1);\n bA.m_angularVelocity = w1;\n bB.m_linearVelocity.SetV(v2);\n bB.m_angularVelocity = w2;\n }\n b2PrismaticJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var limitC = 0;\n var oldLimitImpulse = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var c1 = bA.m_sweep.c;\n var a1 = bA.m_sweep.a;\n var c2 = bB.m_sweep.c;\n var a2 = bB.m_sweep.a;\n var tMat;\n var tX = 0;\n var m1 = 0;\n var m2 = 0;\n var i1 = 0;\n var i2 = 0;\n var linearError = 0.0;\n var angularError = 0.0;\n var active = false;\n var C2 = 0.0;\n var R1 = b2Mat22.FromAngle(a1);\n var R2 = b2Mat22.FromAngle(a2);\n tMat = R1;\n var r1X = this.m_localAnchor1.x - this.m_localCenterA.x;\n var r1Y = this.m_localAnchor1.y - this.m_localCenterA.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = R2;\n var r2X = this.m_localAnchor2.x - this.m_localCenterB.x;\n var r2Y = this.m_localAnchor2.y - this.m_localCenterB.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var dX = c2.x + r2X - c1.x - r1X;\n var dY = c2.y + r2Y - c1.y - r1Y;\n if (this.m_enableLimit) {\n this.m_axis = b2Math.MulMV(R1, this.m_localXAxis1);\n this.m_a1 = (dX + r1X) * this.m_axis.y - (dY + r1Y) * this.m_axis.x;\n this.m_a2 = r2X * this.m_axis.y - r2Y * this.m_axis.x;\n var translation = this.m_axis.x * dX + this.m_axis.y * dY;\n if (b2Math.Abs(this.m_upperTranslation - this.m_lowerTranslation) < 2.0 * b2Settings.b2_linearSlop) {\n C2 = b2Math.Clamp(translation, (-b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);\n linearError = b2Math.Abs(translation);\n active = true;\n }\n else if (translation <= this.m_lowerTranslation) {\n C2 = b2Math.Clamp(translation - this.m_lowerTranslation + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n linearError = this.m_lowerTranslation - translation;\n active = true;\n }\n else if (translation >= this.m_upperTranslation) {\n C2 = b2Math.Clamp(translation - this.m_upperTranslation + b2Settings.b2_linearSlop, 0.0, b2Settings.b2_maxLinearCorrection);\n linearError = translation - this.m_upperTranslation;\n active = true;\n }\n }\n this.m_perp = b2Math.MulMV(R1, this.m_localYAxis1);\n this.m_s1 = (dX + r1X) * this.m_perp.y - (dY + r1Y) * this.m_perp.x;\n this.m_s2 = r2X * this.m_perp.y - r2Y * this.m_perp.x;\n var impulse = new b2Vec3();\n var C1X = this.m_perp.x * dX + this.m_perp.y * dY;\n var C1Y = a2 - a1 - this.m_refAngle;\n linearError = b2Math.Max(linearError, b2Math.Abs(C1X));\n angularError = b2Math.Abs(C1Y);\n if (active) {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n this.m_K.col1.x = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n this.m_K.col1.y = i1 * this.m_s1 + i2 * this.m_s2;\n this.m_K.col1.z = i1 * this.m_s1 * this.m_a1 + i2 * this.m_s2 * this.m_a2;\n this.m_K.col2.x = this.m_K.col1.y;\n this.m_K.col2.y = i1 + i2;\n this.m_K.col2.z = i1 * this.m_a1 + i2 * this.m_a2;\n this.m_K.col3.x = this.m_K.col1.z;\n this.m_K.col3.y = this.m_K.col2.z;\n this.m_K.col3.z = m1 + m2 + i1 * this.m_a1 * this.m_a1 + i2 * this.m_a2 * this.m_a2;\n this.m_K.Solve33(impulse, (-C1X), (-C1Y), (-C2));\n }\n else {\n m1 = this.m_invMassA;\n m2 = this.m_invMassB;\n i1 = this.m_invIA;\n i2 = this.m_invIB;\n var k11 = m1 + m2 + i1 * this.m_s1 * this.m_s1 + i2 * this.m_s2 * this.m_s2;\n var k12 = i1 * this.m_s1 + i2 * this.m_s2;\n var k22 = i1 + i2;\n this.m_K.col1.Set(k11, k12, 0.0);\n this.m_K.col2.Set(k12, k22, 0.0);\n var impulse1 = this.m_K.Solve22(new b2Vec2(), (-C1X), (-C1Y));\n impulse.x = impulse1.x;\n impulse.y = impulse1.y;\n impulse.z = 0.0;\n }\n var PX = impulse.x * this.m_perp.x + impulse.z * this.m_axis.x;\n var PY = impulse.x * this.m_perp.y + impulse.z * this.m_axis.y;\n var L1 = impulse.x * this.m_s1 + impulse.y + impulse.z * this.m_a1;\n var L2 = impulse.x * this.m_s2 + impulse.y + impulse.z * this.m_a2;\n c1.x -= this.m_invMassA * PX;\n c1.y -= this.m_invMassA * PY;\n a1 -= this.m_invIA * L1;\n c2.x += this.m_invMassB * PX;\n c2.y += this.m_invMassB * PY;\n a2 += this.m_invIB * L2;\n bA.m_sweep.a = a1;\n bB.m_sweep.a = a2;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return linearError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n b2PrismaticJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2PrismaticJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2PrismaticJointDef.b2PrismaticJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n this.localAxisA = new b2Vec2();\n };\n b2PrismaticJointDef.prototype.b2PrismaticJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_prismaticJoint;\n this.localAxisA.Set(1.0, 0.0);\n this.referenceAngle = 0.0;\n this.enableLimit = false;\n this.lowerTranslation = 0.0;\n this.upperTranslation = 0.0;\n this.enableMotor = false;\n this.maxMotorForce = 0.0;\n this.motorSpeed = 0.0;\n }\n b2PrismaticJointDef.prototype.Initialize = function (bA, bB, anchor, axis) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA = this.bodyA.GetLocalPoint(anchor);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchor);\n this.localAxisA = this.bodyA.GetLocalVector(axis);\n this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle();\n }\n b2PulleyJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2PulleyJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2PulleyJoint.b2PulleyJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_groundAnchor1 = new b2Vec2();\n this.m_groundAnchor2 = new b2Vec2();\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_u1 = new b2Vec2();\n this.m_u2 = new b2Vec2();\n };\n b2PulleyJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2PulleyJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2PulleyJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse * this.m_u2.x, inv_dt * this.m_impulse * this.m_u2.y);\n }\n b2PulleyJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return 0.0;\n }\n b2PulleyJoint.prototype.GetGroundAnchorA = function () {\n var a = this.m_ground.m_xf.position.Copy();\n a.Add(this.m_groundAnchor1);\n return a;\n }\n b2PulleyJoint.prototype.GetGroundAnchorB = function () {\n var a = this.m_ground.m_xf.position.Copy();\n a.Add(this.m_groundAnchor2);\n return a;\n }\n b2PulleyJoint.prototype.GetLength1 = function () {\n var p = this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n var sX = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x;\n var sY = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y;\n var dX = p.x - sX;\n var dY = p.y - sY;\n return Math.sqrt(dX * dX + dY * dY);\n }\n b2PulleyJoint.prototype.GetLength2 = function () {\n var p = this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n var sX = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x;\n var sY = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;\n var dX = p.x - sX;\n var dY = p.y - sY;\n return Math.sqrt(dX * dX + dY * dY);\n }\n b2PulleyJoint.prototype.GetRatio = function () {\n return this.m_ratio;\n }\n b2PulleyJoint.prototype.b2PulleyJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n var tMat;\n var tX = 0;\n var tY = 0;\n this.m_ground = this.m_bodyA.m_world.m_groundBody;\n this.m_groundAnchor1.x = def.groundAnchorA.x - this.m_ground.m_xf.position.x;\n this.m_groundAnchor1.y = def.groundAnchorA.y - this.m_ground.m_xf.position.y;\n this.m_groundAnchor2.x = def.groundAnchorB.x - this.m_ground.m_xf.position.x;\n this.m_groundAnchor2.y = def.groundAnchorB.y - this.m_ground.m_xf.position.y;\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_ratio = def.ratio;\n this.m_constant = def.lengthA + this.m_ratio * def.lengthB;\n this.m_maxLength1 = b2Math.Min(def.maxLengthA, this.m_constant - this.m_ratio * b2PulleyJoint.b2_minPulleyLength);\n this.m_maxLength2 = b2Math.Min(def.maxLengthB, (this.m_constant - b2PulleyJoint.b2_minPulleyLength) / this.m_ratio);\n this.m_impulse = 0.0;\n this.m_limitImpulse1 = 0.0;\n this.m_limitImpulse2 = 0.0;\n }\n b2PulleyJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var p1X = bA.m_sweep.c.x + r1X;\n var p1Y = bA.m_sweep.c.y + r1Y;\n var p2X = bB.m_sweep.c.x + r2X;\n var p2Y = bB.m_sweep.c.y + r2Y;\n var s1X = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x;\n var s1Y = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y;\n var s2X = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x;\n var s2Y = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;\n this.m_u1.Set(p1X - s1X, p1Y - s1Y);\n this.m_u2.Set(p2X - s2X, p2Y - s2Y);\n var length1 = this.m_u1.Length();\n var length2 = this.m_u2.Length();\n if (length1 > b2Settings.b2_linearSlop) {\n this.m_u1.Multiply(1.0 / length1);\n }\n else {\n this.m_u1.SetZero();\n }\n if (length2 > b2Settings.b2_linearSlop) {\n this.m_u2.Multiply(1.0 / length2);\n }\n else {\n this.m_u2.SetZero();\n }\n var C = this.m_constant - length1 - this.m_ratio * length2;\n if (C > 0.0) {\n this.m_state = this.e_inactiveLimit;\n this.m_impulse = 0.0;\n }\n else {\n this.m_state = this.e_atUpperLimit;\n }\n if (length1 < this.m_maxLength1) {\n this.m_limitState1 = this.e_inactiveLimit;\n this.m_limitImpulse1 = 0.0;\n }\n else {\n this.m_limitState1 = this.e_atUpperLimit;\n }\n if (length2 < this.m_maxLength2) {\n this.m_limitState2 = this.e_inactiveLimit;\n this.m_limitImpulse2 = 0.0;\n }\n else {\n this.m_limitState2 = this.e_atUpperLimit;\n }\n var cr1u1 = r1X * this.m_u1.y - r1Y * this.m_u1.x;\n var cr2u2 = r2X * this.m_u2.y - r2Y * this.m_u2.x;\n this.m_limitMass1 = bA.m_invMass + bA.m_invI * cr1u1 * cr1u1;\n this.m_limitMass2 = bB.m_invMass + bB.m_invI * cr2u2 * cr2u2;\n this.m_pulleyMass = this.m_limitMass1 + this.m_ratio * this.m_ratio * this.m_limitMass2;\n this.m_limitMass1 = 1.0 / this.m_limitMass1;\n this.m_limitMass2 = 1.0 / this.m_limitMass2;\n this.m_pulleyMass = 1.0 / this.m_pulleyMass;\n if (step.warmStarting) {\n this.m_impulse *= step.dtRatio;\n this.m_limitImpulse1 *= step.dtRatio;\n this.m_limitImpulse2 *= step.dtRatio;\n var P1X = ((-this.m_impulse) - this.m_limitImpulse1) * this.m_u1.x;\n var P1Y = ((-this.m_impulse) - this.m_limitImpulse1) * this.m_u1.y;\n var P2X = ((-this.m_ratio * this.m_impulse) - this.m_limitImpulse2) * this.m_u2.x;\n var P2Y = ((-this.m_ratio * this.m_impulse) - this.m_limitImpulse2) * this.m_u2.y;\n bA.m_linearVelocity.x += bA.m_invMass * P1X;\n bA.m_linearVelocity.y += bA.m_invMass * P1Y;\n bA.m_angularVelocity += bA.m_invI * (r1X * P1Y - r1Y * P1X);\n bB.m_linearVelocity.x += bB.m_invMass * P2X;\n bB.m_linearVelocity.y += bB.m_invMass * P2Y;\n bB.m_angularVelocity += bB.m_invI * (r2X * P2Y - r2Y * P2X);\n }\n else {\n this.m_impulse = 0.0;\n this.m_limitImpulse1 = 0.0;\n this.m_limitImpulse2 = 0.0;\n }\n }\n b2PulleyJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n var tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var v1X = 0;\n var v1Y = 0;\n var v2X = 0;\n var v2Y = 0;\n var P1X = 0;\n var P1Y = 0;\n var P2X = 0;\n var P2Y = 0;\n var Cdot = 0;\n var impulse = 0;\n var oldImpulse = 0;\n if (this.m_state == this.e_atUpperLimit) {\n v1X = bA.m_linearVelocity.x + ((-bA.m_angularVelocity * r1Y));\n v1Y = bA.m_linearVelocity.y + (bA.m_angularVelocity * r1X);\n v2X = bB.m_linearVelocity.x + ((-bB.m_angularVelocity * r2Y));\n v2Y = bB.m_linearVelocity.y + (bB.m_angularVelocity * r2X);\n Cdot = (-(this.m_u1.x * v1X + this.m_u1.y * v1Y)) - this.m_ratio * (this.m_u2.x * v2X + this.m_u2.y * v2Y);\n impulse = this.m_pulleyMass * ((-Cdot));\n oldImpulse = this.m_impulse;\n this.m_impulse = b2Math.Max(0.0, this.m_impulse + impulse);\n impulse = this.m_impulse - oldImpulse;\n P1X = (-impulse * this.m_u1.x);\n P1Y = (-impulse * this.m_u1.y);\n P2X = (-this.m_ratio * impulse * this.m_u2.x);\n P2Y = (-this.m_ratio * impulse * this.m_u2.y);\n bA.m_linearVelocity.x += bA.m_invMass * P1X;\n bA.m_linearVelocity.y += bA.m_invMass * P1Y;\n bA.m_angularVelocity += bA.m_invI * (r1X * P1Y - r1Y * P1X);\n bB.m_linearVelocity.x += bB.m_invMass * P2X;\n bB.m_linearVelocity.y += bB.m_invMass * P2Y;\n bB.m_angularVelocity += bB.m_invI * (r2X * P2Y - r2Y * P2X);\n }\n if (this.m_limitState1 == this.e_atUpperLimit) {\n v1X = bA.m_linearVelocity.x + ((-bA.m_angularVelocity * r1Y));\n v1Y = bA.m_linearVelocity.y + (bA.m_angularVelocity * r1X);\n Cdot = (-(this.m_u1.x * v1X + this.m_u1.y * v1Y));\n impulse = (-this.m_limitMass1 * Cdot);\n oldImpulse = this.m_limitImpulse1;\n this.m_limitImpulse1 = b2Math.Max(0.0, this.m_limitImpulse1 + impulse);\n impulse = this.m_limitImpulse1 - oldImpulse;\n P1X = (-impulse * this.m_u1.x);\n P1Y = (-impulse * this.m_u1.y);\n bA.m_linearVelocity.x += bA.m_invMass * P1X;\n bA.m_linearVelocity.y += bA.m_invMass * P1Y;\n bA.m_angularVelocity += bA.m_invI * (r1X * P1Y - r1Y * P1X);\n }\n if (this.m_limitState2 == this.e_atUpperLimit) {\n v2X = bB.m_linearVelocity.x + ((-bB.m_angularVelocity * r2Y));\n v2Y = bB.m_linearVelocity.y + (bB.m_angularVelocity * r2X);\n Cdot = (-(this.m_u2.x * v2X + this.m_u2.y * v2Y));\n impulse = (-this.m_limitMass2 * Cdot);\n oldImpulse = this.m_limitImpulse2;\n this.m_limitImpulse2 = b2Math.Max(0.0, this.m_limitImpulse2 + impulse);\n impulse = this.m_limitImpulse2 - oldImpulse;\n P2X = (-impulse * this.m_u2.x);\n P2Y = (-impulse * this.m_u2.y);\n bB.m_linearVelocity.x += bB.m_invMass * P2X;\n bB.m_linearVelocity.y += bB.m_invMass * P2Y;\n bB.m_angularVelocity += bB.m_invI * (r2X * P2Y - r2Y * P2X);\n }\n }\n b2PulleyJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var s1X = this.m_ground.m_xf.position.x + this.m_groundAnchor1.x;\n var s1Y = this.m_ground.m_xf.position.y + this.m_groundAnchor1.y;\n var s2X = this.m_ground.m_xf.position.x + this.m_groundAnchor2.x;\n var s2Y = this.m_ground.m_xf.position.y + this.m_groundAnchor2.y;\n var r1X = 0;\n var r1Y = 0;\n var r2X = 0;\n var r2Y = 0;\n var p1X = 0;\n var p1Y = 0;\n var p2X = 0;\n var p2Y = 0;\n var length1 = 0;\n var length2 = 0;\n var C = 0;\n var impulse = 0;\n var oldImpulse = 0;\n var oldLimitPositionImpulse = 0;\n var tX = 0;\n var linearError = 0.0;\n if (this.m_state == this.e_atUpperLimit) {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n p1X = bA.m_sweep.c.x + r1X;\n p1Y = bA.m_sweep.c.y + r1Y;\n p2X = bB.m_sweep.c.x + r2X;\n p2Y = bB.m_sweep.c.y + r2Y;\n this.m_u1.Set(p1X - s1X, p1Y - s1Y);\n this.m_u2.Set(p2X - s2X, p2Y - s2Y);\n length1 = this.m_u1.Length();\n length2 = this.m_u2.Length();\n if (length1 > b2Settings.b2_linearSlop) {\n this.m_u1.Multiply(1.0 / length1);\n }\n else {\n this.m_u1.SetZero();\n }\n if (length2 > b2Settings.b2_linearSlop) {\n this.m_u2.Multiply(1.0 / length2);\n }\n else {\n this.m_u2.SetZero();\n }\n C = this.m_constant - length1 - this.m_ratio * length2;\n linearError = b2Math.Max(linearError, (-C));\n C = b2Math.Clamp(C + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n impulse = (-this.m_pulleyMass * C);\n p1X = (-impulse * this.m_u1.x);\n p1Y = (-impulse * this.m_u1.y);\n p2X = (-this.m_ratio * impulse * this.m_u2.x);\n p2Y = (-this.m_ratio * impulse * this.m_u2.y);\n bA.m_sweep.c.x += bA.m_invMass * p1X;\n bA.m_sweep.c.y += bA.m_invMass * p1Y;\n bA.m_sweep.a += bA.m_invI * (r1X * p1Y - r1Y * p1X);\n bB.m_sweep.c.x += bB.m_invMass * p2X;\n bB.m_sweep.c.y += bB.m_invMass * p2Y;\n bB.m_sweep.a += bB.m_invI * (r2X * p2Y - r2Y * p2X);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n }\n if (this.m_limitState1 == this.e_atUpperLimit) {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n p1X = bA.m_sweep.c.x + r1X;\n p1Y = bA.m_sweep.c.y + r1Y;\n this.m_u1.Set(p1X - s1X, p1Y - s1Y);\n length1 = this.m_u1.Length();\n if (length1 > b2Settings.b2_linearSlop) {\n this.m_u1.x *= 1.0 / length1;\n this.m_u1.y *= 1.0 / length1;\n }\n else {\n this.m_u1.SetZero();\n }\n C = this.m_maxLength1 - length1;\n linearError = b2Math.Max(linearError, (-C));\n C = b2Math.Clamp(C + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n impulse = (-this.m_limitMass1 * C);\n p1X = (-impulse * this.m_u1.x);\n p1Y = (-impulse * this.m_u1.y);\n bA.m_sweep.c.x += bA.m_invMass * p1X;\n bA.m_sweep.c.y += bA.m_invMass * p1Y;\n bA.m_sweep.a += bA.m_invI * (r1X * p1Y - r1Y * p1X);\n bA.SynchronizeTransform();\n }\n if (this.m_limitState2 == this.e_atUpperLimit) {\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n p2X = bB.m_sweep.c.x + r2X;\n p2Y = bB.m_sweep.c.y + r2Y;\n this.m_u2.Set(p2X - s2X, p2Y - s2Y);\n length2 = this.m_u2.Length();\n if (length2 > b2Settings.b2_linearSlop) {\n this.m_u2.x *= 1.0 / length2;\n this.m_u2.y *= 1.0 / length2;\n }\n else {\n this.m_u2.SetZero();\n }\n C = this.m_maxLength2 - length2;\n linearError = b2Math.Max(linearError, (-C));\n C = b2Math.Clamp(C + b2Settings.b2_linearSlop, (-b2Settings.b2_maxLinearCorrection), 0.0);\n impulse = (-this.m_limitMass2 * C);\n p2X = (-impulse * this.m_u2.x);\n p2Y = (-impulse * this.m_u2.y);\n bB.m_sweep.c.x += bB.m_invMass * p2X;\n bB.m_sweep.c.y += bB.m_invMass * p2Y;\n bB.m_sweep.a += bB.m_invI * (r2X * p2Y - r2Y * p2X);\n bB.SynchronizeTransform();\n }\n return linearError < b2Settings.b2_linearSlop;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength = 2.0;\n Box2D.Dynamics.Joints.b2PulleyJoint.prototype.b2_minPulleyLength = Box2D.Dynamics.Joints.b2PulleyJoint.b2_minPulleyLength;\n });\n b2PulleyJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2PulleyJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2PulleyJointDef.b2PulleyJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.groundAnchorA = new b2Vec2();\n this.groundAnchorB = new b2Vec2();\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2PulleyJointDef.prototype.b2PulleyJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_pulleyJoint;\n this.groundAnchorA.Set((-1.0), 1.0);\n this.groundAnchorB.Set(1.0, 1.0);\n this.localAnchorA.Set((-1.0), 0.0);\n this.localAnchorB.Set(1.0, 0.0);\n this.lengthA = 0.0;\n this.maxLengthA = 0.0;\n this.lengthB = 0.0;\n this.maxLengthB = 0.0;\n this.ratio = 1.0;\n this.collideConnected = true;\n }\n b2PulleyJointDef.prototype.Initialize = function (bA, bB, gaA, gaB, anchorA, anchorB, r) {\n if (r === undefined) r = 0;\n this.bodyA = bA;\n this.bodyB = bB;\n this.groundAnchorA.SetV(gaA);\n this.groundAnchorB.SetV(gaB);\n this.localAnchorA = this.bodyA.GetLocalPoint(anchorA);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchorB);\n var d1X = anchorA.x - gaA.x;\n var d1Y = anchorA.y - gaA.y;\n this.lengthA = Math.sqrt(d1X * d1X + d1Y * d1Y);\n var d2X = anchorB.x - gaB.x;\n var d2Y = anchorB.y - gaB.y;\n this.lengthB = Math.sqrt(d2X * d2X + d2Y * d2Y);\n this.ratio = r;\n var C = this.lengthA + this.ratio * this.lengthB;\n this.maxLengthA = C - this.ratio * b2PulleyJoint.b2_minPulleyLength;\n this.maxLengthB = (C - b2PulleyJoint.b2_minPulleyLength) / this.ratio;\n }\n b2RevoluteJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2RevoluteJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2RevoluteJoint.b2RevoluteJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.K = new b2Mat22();\n this.K1 = new b2Mat22();\n this.K2 = new b2Mat22();\n this.K3 = new b2Mat22();\n this.impulse3 = new b2Vec3();\n this.impulse2 = new b2Vec2();\n this.reduced = new b2Vec2();\n this.m_localAnchor1 = new b2Vec2();\n this.m_localAnchor2 = new b2Vec2();\n this.m_impulse = new b2Vec3();\n this.m_mass = new b2Mat33();\n };\n b2RevoluteJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchor1);\n }\n b2RevoluteJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchor2);\n }\n b2RevoluteJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse.x, inv_dt * this.m_impulse.y);\n }\n b2RevoluteJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.z;\n }\n b2RevoluteJoint.prototype.GetJointAngle = function () {\n return this.m_bodyB.m_sweep.a - this.m_bodyA.m_sweep.a - this.m_referenceAngle;\n }\n b2RevoluteJoint.prototype.GetJointSpeed = function () {\n return this.m_bodyB.m_angularVelocity - this.m_bodyA.m_angularVelocity;\n }\n b2RevoluteJoint.prototype.IsLimitEnabled = function () {\n return this.m_enableLimit;\n }\n b2RevoluteJoint.prototype.EnableLimit = function (flag) {\n this.m_enableLimit = flag;\n }\n b2RevoluteJoint.prototype.GetLowerLimit = function () {\n return this.m_lowerAngle;\n }\n b2RevoluteJoint.prototype.GetUpperLimit = function () {\n return this.m_upperAngle;\n }\n b2RevoluteJoint.prototype.SetLimits = function (lower, upper) {\n if (lower === undefined) lower = 0;\n if (upper === undefined) upper = 0;\n this.m_lowerAngle = lower;\n this.m_upperAngle = upper;\n }\n b2RevoluteJoint.prototype.IsMotorEnabled = function () {\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n return this.m_enableMotor;\n }\n b2RevoluteJoint.prototype.EnableMotor = function (flag) {\n this.m_enableMotor = flag;\n }\n b2RevoluteJoint.prototype.SetMotorSpeed = function (speed) {\n if (speed === undefined) speed = 0;\n this.m_bodyA.SetAwake(true);\n this.m_bodyB.SetAwake(true);\n this.m_motorSpeed = speed;\n }\n b2RevoluteJoint.prototype.GetMotorSpeed = function () {\n return this.m_motorSpeed;\n }\n b2RevoluteJoint.prototype.SetMaxMotorTorque = function (torque) {\n if (torque === undefined) torque = 0;\n this.m_maxMotorTorque = torque;\n }\n b2RevoluteJoint.prototype.GetMotorTorque = function () {\n return this.m_maxMotorTorque;\n }\n b2RevoluteJoint.prototype.b2RevoluteJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_localAnchor1.SetV(def.localAnchorA);\n this.m_localAnchor2.SetV(def.localAnchorB);\n this.m_referenceAngle = def.referenceAngle;\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n this.m_lowerAngle = def.lowerAngle;\n this.m_upperAngle = def.upperAngle;\n this.m_maxMotorTorque = def.maxMotorTorque;\n this.m_motorSpeed = def.motorSpeed;\n this.m_enableLimit = def.enableLimit;\n this.m_enableMotor = def.enableMotor;\n this.m_limitState = this.e_inactiveLimit;\n }\n b2RevoluteJoint.prototype.InitVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n if (this.m_enableMotor || this.m_enableLimit) {}\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var m1 = bA.m_invMass;\n var m2 = bB.m_invMass;\n var i1 = bA.m_invI;\n var i2 = bB.m_invI;\n this.m_mass.col1.x = m1 + m2 + r1Y * r1Y * i1 + r2Y * r2Y * i2;\n this.m_mass.col2.x = (-r1Y * r1X * i1) - r2Y * r2X * i2;\n this.m_mass.col3.x = (-r1Y * i1) - r2Y * i2;\n this.m_mass.col1.y = this.m_mass.col2.x;\n this.m_mass.col2.y = m1 + m2 + r1X * r1X * i1 + r2X * r2X * i2;\n this.m_mass.col3.y = r1X * i1 + r2X * i2;\n this.m_mass.col1.z = this.m_mass.col3.x;\n this.m_mass.col2.z = this.m_mass.col3.y;\n this.m_mass.col3.z = i1 + i2;\n this.m_motorMass = 1.0 / (i1 + i2);\n if (this.m_enableMotor == false) {\n this.m_motorImpulse = 0.0;\n }\n if (this.m_enableLimit) {\n var jointAngle = bB.m_sweep.a - bA.m_sweep.a - this.m_referenceAngle;\n if (b2Math.Abs(this.m_upperAngle - this.m_lowerAngle) < 2.0 * b2Settings.b2_angularSlop) {\n this.m_limitState = this.e_equalLimits;\n }\n else if (jointAngle <= this.m_lowerAngle) {\n if (this.m_limitState != this.e_atLowerLimit) {\n this.m_impulse.z = 0.0;\n }\n this.m_limitState = this.e_atLowerLimit;\n }\n else if (jointAngle >= this.m_upperAngle) {\n if (this.m_limitState != this.e_atUpperLimit) {\n this.m_impulse.z = 0.0;\n }\n this.m_limitState = this.e_atUpperLimit;\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n this.m_impulse.z = 0.0;\n }\n }\n else {\n this.m_limitState = this.e_inactiveLimit;\n }\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_motorImpulse *= step.dtRatio;\n var PX = this.m_impulse.x;\n var PY = this.m_impulse.y;\n bA.m_linearVelocity.x -= m1 * PX;\n bA.m_linearVelocity.y -= m1 * PY;\n bA.m_angularVelocity -= i1 * ((r1X * PY - r1Y * PX) + this.m_motorImpulse + this.m_impulse.z);\n bB.m_linearVelocity.x += m2 * PX;\n bB.m_linearVelocity.y += m2 * PY;\n bB.m_angularVelocity += i2 * ((r2X * PY - r2Y * PX) + this.m_motorImpulse + this.m_impulse.z);\n }\n else {\n this.m_impulse.SetZero();\n this.m_motorImpulse = 0.0;\n }\n }\n b2RevoluteJoint.prototype.SolveVelocityConstraints = function (step) {\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var tMat;\n var tX = 0;\n var newImpulse = 0;\n var r1X = 0;\n var r1Y = 0;\n var r2X = 0;\n var r2Y = 0;\n var v1 = bA.m_linearVelocity;\n var w1 = bA.m_angularVelocity;\n var v2 = bB.m_linearVelocity;\n var w2 = bB.m_angularVelocity;\n var m1 = bA.m_invMass;\n var m2 = bB.m_invMass;\n var i1 = bA.m_invI;\n var i2 = bB.m_invI;\n if (this.m_enableMotor && this.m_limitState != this.e_equalLimits) {\n var Cdot = w2 - w1 - this.m_motorSpeed;\n var impulse = this.m_motorMass * ((-Cdot));\n var oldImpulse = this.m_motorImpulse;\n var maxImpulse = step.dt * this.m_maxMotorTorque;\n this.m_motorImpulse = b2Math.Clamp(this.m_motorImpulse + impulse, (-maxImpulse), maxImpulse);\n impulse = this.m_motorImpulse - oldImpulse;\n w1 -= i1 * impulse;\n w2 += i2 * impulse;\n }\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var Cdot1X = v2.x + ((-w2 * r2Y)) - v1.x - ((-w1 * r1Y));\n var Cdot1Y = v2.y + (w2 * r2X) - v1.y - (w1 * r1X);\n var Cdot2 = w2 - w1;\n this.m_mass.Solve33(this.impulse3, (-Cdot1X), (-Cdot1Y), (-Cdot2));\n if (this.m_limitState == this.e_equalLimits) {\n this.m_impulse.Add(this.impulse3);\n }\n else if (this.m_limitState == this.e_atLowerLimit) {\n newImpulse = this.m_impulse.z + this.impulse3.z;\n if (newImpulse < 0.0) {\n this.m_mass.Solve22(this.reduced, (-Cdot1X), (-Cdot1Y));\n this.impulse3.x = this.reduced.x;\n this.impulse3.y = this.reduced.y;\n this.impulse3.z = (-this.m_impulse.z);\n this.m_impulse.x += this.reduced.x;\n this.m_impulse.y += this.reduced.y;\n this.m_impulse.z = 0.0;\n }\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n newImpulse = this.m_impulse.z + this.impulse3.z;\n if (newImpulse > 0.0) {\n this.m_mass.Solve22(this.reduced, (-Cdot1X), (-Cdot1Y));\n this.impulse3.x = this.reduced.x;\n this.impulse3.y = this.reduced.y;\n this.impulse3.z = (-this.m_impulse.z);\n this.m_impulse.x += this.reduced.x;\n this.m_impulse.y += this.reduced.y;\n this.m_impulse.z = 0.0;\n }\n }\n v1.x -= m1 * this.impulse3.x;\n v1.y -= m1 * this.impulse3.y;\n w1 -= i1 * (r1X * this.impulse3.y - r1Y * this.impulse3.x + this.impulse3.z);\n v2.x += m2 * this.impulse3.x;\n v2.y += m2 * this.impulse3.y;\n w2 += i2 * (r2X * this.impulse3.y - r2Y * this.impulse3.x + this.impulse3.z);\n }\n else {\n tMat = bA.m_xf.R;\n r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var CdotX = v2.x + ((-w2 * r2Y)) - v1.x - ((-w1 * r1Y));\n var CdotY = v2.y + (w2 * r2X) - v1.y - (w1 * r1X);\n this.m_mass.Solve22(this.impulse2, (-CdotX), (-CdotY));\n this.m_impulse.x += this.impulse2.x;\n this.m_impulse.y += this.impulse2.y;\n v1.x -= m1 * this.impulse2.x;\n v1.y -= m1 * this.impulse2.y;\n w1 -= i1 * (r1X * this.impulse2.y - r1Y * this.impulse2.x);\n v2.x += m2 * this.impulse2.x;\n v2.y += m2 * this.impulse2.y;\n w2 += i2 * (r2X * this.impulse2.y - r2Y * this.impulse2.x);\n }\n bA.m_linearVelocity.SetV(v1);\n bA.m_angularVelocity = w1;\n bB.m_linearVelocity.SetV(v2);\n bB.m_angularVelocity = w2;\n }\n b2RevoluteJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var oldLimitImpulse = 0;\n var C = 0;\n var tMat;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var angularError = 0.0;\n var positionError = 0.0;\n var tX = 0;\n var impulseX = 0;\n var impulseY = 0;\n if (this.m_enableLimit && this.m_limitState != this.e_inactiveLimit) {\n var angle = bB.m_sweep.a - bA.m_sweep.a - this.m_referenceAngle;\n var limitImpulse = 0.0;\n if (this.m_limitState == this.e_equalLimits) {\n C = b2Math.Clamp(angle - this.m_lowerAngle, (-b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);\n limitImpulse = (-this.m_motorMass * C);\n angularError = b2Math.Abs(C);\n }\n else if (this.m_limitState == this.e_atLowerLimit) {\n C = angle - this.m_lowerAngle;\n angularError = (-C);\n C = b2Math.Clamp(C + b2Settings.b2_angularSlop, (-b2Settings.b2_maxAngularCorrection), 0.0);\n limitImpulse = (-this.m_motorMass * C);\n }\n else if (this.m_limitState == this.e_atUpperLimit) {\n C = angle - this.m_upperAngle;\n angularError = C;\n C = b2Math.Clamp(C - b2Settings.b2_angularSlop, 0.0, b2Settings.b2_maxAngularCorrection);\n limitImpulse = (-this.m_motorMass * C);\n }\n bA.m_sweep.a -= bA.m_invI * limitImpulse;\n bB.m_sweep.a += bB.m_invI * limitImpulse;\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n } {\n tMat = bA.m_xf.R;\n var r1X = this.m_localAnchor1.x - bA.m_sweep.localCenter.x;\n var r1Y = this.m_localAnchor1.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r1X + tMat.col2.x * r1Y);\n r1Y = (tMat.col1.y * r1X + tMat.col2.y * r1Y);\n r1X = tX;\n tMat = bB.m_xf.R;\n var r2X = this.m_localAnchor2.x - bB.m_sweep.localCenter.x;\n var r2Y = this.m_localAnchor2.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * r2X + tMat.col2.x * r2Y);\n r2Y = (tMat.col1.y * r2X + tMat.col2.y * r2Y);\n r2X = tX;\n var CX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n var CY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n var CLengthSquared = CX * CX + CY * CY;\n var CLength = Math.sqrt(CLengthSquared);\n positionError = CLength;\n var invMass1 = bA.m_invMass;\n var invMass2 = bB.m_invMass;\n var invI1 = bA.m_invI;\n var invI2 = bB.m_invI;\n var k_allowedStretch = 10.0 * b2Settings.b2_linearSlop;\n if (CLengthSquared > k_allowedStretch * k_allowedStretch) {\n var uX = CX / CLength;\n var uY = CY / CLength;\n var k = invMass1 + invMass2;\n var m = 1.0 / k;\n impulseX = m * ((-CX));\n impulseY = m * ((-CY));\n var k_beta = 0.5;\n bA.m_sweep.c.x -= k_beta * invMass1 * impulseX;\n bA.m_sweep.c.y -= k_beta * invMass1 * impulseY;\n bB.m_sweep.c.x += k_beta * invMass2 * impulseX;\n bB.m_sweep.c.y += k_beta * invMass2 * impulseY;\n CX = bB.m_sweep.c.x + r2X - bA.m_sweep.c.x - r1X;\n CY = bB.m_sweep.c.y + r2Y - bA.m_sweep.c.y - r1Y;\n }\n this.K1.col1.x = invMass1 + invMass2;\n this.K1.col2.x = 0.0;\n this.K1.col1.y = 0.0;\n this.K1.col2.y = invMass1 + invMass2;\n this.K2.col1.x = invI1 * r1Y * r1Y;\n this.K2.col2.x = (-invI1 * r1X * r1Y);\n this.K2.col1.y = (-invI1 * r1X * r1Y);\n this.K2.col2.y = invI1 * r1X * r1X;\n this.K3.col1.x = invI2 * r2Y * r2Y;\n this.K3.col2.x = (-invI2 * r2X * r2Y);\n this.K3.col1.y = (-invI2 * r2X * r2Y);\n this.K3.col2.y = invI2 * r2X * r2X;\n this.K.SetM(this.K1);\n this.K.AddM(this.K2);\n this.K.AddM(this.K3);\n this.K.Solve(b2RevoluteJoint.tImpulse, (-CX), (-CY));\n impulseX = b2RevoluteJoint.tImpulse.x;\n impulseY = b2RevoluteJoint.tImpulse.y;\n bA.m_sweep.c.x -= bA.m_invMass * impulseX;\n bA.m_sweep.c.y -= bA.m_invMass * impulseY;\n bA.m_sweep.a -= bA.m_invI * (r1X * impulseY - r1Y * impulseX);\n bB.m_sweep.c.x += bB.m_invMass * impulseX;\n bB.m_sweep.c.y += bB.m_invMass * impulseY;\n bB.m_sweep.a += bB.m_invI * (r2X * impulseY - r2Y * impulseX);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n }\n return positionError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse = new b2Vec2();\n Box2D.Dynamics.Joints.b2RevoluteJoint.prototype.tImpulse = Box2D.Dynamics.Joints.b2RevoluteJoint.tImpulse;\n });\n b2RevoluteJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2RevoluteJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2RevoluteJointDef.b2RevoluteJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2RevoluteJointDef.prototype.b2RevoluteJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_revoluteJoint;\n this.localAnchorA.Set(0.0, 0.0);\n this.localAnchorB.Set(0.0, 0.0);\n this.referenceAngle = 0.0;\n this.lowerAngle = 0.0;\n this.upperAngle = 0.0;\n this.maxMotorTorque = 0.0;\n this.motorSpeed = 0.0;\n this.enableLimit = false;\n this.enableMotor = false;\n }\n b2RevoluteJointDef.prototype.Initialize = function (bA, bB, anchor) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA = this.bodyA.GetLocalPoint(anchor);\n this.localAnchorB = this.bodyB.GetLocalPoint(anchor);\n this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle();\n }\n b2WeldJoint.inherit(Box2D.Dynamics.Joints.b2Joint);\n b2WeldJoint.prototype.__super = Box2D.Dynamics.Joints.b2Joint.prototype;\n b2WeldJoint.b2WeldJoint = function () {\n Box2D.Dynamics.Joints.b2Joint.b2Joint.apply(this, arguments);\n this.m_localAnchorA = new b2Vec2();\n this.m_localAnchorB = new b2Vec2();\n this.m_impulse = new b2Vec3();\n this.m_mass = new b2Mat33();\n };\n b2WeldJoint.prototype.GetAnchorA = function () {\n return this.m_bodyA.GetWorldPoint(this.m_localAnchorA);\n }\n b2WeldJoint.prototype.GetAnchorB = function () {\n return this.m_bodyB.GetWorldPoint(this.m_localAnchorB);\n }\n b2WeldJoint.prototype.GetReactionForce = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return new b2Vec2(inv_dt * this.m_impulse.x, inv_dt * this.m_impulse.y);\n }\n b2WeldJoint.prototype.GetReactionTorque = function (inv_dt) {\n if (inv_dt === undefined) inv_dt = 0;\n return inv_dt * this.m_impulse.z;\n }\n b2WeldJoint.prototype.b2WeldJoint = function (def) {\n this.__super.b2Joint.call(this, def);\n this.m_localAnchorA.SetV(def.localAnchorA);\n this.m_localAnchorB.SetV(def.localAnchorB);\n this.m_referenceAngle = def.referenceAngle;\n this.m_impulse.SetZero();\n this.m_mass = new b2Mat33();\n }\n b2WeldJoint.prototype.InitVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n this.m_mass.col1.x = mA + mB + rAY * rAY * iA + rBY * rBY * iB;\n this.m_mass.col2.x = (-rAY * rAX * iA) - rBY * rBX * iB;\n this.m_mass.col3.x = (-rAY * iA) - rBY * iB;\n this.m_mass.col1.y = this.m_mass.col2.x;\n this.m_mass.col2.y = mA + mB + rAX * rAX * iA + rBX * rBX * iB;\n this.m_mass.col3.y = rAX * iA + rBX * iB;\n this.m_mass.col1.z = this.m_mass.col3.x;\n this.m_mass.col2.z = this.m_mass.col3.y;\n this.m_mass.col3.z = iA + iB;\n if (step.warmStarting) {\n this.m_impulse.x *= step.dtRatio;\n this.m_impulse.y *= step.dtRatio;\n this.m_impulse.z *= step.dtRatio;\n bA.m_linearVelocity.x -= mA * this.m_impulse.x;\n bA.m_linearVelocity.y -= mA * this.m_impulse.y;\n bA.m_angularVelocity -= iA * (rAX * this.m_impulse.y - rAY * this.m_impulse.x + this.m_impulse.z);\n bB.m_linearVelocity.x += mB * this.m_impulse.x;\n bB.m_linearVelocity.y += mB * this.m_impulse.y;\n bB.m_angularVelocity += iB * (rBX * this.m_impulse.y - rBY * this.m_impulse.x + this.m_impulse.z);\n }\n else {\n this.m_impulse.SetZero();\n }\n }\n b2WeldJoint.prototype.SolveVelocityConstraints = function (step) {\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n var vA = bA.m_linearVelocity;\n var wA = bA.m_angularVelocity;\n var vB = bB.m_linearVelocity;\n var wB = bB.m_angularVelocity;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var Cdot1X = vB.x - wB * rBY - vA.x + wA * rAY;\n var Cdot1Y = vB.y + wB * rBX - vA.y - wA * rAX;\n var Cdot2 = wB - wA;\n var impulse = new b2Vec3();\n this.m_mass.Solve33(impulse, (-Cdot1X), (-Cdot1Y), (-Cdot2));\n this.m_impulse.Add(impulse);\n vA.x -= mA * impulse.x;\n vA.y -= mA * impulse.y;\n wA -= iA * (rAX * impulse.y - rAY * impulse.x + impulse.z);\n vB.x += mB * impulse.x;\n vB.y += mB * impulse.y;\n wB += iB * (rBX * impulse.y - rBY * impulse.x + impulse.z);\n bA.m_angularVelocity = wA;\n bB.m_angularVelocity = wB;\n }\n b2WeldJoint.prototype.SolvePositionConstraints = function (baumgarte) {\n if (baumgarte === undefined) baumgarte = 0;\n var tMat;\n var tX = 0;\n var bA = this.m_bodyA;\n var bB = this.m_bodyB;\n tMat = bA.m_xf.R;\n var rAX = this.m_localAnchorA.x - bA.m_sweep.localCenter.x;\n var rAY = this.m_localAnchorA.y - bA.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rAX + tMat.col2.x * rAY);\n rAY = (tMat.col1.y * rAX + tMat.col2.y * rAY);\n rAX = tX;\n tMat = bB.m_xf.R;\n var rBX = this.m_localAnchorB.x - bB.m_sweep.localCenter.x;\n var rBY = this.m_localAnchorB.y - bB.m_sweep.localCenter.y;\n tX = (tMat.col1.x * rBX + tMat.col2.x * rBY);\n rBY = (tMat.col1.y * rBX + tMat.col2.y * rBY);\n rBX = tX;\n var mA = bA.m_invMass;\n var mB = bB.m_invMass;\n var iA = bA.m_invI;\n var iB = bB.m_invI;\n var C1X = bB.m_sweep.c.x + rBX - bA.m_sweep.c.x - rAX;\n var C1Y = bB.m_sweep.c.y + rBY - bA.m_sweep.c.y - rAY;\n var C2 = bB.m_sweep.a - bA.m_sweep.a - this.m_referenceAngle;\n var k_allowedStretch = 10.0 * b2Settings.b2_linearSlop;\n var positionError = Math.sqrt(C1X * C1X + C1Y * C1Y);\n var angularError = b2Math.Abs(C2);\n if (positionError > k_allowedStretch) {\n iA *= 1.0;\n iB *= 1.0;\n }\n this.m_mass.col1.x = mA + mB + rAY * rAY * iA + rBY * rBY * iB;\n this.m_mass.col2.x = (-rAY * rAX * iA) - rBY * rBX * iB;\n this.m_mass.col3.x = (-rAY * iA) - rBY * iB;\n this.m_mass.col1.y = this.m_mass.col2.x;\n this.m_mass.col2.y = mA + mB + rAX * rAX * iA + rBX * rBX * iB;\n this.m_mass.col3.y = rAX * iA + rBX * iB;\n this.m_mass.col1.z = this.m_mass.col3.x;\n this.m_mass.col2.z = this.m_mass.col3.y;\n this.m_mass.col3.z = iA + iB;\n var impulse = new b2Vec3();\n this.m_mass.Solve33(impulse, (-C1X), (-C1Y), (-C2));\n bA.m_sweep.c.x -= mA * impulse.x;\n bA.m_sweep.c.y -= mA * impulse.y;\n bA.m_sweep.a -= iA * (rAX * impulse.y - rAY * impulse.x + impulse.z);\n bB.m_sweep.c.x += mB * impulse.x;\n bB.m_sweep.c.y += mB * impulse.y;\n bB.m_sweep.a += iB * (rBX * impulse.y - rBY * impulse.x + impulse.z);\n bA.SynchronizeTransform();\n bB.SynchronizeTransform();\n return positionError <= b2Settings.b2_linearSlop && angularError <= b2Settings.b2_angularSlop;\n }\n b2WeldJointDef.inherit(Box2D.Dynamics.Joints.b2JointDef);\n b2WeldJointDef.prototype.__super = Box2D.Dynamics.Joints.b2JointDef.prototype;\n b2WeldJointDef.b2WeldJointDef = function () {\n Box2D.Dynamics.Joints.b2JointDef.b2JointDef.apply(this, arguments);\n this.localAnchorA = new b2Vec2();\n this.localAnchorB = new b2Vec2();\n };\n b2WeldJointDef.prototype.b2WeldJointDef = function () {\n this.__super.b2JointDef.call(this);\n this.type = b2Joint.e_weldJoint;\n this.referenceAngle = 0.0;\n }\n b2WeldJointDef.prototype.Initialize = function (bA, bB, anchor) {\n this.bodyA = bA;\n this.bodyB = bB;\n this.localAnchorA.SetV(this.bodyA.GetLocalPoint(anchor));\n this.localAnchorB.SetV(this.bodyB.GetLocalPoint(anchor));\n this.referenceAngle = this.bodyB.GetAngle() - this.bodyA.GetAngle();\n }\n})();\nvar Vector_a2j_Number = a2j.NVector;\n//post-definitions\nfor (var i = 0; i < _A2J_postDefs.length; ++i) _A2J_postDefs[i]();(function() {\n function b2DebugDraw() {\n b2DebugDraw.b2DebugDraw.apply(this, arguments);\n if (this.constructor === b2DebugDraw) this.b2DebugDraw.apply(this, arguments);\n }\n Box2D.Dynamics.b2DebugDraw = b2DebugDraw;\n})();\n_A2J_postDefs = [];\n(function() {\n var b2DebugDraw = Box2D.Dynamics.b2DebugDraw;\n b2DebugDraw.b2DebugDraw = function () {\n this.m_drawScale = 1.0;\n this.m_lineThickness = 1.0;\n this.m_alpha = 1.0;\n this.m_fillAlpha = 1.0;\n this.m_xformScale = 1.0;\n var __this = this;\n //#WORKAROUND\n this.m_sprite = {graphics: {clear:\n function() {__this.m_ctx.clearRect(0,0,__this.m_ctx.canvas.width,__this.m_ctx.canvas.height)}\n }};\n };\n b2DebugDraw.prototype._color = function(color, alpha) {\n return \"rgba(\"+ ((color & 0xFF0000) >> 16) +\",\"+ ((color & 0xFF00) >> 8) +\",\"+\n (color & 0xFF) +\",\"+ alpha +\")\";\n };\n b2DebugDraw.prototype.b2DebugDraw = function () {\n this.m_drawFlags = 0;\n };\n b2DebugDraw.prototype.SetFlags = function (flags) {\n if (flags === undefined) flags = 0;\n this.m_drawFlags = flags;\n };\n b2DebugDraw.prototype.GetFlags = function () {\n return this.m_drawFlags;\n };\n b2DebugDraw.prototype.AppendFlags = function (flags) {\n if (flags === undefined) flags = 0;\n this.m_drawFlags |= flags;\n };\n b2DebugDraw.prototype.ClearFlags = function (flags) {\n if (flags === undefined) flags = 0;\n this.m_drawFlags &= ~flags;\n };\n b2DebugDraw.prototype.SetSprite = function (sprite) {\n this.m_ctx = sprite;\n };\n b2DebugDraw.prototype.GetSprite = function () {\n return this.m_ctx;\n };\n b2DebugDraw.prototype.SetDrawScale = function (drawScale) {\n if (drawScale === undefined) drawScale = 0;\n this.m_drawScale = drawScale;\n };\n b2DebugDraw.prototype.GetDrawScale = function () {\n return this.m_drawScale;\n };\n b2DebugDraw.prototype.SetLineThickness = function (lineThickness) {\n if (lineThickness === undefined) lineThickness = 0;\n this.m_lineThickness = lineThickness;\n this.m_ctx.strokeWidth = lineThickness;\n };\n b2DebugDraw.prototype.GetLineThickness = function () {\n return this.m_lineThickness;\n };\n b2DebugDraw.prototype.SetAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n this.m_alpha = alpha;\n };\n b2DebugDraw.prototype.GetAlpha = function () {\n return this.m_alpha;\n };\n b2DebugDraw.prototype.SetFillAlpha = function (alpha) {\n if (alpha === undefined) alpha = 0;\n this.m_fillAlpha = alpha;\n };\n b2DebugDraw.prototype.GetFillAlpha = function () {\n return this.m_fillAlpha;\n };\n b2DebugDraw.prototype.SetXFormScale = function (xformScale) {\n if (xformScale === undefined) xformScale = 0;\n this.m_xformScale = xformScale;\n };\n b2DebugDraw.prototype.GetXFormScale = function () {\n return this.m_xformScale;\n };\n b2DebugDraw.prototype.DrawPolygon = function (vertices, vertexCount, color) {\n if(!vertexCount) return;\n var s = this.m_ctx;\n var drawScale = this.m_drawScale;\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.moveTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n for (var i = 1; i < vertexCount; i++) {\n s.lineTo(vertices[i].x * drawScale, vertices[i].y * drawScale);\n }\n s.lineTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n s.closePath();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawSolidPolygon = function (vertices, vertexCount, color) {\n if(!vertexCount) return;\n var s = this.m_ctx;\n var drawScale = this.m_drawScale;\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.fillStyle = this._color(color.color, this.m_fillAlpha);\n s.moveTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n for (var i = 1; i < vertexCount; i++) {\n s.lineTo(vertices[i].x * drawScale, vertices[i].y * drawScale);\n }\n s.lineTo(vertices[0].x * drawScale, vertices[0].y * drawScale);\n s.closePath();\n s.fill();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawCircle = function (center, radius, color) {\n if(!radius) return;\n var s = this.m_ctx;\n var drawScale = this.m_drawScale;\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.arc(center.x * drawScale, center.y * drawScale, radius * drawScale, 0, Math.PI*2, true);\n s.closePath();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawSolidCircle = function (center, radius, axis, color) {\n /*if (radius === undefined) radius = 0;\n this.m_ctx.graphics.lineStyle(this.m_lineThickness, color.color, this.m_alpha);\n this.m_ctx.graphics.moveTo(0, 0);\n this.m_ctx.graphics.beginFill(color.color, this.m_fillAlpha);\n this.m_ctx.graphics.drawCircle(center.x * this.m_drawScale, center.y * this.m_drawScale, radius * this.m_drawScale);\n this.m_ctx.graphics.endFill();\n this.m_ctx.graphics.moveTo(center.x * this.m_drawScale, center.y * this.m_drawScale);\n this.m_ctx.graphics.lineTo((center.x + axis.x * radius) * this.m_drawScale, (center.y + axis.y * radius) * this.m_drawScale);\n */\n if(!radius) return;\n var s = this.m_ctx\n , drawScale = this.m_drawScale\n , cx = center.x * drawScale\n , cy = center.y * drawScale\n ;\n s.moveTo(0, 0);\n s.beginPath();\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.fillStyle = this._color(color.color, this.m_fillAlpha);\n s.arc(cx, cy, radius * drawScale, 0, Math.PI*2, true);\n s.moveTo(cx, cy);\n s.lineTo((center.x + axis.x * radius) * drawScale, (center.y + axis.y * radius) * drawScale);\n s.closePath();\n s.fill();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawSegment = function (p1, p2, color) {\n var s = this.m_ctx\n , drawScale = this.m_drawScale\n ;\n s.strokeStyle = this._color(color.color, this.m_alpha);\n s.beginPath();\n s.moveTo(p1.x * drawScale, p1.y * drawScale);\n s.lineTo(p2.x * drawScale, p2.y * drawScale);\n s.closePath();\n s.stroke();\n };\n b2DebugDraw.prototype.DrawTransform = function (xf) {\n var s = this.m_ctx\n , drawScale = this.m_drawScale\n ;\n s.beginPath();\n s.strokeStyle = this._color(0xff0000, this.m_alpha);\n s.moveTo(xf.position.x * drawScale, xf.position.y * drawScale);\n s.lineTo((xf.position.x + this.m_xformScale * xf.R.col1.x) * drawScale, (xf.position.y + this.m_xformScale * xf.R.col1.y) * drawScale);\n\n s.strokeStyle = this._color(0xff00, this.m_alpha);\n s.moveTo(xf.position.x * drawScale, xf.position.y * drawScale);\n s.lineTo((xf.position.x + this.m_xformScale * xf.R.col2.x) * drawScale, (xf.position.y + this.m_xformScale * xf.R.col2.y) * drawScale);\n s.closePath();\n s.stroke();\n };\n _A2J_postDefs.push(function () {\n Box2D.Dynamics.b2DebugDraw.e_shapeBit = 0x0001;\n Box2D.Dynamics.b2DebugDraw.prototype.e_shapeBit = Box2D.Dynamics.b2DebugDraw.e_shapeBit;\n Box2D.Dynamics.b2DebugDraw.e_jointBit = 0x0002;\n Box2D.Dynamics.b2DebugDraw.prototype.e_jointBit = Box2D.Dynamics.b2DebugDraw.e_jointBit;\n Box2D.Dynamics.b2DebugDraw.e_aabbBit = 0x0004;\n Box2D.Dynamics.b2DebugDraw.prototype.e_aabbBit = Box2D.Dynamics.b2DebugDraw.e_aabbBit;\n Box2D.Dynamics.b2DebugDraw.e_pairBit = 0x0008;\n Box2D.Dynamics.b2DebugDraw.prototype.e_pairBit = Box2D.Dynamics.b2DebugDraw.e_pairBit;\n Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit = 0x0010;\n Box2D.Dynamics.b2DebugDraw.prototype.e_centerOfMassBit = Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit;\n Box2D.Dynamics.b2DebugDraw.e_controllerBit = 0x0020;\n Box2D.Dynamics.b2DebugDraw.prototype.e_controllerBit = Box2D.Dynamics.b2DebugDraw.e_controllerBit;\n });\n})();\n\n//post-definitions\nfor (var i = 0; i < _A2J_postDefs.length; ++i) _A2J_postDefs[i]();;\n;\nvar __slice = Array.prototype.slice;\n/***\nCreates and returns a copy of the array. The copy contains\nthe same objects.\n\n@name copy\n@methodOf Array#\n@type Array\n@returns A new array that is a copy of the array\n*/\nArray.prototype.copy = function() {\n return this.concat();\n};\n/***\nEmpties the array of its contents. It is modified in place.\n\n@name clear\n@methodOf Array#\n@type Array\n@returns this, now emptied.\n*/\nArray.prototype.clear = function() {\n this.length = 0;\n return this;\n};\n/***\nInvoke the named method on each element in the array\nand return a new array containing the results of the invocation.\n\n<code><pre>\n [1.1, 2.2, 3.3, 4.4].invoke(\"floor\")\n => [1, 2, 3, 4]\n\n ['hello', 'world', 'cool!'].invoke('substring', 0, 3)\n => ['hel', 'wor', 'coo']\n</pre></code>\n\n@param {String} method The name of the method to invoke.\n@param [arg...] Optional arguments to pass to the method being invoked.\n\n@name invoke\n@methodOf Array#\n@type Array\n@returns A new array containing the results of invoking the\nnamed method on each element.\n*/\nArray.prototype.invoke = function(method) {\n var args;\n args = __slice.call(arguments, 1);\n return this.map(function(element) {\n return element[method].apply(element, args);\n });\n};\n/***\nRandomly select an element from the array.\n\n@name rand\n@methodOf Array#\n@type Object\n@returns A random element from an array\n*/\nArray.prototype.rand = function() {\n return this[rand(this.length)];\n};\n/***\nRemove the first occurance of the given object from the array if it is\npresent.\n\n@name remove\n@methodOf Array#\n@param {Object} object The object to remove from the array if present.\n@returns The removed object if present otherwise undefined.\n*/\nArray.prototype.remove = function(object) {\n var index;\n index = this.indexOf(object);\n return index >= 0 ? this.splice(index, 1)[0] : undefined;\n};\n/***\nReturns true if the element is present in the array.\n\n@name include\n@methodOf Array#\n@param {Object} element The element to check if present.\n@returns true if the element is in the array, false otherwise.\n@type Boolean\n*/\nArray.prototype.include = function(element) {\n return this.indexOf(element) !== -1;\n};\n/***\nCall the given iterator once for each element in the array,\npassing in the element as the first argument, the index of\nthe element as the second argument, and this array as the\nthird argument.\n\n@name each\n@methodOf Array#\n@param {Function} iterator Function to be called once for\neach element in the array.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns this to enable method chaining.\n*/\nArray.prototype.each = function(iterator, context) {\n var _len, _ref, element, i;\n if (this.forEach) {\n this.forEach(iterator, context);\n } else {\n _ref = this;\n for (i = 0, _len = _ref.length; i < _len; i++) {\n element = _ref[i];\n iterator.call(context, element, i, this);\n }\n }\n return this;\n};\n/***\nCall the given iterator once for each element in the array,\npassing in the given object as the first argument and the element\nas the second argument. Additional arguments are passed similar to\n<code>each</code>\n\n@see Array#each\n\n@name eachWithObject\n@methodOf Array#\n\n@param {Object} object The number of elements in each group.\n@param {Function} iterator Function to be called once for\neach element in the array.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@returns this\n@type Array\n*/\nArray.prototype.eachWithObject = function(object, iterator, context) {\n this.each(function(element, i, self) {\n return iterator.call(context, object, element, i, self);\n });\n return object;\n};\n/***\nCall the given iterator once for each group of elements in the array,\npassing in the elements in groups of n. Additional argumens are\npassed as in <code>each</each>.\n\n@see Array#each\n\n@name eachSlice\n@methodOf Array#\n\n@param {Number} n The number of elements in each group.\n@param {Function} iterator Function to be called once for\neach group of elements in the array.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@returns this\n@type Array\n*/\nArray.prototype.eachSlice = function(n, iterator, context) {\n var i, len;\n if (n > 0) {\n len = (this.length / n).floor();\n i = -1;\n while (++i < len) {\n iterator.call(context, this.slice(i * n, (i + 1) * n), i * n, this);\n }\n }\n return this;\n};\n/***\nReturns a new array with the elements all shuffled up.\n\n@name shuffle\n@methodOf Array#\n\n@returns A new array that is randomly shuffled.\n@type Array\n*/\nArray.prototype.shuffle = function() {\n var shuffledArray;\n shuffledArray = [];\n this.each(function(element) {\n return shuffledArray.splice(rand(shuffledArray.length + 1), 0, element);\n });\n return shuffledArray;\n};\n/***\nReturns the first element of the array, undefined if the array is empty.\n\n@name first\n@methodOf Array#\n\n@returns The first element, or undefined if the array is empty.\n@type Object\n*/\nArray.prototype.first = function() {\n return this[0];\n};\n/***\nReturns the last element of the array, undefined if the array is empty.\n\n@name last\n@methodOf Array#\n\n@returns The last element, or undefined if the array is empty.\n@type Object\n*/\nArray.prototype.last = function() {\n return this[this.length - 1];\n};\n/***\nReturns an object containing the extremes of this array.\n<pre>\n[-1, 3, 0].extremes() # => {min: -1, max: 3}\n</pre>\n\n@name extremes\n@methodOf Array#\n\n@param {Function} [fn] An optional funtion used to evaluate\neach element to calculate its value for determining extremes.\n@returns {min: minElement, max: maxElement}\n@type Object\n*/\nArray.prototype.extremes = function(fn) {\n var max, maxResult, min, minResult;\n fn || (fn = function(n) {\n return n;\n });\n min = (max = undefined);\n minResult = (maxResult = undefined);\n this.each(function(object) {\n var result;\n result = fn(object);\n if (typeof min !== \"undefined\" && min !== null) {\n if (result < minResult) {\n min = object;\n minResult = result;\n }\n } else {\n min = object;\n minResult = result;\n }\n if (typeof max !== \"undefined\" && max !== null) {\n if (result > maxResult) {\n max = object;\n return (maxResult = result);\n }\n } else {\n max = object;\n return (maxResult = result);\n }\n });\n return {\n min: min,\n max: max\n };\n};\n/***\nPretend the array is a circle and grab a new array containing length elements.\nIf length is not given return the element at start, again assuming the array\nis a circle.\n\n@name wrap\n@methodOf Array#\n\n@param {Number} start The index to start wrapping at, or the index of the\nsole element to return if no length is given.\n@param {Number} [length] Optional length determines how long result\narray should be.\n@returns The element at start mod array.length, or an array of length elements,\nstarting from start and wrapping.\n@type Object or Array\n*/\nArray.prototype.wrap = function(start, length) {\n var end, i, result;\n if (typeof length !== \"undefined\" && length !== null) {\n end = start + length;\n i = start;\n result = [];\n while (i++ < end) {\n result.push(this[i.mod(this.length)]);\n }\n return result;\n } else {\n return this[start.mod(this.length)];\n }\n};\n/***\nPartitions the elements into two groups: those for which the iterator returns\ntrue, and those for which it returns false.\n\n@name partition\n@methodOf Array#\n\n@param {Function} iterator\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns An array in the form of [trueCollection, falseCollection]\n*/\nArray.prototype.partition = function(iterator, context) {\n var falseCollection, trueCollection;\n trueCollection = [];\n falseCollection = [];\n this.each(function(element) {\n return iterator.call(context, element) ? trueCollection.push(element) : falseCollection.push(element);\n });\n return [trueCollection, falseCollection];\n};\n/***\nReturn the group of elements for which the return value of the iterator is true.\n\n@name select\n@methodOf Array#\n\n@param {Function} iterator The iterator receives each element in turn as\nthe first agument.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns An array containing the elements for which the iterator returned true.\n*/\nArray.prototype.select = function(iterator, context) {\n return this.partition(iterator, context)[0];\n};\n/***\nReturn the group of elements that are not in the passed in set.\n\n@name without\n@methodOf Array#\n\n@param {Array} values List of elements to exclude.\n\n@type Array\n@returns An array containing the elements that are not passed in.\n*/\nArray.prototype.without = function(values) {\n return this.reject(function(element) {\n return values.include(element);\n });\n};\n/***\nReturn the group of elements for which the return value of the iterator is false.\n\n@name reject\n@methodOf Array#\n\n@param {Function} iterator The iterator receives each element in turn as\nthe first agument.\n@param {Object} [context] Optional context parameter to be\nused as `this` when calling the iterator function.\n\n@type Array\n@returns An array containing the elements for which the iterator returned false.\n*/\nArray.prototype.reject = function(iterator, context) {\n return this.partition(iterator, context)[1];\n};\n/***\nCombines all elements of the array by applying a binary operation.\nfor each element in the arra the iterator is passed an accumulator\nvalue (memo) and the element.\n\n@name inject\n@methodOf Array#\n\n@type Object\n@returns The result of a\n*/\nArray.prototype.inject = function(initial, iterator) {\n this.each(function(element) {\n return (initial = iterator(initial, element));\n });\n return initial;\n};\n/***\nAdd all the elements in the array.\n\n@name sum\n@methodOf Array#\n\n@type Number\n@returns The sum of the elements in the array.\n*/\nArray.prototype.sum = function() {\n return this.inject(0, function(sum, n) {\n return sum + n;\n });\n};\nArray.prototype.zip = function() {\n var args;\n args = __slice.call(arguments, 0);\n return this.map(function(element, index) {\n var output;\n output = args.map(function(arr) {\n return arr[index];\n });\n output.unshift(element);\n return output;\n });\n};;\n/**\n * CoffeeScript Compiler v1.0.1\n * http://coffeescript.org\n *\n * Copyright 2011, Jeremy Ashkenas\n * Released under the MIT License\n */\nthis.CoffeeScript=function(){function require(a){return require[a]}require[\"./helpers\"]=new function(){var a=this;(function(){var b,c;a.starts=function(a,b,c){return b===a.substr(c,b.length)},a.ends=function(a,b,c){var d;d=b.length;return b===a.substr(a.length-d-(c||0),d)},a.compact=function(a){var b,c,d,e;e=[];for(c=0,d=a.length;c<d;c++)b=a[c],b&&e.push(b);return e},a.count=function(a,b){var c,d;c=d=0;if(!b.length)return 1/0;while(d=1+a.indexOf(b,d))c++;return c},a.merge=function(a,c){return b(b({},a),c)},b=a.extend=function(a,b){var c,d;for(c in b)d=b[c],a[c]=d;return a},a.flatten=c=function(a){var b,d,e,f;d=[];for(e=0,f=a.length;e<f;e++)b=a[e],b instanceof Array?d=d.concat(c(b)):d.push(b);return d},a.del=function(a,b){var c;c=a[b],delete a[b];return c},a.last=function(a,b){return a[a.length-(b||0)-1]}}).call(this)},require[\"./rewriter\"]=new function(){var a=this;(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]===a)return b;return-1},u=Array.prototype.slice;a.Rewriter=function(){function a(){}a.prototype.rewrite=function(a){this.tokens=a,this.removeLeadingNewlines(),this.removeMidExpressionNewlines(),this.closeOpenCalls(),this.closeOpenIndexes(),this.addImplicitIndentation(),this.tagPostfixConditionals(),this.addImplicitBraces(),this.addImplicitParentheses(),this.ensureBalance(b),this.rewriteClosingParens();return this.tokens},a.prototype.scanTokens=function(a){var b,c,d;d=this.tokens,b=0;while(c=d[b])b+=a.call(this,c,b,d);return!0},a.prototype.detectEnd=function(a,b,c){var f,g,h,i,j;h=this.tokens,f=0;while(g=h[a]){if(f===0&&b.call(this,g,a))return c.call(this,g,a);if(!g||f<0)return c.call(this,g,a-1);if(i=g[0],t.call(e,i)>=0)f+=1;else if(j=g[0],t.call(d,j)>=0)f-=1;a+=1}return a-1},a.prototype.removeLeadingNewlines=function(){var a,b,c,d;d=this.tokens;for(a=0,c=d.length;a<c;a++){b=d[a][0];if(b!==\"TERMINATOR\")break}if(a)return this.tokens.splice(0,a)},a.prototype.removeMidExpressionNewlines=function(){return this.scanTokens(function(a,b,d){var e;if(a[0]!==\"TERMINATOR\"||!(e=this.tag(b+1),t.call(c,e)>=0))return 1;d.splice(b,1);return 0})},a.prototype.closeOpenCalls=function(){var a,b;b=function(a,b){var c;return(c=a[0])===\")\"||c===\"CALL_END\"||a[0]===\"OUTDENT\"&&this.tag(b-1)===\")\"},a=function(a,b){return this.tokens[a[0]===\"OUTDENT\"?b-1:b][0]=\"CALL_END\"};return this.scanTokens(function(c,d){c[0]===\"CALL_START\"&&this.detectEnd(d+1,b,a);return 1})},a.prototype.closeOpenIndexes=function(){var a,b;b=function(a,b){var c;return(c=a[0])===\"]\"||c===\"INDEX_END\"},a=function(a,b){return a[0]=\"INDEX_END\"};return this.scanTokens(function(c,d){c[0]===\"INDEX_START\"&&this.detectEnd(d+1,b,a);return 1})},a.prototype.addImplicitBraces=function(){var a,b,c,f,g;c=[],f=null,g=0,b=function(a,b){var c,d,e,f,g,h;g=this.tokens.slice(b+1,b+3+1||9e9),c=g[0],f=g[1],e=g[2];if(\"HERECOMMENT\"===(c!=null?c[0]:void 0))return!1;d=a[0];return(d===\"TERMINATOR\"||d===\"OUTDENT\")&&((f!=null?f[0]:void 0)!==\":\"&&((c!=null?c[0]:void 0)!==\"@\"||(e!=null?e[0]:void 0)!==\":\"))||d===\",\"&&c&&((h=c[0])!==\"IDENTIFIER\"&&h!==\"NUMBER\"&&h!==\"STRING\"&&h!==\"@\"&&h!==\"TERMINATOR\"&&h!==\"OUTDENT\")},a=function(a,b){return this.tokens.splice(b,0,[\"}\",\"}\",a[2]])};return this.scanTokens(function(g,h,i){var j,k,l,m,n,o,p;if(o=l=g[0],t.call(e,o)>=0){c.push([l===\"INDENT\"&&this.tag(h-1)===\"{\"?\"{\":l,h]);return 1}if(t.call(d,l)>=0){f=c.pop();return 1}if(l!==\":\"||(j=this.tag(h-2))!==\":\"&&((p=c[c.length-1])!=null?p[0]:void 0)===\"{\")return 1;c.push([\"{\"]),k=j===\"@\"?h-2:h-1;while(this.tag(k-2)===\"HERECOMMENT\")k-=2;n=new String(\"{\"),n.generated=!0,m=[\"{\",n,g[2]],m.generated=!0,i.splice(k,0,m),this.detectEnd(h+2,b,a);return 2})},a.prototype.addImplicitParentheses=function(){var a,b;b=!1,a=function(a,b){var c;c=a[0]===\"OUTDENT\"?b+1:b;return this.tokens.splice(c,0,[\"CALL_END\",\")\",a[2]])};return this.scanTokens(function(c,d,e){var k,m,n,o,p,q,r,s,u;q=c[0];if(q===\"CLASS\"||q===\"IF\")b=!0;r=e.slice(d-1,d+1+1||9e9),o=r[0],m=r[1],n=r[2],k=!b&&q===\"INDENT\"&&n&&n.generated&&n[0]===\"{\"&&o&&(s=o[0],t.call(i,s)>=0),p=!1,t.call(l,q)>=0&&(b=!1),o&&!o.spaced&&q===\"?\"&&(c.call=!0);if(!k&&(!(o!=null?o.spaced:void 0)||!o.call&&!(u=o[0],t.call(i,u)>=0)||t.call(g,q)<0&&(c.spaced||c.newLine||t.call(j,q)<0)))return 1;e.splice(d,0,[\"CALL_START\",\"(\",c[2]]),this.detectEnd(d+1,function(a,b){var c,d;q=a[0];if(!p&&a.fromThen)return!0;if(q===\"IF\"||q===\"ELSE\"||q===\"->\"||q===\"=>\")p=!0;if((q===\".\"||q===\"?.\"||q===\"::\")&&this.tag(b-1)===\"OUTDENT\")return!0;return!a.generated&&this.tag(b-1)!==\",\"&&t.call(h,q)>=0&&(q!==\"INDENT\"||this.tag(b-2)!==\"CLASS\"&&(d=this.tag(b-1),t.call(f,d)<0)&&(!(c=this.tokens[b+1])||!c.generated||c[0]!==\"{\"))},a),o[0]===\"?\"&&(o[0]=\"FUNC_EXIST\");return 2})},a.prototype.addImplicitIndentation=function(){return this.scanTokens(function(a,b,c){var d,e,f,g,h,i,j,k;i=a[0];if(i===\"TERMINATOR\"&&this.tag(b+1)===\"THEN\"){c.splice(b,1);return 0}if(i===\"ELSE\"&&this.tag(b-1)!==\"OUTDENT\"){c.splice.apply(c,[b,0].concat(u.call(this.indentation(a))));return 2}if(i===\"CATCH\"&&((j=this.tag(b+2))===\"OUTDENT\"||j===\"TERMINATOR\"||j===\"FINALLY\")){c.splice.apply(c,[b+2,0].concat(u.call(this.indentation(a))));return 4}if(t.call(n,i)>=0&&this.tag(b+1)!==\"INDENT\"&&(i!==\"ELSE\"||this.tag(b+1)!==\"IF\")){h=i,k=this.indentation(a),f=k[0],g=k[1],h===\"THEN\"&&(f.fromThen=!0),f.generated=g.generated=!0,c.splice(b+1,0,f),e=function(a,b){var c;return a[1]!==\";\"&&(c=a[0],t.call(m,c)>=0)&&(a[0]!==\"ELSE\"||(h===\"IF\"||h===\"THEN\"))},d=function(a,b){return this.tokens.splice(this.tag(b-1)===\",\"?b-1:b,0,g)},this.detectEnd(b+2,e,d),i===\"THEN\"&&c.splice(b,1);return 1}return 1})},a.prototype.tagPostfixConditionals=function(){var a;a=function(a,b){var c;return(c=a[0])===\"TERMINATOR\"||c===\"INDENT\"};return this.scanTokens(function(b,c){var d;if(b[0]!==\"IF\")return 1;d=b,this.detectEnd(c+1,a,function(a,b){if(a[0]!==\"INDENT\")return d[0]=\"POST_\"+d[0]});return 1})},a.prototype.ensureBalance=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;d={},f={},m=this.tokens;for(i=0,k=m.length;i<k;i++){h=m[i],g=h[0];for(j=0,l=a.length;j<l;j++){n=a[j],e=n[0],b=n[1],d[e]|=0;if(g===e)d[e]++===0&&(f[e]=h[2]);else if(g===b&&--d[e]<0)throw Error(\"too many \"+h[1]+\" on line \"+(h[2]+1))}}for(e in d){c=d[e];if(c>0)throw Error(\"unclosed \"+e+\" on line \"+(f[e]+1))}return this},a.prototype.rewriteClosingParens=function(){var a,b,c;c=[],a={};for(b in k)a[b]=0;return this.scanTokens(function(b,f,g){var h,i,j,l,m,n,o;if(o=m=b[0],t.call(e,o)>=0){c.push(b);return 1}if(t.call(d,m)<0)return 1;if(a[h=k[m]]>0){a[h]-=1,g.splice(f,1);return 0}i=c.pop(),j=i[0],l=k[j];if(m===l)return 1;a[j]+=1,n=[l,j===\"INDENT\"?i[1]:l],this.tag(f+2)===j?(g.splice(f+3,0,n),c.push(i)):g.splice(f,0,n);return 1})},a.prototype.indentation=function(a){return[[\"INDENT\",2,a[2]],[\"OUTDENT\",2,a[2]]]},a.prototype.tag=function(a){var b;return(b=this.tokens[a])!=null?b[0]:void 0};return a}(),b=[[\"(\",\")\"],[\"[\",\"]\"],[\"{\",\"}\"],[\"INDENT\",\"OUTDENT\"],[\"CALL_START\",\"CALL_END\"],[\"PARAM_START\",\"PARAM_END\"],[\"INDEX_START\",\"INDEX_END\"]],k={},e=[],d=[];for(q=0,r=b.length;q<r;q++)s=b[q],o=s[0],p=s[1],e.push(k[p]=o),d.push(k[o]=p);c=[\"CATCH\",\"WHEN\",\"ELSE\",\"FINALLY\"].concat(d),i=[\"IDENTIFIER\",\"SUPER\",\")\",\"CALL_END\",\"]\",\"INDEX_END\",\"@\",\"THIS\"],g=[\"IDENTIFIER\",\"NUMBER\",\"STRING\",\"JS\",\"REGEX\",\"NEW\",\"PARAM_START\",\"CLASS\",\"IF\",\"TRY\",\"SWITCH\",\"THIS\",\"BOOL\",\"UNARY\",\"SUPER\",\"@\",\"->\",\"=>\",\"[\",\"(\",\"{\",\"--\",\"++\"],j=[\"+\",\"-\"],f=[\"->\",\"=>\",\"{\",\"[\",\",\"],h=[\"POST_IF\",\"FOR\",\"WHILE\",\"UNTIL\",\"WHEN\",\"BY\",\"LOOP\",\"TERMINATOR\",\"INDENT\"],n=[\"ELSE\",\"->\",\"=>\",\"TRY\",\"FINALLY\",\"THEN\"],m=[\"TERMINATOR\",\"CATCH\",\"FINALLY\",\"ELSE\",\"OUTDENT\",\"LEADING_WHEN\"],l=[\"TERMINATOR\",\"INDENT\",\"OUTDENT\"]}).call(this)},require[\"./lexer\"]=new function(){var a=this;(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U=Array.prototype.indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]===a)return b;return-1};I=require(\"./rewriter\").Rewriter,T=require(\"./helpers\"),P=T.count,S=T.starts,O=T.compact,Q=T.last,a.Lexer=w=function(){function a(){}a.prototype.tokenize=function(a,b){var c;b==null&&(b={}),N.test(a)&&(a=\"\\n\"+a),a=a.replace(/\\r/g,\"\").replace(L,\"\"),this.code=a,this.line=b.line||0,this.indent=0,this.indebt=0,this.outdebt=0,this.indents=[],this.tokens=[],c=0;while(this.chunk=a.slice(c))c+=this.identifierToken()||this.commentToken()||this.whitespaceToken()||this.lineToken()||this.heredocToken()||this.stringToken()||this.numberToken()||this.regexToken()||this.jsToken()||this.literalToken();this.closeIndentation();if(b.rewrite===!1)return this.tokens;return(new I).rewrite(this.tokens)},a.prototype.identifierToken=function(){var a,b,c,d,e,h,i,j,k;if(!(e=o.exec(this.chunk)))return 0;d=e[0],c=e[1],a=e[2];if(c===\"own\"&&this.tag()===\"FOR\"){this.token(\"OWN\",c);return c.length}b=a||(h=Q(this.tokens))&&!h.spaced&&((j=h[0])===\".\"||j===\"?.\"||j===\"@\"||j===\"::\"),i=\"IDENTIFIER\";if(U.call(s,c)>=0||!b&&U.call(g,c)>=0)i=c.toUpperCase(),i===\"WHEN\"&&(k=this.tag(),U.call(t,k)>=0)?i=\"LEADING_WHEN\":i===\"FOR\"?this.seenFor=!0:i===\"UNLESS\"?i=\"IF\":U.call(M,i)<0?U.call(G,i)>=0&&(i!==\"INSTANCEOF\"&&this.seenFor?(i=\"FOR\"+i,this.seenFor=!1):(i=\"RELATION\",this.value()===\"!\"&&(this.tokens.pop(),c=\"!\"+c))):i=\"UNARY\";U.call(r,c)>=0&&(b?(i=\"IDENTIFIER\",c=new String(c),c.reserved=!0):U.call(H,c)>=0&&this.identifierError(c)),b||(f.hasOwnProperty(c)&&(c=f[c]),i=function(){switch(c){case\"!\":return\"UNARY\";case\"==\":case\"!=\":return\"COMPARE\";case\"&&\":case\"||\":return\"LOGIC\";case\"true\":case\"false\":case\"null\":case\"undefined\":return\"BOOL\";case\"break\":case\"continue\":case\"debugger\":return\"STATEMENT\";default:return i}}()),this.token(i,c),a&&this.token(\":\",\":\");return d.length},a.prototype.numberToken=function(){var a,b;if(!(a=D.exec(this.chunk)))return 0;b=a[0],this.token(\"NUMBER\",b);return b.length},a.prototype.stringToken=function(){var a,b;switch(this.chunk.charAt(0)){case\"'\":if(!(a=K.exec(this.chunk)))return 0;this.token(\"STRING\",(b=a[0]).replace(y,\"\\\\\\n\"));break;case'\"':if(!(b=this.balancedString(this.chunk,'\"')))return 0;0<b.indexOf(\"#{\",1)?this.interpolateString(b.slice(1,-1)):this.token(\"STRING\",this.escapeLines(b));break;default:return 0}this.line+=P(b,\"\\n\");return b.length},a.prototype.heredocToken=function(){var a,b,c,d;if(!(c=k.exec(this.chunk)))return 0;b=c[0],d=b.charAt(0),a=this.sanitizeHeredoc(c[2],{quote:d,indent:null}),d!=='\"'||0>a.indexOf(\"#{\")?this.token(\"STRING\",this.makeString(a,d,!0)):this.interpolateString(a,{heredoc:!0}),this.line+=P(b,\"\\n\");return b.length},a.prototype.commentToken=function(){var a,b,c;if(!(c=this.chunk.match(h)))return 0;a=c[0],b=c[1],this.line+=P(a,\"\\n\"),b&&(this.token(\"HERECOMMENT\",this.sanitizeHeredoc(b,{herecomment:!0,indent:Array(this.indent+1).join(\" \")})),this.token(\"TERMINATOR\",\"\\n\"));return a.length},a.prototype.jsToken=function(){var a,b;if(this.chunk.charAt(0)!==\"`\"||!(a=q.exec(this.chunk)))return 0;this.token(\"JS\",(b=a[0]).slice(1,-1));return b.length},a.prototype.regexToken=function(){var a,b,c,d;if(this.chunk.charAt(0)!==\"/\")return 0;if(a=m.exec(this.chunk))return this.heregexToken(a);b=Q(this.tokens);if(b&&(d=b[0],U.call(b.spaced?A:B,d)>=0))return 0;if(!(a=F.exec(this.chunk)))return 0;c=a[0],this.token(\"REGEX\",c===\"//\"?\"/(?:)/\":c);return c.length},a.prototype.heregexToken=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,o;d=a[0],b=a[1],c=a[2];if(0>b.indexOf(\"#{\")){e=b.replace(n,\"\").replace(/\\//g,\"\\\\/\"),this.token(\"REGEX\",\"/\"+(e||\"(?:)\")+\"/\"+c);return d.length}this.token(\"IDENTIFIER\",\"RegExp\"),this.tokens.push([\"CALL_START\",\"(\"]),g=[],k=this.interpolateString(b,{regex:!0});for(i=0,j=k.length;i<j;i++){l=k[i],f=l[0],h=l[1];if(f===\"TOKENS\")g.push.apply(g,h);else{if(!(h=h.replace(n,\"\")))continue;h=h.replace(/\\\\/g,\"\\\\\\\\\"),g.push([\"STRING\",this.makeString(h,'\"',!0)])}g.push([\"+\",\"+\"])}g.pop(),((m=g[0])!=null?m[0]:void 0)!==\"STRING\"&&this.tokens.push([\"STRING\",'\"\"'],[\"+\",\"+\"]),(o=this.tokens).push.apply(o,g),c&&this.tokens.push([\",\",\",\"],[\"STRING\",'\"'+c+'\"']),this.token(\")\",\")\");return d.length},a.prototype.lineToken=function(){var a,b,c,d,e,f;if(!(c=z.exec(this.chunk)))return 0;b=c[0],this.line+=P(b,\"\\n\"),e=Q(this.tokens,1),f=b.length-1-b.lastIndexOf(\"\\n\"),d=this.unfinished();if(f-this.indebt===this.indent){d?this.suppressNewlines():this.newlineToken();return b.length}if(f>this.indent){if(d){this.indebt=f-this.indent,this.suppressNewlines();return b.length}a=f-this.indent+this.outdebt,this.token(\"INDENT\",a),this.indents.push(a),this.outdebt=this.indebt=0}else this.indebt=0,this.outdentToken(this.indent-f,d);this.indent=f;return b.length},a.prototype.outdentToken=function(a,b,c){var d,e;while(a>0)e=this.indents.length-1,this.indents[e]===void 0?a=0:this.indents[e]===this.outdebt?(a-=this.outdebt,this.outdebt=0):this.indents[e]<this.outdebt?(this.outdebt-=this.indents[e],a-=this.indents[e]):(d=this.indents.pop()-this.outdebt,a-=d,this.outdebt=0,this.token(\"OUTDENT\",d));d&&(this.outdebt-=a),this.tag()!==\"TERMINATOR\"&&!b&&this.token(\"TERMINATOR\",\"\\n\");return this},a.prototype.whitespaceToken=function(){var a,b,c;if(!(a=N.exec(this.chunk))&&!(b=this.chunk.charAt(0)===\"\\n\"))return 0;c=Q(this.tokens),c&&(c[a?\"spaced\":\"newLine\"]=!0);return a?a[0].length:0},a.prototype.newlineToken=function(){this.tag()!==\"TERMINATOR\"&&this.token(\"TERMINATOR\",\"\\n\");return this},a.prototype.suppressNewlines=function(){this.value()===\"\\\\\"&&this.tokens.pop();return this},a.prototype.literalToken=function(){var a,b,c,f,g,h,k,l;(a=E.exec(this.chunk))?(f=a[0],e.test(f)&&this.tagParameters()):f=this.chunk.charAt(0),c=f,b=Q(this.tokens);if(f===\"=\"&&b){!b[1].reserved&&(g=b[1],U.call(r,g)>=0)&&this.assignmentError();if((h=b[1])===\"||\"||h===\"&&\"){b[0]=\"COMPOUND_ASSIGN\",b[1]+=\"=\";return f.length}}if(f===\";\")c=\"TERMINATOR\";else if(U.call(x,f)<0)if(U.call(i,f)<0)if(U.call(j,f)<0)if(U.call(M,f)<0)if(U.call(J,f)<0){if(U.call(v,f)>=0||f===\"?\"&&(b!=null?b.spaced:void 0))c=\"LOGIC\";else if(b&&!b.spaced)if(f===\"(\"&&(k=b[0],U.call(d,k)>=0))b[0]===\"?\"&&(b[0]=\"FUNC_EXIST\"),c=\"CALL_START\";else if(f===\"[\"&&(l=b[0],U.call(p,l)>=0)){c=\"INDEX_START\";switch(b[0]){case\"?\":b[0]=\"INDEX_SOAK\";break;case\"::\":b[0]=\"INDEX_PROTO\"}}}else c=\"SHIFT\";else c=\"UNARY\";else c=\"COMPOUND_ASSIGN\";else c=\"COMPARE\";else c=\"MATH\";this.token(c,f);return f.length},a.prototype.sanitizeHeredoc=function(a,b){var c,d,e,f,g;e=b.indent,d=b.herecomment;if(d&&0>a.indexOf(\"\\n\"))return a;if(!d)while(f=l.exec(a)){c=f[1];if(e===null||0<(g=c.length)&&g<e.length)e=c}e&&(a=a.replace(RegExp(\"\\\\n\"+e,\"g\"),\"\\n\")),d||(a=a.replace(/^\\n/,\"\"));return a},a.prototype.tagParameters=function(){var a,b,c,d;if(this.tag()!==\")\")return this;b=[],d=this.tokens,a=d.length,d[--a][0]=\"PARAM_END\";while(c=d[--a])switch(c[0]){case\")\":b.push(c);break;case\"(\":case\"CALL_START\":if(b.length)b.pop();else{c[0]=\"PARAM_START\";return this}}return this},a.prototype.closeIndentation=function(){return this.outdentToken(this.indent)},a.prototype.identifierError=function(a){throw SyntaxError('Reserved word \"'+a+'\" on line '+(this.line+1))},a.prototype.assignmentError=function(){throw SyntaxError('Reserved word \"'+this.value()+'\" on line '+(this.line+1)+\" can't be assigned\")},a.prototype.balancedString=function(a,b){var c,d,e,f,g;f=[b];for(c=1,g=a.length;1<=g?c<g:c>g;1<=g?c+=1:c-=1){switch(d=a.charAt(c)){case\"\\\\\":c++;continue;case b:f.pop();if(!f.length)return a.slice(0,c+1);b=f[f.length-1];continue}b!==\"}\"||d!=='\"'&&d!==\"'\"?b===\"}\"&&d===\"{\"?f.push(b=\"}\"):b==='\"'&&e===\"#\"&&d===\"{\"&&f.push(b=\"}\"):f.push(b=d),e=d}throw new Error(\"missing \"+f.pop()+\", starting on line \"+(this.line+1))},a.prototype.interpolateString=function(b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;c==null&&(c={}),e=c.heredoc,m=c.regex,o=[],l=0,f=-1;while(j=b.charAt(f+=1)){if(j===\"\\\\\"){f+=1;continue}if(j!==\"#\"||b.charAt(f+1)!==\"{\"||!(d=this.balancedString(b.slice(f+1),\"}\")))continue;l<f&&o.push([\"NEOSTRING\",b.slice(l,f)]),g=d.slice(1,-1);if(g.length){k=(new a).tokenize(g,{line:this.line,rewrite:!1}),k.pop(),((r=k[0])!=null?r[0]:void 0)===\"TERMINATOR\"&&k.shift();if(i=k.length)i>1&&(k.unshift([\"(\",\"(\"]),k.push([\")\",\")\"])),o.push([\"TOKENS\",k])}f+=d.length,l=f+1}f>l&&l<b.length&&o.push([\"NEOSTRING\",b.slice(l)]);if(m)return o;if(!o.length)return this.token(\"STRING\",'\"\"');o[0][0]!==\"NEOSTRING\"&&o.unshift([\"\",\"\"]),(h=o.length>1)&&this.token(\"(\",\"(\");for(f=0,q=o.length;f<q;f++)s=o[f],n=s[0],p=s[1],f&&this.token(\"+\",\"+\"),n===\"TOKENS\"?(t=this.tokens).push.apply(t,p):this.token(\"STRING\",this.makeString(p,'\"',e));h&&this.token(\")\",\")\");return o},a.prototype.token=function(a,b){return this.tokens.push([a,b,this.line])},a.prototype.tag=function(a,b){var c;return(c=Q(this.tokens,a))&&(b?c[0]=b:c[0])},a.prototype.value=function(a,b){var c;return(c=Q(this.tokens,a))&&(b?c[1]=b:c[1])},a.prototype.unfinished=function(){var a,c;return u.test(this.chunk)||(a=Q(this.tokens,1))&&a[0]!==\".\"&&(c=this.value())&&!c.reserved&&C.test(c)&&!e.test(c)&&!b.test(this.chunk)},a.prototype.escapeLines=function(a,b){return a.replace(y,b?\"\\\\n\":\"\")},a.prototype.makeString=function(a,b,c){if(!a)return b+b;a=a.replace(/\\\\([\\s\\S])/g,function(a,c){return c===\"\\n\"||c===b?c:a}),a=a.replace(RegExp(\"\"+b,\"g\"),\"\\\\$&\");return b+this.escapeLines(a,c)+b};return a}(),s=[\"true\",\"false\",\"null\",\"this\",\"new\",\"delete\",\"typeof\",\"in\",\"instanceof\",\"return\",\"throw\",\"break\",\"continue\",\"debugger\",\"if\",\"else\",\"switch\",\"for\",\"while\",\"do\",\"try\",\"catch\",\"finally\",\"class\",\"extends\",\"super\"],g=[\"undefined\",\"then\",\"unless\",\"until\",\"loop\",\"of\",\"by\",\"when\"];for(R in f={and:\"&&\",or:\"||\",is:\"==\",isnt:\"!=\",not:\"!\",yes:\"true\",no:\"false\",on:\"true\",off:\"false\"})g.push(R);H=[\"case\",\"default\",\"function\",\"var\",\"void\",\"with\",\"const\",\"let\",\"enum\",\"export\",\"import\",\"native\",\"__hasProp\",\"__extends\",\"__slice\",\"__bind\",\"__indexOf\"],r=s.concat(H),a.RESERVED=H.concat(s).concat(g),o=/^([$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*)([^\\n\\S]*:(?!:))?/,D=/^0x[\\da-f]+|^(?:\\d+(\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?/i,k=/^(\"\"\"|''')([\\s\\S]*?)(?:\\n[^\\n\\S]*)?\\1/,E=/^(?:[-=]>|[-+*\\/%<>&|^!?=]=|>>>=?|([-+:])\\1|([&|<>])\\2=?|\\?\\.|\\.{2,3})/,N=/^[^\\n\\S]+/,h=/^###([^#][\\s\\S]*?)(?:###[^\\n\\S]*|(?:###)?$)|^(?:\\s*#(?!##[^#]).*)+/,e=/^[-=]>/,z=/^(?:\\n[^\\n\\S]*)+/,K=/^'[^\\\\']*(?:\\\\.[^\\\\']*)*'/,q=/^`[^\\\\`]*(?:\\\\.[^\\\\`]*)*`/,F=/^\\/(?!\\s)[^[\\/\\n\\\\]*(?:(?:\\\\[\\s\\S]|\\[[^\\]\\n\\\\]*(?:\\\\[\\s\\S][^\\]\\n\\\\]*)*])[^[\\/\\n\\\\]*)*\\/[imgy]{0,4}(?!\\w)/,m=/^\\/{3}([\\s\\S]+?)\\/{3}([imgy]{0,4})(?!\\w)/,n=/\\s+(?:#.*)?/g,y=/\\n/g,l=/\\n+([^\\n\\S]*)/g,b=/^\\s*@?([$A-Za-z_][$\\w\\x7f-\\uffff]*|['\"].*['\"])[^\\n\\S]*?[:=][^:=>]/,u=/^\\s*(?:,|\\??\\.(?!\\.)|::)/,L=/\\s+$/,C=/^(?:[-+*&|\\/%=<>!.\\\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/,j=[\"-=\",\"+=\",\"/=\",\"*=\",\"%=\",\"||=\",\"&&=\",\"?=\",\"<<=\",\">>=\",\">>>=\",\"&=\",\"^=\",\"|=\"],M=[\"!\",\"~\",\"NEW\",\"TYPEOF\",\"DELETE\",\"DO\"],v=[\"&&\",\"||\",\"&\",\"|\",\"^\"],J=[\"<<\",\">>\",\">>>\"],i=[\"==\",\"!=\",\"<\",\">\",\"<=\",\">=\"],x=[\"*\",\"/\",\"%\"],G=[\"IN\",\"OF\",\"INSTANCEOF\"],c=[\"TRUE\",\"FALSE\",\"NULL\",\"UNDEFINED\"],A=[\"NUMBER\",\"REGEX\",\"BOOL\",\"++\",\"--\",\"]\"],B=A.concat(\")\",\"}\",\"THIS\",\"IDENTIFIER\",\"STRING\"),d=[\"IDENTIFIER\",\"STRING\",\"REGEX\",\")\",\"]\",\"}\",\"?\",\"::\",\"@\",\"THIS\",\"SUPER\"],p=d.concat(\"NUMBER\",\"BOOL\"),t=[\"INDENT\",\"OUTDENT\",\"TERMINATOR\"]}).call(this)},require[\"./parser\"]=new function(){var a=this,b=function(){var a={trace:function b(){},yy:{},symbols_:{error:2,Root:3,Body:4,Block:5,TERMINATOR:6,Line:7,Expression:8,Statement:9,Return:10,Throw:11,Comment:12,STATEMENT:13,Value:14,Invocation:15,Code:16,Operation:17,Assign:18,If:19,Try:20,While:21,For:22,Switch:23,Class:24,INDENT:25,OUTDENT:26,Identifier:27,IDENTIFIER:28,AlphaNumeric:29,NUMBER:30,STRING:31,Literal:32,JS:33,REGEX:34,BOOL:35,Assignable:36,\"=\":37,AssignObj:38,ObjAssignable:39,\":\":40,ThisProperty:41,RETURN:42,HERECOMMENT:43,PARAM_START:44,ParamList:45,PARAM_END:46,FuncGlyph:47,\"->\":48,\"=>\":49,OptComma:50,\",\":51,Param:52,ParamVar:53,\"...\":54,Array:55,Object:56,Splat:57,SimpleAssignable:58,Accessor:59,Parenthetical:60,Range:61,This:62,\".\":63,\"?.\":64,\"::\":65,Index:66,Slice:67,INDEX_START:68,INDEX_END:69,INDEX_SOAK:70,INDEX_PROTO:71,\"{\":72,AssignList:73,\"}\":74,CLASS:75,EXTENDS:76,OptFuncExist:77,Arguments:78,SUPER:79,FUNC_EXIST:80,CALL_START:81,CALL_END:82,ArgList:83,THIS:84,\"@\":85,\"[\":86,\"]\":87,RangeDots:88,\"..\":89,Arg:90,SimpleArgs:91,TRY:92,Catch:93,FINALLY:94,CATCH:95,THROW:96,\"(\":97,\")\":98,WhileSource:99,WHILE:100,WHEN:101,UNTIL:102,Loop:103,LOOP:104,ForBody:105,FOR:106,ForStart:107,ForSource:108,ForVariables:109,OWN:110,ForValue:111,FORIN:112,FOROF:113,BY:114,SWITCH:115,Whens:116,ELSE:117,When:118,LEADING_WHEN:119,IfBlock:120,IF:121,POST_IF:122,UNARY:123,\"-\":124,\"+\":125,\"--\":126,\"++\":127,\"?\":128,MATH:129,SHIFT:130,COMPARE:131,LOGIC:132,RELATION:133,COMPOUND_ASSIGN:134,$accept:0,$end:1},terminals_:{2:\"error\",6:\"TERMINATOR\",13:\"STATEMENT\",25:\"INDENT\",26:\"OUTDENT\",28:\"IDENTIFIER\",30:\"NUMBER\",31:\"STRING\",33:\"JS\",34:\"REGEX\",35:\"BOOL\",37:\"=\",40:\":\",42:\"RETURN\",43:\"HERECOMMENT\",44:\"PARAM_START\",46:\"PARAM_END\",48:\"->\",49:\"=>\",51:\",\",54:\"...\",63:\".\",64:\"?.\",65:\"::\",68:\"INDEX_START\",69:\"INDEX_END\",70:\"INDEX_SOAK\",71:\"INDEX_PROTO\",72:\"{\",74:\"}\",75:\"CLASS\",76:\"EXTENDS\",79:\"SUPER\",80:\"FUNC_EXIST\",81:\"CALL_START\",82:\"CALL_END\",84:\"THIS\",85:\"@\",86:\"[\",87:\"]\",89:\"..\",92:\"TRY\",94:\"FINALLY\",95:\"CATCH\",96:\"THROW\",97:\"(\",98:\")\",100:\"WHILE\",101:\"WHEN\",102:\"UNTIL\",104:\"LOOP\",106:\"FOR\",110:\"OWN\",112:\"FORIN\",113:\"FOROF\",114:\"BY\",115:\"SWITCH\",117:\"ELSE\",119:\"LEADING_WHEN\",121:\"IF\",122:\"POST_IF\",123:\"UNARY\",124:\"-\",125:\"+\",126:\"--\",127:\"++\",128:\"?\",129:\"MATH\",130:\"SHIFT\",131:\"COMPARE\",132:\"LOGIC\",133:\"RELATION\",134:\"COMPOUND_ASSIGN\"},productions_:[0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[18,3],[18,5],[38,1],[38,3],[38,5],[38,1],[39,1],[39,1],[39,1],[10,2],[10,1],[12,1],[16,5],[16,2],[47,1],[47,1],[50,0],[50,1],[45,0],[45,1],[45,3],[52,1],[52,2],[52,3],[53,1],[53,1],[53,1],[53,1],[57,2],[58,1],[58,2],[58,2],[58,1],[36,1],[36,1],[36,1],[14,1],[14,1],[14,1],[14,1],[14,1],[59,2],[59,2],[59,2],[59,1],[59,1],[59,1],[66,3],[66,2],[66,2],[56,4],[73,0],[73,1],[73,3],[73,4],[73,6],[24,1],[24,2],[24,3],[24,4],[24,2],[24,3],[24,4],[24,5],[15,3],[15,3],[15,1],[15,2],[77,0],[77,1],[78,2],[78,4],[62,1],[62,1],[41,2],[55,2],[55,4],[88,1],[88,1],[61,5],[67,5],[67,4],[67,4],[83,1],[83,3],[83,4],[83,4],[83,6],[90,1],[90,1],[91,1],[91,3],[20,2],[20,3],[20,4],[20,5],[93,3],[11,2],[60,3],[60,5],[99,2],[99,4],[99,2],[99,4],[21,2],[21,2],[21,2],[21,1],[103,2],[103,2],[22,2],[22,2],[22,2],[105,2],[105,2],[107,2],[107,3],[111,1],[111,1],[111,1],[109,1],[109,3],[108,2],[108,2],[108,4],[108,4],[108,4],[108,6],[108,6],[23,5],[23,7],[23,4],[23,6],[116,1],[116,2],[118,3],[118,4],[120,3],[120,5],[19,1],[19,3],[19,3],[19,3],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,5],[17,3]],performAction:function c(a,b,c,d,e,f){var g=f.length-1;switch(e){case 1:return this.$=new d.Block;case 2:return this.$=f[g];case 3:return this.$=f[g-1];case 4:this.$=d.Block.wrap([f[g]]);break;case 5:this.$=f[g-2].push(f[g]);break;case 6:this.$=f[g-1];break;case 7:this.$=f[g];break;case 8:this.$=f[g];break;case 9:this.$=f[g];break;case 10:this.$=f[g];break;case 11:this.$=f[g];break;case 12:this.$=new d.Literal(f[g]);break;case 13:this.$=f[g];break;case 14:this.$=f[g];break;case 15:this.$=f[g];break;case 16:this.$=f[g];break;case 17:this.$=f[g];break;case 18:this.$=f[g];break;case 19:this.$=f[g];break;case 20:this.$=f[g];break;case 21:this.$=f[g];break;case 22:this.$=f[g];break;case 23:this.$=f[g];break;case 24:this.$=new d.Block;break;case 25:this.$=f[g-1];break;case 26:this.$=new d.Literal(f[g]);break;case 27:this.$=new d.Literal(f[g]);break;case 28:this.$=new d.Literal(f[g]);break;case 29:this.$=f[g];break;case 30:this.$=new d.Literal(f[g]);break;case 31:this.$=new d.Literal(f[g]);break;case 32:this.$=function(){var a;a=new d.Literal(f[g]),f[g]===\"undefined\"&&(a.isUndefined=!0);return a}();break;case 33:this.$=new d.Assign(f[g-2],f[g]);break;case 34:this.$=new d.Assign(f[g-4],f[g-1]);break;case 35:this.$=new d.Value(f[g]);break;case 36:this.$=new d.Assign(new d.Value(f[g-2]),f[g],\"object\");break;case 37:this.$=new d.Assign(new d.Value(f[g-4]),f[g-1],\"object\");break;case 38:this.$=f[g];break;case 39:this.$=f[g];break;case 40:this.$=f[g];break;case 41:this.$=f[g];break;case 42:this.$=new d.Return(f[g]);break;case 43:this.$=new d.Return;break;case 44:this.$=new d.Comment(f[g]);break;case 45:this.$=new d.Code(f[g-3],f[g],f[g-1]);break;case 46:this.$=new d.Code([],f[g],f[g-1]);break;case 47:this.$=\"func\";break;case 48:this.$=\"boundfunc\";break;case 49:this.$=f[g];break;case 50:this.$=f[g];break;case 51:this.$=[];break;case 52:this.$=[f[g]];break;case 53:this.$=f[g-2].concat(f[g]);break;case 54:this.$=new d.Param(f[g]);break;case 55:this.$=new d.Param(f[g-1],null,!0);break;case 56:this.$=new d.Param(f[g-2],f[g]);break;case 57:this.$=f[g];break;case 58:this.$=f[g];break;case 59:this.$=f[g];break;case 60:this.$=f[g];break;case 61:this.$=new d.Splat(f[g-1]);break;case 62:this.$=new d.Value(f[g]);break;case 63:this.$=f[g-1].push(f[g]);break;case 64:this.$=new d.Value(f[g-1],[f[g]]);break;case 65:this.$=f[g];break;case 66:this.$=f[g];break;case 67:this.$=new d.Value(f[g]);break;case 68:this.$=new d.Value(f[g]);break;case 69:this.$=f[g];break;case 70:this.$=new d.Value(f[g]);break;case 71:this.$=new d.Value(f[g]);break;case 72:this.$=new d.Value(f[g]);break;case 73:this.$=f[g];break;case 74:this.$=new d.Access(f[g]);break;case 75:this.$=new d.Access(f[g],\"soak\");break;case 76:this.$=new d.Access(f[g],\"proto\");break;case 77:this.$=new d.Access(new d.Literal(\"prototype\"));break;case 78:this.$=f[g];break;case 79:this.$=new d.Slice(f[g]);break;case 80:this.$=new d.Index(f[g-1]);break;case 81:this.$=d.extend(f[g],{soak:!0});break;case 82:this.$=d.extend(f[g],{proto:!0});break;case 83:this.$=new d.Obj(f[g-2],f[g-3].generated);break;case 84:this.$=[];break;case 85:this.$=[f[g]];break;case 86:this.$=f[g-2].concat(f[g]);break;case 87:this.$=f[g-3].concat(f[g]);break;case 88:this.$=f[g-5].concat(f[g-2]);break;case 89:this.$=new d.Class;break;case 90:this.$=new d.Class(null,null,f[g]);break;case 91:this.$=new d.Class(null,f[g]);break;case 92:this.$=new d.Class(null,f[g-1],f[g]);break;case 93:this.$=new d.Class(f[g]);break;case 94:this.$=new d.Class(f[g-1],null,f[g]);break;case 95:this.$=new d.Class(f[g-2],f[g]);break;case 96:this.$=new d.Class(f[g-3],f[g-1],f[g]);break;case 97:this.$=new d.Call(f[g-2],f[g],f[g-1]);break;case 98:this.$=new d.Call(f[g-2],f[g],f[g-1]);break;case 99:this.$=new d.Call(\"super\",[new d.Splat(new d.Literal(\"arguments\"))]);break;case 100:this.$=new d.Call(\"super\",f[g]);break;case 101:this.$=!1;break;case 102:this.$=!0;break;case 103:this.$=[];break;case 104:this.$=f[g-2];break;case 105:this.$=new d.Value(new d.Literal(\"this\"));break;case 106:this.$=new d.Value(new d.Literal(\"this\"));break;case 107:this.$=new d.Value(new d.Literal(\"this\"),[new d.Access(f[g])],\"this\");break;case 108:this.$=new d.Arr([]);break;case 109:this.$=new d.Arr(f[g-2]);break;case 110:this.$=\"inclusive\";break;case 111:this.$=\"exclusive\";break;case 112:this.$=new d.Range(f[g-3],f[g-1],f[g-2]);break;case 113:this.$=new d.Range(f[g-3],f[g-1],f[g-2]);break;case 114:this.$=new d.Range(f[g-2],null,f[g-1]);break;case 115:this.$=new d.Range(null,f[g-1],f[g-2]);break;case 116:this.$=[f[g]];break;case 117:this.$=f[g-2].concat(f[g]);break;case 118:this.$=f[g-3].concat(f[g]);break;case 119:this.$=f[g-2];break;case 120:this.$=f[g-5].concat(f[g-2]);break;case 121:this.$=f[g];break;case 122:this.$=f[g];break;case 123:this.$=f[g];break;case 124:this.$=[].concat(f[g-2],f[g]);break;case 125:this.$=new d.Try(f[g]);break;case 126:this.$=new d.Try(f[g-1],f[g][0],f[g][1]);break;case 127:this.$=new d.Try(f[g-2],null,null,f[g]);break;case 128:this.$=new d.Try(f[g-3],f[g-2][0],f[g-2][1],f[g]);break;case 129:this.$=[f[g-1],f[g]];break;case 130:this.$=new d.Throw(f[g]);break;case 131:this.$=new d.Parens(f[g-1]);break;case 132:this.$=new d.Parens(f[g-2]);break;case 133:this.$=new d.While(f[g]);break;case 134:this.$=new d.While(f[g-2],{guard:f[g]});break;case 135:this.$=new d.While(f[g],{invert:!0});break;case 136:this.$=new d.While(f[g-2],{invert:!0,guard:f[g]});break;case 137:this.$=f[g-1].addBody(f[g]);break;case 138:this.$=f[g].addBody(d.Block.wrap([f[g-1]]));break;case 139:this.$=f[g].addBody(d.Block.wrap([f[g-1]]));break;case 140:this.$=f[g];break;case 141:this.$=(new d.While(new d.Literal(\"true\"))).addBody(f[g]);break;case 142:this.$=(new d.While(new d.Literal(\"true\"))).addBody(d.Block.wrap([f[g]]));break;case 143:this.$=new d.For(f[g-1],f[g]);break;case 144:this.$=new d.For(f[g-1],f[g]);break;case 145:this.$=new d.For(f[g],f[g-1]);break;case 146:this.$={source:new d.Value(f[g])};break;case 147:this.$=function(){f[g].own=f[g-1].own,f[g].name=f[g-1][0],f[g].index=f[g-1][1];return f[g]}();break;case 148:this.$=f[g];break;case 149:this.$=function(){f[g].own=!0;return f[g]}();break;case 150:this.$=f[g];break;case 151:this.$=new d.Value(f[g]);break;case 152:this.$=new d.Value(f[g]);break;case 153:this.$=[f[g]];break;case 154:this.$=[f[g-2],f[g]];break;case 155:this.$={source:f[g]};break;case 156:this.$={source:f[g],object:!0};break;case 157:this.$={source:f[g-2],guard:f[g]};break;case 158:this.$={source:f[g-2],guard:f[g],object:!0};break;case 159:this.$={source:f[g-2],step:f[g]};break;case 160:this.$={source:f[g-4],guard:f[g-2],step:f[g]};break;case 161:this.$={source:f[g-4],step:f[g-2],guard:f[g]};break;case 162:this.$=new d.Switch(f[g-3],f[g-1]);break;case 163:this.$=new d.Switch(f[g-5],f[g-3],f[g-1]);break;case 164:this.$=new d.Switch(null,f[g-1]);break;case 165:this.$=new d.Switch(null,f[g-3],f[g-1]);break;case 166:this.$=f[g];break;case 167:this.$=f[g-1].concat(f[g]);break;case 168:this.$=[[f[g-1],f[g]]];break;case 169:this.$=[[f[g-2],f[g-1]]];break;case 170:this.$=new d.If(f[g-1],f[g],{type:f[g-2]});break;case 171:this.$=f[g-4].addElse(new d.If(f[g-1],f[g],{type:f[g-2]}));break;case 172:this.$=f[g];break;case 173:this.$=f[g-2].addElse(f[g]);break;case 174:this.$=new d.If(f[g],d.Block.wrap([f[g-2]]),{type:f[g-1],statement:!0});break;case 175:this.$=new d.If(f[g],d.Block.wrap([f[g-2]]),{type:f[g-1],statement:!0});break;case 176:this.$=new d.Op(f[g-1],f[g]);break;case 177:this.$=new d.Op(\"-\",f[g]);break;case 178:this.$=new d.Op(\"+\",f[g]);break;case 179:this.$=new d.Op(\"--\",f[g]);break;case 180:this.$=new d.Op(\"++\",f[g]);break;case 181:this.$=new d.Op(\"--\",f[g-1],null,!0);break;case 182:this.$=new d.Op(\"++\",f[g-1],null,!0);break;case 183:this.$=new d.Existence(f[g-1]);break;case 184:this.$=new d.Op(\"+\",f[g-2],f[g]);break;case 185:this.$=new d.Op(\"-\",f[g-2],f[g]);break;case 186:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 187:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 188:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 189:this.$=new d.Op(f[g-1],f[g-2],f[g]);break;case 190:this.$=function(){return f[g-1].charAt(0)===\"!\"?(new d.Op(f[g-1].slice(1),f[g-2],f[g])).invert():new d.Op(f[g-1],f[g-2],f[g])}();break;case 191:this.$=new d.Assign(f[g-2],f[g],f[g-1]);break;case 192:this.$=new d.Assign(f[g-4],f[g-1],f[g-3]);break;case 193:this.$=new d.Extends(f[g-2],f[g])}},table:[{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[3]},{1:[2,2],6:[1,71]},{6:[1,72]},{1:[2,4],6:[2,4],26:[2,4],98:[2,4]},{4:74,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[1,73],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,7],6:[2,7],26:[2,7],98:[2,7],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,8],6:[2,8],26:[2,8],98:[2,8],99:87,100:[1,62],102:[1,63],105:88,106:[1,65],107:66,122:[1,86]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],46:[2,13],51:[2,13],54:[2,13],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,13],70:[1,98],71:[1,99],74:[2,13],77:89,80:[1,91],81:[2,101],82:[2,13],87:[2,13],89:[2,13],98:[2,13],100:[2,13],101:[2,13],102:[2,13],106:[2,13],114:[2,13],122:[2,13],124:[2,13],125:[2,13],128:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],46:[2,14],51:[2,14],54:[2,14],59:101,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,14],70:[1,98],71:[1,99],74:[2,14],77:100,80:[1,91],81:[2,101],82:[2,14],87:[2,14],89:[2,14],98:[2,14],100:[2,14],101:[2,14],102:[2,14],106:[2,14],114:[2,14],122:[2,14],124:[2,14],125:[2,14],128:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],46:[2,15],51:[2,15],54:[2,15],69:[2,15],74:[2,15],82:[2,15],87:[2,15],89:[2,15],98:[2,15],100:[2,15],101:[2,15],102:[2,15],106:[2,15],114:[2,15],122:[2,15],124:[2,15],125:[2,15],128:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],46:[2,16],51:[2,16],54:[2,16],69:[2,16],74:[2,16],82:[2,16],87:[2,16],89:[2,16],98:[2,16],100:[2,16],101:[2,16],102:[2,16],106:[2,16],114:[2,16],122:[2,16],124:[2,16],125:[2,16],128:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],46:[2,17],51:[2,17],54:[2,17],69:[2,17],74:[2,17],82:[2,17],87:[2,17],89:[2,17],98:[2,17],100:[2,17],101:[2,17],102:[2,17],106:[2,17],114:[2,17],122:[2,17],124:[2,17],125:[2,17],128:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],46:[2,18],51:[2,18],54:[2,18],69:[2,18],74:[2,18],82:[2,18],87:[2,18],89:[2,18],98:[2,18],100:[2,18],101:[2,18],102:[2,18],106:[2,18],114:[2,18],122:[2,18],124:[2,18],125:[2,18],128:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],46:[2,19],51:[2,19],54:[2,19],69:[2,19],74:[2,19],82:[2,19],87:[2,19],89:[2,19],98:[2,19],100:[2,19],101:[2,19],102:[2,19],106:[2,19],114:[2,19],122:[2,19],124:[2,19],125:[2,19],128:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],46:[2,20],51:[2,20],54:[2,20],69:[2,20],74:[2,20],82:[2,20],87:[2,20],89:[2,20],98:[2,20],100:[2,20],101:[2,20],102:[2,20],106:[2,20],114:[2,20],122:[2,20],124:[2,20],125:[2,20],128:[2,20],129:[2,20],130:[2,20],131:[2,20],132:[2,20],133:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],46:[2,21],51:[2,21],54:[2,21],69:[2,21],74:[2,21],82:[2,21],87:[2,21],89:[2,21],98:[2,21],100:[2,21],101:[2,21],102:[2,21],106:[2,21],114:[2,21],122:[2,21],124:[2,21],125:[2,21],128:[2,21],129:[2,21],130:[2,21],131:[2,21],132:[2,21],133:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],46:[2,22],51:[2,22],54:[2,22],69:[2,22],74:[2,22],82:[2,22],87:[2,22],89:[2,22],98:[2,22],100:[2,22],101:[2,22],102:[2,22],106:[2,22],114:[2,22],122:[2,22],124:[2,22],125:[2,22],128:[2,22],129:[2,22],130:[2,22],131:[2,22],132:[2,22],133:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],46:[2,23],51:[2,23],54:[2,23],69:[2,23],74:[2,23],82:[2,23],87:[2,23],89:[2,23],98:[2,23],100:[2,23],101:[2,23],102:[2,23],106:[2,23],114:[2,23],122:[2,23],124:[2,23],125:[2,23],128:[2,23],129:[2,23],130:[2,23],131:[2,23],132:[2,23],133:[2,23]},{1:[2,9],6:[2,9],26:[2,9],98:[2,9],100:[2,9],102:[2,9],106:[2,9],122:[2,9]},{1:[2,10],6:[2,10],26:[2,10],98:[2,10],100:[2,10],102:[2,10],106:[2,10],122:[2,10]},{1:[2,11],6:[2,11],26:[2,11],98:[2,11],100:[2,11],102:[2,11],106:[2,11],122:[2,11]},{1:[2,12],6:[2,12],26:[2,12],98:[2,12],100:[2,12],102:[2,12],106:[2,12],122:[2,12]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],37:[1,102],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],68:[2,69],69:[2,69],70:[2,69],71:[2,69],74:[2,69],80:[2,69],81:[2,69],82:[2,69],87:[2,69],89:[2,69],98:[2,69],100:[2,69],101:[2,69],102:[2,69],106:[2,69],114:[2,69],122:[2,69],124:[2,69],125:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],46:[2,70],51:[2,70],54:[2,70],63:[2,70],64:[2,70],65:[2,70],68:[2,70],69:[2,70],70:[2,70],71:[2,70],74:[2,70],80:[2,70],81:[2,70],82:[2,70],87:[2,70],89:[2,70],98:[2,70],100:[2,70],101:[2,70],102:[2,70],106:[2,70],114:[2,70],122:[2,70],124:[2,70],125:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],46:[2,71],51:[2,71],54:[2,71],63:[2,71],64:[2,71],65:[2,71],68:[2,71],69:[2,71],70:[2,71],71:[2,71],74:[2,71],80:[2,71],81:[2,71],82:[2,71],87:[2,71],89:[2,71],98:[2,71],100:[2,71],101:[2,71],102:[2,71],106:[2,71],114:[2,71],122:[2,71],124:[2,71],125:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],46:[2,72],51:[2,72],54:[2,72],63:[2,72],64:[2,72],65:[2,72],68:[2,72],69:[2,72],70:[2,72],71:[2,72],74:[2,72],80:[2,72],81:[2,72],82:[2,72],87:[2,72],89:[2,72],98:[2,72],100:[2,72],101:[2,72],102:[2,72],106:[2,72],114:[2,72],122:[2,72],124:[2,72],125:[2,72],128:[2,72],129:[2,72],130:[2,72],131:[2,72],132:[2,72],133:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],46:[2,73],51:[2,73],54:[2,73],63:[2,73],64:[2,73],65:[2,73],68:[2,73],69:[2,73],70:[2,73],71:[2,73],74:[2,73],80:[2,73],81:[2,73],82:[2,73],87:[2,73],89:[2,73],98:[2,73],100:[2,73],101:[2,73],102:[2,73],106:[2,73],114:[2,73],122:[2,73],124:[2,73],125:[2,73],128:[2,73],129:[2,73],130:[2,73],131:[2,73],132:[2,73],133:[2,73]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],46:[2,99],51:[2,99],54:[2,99],63:[2,99],64:[2,99],65:[2,99],68:[2,99],69:[2,99],70:[2,99],71:[2,99],74:[2,99],78:103,80:[2,99],81:[1,104],82:[2,99],87:[2,99],89:[2,99],98:[2,99],100:[2,99],101:[2,99],102:[2,99],106:[2,99],114:[2,99],122:[2,99],124:[2,99],125:[2,99],128:[2,99],129:[2,99],130:[2,99],131:[2,99],132:[2,99],133:[2,99]},{27:108,28:[1,70],41:109,45:105,46:[2,51],51:[2,51],52:106,53:107,55:110,56:111,72:[1,67],85:[1,112],86:[1,113]},{5:114,25:[1,5]},{8:115,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:117,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:118,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{14:120,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:119,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{14:120,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:123,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],37:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,66],70:[2,66],71:[2,66],74:[2,66],76:[1,127],80:[2,66],81:[2,66],82:[2,66],87:[2,66],89:[2,66],98:[2,66],100:[2,66],101:[2,66],102:[2,66],106:[2,66],114:[2,66],122:[2,66],124:[2,66],125:[2,66],126:[1,124],127:[1,125],128:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[1,126]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],46:[2,172],51:[2,172],54:[2,172],69:[2,172],74:[2,172],82:[2,172],87:[2,172],89:[2,172],98:[2,172],100:[2,172],101:[2,172],102:[2,172],106:[2,172],114:[2,172],117:[1,128],122:[2,172],124:[2,172],125:[2,172],128:[2,172],129:[2,172],130:[2,172],131:[2,172],132:[2,172],133:[2,172]},{5:129,25:[1,5]},{5:130,25:[1,5]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],46:[2,140],51:[2,140],54:[2,140],69:[2,140],74:[2,140],82:[2,140],87:[2,140],89:[2,140],98:[2,140],100:[2,140],101:[2,140],102:[2,140],106:[2,140],114:[2,140],122:[2,140],124:[2,140],125:[2,140],128:[2,140],129:[2,140],130:[2,140],131:[2,140],132:[2,140],133:[2,140]},{5:131,25:[1,5]},{8:132,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,133],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,89],5:134,6:[2,89],14:120,15:121,25:[1,5],26:[2,89],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,46:[2,89],51:[2,89],54:[2,89],55:47,56:48,58:136,60:25,61:26,62:27,69:[2,89],72:[1,67],74:[2,89],76:[1,135],79:[1,28],82:[2,89],84:[1,55],85:[1,56],86:[1,54],87:[2,89],89:[2,89],97:[1,53],98:[2,89],100:[2,89],101:[2,89],102:[2,89],106:[2,89],114:[2,89],122:[2,89],124:[2,89],125:[2,89],128:[2,89],129:[2,89],130:[2,89],131:[2,89],132:[2,89],133:[2,89]},{1:[2,43],6:[2,43],8:137,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[2,43],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],98:[2,43],99:39,100:[2,43],102:[2,43],103:40,104:[1,64],105:41,106:[2,43],107:66,115:[1,42],120:37,121:[1,61],122:[2,43],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:138,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,44],6:[2,44],25:[2,44],26:[2,44],51:[2,44],74:[2,44],98:[2,44],100:[2,44],102:[2,44],106:[2,44],122:[2,44]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],37:[2,67],46:[2,67],51:[2,67],54:[2,67],63:[2,67],64:[2,67],65:[2,67],68:[2,67],69:[2,67],70:[2,67],71:[2,67],74:[2,67],80:[2,67],81:[2,67],82:[2,67],87:[2,67],89:[2,67],98:[2,67],100:[2,67],101:[2,67],102:[2,67],106:[2,67],114:[2,67],122:[2,67],124:[2,67],125:[2,67],128:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],37:[2,68],46:[2,68],51:[2,68],54:[2,68],63:[2,68],64:[2,68],65:[2,68],68:[2,68],69:[2,68],70:[2,68],71:[2,68],74:[2,68],80:[2,68],81:[2,68],82:[2,68],87:[2,68],89:[2,68],98:[2,68],100:[2,68],101:[2,68],102:[2,68],106:[2,68],114:[2,68],122:[2,68],124:[2,68],125:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],46:[2,29],51:[2,29],54:[2,29],63:[2,29],64:[2,29],65:[2,29],68:[2,29],69:[2,29],70:[2,29],71:[2,29],74:[2,29],80:[2,29],81:[2,29],82:[2,29],87:[2,29],89:[2,29],98:[2,29],100:[2,29],101:[2,29],102:[2,29],106:[2,29],114:[2,29],122:[2,29],124:[2,29],125:[2,29],128:[2,29],129:[2,29],130:[2,29],131:[2,29],132:[2,29],133:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],46:[2,30],51:[2,30],54:[2,30],63:[2,30],64:[2,30],65:[2,30],68:[2,30],69:[2,30],70:[2,30],71:[2,30],74:[2,30],80:[2,30],81:[2,30],82:[2,30],87:[2,30],89:[2,30],98:[2,30],100:[2,30],101:[2,30],102:[2,30],106:[2,30],114:[2,30],122:[2,30],124:[2,30],125:[2,30],128:[2,30],129:[2,30],130:[2,30],131:[2,30],132:[2,30],133:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],46:[2,31],51:[2,31],54:[2,31],63:[2,31],64:[2,31],65:[2,31],68:[2,31],69:[2,31],70:[2,31],71:[2,31],74:[2,31],80:[2,31],81:[2,31],82:[2,31],87:[2,31],89:[2,31],98:[2,31],100:[2,31],101:[2,31],102:[2,31],106:[2,31],114:[2,31],122:[2,31],124:[2,31],125:[2,31],128:[2,31],129:[2,31],130:[2,31],131:[2,31],132:[2,31],133:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],46:[2,32],51:[2,32],54:[2,32],63:[2,32],64:[2,32],65:[2,32],68:[2,32],69:[2,32],70:[2,32],71:[2,32],74:[2,32],80:[2,32],81:[2,32],82:[2,32],87:[2,32],89:[2,32],98:[2,32],100:[2,32],101:[2,32],102:[2,32],106:[2,32],114:[2,32],122:[2,32],124:[2,32],125:[2,32],128:[2,32],129:[2,32],130:[2,32],131:[2,32],132:[2,32],133:[2,32]},{4:139,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,140],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:141,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:143,84:[1,55],85:[1,56],86:[1,54],87:[1,142],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],46:[2,105],51:[2,105],54:[2,105],63:[2,105],64:[2,105],65:[2,105],68:[2,105],69:[2,105],70:[2,105],71:[2,105],74:[2,105],80:[2,105],81:[2,105],82:[2,105],87:[2,105],89:[2,105],98:[2,105],100:[2,105],101:[2,105],102:[2,105],106:[2,105],114:[2,105],122:[2,105],124:[2,105],125:[2,105],128:[2,105],129:[2,105],130:[2,105],131:[2,105],132:[2,105],133:[2,105]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],27:147,28:[1,70],46:[2,106],51:[2,106],54:[2,106],63:[2,106],64:[2,106],65:[2,106],68:[2,106],69:[2,106],70:[2,106],71:[2,106],74:[2,106],80:[2,106],81:[2,106],82:[2,106],87:[2,106],89:[2,106],98:[2,106],100:[2,106],101:[2,106],102:[2,106],106:[2,106],114:[2,106],122:[2,106],124:[2,106],125:[2,106],128:[2,106],129:[2,106],130:[2,106],131:[2,106],132:[2,106],133:[2,106]},{25:[2,47]},{25:[2,48]},{1:[2,62],6:[2,62],25:[2,62],26:[2,62],37:[2,62],46:[2,62],51:[2,62],54:[2,62],63:[2,62],64:[2,62],65:[2,62],68:[2,62],69:[2,62],70:[2,62],71:[2,62],74:[2,62],76:[2,62],80:[2,62],81:[2,62],82:[2,62],87:[2,62],89:[2,62],98:[2,62],100:[2,62],101:[2,62],102:[2,62],106:[2,62],114:[2,62],122:[2,62],124:[2,62],125:[2,62],126:[2,62],127:[2,62],128:[2,62],129:[2,62],130:[2,62],131:[2,62],132:[2,62],133:[2,62],134:[2,62]},{1:[2,65],6:[2,65],25:[2,65],26:[2,65],37:[2,65],46:[2,65],51:[2,65],54:[2,65],63:[2,65],64:[2,65],65:[2,65],68:[2,65],69:[2,65],70:[2,65],71:[2,65],74:[2,65],76:[2,65],80:[2,65],81:[2,65],82:[2,65],87:[2,65],89:[2,65],98:[2,65],100:[2,65],101:[2,65],102:[2,65],106:[2,65],114:[2,65],122:[2,65],124:[2,65],125:[2,65],126:[2,65],127:[2,65],128:[2,65],129:[2,65],130:[2,65],131:[2,65],132:[2,65],133:[2,65],134:[2,65]},{8:148,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:149,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:150,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{5:151,8:152,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{27:157,28:[1,70],55:158,56:159,61:153,72:[1,67],86:[1,54],109:154,110:[1,155],111:156},{108:160,112:[1,161],113:[1,162]},{6:[2,84],12:166,25:[2,84],27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:164,39:165,41:169,43:[1,46],51:[2,84],73:163,74:[2,84],85:[1,112]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],40:[2,27],46:[2,27],51:[2,27],54:[2,27],63:[2,27],64:[2,27],65:[2,27],68:[2,27],69:[2,27],70:[2,27],71:[2,27],74:[2,27],80:[2,27],81:[2,27],82:[2,27],87:[2,27],89:[2,27],98:[2,27],100:[2,27],101:[2,27],102:[2,27],106:[2,27],114:[2,27],122:[2,27],124:[2,27],125:[2,27],128:[2,27],129:[2,27],130:[2,27],131:[2,27],132:[2,27],133:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],40:[2,28],46:[2,28],51:[2,28],54:[2,28],63:[2,28],64:[2,28],65:[2,28],68:[2,28],69:[2,28],70:[2,28],71:[2,28],74:[2,28],80:[2,28],81:[2,28],82:[2,28],87:[2,28],89:[2,28],98:[2,28],100:[2,28],101:[2,28],102:[2,28],106:[2,28],114:[2,28],122:[2,28],124:[2,28],125:[2,28],128:[2,28],129:[2,28],130:[2,28],131:[2,28],132:[2,28],133:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],37:[2,26],40:[2,26],46:[2,26],51:[2,26],54:[2,26],63:[2,26],64:[2,26],65:[2,26],68:[2,26],69:[2,26],70:[2,26],71:[2,26],74:[2,26],76:[2,26],80:[2,26],81:[2,26],82:[2,26],87:[2,26],89:[2,26],98:[2,26],100:[2,26],101:[2,26],102:[2,26],106:[2,26],112:[2,26],113:[2,26],114:[2,26],122:[2,26],124:[2,26],125:[2,26],126:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26]},{1:[2,6],6:[2,6],7:170,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[2,6],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],98:[2,6],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],46:[2,24],51:[2,24],54:[2,24],69:[2,24],74:[2,24],82:[2,24],87:[2,24],89:[2,24],94:[2,24],95:[2,24],98:[2,24],100:[2,24],101:[2,24],102:[2,24],106:[2,24],114:[2,24],117:[2,24],119:[2,24],122:[2,24],124:[2,24],125:[2,24],128:[2,24],129:[2,24],130:[2,24],131:[2,24],132:[2,24],133:[2,24]},{6:[1,71],26:[1,171]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],46:[2,183],51:[2,183],54:[2,183],69:[2,183],74:[2,183],82:[2,183],87:[2,183],89:[2,183],98:[2,183],100:[2,183],101:[2,183],102:[2,183],106:[2,183],114:[2,183],122:[2,183],124:[2,183],125:[2,183],128:[2,183],129:[2,183],130:[2,183],131:[2,183],132:[2,183],133:[2,183]},{8:172,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:173,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:174,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:175,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:176,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:177,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:178,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:179,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],46:[2,139],51:[2,139],54:[2,139],69:[2,139],74:[2,139],82:[2,139],87:[2,139],89:[2,139],98:[2,139],100:[2,139],101:[2,139],102:[2,139],106:[2,139],114:[2,139],122:[2,139],124:[2,139],125:[2,139],128:[2,139],129:[2,139],130:[2,139],131:[2,139],132:[2,139],133:[2,139]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],46:[2,144],51:[2,144],54:[2,144],69:[2,144],74:[2,144],82:[2,144],87:[2,144],89:[2,144],98:[2,144],100:[2,144],101:[2,144],102:[2,144],106:[2,144],114:[2,144],122:[2,144],124:[2,144],125:[2,144],128:[2,144],129:[2,144],130:[2,144],131:[2,144],132:[2,144],133:[2,144]},{8:180,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],46:[2,138],51:[2,138],54:[2,138],69:[2,138],74:[2,138],82:[2,138],87:[2,138],89:[2,138],98:[2,138],100:[2,138],101:[2,138],102:[2,138],106:[2,138],114:[2,138],122:[2,138],124:[2,138],125:[2,138],128:[2,138],129:[2,138],130:[2,138],131:[2,138],132:[2,138],133:[2,138]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],46:[2,143],51:[2,143],54:[2,143],69:[2,143],74:[2,143],82:[2,143],87:[2,143],89:[2,143],98:[2,143],100:[2,143],101:[2,143],102:[2,143],106:[2,143],114:[2,143],122:[2,143],124:[2,143],125:[2,143],128:[2,143],129:[2,143],130:[2,143],131:[2,143],132:[2,143],133:[2,143]},{78:181,81:[1,104]},{1:[2,63],6:[2,63],25:[2,63],26:[2,63],37:[2,63],46:[2,63],51:[2,63],54:[2,63],63:[2,63],64:[2,63],65:[2,63],68:[2,63],69:[2,63],70:[2,63],71:[2,63],74:[2,63],76:[2,63],80:[2,63],81:[2,63],82:[2,63],87:[2,63],89:[2,63],98:[2,63],100:[2,63],101:[2,63],102:[2,63],106:[2,63],114:[2,63],122:[2,63],124:[2,63],125:[2,63],126:[2,63],127:[2,63],128:[2,63],129:[2,63],130:[2,63],131:[2,63],132:[2,63],133:[2,63],134:[2,63]},{81:[2,102]},{27:182,28:[1,70]},{27:183,28:[1,70]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],27:184,28:[1,70],37:[2,77],46:[2,77],51:[2,77],54:[2,77],63:[2,77],64:[2,77],65:[2,77],68:[2,77],69:[2,77],70:[2,77],71:[2,77],74:[2,77],76:[2,77],80:[2,77],81:[2,77],82:[2,77],87:[2,77],89:[2,77],98:[2,77],100:[2,77],101:[2,77],102:[2,77],106:[2,77],114:[2,77],122:[2,77],124:[2,77],125:[2,77],126:[2,77],127:[2,77],128:[2,77],129:[2,77],130:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],37:[2,78],46:[2,78],51:[2,78],54:[2,78],63:[2,78],64:[2,78],65:[2,78],68:[2,78],69:[2,78],70:[2,78],71:[2,78],74:[2,78],76:[2,78],80:[2,78],81:[2,78],82:[2,78],87:[2,78],89:[2,78],98:[2,78],100:[2,78],101:[2,78],102:[2,78],106:[2,78],114:[2,78],122:[2,78],124:[2,78],125:[2,78],126:[2,78],127:[2,78],128:[2,78],129:[2,78],130:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],37:[2,79],46:[2,79],51:[2,79],54:[2,79],63:[2,79],64:[2,79],65:[2,79],68:[2,79],69:[2,79],70:[2,79],71:[2,79],74:[2,79],76:[2,79],80:[2,79],81:[2,79],82:[2,79],87:[2,79],89:[2,79],98:[2,79],100:[2,79],101:[2,79],102:[2,79],106:[2,79],114:[2,79],122:[2,79],124:[2,79],125:[2,79],126:[2,79],127:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79]},{8:185,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],54:[1,188],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],88:186,89:[1,187],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{66:189,68:[1,190],70:[1,98],71:[1,99]},{66:191,68:[1,190],70:[1,98],71:[1,99]},{78:192,81:[1,104]},{1:[2,64],6:[2,64],25:[2,64],26:[2,64],37:[2,64],46:[2,64],51:[2,64],54:[2,64],63:[2,64],64:[2,64],65:[2,64],68:[2,64],69:[2,64],70:[2,64],71:[2,64],74:[2,64],76:[2,64],80:[2,64],81:[2,64],82:[2,64],87:[2,64],89:[2,64],98:[2,64],100:[2,64],101:[2,64],102:[2,64],106:[2,64],114:[2,64],122:[2,64],124:[2,64],125:[2,64],126:[2,64],127:[2,64],128:[2,64],129:[2,64],130:[2,64],131:[2,64],132:[2,64],133:[2,64],134:[2,64]},{8:193,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,194],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],46:[2,100],51:[2,100],54:[2,100],63:[2,100],64:[2,100],65:[2,100],68:[2,100],69:[2,100],70:[2,100],71:[2,100],74:[2,100],80:[2,100],81:[2,100],82:[2,100],87:[2,100],89:[2,100],98:[2,100],100:[2,100],101:[2,100],102:[2,100],106:[2,100],114:[2,100],122:[2,100],124:[2,100],125:[2,100],128:[2,100],129:[2,100],130:[2,100],131:[2,100],132:[2,100],133:[2,100]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],82:[1,195],83:196,84:[1,55],85:[1,56],86:[1,54],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{46:[1,198],51:[1,199]},{46:[2,52],51:[2,52]},{37:[1,201],46:[2,54],51:[2,54],54:[1,200]},{37:[2,57],46:[2,57],51:[2,57],54:[2,57]},{37:[2,58],46:[2,58],51:[2,58],54:[2,58]},{37:[2,59],46:[2,59],51:[2,59],54:[2,59]},{37:[2,60],46:[2,60],51:[2,60],54:[2,60]},{27:147,28:[1,70]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:143,84:[1,55],85:[1,56],86:[1,54],87:[1,142],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,46],6:[2,46],25:[2,46],26:[2,46],46:[2,46],51:[2,46],54:[2,46],69:[2,46],74:[2,46],82:[2,46],87:[2,46],89:[2,46],98:[2,46],100:[2,46],101:[2,46],102:[2,46],106:[2,46],114:[2,46],122:[2,46],124:[2,46],125:[2,46],128:[2,46],129:[2,46],130:[2,46],131:[2,46],132:[2,46],133:[2,46]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],46:[2,176],51:[2,176],54:[2,176],69:[2,176],74:[2,176],82:[2,176],87:[2,176],89:[2,176],98:[2,176],99:84,100:[2,176],101:[2,176],102:[2,176],105:85,106:[2,176],107:66,114:[2,176],122:[2,176],124:[2,176],125:[2,176],128:[1,75],129:[2,176],130:[2,176],131:[2,176],132:[2,176],133:[2,176]},{99:87,100:[1,62],102:[1,63],105:88,106:[1,65],107:66,122:[1,86]},{1:[2,177],6:[2,177],25:[2,177],26:[2,177],46:[2,177],51:[2,177],54:[2,177],69:[2,177],74:[2,177],82:[2,177],87:[2,177],89:[2,177],98:[2,177],99:84,100:[2,177],101:[2,177],102:[2,177],105:85,106:[2,177],107:66,114:[2,177],122:[2,177],124:[2,177],125:[2,177],128:[1,75],129:[2,177],130:[2,177],131:[2,177],132:[2,177],133:[2,177]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],46:[2,178],51:[2,178],54:[2,178],69:[2,178],74:[2,178],82:[2,178],87:[2,178],89:[2,178],98:[2,178],99:84,100:[2,178],101:[2,178],102:[2,178],105:85,106:[2,178],107:66,114:[2,178],122:[2,178],124:[2,178],125:[2,178],128:[1,75],129:[2,178],130:[2,178],131:[2,178],132:[2,178],133:[2,178]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],46:[2,179],51:[2,179],54:[2,179],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,179],70:[2,66],71:[2,66],74:[2,179],80:[2,66],81:[2,66],82:[2,179],87:[2,179],89:[2,179],98:[2,179],100:[2,179],101:[2,179],102:[2,179],106:[2,179],114:[2,179],122:[2,179],124:[2,179],125:[2,179],128:[2,179],129:[2,179],130:[2,179],131:[2,179],132:[2,179],133:[2,179]},{59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],70:[1,98],71:[1,99],77:89,80:[1,91],81:[2,101]},{59:101,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],70:[1,98],71:[1,99],77:100,80:[1,91],81:[2,101]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],68:[2,69],69:[2,69],70:[2,69],71:[2,69],74:[2,69],80:[2,69],81:[2,69],82:[2,69],87:[2,69],89:[2,69],98:[2,69],100:[2,69],101:[2,69],102:[2,69],106:[2,69],114:[2,69],122:[2,69],124:[2,69],125:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],46:[2,180],51:[2,180],54:[2,180],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,180],70:[2,66],71:[2,66],74:[2,180],80:[2,66],81:[2,66],82:[2,180],87:[2,180],89:[2,180],98:[2,180],100:[2,180],101:[2,180],102:[2,180],106:[2,180],114:[2,180],122:[2,180],124:[2,180],125:[2,180],128:[2,180],129:[2,180],130:[2,180],131:[2,180],132:[2,180],133:[2,180]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],46:[2,181],51:[2,181],54:[2,181],69:[2,181],74:[2,181],82:[2,181],87:[2,181],89:[2,181],98:[2,181],100:[2,181],101:[2,181],102:[2,181],106:[2,181],114:[2,181],122:[2,181],124:[2,181],125:[2,181],128:[2,181],129:[2,181],130:[2,181],131:[2,181],132:[2,181],133:[2,181]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],46:[2,182],51:[2,182],54:[2,182],69:[2,182],74:[2,182],82:[2,182],87:[2,182],89:[2,182],98:[2,182],100:[2,182],101:[2,182],102:[2,182],106:[2,182],114:[2,182],122:[2,182],124:[2,182],125:[2,182],128:[2,182],129:[2,182],130:[2,182],131:[2,182],132:[2,182],133:[2,182]},{8:202,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,203],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:204,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{5:205,25:[1,5],121:[1,206]},{1:[2,125],6:[2,125],25:[2,125],26:[2,125],46:[2,125],51:[2,125],54:[2,125],69:[2,125],74:[2,125],82:[2,125],87:[2,125],89:[2,125],93:207,94:[1,208],95:[1,209],98:[2,125],100:[2,125],101:[2,125],102:[2,125],106:[2,125],114:[2,125],122:[2,125],124:[2,125],125:[2,125],128:[2,125],129:[2,125],130:[2,125],131:[2,125],132:[2,125],133:[2,125]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],46:[2,137],51:[2,137],54:[2,137],69:[2,137],74:[2,137],82:[2,137],87:[2,137],89:[2,137],98:[2,137],100:[2,137],101:[2,137],102:[2,137],106:[2,137],114:[2,137],122:[2,137],124:[2,137],125:[2,137],128:[2,137],129:[2,137],130:[2,137],131:[2,137],132:[2,137],133:[2,137]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],46:[2,145],51:[2,145],54:[2,145],69:[2,145],74:[2,145],82:[2,145],87:[2,145],89:[2,145],98:[2,145],100:[2,145],101:[2,145],102:[2,145],106:[2,145],114:[2,145],122:[2,145],124:[2,145],125:[2,145],128:[2,145],129:[2,145],130:[2,145],131:[2,145],132:[2,145],133:[2,145]},{25:[1,210],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{116:211,118:212,119:[1,213]},{1:[2,90],6:[2,90],25:[2,90],26:[2,90],46:[2,90],51:[2,90],54:[2,90],69:[2,90],74:[2,90],82:[2,90],87:[2,90],89:[2,90],98:[2,90],100:[2,90],101:[2,90],102:[2,90],106:[2,90],114:[2,90],122:[2,90],124:[2,90],125:[2,90],128:[2,90],129:[2,90],130:[2,90],131:[2,90],132:[2,90],133:[2,90]},{14:214,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:215,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{1:[2,93],5:216,6:[2,93],25:[1,5],26:[2,93],46:[2,93],51:[2,93],54:[2,93],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,93],70:[2,66],71:[2,66],74:[2,93],76:[1,217],80:[2,66],81:[2,66],82:[2,93],87:[2,93],89:[2,93],98:[2,93],100:[2,93],101:[2,93],102:[2,93],106:[2,93],114:[2,93],122:[2,93],124:[2,93],125:[2,93],128:[2,93],129:[2,93],130:[2,93],131:[2,93],132:[2,93],133:[2,93]},{1:[2,42],6:[2,42],26:[2,42],98:[2,42],99:84,100:[2,42],102:[2,42],105:85,106:[2,42],107:66,122:[2,42],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,130],6:[2,130],26:[2,130],98:[2,130],99:84,100:[2,130],102:[2,130],105:85,106:[2,130],107:66,122:[2,130],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,71],98:[1,218]},{4:219,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,121],25:[2,121],51:[2,121],54:[1,221],87:[2,121],88:220,89:[1,187],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,108],6:[2,108],25:[2,108],26:[2,108],37:[2,108],46:[2,108],51:[2,108],54:[2,108],63:[2,108],64:[2,108],65:[2,108],68:[2,108],69:[2,108],70:[2,108],71:[2,108],74:[2,108],80:[2,108],81:[2,108],82:[2,108],87:[2,108],89:[2,108],98:[2,108],100:[2,108],101:[2,108],102:[2,108],106:[2,108],112:[2,108],113:[2,108],114:[2,108],122:[2,108],124:[2,108],125:[2,108],128:[2,108],129:[2,108],130:[2,108],131:[2,108],132:[2,108],133:[2,108]},{6:[2,49],25:[2,49],50:222,51:[1,223],87:[2,49]},{6:[2,116],25:[2,116],26:[2,116],51:[2,116],82:[2,116],87:[2,116]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:224,84:[1,55],85:[1,56],86:[1,54],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,122],25:[2,122],26:[2,122],51:[2,122],82:[2,122],87:[2,122]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],37:[2,107],40:[2,107],46:[2,107],51:[2,107],54:[2,107],63:[2,107],64:[2,107],65:[2,107],68:[2,107],69:[2,107],70:[2,107],71:[2,107],74:[2,107],76:[2,107],80:[2,107],81:[2,107],82:[2,107],87:[2,107],89:[2,107],98:[2,107],100:[2,107],101:[2,107],102:[2,107],106:[2,107],114:[2,107],122:[2,107],124:[2,107],125:[2,107],126:[2,107],127:[2,107],128:[2,107],129:[2,107],130:[2,107],131:[2,107],132:[2,107],133:[2,107],134:[2,107]},{5:225,25:[1,5],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],46:[2,133],51:[2,133],54:[2,133],69:[2,133],74:[2,133],82:[2,133],87:[2,133],89:[2,133],98:[2,133],99:84,100:[1,62],101:[1,226],102:[1,63],105:85,106:[1,65],107:66,114:[2,133],122:[2,133],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],46:[2,135],51:[2,135],54:[2,135],69:[2,135],74:[2,135],82:[2,135],87:[2,135],89:[2,135],98:[2,135],99:84,100:[1,62],101:[1,227],102:[1,63],105:85,106:[1,65],107:66,114:[2,135],122:[2,135],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],46:[2,141],51:[2,141],54:[2,141],69:[2,141],74:[2,141],82:[2,141],87:[2,141],89:[2,141],98:[2,141],100:[2,141],101:[2,141],102:[2,141],106:[2,141],114:[2,141],122:[2,141],124:[2,141],125:[2,141],128:[2,141],129:[2,141],130:[2,141],131:[2,141],132:[2,141],133:[2,141]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],46:[2,142],51:[2,142],54:[2,142],69:[2,142],74:[2,142],82:[2,142],87:[2,142],89:[2,142],98:[2,142],99:84,100:[1,62],101:[2,142],102:[1,63],105:85,106:[1,65],107:66,114:[2,142],122:[2,142],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],46:[2,146],51:[2,146],54:[2,146],69:[2,146],74:[2,146],82:[2,146],87:[2,146],89:[2,146],98:[2,146],100:[2,146],101:[2,146],102:[2,146],106:[2,146],114:[2,146],122:[2,146],124:[2,146],125:[2,146],128:[2,146],129:[2,146],130:[2,146],131:[2,146],132:[2,146],133:[2,146]},{112:[2,148],113:[2,148]},{27:157,28:[1,70],55:158,56:159,72:[1,67],86:[1,113],109:228,111:156},{51:[1,229],112:[2,153],113:[2,153]},{51:[2,150],112:[2,150],113:[2,150]},{51:[2,151],112:[2,151],113:[2,151]},{51:[2,152],112:[2,152],113:[2,152]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],46:[2,147],51:[2,147],54:[2,147],69:[2,147],74:[2,147],82:[2,147],87:[2,147],89:[2,147],98:[2,147],100:[2,147],101:[2,147],102:[2,147],106:[2,147],114:[2,147],122:[2,147],124:[2,147],125:[2,147],128:[2,147],129:[2,147],130:[2,147],131:[2,147],132:[2,147],133:[2,147]},{8:230,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:231,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,49],25:[2,49],50:232,51:[1,233],74:[2,49]},{6:[2,85],25:[2,85],26:[2,85],51:[2,85],74:[2,85]},{6:[2,35],25:[2,35],26:[2,35],40:[1,234],51:[2,35],74:[2,35]},{6:[2,38],25:[2,38],26:[2,38],51:[2,38],74:[2,38]},{6:[2,39],25:[2,39],26:[2,39],40:[2,39],51:[2,39],74:[2,39]},{6:[2,40],25:[2,40],26:[2,40],40:[2,40],51:[2,40],74:[2,40]},{6:[2,41],25:[2,41],26:[2,41],40:[2,41],51:[2,41],74:[2,41]},{1:[2,5],6:[2,5],26:[2,5],98:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],46:[2,25],51:[2,25],54:[2,25],69:[2,25],74:[2,25],82:[2,25],87:[2,25],89:[2,25],94:[2,25],95:[2,25],98:[2,25],100:[2,25],101:[2,25],102:[2,25],106:[2,25],114:[2,25],117:[2,25],119:[2,25],122:[2,25],124:[2,25],125:[2,25],128:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],46:[2,184],51:[2,184],54:[2,184],69:[2,184],74:[2,184],82:[2,184],87:[2,184],89:[2,184],98:[2,184],99:84,100:[2,184],101:[2,184],102:[2,184],105:85,106:[2,184],107:66,114:[2,184],122:[2,184],124:[2,184],125:[2,184],128:[1,75],129:[1,78],130:[2,184],131:[2,184],132:[2,184],133:[2,184]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],46:[2,185],51:[2,185],54:[2,185],69:[2,185],74:[2,185],82:[2,185],87:[2,185],89:[2,185],98:[2,185],99:84,100:[2,185],101:[2,185],102:[2,185],105:85,106:[2,185],107:66,114:[2,185],122:[2,185],124:[2,185],125:[2,185],128:[1,75],129:[1,78],130:[2,185],131:[2,185],132:[2,185],133:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],46:[2,186],51:[2,186],54:[2,186],69:[2,186],74:[2,186],82:[2,186],87:[2,186],89:[2,186],98:[2,186],99:84,100:[2,186],101:[2,186],102:[2,186],105:85,106:[2,186],107:66,114:[2,186],122:[2,186],124:[2,186],125:[2,186],128:[1,75],129:[2,186],130:[2,186],131:[2,186],132:[2,186],133:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],46:[2,187],51:[2,187],54:[2,187],69:[2,187],74:[2,187],82:[2,187],87:[2,187],89:[2,187],98:[2,187],99:84,100:[2,187],101:[2,187],102:[2,187],105:85,106:[2,187],107:66,114:[2,187],122:[2,187],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[2,187],131:[2,187],132:[2,187],133:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],46:[2,188],51:[2,188],54:[2,188],69:[2,188],74:[2,188],82:[2,188],87:[2,188],89:[2,188],98:[2,188],99:84,100:[2,188],101:[2,188],102:[2,188],105:85,106:[2,188],107:66,114:[2,188],122:[2,188],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[2,188],132:[2,188],133:[1,82]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],46:[2,189],51:[2,189],54:[2,189],69:[2,189],74:[2,189],82:[2,189],87:[2,189],89:[2,189],98:[2,189],99:84,100:[2,189],101:[2,189],102:[2,189],105:85,106:[2,189],107:66,114:[2,189],122:[2,189],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[2,189],133:[1,82]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],46:[2,190],51:[2,190],54:[2,190],69:[2,190],74:[2,190],82:[2,190],87:[2,190],89:[2,190],98:[2,190],99:84,100:[2,190],101:[2,190],102:[2,190],105:85,106:[2,190],107:66,114:[2,190],122:[2,190],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[2,190],132:[2,190],133:[2,190]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],46:[2,175],51:[2,175],54:[2,175],69:[2,175],74:[2,175],82:[2,175],87:[2,175],89:[2,175],98:[2,175],99:84,100:[1,62],101:[2,175],102:[1,63],105:85,106:[1,65],107:66,114:[2,175],122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],46:[2,174],51:[2,174],54:[2,174],69:[2,174],74:[2,174],82:[2,174],87:[2,174],89:[2,174],98:[2,174],99:84,100:[1,62],101:[2,174],102:[1,63],105:85,106:[1,65],107:66,114:[2,174],122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,97],6:[2,97],25:[2,97],26:[2,97],46:[2,97],51:[2,97],54:[2,97],63:[2,97],64:[2,97],65:[2,97],68:[2,97],69:[2,97],70:[2,97],71:[2,97],74:[2,97],80:[2,97],81:[2,97],82:[2,97],87:[2,97],89:[2,97],98:[2,97],100:[2,97],101:[2,97],102:[2,97],106:[2,97],114:[2,97],122:[2,97],124:[2,97],125:[2,97],128:[2,97],129:[2,97],130:[2,97],131:[2,97],132:[2,97],133:[2,97]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],37:[2,74],46:[2,74],51:[2,74],54:[2,74],63:[2,74],64:[2,74],65:[2,74],68:[2,74],69:[2,74],70:[2,74],71:[2,74],74:[2,74],76:[2,74],80:[2,74],81:[2,74],82:[2,74],87:[2,74],89:[2,74],98:[2,74],100:[2,74],101:[2,74],102:[2,74],106:[2,74],114:[2,74],122:[2,74],124:[2,74],125:[2,74],126:[2,74],127:[2,74],128:[2,74],129:[2,74],130:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],37:[2,75],46:[2,75],51:[2,75],54:[2,75],63:[2,75],64:[2,75],65:[2,75],68:[2,75],69:[2,75],70:[2,75],71:[2,75],74:[2,75],76:[2,75],80:[2,75],81:[2,75],82:[2,75],87:[2,75],89:[2,75],98:[2,75],100:[2,75],101:[2,75],102:[2,75],106:[2,75],114:[2,75],122:[2,75],124:[2,75],125:[2,75],126:[2,75],127:[2,75],128:[2,75],129:[2,75],130:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],37:[2,76],46:[2,76],51:[2,76],54:[2,76],63:[2,76],64:[2,76],65:[2,76],68:[2,76],69:[2,76],70:[2,76],71:[2,76],74:[2,76],76:[2,76],80:[2,76],81:[2,76],82:[2,76],87:[2,76],89:[2,76],98:[2,76],100:[2,76],101:[2,76],102:[2,76],106:[2,76],114:[2,76],122:[2,76],124:[2,76],125:[2,76],126:[2,76],127:[2,76],128:[2,76],129:[2,76],130:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76]},{54:[1,188],69:[1,235],88:236,89:[1,187],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:237,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{13:[2,110],28:[2,110],30:[2,110],31:[2,110],33:[2,110],34:[2,110],35:[2,110],42:[2,110],43:[2,110],44:[2,110],48:[2,110],49:[2,110],69:[2,110],72:[2,110],75:[2,110],79:[2,110],84:[2,110],85:[2,110],86:[2,110],92:[2,110],96:[2,110],97:[2,110],100:[2,110],102:[2,110],104:[2,110],106:[2,110],115:[2,110],121:[2,110],123:[2,110],124:[2,110],125:[2,110],126:[2,110],127:[2,110]},{13:[2,111],28:[2,111],30:[2,111],31:[2,111],33:[2,111],34:[2,111],35:[2,111],42:[2,111],43:[2,111],44:[2,111],48:[2,111],49:[2,111],69:[2,111],72:[2,111],75:[2,111],79:[2,111],84:[2,111],85:[2,111],86:[2,111],92:[2,111],96:[2,111],97:[2,111],100:[2,111],102:[2,111],104:[2,111],106:[2,111],115:[2,111],121:[2,111],123:[2,111],124:[2,111],125:[2,111],126:[2,111],127:[2,111]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],37:[2,81],46:[2,81],51:[2,81],54:[2,81],63:[2,81],64:[2,81],65:[2,81],68:[2,81],69:[2,81],70:[2,81],71:[2,81],74:[2,81],76:[2,81],80:[2,81],81:[2,81],82:[2,81],87:[2,81],89:[2,81],98:[2,81],100:[2,81],101:[2,81],102:[2,81],106:[2,81],114:[2,81],122:[2,81],124:[2,81],125:[2,81],126:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81]},{8:238,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],37:[2,82],46:[2,82],51:[2,82],54:[2,82],63:[2,82],64:[2,82],65:[2,82],68:[2,82],69:[2,82],70:[2,82],71:[2,82],74:[2,82],76:[2,82],80:[2,82],81:[2,82],82:[2,82],87:[2,82],89:[2,82],98:[2,82],100:[2,82],101:[2,82],102:[2,82],106:[2,82],114:[2,82],122:[2,82],124:[2,82],125:[2,82],126:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],46:[2,98],51:[2,98],54:[2,98],63:[2,98],64:[2,98],65:[2,98],68:[2,98],69:[2,98],70:[2,98],71:[2,98],74:[2,98],80:[2,98],81:[2,98],82:[2,98],87:[2,98],89:[2,98],98:[2,98],100:[2,98],101:[2,98],102:[2,98],106:[2,98],114:[2,98],122:[2,98],124:[2,98],125:[2,98],128:[2,98],129:[2,98],130:[2,98],131:[2,98],132:[2,98],133:[2,98]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],46:[2,33],51:[2,33],54:[2,33],69:[2,33],74:[2,33],82:[2,33],87:[2,33],89:[2,33],98:[2,33],99:84,100:[2,33],101:[2,33],102:[2,33],105:85,106:[2,33],107:66,114:[2,33],122:[2,33],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:239,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],46:[2,103],51:[2,103],54:[2,103],63:[2,103],64:[2,103],65:[2,103],68:[2,103],69:[2,103],70:[2,103],71:[2,103],74:[2,103],80:[2,103],81:[2,103],82:[2,103],87:[2,103],89:[2,103],98:[2,103],100:[2,103],101:[2,103],102:[2,103],106:[2,103],114:[2,103],122:[2,103],124:[2,103],125:[2,103],128:[2,103],129:[2,103],130:[2,103],131:[2,103],132:[2,103],133:[2,103]},{6:[2,49],25:[2,49],50:240,51:[1,223],82:[2,49]},{6:[2,121],25:[2,121],26:[2,121],51:[2,121],54:[1,241],82:[2,121],87:[2,121],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{47:242,48:[1,57],49:[1,58]},{27:108,28:[1,70],41:109,52:243,53:107,55:110,56:111,72:[1,67],85:[1,112],86:[1,113]},{46:[2,55],51:[2,55]},{8:244,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],46:[2,191],51:[2,191],54:[2,191],69:[2,191],74:[2,191],82:[2,191],87:[2,191],89:[2,191],98:[2,191],99:84,100:[2,191],101:[2,191],102:[2,191],105:85,106:[2,191],107:66,114:[2,191],122:[2,191],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:245,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],46:[2,193],51:[2,193],54:[2,193],69:[2,193],74:[2,193],82:[2,193],87:[2,193],89:[2,193],98:[2,193],99:84,100:[2,193],101:[2,193],102:[2,193],105:85,106:[2,193],107:66,114:[2,193],122:[2,193],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],46:[2,173],51:[2,173],54:[2,173],69:[2,173],74:[2,173],82:[2,173],87:[2,173],89:[2,173],98:[2,173],100:[2,173],101:[2,173],102:[2,173],106:[2,173],114:[2,173],122:[2,173],124:[2,173],125:[2,173],128:[2,173],129:[2,173],130:[2,173],131:[2,173],132:[2,173],133:[2,173]},{8:246,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,126],6:[2,126],25:[2,126],26:[2,126],46:[2,126],51:[2,126],54:[2,126],69:[2,126],74:[2,126],82:[2,126],87:[2,126],89:[2,126],94:[1,247],98:[2,126],100:[2,126],101:[2,126],102:[2,126],106:[2,126],114:[2,126],122:[2,126],124:[2,126],125:[2,126],128:[2,126],129:[2,126],130:[2,126],131:[2,126],132:[2,126],133:[2,126]},{5:248,25:[1,5]},{27:249,28:[1,70]},{116:250,118:212,119:[1,213]},{26:[1,251],117:[1,252],118:253,119:[1,213]},{26:[2,166],117:[2,166],119:[2,166]},{8:255,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],91:254,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,91],5:256,6:[2,91],25:[1,5],26:[2,91],46:[2,91],51:[2,91],54:[2,91],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,91],70:[1,98],71:[1,99],74:[2,91],77:89,80:[1,91],81:[2,101],82:[2,91],87:[2,91],89:[2,91],98:[2,91],100:[2,91],101:[2,91],102:[2,91],106:[2,91],114:[2,91],122:[2,91],124:[2,91],125:[2,91],128:[2,91],129:[2,91],130:[2,91],131:[2,91],132:[2,91],133:[2,91]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],68:[2,66],69:[2,66],70:[2,66],71:[2,66],74:[2,66],80:[2,66],81:[2,66],82:[2,66],87:[2,66],89:[2,66],98:[2,66],100:[2,66],101:[2,66],102:[2,66],106:[2,66],114:[2,66],122:[2,66],124:[2,66],125:[2,66],128:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66]},{1:[2,94],6:[2,94],25:[2,94],26:[2,94],46:[2,94],51:[2,94],54:[2,94],69:[2,94],74:[2,94],82:[2,94],87:[2,94],89:[2,94],98:[2,94],100:[2,94],101:[2,94],102:[2,94],106:[2,94],114:[2,94],122:[2,94],124:[2,94],125:[2,94],128:[2,94],129:[2,94],130:[2,94],131:[2,94],132:[2,94],133:[2,94]},{14:257,15:121,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:122,41:60,55:47,56:48,58:215,60:25,61:26,62:27,72:[1,67],79:[1,28],84:[1,55],85:[1,56],86:[1,54],97:[1,53]},{1:[2,131],6:[2,131],25:[2,131],26:[2,131],46:[2,131],51:[2,131],54:[2,131],63:[2,131],64:[2,131],65:[2,131],68:[2,131],69:[2,131],70:[2,131],71:[2,131],74:[2,131],80:[2,131],81:[2,131],82:[2,131],87:[2,131],89:[2,131],98:[2,131],100:[2,131],101:[2,131],102:[2,131],106:[2,131],114:[2,131],122:[2,131],124:[2,131],125:[2,131],128:[2,131],129:[2,131],130:[2,131],131:[2,131],132:[2,131],133:[2,131]},{6:[1,71],26:[1,258]},{8:259,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,61],13:[2,111],25:[2,61],28:[2,111],30:[2,111],31:[2,111],33:[2,111],34:[2,111],35:[2,111],42:[2,111],43:[2,111],44:[2,111],48:[2,111],49:[2,111],51:[2,61],72:[2,111],75:[2,111],79:[2,111],84:[2,111],85:[2,111],86:[2,111],87:[2,61],92:[2,111],96:[2,111],97:[2,111],100:[2,111],102:[2,111],104:[2,111],106:[2,111],115:[2,111],121:[2,111],123:[2,111],124:[2,111],125:[2,111],126:[2,111],127:[2,111]},{6:[1,261],25:[1,262],87:[1,260]},{6:[2,50],8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[2,50],26:[2,50],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],82:[2,50],84:[1,55],85:[1,56],86:[1,54],87:[2,50],90:263,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,49],25:[2,49],26:[2,49],50:264,51:[1,223]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],46:[2,170],51:[2,170],54:[2,170],69:[2,170],74:[2,170],82:[2,170],87:[2,170],89:[2,170],98:[2,170],100:[2,170],101:[2,170],102:[2,170],106:[2,170],114:[2,170],117:[2,170],122:[2,170],124:[2,170],125:[2,170],128:[2,170],129:[2,170],130:[2,170],131:[2,170],132:[2,170],133:[2,170]},{8:265,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:266,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{112:[2,149],113:[2,149]},{27:157,28:[1,70],55:158,56:159,72:[1,67],86:[1,113],111:267},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],46:[2,155],51:[2,155],54:[2,155],69:[2,155],74:[2,155],82:[2,155],87:[2,155],89:[2,155],98:[2,155],99:84,100:[2,155],101:[1,268],102:[2,155],105:85,106:[2,155],107:66,114:[1,269],122:[2,155],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],46:[2,156],51:[2,156],54:[2,156],69:[2,156],74:[2,156],82:[2,156],87:[2,156],89:[2,156],98:[2,156],99:84,100:[2,156],101:[1,270],102:[2,156],105:85,106:[2,156],107:66,114:[2,156],122:[2,156],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,272],25:[1,273],74:[1,271]},{6:[2,50],12:166,25:[2,50],26:[2,50],27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:274,39:165,41:169,43:[1,46],74:[2,50],85:[1,112]},{8:275,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,276],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],37:[2,80],46:[2,80],51:[2,80],54:[2,80],63:[2,80],64:[2,80],65:[2,80],68:[2,80],69:[2,80],70:[2,80],71:[2,80],74:[2,80],76:[2,80],80:[2,80],81:[2,80],82:[2,80],87:[2,80],89:[2,80],98:[2,80],100:[2,80],101:[2,80],102:[2,80],106:[2,80],114:[2,80],122:[2,80],124:[2,80],125:[2,80],126:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80]},{8:277,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,69:[1,278],72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{69:[1,279],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{69:[1,235],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{26:[1,280],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,261],25:[1,262],82:[1,281]},{6:[2,61],25:[2,61],26:[2,61],51:[2,61],82:[2,61],87:[2,61]},{5:282,25:[1,5]},{46:[2,53],51:[2,53]},{46:[2,56],51:[2,56],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{26:[1,283],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{5:284,25:[1,5],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{5:285,25:[1,5]},{1:[2,127],6:[2,127],25:[2,127],26:[2,127],46:[2,127],51:[2,127],54:[2,127],69:[2,127],74:[2,127],82:[2,127],87:[2,127],89:[2,127],98:[2,127],100:[2,127],101:[2,127],102:[2,127],106:[2,127],114:[2,127],122:[2,127],124:[2,127],125:[2,127],128:[2,127],129:[2,127],130:[2,127],131:[2,127],132:[2,127],133:[2,127]},{5:286,25:[1,5]},{26:[1,287],117:[1,288],118:253,119:[1,213]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],46:[2,164],51:[2,164],54:[2,164],69:[2,164],74:[2,164],82:[2,164],87:[2,164],89:[2,164],98:[2,164],100:[2,164],101:[2,164],102:[2,164],106:[2,164],114:[2,164],122:[2,164],124:[2,164],125:[2,164],128:[2,164],129:[2,164],130:[2,164],131:[2,164],132:[2,164],133:[2,164]},{5:289,25:[1,5]},{26:[2,167],117:[2,167],119:[2,167]},{5:290,25:[1,5],51:[1,291]},{25:[2,123],51:[2,123],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,92],6:[2,92],25:[2,92],26:[2,92],46:[2,92],51:[2,92],54:[2,92],69:[2,92],74:[2,92],82:[2,92],87:[2,92],89:[2,92],98:[2,92],100:[2,92],101:[2,92],102:[2,92],106:[2,92],114:[2,92],122:[2,92],124:[2,92],125:[2,92],128:[2,92],129:[2,92],130:[2,92],131:[2,92],132:[2,92],133:[2,92]},{1:[2,95],5:292,6:[2,95],25:[1,5],26:[2,95],46:[2,95],51:[2,95],54:[2,95],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:96,68:[1,97],69:[2,95],70:[1,98],71:[1,99],74:[2,95],77:89,80:[1,91],81:[2,101],82:[2,95],87:[2,95],89:[2,95],98:[2,95],100:[2,95],101:[2,95],102:[2,95],106:[2,95],114:[2,95],122:[2,95],124:[2,95],125:[2,95],128:[2,95],129:[2,95],130:[2,95],131:[2,95],132:[2,95],133:[2,95]},{98:[1,293]},{87:[1,294],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],37:[2,109],46:[2,109],51:[2,109],54:[2,109],63:[2,109],64:[2,109],65:[2,109],68:[2,109],69:[2,109],70:[2,109],71:[2,109],74:[2,109],80:[2,109],81:[2,109],82:[2,109],87:[2,109],89:[2,109],98:[2,109],100:[2,109],101:[2,109],102:[2,109],106:[2,109],112:[2,109],113:[2,109],114:[2,109],122:[2,109],124:[2,109],125:[2,109],128:[2,109],129:[2,109],130:[2,109],131:[2,109],132:[2,109],133:[2,109]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],90:295,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:197,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,145],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:146,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],83:296,84:[1,55],85:[1,56],86:[1,54],90:144,92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[2,117],25:[2,117],26:[2,117],51:[2,117],82:[2,117],87:[2,117]},{6:[1,261],25:[1,262],26:[1,297]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],46:[2,134],51:[2,134],54:[2,134],69:[2,134],74:[2,134],82:[2,134],87:[2,134],89:[2,134],98:[2,134],99:84,100:[1,62],101:[2,134],102:[1,63],105:85,106:[1,65],107:66,114:[2,134],122:[2,134],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],46:[2,136],51:[2,136],54:[2,136],69:[2,136],74:[2,136],82:[2,136],87:[2,136],89:[2,136],98:[2,136],99:84,100:[1,62],101:[2,136],102:[1,63],105:85,106:[1,65],107:66,114:[2,136],122:[2,136],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{112:[2,154],113:[2,154]},{8:298,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:299,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:300,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],37:[2,83],46:[2,83],51:[2,83],54:[2,83],63:[2,83],64:[2,83],65:[2,83],68:[2,83],69:[2,83],70:[2,83],71:[2,83],74:[2,83],80:[2,83],81:[2,83],82:[2,83],87:[2,83],89:[2,83],98:[2,83],100:[2,83],101:[2,83],102:[2,83],106:[2,83],112:[2,83],113:[2,83],114:[2,83],122:[2,83],124:[2,83],125:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83]},{12:166,27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:301,39:165,41:169,43:[1,46],85:[1,112]},{6:[2,84],12:166,25:[2,84],26:[2,84],27:167,28:[1,70],29:168,30:[1,68],31:[1,69],38:164,39:165,41:169,43:[1,46],51:[2,84],73:302,85:[1,112]},{6:[2,86],25:[2,86],26:[2,86],51:[2,86],74:[2,86]},{6:[2,36],25:[2,36],26:[2,36],51:[2,36],74:[2,36],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{8:303,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{69:[1,304],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],37:[2,114],46:[2,114],51:[2,114],54:[2,114],63:[2,114],64:[2,114],65:[2,114],68:[2,114],69:[2,114],70:[2,114],71:[2,114],74:[2,114],76:[2,114],80:[2,114],81:[2,114],82:[2,114],87:[2,114],89:[2,114],98:[2,114],100:[2,114],101:[2,114],102:[2,114],106:[2,114],114:[2,114],122:[2,114],124:[2,114],125:[2,114],126:[2,114],127:[2,114],128:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],37:[2,115],46:[2,115],51:[2,115],54:[2,115],63:[2,115],64:[2,115],65:[2,115],68:[2,115],69:[2,115],70:[2,115],71:[2,115],74:[2,115],76:[2,115],80:[2,115],81:[2,115],82:[2,115],87:[2,115],89:[2,115],98:[2,115],100:[2,115],101:[2,115],102:[2,115],106:[2,115],114:[2,115],122:[2,115],124:[2,115],125:[2,115],126:[2,115],127:[2,115],128:[2,115],129:[2,115],130:[2,115],131:[2,115],132:[2,115],133:[2,115],134:[2,115]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],46:[2,34],51:[2,34],54:[2,34],69:[2,34],74:[2,34],82:[2,34],87:[2,34],89:[2,34],98:[2,34],100:[2,34],101:[2,34],102:[2,34],106:[2,34],114:[2,34],122:[2,34],124:[2,34],125:[2,34],128:[2,34],129:[2,34],130:[2,34],131:[2,34],132:[2,34],133:[2,34]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],46:[2,104],51:[2,104],54:[2,104],63:[2,104],64:[2,104],65:[2,104],68:[2,104],69:[2,104],70:[2,104],71:[2,104],74:[2,104],80:[2,104],81:[2,104],82:[2,104],87:[2,104],89:[2,104],98:[2,104],100:[2,104],101:[2,104],102:[2,104],106:[2,104],114:[2,104],122:[2,104],124:[2,104],125:[2,104],128:[2,104],129:[2,104],130:[2,104],131:[2,104],132:[2,104],133:[2,104]},{1:[2,45],6:[2,45],25:[2,45],26:[2,45],46:[2,45],51:[2,45],54:[2,45],69:[2,45],74:[2,45],82:[2,45],87:[2,45],89:[2,45],98:[2,45],100:[2,45],101:[2,45],102:[2,45],106:[2,45],114:[2,45],122:[2,45],124:[2,45],125:[2,45],128:[2,45],129:[2,45],130:[2,45],131:[2,45],132:[2,45],133:[2,45]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],46:[2,192],51:[2,192],54:[2,192],69:[2,192],74:[2,192],82:[2,192],87:[2,192],89:[2,192],98:[2,192],100:[2,192],101:[2,192],102:[2,192],106:[2,192],114:[2,192],122:[2,192],124:[2,192],125:[2,192],128:[2,192],129:[2,192],130:[2,192],131:[2,192],132:[2,192],133:[2,192]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],46:[2,171],51:[2,171],54:[2,171],69:[2,171],74:[2,171],82:[2,171],87:[2,171],89:[2,171],98:[2,171],100:[2,171],101:[2,171],102:[2,171],106:[2,171],114:[2,171],117:[2,171],122:[2,171],124:[2,171],125:[2,171],128:[2,171],129:[2,171],130:[2,171],131:[2,171],132:[2,171],133:[2,171]},{1:[2,128],6:[2,128],25:[2,128],26:[2,128],46:[2,128],51:[2,128],54:[2,128],69:[2,128],74:[2,128],82:[2,128],87:[2,128],89:[2,128],98:[2,128],100:[2,128],101:[2,128],102:[2,128],106:[2,128],114:[2,128],122:[2,128],124:[2,128],125:[2,128],128:[2,128],129:[2,128],130:[2,128],131:[2,128],132:[2,128],133:[2,128]},{1:[2,129],6:[2,129],25:[2,129],26:[2,129],46:[2,129],51:[2,129],54:[2,129],69:[2,129],74:[2,129],82:[2,129],87:[2,129],89:[2,129],94:[2,129],98:[2,129],100:[2,129],101:[2,129],102:[2,129],106:[2,129],114:[2,129],122:[2,129],124:[2,129],125:[2,129],128:[2,129],129:[2,129],130:[2,129],131:[2,129],132:[2,129],133:[2,129]},{1:[2,162],6:[2,162],25:[2,162],26:[2,162],46:[2,162],51:[2,162],54:[2,162],69:[2,162],74:[2,162],82:[2,162],87:[2,162],89:[2,162],98:[2,162],100:[2,162],101:[2,162],102:[2,162],106:[2,162],114:[2,162],122:[2,162],124:[2,162],125:[2,162],128:[2,162],129:[2,162],130:[2,162],131:[2,162],132:[2,162],133:[2,162]},{5:305,25:[1,5]},{26:[1,306]},{6:[1,307],26:[2,168],117:[2,168],119:[2,168]},{8:308,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],46:[2,96],51:[2,96],54:[2,96],69:[2,96],74:[2,96],82:[2,96],87:[2,96],89:[2,96],98:[2,96],100:[2,96],101:[2,96],102:[2,96],106:[2,96],114:[2,96],122:[2,96],124:[2,96],125:[2,96],128:[2,96],129:[2,96],130:[2,96],131:[2,96],132:[2,96],133:[2,96]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],46:[2,132],51:[2,132],54:[2,132],63:[2,132],64:[2,132],65:[2,132],68:[2,132],69:[2,132],70:[2,132],71:[2,132],74:[2,132],80:[2,132],81:[2,132],82:[2,132],87:[2,132],89:[2,132],98:[2,132],100:[2,132],101:[2,132],102:[2,132],106:[2,132],114:[2,132],122:[2,132],124:[2,132],125:[2,132],128:[2,132],129:[2,132],130:[2,132],131:[2,132],132:[2,132],133:[2,132]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],46:[2,112],51:[2,112],54:[2,112],63:[2,112],64:[2,112],65:[2,112],68:[2,112],69:[2,112],70:[2,112],71:[2,112],74:[2,112],80:[2,112],81:[2,112],82:[2,112],87:[2,112],89:[2,112],98:[2,112],100:[2,112],101:[2,112],102:[2,112],106:[2,112],114:[2,112],122:[2,112],124:[2,112],125:[2,112],128:[2,112],129:[2,112],130:[2,112],131:[2,112],132:[2,112],133:[2,112]},{6:[2,118],25:[2,118],26:[2,118],51:[2,118],82:[2,118],87:[2,118]},{6:[2,49],25:[2,49],26:[2,49],50:309,51:[1,223]},{6:[2,119],25:[2,119],26:[2,119],51:[2,119],82:[2,119],87:[2,119]},{1:[2,157],6:[2,157],25:[2,157],26:[2,157],46:[2,157],51:[2,157],54:[2,157],69:[2,157],74:[2,157],82:[2,157],87:[2,157],89:[2,157],98:[2,157],99:84,100:[2,157],101:[2,157],102:[2,157],105:85,106:[2,157],107:66,114:[1,310],122:[2,157],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,159],6:[2,159],25:[2,159],26:[2,159],46:[2,159],51:[2,159],54:[2,159],69:[2,159],74:[2,159],82:[2,159],87:[2,159],89:[2,159],98:[2,159],99:84,100:[2,159],101:[1,311],102:[2,159],105:85,106:[2,159],107:66,114:[2,159],122:[2,159],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,158],6:[2,158],25:[2,158],26:[2,158],46:[2,158],51:[2,158],54:[2,158],69:[2,158],74:[2,158],82:[2,158],87:[2,158],89:[2,158],98:[2,158],99:84,100:[2,158],101:[2,158],102:[2,158],105:85,106:[2,158],107:66,114:[2,158],122:[2,158],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[2,87],25:[2,87],26:[2,87],51:[2,87],74:[2,87]},{6:[2,49],25:[2,49],26:[2,49],50:312,51:[1,233]},{26:[1,313],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],37:[2,113],46:[2,113],51:[2,113],54:[2,113],63:[2,113],64:[2,113],65:[2,113],68:[2,113],69:[2,113],70:[2,113],71:[2,113],74:[2,113],76:[2,113],80:[2,113],81:[2,113],82:[2,113],87:[2,113],89:[2,113],98:[2,113],100:[2,113],101:[2,113],102:[2,113],106:[2,113],114:[2,113],122:[2,113],124:[2,113],125:[2,113],126:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113]},{26:[1,314]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],46:[2,165],51:[2,165],54:[2,165],69:[2,165],74:[2,165],82:[2,165],87:[2,165],89:[2,165],98:[2,165],100:[2,165],101:[2,165],102:[2,165],106:[2,165],114:[2,165],122:[2,165],124:[2,165],125:[2,165],128:[2,165],129:[2,165],130:[2,165],131:[2,165],132:[2,165],133:[2,165]},{26:[2,169],117:[2,169],119:[2,169]},{25:[2,124],51:[2,124],99:84,100:[1,62],102:[1,63],105:85,106:[1,65],107:66,122:[1,83],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[1,261],25:[1,262],26:[1,315]},{8:316,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{8:317,9:116,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,72:[1,67],75:[1,43],79:[1,28],84:[1,55],85:[1,56],86:[1,54],92:[1,38],96:[1,45],97:[1,53],99:39,100:[1,62],102:[1,63],103:40,104:[1,64],105:41,106:[1,65],107:66,115:[1,42],120:37,121:[1,61],123:[1,31],124:[1,32],125:[1,33],126:[1,34],127:[1,35]},{6:[1,272],25:[1,273],26:[1,318]},{6:[2,37],25:[2,37],26:[2,37],51:[2,37],74:[2,37]},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],46:[2,163],51:[2,163],54:[2,163],69:[2,163],74:[2,163],82:[2,163],87:[2,163],89:[2,163],98:[2,163],100:[2,163],101:[2,163],102:[2,163],106:[2,163],114:[2,163],122:[2,163],124:[2,163],125:[2,163],128:[2,163],129:[2,163],130:[2,163],131:[2,163],132:[2,163],133:[2,163]},{6:[2,120],25:[2,120],26:[2,120],51:[2,120],82:[2,120],87:[2,120]},{1:[2,160],6:[2,160],25:[2,160],26:[2,160],46:[2,160],51:[2,160],54:[2,160],69:[2,160],74:[2,160],82:[2,160],87:[2,160],89:[2,160],98:[2,160],99:84,100:[2,160],101:[2,160],102:[2,160],105:85,106:[2,160],107:66,114:[2,160],122:[2,160],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{1:[2,161],6:[2,161],25:[2,161],26:[2,161],46:[2,161],51:[2,161],54:[2,161],69:[2,161],74:[2,161],82:[2,161],87:[2,161],89:[2,161],98:[2,161],99:84,100:[2,161],101:[2,161],102:[2,161],105:85,106:[2,161],107:66,114:[2,161],122:[2,161],124:[1,77],125:[1,76],128:[1,75],129:[1,78],130:[1,79],131:[1,80],132:[1,81],133:[1,82]},{6:[2,88],25:[2,88],26:[2,88],51:[2,88],74:[2,88]}],defaultActions:{57:[2,47],58:[2,48],72:[2,3],91:[2,102]},parseError:function d(a,b){throw new Error(a)},parse:function e(a){function m(){var a;a=b.lexer.lex()||1,typeof a!==\"number\"&&(a=b.symbols_[a]||a);return a}function l(a){c.length=c.length-2*a,d.length=d.length-a}var b=this,c=[0],d=[null],e=this.table,f=\"\",g=0,h=0,i=0,j=2,k=1;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.yy.parseError===\"function\"&&(this.parseError=this.yy.parseError);var n,o,p,q,r,s,t={},u,v,w,x;while(!0){p=c[c.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(n==null&&(n=m()),q=e[p]&&e[p][n]);if(typeof q===\"undefined\"||!q.length||!q[0]){if(!i){x=[];for(u in e[p])this.terminals_[u]&&u>2&&x.push(\"'\"+this.terminals_[u]+\"'\");var y=\"\";this.lexer.showPosition?y=\"Parse error on line \"+(g+1)+\":\\n\"+this.lexer.showPosition()+\"\\nExpecting \"+x.join(\", \"):y=\"Parse error on line \"+(g+1)+\": Unexpected \"+(n==1?\"end of input\":\"'\"+(this.terminals_[n]||n)+\"'\"),this.parseError(y,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,expected:x})}if(i==3){if(n==k)throw new Error(y||\"Parsing halted.\");h=this.lexer.yyleng,f=this.lexer.yytext,g=this.lexer.yylineno,n=m()}while(1){if(j.toString()in e[p])break;if(p==0)throw new Error(y||\"Parsing halted.\");l(1),p=c[c.length-1]}o=n,n=j,p=c[c.length-1],q=e[p]&&e[p][j],i=3}if(q[0]instanceof Array&&q.length>1)throw new Error(\"Parse Error: multiple actions possible at state: \"+p+\", token: \"+n);switch(q[0]){case 1:c.push(n),d.push(this.lexer.yytext),c.push(q[1]),n=null,o?(n=o,o=null):(h=this.lexer.yyleng,f=this.lexer.yytext,g=this.lexer.yylineno,i>0&&i--);break;case 2:v=this.productions_[q[1]][1],t.$=d[d.length-v],s=this.performAction.call(t,f,h,g,this.yy,q[1],d);if(typeof s!==\"undefined\")return s;v&&(c=c.slice(0,-1*v*2),d=d.slice(0,-1*v)),c.push(this.productions_[q[1]][0]),d.push(t.$),w=e[c[c.length-2]][c[c.length-1]],c.push(w);break;case 3:return!0}}return!0}};return a}();typeof require!==\"undefined\"&&(a.parser=b,a.parse=function(){return b.parse.apply(b,arguments)},a.main=function c(b){if(!b[1])throw new Error(\"Usage: \"+b[0]+\" FILE\");if(typeof process!==\"undefined\")var c=require(\"fs\").readFileSync(require(\"path\").join(process.cwd(),b[1]),\"utf8\");else var d=require(\"file\").path(require(\"file\").cwd()),c=d.join(b[1]).read({charset:\"utf-8\"});return a.parser.parse(c)},typeof module!==\"undefined\"&&require.main===module&&a.main(typeof process!==\"undefined\"?process.argv.slice(1):require(\"system\").args))},require[\"./scope\"]=new function(){var a=this;(function(){var b,c,d,e;e=require(\"./helpers\"),c=e.extend,d=e.last,a.Scope=b=function(){function a(b,c,d){this.parent=b,this.expressions=c,this.method=d,this.variables=[{name:\"arguments\",type:\"arguments\"}],this.positions={},this.parent||(a.root=this)}a.root=null,a.prototype.add=function(a,b,c){var d;if(this.shared&&!c)return this.parent.add(a,b,c);return typeof (d=this.positions[a])===\"number\"?this.variables[d].type=b:this.positions[a]=this.variables.push({name:a,type:b})-1},a.prototype.find=function(a,b){if(this.check(a,b))return!0;this.add(a,\"var\");return!1},a.prototype.parameter=function(a){if(!this.shared||!this.parent.check(a,!0))return this.add(a,\"param\")},a.prototype.check=function(a,b){var c,d;c=!!this.type(a);if(c||b)return c;return!!((d=this.parent)!=null?d.check(a):void 0)},a.prototype.temporary=function(a,b){return a.length>1?\"_\"+a+(b>1?b:\"\"):\"_\"+(b+parseInt(a,36)).toString(36).replace(/\\d/g,\"a\")},a.prototype.type=function(a){var b,c,d,e;e=this.variables;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.name===a)return b.type}return null},a.prototype.freeVariable=function(a){var b,c;b=0;while(this.check(c=this.temporary(a,b),!0))b++;this.add(c,\"var\",!0);return c},a.prototype.assign=function(a,b){this.add(a,{value:b,assigned:!0});return this.hasAssignments=!0},a.prototype.hasDeclarations=function(){return!!this.declaredVariables().length},a.prototype.declaredVariables=function(){var a,b,c,d,e,f;a=[],b=[],f=this.variables;for(d=0,e=f.length;d<e;d++)c=f[d],c.type===\"var\"&&(c.name.charAt(0)===\"_\"?b:a).push(c.name);return a.sort().concat(b.sort())},a.prototype.assignedVariables=function(){var a,b,c,d,e;d=this.variables,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],a.type.assigned&&e.push(\"\"+a.name+\" = \"+a.type.value);return e};return a}()}).call(this)},require[\"./nodes\"]=new function(){var a=this;(function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ba,bb,bc,bd,be,bf,bg,bh=Object.prototype.hasOwnProperty,bi=function(a,b){function d(){this.constructor=a}for(var c in b)bh.call(b,c)&&(a[c]=b[c]);d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype;return a},bj=function(a,b){return function(){return a.apply(b,arguments)}};K=require(\"./scope\").Scope,bg=require(\"./helpers\"),X=bg.compact,_=bg.flatten,$=bg.extend,bb=bg.merge,Y=bg.del,bd=bg.starts,Z=bg.ends,ba=bg.last,a.extend=$,W=function(){return!0},B=function(){return!1},P=function(){return this},A=function(){this.negated=!this.negated;return this},a.Base=e=function(){function a(){}a.prototype.compile=function(a,b){var c;a=$({},a),b&&(a.level=b),c=this.unfoldSoak(a)||this,c.tab=a.indent;return a.level!==y&&c.isStatement(a)?c.compileClosure(a):c.compileNode(a)},a.prototype.compileClosure=function(a){if(this.jumps())throw SyntaxError(\"cannot use a pure statement in an expression.\");a.sharedScope=!0;return i.wrap(this).compileNode(a)},a.prototype.cache=function(a,b,c){var e,f;if(this.isComplex()){e=new z(c||a.scope.freeVariable(\"ref\")),f=new d(e,this);return b?[f.compile(a,b),e.value]:[f,e]}e=b?this.compile(a,b):this;return[e,e]},a.prototype.compileLoopReference=function(a,b){var c,d,e;c=d=this.compile(a,v),-Infinity<(e=+c)&&e<Infinity||o.test(c)&&a.scope.check(c,!0)||(c=\"\"+(d=a.scope.freeVariable(b))+\" = \"+c);return[c,d]},a.prototype.makeReturn=function(){return new I(this)},a.prototype.contains=function(a){var b;b=!1,this.traverseChildren(!1,function(c){if(a(c)){b=!0;return!1}});return b},a.prototype.containsType=function(a){return this instanceof a||this.contains(function(b){return b instanceof a})},a.prototype.lastNonComment=function(a){var b;b=a.length;while(b--)if(!(a[b]instanceof k))return a[b];return null},a.prototype.toString=function(a,b){var c;a==null&&(a=\"\"),b==null&&(b=this.constructor.name),c=\"\\n\"+a+b,this.soak&&(c+=\"?\"),this.eachChild(function(b){return c+=b.toString(a+O)});return c},a.prototype.eachChild=function(a){var b,c,d,e,f,g,h,i;if(!this.children)return this;h=this.children;for(d=0,f=h.length;d<f;d++){b=h[d];if(this[b]){i=_([this[b]]);for(e=0,g=i.length;e<g;e++){c=i[e];if(a(c)===!1)return this}}}return this},a.prototype.traverseChildren=function(a,b){return this.eachChild(function(c){if(b(c)===!1)return!1;return c.traverseChildren(a,b)})},a.prototype.invert=function(){return new D(\"!\",this)},a.prototype.unwrapAll=function(){var a;a=this;while(a!==(a=a.unwrap()))continue;return a},a.prototype.children=[],a.prototype.isStatement=B,a.prototype.jumps=B,a.prototype.isComplex=W,a.prototype.isChainable=B,a.prototype.isAssignable=B,a.prototype.unwrap=P,a.prototype.unfoldSoak=B,a.prototype.assigns=B;return a}(),a.Block=f=function(){function a(a){this.expressions=X(_(a||[]))}bi(a,e),a.prototype.children=[\"expressions\"],a.prototype.push=function(a){this.expressions.push(a);return this},a.prototype.pop=function(){return this.expressions.pop()},a.prototype.unshift=function(a){this.expressions.unshift(a);return this},a.prototype.unwrap=function(){return this.expressions.length===1?this.expressions[0]:this},a.prototype.isEmpty=function(){return!this.expressions.length},a.prototype.isStatement=function(a){var b,c,d,e;e=this.expressions;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.isStatement(a))return!0}return!1},a.prototype.jumps=function(a){var b,c,d,e;e=this.expressions;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.jumps(a))return b}},a.prototype.makeReturn=function(){var a,b;b=this.expressions.length;while(b--){a=this.expressions[b];if(!(a instanceof k)){this.expressions[b]=a.makeReturn(),a instanceof I&&!a.expression&&this.expressions.splice(b,1);break}}return this},a.prototype.compile=function(b,c){b==null&&(b={});return b.scope?a.__super__.compile.call(this,b,c):this.compileRoot(b)},a.prototype.compileNode=function(a){var b,c,d,e,f,g,h;this.tab=a.indent,e=a.level===y,c=[],h=this.expressions;for(f=0,g=h.length;f<g;f++)d=h[f],d=d.unwrapAll(),d=d.unfoldSoak(a)||d,e?(d.front=!0,b=d.compile(a),c.push(d.isStatement(a)?b:this.tab+b+\";\")):c.push(d.compile(a,v));if(e)return c.join(\"\\n\");b=c.join(\", \")||\"void 0\";return c.length>1&&a.level>=v?\"(\"+b+\")\":b},a.prototype.compileRoot=function(a){var b;a.indent=this.tab=a.bare?\"\":O,a.scope=new K(null,this,null),a.level=y,b=this.compileWithDeclarations(a),b=b.replace(Q,\"\");return a.bare?b:\"(function() {\\n\"+b+\"\\n}).call(this);\\n\"},a.prototype.compileWithDeclarations=function(a){var b,c,d,e,f,g,h,i;b=e=\"\",i=this.expressions;for(d=0,h=i.length;d<h;d++){c=i[d],c=c.unwrap();if(!(c instanceof k||c instanceof z))break}a=bb(a,{level:y}),d&&(f=this.expressions.splice(d,this.expressions.length),b=this.compileNode(a),this.expressions=f),e=this.compileNode(a),g=a.scope,g.expressions===this&&(!a.globals&&a.scope.hasDeclarations()&&(b+=\"\"+this.tab+\"var \"+g.declaredVariables().join(\", \")+\";\\n\"),g.hasAssignments&&(b+=\"\"+this.tab+\"var \"+bc(g.assignedVariables().join(\", \"),this.tab)+\";\\n\"));return b+e},a.wrap=function(b){if(b.length===1&&b[0]instanceof a)return b[0];return new a(b)};return a}(),a.Literal=z=function(){function a(a){this.value=a}bi(a,e),a.prototype.makeReturn=function(){return this.isStatement()?this:new I(this)},a.prototype.isAssignable=function(){return o.test(this.value)},a.prototype.isStatement=function(){var a;return(a=this.value)===\"break\"||a===\"continue\"||a===\"debugger\"},a.prototype.isComplex=B,a.prototype.assigns=function(a){return a===this.value},a.prototype.jumps=function(a){if(!this.isStatement())return!1;return a&&(a.loop||a.block&&this.value!==\"continue\")?!1:this},a.prototype.compileNode=function(a){var b;b=this.isUndefined?a.level>=t?\"(void 0)\":\"void 0\":this.value.reserved?'\"'+this.value+'\"':this.value;return this.isStatement()?\"\"+this.tab+b+\";\":b},a.prototype.toString=function(){return' \"'+this.value+'\"'};return a}(),a.Return=I=function(){function a(a){a&&!a.unwrap().isUndefined&&(this.expression=a)}bi(a,e),a.prototype.children=[\"expression\"],a.prototype.isStatement=W,a.prototype.makeReturn=P,a.prototype.jumps=P,a.prototype.compile=function(b,c){var d,e;d=(e=this.expression)!=null?e.makeReturn():void 0;return!d||d instanceof a?a.__super__.compile.call(this,b,c):d.compile(b,c)},a.prototype.compileNode=function(a){return this.tab+(\"return\"+(this.expression?\" \"+this.expression.compile(a,x):\"\")+\";\")};return a}(),a.Value=U=function(){function a(b,c,d){if(!c&&b instanceof a)return b;this.base=b,this.properties=c||[],d&&(this[d]=!0);return this}bi(a,e),a.prototype.children=[\"base\",\"properties\"],a.prototype.push=function(a){this.properties.push(a);return this},a.prototype.hasProperties=function(){return!!this.properties.length},a.prototype.isArray=function(){return!this.properties.length&&this.base instanceof c},a.prototype.isComplex=function(){return this.hasProperties()||this.base.isComplex()},a.prototype.isAssignable=function(){return this.hasProperties()||this.base.isAssignable()},a.prototype.isSimpleNumber=function(){return this.base instanceof z&&J.test(this.base.value)},a.prototype.isAtomic=function(){var a,b,c,d;d=this.properties.concat(this.base);for(b=0,c=d.length;b<c;b++){a=d[b];if(a.soak||a instanceof g)return!1}return!0},a.prototype.isStatement=function(a){return!this.properties.length&&this.base.isStatement(a)},a.prototype.assigns=function(a){return!this.properties.length&&this.base.assigns(a)},a.prototype.jumps=function(a){return!this.properties.length&&this.base.jumps(a)},a.prototype.isObject=function(a){if(this.properties.length)return!1;return this.base instanceof C&&(!a||this.base.generated)},a.prototype.isSplice=function(){return ba(this.properties)instanceof L},a.prototype.makeReturn=function(){return this.properties.length?a.__super__.makeReturn.call(this):this.base.makeReturn()},a.prototype.unwrap=function(){return this.properties.length?this:this.base},a.prototype.cacheReference=function(b){var c,e,f,g;f=ba(this.properties);if(this.properties.length<2&&!this.base.isComplex()&&!(f!=null?f.isComplex():void 0))return[this,this];c=new a(this.base,this.properties.slice(0,-1)),c.isComplex()&&(e=new z(b.scope.freeVariable(\"base\")),c=new a(new F(new d(e,c))));if(!f)return[c,e];f.isComplex()&&(g=new z(b.scope.freeVariable(\"name\")),f=new s(new d(g,f.index)),g=new s(g));return[c.push(f),new a(e||c.base,[g||f])]},a.prototype.compileNode=function(a){var c,d,e,f,g;this.base.front=this.front,e=this.properties,c=this.base.compile(a,e.length?t:null),e[0]instanceof b&&this.isSimpleNumber()&&(c=\"(\"+c+\")\");for(f=0,g=e.length;f<g;f++)d=e[f],c+=d.compile(a);return c},a.prototype.unfoldSoak=function(b){var c,e,f,g,h,i,j,k;if(f=this.base.unfoldSoak(b)){Array.prototype.push.apply(f.body.properties,this.properties);return f}k=this.properties;for(e=0,j=k.length;e<j;e++){g=k[e];if(g.soak){g.soak=!1,c=new a(this.base,this.properties.slice(0,e)),i=new a(this.base,this.properties.slice(e)),c.isComplex()&&(h=new z(b.scope.freeVariable(\"ref\")),c=new F(new d(h,c)),i.base=h);return new q(new l(c),i,{soak:!0})}}return null};return a}(),a.Comment=k=function(){function a(a){this.comment=a}bi(a,e),a.prototype.isStatement=W,a.prototype.makeReturn=P,a.prototype.compileNode=function(a,b){var c;c=\"/*\"+bc(this.comment,this.tab)+\"*/\",(b||a.level)===y&&(c=a.indent+c);return c};return a}(),a.Call=g=function(){function a(a,b,c){this.args=b!=null?b:[],this.soak=c,this.isNew=!1,this.isSuper=a===\"super\",this.variable=this.isSuper?null:a}bi(a,e),a.prototype.children=[\"variable\",\"args\"],a.prototype.newInstance=function(){var b;b=this.variable.base||this.variable,b instanceof a?b.newInstance():this.isNew=!0;return this},a.prototype.superReference=function(a){var b,c;b=a.scope.method;if(!b)throw SyntaxError(\"cannot call super outside of a function.\");c=b.name;if(!c)throw SyntaxError(\"cannot call super on an anonymous function.\");return b.klass?\"\"+b.klass+\".__super__.\"+c:\"\"+c+\".__super__.constructor\"},a.prototype.unfoldSoak=function(b){var c,d,e,f,g,h,i,j,k;if(this.soak){if(this.variable){if(d=be(b,this,\"variable\"))return d;j=(new U(this.variable)).cacheReference(b),e=j[0],g=j[1]}else e=new z(this.superReference(b)),g=new U(e);g=new a(g,this.args),g.isNew=this.isNew,e=new z(\"typeof \"+e.compile(b)+' == \"function\"');return new q(e,new U(g),{soak:!0})}c=this,f=[];while(!0){if(c.variable instanceof a){f.push(c),c=c.variable;continue}if(!(c.variable instanceof U))break;f.push(c);if(!((c=c.variable.base)instanceof a))break}k=f.reverse();for(h=0,i=k.length;h<i;h++)c=k[h],d&&(c.variable instanceof a?c.variable=d:c.variable.base=d),d=be(b,c,\"variable\");return d},a.prototype.compileNode=function(a){var b,c,d,e;(e=this.variable)!=null&&(e.front=this.front);if(d=M.compileSplattedArray(a,this.args,!0))return this.compileSplat(a,d);c=function(){var c,d,e,f;e=this.args,f=[];for(c=0,d=e.length;c<d;c++)b=e[c],f.push(b.compile(a,v));return f}.call(this).join(\", \");return this.isSuper?this.superReference(a)+(\".call(this\"+(c&&\", \"+c)+\")\"):(this.isNew?\"new \":\"\")+this.variable.compile(a,t)+(\"(\"+c+\")\")},a.prototype.compileSuper=function(a,b){return\"\"+this.superReference(b)+\".call(this\"+(a.length?\", \":\"\")+a+\")\"},a.prototype.compileSplat=function(a,b){var c,d,e,f,g;if(this.isSuper)return\"\"+this.superReference(a)+\".apply(this, \"+b+\")\";if(this.isNew){e=this.tab+O;return\"(function(func, args, ctor) {\\n\"+e+\"ctor.prototype = func.prototype;\\n\"+e+\"var child = new ctor, result = func.apply(child, args);\\n\"+e+'return typeof result == \"object\" ? result : child;\\n'+this.tab+\"})(\"+this.variable.compile(a,v)+\", \"+b+\", function() {})\"}c=new U(this.variable),(f=c.properties.pop())&&c.isComplex()?(g=a.scope.freeVariable(\"ref\"),d=\"(\"+g+\" = \"+c.compile(a,v)+\")\"+f.compile(a)):(d=c.compile(a,t),J.test(d)&&(d=\"(\"+d+\")\"),f?(g=d,d+=f.compile(a)):g=\"null\");return\"\"+d+\".apply(\"+g+\", \"+b+\")\"};return a}(),a.Extends=m=function(){function a(a,b){this.child=a,this.parent=b}bi(a,e),a.prototype.children=[\"child\",\"parent\"],a.prototype.compile=function(a){bf(\"hasProp\");return(new g(new U(new z(bf(\"extends\"))),[this.child,this.parent])).compile(a)};return a}(),a.Access=b=function(){function a(a,b){this.name=a,this.name.asKey=!0,this.proto=b===\"proto\"?\".prototype\":\"\",this.soak=b===\"soak\"}bi(a,e),a.prototype.children=[\"name\"],a.prototype.compile=function(a){var b;b=this.name.compile(a);return this.proto+(p.test(b)?\"[\"+b+\"]\":\".\"+b)},a.prototype.isComplex=B;return a}(),a.Index=s=function(){function a(a){this.index=a}bi(a,e),a.prototype.children=[\"index\"],a.prototype.compile=function(a){return(this.proto?\".prototype\":\"\")+(\"[\"+this.index.compile(a,x)+\"]\")},a.prototype.isComplex=function(){return this.index.isComplex()};return a}(),a.Range=H=function(){function a(a,b,c){this.from=a,this.to=b,this.exclusive=c===\"exclusive\",this.equals=this.exclusive?\"\":\"=\"}bi(a,e),a.prototype.children=[\"from\",\"to\"],a.prototype.compileVariables=function(a){var b,c,d,e;a=bb(a,{top:!0}),c=this.from.cache(a,v),this.from=c[0],this.fromVar=c[1],d=this.to.cache(a,v),this.to=d[0],this.toVar=d[1],e=[this.fromVar.match(J),this.toVar.match(J)],this.fromNum=e[0],this.toNum=e[1],b=[],this.from!==this.fromVar&&b.push(this.from);if(this.to!==this.toVar)return b.push(this.to)},a.prototype.compileNode=function(a){var b,c,d,e,f,g,h;this.compileVariables(a);if(!a.index)return this.compileArray(a);if(this.fromNum&&this.toNum)return this.compileSimple(a);c=Y(a,\"index\"),f=Y(a,\"step\"),h=\"\"+c+\" = \"+this.from+(this.to!==this.toVar?\", \"+this.to:\"\"),e=\"(\"+this.fromVar+\" <= \"+this.toVar+\" ? \"+c,b=\"\"+e+\" <\"+this.equals+\" \"+this.toVar+\" : \"+c+\" >\"+this.equals+\" \"+this.toVar+\")\",g=f?f.compile(a):\"1\",d=f?\"\"+c+\" += \"+g:\"\"+e+\" += \"+g+\" : \"+c+\" -= \"+g+\")\";return\"\"+h+\"; \"+b+\"; \"+d},a.prototype.compileSimple=function(a){var b,c,d,e,f;f=[+this.fromNum,+this.toNum],b=f[0],e=f[1],c=Y(a,\"index\"),d=Y(a,\"step\"),d&&(d=\"\"+c+\" += \"+d.compile(a));return b>e?\"\"+c+\" = \"+b+\"; \"+c+\" >\"+this.equals+\" \"+e+\"; \"+(d||\"\"+c+\"--\"):\"\"+c+\" = \"+b+\"; \"+c+\" <\"+this.equals+\" \"+e+\"; \"+(d||\"\"+c+\"++\")},a.prototype.compileArray=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n;if(this.fromNum&&this.toNum&&Math.abs(this.fromNum-this.toNum)<=20){h=function(){n=[];for(var a=l=+this.fromNum,b=+this.toNum;l<=b?a<=b:a>=b;l<=b?a+=1:a-=1)n.push(a);return n}.apply(this,arguments),this.exclusive&&h.pop();return\"[\"+h.join(\", \")+\"]\"}e=this.tab+O,d=a.scope.freeVariable(\"i\"),i=a.scope.freeVariable(\"results\"),g=\"\\n\"+e+i+\" = [];\",this.fromNum&&this.toNum?(a.index=d,b=this.compileSimple(a)):(j=\"\"+d+\" = \"+this.from+(this.to!==this.toVar?\", \"+this.to:\"\"),c=\"\"+this.fromVar+\" <= \"+this.toVar+\" ?\",b=\"var \"+j+\"; \"+c+\" \"+d+\" <\"+this.equals+\" \"+this.toVar+\" : \"+d+\" >\"+this.equals+\" \"+this.toVar+\"; \"+c+\" \"+d+\" += 1 : \"+d+\" -= 1\"),f=\"{ \"+i+\".push(\"+d+\"); }\\n\"+e+\"return \"+i+\";\\n\"+a.indent;return\"(function() {\"+g+\"\\n\"+e+\"for (\"+b+\")\"+f+\"}).apply(this, arguments)\"};return a}(),a.Slice=L=function(){function a(b){this.range=b,a.__super__.constructor.call(this)}bi(a,e),a.prototype.children=[\"range\"],a.prototype.compileNode=function(a){var b,c,d,e,f,g;g=this.range,e=g.to,c=g.from,d=c&&c.compile(a,x)||\"0\",b=e&&e.compile(a,x),e&&(this.range.exclusive||+b!==-1)&&(f=\", \"+(this.range.exclusive?b:J.test(b)?(+b+1).toString():\"(\"+b+\" + 1) || 9e9\"));return\".slice(\"+d+(f||\"\")+\")\"};return a}(),a.Obj=C=function(){function a(a,b){this.generated=b!=null?b:!1,this.objects=this.properties=a||[]}bi(a,e),a.prototype.children=[\"properties\"],a.prototype.compileNode=function(a){var b,c,e,f,g,h,i,j;j=this.properties;if(!j.length)return this.front?\"({})\":\"{}\";c=a.indent+=O,g=this.lastNonComment(this.properties),j=function(){var h,l;l=[];for(b=0,h=j.length;b<h;b++)i=j[b],f=b===j.length-1?\"\":i===g||i instanceof k?\"\\n\":\",\\n\",e=i instanceof k?\"\":c,i instanceof U&&i[\"this\"]&&(i=new d(i.properties[0].name,i,\"object\")),i instanceof k||(i instanceof d||(i=new d(i,i,\"object\")),(i.variable.base||i.variable).asKey=!0),l.push(e+i.compile(a,y)+f);return l}(),j=j.join(\"\"),h=\"{\"+(j&&\"\\n\"+j+\"\\n\"+this.tab)+\"}\";return this.front?\"(\"+h+\")\":h},a.prototype.assigns=function(a){var b,c,d,e;e=this.properties;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.assigns(a))return!0}return!1};return a}(),a.Arr=c=function(){function a(a){this.objects=a||[]}bi(a,e),a.prototype.children=[\"objects\"],a.prototype.compileNode=function(a){var b,c;if(!this.objects.length)return\"[]\";a.indent+=O;if(b=M.compileSplattedArray(a,this.objects))return b;b=function(){var b,d,e,f;e=this.objects,f=[];for(b=0,d=e.length;b<d;b++)c=e[b],f.push(c.compile(a,v));return f}.call(this).join(\", \");return b.indexOf(\"\\n\")<0?\"[\"+b+\"]\":\"[\\n\"+a.indent+b+\"\\n\"+this.tab+\"]\"},a.prototype.assigns=function(a){var b,c,d,e;e=this.objects;for(c=0,d=e.length;c<d;c++){b=e[c];if(b.assigns(a))return!0}return!1};return a}(),a.Class=h=function(){function a(a,b,c){this.variable=a,this.parent=b,this.body=c!=null?c:new f,this.boundFuncs=[],this.body.classBody=!0}bi(a,e),a.prototype.children=[\"variable\",\"parent\",\"body\"],a.prototype.determineName=function(){var a,c;if(!this.variable)return null;a=(c=ba(this.variable.properties))?c instanceof b&&c.name.value:this.variable.base.value;return a&&(a=o.test(a)&&a)},a.prototype.setContext=function(a){return this.body.traverseChildren(!1,function(b){if(b.classBody)return!1;if(b instanceof z&&b.value===\"this\")return b.value=a;if(b instanceof j){b.klass=a;if(b.bound)return b.context=a}})},a.prototype.addBoundFunctions=function(a){var b,c,d,e,f,g;if(this.boundFuncs.length){f=this.boundFuncs,g=[];for(d=0,e=f.length;d<e;d++)c=f[d],b=c.compile(a),g.push(this.ctor.body.unshift(new z(\"this.\"+b+\" = \"+bf(\"bind\")+\"(this.\"+b+\", this);\")));return g}},a.prototype.addProperties=function(a,c){var e,f,g,h,i;h=a.base.properties.slice(0),i=[];while(e=h.shift()){if(e instanceof d){f=e.variable.base,delete e.context,g=e.value;if(f.value===\"constructor\"){if(this.ctor)throw new Error(\"cannot define more than one constructor in a class\");if(g.bound)throw new Error(\"cannot define a constructor as a bound function\");g instanceof j?e=this.ctor=g:e=this.ctor=new d(new U(new z(c)),g)}else e.variable[\"this\"]||(e.variable=new U(new z(c),[new b(f,\"proto\")])),g instanceof j&&g.bound&&(this.boundFuncs.push(f),g.bound=!1)}i.push(e)}return i},a.prototype.walkBody=function(b){return this.traverseChildren(!1,bj(function(c){var d,e,g,h,i;if(c instanceof a)return!1;if(c instanceof f){i=d=c.expressions;for(e=0,h=i.length;e<h;e++)g=i[e],g instanceof U&&g.isObject(!0)&&(d[e]=this.addProperties(g,b));return c.expressions=d=_(d)}},this))},a.prototype.ensureConstructor=function(a){this.ctor||(this.ctor=new j,this.parent&&this.ctor.body.push(new g(\"super\",[new M(new z(\"arguments\"))])),this.body.expressions.unshift(this.ctor)),this.ctor.ctor=this.ctor.name=a,this.ctor.klass=null;return this.ctor.noReturn=!0},a.prototype.compileNode=function(a){var b,c,e,f;b=this.determineName(),f=b||this.name||\"_Class\",e=new z(f),this.setContext(f),this.walkBody(f),this.parent&&this.body.expressions.unshift(new m(e,this.parent)),this.ensureConstructor(f),this.body.expressions.push(e),this.addBoundFunctions(a),c=new F(i.wrap(this.body),!0),this.variable&&(c=new d(this.variable,c));return c.compile(a)};return a}(),a.Assign=d=function(){function a(a,b,c,d){this.variable=a,this.value=b,this.context=c,this.param=d&&d.param}bi(a,e),a.prototype.METHOD_DEF=/^(?:(\\S+)\\.prototype\\.|\\S+?)?\\b([$A-Za-z_][$\\w\\x7f-\\uffff]*)$/,a.prototype.children=[\"variable\",\"value\"],a.prototype.assigns=function(a){return this[this.context===\"object\"?\"value\":\"variable\"].assigns(a)},a.prototype.unfoldSoak=function(a){return be(a,this,\"variable\")},a.prototype.compileNode=function(a){var b,c,d,e,f;if(b=this.variable instanceof U){if(this.variable.isArray()||this.variable.isObject())return this.compilePatternMatch(a);if(this.variable.isSplice())return this.compileSplice(a);if((f=this.context)===\"||=\"||f===\"&&=\"||f===\"?=\")return this.compileConditional(a)}d=this.variable.compile(a,v),this.value instanceof j&&(c=this.METHOD_DEF.exec(d))&&(this.value.name=c[2],c[1]&&(this.value.klass=c[1])),e=this.value.compile(a,v);if(this.context===\"object\")return\"\"+d+\": \"+e;if(!this.variable.isAssignable())throw SyntaxError('\"'+this.variable.compile(a)+'\" cannot be assigned.');this.context||b&&(this.variable.namespaced||this.variable.hasProperties())||(this.param?a.scope.add(d,\"var\"):a.scope.find(d)),e=d+(\" \"+(this.context||\"=\")+\" \")+e;return a.level>v?\"(\"+e+\")\":e},a.prototype.compilePatternMatch=function(c){var d,e,f,g,h,i,j,k,l,m,n,p,q,r,t,u,x,A,B,C,D,E;r=c.level===y,u=this.value,l=this.variable.base.objects;if(!(m=l.length)){if(r)return!1;f=u.compile(c);return c.level<w?f:\"(\"+f+\")\"}i=this.variable.isObject();if(r&&m===1&&!((k=l[0])instanceof M)){k instanceof a?(B=k,h=B.variable.base,k=B.value):k.base instanceof F?(C=(new U(k.unwrapAll())).cacheReference(c),k=C[0],h=C[1]):h=i?k[\"this\"]?k.properties[0].name:k:new z(0),d=o.test(h.unwrap().value||0),u=new U(u),u.properties.push(new(d?b:s)(h));return(new a(k,u)).compile(c)}x=u.compile(c,v),e=[],q=!1;if(!o.test(x)||this.variable.assigns(x))e.push(\"\"+(n=c.scope.freeVariable(\"ref\"))+\" = \"+x),x=n;for(g=0,A=l.length;g<A;g++){k=l[g],h=g,i&&(k instanceof a?(D=k,h=D.variable.base,k=D.value):k.base instanceof F?(E=(new U(k.unwrapAll())).cacheReference(c),k=E[0],h=E[1]):h=k[\"this\"]?k.properties[0].name:k);if(!q&&k instanceof M)t=\"\"+m+\" <= \"+x+\".length ? \"+bf(\"slice\")+\".call(\"+x+\", \"+g,(p=m-g-1)?(j=c.scope.freeVariable(\"i\"),t+=\", \"+j+\" = \"+x+\".length - \"+p+\") : (\"+j+\" = \"+g+\", [])\"):t+=\") : []\",t=new z(t),q=\"\"+j+\"++\";else{if(k instanceof M){k=k.name.compile(c);throw SyntaxError(\"multiple splats are disallowed in an assignment: \"+k+\" ...\")}typeof h===\"number\"?(h=new z(q||h),d=!1):d=i&&o.test(h.unwrap().value||0),t=new U(new z(x),[new(d?b:s)(h)])}e.push((new a(k,t,null,{param:this.param})).compile(c,y))}r||e.push(x),f=X(e).join(\", \");return c.level<v?f:\"(\"+f+\")\"},a.prototype.compileConditional=function(b){var c,d,e;e=this.variable.cacheReference(b),c=e[0],d=e[1];return(new D(this.context.slice(0,-1),c,new a(d,this.value,\"=\"))).compile(b)},a.prototype.compileSplice=function(a){var b,c,d,e,f,g,h,i,j,k,l,m;k=this.variable.properties.pop().range,d=k.from,h=k.to,c=k.exclusive,g=this.variable.compile(a),l=(d!=null?d.cache(a,w):void 0)||[\"0\",\"0\"],e=l[0],f=l[1],h?(d!=null?d.isSimpleNumber():void 0)&&h.isSimpleNumber()?(h=+h.compile(a)- +f,c||(h+=1)):(h=h.compile(a)+\" - \"+f,c||(h+=\" + 1\")):h=\"9e9\",m=this.value.cache(a,v),i=m[0],j=m[1],b=\"[].splice.apply(\"+g+\", [\"+e+\", \"+h+\"].concat(\"+i+\")), \"+j;return a.level>y?\"(\"+b+\")\":b};return a}(),a.Code=j=function(){function a(a,b,c){this.params=a||[],this.body=b||new f,this.bound=c===\"boundfunc\",this.bound&&(this.context=\"this\")}bi(a,e),a.prototype.children=[\"params\",\"body\"],a.prototype.isStatement=function(){return!!this.ctor},a.prototype.jumps=B,a.prototype.compileNode=function(a){var b,e,f,g,h,i,j,k,l,m,n,o,p,r,s,u,v,w,x,y,A;a.scope=new K(a.scope,this.body,this),a.scope.shared=Y(a,\"sharedScope\"),a.indent+=O,delete a.bare,delete a.globals,o=[],e=[],x=this.params;for(r=0,u=x.length;r<u;r++){j=x[r];if(j.splat){l=new d(new U(new c(function(){var b,c,d,e;d=this.params,e=[];for(b=0,c=d.length;b<c;b++)i=d[b],e.push(i.asReference(a));return e}.call(this))),new U(new z(\"arguments\")));break}}y=this.params;for(s=0,v=y.length;s<v;s++)j=y[s],j.isComplex()?(n=k=j.asReference(a),j.value&&(n=new D(\"?\",k,j.value)),e.push(new d(new U(j.name),n,\"=\",{param:!0}))):(k=j,j.value&&(h=new z(k.name.value+\" == null\"),n=new d(new U(j.name),j.value,\"=\"),e.push(new q(h,n)))),l||o.push(k);p=this.body.isEmpty(),l&&e.unshift(l),e.length&&(A=this.body.expressions).unshift.apply(A,e);if(!l)for(f=0,w=o.length;f<w;f++)m=o[f],a.scope.parameter(o[f]=m.compile(a));!p&&!this.noReturn&&this.body.makeReturn(),g=a.indent,b=\"function\",this.ctor&&(b+=\" \"+this.name),b+=\"(\"+o.join(\", \")+\") {\",this.body.isEmpty()||(b+=\"\\n\"+this.body.compileWithDeclarations(a)+\"\\n\"+this.tab),b+=\"}\";if(this.ctor)return this.tab+b;if(this.bound)return bf(\"bind\")+(\"(\"+b+\", \"+this.context+\")\");return this.front||a.level>=t?\"(\"+b+\")\":b},a.prototype.traverseChildren=function(b,c){if(b)return a.__super__.traverseChildren.call(this,b,c)};return a}(),a.Param=E=function(){function a(a,b,c){this.name=a,this.value=b,this.splat=c}bi(a,e),a.prototype.children=[\"name\",\"value\"],a.prototype.compile=function(a){return this.name.compile(a,v)},a.prototype.asReference=function(a){var b;if(this.reference)return this.reference;b=this.name,b[\"this\"]?(b=b.properties[0].name,b.value.reserved&&(b=new z(\"_\"+b.value))):b.isComplex()&&(b=new z(a.scope.freeVariable(\"arg\"))),b=new U(b),this.splat&&(b=new M(b));return this.reference=b},a.prototype.isComplex=function(){return this.name.isComplex()};return a}(),a.Splat=M=function(){function a(a){this.name=a.compile?a:new z(a)}bi(a,e),a.prototype.children=[\"name\"],a.prototype.isAssignable=W,a.prototype.assigns=function(a){return this.name.assigns(a)},a.prototype.compile=function(a){return this.index!=null?this.compileParam(a):this.name.compile(a)},a.compileSplattedArray=function(b,c,d){var e,f,g,h,i,j,k;i=-1;while((j=c[++i])&&!(j instanceof a))continue;if(i>=c.length)return\"\";if(c.length===1){g=c[0].compile(b,v);if(d)return g;return\"\"+bf(\"slice\")+\".call(\"+g+\")\"}e=c.slice(i);for(h=0,k=e.length;h<k;h++)j=e[h],g=j.compile(b,v),e[h]=j instanceof a?\"\"+bf(\"slice\")+\".call(\"+g+\")\":\"[\"+g+\"]\";if(i===0)return e[0]+(\".concat(\"+e.slice(1).join(\", \")+\")\");f=function(){var a,d,e,f;e=c.slice(0,i),f=[];for(a=0,d=e.length;a<d;a++)j=e[a],f.push(j.compile(b,v));return f}();return\"[\"+f.join(\", \")+\"].concat(\"+e.join(\", \")+\")\"};return a}(),a.While=V=function(){function a(a,b){this.condition=(b!=null?b.invert:void 0)?a.invert():a,this.guard=b!=null?b.guard:void 0}bi(a,e),a.prototype.children=[\"condition\",\"guard\",\"body\"],a.prototype.isStatement=W,a.prototype.makeReturn=function(){this.returns=!0;return this},a.prototype.addBody=function(a){this.body=a;return this},a.prototype.jumps=function(){var a,b,c,d;a=this.body.expressions;if(!a.length)return!1;for(c=0,d=a.length;c<d;c++){b=a[c];if(b.jumps({loop:!0}))return b}return!1},a.prototype.compileNode=function(a){var b,c,d,e;a.indent+=O,e=\"\",b=this.body;if(b.isEmpty())b=\"\";else{if(a.level>y||this.returns)d=a.scope.freeVariable(\"results\"),e=\"\"+this.tab+d+\" = [];\\n\",b&&(b=G.wrap(d,b));this.guard&&(b=f.wrap([new q(this.guard,b)])),b=\"\\n\"+b.compile(a,y)+\"\\n\"+this.tab}c=e+this.tab+(\"while (\"+this.condition.compile(a,x)+\") {\"+b+\"}\"),this.returns&&(c+=\"\\n\"+this.tab+\"return \"+d+\";\");return c};return a}(),a.Op=D=function(){function c(b,c,d,e){if(b===\"in\")return new r(c,d);if(b===\"do\")return new g(c,c.params||[]);if(b===\"new\"){if(c instanceof g)return c.newInstance();c instanceof j&&c.bound&&(c=new F(c))}this.operator=a[b]||b,this.first=c,this.second=d,this.flip=!!e;return this}var a,b;bi(c,e),a={\"==\":\"===\",\"!=\":\"!==\",of:\"in\"},b={\"!==\":\"===\",\"===\":\"!==\"},c.prototype.children=[\"first\",\"second\"],c.prototype.isSimpleNumber=B,c.prototype.isUnary=function(){return!this.second},c.prototype.isChainable=function(){var a;return(a=this.operator)===\"<\"||a===\">\"||a===\">=\"||a===\"<=\"||a===\"===\"||a===\"!==\"},c.prototype.invert=function(){var a,d,e,f,g;if(this.isChainable()&&this.first.isChainable()){a=!0,d=this;while(d&&d.operator)a&&(a=d.operator in b),d=d.first;if(!a)return(new F(this)).invert();d=this;while(d&&d.operator)d.invert=!d.invert,d.operator=b[d.operator],d=d.first;return this}if(f=b[this.operator]){this.operator=f,this.first.unwrap()instanceof c&&this.first.invert();return this}return this.second?(new F(this)).invert():this.operator===\"!\"&&(e=this.first.unwrap())instanceof c&&((g=e.operator)===\"!\"||g===\"in\"||g===\"instanceof\")?e:new c(\"!\",this)},c.prototype.unfoldSoak=function(a){var b;return((b=this.operator)===\"++\"||b===\"--\"||b===\"delete\")&&be(a,this,\"first\")},c.prototype.compileNode=function(a){var b;if(this.isUnary())return this.compileUnary(a);if(this.isChainable()&&this.first.isChainable())return this.compileChain(a);if(this.operator===\"?\")return this.compileExistence(a);this.first.front=this.front,b=this.first.compile(a,w)+\" \"+this.operator+\" \"+this.second.compile(a,w);return a.level>w?\"(\"+b+\")\":b},c.prototype.compileChain=function(a){var b,c,d,e;e=this.first.second.cache(a),this.first.second=e[0],d=e[1],c=this.first.compile(a,w),b=\"\"+c+\" \"+(this.invert?\"&&\":\"||\")+\" \"+d.compile(a)+\" \"+this.operator+\" \"+this.second.compile(a,w);return\"(\"+b+\")\"},c.prototype.compileExistence=function(a){var b,c;this.first.isComplex()?(c=a.scope.freeVariable(\"ref\"),b=new F(new d(new z(c),this.first))):(b=this.first,c=b.compile(a));return(new l(b)).compile(a)+(\" ? \"+c+\" : \"+this.second.compile(a,v))},c.prototype.compileUnary=function(a){var b,d;d=[b=this.operator],(b===\"new\"||b===\"typeof\"||b===\"delete\"||(b===\"+\"||b===\"-\")&&this.first instanceof c&&this.first.operator===b)&&d.push(\" \"),d.push(this.first.compile(a,w)),this.flip&&d.reverse();return d.join(\"\")},c.prototype.toString=function(a){return c.__super__.toString.call(this,a,this.constructor.name+\" \"+this.operator)};return c}(),a.In=r=function(){function a(a,b){this.object=a,this.array=b}bi(a,e),a.prototype.children=[\"object\",\"array\"],a.prototype.invert=A,a.prototype.compileNode=function(a){return this.array instanceof U&&this.array.isArray()?this.compileOrTest(a):this.compileLoopTest(a)},a.prototype.compileOrTest=function(a){var b,c,d,e,f,g,h,i,j;i=this.object.cache(a,w),g=i[0],f=i[1],j=this.negated?[\" !== \",\" && \"]:[\" === \",\" || \"],b=j[0],c=j[1],h=function(){var c,h,i;h=this.array.base.objects,i=[];for(d=0,c=h.length;d<c;d++)e=h[d],i.push((d?f:g)+b+e.compile(a,w));return i}.call(this),h=h.join(c);return a.level<w?h:\"(\"+h+\")\"},a.prototype.compileLoopTest=function(a){var b,c,d,e;e=this.object.cache(a,v),d=e[0],c=e[1],b=bf(\"indexOf\")+(\".call(\"+this.array.compile(a,v)+\", \"+c+\") \")+(this.negated?\"< 0\":\">= 0\");if(d===c)return b;b=d+\", \"+b;return a.level<v?b:\"(\"+b+\")\"},a.prototype.toString=function(b){return a.__super__.toString.call(this,b,this.constructor.name+(this.negated?\"!\":\"\"))};return a}(),a.Try=S=function(){function a(a,b,c,d){this.attempt=a,this.error=b,this.recovery=c,this.ensure=d}bi(a,e),a.prototype.children=[\"attempt\",\"recovery\",\"ensure\"],a.prototype.isStatement=W,a.prototype.jumps=function(a){var b;return this.attempt.jumps(a)||((b=this.recovery)!=null?b.jumps(a):void 0)},a.prototype.makeReturn=function(){this.attempt&&(this.attempt=this.attempt.makeReturn()),this.recovery&&(this.recovery=this.recovery.makeReturn());return this},a.prototype.compileNode=function(a){var b,c;a.indent+=O,c=this.error?\" (\"+this.error.compile(a)+\") \":\" \",b=this.recovery?\" catch\"+c+\"{\\n\"+this.recovery.compile(a,y)+\"\\n\"+this.tab+\"}\":!this.ensure&&!this.recovery?\" catch (_e) {}\":void 0;return\"\"+this.tab+\"try {\\n\"+this.attempt.compile(a,y)+\"\\n\"+this.tab+\"}\"+(b||\"\")+(this.ensure?\" finally {\\n\"+this.ensure.compile(a,y)+\"\\n\"+this.tab+\"}\":\"\")};return a}(),a.Throw=R=function(){function a(a){this.expression=a}bi(a,e),a.prototype.children=[\"expression\"],a.prototype.isStatement=W,a.prototype.jumps=B,a.prototype.makeReturn=P,a.prototype.compileNode=function(a){return this.tab+(\"throw \"+this.expression.compile(a)+\";\")};return a}(),a.Existence=l=function(){function a(a){this.expression=a}bi(a,e),a.prototype.children=[\"expression\"],a.prototype.invert=A,a.prototype.compileNode=function(a){var b,c;b=this.expression.compile(a,w),b=o.test(b)&&!a.scope.check(b)?this.negated?\"typeof \"+b+' == \"undefined\" || '+b+\" === null\":\"typeof \"+b+' != \"undefined\" && '+b+\" !== null\":(c=this.negated?\"==\":\"!=\",\"\"+b+\" \"+c+\" null\");return a.level>u?\"(\"+b+\")\":b};return a}(),a.Parens=F=function(){function a(a){this.body=a}bi(a,e),a.prototype.children=[\"body\"],a.prototype.unwrap=function(){return this.body},a.prototype.isComplex=function(){return this.body.isComplex()},a.prototype.makeReturn=function(){return this.body.makeReturn()},a.prototype.compileNode=function(a){var b,c,d;d=this.body.unwrap();if(d instanceof U&&d.isAtomic()){d.front=this.front;return d.compile(a)}c=d.compile(a,x),b=a.level<w&&(d instanceof D||d instanceof g||d instanceof n&&d.returns);return b?c:\"(\"+c+\")\"};return a}(),a.For=n=function(){function a(a,b){var c;this.source=b.source,this.guard=b.guard,this.step=b.step,this.name=b.name,this.index=b.index,this.body=f.wrap([a]),this.own=!!b.own,this.object=!!b.object,this.object&&(c=[this.index,this.name],this.name=c[0],this.index=c[1]);if(this.index instanceof U)throw SyntaxError(\"index cannot be a pattern matching expression\");this.range=this.source instanceof U&&this.source.base instanceof H&&!this.source.properties.length,this.pattern=this.name instanceof U;if(this.range&&this.index)throw SyntaxError(\"indexes do not apply to range loops\");if(this.range&&this.pattern)throw SyntaxError(\"cannot pattern match over range loops\");this.returns=!1}bi(a,e),a.prototype.children=[\"body\",\"source\",\"guard\",\"step\"],a.prototype.isStatement=W,a.prototype.jumps=V.prototype.jumps,a.prototype.makeReturn=function(){this.returns=!0;return this},a.prototype.compileNode=function(a){var b,c,e,g,h,i,j,k,l,m,n,p,r,s,t,u,x,A,B,C,D;b=f.wrap([this.body]),k=(D=ba(b.expressions))!=null?D.jumps():void 0,k&&k instanceof I&&(this.returns=!1),x=this.range?this.source.base:this.source,u=a.scope,m=this.name&&this.name.compile(a,v),i=this.index&&this.index.compile(a,v),m&&!this.pattern&&u.find(m,{immediate:!0}),i&&u.find(i,{immediate:!0}),this.returns&&(t=u.freeVariable(\"results\")),j=(this.range?m:i)||u.freeVariable(\"i\"),this.pattern&&(m=j),C=\"\",g=\"\",c=\"\",h=this.tab+O,this.range?e=x.compile(bb(a,{index:j,step:this.step})):(B=this.source.compile(a,v),(m||this.own)&&!o.test(B)&&(c=\"\"+this.tab+(p=u.freeVariable(\"ref\"))+\" = \"+B+\";\\n\",B=p),m&&!this.pattern&&(n=\"\"+m+\" = \"+B+\"[\"+j+\"]\"),this.object||(l=u.freeVariable(\"len\"),A=this.step?\"\"+j+\" += \"+this.step.compile(a,w):\"\"+j+\"++\",e=\"\"+j+\" = 0, \"+l+\" = \"+B+\".length; \"+j+\" < \"+l+\"; \"+A)),this.returns&&(r=\"\"+this.tab+t+\" = [];\\n\",s=\"\\n\"+this.tab+\"return \"+t+\";\",b=G.wrap(t,b)),this.guard&&(b=f.wrap([new q(this.guard,b)])),this.pattern&&b.expressions.unshift(new d(this.name,new z(\"\"+B+\"[\"+j+\"]\"))),c+=this.pluckDirectCall(a,b),n&&(C=\"\\n\"+h+n+\";\"),this.object&&(e=\"\"+j+\" in \"+B,this.own&&(g=\"\\n\"+h+\"if (!\"+bf(\"hasProp\")+\".call(\"+B+\", \"+j+\")) continue;\")),b=b.compile(bb(a,{indent:h}),y),b&&(b=\"\\n\"+b+\"\\n\");return\"\"+c+(r||\"\")+this.tab+\"for (\"+e+\") {\"+g+C+b+this.tab+\"}\"+(s||\"\")},a.prototype.pluckDirectCall=function(a,b){var c,e,f,h,i,k,l,m,n,o,p,q,r,s;e=\"\",n=b.expressions;for(i=0,m=n.length;i<m;i++){f=n[i],f=f.unwrapAll();if(!(f instanceof g))continue;l=f.variable.unwrapAll();if(!(l instanceof j||l instanceof U&&((o=l.base)!=null?o.unwrapAll():void 0)instanceof j&&l.properties.length===1&&((p=(q=l.properties[0].name)!=null?q.value:void 0)===\"call\"||p===\"apply\")))continue;h=((r=l.base)!=null?r.unwrapAll():void 0)||l,k=new z(a.scope.freeVariable(\"fn\")),c=new U(k),l.base&&(s=[c,l],l.base=s[0],c=s[1],args.unshift(new z(\"this\"))),b.expressions[i]=new g(c,f.args),e+=this.tab+(new d(k,h)).compile(a,y)+\";\\n\"}return e};return a}(),a.Switch=N=function(){function a(a,b,c){this.subject=a,this.cases=b,this.otherwise=c}bi(a,e),a.prototype.children=[\"subject\",\"cases\",\"otherwise\"],a.prototype.isStatement=W,a.prototype.jumps=function(a){var b,c,d,e,f,g,h;a==null&&(a={block:!0}),f=this.cases;for(d=0,e=f.length;d<e;d++){g=f[d],c=g[0],b=g[1];if(b.jumps(a))return b}return(h=this.otherwise)!=null?h.jumps(a):void 0},a.prototype.makeReturn=function(){var a,b,c,d,e;d=this.cases;for(b=0,c=d.length;b<c;b++)a=d[b],a[1].makeReturn();(e=this.otherwise)!=null&&e.makeReturn();return this},a.prototype.compileNode=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;i=a.indent+O,j=a.indent=i+O,d=this.tab+(\"switch (\"+(((n=this.subject)!=null?n.compile(a,x):void 0)||!1)+\") {\\n\"),o=this.cases;for(h=0,l=o.length;h<l;h++){p=o[h],f=p[0],b=p[1],q=_([f]);for(k=0,m=q.length;k<m;k++)e=q[k],this.subject||(e=e.invert()),d+=i+(\"case \"+e.compile(a,x)+\":\\n\");if(c=b.compile(a,y))d+=c+\"\\n\";if(h===this.cases.length-1&&!this.otherwise)break;g=this.lastNonComment(b.expressions);if(g instanceof I||g instanceof z&&g.jumps()&&g.value!==\"debugger\")continue;d+=j+\"break;\\n\"}this.otherwise&&this.otherwise.expressions.length&&(d+=i+(\"default:\\n\"+this.otherwise.compile(a,y)+\"\\n\"));return d+this.tab+\"}\"};return a}(),a.If=q=function(){function a(a,b,c){this.body=b,c==null&&(c={}),this.condition=c.type===\"unless\"?a.invert():a,this.elseBody=null,this.isChain=!1,this.soak=c.soak}bi(a,e),a.prototype.children=[\"condition\",\"body\",\"elseBody\"],a.prototype.bodyNode=function(){var a;return(a=this.body)!=null?a.unwrap():void 0},a.prototype.elseBodyNode=function(){var a;return(a=this.elseBody)!=null?a.unwrap():void 0},a.prototype.addElse=function(b){this.isChain?this.elseBodyNode().addElse(b):(this.isChain=b instanceof a,this.elseBody=this.ensureBlock(b));return this},a.prototype.isStatement=function(a){var b;return(a!=null?a.level:void 0)===y||this.bodyNode().isStatement(a)||((b=this.elseBodyNode())!=null?b.isStatement(a):void 0)},a.prototype.jumps=function(a){var b;return this.body.jumps(a)||((b=this.elseBody)!=null?b.jumps(a):void 0)},a.prototype.compileNode=function(a){return this.isStatement(a)?this.compileStatement(a):this.compileExpression(a)},a.prototype.makeReturn=function(){this.body&&(this.body=new f([this.body.makeReturn()])),this.elseBody&&(this.elseBody=new f([this.elseBody.makeReturn()]));return this},a.prototype.ensureBlock=function(a){return a instanceof f?a:new f([a])},a.prototype.compileStatement=function(a){var b,c,d,e;c=Y(a,\"chainChild\"),d=this.condition.compile(a,x),a.indent+=O,b=this.ensureBlock(this.body).compile(a),b&&(b=\"\\n\"+b+\"\\n\"+this.tab),e=\"if (\"+d+\") {\"+b+\"}\",c||(e=this.tab+e);if(!this.elseBody)return e;return e+\" else \"+(this.isChain?(a.indent=this.tab,a.chainChild=!0,this.elseBody.unwrap().compile(a,y)):\"{\\n\"+this.elseBody.compile(a,y)+\"\\n\"+this.tab+\"}\")},a.prototype.compileExpression=function(a){var b,c,d,e;e=this.condition.compile(a,u),c=this.bodyNode().compile(a,v),b=this.elseBodyNode()?this.elseBodyNode().compile(a,v):\"void 0\",d=\"\"+e+\" ? \"+c+\" : \"+b;return a.level<u?d:\"(\"+d+\")\"},a.prototype.unfoldSoak=function(){return this.soak&&this};return a}(),G={wrap:function(a,c){if(c.isEmpty()||ba(c.expressions).jumps())return c;return c.push(new g(new U(new z(a),[new b(new z(\"push\"))]),[c.pop()]))}},i={wrap:function(a,c,d){var e,h,i,k,l;if(a.jumps())return a;i=new j([],f.wrap([a])),e=[];if((k=a.contains(this.literalArgs))||a.contains(this.literalThis))l=new z(k?\"apply\":\"call\"),e=[new z(\"this\")],k&&e.push(new z(\"arguments\")),i=new U(i,[new b(l)]);i.noReturn=d,h=new g(i,e);return c?f.wrap([h]):h},literalArgs:function(a){return a instanceof z&&a.value===\"arguments\"&&!a.asKey},literalThis:function(a){return a instanceof z&&a.value===\"this\"&&!a.asKey||a instanceof j&&a.bound}},be=function(a,b,c){var d;if(d=b[c].unfoldSoak(a)){b[c]=d.body,d.body=new U(b);return d}},T={\"extends\":\"function(child, parent) {\\n for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }\\n function ctor() { this.constructor = child; }\\n ctor.prototype = parent.prototype;\\n child.prototype = new ctor;\\n child.__super__ = parent.prototype;\\n return child;\\n}\",bind:\"function(fn, me){ return function(){ return fn.apply(me, arguments); }; }\",indexOf:\"Array.prototype.indexOf || function(item) {\\n for (var i = 0, l = this.length; i < l; i++) {\\n if (this[i] === item) return i;\\n }\\n return -1;\\n}\",hasProp:\"Object.prototype.hasOwnProperty\",slice:\"Array.prototype.slice\"},y=1,x=2,v=3,u=4,w=5,t=6,O=\" \",Q=/[ \\t]+$/gm,o=/^[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*$/,J=/^[+-]?\\d+$/,p=/^['\"]/,bf=function(a){var b;b=\"__\"+a,K.root.assign(b,T[a]);return b},bc=function(a,b){return a.replace(/\\n/g,\"$&\"+b)}}).call(this)},require[\"./coffee-script\"]=new function(){var exports=this;(function(){var Lexer,RESERVED,compile,fs,lexer,parser,path,_ref;fs=require(\"fs\"),path=require(\"path\"),_ref=require(\"./lexer\"),Lexer=_ref.Lexer,RESERVED=_ref.RESERVED,parser=require(\"./parser\").parser,require.extensions?require.extensions[\".coffee\"]=function(a,b){var c;c=compile(fs.readFileSync(b,\"utf8\"));return a._compile(c,b)}:require.registerExtension&&require.registerExtension(\".coffee\",function(a){return compile(a)}),exports.VERSION=\"1.0.1\",exports.RESERVED=RESERVED,exports.helpers=require(\"./helpers\"),exports.compile=compile=function(a,b){b==null&&(b={});try{return parser.parse(lexer.tokenize(a)).compile(b)}catch(c){b.filename&&(c.message=\"In \"+b.filename+\", \"+c.message);throw c}},exports.tokens=function(a,b){return lexer.tokenize(a,b)},exports.nodes=function(a,b){return typeof a===\"string\"?parser.parse(lexer.tokenize(a,b)):parser.parse(a)},exports.run=function(a,b){var c;c=module;while(c.parent)c=c.parent;c.filename=b.filename?fs.realpathSync(b.filename):\".\",c.moduleCache&&(c.moduleCache={});return path.extname(c.filename)!==\".coffee\"||require.extensions?c._compile(compile(a,b),c.filename):c._compile(a,c.filename)},exports.eval=function(code,options){var __dirname,__filename;__filename=module.filename=options.filename,__dirname=path.dirname(__filename);return eval(compile(code,options))},lexer=new Lexer,parser.lexer={lex:function(){var a,b;b=this.tokens[this.pos++]||[\"\"],a=b[0],this.yytext=b[1],this.yylineno=b[2];return a},setInput:function(a){this.tokens=a;return this.pos=0},upcomingInput:function(){return\"\"}},parser.yy=require(\"./nodes\")}).call(this)},require[\"./browser\"]=new function(){var exports=this;(function(){var CoffeeScript,runScripts;CoffeeScript=require(\"./coffee-script\"),CoffeeScript.require=require,CoffeeScript.eval=function(code,options){return eval(CoffeeScript.compile(code,options))},CoffeeScript.run=function(a,b){b==null&&(b={}),b.bare=!0;return Function(CoffeeScript.compile(a,b))()};typeof window!=\"undefined\"&&window!==null&&(CoffeeScript.load=function(a,b){var c;c=new(window.ActiveXObject||XMLHttpRequest)(\"Microsoft.XMLHTTP\"),c.open(\"GET\",a,!0),\"overrideMimeType\"in c&&c.overrideMimeType(\"text/plain\"),c.onreadystatechange=function(){if(c.readyState===4)return CoffeeScript.run(c.responseText,b)};return c.send(null)},runScripts=function(){var a,b,c,d;d=document.getElementsByTagName(\"script\");for(b=0,c=d.length;b<c;b++)a=d[b],a.type===\"text/coffeescript\"&&(a.src?CoffeeScript.load(a.src):CoffeeScript.run(a.innerHTML));return null},window.addEventListener?addEventListener(\"DOMContentLoaded\",runScripts,!1):attachEvent(\"onload\",runScripts))}).call(this)};return require[\"./coffee-script\"]}()\n;\nvar __slice = Array.prototype.slice;\n(function() {\n var hslParser, hslToRgb, lookup, names, normalizeKey, parseHSL, parseHex, parseRGB, rgbParser, shiftLightness;\n rgbParser = /^rgba?\\((\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3}),?\\s*(\\d?\\.?\\d*)?\\)$/;\n hslParser = /^hsla?\\((\\d{1,3}),\\s*(\\d?\\.?\\d*),\\s*(\\d?\\.?\\d*),?\\s*(\\d?\\.?\\d*)?\\)$/;\n parseHex = function(hexString) {\n var _result, i, rgb;\n hexString = hexString.replace(/#/, '');\n switch (hexString.length) {\n case 3:\n case 4:\n rgb = (function() {\n _result = [];\n for (i = 0; i <= 2; i++) {\n _result.push(parseInt(hexString.substr(i, 1), 16) * 0x11);\n }\n return _result;\n })();\n return rgb.concat(hexString.substr(3, 1).length ? (parseInt(hexString.substr(3, 1), 16) * 0x11) / 255.0 : 1.0);\n case 6:\n case 8:\n rgb = (function() {\n _result = [];\n for (i = 0; i <= 2; i++) {\n _result.push(parseInt(hexString.substr(2 * i, 2), 16));\n }\n return _result;\n })();\n return rgb.concat(hexString.substr(6, 2).length ? parseInt(hexString.substr(6, 2), 16) / 255.0 : 1.0);\n default:\n return undefined;\n }\n };\n parseRGB = function(colorString) {\n var _ref, bits, rgbMap;\n if (!(bits = rgbParser.exec(colorString))) {\n return undefined;\n }\n rgbMap = bits.splice(1, 3).map(function(channel) {\n return parseFloat(channel);\n });\n return rgbMap.concat((typeof (_ref = bits[1]) !== \"undefined\" && _ref !== null) ? parseFloat(bits[1]) : 1.0);\n };\n parseHSL = function(colorString) {\n var _ref, bits, hslMap;\n if (!(bits = hslParser.exec(colorString))) {\n return undefined;\n }\n hslMap = bits.splice(1, 3).map(function(channel) {\n return parseFloat(channel);\n });\n return hslToRgb(hslMap.concat((typeof (_ref = bits[1]) !== \"undefined\" && _ref !== null) ? parseFloat(bits[1]) : 1.0));\n };\n shiftLightness = function(amount, obj) {\n var hsl;\n hsl = obj.toHsl();\n hsl[2] = hsl[2] + amount;\n return Color(hslToRgb(hsl));\n };\n hslToRgb = function(hsl) {\n var a, b, g, h, hueToRgb, l, p, q, r, rgbMap, s;\n h = hsl[0] / 360.0;\n s = hsl[1];\n l = hsl[2];\n a = (hsl[3] ? parseFloat(hsl[3]) : 1.0);\n r = (g = (b = null));\n hueToRgb = function(p, q, t) {\n if (t < 0) {\n t += 1;\n }\n if (t > 1) {\n t -= 1;\n }\n if (t < 1 / 6) {\n return p + (q - p) * 6 * t;\n }\n if (t < 1 / 2) {\n return q;\n }\n if (t < 2 / 3) {\n return p + (q - p) * (2 / 3 - t) * 6;\n }\n return p;\n };\n if (s === 0) {\n r = (g = (b = l));\n } else {\n q = (l < 0.5 ? l * (1 + s) : l + s - l * s);\n p = 2 * l - q;\n r = hueToRgb(p, q, h + 1 / 3);\n g = hueToRgb(p, q, h);\n b = hueToRgb(p, q, h - 1 / 3);\n rgbMap = [r, g, b].map(function(channel) {\n return channel * 0xFF;\n });\n }\n return rgbMap.concat(a);\n };\n normalizeKey = function(key) {\n return key.toString().toLowerCase().split(' ').join('');\n };\n window.Color = function() {\n var _ref, alpha, args, arr, channels, color, parsedColor, rgbMap, self;\n args = __slice.call(arguments, 0);\n color = args.first();\n if ((typeof color === \"undefined\" || color === null) ? undefined : color.channels) {\n return Color(color.channels());\n }\n parsedColor = null;\n if (args.length === 0) {\n parsedColor = [0, 0, 0, 1];\n } else if (args.length === 1 && Object.isArray(args.first())) {\n arr = args.first();\n rgbMap = arr.splice(0, 3).map(function(channel) {\n return parseFloat(channel);\n });\n alpha = (typeof (_ref = arr[0]) !== \"undefined\" && _ref !== null) ? parseFloat(arr[0]) : 1.0;\n parsedColor = rgbMap.concat(alpha);\n } else if (args.length === 2) {\n color = args[0];\n alpha = args[1];\n if (Object.isArray(color)) {\n rgbMap = color.splice(0, 3).map(function(channel) {\n return parseFloat(channel);\n });\n parsedColor = rgbMap.concat(parseFloat(alpha));\n } else {\n parsedColor = lookup[normalizeKey(color)] || parseHex(color) || parseRGB(color) || parseHSL(color);\n parsedColor[3] = alpha;\n }\n } else if (args.length > 2) {\n rgbMap = args.splice(0, 3).map(function(channel) {\n return parseFloat(channel);\n });\n alpha = (typeof (_ref = args.first()) !== \"undefined\" && _ref !== null) ? args.first() : 1.0;\n parsedColor = rgbMap.concat(parseFloat(alpha));\n } else {\n color = args.first();\n parsedColor = lookup[normalizeKey(color)] || parseHex(color) || parseRGB(color) || parseHSL(color);\n }\n if (!(parsedColor)) {\n throw (\"\" + (args.join(',')) + \" is an unknown color\");\n }\n rgbMap = parsedColor.splice(0, 3).map(function(channel) {\n return channel.round();\n });\n alpha = ((typeof (_ref = parsedColor.first()) !== \"undefined\" && _ref !== null) ? parseFloat(parsedColor.first()) : 1.0);\n channels = rgbMap.concat(alpha);\n self = {\n channels: function() {\n return channels.copy();\n },\n r: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[0] = val;\n return self;\n } else {\n return channels[0];\n }\n },\n g: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[1] = val;\n return self;\n } else {\n return channels[1];\n }\n },\n b: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[2] = val;\n return self;\n } else {\n return channels[2];\n }\n },\n a: function(val) {\n if (typeof val !== \"undefined\" && val !== null) {\n channels[3] = val;\n return self;\n } else {\n return channels[3];\n }\n },\n equals: function(other) {\n return other.r() === self.r() && other.g() === self.g() && other.b() === self.b() && other.a() === self.a();\n },\n lighten: function(amount) {\n return shiftLightness(amount, self);\n },\n darken: function(amount) {\n return shiftLightness(-amount, self);\n },\n rgba: function() {\n return \"rgba(\" + (self.r()) + \", \" + (self.g()) + \", \" + (self.b()) + \", \" + (self.a()) + \")\";\n },\n desaturate: function(amount) {\n var hsl;\n hsl = self.toHsl();\n hsl[1] -= amount;\n return Color(hslToRgb(hsl));\n },\n saturate: function(amount) {\n var hsl;\n hsl = self.toHsl();\n hsl[1] += amount;\n return Color(hslToRgb(hsl));\n },\n grayscale: function() {\n var g, hsl;\n hsl = self.toHsl();\n g = hsl[2] * 255;\n return Color(g, g, g);\n },\n hue: function(degrees) {\n var hsl;\n hsl = self.toHsl();\n hsl[0] = (hsl[0] + degrees) % 360;\n return Color(hslToRgb(hsl));\n },\n complement: function() {\n var hsl;\n hsl = self.toHsl();\n return self.hue(180);\n },\n toHex: function() {\n var hexFromNumber, hexString, padString;\n hexString = function(number) {\n return number.toString(16);\n };\n padString = function(hexString) {\n var pad;\n if (hexString.length === 1) {\n pad = \"0\";\n }\n return (pad || \"\") + hexString;\n };\n hexFromNumber = function(number) {\n return padString(hexString(number));\n };\n return \"#\" + (hexFromNumber(channels[0])) + (hexFromNumber(channels[1])) + (hexFromNumber(channels[2]));\n },\n toHsl: function() {\n var _ref2, b, delta, g, hue, lightness, max, min, r, saturation;\n _ref2 = channels.map(function(channel) {\n return channel / 255.0;\n });\n r = _ref2[0];\n g = _ref2[1];\n b = _ref2[2];\n min = Math.min(r, g, b);\n max = Math.max(r, g, b);\n hue = (saturation = (lightness = (max + min) / 2.0));\n if (max === min) {\n hue = (saturation = 0);\n } else {\n delta = max - min;\n saturation = (lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min));\n switch (max) {\n case r:\n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g:\n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n hue *= 60;\n }\n return [hue, saturation, lightness, channels[3]];\n },\n toString: function() {\n return self.rgba();\n }\n };\n return self;\n };\n lookup = {};\n names = [[\"000000\", \"Black\"], [\"000080\", \"Navy Blue\"], [\"0000C8\", \"Dark Blue\"], [\"0000FF\", \"Blue\"], [\"000741\", \"Stratos\"], [\"001B1C\", \"Swamp\"], [\"002387\", \"Resolution Blue\"], [\"002900\", \"Deep Fir\"], [\"002E20\", \"Burnham\"], [\"002FA7\", \"International Klein Blue\"], [\"003153\", \"Prussian Blue\"], [\"003366\", \"Midnight Blue\"], [\"003399\", \"Smalt\"], [\"003532\", \"Deep Teal\"], [\"003E40\", \"Cyprus\"], [\"004620\", \"Kaitoke Green\"], [\"0047AB\", \"Cobalt\"], [\"004816\", \"Crusoe\"], [\"004950\", \"Sherpa Blue\"], [\"0056A7\", \"Endeavour\"], [\"00581A\", \"Camarone\"], [\"0066CC\", \"Science Blue\"], [\"0066FF\", \"Blue Ribbon\"], [\"00755E\", \"Tropical Rain Forest\"], [\"0076A3\", \"Allports\"], [\"007BA7\", \"Deep Cerulean\"], [\"007EC7\", \"Lochmara\"], [\"007FFF\", \"Azure Radiance\"], [\"008080\", \"Teal\"], [\"0095B6\", \"Bondi Blue\"], [\"009DC4\", \"Pacific Blue\"], [\"00A693\", \"Persian Green\"], [\"00A86B\", \"Jade\"], [\"00CC99\", \"Caribbean Green\"], [\"00CCCC\", \"Robin's Egg Blue\"], [\"00FF00\", \"Green\"], [\"00FF7F\", \"Spring Green\"], [\"00FFFF\", \"Cyan / Aqua\"], [\"010D1A\", \"Blue Charcoal\"], [\"011635\", \"Midnight\"], [\"011D13\", \"Holly\"], [\"012731\", \"Daintree\"], [\"01361C\", \"Cardin Green\"], [\"01371A\", \"County Green\"], [\"013E62\", \"Astronaut Blue\"], [\"013F6A\", \"Regal Blue\"], [\"014B43\", \"Aqua Deep\"], [\"015E85\", \"Orient\"], [\"016162\", \"Blue Stone\"], [\"016D39\", \"Fun Green\"], [\"01796F\", \"Pine Green\"], [\"017987\", \"Blue Lagoon\"], [\"01826B\", \"Deep Sea\"], [\"01A368\", \"Green Haze\"], [\"022D15\", \"English Holly\"], [\"02402C\", \"Sherwood Green\"], [\"02478E\", \"Congress Blue\"], [\"024E46\", \"Evening Sea\"], [\"026395\", \"Bahama Blue\"], [\"02866F\", \"Observatory\"], [\"02A4D3\", \"Cerulean\"], [\"03163C\", \"Tangaroa\"], [\"032B52\", \"Green Vogue\"], [\"036A6E\", \"Mosque\"], [\"041004\", \"Midnight Moss\"], [\"041322\", \"Black Pearl\"], [\"042E4C\", \"Blue Whale\"], [\"044022\", \"Zuccini\"], [\"044259\", \"Teal Blue\"], [\"051040\", \"Deep Cove\"], [\"051657\", \"Gulf Blue\"], [\"055989\", \"Venice Blue\"], [\"056F57\", \"Watercourse\"], [\"062A78\", \"Catalina Blue\"], [\"063537\", \"Tiber\"], [\"069B81\", \"Gossamer\"], [\"06A189\", \"Niagara\"], [\"073A50\", \"Tarawera\"], [\"080110\", \"Jaguar\"], [\"081910\", \"Black Bean\"], [\"082567\", \"Deep Sapphire\"], [\"088370\", \"Elf Green\"], [\"08E8DE\", \"Bright Turquoise\"], [\"092256\", \"Downriver\"], [\"09230F\", \"Palm Green\"], [\"09255D\", \"Madison\"], [\"093624\", \"Bottle Green\"], [\"095859\", \"Deep Sea Green\"], [\"097F4B\", \"Salem\"], [\"0A001C\", \"Black Russian\"], [\"0A480D\", \"Dark Fern\"], [\"0A6906\", \"Japanese Laurel\"], [\"0A6F75\", \"Atoll\"], [\"0B0B0B\", \"Cod Gray\"], [\"0B0F08\", \"Marshland\"], [\"0B1107\", \"Gordons Green\"], [\"0B1304\", \"Black Forest\"], [\"0B6207\", \"San Felix\"], [\"0BDA51\", \"Malachite\"], [\"0C0B1D\", \"Ebony\"], [\"0C0D0F\", \"Woodsmoke\"], [\"0C1911\", \"Racing Green\"], [\"0C7A79\", \"Surfie Green\"], [\"0C8990\", \"Blue Chill\"], [\"0D0332\", \"Black Rock\"], [\"0D1117\", \"Bunker\"], [\"0D1C19\", \"Aztec\"], [\"0D2E1C\", \"Bush\"], [\"0E0E18\", \"Cinder\"], [\"0E2A30\", \"Firefly\"], [\"0F2D9E\", \"Torea Bay\"], [\"10121D\", \"Vulcan\"], [\"101405\", \"Green Waterloo\"], [\"105852\", \"Eden\"], [\"110C6C\", \"Arapawa\"], [\"120A8F\", \"Ultramarine\"], [\"123447\", \"Elephant\"], [\"126B40\", \"Jewel\"], [\"130000\", \"Diesel\"], [\"130A06\", \"Asphalt\"], [\"13264D\", \"Blue Zodiac\"], [\"134F19\", \"Parsley\"], [\"140600\", \"Nero\"], [\"1450AA\", \"Tory Blue\"], [\"151F4C\", \"Bunting\"], [\"1560BD\", \"Denim\"], [\"15736B\", \"Genoa\"], [\"161928\", \"Mirage\"], [\"161D10\", \"Hunter Green\"], [\"162A40\", \"Big Stone\"], [\"163222\", \"Celtic\"], [\"16322C\", \"Timber Green\"], [\"163531\", \"Gable Green\"], [\"171F04\", \"Pine Tree\"], [\"175579\", \"Chathams Blue\"], [\"182D09\", \"Deep Forest Green\"], [\"18587A\", \"Blumine\"], [\"19330E\", \"Palm Leaf\"], [\"193751\", \"Nile Blue\"], [\"1959A8\", \"Fun Blue\"], [\"1A1A68\", \"Lucky Point\"], [\"1AB385\", \"Mountain Meadow\"], [\"1B0245\", \"Tolopea\"], [\"1B1035\", \"Haiti\"], [\"1B127B\", \"Deep Koamaru\"], [\"1B1404\", \"Acadia\"], [\"1B2F11\", \"Seaweed\"], [\"1B3162\", \"Biscay\"], [\"1B659D\", \"Matisse\"], [\"1C1208\", \"Crowshead\"], [\"1C1E13\", \"Rangoon Green\"], [\"1C39BB\", \"Persian Blue\"], [\"1C402E\", \"Everglade\"], [\"1C7C7D\", \"Elm\"], [\"1D6142\", \"Green Pea\"], [\"1E0F04\", \"Creole\"], [\"1E1609\", \"Karaka\"], [\"1E1708\", \"El Paso\"], [\"1E385B\", \"Cello\"], [\"1E433C\", \"Te Papa Green\"], [\"1E90FF\", \"Dodger Blue\"], [\"1E9AB0\", \"Eastern Blue\"], [\"1F120F\", \"Night Rider\"], [\"1FC2C2\", \"Java\"], [\"20208D\", \"Jacksons Purple\"], [\"202E54\", \"Cloud Burst\"], [\"204852\", \"Blue Dianne\"], [\"211A0E\", \"Eternity\"], [\"220878\", \"Deep Blue\"], [\"228B22\", \"Forest Green\"], [\"233418\", \"Mallard\"], [\"240A40\", \"Violet\"], [\"240C02\", \"Kilamanjaro\"], [\"242A1D\", \"Log Cabin\"], [\"242E16\", \"Black Olive\"], [\"24500F\", \"Green House\"], [\"251607\", \"Graphite\"], [\"251706\", \"Cannon Black\"], [\"251F4F\", \"Port Gore\"], [\"25272C\", \"Shark\"], [\"25311C\", \"Green Kelp\"], [\"2596D1\", \"Curious Blue\"], [\"260368\", \"Paua\"], [\"26056A\", \"Paris M\"], [\"261105\", \"Wood Bark\"], [\"261414\", \"Gondola\"], [\"262335\", \"Steel Gray\"], [\"26283B\", \"Ebony Clay\"], [\"273A81\", \"Bay of Many\"], [\"27504B\", \"Plantation\"], [\"278A5B\", \"Eucalyptus\"], [\"281E15\", \"Oil\"], [\"283A77\", \"Astronaut\"], [\"286ACD\", \"Mariner\"], [\"290C5E\", \"Violent Violet\"], [\"292130\", \"Bastille\"], [\"292319\", \"Zeus\"], [\"292937\", \"Charade\"], [\"297B9A\", \"Jelly Bean\"], [\"29AB87\", \"Jungle Green\"], [\"2A0359\", \"Cherry Pie\"], [\"2A140E\", \"Coffee Bean\"], [\"2A2630\", \"Baltic Sea\"], [\"2A380B\", \"Turtle Green\"], [\"2A52BE\", \"Cerulean Blue\"], [\"2B0202\", \"Sepia Black\"], [\"2B194F\", \"Valhalla\"], [\"2B3228\", \"Heavy Metal\"], [\"2C0E8C\", \"Blue Gem\"], [\"2C1632\", \"Revolver\"], [\"2C2133\", \"Bleached Cedar\"], [\"2C8C84\", \"Lochinvar\"], [\"2D2510\", \"Mikado\"], [\"2D383A\", \"Outer Space\"], [\"2D569B\", \"St Tropaz\"], [\"2E0329\", \"Jacaranda\"], [\"2E1905\", \"Jacko Bean\"], [\"2E3222\", \"Rangitoto\"], [\"2E3F62\", \"Rhino\"], [\"2E8B57\", \"Sea Green\"], [\"2EBFD4\", \"Scooter\"], [\"2F270E\", \"Onion\"], [\"2F3CB3\", \"Governor Bay\"], [\"2F519E\", \"Sapphire\"], [\"2F5A57\", \"Spectra\"], [\"2F6168\", \"Casal\"], [\"300529\", \"Melanzane\"], [\"301F1E\", \"Cocoa Brown\"], [\"302A0F\", \"Woodrush\"], [\"304B6A\", \"San Juan\"], [\"30D5C8\", \"Turquoise\"], [\"311C17\", \"Eclipse\"], [\"314459\", \"Pickled Bluewood\"], [\"315BA1\", \"Azure\"], [\"31728D\", \"Calypso\"], [\"317D82\", \"Paradiso\"], [\"32127A\", \"Persian Indigo\"], [\"32293A\", \"Blackcurrant\"], [\"323232\", \"Mine Shaft\"], [\"325D52\", \"Stromboli\"], [\"327C14\", \"Bilbao\"], [\"327DA0\", \"Astral\"], [\"33036B\", \"Christalle\"], [\"33292F\", \"Thunder\"], [\"33CC99\", \"Shamrock\"], [\"341515\", \"Tamarind\"], [\"350036\", \"Mardi Gras\"], [\"350E42\", \"Valentino\"], [\"350E57\", \"Jagger\"], [\"353542\", \"Tuna\"], [\"354E8C\", \"Chambray\"], [\"363050\", \"Martinique\"], [\"363534\", \"Tuatara\"], [\"363C0D\", \"Waiouru\"], [\"36747D\", \"Ming\"], [\"368716\", \"La Palma\"], [\"370202\", \"Chocolate\"], [\"371D09\", \"Clinker\"], [\"37290E\", \"Brown Tumbleweed\"], [\"373021\", \"Birch\"], [\"377475\", \"Oracle\"], [\"380474\", \"Blue Diamond\"], [\"381A51\", \"Grape\"], [\"383533\", \"Dune\"], [\"384555\", \"Oxford Blue\"], [\"384910\", \"Clover\"], [\"394851\", \"Limed Spruce\"], [\"396413\", \"Dell\"], [\"3A0020\", \"Toledo\"], [\"3A2010\", \"Sambuca\"], [\"3A2A6A\", \"Jacarta\"], [\"3A686C\", \"William\"], [\"3A6A47\", \"Killarney\"], [\"3AB09E\", \"Keppel\"], [\"3B000B\", \"Temptress\"], [\"3B0910\", \"Aubergine\"], [\"3B1F1F\", \"Jon\"], [\"3B2820\", \"Treehouse\"], [\"3B7A57\", \"Amazon\"], [\"3B91B4\", \"Boston Blue\"], [\"3C0878\", \"Windsor\"], [\"3C1206\", \"Rebel\"], [\"3C1F76\", \"Meteorite\"], [\"3C2005\", \"Dark Ebony\"], [\"3C3910\", \"Camouflage\"], [\"3C4151\", \"Bright Gray\"], [\"3C4443\", \"Cape Cod\"], [\"3C493A\", \"Lunar Green\"], [\"3D0C02\", \"Bean \"], [\"3D2B1F\", \"Bistre\"], [\"3D7D52\", \"Goblin\"], [\"3E0480\", \"Kingfisher Daisy\"], [\"3E1C14\", \"Cedar\"], [\"3E2B23\", \"English Walnut\"], [\"3E2C1C\", \"Black Marlin\"], [\"3E3A44\", \"Ship Gray\"], [\"3EABBF\", \"Pelorous\"], [\"3F2109\", \"Bronze\"], [\"3F2500\", \"Cola\"], [\"3F3002\", \"Madras\"], [\"3F307F\", \"Minsk\"], [\"3F4C3A\", \"Cabbage Pont\"], [\"3F583B\", \"Tom Thumb\"], [\"3F5D53\", \"Mineral Green\"], [\"3FC1AA\", \"Puerto Rico\"], [\"3FFF00\", \"Harlequin\"], [\"401801\", \"Brown Pod\"], [\"40291D\", \"Cork\"], [\"403B38\", \"Masala\"], [\"403D19\", \"Thatch Green\"], [\"405169\", \"Fiord\"], [\"40826D\", \"Viridian\"], [\"40A860\", \"Chateau Green\"], [\"410056\", \"Ripe Plum\"], [\"411F10\", \"Paco\"], [\"412010\", \"Deep Oak\"], [\"413C37\", \"Merlin\"], [\"414257\", \"Gun Powder\"], [\"414C7D\", \"East Bay\"], [\"4169E1\", \"Royal Blue\"], [\"41AA78\", \"Ocean Green\"], [\"420303\", \"Burnt Maroon\"], [\"423921\", \"Lisbon Brown\"], [\"427977\", \"Faded Jade\"], [\"431560\", \"Scarlet Gum\"], [\"433120\", \"Iroko\"], [\"433E37\", \"Armadillo\"], [\"434C59\", \"River Bed\"], [\"436A0D\", \"Green Leaf\"], [\"44012D\", \"Barossa\"], [\"441D00\", \"Morocco Brown\"], [\"444954\", \"Mako\"], [\"454936\", \"Kelp\"], [\"456CAC\", \"San Marino\"], [\"45B1E8\", \"Picton Blue\"], [\"460B41\", \"Loulou\"], [\"462425\", \"Crater Brown\"], [\"465945\", \"Gray Asparagus\"], [\"4682B4\", \"Steel Blue\"], [\"480404\", \"Rustic Red\"], [\"480607\", \"Bulgarian Rose\"], [\"480656\", \"Clairvoyant\"], [\"481C1C\", \"Cocoa Bean\"], [\"483131\", \"Woody Brown\"], [\"483C32\", \"Taupe\"], [\"49170C\", \"Van Cleef\"], [\"492615\", \"Brown Derby\"], [\"49371B\", \"Metallic Bronze\"], [\"495400\", \"Verdun Green\"], [\"496679\", \"Blue Bayoux\"], [\"497183\", \"Bismark\"], [\"4A2A04\", \"Bracken\"], [\"4A3004\", \"Deep Bronze\"], [\"4A3C30\", \"Mondo\"], [\"4A4244\", \"Tundora\"], [\"4A444B\", \"Gravel\"], [\"4A4E5A\", \"Trout\"], [\"4B0082\", \"Pigment Indigo\"], [\"4B5D52\", \"Nandor\"], [\"4C3024\", \"Saddle\"], [\"4C4F56\", \"Abbey\"], [\"4D0135\", \"Blackberry\"], [\"4D0A18\", \"Cab Sav\"], [\"4D1E01\", \"Indian Tan\"], [\"4D282D\", \"Cowboy\"], [\"4D282E\", \"Livid Brown\"], [\"4D3833\", \"Rock\"], [\"4D3D14\", \"Punga\"], [\"4D400F\", \"Bronzetone\"], [\"4D5328\", \"Woodland\"], [\"4E0606\", \"Mahogany\"], [\"4E2A5A\", \"Bossanova\"], [\"4E3B41\", \"Matterhorn\"], [\"4E420C\", \"Bronze Olive\"], [\"4E4562\", \"Mulled Wine\"], [\"4E6649\", \"Axolotl\"], [\"4E7F9E\", \"Wedgewood\"], [\"4EABD1\", \"Shakespeare\"], [\"4F1C70\", \"Honey Flower\"], [\"4F2398\", \"Daisy Bush\"], [\"4F69C6\", \"Indigo\"], [\"4F7942\", \"Fern Green\"], [\"4F9D5D\", \"Fruit Salad\"], [\"4FA83D\", \"Apple\"], [\"504351\", \"Mortar\"], [\"507096\", \"Kashmir Blue\"], [\"507672\", \"Cutty Sark\"], [\"50C878\", \"Emerald\"], [\"514649\", \"Emperor\"], [\"516E3D\", \"Chalet Green\"], [\"517C66\", \"Como\"], [\"51808F\", \"Smalt Blue\"], [\"52001F\", \"Castro\"], [\"520C17\", \"Maroon Oak\"], [\"523C94\", \"Gigas\"], [\"533455\", \"Voodoo\"], [\"534491\", \"Victoria\"], [\"53824B\", \"Hippie Green\"], [\"541012\", \"Heath\"], [\"544333\", \"Judge Gray\"], [\"54534D\", \"Fuscous Gray\"], [\"549019\", \"Vida Loca\"], [\"55280C\", \"Cioccolato\"], [\"555B10\", \"Saratoga\"], [\"556D56\", \"Finlandia\"], [\"5590D9\", \"Havelock Blue\"], [\"56B4BE\", \"Fountain Blue\"], [\"578363\", \"Spring Leaves\"], [\"583401\", \"Saddle Brown\"], [\"585562\", \"Scarpa Flow\"], [\"587156\", \"Cactus\"], [\"589AAF\", \"Hippie Blue\"], [\"591D35\", \"Wine Berry\"], [\"592804\", \"Brown Bramble\"], [\"593737\", \"Congo Brown\"], [\"594433\", \"Millbrook\"], [\"5A6E9C\", \"Waikawa Gray\"], [\"5A87A0\", \"Horizon\"], [\"5B3013\", \"Jambalaya\"], [\"5C0120\", \"Bordeaux\"], [\"5C0536\", \"Mulberry Wood\"], [\"5C2E01\", \"Carnaby Tan\"], [\"5C5D75\", \"Comet\"], [\"5D1E0F\", \"Redwood\"], [\"5D4C51\", \"Don Juan\"], [\"5D5C58\", \"Chicago\"], [\"5D5E37\", \"Verdigris\"], [\"5D7747\", \"Dingley\"], [\"5DA19F\", \"Breaker Bay\"], [\"5E483E\", \"Kabul\"], [\"5E5D3B\", \"Hemlock\"], [\"5F3D26\", \"Irish Coffee\"], [\"5F5F6E\", \"Mid Gray\"], [\"5F6672\", \"Shuttle Gray\"], [\"5FA777\", \"Aqua Forest\"], [\"5FB3AC\", \"Tradewind\"], [\"604913\", \"Horses Neck\"], [\"605B73\", \"Smoky\"], [\"606E68\", \"Corduroy\"], [\"6093D1\", \"Danube\"], [\"612718\", \"Espresso\"], [\"614051\", \"Eggplant\"], [\"615D30\", \"Costa Del Sol\"], [\"61845F\", \"Glade Green\"], [\"622F30\", \"Buccaneer\"], [\"623F2D\", \"Quincy\"], [\"624E9A\", \"Butterfly Bush\"], [\"625119\", \"West Coast\"], [\"626649\", \"Finch\"], [\"639A8F\", \"Patina\"], [\"63B76C\", \"Fern\"], [\"6456B7\", \"Blue Violet\"], [\"646077\", \"Dolphin\"], [\"646463\", \"Storm Dust\"], [\"646A54\", \"Siam\"], [\"646E75\", \"Nevada\"], [\"6495ED\", \"Cornflower Blue\"], [\"64CCDB\", \"Viking\"], [\"65000B\", \"Rosewood\"], [\"651A14\", \"Cherrywood\"], [\"652DC1\", \"Purple Heart\"], [\"657220\", \"Fern Frond\"], [\"65745D\", \"Willow Grove\"], [\"65869F\", \"Hoki\"], [\"660045\", \"Pompadour\"], [\"660099\", \"Purple\"], [\"66023C\", \"Tyrian Purple\"], [\"661010\", \"Dark Tan\"], [\"66B58F\", \"Silver Tree\"], [\"66FF00\", \"Bright Green\"], [\"66FF66\", \"Screamin' Green\"], [\"67032D\", \"Black Rose\"], [\"675FA6\", \"Scampi\"], [\"676662\", \"Ironside Gray\"], [\"678975\", \"Viridian Green\"], [\"67A712\", \"Christi\"], [\"683600\", \"Nutmeg Wood Finish\"], [\"685558\", \"Zambezi\"], [\"685E6E\", \"Salt Box\"], [\"692545\", \"Tawny Port\"], [\"692D54\", \"Finn\"], [\"695F62\", \"Scorpion\"], [\"697E9A\", \"Lynch\"], [\"6A442E\", \"Spice\"], [\"6A5D1B\", \"Himalaya\"], [\"6A6051\", \"Soya Bean\"], [\"6B2A14\", \"Hairy Heath\"], [\"6B3FA0\", \"Royal Purple\"], [\"6B4E31\", \"Shingle Fawn\"], [\"6B5755\", \"Dorado\"], [\"6B8BA2\", \"Bermuda Gray\"], [\"6B8E23\", \"Olive Drab\"], [\"6C3082\", \"Eminence\"], [\"6CDAE7\", \"Turquoise Blue\"], [\"6D0101\", \"Lonestar\"], [\"6D5E54\", \"Pine Cone\"], [\"6D6C6C\", \"Dove Gray\"], [\"6D9292\", \"Juniper\"], [\"6D92A1\", \"Gothic\"], [\"6E0902\", \"Red Oxide\"], [\"6E1D14\", \"Moccaccino\"], [\"6E4826\", \"Pickled Bean\"], [\"6E4B26\", \"Dallas\"], [\"6E6D57\", \"Kokoda\"], [\"6E7783\", \"Pale Sky\"], [\"6F440C\", \"Cafe Royale\"], [\"6F6A61\", \"Flint\"], [\"6F8E63\", \"Highland\"], [\"6F9D02\", \"Limeade\"], [\"6FD0C5\", \"Downy\"], [\"701C1C\", \"Persian Plum\"], [\"704214\", \"Sepia\"], [\"704A07\", \"Antique Bronze\"], [\"704F50\", \"Ferra\"], [\"706555\", \"Coffee\"], [\"708090\", \"Slate Gray\"], [\"711A00\", \"Cedar Wood Finish\"], [\"71291D\", \"Metallic Copper\"], [\"714693\", \"Affair\"], [\"714AB2\", \"Studio\"], [\"715D47\", \"Tobacco Brown\"], [\"716338\", \"Yellow Metal\"], [\"716B56\", \"Peat\"], [\"716E10\", \"Olivetone\"], [\"717486\", \"Storm Gray\"], [\"718080\", \"Sirocco\"], [\"71D9E2\", \"Aquamarine Blue\"], [\"72010F\", \"Venetian Red\"], [\"724A2F\", \"Old Copper\"], [\"726D4E\", \"Go Ben\"], [\"727B89\", \"Raven\"], [\"731E8F\", \"Seance\"], [\"734A12\", \"Raw Umber\"], [\"736C9F\", \"Kimberly\"], [\"736D58\", \"Crocodile\"], [\"737829\", \"Crete\"], [\"738678\", \"Xanadu\"], [\"74640D\", \"Spicy Mustard\"], [\"747D63\", \"Limed Ash\"], [\"747D83\", \"Rolling Stone\"], [\"748881\", \"Blue Smoke\"], [\"749378\", \"Laurel\"], [\"74C365\", \"Mantis\"], [\"755A57\", \"Russett\"], [\"7563A8\", \"Deluge\"], [\"76395D\", \"Cosmic\"], [\"7666C6\", \"Blue Marguerite\"], [\"76BD17\", \"Lima\"], [\"76D7EA\", \"Sky Blue\"], [\"770F05\", \"Dark Burgundy\"], [\"771F1F\", \"Crown of Thorns\"], [\"773F1A\", \"Walnut\"], [\"776F61\", \"Pablo\"], [\"778120\", \"Pacifika\"], [\"779E86\", \"Oxley\"], [\"77DD77\", \"Pastel Green\"], [\"780109\", \"Japanese Maple\"], [\"782D19\", \"Mocha\"], [\"782F16\", \"Peanut\"], [\"78866B\", \"Camouflage Green\"], [\"788A25\", \"Wasabi\"], [\"788BBA\", \"Ship Cove\"], [\"78A39C\", \"Sea Nymph\"], [\"795D4C\", \"Roman Coffee\"], [\"796878\", \"Old Lavender\"], [\"796989\", \"Rum\"], [\"796A78\", \"Fedora\"], [\"796D62\", \"Sandstone\"], [\"79DEEC\", \"Spray\"], [\"7A013A\", \"Siren\"], [\"7A58C1\", \"Fuchsia Blue\"], [\"7A7A7A\", \"Boulder\"], [\"7A89B8\", \"Wild Blue Yonder\"], [\"7AC488\", \"De York\"], [\"7B3801\", \"Red Beech\"], [\"7B3F00\", \"Cinnamon\"], [\"7B6608\", \"Yukon Gold\"], [\"7B7874\", \"Tapa\"], [\"7B7C94\", \"Waterloo \"], [\"7B8265\", \"Flax Smoke\"], [\"7B9F80\", \"Amulet\"], [\"7BA05B\", \"Asparagus\"], [\"7C1C05\", \"Kenyan Copper\"], [\"7C7631\", \"Pesto\"], [\"7C778A\", \"Topaz\"], [\"7C7B7A\", \"Concord\"], [\"7C7B82\", \"Jumbo\"], [\"7C881A\", \"Trendy Green\"], [\"7CA1A6\", \"Gumbo\"], [\"7CB0A1\", \"Acapulco\"], [\"7CB7BB\", \"Neptune\"], [\"7D2C14\", \"Pueblo\"], [\"7DA98D\", \"Bay Leaf\"], [\"7DC8F7\", \"Malibu\"], [\"7DD8C6\", \"Bermuda\"], [\"7E3A15\", \"Copper Canyon\"], [\"7F1734\", \"Claret\"], [\"7F3A02\", \"Peru Tan\"], [\"7F626D\", \"Falcon\"], [\"7F7589\", \"Mobster\"], [\"7F76D3\", \"Moody Blue\"], [\"7FFF00\", \"Chartreuse\"], [\"7FFFD4\", \"Aquamarine\"], [\"800000\", \"Maroon\"], [\"800B47\", \"Rose Bud Cherry\"], [\"801818\", \"Falu Red\"], [\"80341F\", \"Red Robin\"], [\"803790\", \"Vivid Violet\"], [\"80461B\", \"Russet\"], [\"807E79\", \"Friar Gray\"], [\"808000\", \"Olive\"], [\"808080\", \"Gray\"], [\"80B3AE\", \"Gulf Stream\"], [\"80B3C4\", \"Glacier\"], [\"80CCEA\", \"Seagull\"], [\"81422C\", \"Nutmeg\"], [\"816E71\", \"Spicy Pink\"], [\"817377\", \"Empress\"], [\"819885\", \"Spanish Green\"], [\"826F65\", \"Sand Dune\"], [\"828685\", \"Gunsmoke\"], [\"828F72\", \"Battleship Gray\"], [\"831923\", \"Merlot\"], [\"837050\", \"Shadow\"], [\"83AA5D\", \"Chelsea Cucumber\"], [\"83D0C6\", \"Monte Carlo\"], [\"843179\", \"Plum\"], [\"84A0A0\", \"Granny Smith\"], [\"8581D9\", \"Chetwode Blue\"], [\"858470\", \"Bandicoot\"], [\"859FAF\", \"Bali Hai\"], [\"85C4CC\", \"Half Baked\"], [\"860111\", \"Red Devil\"], [\"863C3C\", \"Lotus\"], [\"86483C\", \"Ironstone\"], [\"864D1E\", \"Bull Shot\"], [\"86560A\", \"Rusty Nail\"], [\"868974\", \"Bitter\"], [\"86949F\", \"Regent Gray\"], [\"871550\", \"Disco\"], [\"87756E\", \"Americano\"], [\"877C7B\", \"Hurricane\"], [\"878D91\", \"Oslo Gray\"], [\"87AB39\", \"Sushi\"], [\"885342\", \"Spicy Mix\"], [\"886221\", \"Kumera\"], [\"888387\", \"Suva Gray\"], [\"888D65\", \"Avocado\"], [\"893456\", \"Camelot\"], [\"893843\", \"Solid Pink\"], [\"894367\", \"Cannon Pink\"], [\"897D6D\", \"Makara\"], [\"8A3324\", \"Burnt Umber\"], [\"8A73D6\", \"True V\"], [\"8A8360\", \"Clay Creek\"], [\"8A8389\", \"Monsoon\"], [\"8A8F8A\", \"Stack\"], [\"8AB9F1\", \"Jordy Blue\"], [\"8B00FF\", \"Electric Violet\"], [\"8B0723\", \"Monarch\"], [\"8B6B0B\", \"Corn Harvest\"], [\"8B8470\", \"Olive Haze\"], [\"8B847E\", \"Schooner\"], [\"8B8680\", \"Natural Gray\"], [\"8B9C90\", \"Mantle\"], [\"8B9FEE\", \"Portage\"], [\"8BA690\", \"Envy\"], [\"8BA9A5\", \"Cascade\"], [\"8BE6D8\", \"Riptide\"], [\"8C055E\", \"Cardinal Pink\"], [\"8C472F\", \"Mule Fawn\"], [\"8C5738\", \"Potters Clay\"], [\"8C6495\", \"Trendy Pink\"], [\"8D0226\", \"Paprika\"], [\"8D3D38\", \"Sanguine Brown\"], [\"8D3F3F\", \"Tosca\"], [\"8D7662\", \"Cement\"], [\"8D8974\", \"Granite Green\"], [\"8D90A1\", \"Manatee\"], [\"8DA8CC\", \"Polo Blue\"], [\"8E0000\", \"Red Berry\"], [\"8E4D1E\", \"Rope\"], [\"8E6F70\", \"Opium\"], [\"8E775E\", \"Domino\"], [\"8E8190\", \"Mamba\"], [\"8EABC1\", \"Nepal\"], [\"8F021C\", \"Pohutukawa\"], [\"8F3E33\", \"El Salva\"], [\"8F4B0E\", \"Korma\"], [\"8F8176\", \"Squirrel\"], [\"8FD6B4\", \"Vista Blue\"], [\"900020\", \"Burgundy\"], [\"901E1E\", \"Old Brick\"], [\"907874\", \"Hemp\"], [\"907B71\", \"Almond Frost\"], [\"908D39\", \"Sycamore\"], [\"92000A\", \"Sangria\"], [\"924321\", \"Cumin\"], [\"926F5B\", \"Beaver\"], [\"928573\", \"Stonewall\"], [\"928590\", \"Venus\"], [\"9370DB\", \"Medium Purple\"], [\"93CCEA\", \"Cornflower\"], [\"93DFB8\", \"Algae Green\"], [\"944747\", \"Copper Rust\"], [\"948771\", \"Arrowtown\"], [\"950015\", \"Scarlett\"], [\"956387\", \"Strikemaster\"], [\"959396\", \"Mountain Mist\"], [\"960018\", \"Carmine\"], [\"964B00\", \"Brown\"], [\"967059\", \"Leather\"], [\"9678B6\", \"Purple Mountain's Majesty\"], [\"967BB6\", \"Lavender Purple\"], [\"96A8A1\", \"Pewter\"], [\"96BBAB\", \"Summer Green\"], [\"97605D\", \"Au Chico\"], [\"9771B5\", \"Wisteria\"], [\"97CD2D\", \"Atlantis\"], [\"983D61\", \"Vin Rouge\"], [\"9874D3\", \"Lilac Bush\"], [\"98777B\", \"Bazaar\"], [\"98811B\", \"Hacienda\"], [\"988D77\", \"Pale Oyster\"], [\"98FF98\", \"Mint Green\"], [\"990066\", \"Fresh Eggplant\"], [\"991199\", \"Violet Eggplant\"], [\"991613\", \"Tamarillo\"], [\"991B07\", \"Totem Pole\"], [\"996666\", \"Copper Rose\"], [\"9966CC\", \"Amethyst\"], [\"997A8D\", \"Mountbatten Pink\"], [\"9999CC\", \"Blue Bell\"], [\"9A3820\", \"Prairie Sand\"], [\"9A6E61\", \"Toast\"], [\"9A9577\", \"Gurkha\"], [\"9AB973\", \"Olivine\"], [\"9AC2B8\", \"Shadow Green\"], [\"9B4703\", \"Oregon\"], [\"9B9E8F\", \"Lemon Grass\"], [\"9C3336\", \"Stiletto\"], [\"9D5616\", \"Hawaiian Tan\"], [\"9DACB7\", \"Gull Gray\"], [\"9DC209\", \"Pistachio\"], [\"9DE093\", \"Granny Smith Apple\"], [\"9DE5FF\", \"Anakiwa\"], [\"9E5302\", \"Chelsea Gem\"], [\"9E5B40\", \"Sepia Skin\"], [\"9EA587\", \"Sage\"], [\"9EA91F\", \"Citron\"], [\"9EB1CD\", \"Rock Blue\"], [\"9EDEE0\", \"Morning Glory\"], [\"9F381D\", \"Cognac\"], [\"9F821C\", \"Reef Gold\"], [\"9F9F9C\", \"Star Dust\"], [\"9FA0B1\", \"Santas Gray\"], [\"9FD7D3\", \"Sinbad\"], [\"9FDD8C\", \"Feijoa\"], [\"A02712\", \"Tabasco\"], [\"A1750D\", \"Buttered Rum\"], [\"A1ADB5\", \"Hit Gray\"], [\"A1C50A\", \"Citrus\"], [\"A1DAD7\", \"Aqua Island\"], [\"A1E9DE\", \"Water Leaf\"], [\"A2006D\", \"Flirt\"], [\"A23B6C\", \"Rouge\"], [\"A26645\", \"Cape Palliser\"], [\"A2AAB3\", \"Gray Chateau\"], [\"A2AEAB\", \"Edward\"], [\"A3807B\", \"Pharlap\"], [\"A397B4\", \"Amethyst Smoke\"], [\"A3E3ED\", \"Blizzard Blue\"], [\"A4A49D\", \"Delta\"], [\"A4A6D3\", \"Wistful\"], [\"A4AF6E\", \"Green Smoke\"], [\"A50B5E\", \"Jazzberry Jam\"], [\"A59B91\", \"Zorba\"], [\"A5CB0C\", \"Bahia\"], [\"A62F20\", \"Roof Terracotta\"], [\"A65529\", \"Paarl\"], [\"A68B5B\", \"Barley Corn\"], [\"A69279\", \"Donkey Brown\"], [\"A6A29A\", \"Dawn\"], [\"A72525\", \"Mexican Red\"], [\"A7882C\", \"Luxor Gold\"], [\"A85307\", \"Rich Gold\"], [\"A86515\", \"Reno Sand\"], [\"A86B6B\", \"Coral Tree\"], [\"A8989B\", \"Dusty Gray\"], [\"A899E6\", \"Dull Lavender\"], [\"A8A589\", \"Tallow\"], [\"A8AE9C\", \"Bud\"], [\"A8AF8E\", \"Locust\"], [\"A8BD9F\", \"Norway\"], [\"A8E3BD\", \"Chinook\"], [\"A9A491\", \"Gray Olive\"], [\"A9ACB6\", \"Aluminium\"], [\"A9B2C3\", \"Cadet Blue\"], [\"A9B497\", \"Schist\"], [\"A9BDBF\", \"Tower Gray\"], [\"A9BEF2\", \"Perano\"], [\"A9C6C2\", \"Opal\"], [\"AA375A\", \"Night Shadz\"], [\"AA4203\", \"Fire\"], [\"AA8B5B\", \"Muesli\"], [\"AA8D6F\", \"Sandal\"], [\"AAA5A9\", \"Shady Lady\"], [\"AAA9CD\", \"Logan\"], [\"AAABB7\", \"Spun Pearl\"], [\"AAD6E6\", \"Regent St Blue\"], [\"AAF0D1\", \"Magic Mint\"], [\"AB0563\", \"Lipstick\"], [\"AB3472\", \"Royal Heath\"], [\"AB917A\", \"Sandrift\"], [\"ABA0D9\", \"Cold Purple\"], [\"ABA196\", \"Bronco\"], [\"AC8A56\", \"Limed Oak\"], [\"AC91CE\", \"East Side\"], [\"AC9E22\", \"Lemon Ginger\"], [\"ACA494\", \"Napa\"], [\"ACA586\", \"Hillary\"], [\"ACA59F\", \"Cloudy\"], [\"ACACAC\", \"Silver Chalice\"], [\"ACB78E\", \"Swamp Green\"], [\"ACCBB1\", \"Spring Rain\"], [\"ACDD4D\", \"Conifer\"], [\"ACE1AF\", \"Celadon\"], [\"AD781B\", \"Mandalay\"], [\"ADBED1\", \"Casper\"], [\"ADDFAD\", \"Moss Green\"], [\"ADE6C4\", \"Padua\"], [\"ADFF2F\", \"Green Yellow\"], [\"AE4560\", \"Hippie Pink\"], [\"AE6020\", \"Desert\"], [\"AE809E\", \"Bouquet\"], [\"AF4035\", \"Medium Carmine\"], [\"AF4D43\", \"Apple Blossom\"], [\"AF593E\", \"Brown Rust\"], [\"AF8751\", \"Driftwood\"], [\"AF8F2C\", \"Alpine\"], [\"AF9F1C\", \"Lucky\"], [\"AFA09E\", \"Martini\"], [\"AFB1B8\", \"Bombay\"], [\"AFBDD9\", \"Pigeon Post\"], [\"B04C6A\", \"Cadillac\"], [\"B05D54\", \"Matrix\"], [\"B05E81\", \"Tapestry\"], [\"B06608\", \"Mai Tai\"], [\"B09A95\", \"Del Rio\"], [\"B0E0E6\", \"Powder Blue\"], [\"B0E313\", \"Inch Worm\"], [\"B10000\", \"Bright Red\"], [\"B14A0B\", \"Vesuvius\"], [\"B1610B\", \"Pumpkin Skin\"], [\"B16D52\", \"Santa Fe\"], [\"B19461\", \"Teak\"], [\"B1E2C1\", \"Fringy Flower\"], [\"B1F4E7\", \"Ice Cold\"], [\"B20931\", \"Shiraz\"], [\"B2A1EA\", \"Biloba Flower\"], [\"B32D29\", \"Tall Poppy\"], [\"B35213\", \"Fiery Orange\"], [\"B38007\", \"Hot Toddy\"], [\"B3AF95\", \"Taupe Gray\"], [\"B3C110\", \"La Rioja\"], [\"B43332\", \"Well Read\"], [\"B44668\", \"Blush\"], [\"B4CFD3\", \"Jungle Mist\"], [\"B57281\", \"Turkish Rose\"], [\"B57EDC\", \"Lavender\"], [\"B5A27F\", \"Mongoose\"], [\"B5B35C\", \"Olive Green\"], [\"B5D2CE\", \"Jet Stream\"], [\"B5ECDF\", \"Cruise\"], [\"B6316C\", \"Hibiscus\"], [\"B69D98\", \"Thatch\"], [\"B6B095\", \"Heathered Gray\"], [\"B6BAA4\", \"Eagle\"], [\"B6D1EA\", \"Spindle\"], [\"B6D3BF\", \"Gum Leaf\"], [\"B7410E\", \"Rust\"], [\"B78E5C\", \"Muddy Waters\"], [\"B7A214\", \"Sahara\"], [\"B7A458\", \"Husk\"], [\"B7B1B1\", \"Nobel\"], [\"B7C3D0\", \"Heather\"], [\"B7F0BE\", \"Madang\"], [\"B81104\", \"Milano Red\"], [\"B87333\", \"Copper\"], [\"B8B56A\", \"Gimblet\"], [\"B8C1B1\", \"Green Spring\"], [\"B8C25D\", \"Celery\"], [\"B8E0F9\", \"Sail\"], [\"B94E48\", \"Chestnut\"], [\"B95140\", \"Crail\"], [\"B98D28\", \"Marigold\"], [\"B9C46A\", \"Wild Willow\"], [\"B9C8AC\", \"Rainee\"], [\"BA0101\", \"Guardsman Red\"], [\"BA450C\", \"Rock Spray\"], [\"BA6F1E\", \"Bourbon\"], [\"BA7F03\", \"Pirate Gold\"], [\"BAB1A2\", \"Nomad\"], [\"BAC7C9\", \"Submarine\"], [\"BAEEF9\", \"Charlotte\"], [\"BB3385\", \"Medium Red Violet\"], [\"BB8983\", \"Brandy Rose\"], [\"BBD009\", \"Rio Grande\"], [\"BBD7C1\", \"Surf\"], [\"BCC9C2\", \"Powder Ash\"], [\"BD5E2E\", \"Tuscany\"], [\"BD978E\", \"Quicksand\"], [\"BDB1A8\", \"Silk\"], [\"BDB2A1\", \"Malta\"], [\"BDB3C7\", \"Chatelle\"], [\"BDBBD7\", \"Lavender Gray\"], [\"BDBDC6\", \"French Gray\"], [\"BDC8B3\", \"Clay Ash\"], [\"BDC9CE\", \"Loblolly\"], [\"BDEDFD\", \"French Pass\"], [\"BEA6C3\", \"London Hue\"], [\"BEB5B7\", \"Pink Swan\"], [\"BEDE0D\", \"Fuego\"], [\"BF5500\", \"Rose of Sharon\"], [\"BFB8B0\", \"Tide\"], [\"BFBED8\", \"Blue Haze\"], [\"BFC1C2\", \"Silver Sand\"], [\"BFC921\", \"Key Lime Pie\"], [\"BFDBE2\", \"Ziggurat\"], [\"BFFF00\", \"Lime\"], [\"C02B18\", \"Thunderbird\"], [\"C04737\", \"Mojo\"], [\"C08081\", \"Old Rose\"], [\"C0C0C0\", \"Silver\"], [\"C0D3B9\", \"Pale Leaf\"], [\"C0D8B6\", \"Pixie Green\"], [\"C1440E\", \"Tia Maria\"], [\"C154C1\", \"Fuchsia Pink\"], [\"C1A004\", \"Buddha Gold\"], [\"C1B7A4\", \"Bison Hide\"], [\"C1BAB0\", \"Tea\"], [\"C1BECD\", \"Gray Suit\"], [\"C1D7B0\", \"Sprout\"], [\"C1F07C\", \"Sulu\"], [\"C26B03\", \"Indochine\"], [\"C2955D\", \"Twine\"], [\"C2BDB6\", \"Cotton Seed\"], [\"C2CAC4\", \"Pumice\"], [\"C2E8E5\", \"Jagged Ice\"], [\"C32148\", \"Maroon Flush\"], [\"C3B091\", \"Indian Khaki\"], [\"C3BFC1\", \"Pale Slate\"], [\"C3C3BD\", \"Gray Nickel\"], [\"C3CDE6\", \"Periwinkle Gray\"], [\"C3D1D1\", \"Tiara\"], [\"C3DDF9\", \"Tropical Blue\"], [\"C41E3A\", \"Cardinal\"], [\"C45655\", \"Fuzzy Wuzzy Brown\"], [\"C45719\", \"Orange Roughy\"], [\"C4C4BC\", \"Mist Gray\"], [\"C4D0B0\", \"Coriander\"], [\"C4F4EB\", \"Mint Tulip\"], [\"C54B8C\", \"Mulberry\"], [\"C59922\", \"Nugget\"], [\"C5994B\", \"Tussock\"], [\"C5DBCA\", \"Sea Mist\"], [\"C5E17A\", \"Yellow Green\"], [\"C62D42\", \"Brick Red\"], [\"C6726B\", \"Contessa\"], [\"C69191\", \"Oriental Pink\"], [\"C6A84B\", \"Roti\"], [\"C6C3B5\", \"Ash\"], [\"C6C8BD\", \"Kangaroo\"], [\"C6E610\", \"Las Palmas\"], [\"C7031E\", \"Monza\"], [\"C71585\", \"Red Violet\"], [\"C7BCA2\", \"Coral Reef\"], [\"C7C1FF\", \"Melrose\"], [\"C7C4BF\", \"Cloud\"], [\"C7C9D5\", \"Ghost\"], [\"C7CD90\", \"Pine Glade\"], [\"C7DDE5\", \"Botticelli\"], [\"C88A65\", \"Antique Brass\"], [\"C8A2C8\", \"Lilac\"], [\"C8A528\", \"Hokey Pokey\"], [\"C8AABF\", \"Lily\"], [\"C8B568\", \"Laser\"], [\"C8E3D7\", \"Edgewater\"], [\"C96323\", \"Piper\"], [\"C99415\", \"Pizza\"], [\"C9A0DC\", \"Light Wisteria\"], [\"C9B29B\", \"Rodeo Dust\"], [\"C9B35B\", \"Sundance\"], [\"C9B93B\", \"Earls Green\"], [\"C9C0BB\", \"Silver Rust\"], [\"C9D9D2\", \"Conch\"], [\"C9FFA2\", \"Reef\"], [\"C9FFE5\", \"Aero Blue\"], [\"CA3435\", \"Flush Mahogany\"], [\"CABB48\", \"Turmeric\"], [\"CADCD4\", \"Paris White\"], [\"CAE00D\", \"Bitter Lemon\"], [\"CAE6DA\", \"Skeptic\"], [\"CB8FA9\", \"Viola\"], [\"CBCAB6\", \"Foggy Gray\"], [\"CBD3B0\", \"Green Mist\"], [\"CBDBD6\", \"Nebula\"], [\"CC3333\", \"Persian Red\"], [\"CC5500\", \"Burnt Orange\"], [\"CC7722\", \"Ochre\"], [\"CC8899\", \"Puce\"], [\"CCCAA8\", \"Thistle Green\"], [\"CCCCFF\", \"Periwinkle\"], [\"CCFF00\", \"Electric Lime\"], [\"CD5700\", \"Tenn\"], [\"CD5C5C\", \"Chestnut Rose\"], [\"CD8429\", \"Brandy Punch\"], [\"CDF4FF\", \"Onahau\"], [\"CEB98F\", \"Sorrell Brown\"], [\"CEBABA\", \"Cold Turkey\"], [\"CEC291\", \"Yuma\"], [\"CEC7A7\", \"Chino\"], [\"CFA39D\", \"Eunry\"], [\"CFB53B\", \"Old Gold\"], [\"CFDCCF\", \"Tasman\"], [\"CFE5D2\", \"Surf Crest\"], [\"CFF9F3\", \"Humming Bird\"], [\"CFFAF4\", \"Scandal\"], [\"D05F04\", \"Red Stage\"], [\"D06DA1\", \"Hopbush\"], [\"D07D12\", \"Meteor\"], [\"D0BEF8\", \"Perfume\"], [\"D0C0E5\", \"Prelude\"], [\"D0F0C0\", \"Tea Green\"], [\"D18F1B\", \"Geebung\"], [\"D1BEA8\", \"Vanilla\"], [\"D1C6B4\", \"Soft Amber\"], [\"D1D2CA\", \"Celeste\"], [\"D1D2DD\", \"Mischka\"], [\"D1E231\", \"Pear\"], [\"D2691E\", \"Hot Cinnamon\"], [\"D27D46\", \"Raw Sienna\"], [\"D29EAA\", \"Careys Pink\"], [\"D2B48C\", \"Tan\"], [\"D2DA97\", \"Deco\"], [\"D2F6DE\", \"Blue Romance\"], [\"D2F8B0\", \"Gossip\"], [\"D3CBBA\", \"Sisal\"], [\"D3CDC5\", \"Swirl\"], [\"D47494\", \"Charm\"], [\"D4B6AF\", \"Clam Shell\"], [\"D4BF8D\", \"Straw\"], [\"D4C4A8\", \"Akaroa\"], [\"D4CD16\", \"Bird Flower\"], [\"D4D7D9\", \"Iron\"], [\"D4DFE2\", \"Geyser\"], [\"D4E2FC\", \"Hawkes Blue\"], [\"D54600\", \"Grenadier\"], [\"D591A4\", \"Can Can\"], [\"D59A6F\", \"Whiskey\"], [\"D5D195\", \"Winter Hazel\"], [\"D5F6E3\", \"Granny Apple\"], [\"D69188\", \"My Pink\"], [\"D6C562\", \"Tacha\"], [\"D6CEF6\", \"Moon Raker\"], [\"D6D6D1\", \"Quill Gray\"], [\"D6FFDB\", \"Snowy Mint\"], [\"D7837F\", \"New York Pink\"], [\"D7C498\", \"Pavlova\"], [\"D7D0FF\", \"Fog\"], [\"D84437\", \"Valencia\"], [\"D87C63\", \"Japonica\"], [\"D8BFD8\", \"Thistle\"], [\"D8C2D5\", \"Maverick\"], [\"D8FCFA\", \"Foam\"], [\"D94972\", \"Cabaret\"], [\"D99376\", \"Burning Sand\"], [\"D9B99B\", \"Cameo\"], [\"D9D6CF\", \"Timberwolf\"], [\"D9DCC1\", \"Tana\"], [\"D9E4F5\", \"Link Water\"], [\"D9F7FF\", \"Mabel\"], [\"DA3287\", \"Cerise\"], [\"DA5B38\", \"Flame Pea\"], [\"DA6304\", \"Bamboo\"], [\"DA6A41\", \"Red Damask\"], [\"DA70D6\", \"Orchid\"], [\"DA8A67\", \"Copperfield\"], [\"DAA520\", \"Golden Grass\"], [\"DAECD6\", \"Zanah\"], [\"DAF4F0\", \"Iceberg\"], [\"DAFAFF\", \"Oyster Bay\"], [\"DB5079\", \"Cranberry\"], [\"DB9690\", \"Petite Orchid\"], [\"DB995E\", \"Di Serria\"], [\"DBDBDB\", \"Alto\"], [\"DBFFF8\", \"Frosted Mint\"], [\"DC143C\", \"Crimson\"], [\"DC4333\", \"Punch\"], [\"DCB20C\", \"Galliano\"], [\"DCB4BC\", \"Blossom\"], [\"DCD747\", \"Wattle\"], [\"DCD9D2\", \"Westar\"], [\"DCDDCC\", \"Moon Mist\"], [\"DCEDB4\", \"Caper\"], [\"DCF0EA\", \"Swans Down\"], [\"DDD6D5\", \"Swiss Coffee\"], [\"DDF9F1\", \"White Ice\"], [\"DE3163\", \"Cerise Red\"], [\"DE6360\", \"Roman\"], [\"DEA681\", \"Tumbleweed\"], [\"DEBA13\", \"Gold Tips\"], [\"DEC196\", \"Brandy\"], [\"DECBC6\", \"Wafer\"], [\"DED4A4\", \"Sapling\"], [\"DED717\", \"Barberry\"], [\"DEE5C0\", \"Beryl Green\"], [\"DEF5FF\", \"Pattens Blue\"], [\"DF73FF\", \"Heliotrope\"], [\"DFBE6F\", \"Apache\"], [\"DFCD6F\", \"Chenin\"], [\"DFCFDB\", \"Lola\"], [\"DFECDA\", \"Willow Brook\"], [\"DFFF00\", \"Chartreuse Yellow\"], [\"E0B0FF\", \"Mauve\"], [\"E0B646\", \"Anzac\"], [\"E0B974\", \"Harvest Gold\"], [\"E0C095\", \"Calico\"], [\"E0FFFF\", \"Baby Blue\"], [\"E16865\", \"Sunglo\"], [\"E1BC64\", \"Equator\"], [\"E1C0C8\", \"Pink Flare\"], [\"E1E6D6\", \"Periglacial Blue\"], [\"E1EAD4\", \"Kidnapper\"], [\"E1F6E8\", \"Tara\"], [\"E25465\", \"Mandy\"], [\"E2725B\", \"Terracotta\"], [\"E28913\", \"Golden Bell\"], [\"E292C0\", \"Shocking\"], [\"E29418\", \"Dixie\"], [\"E29CD2\", \"Light Orchid\"], [\"E2D8ED\", \"Snuff\"], [\"E2EBED\", \"Mystic\"], [\"E2F3EC\", \"Apple Green\"], [\"E30B5C\", \"Razzmatazz\"], [\"E32636\", \"Alizarin Crimson\"], [\"E34234\", \"Cinnabar\"], [\"E3BEBE\", \"Cavern Pink\"], [\"E3F5E1\", \"Peppermint\"], [\"E3F988\", \"Mindaro\"], [\"E47698\", \"Deep Blush\"], [\"E49B0F\", \"Gamboge\"], [\"E4C2D5\", \"Melanie\"], [\"E4CFDE\", \"Twilight\"], [\"E4D1C0\", \"Bone\"], [\"E4D422\", \"Sunflower\"], [\"E4D5B7\", \"Grain Brown\"], [\"E4D69B\", \"Zombie\"], [\"E4F6E7\", \"Frostee\"], [\"E4FFD1\", \"Snow Flurry\"], [\"E52B50\", \"Amaranth\"], [\"E5841B\", \"Zest\"], [\"E5CCC9\", \"Dust Storm\"], [\"E5D7BD\", \"Stark White\"], [\"E5D8AF\", \"Hampton\"], [\"E5E0E1\", \"Bon Jour\"], [\"E5E5E5\", \"Mercury\"], [\"E5F9F6\", \"Polar\"], [\"E64E03\", \"Trinidad\"], [\"E6BE8A\", \"Gold Sand\"], [\"E6BEA5\", \"Cashmere\"], [\"E6D7B9\", \"Double Spanish White\"], [\"E6E4D4\", \"Satin Linen\"], [\"E6F2EA\", \"Harp\"], [\"E6F8F3\", \"Off Green\"], [\"E6FFE9\", \"Hint of Green\"], [\"E6FFFF\", \"Tranquil\"], [\"E77200\", \"Mango Tango\"], [\"E7730A\", \"Christine\"], [\"E79F8C\", \"Tonys Pink\"], [\"E79FC4\", \"Kobi\"], [\"E7BCB4\", \"Rose Fog\"], [\"E7BF05\", \"Corn\"], [\"E7CD8C\", \"Putty\"], [\"E7ECE6\", \"Gray Nurse\"], [\"E7F8FF\", \"Lily White\"], [\"E7FEFF\", \"Bubbles\"], [\"E89928\", \"Fire Bush\"], [\"E8B9B3\", \"Shilo\"], [\"E8E0D5\", \"Pearl Bush\"], [\"E8EBE0\", \"Green White\"], [\"E8F1D4\", \"Chrome White\"], [\"E8F2EB\", \"Gin\"], [\"E8F5F2\", \"Aqua Squeeze\"], [\"E96E00\", \"Clementine\"], [\"E97451\", \"Burnt Sienna\"], [\"E97C07\", \"Tahiti Gold\"], [\"E9CECD\", \"Oyster Pink\"], [\"E9D75A\", \"Confetti\"], [\"E9E3E3\", \"Ebb\"], [\"E9F8ED\", \"Ottoman\"], [\"E9FFFD\", \"Clear Day\"], [\"EA88A8\", \"Carissma\"], [\"EAAE69\", \"Porsche\"], [\"EAB33B\", \"Tulip Tree\"], [\"EAC674\", \"Rob Roy\"], [\"EADAB8\", \"Raffia\"], [\"EAE8D4\", \"White Rock\"], [\"EAF6EE\", \"Panache\"], [\"EAF6FF\", \"Solitude\"], [\"EAF9F5\", \"Aqua Spring\"], [\"EAFFFE\", \"Dew\"], [\"EB9373\", \"Apricot\"], [\"EBC2AF\", \"Zinnwaldite\"], [\"ECA927\", \"Fuel Yellow\"], [\"ECC54E\", \"Ronchi\"], [\"ECC7EE\", \"French Lilac\"], [\"ECCDB9\", \"Just Right\"], [\"ECE090\", \"Wild Rice\"], [\"ECEBBD\", \"Fall Green\"], [\"ECEBCE\", \"Aths Special\"], [\"ECF245\", \"Starship\"], [\"ED0A3F\", \"Red Ribbon\"], [\"ED7A1C\", \"Tango\"], [\"ED9121\", \"Carrot Orange\"], [\"ED989E\", \"Sea Pink\"], [\"EDB381\", \"Tacao\"], [\"EDC9AF\", \"Desert Sand\"], [\"EDCDAB\", \"Pancho\"], [\"EDDCB1\", \"Chamois\"], [\"EDEA99\", \"Primrose\"], [\"EDF5DD\", \"Frost\"], [\"EDF5F5\", \"Aqua Haze\"], [\"EDF6FF\", \"Zumthor\"], [\"EDF9F1\", \"Narvik\"], [\"EDFC84\", \"Honeysuckle\"], [\"EE82EE\", \"Lavender Magenta\"], [\"EEC1BE\", \"Beauty Bush\"], [\"EED794\", \"Chalky\"], [\"EED9C4\", \"Almond\"], [\"EEDC82\", \"Flax\"], [\"EEDEDA\", \"Bizarre\"], [\"EEE3AD\", \"Double Colonial White\"], [\"EEEEE8\", \"Cararra\"], [\"EEEF78\", \"Manz\"], [\"EEF0C8\", \"Tahuna Sands\"], [\"EEF0F3\", \"Athens Gray\"], [\"EEF3C3\", \"Tusk\"], [\"EEF4DE\", \"Loafer\"], [\"EEF6F7\", \"Catskill White\"], [\"EEFDFF\", \"Twilight Blue\"], [\"EEFF9A\", \"Jonquil\"], [\"EEFFE2\", \"Rice Flower\"], [\"EF863F\", \"Jaffa\"], [\"EFEFEF\", \"Gallery\"], [\"EFF2F3\", \"Porcelain\"], [\"F091A9\", \"Mauvelous\"], [\"F0D52D\", \"Golden Dream\"], [\"F0DB7D\", \"Golden Sand\"], [\"F0DC82\", \"Buff\"], [\"F0E2EC\", \"Prim\"], [\"F0E68C\", \"Khaki\"], [\"F0EEFD\", \"Selago\"], [\"F0EEFF\", \"Titan White\"], [\"F0F8FF\", \"Alice Blue\"], [\"F0FCEA\", \"Feta\"], [\"F18200\", \"Gold Drop\"], [\"F19BAB\", \"Wewak\"], [\"F1E788\", \"Sahara Sand\"], [\"F1E9D2\", \"Parchment\"], [\"F1E9FF\", \"Blue Chalk\"], [\"F1EEC1\", \"Mint Julep\"], [\"F1F1F1\", \"Seashell\"], [\"F1F7F2\", \"Saltpan\"], [\"F1FFAD\", \"Tidal\"], [\"F1FFC8\", \"Chiffon\"], [\"F2552A\", \"Flamingo\"], [\"F28500\", \"Tangerine\"], [\"F2C3B2\", \"Mandys Pink\"], [\"F2F2F2\", \"Concrete\"], [\"F2FAFA\", \"Black Squeeze\"], [\"F34723\", \"Pomegranate\"], [\"F3AD16\", \"Buttercup\"], [\"F3D69D\", \"New Orleans\"], [\"F3D9DF\", \"Vanilla Ice\"], [\"F3E7BB\", \"Sidecar\"], [\"F3E9E5\", \"Dawn Pink\"], [\"F3EDCF\", \"Wheatfield\"], [\"F3FB62\", \"Canary\"], [\"F3FBD4\", \"Orinoco\"], [\"F3FFD8\", \"Carla\"], [\"F400A1\", \"Hollywood Cerise\"], [\"F4A460\", \"Sandy brown\"], [\"F4C430\", \"Saffron\"], [\"F4D81C\", \"Ripe Lemon\"], [\"F4EBD3\", \"Janna\"], [\"F4F2EE\", \"Pampas\"], [\"F4F4F4\", \"Wild Sand\"], [\"F4F8FF\", \"Zircon\"], [\"F57584\", \"Froly\"], [\"F5C85C\", \"Cream Can\"], [\"F5C999\", \"Manhattan\"], [\"F5D5A0\", \"Maize\"], [\"F5DEB3\", \"Wheat\"], [\"F5E7A2\", \"Sandwisp\"], [\"F5E7E2\", \"Pot Pourri\"], [\"F5E9D3\", \"Albescent White\"], [\"F5EDEF\", \"Soft Peach\"], [\"F5F3E5\", \"Ecru White\"], [\"F5F5DC\", \"Beige\"], [\"F5FB3D\", \"Golden Fizz\"], [\"F5FFBE\", \"Australian Mint\"], [\"F64A8A\", \"French Rose\"], [\"F653A6\", \"Brilliant Rose\"], [\"F6A4C9\", \"Illusion\"], [\"F6F0E6\", \"Merino\"], [\"F6F7F7\", \"Black Haze\"], [\"F6FFDC\", \"Spring Sun\"], [\"F7468A\", \"Violet Red\"], [\"F77703\", \"Chilean Fire\"], [\"F77FBE\", \"Persian Pink\"], [\"F7B668\", \"Rajah\"], [\"F7C8DA\", \"Azalea\"], [\"F7DBE6\", \"We Peep\"], [\"F7F2E1\", \"Quarter Spanish White\"], [\"F7F5FA\", \"Whisper\"], [\"F7FAF7\", \"Snow Drift\"], [\"F8B853\", \"Casablanca\"], [\"F8C3DF\", \"Chantilly\"], [\"F8D9E9\", \"Cherub\"], [\"F8DB9D\", \"Marzipan\"], [\"F8DD5C\", \"Energy Yellow\"], [\"F8E4BF\", \"Givry\"], [\"F8F0E8\", \"White Linen\"], [\"F8F4FF\", \"Magnolia\"], [\"F8F6F1\", \"Spring Wood\"], [\"F8F7DC\", \"Coconut Cream\"], [\"F8F7FC\", \"White Lilac\"], [\"F8F8F7\", \"Desert Storm\"], [\"F8F99C\", \"Texas\"], [\"F8FACD\", \"Corn Field\"], [\"F8FDD3\", \"Mimosa\"], [\"F95A61\", \"Carnation\"], [\"F9BF58\", \"Saffron Mango\"], [\"F9E0ED\", \"Carousel Pink\"], [\"F9E4BC\", \"Dairy Cream\"], [\"F9E663\", \"Portica\"], [\"F9E6F4\", \"Underage Pink\"], [\"F9EAF3\", \"Amour\"], [\"F9F8E4\", \"Rum Swizzle\"], [\"F9FF8B\", \"Dolly\"], [\"F9FFF6\", \"Sugar Cane\"], [\"FA7814\", \"Ecstasy\"], [\"FA9D5A\", \"Tan Hide\"], [\"FAD3A2\", \"Corvette\"], [\"FADFAD\", \"Peach Yellow\"], [\"FAE600\", \"Turbo\"], [\"FAEAB9\", \"Astra\"], [\"FAECCC\", \"Champagne\"], [\"FAF0E6\", \"Linen\"], [\"FAF3F0\", \"Fantasy\"], [\"FAF7D6\", \"Citrine White\"], [\"FAFAFA\", \"Alabaster\"], [\"FAFDE4\", \"Hint of Yellow\"], [\"FAFFA4\", \"Milan\"], [\"FB607F\", \"Brink Pink\"], [\"FB8989\", \"Geraldine\"], [\"FBA0E3\", \"Lavender Rose\"], [\"FBA129\", \"Sea Buckthorn\"], [\"FBAC13\", \"Sun\"], [\"FBAED2\", \"Lavender Pink\"], [\"FBB2A3\", \"Rose Bud\"], [\"FBBEDA\", \"Cupid\"], [\"FBCCE7\", \"Classic Rose\"], [\"FBCEB1\", \"Apricot Peach\"], [\"FBE7B2\", \"Banana Mania\"], [\"FBE870\", \"Marigold Yellow\"], [\"FBE96C\", \"Festival\"], [\"FBEA8C\", \"Sweet Corn\"], [\"FBEC5D\", \"Candy Corn\"], [\"FBF9F9\", \"Hint of Red\"], [\"FBFFBA\", \"Shalimar\"], [\"FC0FC0\", \"Shocking Pink\"], [\"FC80A5\", \"Tickle Me Pink\"], [\"FC9C1D\", \"Tree Poppy\"], [\"FCC01E\", \"Lightning Yellow\"], [\"FCD667\", \"Goldenrod\"], [\"FCD917\", \"Candlelight\"], [\"FCDA98\", \"Cherokee\"], [\"FCF4D0\", \"Double Pearl Lusta\"], [\"FCF4DC\", \"Pearl Lusta\"], [\"FCF8F7\", \"Vista White\"], [\"FCFBF3\", \"Bianca\"], [\"FCFEDA\", \"Moon Glow\"], [\"FCFFE7\", \"China Ivory\"], [\"FCFFF9\", \"Ceramic\"], [\"FD0E35\", \"Torch Red\"], [\"FD5B78\", \"Wild Watermelon\"], [\"FD7B33\", \"Crusta\"], [\"FD7C07\", \"Sorbus\"], [\"FD9FA2\", \"Sweet Pink\"], [\"FDD5B1\", \"Light Apricot\"], [\"FDD7E4\", \"Pig Pink\"], [\"FDE1DC\", \"Cinderella\"], [\"FDE295\", \"Golden Glow\"], [\"FDE910\", \"Lemon\"], [\"FDF5E6\", \"Old Lace\"], [\"FDF6D3\", \"Half Colonial White\"], [\"FDF7AD\", \"Drover\"], [\"FDFEB8\", \"Pale Prim\"], [\"FDFFD5\", \"Cumulus\"], [\"FE28A2\", \"Persian Rose\"], [\"FE4C40\", \"Sunset Orange\"], [\"FE6F5E\", \"Bittersweet\"], [\"FE9D04\", \"California\"], [\"FEA904\", \"Yellow Sea\"], [\"FEBAAD\", \"Melon\"], [\"FED33C\", \"Bright Sun\"], [\"FED85D\", \"Dandelion\"], [\"FEDB8D\", \"Salomie\"], [\"FEE5AC\", \"Cape Honey\"], [\"FEEBF3\", \"Remy\"], [\"FEEFCE\", \"Oasis\"], [\"FEF0EC\", \"Bridesmaid\"], [\"FEF2C7\", \"Beeswax\"], [\"FEF3D8\", \"Bleach White\"], [\"FEF4CC\", \"Pipi\"], [\"FEF4DB\", \"Half Spanish White\"], [\"FEF4F8\", \"Wisp Pink\"], [\"FEF5F1\", \"Provincial Pink\"], [\"FEF7DE\", \"Half Dutch White\"], [\"FEF8E2\", \"Solitaire\"], [\"FEF8FF\", \"White Pointer\"], [\"FEF9E3\", \"Off Yellow\"], [\"FEFCED\", \"Orange White\"], [\"FF0000\", \"Red\"], [\"FF007F\", \"Rose\"], [\"FF00CC\", \"Purple Pizzazz\"], [\"FF00FF\", \"Magenta / Fuchsia\"], [\"FF2400\", \"Scarlet\"], [\"FF3399\", \"Wild Strawberry\"], [\"FF33CC\", \"Razzle Dazzle Rose\"], [\"FF355E\", \"Radical Red\"], [\"FF3F34\", \"Red Orange\"], [\"FF4040\", \"Coral Red\"], [\"FF4D00\", \"Vermilion\"], [\"FF4F00\", \"International Orange\"], [\"FF6037\", \"Outrageous Orange\"], [\"FF6600\", \"Blaze Orange\"], [\"FF66FF\", \"Pink Flamingo\"], [\"FF681F\", \"Orange\"], [\"FF69B4\", \"Hot Pink\"], [\"FF6B53\", \"Persimmon\"], [\"FF6FFF\", \"Blush Pink\"], [\"FF7034\", \"Burning Orange\"], [\"FF7518\", \"Pumpkin\"], [\"FF7D07\", \"Flamenco\"], [\"FF7F00\", \"Flush Orange\"], [\"FF7F50\", \"Coral\"], [\"FF8C69\", \"Salmon\"], [\"FF9000\", \"Pizazz\"], [\"FF910F\", \"West Side\"], [\"FF91A4\", \"Pink Salmon\"], [\"FF9933\", \"Neon Carrot\"], [\"FF9966\", \"Atomic Tangerine\"], [\"FF9980\", \"Vivid Tangerine\"], [\"FF9E2C\", \"Sunshade\"], [\"FFA000\", \"Orange Peel\"], [\"FFA194\", \"Mona Lisa\"], [\"FFA500\", \"Web Orange\"], [\"FFA6C9\", \"Carnation Pink\"], [\"FFAB81\", \"Hit Pink\"], [\"FFAE42\", \"Yellow Orange\"], [\"FFB0AC\", \"Cornflower Lilac\"], [\"FFB1B3\", \"Sundown\"], [\"FFB31F\", \"My Sin\"], [\"FFB555\", \"Texas Rose\"], [\"FFB7D5\", \"Cotton Candy\"], [\"FFB97B\", \"Macaroni and Cheese\"], [\"FFBA00\", \"Selective Yellow\"], [\"FFBD5F\", \"Koromiko\"], [\"FFBF00\", \"Amber\"], [\"FFC0A8\", \"Wax Flower\"], [\"FFC0CB\", \"Pink\"], [\"FFC3C0\", \"Your Pink\"], [\"FFC901\", \"Supernova\"], [\"FFCBA4\", \"Flesh\"], [\"FFCC33\", \"Sunglow\"], [\"FFCC5C\", \"Golden Tainoi\"], [\"FFCC99\", \"Peach Orange\"], [\"FFCD8C\", \"Chardonnay\"], [\"FFD1DC\", \"Pastel Pink\"], [\"FFD2B7\", \"Romantic\"], [\"FFD38C\", \"Grandis\"], [\"FFD700\", \"Gold\"], [\"FFD800\", \"School bus Yellow\"], [\"FFD8D9\", \"Cosmos\"], [\"FFDB58\", \"Mustard\"], [\"FFDCD6\", \"Peach Schnapps\"], [\"FFDDAF\", \"Caramel\"], [\"FFDDCD\", \"Tuft Bush\"], [\"FFDDCF\", \"Watusi\"], [\"FFDDF4\", \"Pink Lace\"], [\"FFDEAD\", \"Navajo White\"], [\"FFDEB3\", \"Frangipani\"], [\"FFE1DF\", \"Pippin\"], [\"FFE1F2\", \"Pale Rose\"], [\"FFE2C5\", \"Negroni\"], [\"FFE5A0\", \"Cream Brulee\"], [\"FFE5B4\", \"Peach\"], [\"FFE6C7\", \"Tequila\"], [\"FFE772\", \"Kournikova\"], [\"FFEAC8\", \"Sandy Beach\"], [\"FFEAD4\", \"Karry\"], [\"FFEC13\", \"Broom\"], [\"FFEDBC\", \"Colonial White\"], [\"FFEED8\", \"Derby\"], [\"FFEFA1\", \"Vis Vis\"], [\"FFEFC1\", \"Egg White\"], [\"FFEFD5\", \"Papaya Whip\"], [\"FFEFEC\", \"Fair Pink\"], [\"FFF0DB\", \"Peach Cream\"], [\"FFF0F5\", \"Lavender blush\"], [\"FFF14F\", \"Gorse\"], [\"FFF1B5\", \"Buttermilk\"], [\"FFF1D8\", \"Pink Lady\"], [\"FFF1EE\", \"Forget Me Not\"], [\"FFF1F9\", \"Tutu\"], [\"FFF39D\", \"Picasso\"], [\"FFF3F1\", \"Chardon\"], [\"FFF46E\", \"Paris Daisy\"], [\"FFF4CE\", \"Barley White\"], [\"FFF4DD\", \"Egg Sour\"], [\"FFF4E0\", \"Sazerac\"], [\"FFF4E8\", \"Serenade\"], [\"FFF4F3\", \"Chablis\"], [\"FFF5EE\", \"Seashell Peach\"], [\"FFF5F3\", \"Sauvignon\"], [\"FFF6D4\", \"Milk Punch\"], [\"FFF6DF\", \"Varden\"], [\"FFF6F5\", \"Rose White\"], [\"FFF8D1\", \"Baja White\"], [\"FFF9E2\", \"Gin Fizz\"], [\"FFF9E6\", \"Early Dawn\"], [\"FFFACD\", \"Lemon Chiffon\"], [\"FFFAF4\", \"Bridal Heath\"], [\"FFFBDC\", \"Scotch Mist\"], [\"FFFBF9\", \"Soapstone\"], [\"FFFC99\", \"Witch Haze\"], [\"FFFCEA\", \"Buttery White\"], [\"FFFCEE\", \"Island Spice\"], [\"FFFDD0\", \"Cream\"], [\"FFFDE6\", \"Chilean Heath\"], [\"FFFDE8\", \"Travertine\"], [\"FFFDF3\", \"Orchid White\"], [\"FFFDF4\", \"Quarter Pearl Lusta\"], [\"FFFEE1\", \"Half and Half\"], [\"FFFEEC\", \"Apricot White\"], [\"FFFEF0\", \"Rice Cake\"], [\"FFFEF6\", \"Black White\"], [\"FFFEFD\", \"Romance\"], [\"FFFF00\", \"Yellow\"], [\"FFFF66\", \"Laser Lemon\"], [\"FFFF99\", \"Pale Canary\"], [\"FFFFB4\", \"Portafino\"], [\"FFFFF0\", \"Ivory\"], [\"FFFFFF\", \"White\"], [\"acc2d9\", \"cloudy blue\"], [\"56ae57\", \"dark pastel green\"], [\"b2996e\", \"dust\"], [\"a8ff04\", \"electric lime\"], [\"69d84f\", \"fresh green\"], [\"894585\", \"light eggplant\"], [\"70b23f\", \"nasty green\"], [\"d4ffff\", \"really light blue\"], [\"65ab7c\", \"tea\"], [\"952e8f\", \"warm purple\"], [\"fcfc81\", \"yellowish tan\"], [\"a5a391\", \"cement\"], [\"388004\", \"dark grass green\"], [\"4c9085\", \"dusty teal\"], [\"5e9b8a\", \"grey teal\"], [\"efb435\", \"macaroni and cheese\"], [\"d99b82\", \"pinkish tan\"], [\"0a5f38\", \"spruce\"], [\"0c06f7\", \"strong blue\"], [\"61de2a\", \"toxic green\"], [\"3778bf\", \"windows blue\"], [\"2242c7\", \"blue blue\"], [\"533cc6\", \"blue with a hint of purple\"], [\"9bb53c\", \"booger\"], [\"05ffa6\", \"bright sea green\"], [\"1f6357\", \"dark green blue\"], [\"017374\", \"deep turquoise\"], [\"0cb577\", \"green teal\"], [\"ff0789\", \"strong pink\"], [\"afa88b\", \"bland\"], [\"08787f\", \"deep aqua\"], [\"dd85d7\", \"lavender pink\"], [\"a6c875\", \"light moss green\"], [\"a7ffb5\", \"light seafoam green\"], [\"c2b709\", \"olive yellow\"], [\"e78ea5\", \"pig pink\"], [\"966ebd\", \"deep lilac\"], [\"ccad60\", \"desert\"], [\"ac86a8\", \"dusty lavender\"], [\"947e94\", \"purpley grey\"], [\"983fb2\", \"purply\"], [\"ff63e9\", \"candy pink\"], [\"b2fba5\", \"light pastel green\"], [\"63b365\", \"boring green\"], [\"8ee53f\", \"kiwi green\"], [\"b7e1a1\", \"light grey green\"], [\"ff6f52\", \"orange pink\"], [\"bdf8a3\", \"tea green\"], [\"d3b683\", \"very light brown\"], [\"fffcc4\", \"egg shell\"], [\"430541\", \"eggplant purple\"], [\"ffb2d0\", \"powder pink\"], [\"997570\", \"reddish grey\"], [\"ad900d\", \"baby shit brown\"], [\"c48efd\", \"liliac\"], [\"507b9c\", \"stormy blue\"], [\"7d7103\", \"ugly brown\"], [\"fffd78\", \"custard\"], [\"da467d\", \"darkish pink\"], [\"410200\", \"deep brown\"], [\"c9d179\", \"greenish beige\"], [\"fffa86\", \"manilla\"], [\"5684ae\", \"off blue\"], [\"6b7c85\", \"battleship grey\"], [\"6f6c0a\", \"browny green\"], [\"7e4071\", \"bruise\"], [\"009337\", \"kelley green\"], [\"d0e429\", \"sickly yellow\"], [\"fff917\", \"sunny yellow\"], [\"1d5dec\", \"azul\"], [\"054907\", \"darkgreen\"], [\"b5ce08\", \"green/yellow\"], [\"8fb67b\", \"lichen\"], [\"c8ffb0\", \"light light green\"], [\"fdde6c\", \"pale gold\"], [\"ffdf22\", \"sun yellow\"], [\"a9be70\", \"tan green\"], [\"6832e3\", \"burple\"], [\"fdb147\", \"butterscotch\"], [\"c7ac7d\", \"toupe\"], [\"fff39a\", \"dark cream\"], [\"850e04\", \"indian red\"], [\"efc0fe\", \"light lavendar\"], [\"40fd14\", \"poison green\"], [\"b6c406\", \"baby puke green\"], [\"9dff00\", \"bright yellow green\"], [\"3c4142\", \"charcoal grey\"], [\"f2ab15\", \"squash\"], [\"ac4f06\", \"cinnamon\"], [\"c4fe82\", \"light pea green\"], [\"2cfa1f\", \"radioactive green\"], [\"9a6200\", \"raw sienna\"], [\"ca9bf7\", \"baby purple\"], [\"875f42\", \"cocoa\"], [\"3a2efe\", \"light royal blue\"], [\"fd8d49\", \"orangeish\"], [\"8b3103\", \"rust brown\"], [\"cba560\", \"sand brown\"], [\"698339\", \"swamp\"], [\"0cdc73\", \"tealish green\"], [\"b75203\", \"burnt siena\"], [\"7f8f4e\", \"camo\"], [\"26538d\", \"dusk blue\"], [\"63a950\", \"fern\"], [\"c87f89\", \"old rose\"], [\"b1fc99\", \"pale light green\"], [\"ff9a8a\", \"peachy pink\"], [\"f6688e\", \"rosy pink\"], [\"76fda8\", \"light bluish green\"], [\"53fe5c\", \"light bright green\"], [\"4efd54\", \"light neon green\"], [\"a0febf\", \"light seafoam\"], [\"7bf2da\", \"tiffany blue\"], [\"bcf5a6\", \"washed out green\"], [\"ca6b02\", \"browny orange\"], [\"107ab0\", \"nice blue\"], [\"2138ab\", \"sapphire\"], [\"719f91\", \"greyish teal\"], [\"fdb915\", \"orangey yellow\"], [\"fefcaf\", \"parchment\"], [\"fcf679\", \"straw\"], [\"1d0200\", \"very dark brown\"], [\"cb6843\", \"terracota\"], [\"31668a\", \"ugly blue\"], [\"247afd\", \"clear blue\"], [\"ffffb6\", \"creme\"], [\"90fda9\", \"foam green\"], [\"86a17d\", \"grey/green\"], [\"fddc5c\", \"light gold\"], [\"78d1b6\", \"seafoam blue\"], [\"13bbaf\", \"topaz\"], [\"fb5ffc\", \"violet pink\"], [\"20f986\", \"wintergreen\"], [\"ffe36e\", \"yellow tan\"], [\"9d0759\", \"dark fuchsia\"], [\"3a18b1\", \"indigo blue\"], [\"c2ff89\", \"light yellowish green\"], [\"d767ad\", \"pale magenta\"], [\"720058\", \"rich purple\"], [\"ffda03\", \"sunflower yellow\"], [\"01c08d\", \"green/blue\"], [\"ac7434\", \"leather\"], [\"014600\", \"racing green\"], [\"9900fa\", \"vivid purple\"], [\"02066f\", \"dark royal blue\"], [\"8e7618\", \"hazel\"], [\"d1768f\", \"muted pink\"], [\"96b403\", \"booger green\"], [\"fdff63\", \"canary\"], [\"95a3a6\", \"cool grey\"], [\"7f684e\", \"dark taupe\"], [\"751973\", \"darkish purple\"], [\"089404\", \"true green\"], [\"ff6163\", \"coral pink\"], [\"598556\", \"dark sage\"], [\"214761\", \"dark slate blue\"], [\"3c73a8\", \"flat blue\"], [\"ba9e88\", \"mushroom\"], [\"021bf9\", \"rich blue\"], [\"734a65\", \"dirty purple\"], [\"23c48b\", \"greenblue\"], [\"8fae22\", \"icky green\"], [\"e6f2a2\", \"light khaki\"], [\"4b57db\", \"warm blue\"], [\"d90166\", \"dark hot pink\"], [\"015482\", \"deep sea blue\"], [\"9d0216\", \"carmine\"], [\"728f02\", \"dark yellow green\"], [\"ffe5ad\", \"pale peach\"], [\"4e0550\", \"plum purple\"], [\"f9bc08\", \"golden rod\"], [\"ff073a\", \"neon red\"], [\"c77986\", \"old pink\"], [\"d6fffe\", \"very pale blue\"], [\"fe4b03\", \"blood orange\"], [\"fd5956\", \"grapefruit\"], [\"fce166\", \"sand yellow\"], [\"b2713d\", \"clay brown\"], [\"1f3b4d\", \"dark blue grey\"], [\"699d4c\", \"flat green\"], [\"56fca2\", \"light green blue\"], [\"fb5581\", \"warm pink\"], [\"3e82fc\", \"dodger blue\"], [\"a0bf16\", \"gross green\"], [\"d6fffa\", \"ice\"], [\"4f738e\", \"metallic blue\"], [\"ffb19a\", \"pale salmon\"], [\"5c8b15\", \"sap green\"], [\"54ac68\", \"algae\"], [\"89a0b0\", \"bluey grey\"], [\"7ea07a\", \"greeny grey\"], [\"1bfc06\", \"highlighter green\"], [\"cafffb\", \"light light blue\"], [\"b6ffbb\", \"light mint\"], [\"a75e09\", \"raw umber\"], [\"152eff\", \"vivid blue\"], [\"8d5eb7\", \"deep lavender\"], [\"5f9e8f\", \"dull teal\"], [\"63f7b4\", \"light greenish blue\"], [\"606602\", \"mud green\"], [\"fc86aa\", \"pinky\"], [\"8c0034\", \"red wine\"], [\"758000\", \"shit green\"], [\"ab7e4c\", \"tan brown\"], [\"030764\", \"darkblue\"], [\"fe86a4\", \"rosa\"], [\"d5174e\", \"lipstick\"], [\"fed0fc\", \"pale mauve\"], [\"680018\", \"claret\"], [\"fedf08\", \"dandelion\"], [\"fe420f\", \"orangered\"], [\"6f7c00\", \"poop green\"], [\"ca0147\", \"ruby\"], [\"1b2431\", \"dark\"], [\"00fbb0\", \"greenish turquoise\"], [\"db5856\", \"pastel red\"], [\"ddd618\", \"piss yellow\"], [\"41fdfe\", \"bright cyan\"], [\"cf524e\", \"dark coral\"], [\"21c36f\", \"algae green\"], [\"a90308\", \"darkish red\"], [\"6e1005\", \"reddy brown\"], [\"fe828c\", \"blush pink\"], [\"4b6113\", \"camouflage green\"], [\"4da409\", \"lawn green\"], [\"beae8a\", \"putty\"], [\"0339f8\", \"vibrant blue\"], [\"a88f59\", \"dark sand\"], [\"5d21d0\", \"purple/blue\"], [\"feb209\", \"saffron\"], [\"4e518b\", \"twilight\"], [\"964e02\", \"warm brown\"], [\"85a3b2\", \"bluegrey\"], [\"ff69af\", \"bubble gum pink\"], [\"c3fbf4\", \"duck egg blue\"], [\"2afeb7\", \"greenish cyan\"], [\"005f6a\", \"petrol\"], [\"0c1793\", \"royal\"], [\"ffff81\", \"butter\"], [\"f0833a\", \"dusty orange\"], [\"f1f33f\", \"off yellow\"], [\"b1d27b\", \"pale olive green\"], [\"fc824a\", \"orangish\"], [\"71aa34\", \"leaf\"], [\"b7c9e2\", \"light blue grey\"], [\"4b0101\", \"dried blood\"], [\"a552e6\", \"lightish purple\"], [\"af2f0d\", \"rusty red\"], [\"8b88f8\", \"lavender blue\"], [\"9af764\", \"light grass green\"], [\"a6fbb2\", \"light mint green\"], [\"ffc512\", \"sunflower\"], [\"750851\", \"velvet\"], [\"c14a09\", \"brick orange\"], [\"fe2f4a\", \"lightish red\"], [\"0203e2\", \"pure blue\"], [\"0a437a\", \"twilight blue\"], [\"a50055\", \"violet red\"], [\"ae8b0c\", \"yellowy brown\"], [\"fd798f\", \"carnation\"], [\"bfac05\", \"muddy yellow\"], [\"3eaf76\", \"dark seafoam green\"], [\"c74767\", \"deep rose\"], [\"b9484e\", \"dusty red\"], [\"647d8e\", \"grey/blue\"], [\"bffe28\", \"lemon lime\"], [\"d725de\", \"purple/pink\"], [\"b29705\", \"brown yellow\"], [\"673a3f\", \"purple brown\"], [\"a87dc2\", \"wisteria\"], [\"fafe4b\", \"banana yellow\"], [\"c0022f\", \"lipstick red\"], [\"0e87cc\", \"water blue\"], [\"8d8468\", \"brown grey\"], [\"ad03de\", \"vibrant purple\"], [\"8cff9e\", \"baby green\"], [\"94ac02\", \"barf green\"], [\"c4fff7\", \"eggshell blue\"], [\"fdee73\", \"sandy yellow\"], [\"33b864\", \"cool green\"], [\"fff9d0\", \"pale\"], [\"758da3\", \"blue/grey\"], [\"f504c9\", \"hot magenta\"], [\"77a1b5\", \"greyblue\"], [\"8756e4\", \"purpley\"], [\"889717\", \"baby shit green\"], [\"c27e79\", \"brownish pink\"], [\"017371\", \"dark aquamarine\"], [\"9f8303\", \"diarrhea\"], [\"f7d560\", \"light mustard\"], [\"bdf6fe\", \"pale sky blue\"], [\"75b84f\", \"turtle green\"], [\"9cbb04\", \"bright olive\"], [\"29465b\", \"dark grey blue\"], [\"696006\", \"greeny brown\"], [\"adf802\", \"lemon green\"], [\"c1c6fc\", \"light periwinkle\"], [\"35ad6b\", \"seaweed green\"], [\"fffd37\", \"sunshine yellow\"], [\"a442a0\", \"ugly purple\"], [\"f36196\", \"medium pink\"], [\"947706\", \"puke brown\"], [\"fff4f2\", \"very light pink\"], [\"1e9167\", \"viridian\"], [\"b5c306\", \"bile\"], [\"feff7f\", \"faded yellow\"], [\"cffdbc\", \"very pale green\"], [\"0add08\", \"vibrant green\"], [\"87fd05\", \"bright lime\"], [\"1ef876\", \"spearmint\"], [\"7bfdc7\", \"light aquamarine\"], [\"bcecac\", \"light sage\"], [\"bbf90f\", \"yellowgreen\"], [\"ab9004\", \"baby poo\"], [\"1fb57a\", \"dark seafoam\"], [\"00555a\", \"deep teal\"], [\"a484ac\", \"heather\"], [\"c45508\", \"rust orange\"], [\"3f829d\", \"dirty blue\"], [\"548d44\", \"fern green\"], [\"c95efb\", \"bright lilac\"], [\"3ae57f\", \"weird green\"], [\"016795\", \"peacock blue\"], [\"87a922\", \"avocado green\"], [\"f0944d\", \"faded orange\"], [\"5d1451\", \"grape purple\"], [\"25ff29\", \"hot green\"], [\"d0fe1d\", \"lime yellow\"], [\"ffa62b\", \"mango\"], [\"01b44c\", \"shamrock\"], [\"ff6cb5\", \"bubblegum\"], [\"6b4247\", \"purplish brown\"], [\"c7c10c\", \"vomit yellow\"], [\"b7fffa\", \"pale cyan\"], [\"aeff6e\", \"key lime\"], [\"ec2d01\", \"tomato red\"], [\"76ff7b\", \"lightgreen\"], [\"730039\", \"merlot\"], [\"040348\", \"night blue\"], [\"df4ec8\", \"purpleish pink\"], [\"6ecb3c\", \"apple\"], [\"8f9805\", \"baby poop green\"], [\"5edc1f\", \"green apple\"], [\"d94ff5\", \"heliotrope\"], [\"c8fd3d\", \"yellow/green\"], [\"070d0d\", \"almost black\"], [\"4984b8\", \"cool blue\"], [\"51b73b\", \"leafy green\"], [\"ac7e04\", \"mustard brown\"], [\"4e5481\", \"dusk\"], [\"876e4b\", \"dull brown\"], [\"58bc08\", \"frog green\"], [\"2fef10\", \"vivid green\"], [\"2dfe54\", \"bright light green\"], [\"0aff02\", \"fluro green\"], [\"9cef43\", \"kiwi\"], [\"18d17b\", \"seaweed\"], [\"35530a\", \"navy green\"], [\"1805db\", \"ultramarine blue\"], [\"6258c4\", \"iris\"], [\"ff964f\", \"pastel orange\"], [\"ffab0f\", \"yellowish orange\"], [\"8f8ce7\", \"perrywinkle\"], [\"24bca8\", \"tealish\"], [\"3f012c\", \"dark plum\"], [\"cbf85f\", \"pear\"], [\"ff724c\", \"pinkish orange\"], [\"280137\", \"midnight purple\"], [\"b36ff6\", \"light urple\"], [\"48c072\", \"dark mint\"], [\"bccb7a\", \"greenish tan\"], [\"a8415b\", \"light burgundy\"], [\"06b1c4\", \"turquoise blue\"], [\"cd7584\", \"ugly pink\"], [\"f1da7a\", \"sandy\"], [\"ff0490\", \"electric pink\"], [\"805b87\", \"muted purple\"], [\"50a747\", \"mid green\"], [\"a8a495\", \"greyish\"], [\"cfff04\", \"neon yellow\"], [\"ffff7e\", \"banana\"], [\"ff7fa7\", \"carnation pink\"], [\"ef4026\", \"tomato\"], [\"3c9992\", \"sea\"], [\"886806\", \"muddy brown\"], [\"04f489\", \"turquoise green\"], [\"fef69e\", \"buff\"], [\"cfaf7b\", \"fawn\"], [\"3b719f\", \"muted blue\"], [\"fdc1c5\", \"pale rose\"], [\"20c073\", \"dark mint green\"], [\"9b5fc0\", \"amethyst\"], [\"0f9b8e\", \"blue/green\"], [\"742802\", \"chestnut\"], [\"9db92c\", \"sick green\"], [\"a4bf20\", \"pea\"], [\"cd5909\", \"rusty orange\"], [\"ada587\", \"stone\"], [\"be013c\", \"rose red\"], [\"b8ffeb\", \"pale aqua\"], [\"dc4d01\", \"deep orange\"], [\"a2653e\", \"earth\"], [\"638b27\", \"mossy green\"], [\"419c03\", \"grassy green\"], [\"b1ff65\", \"pale lime green\"], [\"9dbcd4\", \"light grey blue\"], [\"fdfdfe\", \"pale grey\"], [\"77ab56\", \"asparagus\"], [\"464196\", \"blueberry\"], [\"990147\", \"purple red\"], [\"befd73\", \"pale lime\"], [\"32bf84\", \"greenish teal\"], [\"af6f09\", \"caramel\"], [\"a0025c\", \"deep magenta\"], [\"ffd8b1\", \"light peach\"], [\"7f4e1e\", \"milk chocolate\"], [\"bf9b0c\", \"ocher\"], [\"6ba353\", \"off green\"], [\"f075e6\", \"purply pink\"], [\"7bc8f6\", \"lightblue\"], [\"475f94\", \"dusky blue\"], [\"f5bf03\", \"golden\"], [\"fffeb6\", \"light beige\"], [\"fffd74\", \"butter yellow\"], [\"895b7b\", \"dusky purple\"], [\"436bad\", \"french blue\"], [\"d0c101\", \"ugly yellow\"], [\"c6f808\", \"greeny yellow\"], [\"f43605\", \"orangish red\"], [\"02c14d\", \"shamrock green\"], [\"b25f03\", \"orangish brown\"], [\"2a7e19\", \"tree green\"], [\"490648\", \"deep violet\"], [\"536267\", \"gunmetal\"], [\"5a06ef\", \"blue/purple\"], [\"cf0234\", \"cherry\"], [\"c4a661\", \"sandy brown\"], [\"978a84\", \"warm grey\"], [\"1f0954\", \"dark indigo\"], [\"03012d\", \"midnight\"], [\"2bb179\", \"bluey green\"], [\"c3909b\", \"grey pink\"], [\"a66fb5\", \"soft purple\"], [\"770001\", \"blood\"], [\"922b05\", \"brown red\"], [\"7d7f7c\", \"medium grey\"], [\"990f4b\", \"berry\"], [\"8f7303\", \"poo\"], [\"c83cb9\", \"purpley pink\"], [\"fea993\", \"light salmon\"], [\"acbb0d\", \"snot\"], [\"c071fe\", \"easter purple\"], [\"ccfd7f\", \"light yellow green\"], [\"00022e\", \"dark navy blue\"], [\"828344\", \"drab\"], [\"ffc5cb\", \"light rose\"], [\"ab1239\", \"rouge\"], [\"b0054b\", \"purplish red\"], [\"99cc04\", \"slime green\"], [\"937c00\", \"baby poop\"], [\"019529\", \"irish green\"], [\"ef1de7\", \"pink/purple\"], [\"000435\", \"dark navy\"], [\"42b395\", \"greeny blue\"], [\"9d5783\", \"light plum\"], [\"c8aca9\", \"pinkish grey\"], [\"c87606\", \"dirty orange\"], [\"aa2704\", \"rust red\"], [\"e4cbff\", \"pale lilac\"], [\"fa4224\", \"orangey red\"], [\"0804f9\", \"primary blue\"], [\"5cb200\", \"kermit green\"], [\"76424e\", \"brownish purple\"], [\"6c7a0e\", \"murky green\"], [\"fbdd7e\", \"wheat\"], [\"2a0134\", \"very dark purple\"], [\"044a05\", \"bottle green\"], [\"fd4659\", \"watermelon\"], [\"0d75f8\", \"deep sky blue\"], [\"fe0002\", \"fire engine red\"], [\"cb9d06\", \"yellow ochre\"], [\"fb7d07\", \"pumpkin orange\"], [\"b9cc81\", \"pale olive\"], [\"edc8ff\", \"light lilac\"], [\"61e160\", \"lightish green\"], [\"8ab8fe\", \"carolina blue\"], [\"920a4e\", \"mulberry\"], [\"fe02a2\", \"shocking pink\"], [\"9a3001\", \"auburn\"], [\"65fe08\", \"bright lime green\"], [\"befdb7\", \"celadon\"], [\"b17261\", \"pinkish brown\"], [\"885f01\", \"poo brown\"], [\"02ccfe\", \"bright sky blue\"], [\"c1fd95\", \"celery\"], [\"836539\", \"dirt brown\"], [\"fb2943\", \"strawberry\"], [\"84b701\", \"dark lime\"], [\"b66325\", \"copper\"], [\"7f5112\", \"medium brown\"], [\"5fa052\", \"muted green\"], [\"6dedfd\", \"robin's egg\"], [\"0bf9ea\", \"bright aqua\"], [\"c760ff\", \"bright lavender\"], [\"ffffcb\", \"ivory\"], [\"f6cefc\", \"very light purple\"], [\"155084\", \"light navy\"], [\"f5054f\", \"pink red\"], [\"645403\", \"olive brown\"], [\"7a5901\", \"poop brown\"], [\"a8b504\", \"mustard green\"], [\"3d9973\", \"ocean green\"], [\"000133\", \"very dark blue\"], [\"76a973\", \"dusty green\"], [\"2e5a88\", \"light navy blue\"], [\"0bf77d\", \"minty green\"], [\"bd6c48\", \"adobe\"], [\"ac1db8\", \"barney\"], [\"2baf6a\", \"jade green\"], [\"26f7fd\", \"bright light blue\"], [\"aefd6c\", \"light lime\"], [\"9b8f55\", \"dark khaki\"], [\"ffad01\", \"orange yellow\"], [\"c69c04\", \"ocre\"], [\"f4d054\", \"maize\"], [\"de9dac\", \"faded pink\"], [\"05480d\", \"british racing green\"], [\"c9ae74\", \"sandstone\"], [\"60460f\", \"mud brown\"], [\"98f6b0\", \"light sea green\"], [\"8af1fe\", \"robin egg blue\"], [\"2ee8bb\", \"aqua marine\"], [\"11875d\", \"dark sea green\"], [\"fdb0c0\", \"soft pink\"], [\"b16002\", \"orangey brown\"], [\"f7022a\", \"cherry red\"], [\"d5ab09\", \"burnt yellow\"], [\"86775f\", \"brownish grey\"], [\"c69f59\", \"camel\"], [\"7a687f\", \"purplish grey\"], [\"042e60\", \"marine\"], [\"c88d94\", \"greyish pink\"], [\"a5fbd5\", \"pale turquoise\"], [\"fffe71\", \"pastel yellow\"], [\"6241c7\", \"bluey purple\"], [\"fffe40\", \"canary yellow\"], [\"d3494e\", \"faded red\"], [\"985e2b\", \"sepia\"], [\"a6814c\", \"coffee\"], [\"ff08e8\", \"bright magenta\"], [\"9d7651\", \"mocha\"], [\"feffca\", \"ecru\"], [\"98568d\", \"purpleish\"], [\"9e003a\", \"cranberry\"], [\"287c37\", \"darkish green\"], [\"b96902\", \"brown orange\"], [\"ba6873\", \"dusky rose\"], [\"ff7855\", \"melon\"], [\"94b21c\", \"sickly green\"], [\"c5c9c7\", \"silver\"], [\"661aee\", \"purply blue\"], [\"6140ef\", \"purpleish blue\"], [\"9be5aa\", \"hospital green\"], [\"7b5804\", \"shit brown\"], [\"276ab3\", \"mid blue\"], [\"feb308\", \"amber\"], [\"8cfd7e\", \"easter green\"], [\"6488ea\", \"soft blue\"], [\"056eee\", \"cerulean blue\"], [\"b27a01\", \"golden brown\"], [\"0ffef9\", \"bright turquoise\"], [\"fa2a55\", \"red pink\"], [\"820747\", \"red purple\"], [\"7a6a4f\", \"greyish brown\"], [\"f4320c\", \"vermillion\"], [\"a13905\", \"russet\"], [\"6f828a\", \"steel grey\"], [\"a55af4\", \"lighter purple\"], [\"ad0afd\", \"bright violet\"], [\"004577\", \"prussian blue\"], [\"658d6d\", \"slate green\"], [\"ca7b80\", \"dirty pink\"], [\"005249\", \"dark blue green\"], [\"2b5d34\", \"pine\"], [\"bff128\", \"yellowy green\"], [\"b59410\", \"dark gold\"], [\"2976bb\", \"bluish\"], [\"014182\", \"darkish blue\"], [\"bb3f3f\", \"dull red\"], [\"fc2647\", \"pinky red\"], [\"a87900\", \"bronze\"], [\"82cbb2\", \"pale teal\"], [\"667c3e\", \"military green\"], [\"fe46a5\", \"barbie pink\"], [\"fe83cc\", \"bubblegum pink\"], [\"94a617\", \"pea soup green\"], [\"a88905\", \"dark mustard\"], [\"7f5f00\", \"shit\"], [\"9e43a2\", \"medium purple\"], [\"062e03\", \"very dark green\"], [\"8a6e45\", \"dirt\"], [\"cc7a8b\", \"dusky pink\"], [\"9e0168\", \"red violet\"], [\"fdff38\", \"lemon yellow\"], [\"c0fa8b\", \"pistachio\"], [\"eedc5b\", \"dull yellow\"], [\"7ebd01\", \"dark lime green\"], [\"3b5b92\", \"denim blue\"], [\"01889f\", \"teal blue\"], [\"3d7afd\", \"lightish blue\"], [\"5f34e7\", \"purpley blue\"], [\"6d5acf\", \"light indigo\"], [\"748500\", \"swamp green\"], [\"706c11\", \"brown green\"], [\"3c0008\", \"dark maroon\"], [\"cb00f5\", \"hot purple\"], [\"002d04\", \"dark forest green\"], [\"658cbb\", \"faded blue\"], [\"749551\", \"drab green\"], [\"b9ff66\", \"light lime green\"], [\"9dc100\", \"snot green\"], [\"faee66\", \"yellowish\"], [\"7efbb3\", \"light blue green\"], [\"7b002c\", \"bordeaux\"], [\"c292a1\", \"light mauve\"], [\"017b92\", \"ocean\"], [\"fcc006\", \"marigold\"], [\"657432\", \"muddy green\"], [\"d8863b\", \"dull orange\"], [\"738595\", \"steel\"], [\"aa23ff\", \"electric purple\"], [\"08ff08\", \"fluorescent green\"], [\"9b7a01\", \"yellowish brown\"], [\"f29e8e\", \"blush\"], [\"6fc276\", \"soft green\"], [\"ff5b00\", \"bright orange\"], [\"fdff52\", \"lemon\"], [\"866f85\", \"purple grey\"], [\"8ffe09\", \"acid green\"], [\"eecffe\", \"pale lavender\"], [\"510ac9\", \"violet blue\"], [\"4f9153\", \"light forest green\"], [\"9f2305\", \"burnt red\"], [\"728639\", \"khaki green\"], [\"de0c62\", \"cerise\"], [\"916e99\", \"faded purple\"], [\"ffb16d\", \"apricot\"], [\"3c4d03\", \"dark olive green\"], [\"7f7053\", \"grey brown\"], [\"77926f\", \"green grey\"], [\"010fcc\", \"true blue\"], [\"ceaefa\", \"pale violet\"], [\"8f99fb\", \"periwinkle blue\"], [\"c6fcff\", \"light sky blue\"], [\"5539cc\", \"blurple\"], [\"544e03\", \"green brown\"], [\"017a79\", \"bluegreen\"], [\"01f9c6\", \"bright teal\"], [\"c9b003\", \"brownish yellow\"], [\"929901\", \"pea soup\"], [\"0b5509\", \"forest\"], [\"a00498\", \"barney purple\"], [\"2000b1\", \"ultramarine\"], [\"94568c\", \"purplish\"], [\"c2be0e\", \"puke yellow\"], [\"748b97\", \"bluish grey\"], [\"665fd1\", \"dark periwinkle\"], [\"9c6da5\", \"dark lilac\"], [\"c44240\", \"reddish\"], [\"a24857\", \"light maroon\"], [\"825f87\", \"dusty purple\"], [\"c9643b\", \"terra cotta\"], [\"90b134\", \"avocado\"], [\"01386a\", \"marine blue\"], [\"25a36f\", \"teal green\"], [\"59656d\", \"slate grey\"], [\"75fd63\", \"lighter green\"], [\"21fc0d\", \"electric green\"], [\"5a86ad\", \"dusty blue\"], [\"fec615\", \"golden yellow\"], [\"fffd01\", \"bright yellow\"], [\"dfc5fe\", \"light lavender\"], [\"b26400\", \"umber\"], [\"7f5e00\", \"poop\"], [\"de7e5d\", \"dark peach\"], [\"048243\", \"jungle green\"], [\"ffffd4\", \"eggshell\"], [\"3b638c\", \"denim\"], [\"b79400\", \"yellow brown\"], [\"84597e\", \"dull purple\"], [\"411900\", \"chocolate brown\"], [\"7b0323\", \"wine red\"], [\"04d9ff\", \"neon blue\"], [\"667e2c\", \"dirty green\"], [\"fbeeac\", \"light tan\"], [\"d7fffe\", \"ice blue\"], [\"4e7496\", \"cadet blue\"], [\"874c62\", \"dark mauve\"], [\"d5ffff\", \"very light blue\"], [\"826d8c\", \"grey purple\"], [\"ffbacd\", \"pastel pink\"], [\"d1ffbd\", \"very light green\"], [\"448ee4\", \"dark sky blue\"], [\"05472a\", \"evergreen\"], [\"d5869d\", \"dull pink\"], [\"3d0734\", \"aubergine\"], [\"4a0100\", \"mahogany\"], [\"f8481c\", \"reddish orange\"], [\"02590f\", \"deep green\"], [\"89a203\", \"vomit green\"], [\"e03fd8\", \"purple pink\"], [\"d58a94\", \"dusty pink\"], [\"7bb274\", \"faded green\"], [\"526525\", \"camo green\"], [\"c94cbe\", \"pinky purple\"], [\"db4bda\", \"pink purple\"], [\"9e3623\", \"brownish red\"], [\"b5485d\", \"dark rose\"], [\"735c12\", \"mud\"], [\"9c6d57\", \"brownish\"], [\"028f1e\", \"emerald green\"], [\"b1916e\", \"pale brown\"], [\"49759c\", \"dull blue\"], [\"a0450e\", \"burnt umber\"], [\"39ad48\", \"medium green\"], [\"b66a50\", \"clay\"], [\"8cffdb\", \"light aqua\"], [\"a4be5c\", \"light olive green\"], [\"cb7723\", \"brownish orange\"], [\"05696b\", \"dark aqua\"], [\"ce5dae\", \"purplish pink\"], [\"c85a53\", \"dark salmon\"], [\"96ae8d\", \"greenish grey\"], [\"1fa774\", \"jade\"], [\"7a9703\", \"ugly green\"], [\"ac9362\", \"dark beige\"], [\"01a049\", \"emerald\"], [\"d9544d\", \"pale red\"], [\"fa5ff7\", \"light magenta\"], [\"82cafc\", \"sky\"], [\"acfffc\", \"light cyan\"], [\"fcb001\", \"yellow orange\"], [\"910951\", \"reddish purple\"], [\"fe2c54\", \"reddish pink\"], [\"c875c4\", \"orchid\"], [\"cdc50a\", \"dirty yellow\"], [\"fd411e\", \"orange red\"], [\"9a0200\", \"deep red\"], [\"be6400\", \"orange brown\"], [\"030aa7\", \"cobalt blue\"], [\"fe019a\", \"neon pink\"], [\"f7879a\", \"rose pink\"], [\"887191\", \"greyish purple\"], [\"b00149\", \"raspberry\"], [\"12e193\", \"aqua green\"], [\"fe7b7c\", \"salmon pink\"], [\"ff9408\", \"tangerine\"], [\"6a6e09\", \"brownish green\"], [\"8b2e16\", \"red brown\"], [\"696112\", \"greenish brown\"], [\"e17701\", \"pumpkin\"], [\"0a481e\", \"pine green\"], [\"343837\", \"charcoal\"], [\"ffb7ce\", \"baby pink\"], [\"6a79f7\", \"cornflower\"], [\"5d06e9\", \"blue violet\"], [\"3d1c02\", \"chocolate\"], [\"82a67d\", \"greyish green\"], [\"be0119\", \"scarlet\"], [\"c9ff27\", \"green yellow\"], [\"373e02\", \"dark olive\"], [\"a9561e\", \"sienna\"], [\"caa0ff\", \"pastel purple\"], [\"ca6641\", \"terracotta\"], [\"02d8e9\", \"aqua blue\"], [\"88b378\", \"sage green\"], [\"980002\", \"blood red\"], [\"cb0162\", \"deep pink\"], [\"5cac2d\", \"grass\"], [\"769958\", \"moss\"], [\"a2bffe\", \"pastel blue\"], [\"10a674\", \"bluish green\"], [\"06b48b\", \"green blue\"], [\"af884a\", \"dark tan\"], [\"0b8b87\", \"greenish blue\"], [\"ffa756\", \"pale orange\"], [\"a2a415\", \"vomit\"], [\"154406\", \"forrest green\"], [\"856798\", \"dark lavender\"], [\"34013f\", \"dark violet\"], [\"632de9\", \"purple blue\"], [\"0a888a\", \"dark cyan\"], [\"6f7632\", \"olive drab\"], [\"d46a7e\", \"pinkish\"], [\"1e488f\", \"cobalt\"], [\"bc13fe\", \"neon purple\"], [\"7ef4cc\", \"light turquoise\"], [\"76cd26\", \"apple green\"], [\"74a662\", \"dull green\"], [\"80013f\", \"wine\"], [\"b1d1fc\", \"powder blue\"], [\"ffffe4\", \"off white\"], [\"0652ff\", \"electric blue\"], [\"045c5a\", \"dark turquoise\"], [\"5729ce\", \"blue purple\"], [\"069af3\", \"azure\"], [\"ff000d\", \"bright red\"], [\"f10c45\", \"pinkish red\"], [\"5170d7\", \"cornflower blue\"], [\"acbf69\", \"light olive\"], [\"6c3461\", \"grape\"], [\"5e819d\", \"greyish blue\"], [\"601ef9\", \"purplish blue\"], [\"b0dd16\", \"yellowish green\"], [\"cdfd02\", \"greenish yellow\"], [\"2c6fbb\", \"medium blue\"], [\"c0737a\", \"dusty rose\"], [\"d6b4fc\", \"light violet\"], [\"020035\", \"midnight blue\"], [\"703be7\", \"bluish purple\"], [\"fd3c06\", \"red orange\"], [\"960056\", \"dark magenta\"], [\"40a368\", \"greenish\"], [\"03719c\", \"ocean blue\"], [\"fc5a50\", \"coral\"], [\"ffffc2\", \"cream\"], [\"7f2b0a\", \"reddish brown\"], [\"b04e0f\", \"burnt sienna\"], [\"a03623\", \"brick\"], [\"87ae73\", \"sage\"], [\"789b73\", \"grey green\"], [\"ffffff\", \"white\"], [\"98eff9\", \"robin's egg blue\"], [\"658b38\", \"moss green\"], [\"5a7d9a\", \"steel blue\"], [\"380835\", \"eggplant\"], [\"fffe7a\", \"light yellow\"], [\"5ca904\", \"leaf green\"], [\"d8dcd6\", \"light grey\"], [\"a5a502\", \"puke\"], [\"d648d7\", \"pinkish purple\"], [\"047495\", \"sea blue\"], [\"b790d4\", \"pale purple\"], [\"5b7c99\", \"slate blue\"], [\"607c8e\", \"blue grey\"], [\"0b4008\", \"hunter green\"], [\"ed0dd9\", \"fuchsia\"], [\"8c000f\", \"crimson\"], [\"ffff84\", \"pale yellow\"], [\"bf9005\", \"ochre\"], [\"d2bd0a\", \"mustard yellow\"], [\"ff474c\", \"light red\"], [\"0485d1\", \"cerulean\"], [\"ffcfdc\", \"pale pink\"], [\"040273\", \"deep blue\"], [\"a83c09\", \"rust\"], [\"90e4c1\", \"light teal\"], [\"516572\", \"slate\"], [\"fac205\", \"goldenrod\"], [\"d5b60a\", \"dark yellow\"], [\"363737\", \"dark grey\"], [\"4b5d16\", \"army green\"], [\"6b8ba4\", \"grey blue\"], [\"80f9ad\", \"seafoam\"], [\"a57e52\", \"puce\"], [\"a9f971\", \"spring green\"], [\"c65102\", \"dark orange\"], [\"e2ca76\", \"sand\"], [\"b0ff9d\", \"pastel green\"], [\"9ffeb0\", \"mint\"], [\"fdaa48\", \"light orange\"], [\"fe01b1\", \"bright pink\"], [\"c1f80a\", \"chartreuse\"], [\"36013f\", \"deep purple\"], [\"341c02\", \"dark brown\"], [\"b9a281\", \"taupe\"], [\"8eab12\", \"pea green\"], [\"9aae07\", \"puke green\"], [\"02ab2e\", \"kelly green\"], [\"7af9ab\", \"seafoam green\"], [\"137e6d\", \"blue green\"], [\"aaa662\", \"khaki\"], [\"610023\", \"burgundy\"], [\"014d4e\", \"dark teal\"], [\"8f1402\", \"brick red\"], [\"4b006e\", \"royal purple\"], [\"580f41\", \"plum\"], [\"8fff9f\", \"mint green\"], [\"dbb40c\", \"gold\"], [\"a2cffe\", \"baby blue\"], [\"c0fb2d\", \"yellow green\"], [\"be03fd\", \"bright purple\"], [\"840000\", \"dark red\"], [\"d0fefe\", \"pale blue\"], [\"3f9b0b\", \"grass green\"], [\"01153e\", \"navy\"], [\"04d8b2\", \"aquamarine\"], [\"c04e01\", \"burnt orange\"], [\"0cff0c\", \"neon green\"], [\"0165fc\", \"bright blue\"], [\"cf6275\", \"rose\"], [\"ffd1df\", \"light pink\"], [\"ceb301\", \"mustard\"], [\"380282\", \"indigo\"], [\"aaff32\", \"lime\"], [\"53fca1\", \"sea green\"], [\"8e82fe\", \"periwinkle\"], [\"cb416b\", \"dark pink\"], [\"677a04\", \"olive green\"], [\"ffb07c\", \"peach\"], [\"c7fdb5\", \"pale green\"], [\"ad8150\", \"light brown\"], [\"ff028d\", \"hot pink\"], [\"000000\", \"black\"], [\"cea2fd\", \"lilac\"], [\"001146\", \"navy blue\"], [\"0504aa\", \"royal blue\"], [\"e6daa6\", \"beige\"], [\"ff796c\", \"salmon\"], [\"6e750e\", \"olive\"], [\"650021\", \"maroon\"], [\"01ff07\", \"bright green\"], [\"35063e\", \"dark purple\"], [\"ae7181\", \"mauve\"], [\"06470c\", \"forest green\"], [\"13eac9\", \"aqua\"], [\"00ffff\", \"cyan\"], [\"d1b26f\", \"tan\"], [\"00035b\", \"dark blue\"], [\"c79fef\", \"lavender\"], [\"06c2ac\", \"turquoise\"], [\"033500\", \"dark green\"], [\"9a0eea\", \"violet\"], [\"bf77f6\", \"light purple\"], [\"89fe05\", \"lime green\"], [\"929591\", \"grey\"], [\"75bbfd\", \"sky blue\"], [\"ffff14\", \"yellow\"], [\"c20078\", \"magenta\"], [\"96f97b\", \"light green\"], [\"f97306\", \"orange\"], [\"029386\", \"teal\"], [\"95d0fc\", \"light blue\"], [\"e50000\", \"red\"], [\"653700\", \"brown\"], [\"ff81c0\", \"pink\"], [\"0343df\", \"blue\"], [\"15b01a\", \"green\"], [\"7e1e9c\", \"purple\"], [\"00000000\", \"transparent\"]];\n names.each(function(element) {\n return (lookup[normalizeKey(element[1])] = parseHex(element[0]));\n });\n window.Color.random = function() {\n return Color(rand(256), rand(256), rand(256), 1);\n };\n return (window.Color.mix = function(color1, color2, amount) {\n var new_colors;\n amount || (amount = 0.5);\n new_colors = color1.channels().zip(color2.channels()).map(function(array) {\n return (array[0] * amount) + (array[1] * (1 - amount));\n });\n return Color(new_colors);\n });\n})();;\nvar Core;\nvar __slice = Array.prototype.slice;\n/***\nThe Core class is used to add extended functionality to objects without\nextending the object class directly. Inherit from Core to gain its utility\nmethods.\n\n@name Core\n@constructor\n\n@param {Object} I Instance variables\n*/\n/***\n@name I\n@memberOf Core#\n*/\nCore = function(I) {\n var self;\n I || (I = {});\n return (self = {\n I: I,\n /***\n Generates a public jQuery style getter / setter method for each\n String argument.\n\n @name attrAccessor\n @methodOf Core#\n */\n attrAccessor: function() {\n var attrNames;\n attrNames = __slice.call(arguments, 0);\n return attrNames.each(function(attrName) {\n return (self[attrName] = function(newValue) {\n if (typeof newValue !== \"undefined\" && newValue !== null) {\n I[attrName] = newValue;\n return self;\n } else {\n return I[attrName];\n }\n });\n });\n },\n /***\n Generates a public jQuery style getter method for each String argument.\n\n @name attrReader\n @methodOf Core#\n */\n attrReader: function() {\n var attrNames;\n attrNames = __slice.call(arguments, 0);\n return attrNames.each(function(attrName) {\n return (self[attrName] = function() {\n return I[attrName];\n });\n });\n },\n /***\n Extends this object with methods from the passed in object. `before` and\n `after` are special option names that glue functionality before or after\n existing methods.\n\n @name extend\n @methodOf Core#\n */\n extend: function(options) {\n var afterMethods, beforeMethods;\n afterMethods = options.after;\n beforeMethods = options.before;\n delete options.after;\n delete options.before;\n $.extend(self, options);\n if (beforeMethods) {\n $.each(beforeMethods, function(name, fn) {\n return (self[name] = self[name].withBefore(fn));\n });\n }\n if (afterMethods) {\n $.each(afterMethods, function(name, fn) {\n return (self[name] = self[name].withAfter(fn));\n });\n }\n return self;\n },\n /***\n Includes a module in this object.\n\n @name include\n @methodOf Core#\n\n @param {Module} Module the module to include. A module is a constructor\n that takes two parameters, I and self, and returns an object containing the\n public methods to extend the including object with.\n */\n include: function(Module) {\n return self.extend(Module(I, self));\n }\n });\n};;\nvar DebugConsole;\nDebugConsole = function() {\n var REPL, container, input, output, repl, runButton;\n REPL = function(input, output) {\n var print;\n print = function(message) {\n return output.append($(\"<li />\", {\n text: message\n }));\n };\n return {\n run: function() {\n var code, result, source;\n source = input.val();\n try {\n code = CoffeeScript.compile(source, {\n noWrap: true\n });\n result = eval(code);\n print(\" => \" + (result));\n return input.val('');\n } catch (error) {\n return error.stack ? print(error.stack) : print(error.toString());\n }\n }\n };\n };\n container = $(\"<div />\", {\n \"class\": \"console\"\n });\n input = $(\"<textarea />\");\n output = $(\"<ul />\");\n runButton = $(\"<button />\", {\n text: \"Run\"\n });\n repl = REPL(input, output);\n container.append(output).append(input).append(runButton);\n return $(function() {\n runButton.click(function() {\n return repl.run();\n });\n return $(\"body\").append(container);\n });\n};;\nFunction.prototype.withBefore = function(interception) {\n var method;\n method = this;\n return function() {\n interception.apply(this, arguments);\n return method.apply(this, arguments);\n };\n};\nFunction.prototype.withAfter = function(interception) {\n var method;\n method = this;\n return function() {\n var result;\n result = method.apply(this, arguments);\n interception.apply(this, arguments);\n return result;\n };\n};;\n/***\n * jQuery Hotkeys Plugin\n * Copyright 2010, John Resig\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Based upon the plugin by Tzury Bar Yochay:\n * http://github.com/tzuryby/hotkeys\n *\n * Original idea by:\n * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/\n*/\n(function(jQuery) {\n var keyHandler;\n jQuery.hotkeys = {\n version: \"0.8\",\n specialKeys: {\n 8: \"backspace\",\n 9: \"tab\",\n 13: \"return\",\n 16: \"shift\",\n 17: \"ctrl\",\n 18: \"alt\",\n 19: \"pause\",\n 20: \"capslock\",\n 27: \"esc\",\n 32: \"space\",\n 33: \"pageup\",\n 34: \"pagedown\",\n 35: \"end\",\n 36: \"home\",\n 37: \"left\",\n 38: \"up\",\n 39: \"right\",\n 40: \"down\",\n 45: \"insert\",\n 46: \"del\",\n 96: \"0\",\n 97: \"1\",\n 98: \"2\",\n 99: \"3\",\n 100: \"4\",\n 101: \"5\",\n 102: \"6\",\n 103: \"7\",\n 104: \"8\",\n 105: \"9\",\n 106: \"*\",\n 107: \"+\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 112: \"f1\",\n 113: \"f2\",\n 114: \"f3\",\n 115: \"f4\",\n 116: \"f5\",\n 117: \"f6\",\n 118: \"f7\",\n 119: \"f8\",\n 120: \"f9\",\n 121: \"f10\",\n 122: \"f11\",\n 123: \"f12\",\n 144: \"numlock\",\n 145: \"scroll\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\",\n 224: \"meta\"\n },\n shiftNums: {\n \"`\": \"~\",\n \"1\": \"!\",\n \"2\": \"@\",\n \"3\": \"#\",\n \"4\": \"$\",\n \"5\": \"%\",\n \"6\": \"^\",\n \"7\": \"&\",\n \"8\": \"*\",\n \"9\": \"(\",\n \"0\": \")\",\n \"-\": \"_\",\n \"=\": \"+\",\n \";\": \":\",\n \"'\": \"\\\"\",\n \",\": \"<\",\n \".\": \">\",\n \"/\": \"?\",\n \"\\\\\": \"|\"\n }\n };\n keyHandler = function(handleObj) {\n var keys, origHandler;\n if (typeof handleObj.data !== \"string\") {\n return null;\n }\n origHandler = handleObj.handler;\n keys = handleObj.data.toLowerCase().split(\" \");\n return (handleObj.handler = function(event) {\n var _i, _len, _ref, _result, character, key, modif, possible, special;\n if (this !== event.target && (/textarea|select/i.test(event.target.nodeName) || event.target.type === \"text\" || event.target.type === \"password\")) {\n return null;\n }\n special = event.type !== \"keypress\" && jQuery.hotkeys.specialKeys[event.which];\n character = String.fromCharCode(event.which).toLowerCase();\n modif = \"\";\n possible = {};\n if (event.altKey && special !== \"alt\") {\n modif += \"alt+\";\n }\n if (event.ctrlKey && special !== \"ctrl\") {\n modif += \"ctrl+\";\n }\n if (event.metaKey && !event.ctrlKey && special !== \"meta\") {\n modif += \"meta+\";\n }\n if (event.shiftKey && special !== \"shift\") {\n modif += \"shift+\";\n }\n if (special) {\n possible[modif + special] = true;\n } else {\n possible[modif + character] = true;\n possible[modif + jQuery.hotkeys.shiftNums[character]] = true;\n if (modif === \"shift+\") {\n possible[jQuery.hotkeys.shiftNums[character]] = true;\n }\n }\n _result = []; _ref = keys;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n key = _ref[_i];\n if (possible[key]) {\n return origHandler.apply(this, arguments);\n }\n }\n return _result;\n });\n };\n return jQuery.each([\"keydown\", \"keyup\", \"keypress\"], function() {\n return (jQuery.event.special[this] = {\n add: keyHandler\n });\n });\n})(jQuery);;\nvar __slice = Array.prototype.slice, __hasProp = Object.prototype.hasOwnProperty;\n/***\n * Merges properties from objects into target without overiding.\n * First come, first served.\n * @return target\n*/\njQuery.extend({\n reverseMerge: function(target) {\n var _i, _j, _len, _ref, _ref2, name, object, objects;\n objects = __slice.call(arguments, 1);\n _ref = objects;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n object = _ref[_i];\n _ref2 = object;\n for (name in _ref2) {\n if (!__hasProp.call(_ref2, name)) continue;\n _j = _ref2[name];\n if (!(target.hasOwnProperty(name))) {\n target[name] = object[name];\n }\n }\n }\n return target;\n }\n});;\n$(function() {\n var keyName;\n /***\n The global keydown property lets your query the status of keys.\n\n <pre>\n if keydown.left\n moveLeft()\n </pre>\n\n @name keydown\n @namespace\n */\n window.keydown = {};\n keyName = function(event) {\n return jQuery.hotkeys.specialKeys[event.which] || String.fromCharCode(event.which).toLowerCase();\n };\n $(document).bind(\"keydown\", function(event) {\n return (keydown[keyName(event)] = true);\n });\n return $(document).bind(\"keyup\", function(event) {\n return (keydown[keyName(event)] = false);\n });\n});;\n$(function() {\n return [\"log\", \"info\", \"warn\", \"error\"].each(function(name) {\n return typeof console !== \"undefined\" ? (window[name] = function(message) {\n return console[name] ? console[name](message) : null;\n }) : (window[name] = $.noop);\n });\n});;\n/***\n* Matrix.js v1.3.0pre\n*\n* Copyright (c) 2010 STRd6\n*\n* Permission is hereby granted, free of charge, to any person obtaining a copy\n* of this software and associated documentation files (the \"Software\"), to deal\n* in the Software without restriction, including without limitation the rights\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the Software is\n* furnished to do so, subject to the following conditions:\n*\n* The above copyright notice and this permission notice shall be included in\n* all copies or substantial portions of the Software.\n*\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n* THE SOFTWARE.\n*\n* Loosely based on flash:\n* http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/geom/Matrix.html\n*/\n(function() {\n var Matrix, Point;\n /***\n * Create a new point with given x and y coordinates. If no arguments are given\n * defaults to (0, 0).\n * @name Point\n * @param {Number} [x]\n * @param {Number} [y]\n * @constructor\n */\n Point = function(x, y) {\n return {\n /***\n * The x coordinate of this point.\n * @name x\n * @fieldOf Point#\n */\n x: x || 0,\n /***\n * The y coordinate of this point.\n * @name y\n * @fieldOf Point#\n */\n y: y || 0,\n /***\n * Adds a point to this one and returns the new point.\n * @name add\n * @methodOf Point#\n *\n * @param {Point} other The point to add this point to.\n * @returns A new point, the sum of both.\n * @type Point\n */\n add: function(other) {\n return Point(this.x + other.x, this.y + other.y);\n },\n /***\n * Subtracts a point to this one and returns the new point.\n * @name subtract\n * @methodOf Point#\n *\n * @param {Point} other The point to subtract from this point.\n * @returns A new point, this - other.\n * @type Point\n */\n subtract: function(other) {\n return Point(this.x - other.x, this.y - other.y);\n },\n /***\n * Scale this Point (Vector) by a constant amount.\n * @name scale\n * @methodOf Point#\n *\n * @param {Number} scalar The amount to scale this point by.\n * @returns A new point, this * scalar.\n * @type Point\n */\n scale: function(scalar) {\n return Point(this.x * scalar, this.y * scalar);\n },\n /***\n * Determine whether this point is equal to another point.\n * @name equal\n * @methodOf Point#\n *\n * @param {Point} other The point to check for equality.\n * @returns true if the other point has the same x, y coordinates, false otherwise.\n * @type Boolean\n */\n equal: function(other) {\n return this.x === other.x && this.y === other.y;\n },\n /***\n * Calculate the magnitude of this Point (Vector).\n * @name magnitude\n * @methodOf Point#\n *\n * @returns The magnitude of this point as if it were a vector from (0, 0) -> (x, y).\n * @type Number\n */\n magnitude: function() {\n return Point.distance(Point(0, 0), this);\n },\n /***\n * Calculate the dot product of this point and another point (Vector).\n * @name dot\n * @methodOf Point#\n *\n * @param {Point} other The point to dot with this point.\n * @returns The dot product of this point dot other as a scalar value.\n * @type Number\n */\n dot: function(other) {\n return this.x * other.x + this.y * other.y;\n },\n /***\n * Calculate the cross product of this point and another point (Vector).\n * Usually cross products are thought of as only applying to three dimensional vectors,\n * but z can be treated as zero. The result of this method is interpreted as the magnitude\n * of the vector result of the cross product between [x1, y1, 0] x [x2, y2, 0]\n * perpendicular to the xy plane.\n * @name cross\n * @methodOf Point#\n *\n * @param {Point} other The point to cross with this point.\n * @returns The cross product of this point with the other point as scalar value.\n * @type Number\n */\n cross: function(other) {\n return this.x * other.y - other.x * this.y;\n },\n /***\n * The norm of a vector is the unit vector pointing in the same direction. This method\n * treats the point as though it is a vector from the origin to (x, y).\n * @name norm\n * @methodOf Point#\n *\n * @returns The unit vector pointing in the same direction as this vector.\n * @type Point\n */\n norm: function() {\n return this.scale(1.0 / this.length());\n },\n /***\n * Computed the length of this point as though it were a vector from (0,0) to (x,y)\n * @name length\n * @methodOf Point#\n *\n * @returns The length of the vector from the origin to this point.\n * @type Number\n */\n length: function() {\n return Math.sqrt(this.dot(this));\n },\n /***\n * Computed the Euclidean between this point and another point.\n * @name distance\n * @methodOf Point#\n *\n * @param {Point} other The point to compute the distance to.\n * @returns The distance between this point and another point.\n * @type Number\n */\n distance: function(other) {\n return Point.distance(this, other);\n }\n };\n };\n /***\n * @param {Point} p1\n * @param {Point} p2\n * @type Number\n * @returns The Euclidean distance between two points.\n */\n Point.distance = function(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n };\n /***\n * Construct a point on the unit circle for the given angle.\n *\n * @param {Number} angle The angle in radians\n * @type Point\n * @returns The point on the unit circle.\n */\n Point.fromAngle = function(angle) {\n return Point(Math.cos(angle), Math.sin(angle));\n };\n /***\n * If you have two dudes, one standing at point p1, and the other\n * standing at point p2, then this method will return the direction\n * that the dude standing at p1 will need to face to look at p2.\n * @param {Point} p1 The starting point.\n * @param {Point} p2 The ending point.\n * @returns The direction from p1 to p2 in radians.\n */\n Point.direction = function(p1, p2) {\n return Math.atan2(p2.y - p1.y, p2.x - p1.x);\n };\n /***\n * <pre>\n * _ _\n * | a c tx |\n * | b d ty |\n * |_0 0 1 _|\n * </pre>\n * Creates a matrix for 2d affine transformations.\n *\n * concat, inverse, rotate, scale and translate return new matrices with the\n * transformations applied. The matrix is not modified in place.\n *\n * Returns the identity matrix when called with no arguments.\n * @name Matrix\n * @param {Number} [a]\n * @param {Number} [b]\n * @param {Number} [c]\n * @param {Number} [d]\n * @param {Number} [tx]\n * @param {Number} [ty]\n * @constructor\n */\n Matrix = function(a, b, c, d, tx, ty) {\n a = (typeof a !== \"undefined\" && a !== null) ? a : 1;\n d = (typeof d !== \"undefined\" && d !== null) ? d : 1;\n return {\n /***\n * @name a\n * @fieldOf Matrix#\n */\n a: a,\n /***\n * @name b\n * @fieldOf Matrix#\n */\n b: b || 0,\n /***\n * @name c\n * @fieldOf Matrix#\n */\n c: c || 0,\n /***\n * @name d\n * @fieldOf Matrix#\n */\n d: d,\n /***\n * @name tx\n * @fieldOf Matrix#\n */\n tx: tx || 0,\n /***\n * @name ty\n * @fieldOf Matrix#\n */\n ty: ty || 0,\n /***\n * Returns the result of this matrix multiplied by another matrix\n * combining the geometric effects of the two. In mathematical terms,\n * concatenating two matrixes is the same as combining them using matrix multiplication.\n * If this matrix is A and the matrix passed in is B, the resulting matrix is A x B\n * http://mathworld.wolfram.com/MatrixMultiplication.html\n * @name concat\n * @methodOf Matrix#\n *\n * @param {Matrix} matrix The matrix to multiply this matrix by.\n * @returns The result of the matrix multiplication, a new matrix.\n * @type Matrix\n */\n concat: function(matrix) {\n return Matrix(this.a * matrix.a + this.c * matrix.b, this.b * matrix.a + this.d * matrix.b, this.a * matrix.c + this.c * matrix.d, this.b * matrix.c + this.d * matrix.d, this.a * matrix.tx + this.c * matrix.ty + this.tx, this.b * matrix.tx + this.d * matrix.ty + this.ty);\n },\n /***\n * Given a point in the pretransform coordinate space, returns the coordinates of\n * that point after the transformation occurs. Unlike the standard transformation\n * applied using the transformPoint() method, the deltaTransformPoint() method\n * does not consider the translation parameters tx and ty.\n * @name deltaTransformPoint\n * @methodOf Matrix#\n * @see #transformPoint\n *\n * @return A new point transformed by this matrix ignoring tx and ty.\n * @type Point\n */\n deltaTransformPoint: function(point) {\n return Point(this.a * point.x + this.c * point.y, this.b * point.x + this.d * point.y);\n },\n /***\n * Returns the inverse of the matrix.\n * http://mathworld.wolfram.com/MatrixInverse.html\n * @name inverse\n * @methodOf Matrix#\n *\n * @returns A new matrix that is the inverse of this matrix.\n * @type Matrix\n */\n inverse: function() {\n var determinant;\n determinant = this.a * this.d - this.b * this.c;\n return Matrix(this.d / determinant, -this.b / determinant, -this.c / determinant, this.a / determinant, (this.c * this.ty - this.d * this.tx) / determinant, (this.b * this.tx - this.a * this.ty) / determinant);\n },\n /***\n * Returns a new matrix that corresponds this matrix multiplied by a\n * a rotation matrix.\n * @name rotate\n * @methodOf Matrix#\n * @see Matrix.rotation\n *\n * @param {Number} theta Amount to rotate in radians.\n * @param {Point} [aboutPoint] The point about which this rotation occurs. Defaults to (0,0).\n * @returns A new matrix, rotated by the specified amount.\n * @type Matrix\n */\n rotate: function(theta, aboutPoint) {\n return this.concat(Matrix.rotation(theta, aboutPoint));\n },\n /***\n * Returns a new matrix that corresponds this matrix multiplied by a\n * a scaling matrix.\n * @name scale\n * @methodOf Matrix#\n * @see Matrix.scale\n *\n * @param {Number} sx\n * @param {Number} [sy]\n * @param {Point} [aboutPoint] The point that remains fixed during the scaling\n * @type Matrix\n */\n scale: function(sx, sy, aboutPoint) {\n return this.concat(Matrix.scale(sx, sy, aboutPoint));\n },\n /***\n * Returns the result of applying the geometric transformation represented by the\n * Matrix object to the specified point.\n * @name transformPoint\n * @methodOf Matrix#\n * @see #deltaTransformPoint\n *\n * @returns A new point with the transformation applied.\n * @type Point\n */\n transformPoint: function(point) {\n return Point(this.a * point.x + this.c * point.y + this.tx, this.b * point.x + this.d * point.y + this.ty);\n },\n /***\n * Translates the matrix along the x and y axes, as specified by the tx and ty parameters.\n * @name translate\n * @methodOf Matrix#\n * @see Matrix.translation\n *\n * @param {Number} tx The translation along the x axis.\n * @param {Number} ty The translation along the y axis.\n * @returns A new matrix with the translation applied.\n * @type Matrix\n */\n translate: function(tx, ty) {\n return this.concat(Matrix.translation(tx, ty));\n }\n };\n };\n /***\n * Creates a matrix transformation that corresponds to the given rotation,\n * around (0,0) or the specified point.\n * @see Matrix#rotate\n *\n * @param {Number} theta Rotation in radians.\n * @param {Point} [aboutPoint] The point about which this rotation occurs. Defaults to (0,0).\n * @returns\n * @type Matrix\n */\n Matrix.rotation = function(theta, aboutPoint) {\n var rotationMatrix;\n rotationMatrix = Matrix(Math.cos(theta), Math.sin(theta), -Math.sin(theta), Math.cos(theta));\n if (typeof aboutPoint !== \"undefined\" && aboutPoint !== null) {\n rotationMatrix = Matrix.translation(aboutPoint.x, aboutPoint.y).concat(rotationMatrix).concat(Matrix.translation(-aboutPoint.x, -aboutPoint.y));\n }\n return rotationMatrix;\n };\n /***\n * Returns a matrix that corresponds to scaling by factors of sx, sy along\n * the x and y axis respectively.\n * If only one parameter is given the matrix is scaled uniformly along both axis.\n * If the optional aboutPoint parameter is given the scaling takes place\n * about the given point.\n * @see Matrix#scale\n *\n * @param {Number} sx The amount to scale by along the x axis or uniformly if no sy is given.\n * @param {Number} [sy] The amount to scale by along the y axis.\n * @param {Point} [aboutPoint] The point about which the scaling occurs. Defaults to (0,0).\n * @returns A matrix transformation representing scaling by sx and sy.\n * @type Matrix\n */\n Matrix.scale = function(sx, sy, aboutPoint) {\n var scaleMatrix;\n sy = sy || sx;\n scaleMatrix = Matrix(sx, 0, 0, sy);\n if (aboutPoint) {\n scaleMatrix = Matrix.translation(aboutPoint.x, aboutPoint.y).concat(scaleMatrix).concat(Matrix.translation(-aboutPoint.x, -aboutPoint.y));\n }\n return scaleMatrix;\n };\n /***\n * Returns a matrix that corresponds to a translation of tx, ty.\n * @see Matrix#translate\n *\n * @param {Number} tx The amount to translate in the x direction.\n * @param {Number} ty The amount to translate in the y direction.\n * @return A matrix transformation representing a translation by tx and ty.\n * @type Matrix\n */\n Matrix.translation = function(tx, ty) {\n return Matrix(1, 0, 0, 1, tx, ty);\n };\n /***\n * A constant representing the identity matrix.\n * @name IDENTITY\n * @fieldOf Matrix\n */\n Matrix.IDENTITY = Matrix();\n /***\n * A constant representing the horizontal flip transformation matrix.\n * @name HORIZONTAL_FLIP\n * @fieldOf Matrix\n */\n Matrix.HORIZONTAL_FLIP = Matrix(-1, 0, 0, 1);\n /***\n * A constant representing the vertical flip transformation matrix.\n * @name VERTICAL_FLIP\n * @fieldOf Matrix\n */\n Matrix.VERTICAL_FLIP = Matrix(1, 0, 0, -1);\n window[\"Point\"] = Point;\n return (window[\"Matrix\"] = Matrix);\n})();;\nwindow.Mouse = (function() {\n var Mouse, buttons, set_button;\n Mouse = {\n left: false,\n right: false,\n middle: false,\n location: Point(0, 0)\n };\n buttons = [null, \"left\", \"middle\", \"right\"];\n set_button = function(index, state) {\n var button_name;\n button_name = buttons[index];\n return button_name ? (Mouse[button_name] = state) : null;\n };\n $(document).mousedown(function(event) {\n return set_button(event.which, true);\n });\n $(document).mouseup(function(event) {\n return set_button(event.which, false);\n });\n $(document).mousemove(function(event) {\n var x, y;\n x = event.pageX;\n y = event.pageY;\n Mouse.location = Point(x, y);\n Mouse.x = x;\n return (Mouse.y = y);\n });\n return Mouse;\n})();;\n/***\nReturns the absolute value of this number.\n\n@name abs\n@methodOf Number#\n\n@type Number\n@returns The absolute value of the number.\n*/\nNumber.prototype.abs = function() {\n return Math.abs(this);\n};\n/***\nReturns the mathematical ceiling of this number.\n\n@name ceil\n@methodOf Number#\n\n@type Number\n@returns The number truncated to the nearest integer of greater than or equal value.\n\n(4.9).ceil() # => 5\n(4.2).ceil() # => 5\n(-1.2).ceil() # => -1\n*/\nNumber.prototype.ceil = function() {\n return Math.ceil(this);\n};\n/***\nReturns the mathematical floor of this number.\n\n@name floor\n@methodOf Number#\n\n@type Number\n@returns The number truncated to the nearest integer of less than or equal value.\n\n(4.9).floor() # => 4\n(4.2).floor() # => 4\n(-1.2).floor() # => -2\n*/\nNumber.prototype.floor = function() {\n return Math.floor(this);\n};\n/***\nReturns this number rounded to the nearest integer.\n\n@name round\n@methodOf Number#\n\n@type Number\n@returns The number rounded to the nearest integer.\n\n(4.5).round() # => 5\n(4.4).round() # => 4\n*/\nNumber.prototype.round = function() {\n return Math.round(this);\n};\n/***\nReturns a number whose value is limited to the given range.\n\nExample: limit the output of this computation to between 0 and 255\n<pre>\n(x * 255).clamp(0, 255)\n</pre>\n\n@name clamp\n@methodOf Number#\n\n@param {Number} min The lower boundary of the output range\n@param {Number} max The upper boundary of the output range\n\n@returns A number in the range [min, max]\n@type Number\n*/\nNumber.prototype.clamp = function(min, max) {\n return Math.min(Math.max(this, min), max);\n};\n/***\nA mod method useful for array wrapping. The range of the function is\nconstrained to remain in bounds of array indices.\n\n<pre>\nExample:\n(-1).mod(5) == 4\n</pre>\n\n@name mod\n@methodOf Number#\n\n@param {Number} base\n@returns An integer between 0 and (base - 1) if base is positive.\n@type Number\n*/\nNumber.prototype.mod = function(base) {\n var result;\n result = this % base;\n if (result < 0 && base > 0) {\n result += base;\n }\n return result;\n};\n/***\nGet the sign of this number as an integer (1, -1, or 0).\n\n@name sign\n@methodOf Number#\n\n@type Number\n@returns The sign of this number, 0 if the number is 0.\n*/\nNumber.prototype.sign = function() {\n if (this > 0) {\n return 1;\n } else if (this < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n/***\nCalls iterator the specified number of times, passing in the number of the\ncurrent iteration as a parameter: 0 on first call, 1 on the second call, etc.\n\n@name times\n@methodOf Number#\n\n@param {Function} iterator The iterator takes a single parameter, the number\nof the current iteration.\n@param {Object} [context] The optional context parameter specifies an object\nto treat as <code>this</code> in the iterator block.\n\n@returns The number of times the iterator was called.\n@type Number\n*/\nNumber.prototype.times = function(iterator, context) {\n var i;\n i = -1;\n while (++i < this) {\n iterator.call(context, i);\n }\n return i;\n};\n/***\nReturns the the nearest grid resolution less than or equal to the number.\n\n EX:\n (7).snap(8) => 0\n (4).snap(8) => 0\n (12).snap(8) => 8\n\n@name snap\n@methodOf Number#\n\n@param {Number} resolution The grid resolution to snap to.\n@returns The nearest multiple of resolution lower than the number.\n@type Number\n*/\nNumber.prototype.snap = function(resolution) {\n var n;\n n = this / resolution;\n 1 / 1;\n return n.floor() * resolution;\n};\nNumber.prototype.toColorPart = function() {\n var s;\n s = parseInt(this.clamp(0, 255), 10).toString(16);\n if (s.length === 1) {\n s = '0' + s;\n }\n return s;\n};\nNumber.prototype.approach = function(target, maxDelta) {\n return (target - this).clamp(-maxDelta, maxDelta) + this;\n};\nNumber.prototype.approachByRatio = function(target, ratio) {\n return this.approach(target, this * ratio);\n};\nNumber.prototype.approachRotation = function(target, maxDelta) {\n while (target > this + Math.PI) {\n target -= Math.TAU;\n }\n while (target < this - Math.PI) {\n target += Math.TAU;\n }\n return (target - this).clamp(-maxDelta, maxDelta) + this;\n};\n/***\nConstrains a rotation to between -PI and PI.\n\n@name constrainRotation\n@methodOf Number#\n\n@returns This number constrained between -PI and PI.\n@type Number\n*/\nNumber.prototype.constrainRotation = function() {\n var target;\n target = this;\n while (target > Math.PI) {\n target -= Math.TAU;\n }\n while (target < -Math.PI) {\n target += MATH.TAU;\n }\n return target;\n};\nNumber.prototype.d = function(sides) {\n var sum;\n sum = 0;\n this.times(function() {\n return sum += rand(sides) + 1;\n });\n return sum;\n};\n/***\nThe mathematical circle constant of 1 turn.\n\n@name TAU\n@fieldOf Math\n*/\nMath.TAU = 2 * Math.PI;;\n/***\n* Checks whether an object is an array.\n*\n* @type Object\n* @returns A boolean expressing whether the object is an instance of Array\n*/\nObject.isArray = function(object) {\n return Object.prototype.toString.call(object) === '[object Array]';\n};;\nvar __hasProp = Object.prototype.hasOwnProperty, __slice = Array.prototype.slice;\n(function($) {\n return ($.fn.powerCanvas = function(options) {\n var $canvas, canvas, context;\n options || (options = {});\n canvas = this.get(0);\n context = undefined;\n /***\n * PowerCanvas provides a convenient wrapper for working with Context2d.\n * @name PowerCanvas\n * @constructor\n */\n $canvas = $(canvas).extend({\n /***\n * Passes this canvas to the block with the given matrix transformation\n * applied. All drawing methods called within the block will draw\n * into the canvas with the transformation applied. The transformation\n * is removed at the end of the block, even if the block throws an error.\n *\n * @name withTransform\n * @methodOf PowerCanvas#\n *\n * @param {Matrix} matrix\n * @param {Function} block\n * @returns this\n */\n withTransform: function(matrix, block) {\n context.save();\n context.transform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n try {\n block(this);\n } finally {\n context.restore();\n }\n return this;\n },\n clear: function() {\n context.clearRect(0, 0, canvas.width, canvas.height);\n return this;\n },\n clearRect: function(x, y, width, height) {\n context.clearRect(x, y, width, height);\n return this;\n },\n context: function() {\n return context;\n },\n element: function() {\n return canvas;\n },\n globalAlpha: function(newVal) {\n if (typeof newVal !== \"undefined\" && newVal !== null) {\n context.globalAlpha = newVal;\n return this;\n } else {\n return context.globalAlpha;\n }\n },\n compositeOperation: function(newVal) {\n if (typeof newVal !== \"undefined\" && newVal !== null) {\n context.globalCompositeOperation = newVal;\n return this;\n } else {\n return context.globalCompositeOperation;\n }\n },\n createLinearGradient: function(x0, y0, x1, y1) {\n return context.createLinearGradient(x0, y0, x1, y1);\n },\n createRadialGradient: function(x0, y0, r0, x1, y1, r1) {\n return context.createRadialGradient(x0, y0, r0, x1, y1, r1);\n },\n buildRadialGradient: function(c1, c2, stops) {\n var _ref, color, gradient, position;\n gradient = context.createRadialGradient(c1.x, c1.y, c1.radius, c2.x, c2.y, c2.radius);\n _ref = stops;\n for (position in _ref) {\n if (!__hasProp.call(_ref, position)) continue;\n color = _ref[position];\n gradient.addColorStop(position, color);\n }\n return gradient;\n },\n createPattern: function(image, repitition) {\n return context.createPattern(image, repitition);\n },\n drawImage: function(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {\n context.drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\n return this;\n },\n drawLine: function(x1, y1, x2, y2, width) {\n if (arguments.length === 3) {\n width = x2;\n x2 = y1.x;\n y2 = y1.y;\n y1 = x1.y;\n x1 = x1.x;\n }\n width || (width = 3);\n context.lineWidth = width;\n context.beginPath();\n context.moveTo(x1, y1);\n context.lineTo(x2, y2);\n context.closePath();\n context.stroke();\n return this;\n },\n fill: function(color) {\n $canvas.fillColor(color);\n context.fillRect(0, 0, canvas.width, canvas.height);\n return this;\n },\n /***\n * Fills a circle at the specified position with the specified\n * radius and color.\n *\n * @name fillCircle\n * @methodOf PowerCanvas#\n *\n * @param {Number} x\n * @param {Number} y\n * @param {Number} radius\n * @param {Number} color\n * @see PowerCanvas#fillColor\n * @returns this\n */\n fillCircle: function(x, y, radius, color) {\n $canvas.fillColor(color);\n context.beginPath();\n context.arc(x, y, radius, 0, Math.TAU, true);\n context.closePath();\n context.fill();\n return this;\n },\n /***\n * Fills a rectangle with the current fillColor\n * at the specified position with the specified\n * width and height\n\n * @name fillRect\n * @methodOf PowerCanvas#\n *\n * @param {Number} x\n * @param {Number} y\n * @param {Number} width\n * @param {Number} height\n * @see PowerCanvas#fillColor\n * @returns this\n */\n fillRect: function(x, y, width, height) {\n context.fillRect(x, y, width, height);\n return this;\n },\n fillShape: function() {\n var points;\n points = __slice.call(arguments, 0);\n context.beginPath();\n points.each(function(point, i) {\n return i === 0 ? context.moveTo(point.x, point.y) : context.lineTo(point.x, point.y);\n });\n context.lineTo(points[0].x, points[0].y);\n return context.fill();\n },\n /***\n * Adapted from http://js-bits.blogspot.com/2010/07/canvas-rounded-corner-rectangles.html\n */\n fillRoundRect: function(x, y, width, height, radius, strokeWidth) {\n radius || (radius = 5);\n context.beginPath();\n context.moveTo(x + radius, y);\n context.lineTo(x + width - radius, y);\n context.quadraticCurveTo(x + width, y, x + width, y + radius);\n context.lineTo(x + width, y + height - radius);\n context.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n context.lineTo(x + radius, y + height);\n context.quadraticCurveTo(x, y + height, x, y + height - radius);\n context.lineTo(x, y + radius);\n context.quadraticCurveTo(x, y, x + radius, y);\n context.closePath();\n if (strokeWidth) {\n context.lineWidth = strokeWidth;\n context.stroke();\n }\n context.fill();\n return this;\n },\n fillText: function(text, x, y) {\n context.fillText(text, x, y);\n return this;\n },\n centerText: function(text, y) {\n var textWidth;\n textWidth = $canvas.measureText(text);\n return $canvas.fillText(text, (canvas.width - textWidth) / 2, y);\n },\n fillWrappedText: function(text, x, y, width) {\n var lineHeight, tokens, tokens2;\n tokens = text.split(\" \");\n tokens2 = text.split(\" \");\n lineHeight = 16;\n if ($canvas.measureText(text) > width) {\n if (tokens.length % 2 === 0) {\n tokens2 = tokens.splice(tokens.length / 2, tokens.length / 2, \"\");\n } else {\n tokens2 = tokens.splice(tokens.length / 2 + 1, (tokens.length / 2) + 1, \"\");\n }\n context.fillText(tokens.join(\" \"), x, y);\n return context.fillText(tokens2.join(\" \"), x, y + lineHeight);\n } else {\n return context.fillText(tokens.join(\" \"), x, y + lineHeight);\n }\n },\n fillColor: function(color) {\n if (color) {\n if (color.channels) {\n context.fillStyle = color.toString();\n } else {\n context.fillStyle = color;\n }\n return this;\n } else {\n return context.fillStyle;\n }\n },\n font: function(font) {\n if (typeof font !== \"undefined\" && font !== null) {\n context.font = font;\n return this;\n } else {\n return context.font;\n }\n },\n measureText: function(text) {\n return context.measureText(text).width;\n },\n putImageData: function(imageData, x, y) {\n context.putImageData(imageData, x, y);\n return this;\n },\n strokeColor: function(color) {\n if (color) {\n if (color.channels) {\n context.strokeStyle = color.toString();\n } else {\n context.strokeStyle = color;\n }\n return this;\n } else {\n return context.strokeStyle;\n }\n },\n strokeRect: function(x, y, width, height) {\n context.strokeRect(x, y, width, height);\n return this;\n },\n textAlign: function(textAlign) {\n context.textAlign = textAlign;\n return this;\n },\n height: function() {\n return canvas.height;\n },\n width: function() {\n return canvas.width;\n }\n });\n if ((typeof canvas === \"undefined\" || canvas === null) ? undefined : canvas.getContext) {\n context = canvas.getContext('2d');\n if (options.init) {\n options.init($canvas);\n }\n return $canvas;\n }\n });\n})(jQuery);;\n(function(window) {\n var Node, QuadTree;\n QuadTree = function(I) {\n var root, self;\n I || (I = {});\n $.reverseMerge(I, {\n bounds: {\n x: 0,\n y: 0,\n width: 480,\n height: 320\n },\n maxChildren: 5,\n maxDepth: 4\n });\n root = Node({\n bounds: I.bounds,\n maxDepth: I.maxDepth,\n maxChildren: I.maxChildren\n });\n self = {\n I: I,\n root: function() {\n return root;\n },\n clear: function() {\n return root.clear();\n },\n insert: function(obj) {\n return Object.isArray(obj) ? obj.each(function(item) {\n return root.insert(item);\n }) : root.insert(obj);\n },\n retrieve: function(item) {\n return root.retrieve(item).copy();\n }\n };\n return self;\n };\n Node = function(I) {\n var BOTTOM_LEFT, BOTTOM_RIGHT, TOP_LEFT, TOP_RIGHT, findQuadrant, halfHeight, halfWidth, self, subdivide;\n I || (I = {});\n $.reverseMerge(I, {\n bounds: {\n x: 0,\n y: 0,\n width: 120,\n height: 80\n },\n children: [],\n depth: 0,\n maxChildren: 5,\n maxDepth: 4,\n nodes: []\n });\n TOP_LEFT = 0;\n TOP_RIGHT = 1;\n BOTTOM_LEFT = 2;\n BOTTOM_RIGHT = 3;\n findQuadrant = function(item) {\n var bounds, index, left, top, x, x_midpoint, y, y_midpoint;\n bounds = I.bounds;\n x = bounds.x;\n y = bounds.y;\n x_midpoint = x + halfWidth();\n y_midpoint = y + halfHeight();\n left = item.x <= x_midpoint;\n top = item.y <= y_midpoint;\n index = TOP_LEFT;\n if (left) {\n if (!top) {\n index = BOTTOM_LEFT;\n }\n } else {\n if (top) {\n index = TOP_RIGHT;\n } else {\n index = BOTTOM_RIGHT;\n }\n }\n return index;\n };\n halfWidth = function() {\n return (I.bounds.width / 2).floor();\n };\n halfHeight = function() {\n return (I.bounds.height / 2).floor();\n };\n subdivide = function() {\n var half_height, half_width, increased_depth;\n increased_depth = I.depth + 1;\n half_width = halfWidth();\n half_height = halfHeight();\n return (4).times(function(n) {\n return (I.nodes[n] = Node({\n bounds: {\n x: half_width * (n % 2),\n y: half_height * (n < 2 ? 0 : 1),\n width: half_width,\n height: half_height\n },\n depth: increased_depth,\n maxChildren: I.maxChildren,\n maxDepth: I.maxDepth\n }));\n });\n };\n self = {\n I: I,\n clear: function() {\n I.children.clear();\n I.nodes.invoke('clear');\n return I.nodes.clear();\n },\n insert: function(item) {\n var index;\n if (I.nodes.length) {\n index = findQuadrant(item);\n I.nodes[index].insert(item);\n return true;\n }\n I.children.push(item);\n if ((I.depth < I.maxDepth) && (I.children.length > I.maxChildren)) {\n subdivide();\n I.children.each(function(child) {\n return self.insert(child);\n });\n return I.children.clear();\n }\n },\n retrieve: function(item) {\n var index;\n index = findQuadrant(item);\n return (I.nodes[index] == null ? undefined : I.nodes[index].retrieve(item)) || I.children;\n }\n };\n return self;\n };\n return (window.QuadTree = QuadTree);\n})(window);;\n(function($) {\n window.Random = $.extend(window.Random, {\n angle: function() {\n return rand() * Math.TAU;\n },\n color: function() {\n return Color.random();\n },\n often: function() {\n return rand(3);\n },\n sometimes: function() {\n return !rand(3);\n }\n });\n /***\n Returns random integers from [0, n) if n is given.\n Otherwise returns random float between 0 and 1.\n\n @param {Number} n\n */\n return (window.rand = function(n) {\n return n ? Math.floor(n * Math.random()) : Math.random();\n });\n})(jQuery);;\n(function($) {\n var retrieve, store;\n /***\n @name Local\n @namespace\n */\n /***\n Store an object in local storage.\n\n @name set\n @methodOf Local\n\n @param {String} key\n @param {Object} value\n @type Object\n @returns value\n */\n store = function(key, value) {\n localStorage[key] = JSON.stringify(value);\n return value;\n };\n /***\n Retrieve an object from local storage.\n\n @name get\n @methodOf Local\n\n @param {String} key\n @type Object\n @returns The object that was stored or undefined if no object was stored.\n */\n retrieve = function(key) {\n var value;\n value = localStorage[key];\n return (typeof value !== \"undefined\" && value !== null) ? JSON.parse(value) : null;\n };\n return (window.Local = $.extend(window.Local, {\n get: retrieve,\n set: store,\n put: store,\n /***\n Access an instance of Local with a specified prefix.\n\n @name new\n @methodOf Local\n\n @param {String} prefix\n @type Local\n @returns An interface to local storage with the given prefix applied.\n */\n \"new\": function(prefix) {\n prefix || (prefix = \"\");\n return {\n get: function(key) {\n return retrieve(\"\" + (prefix) + \"_key\");\n },\n set: function(key, value) {\n return store(\"\" + (prefix) + \"_key\", value);\n },\n put: function(key, value) {\n return store(\"\" + (prefix) + \"_key\", value);\n }\n };\n }\n }));\n})(jQuery);;\n/***\nReturn the class or constant named in this string.\n\n@name constantize\n@methodOf String#\n\n@returns The class or constant named in this string.\n@type Object\n*/\nString.prototype.constantize = function() {\n if (this.match(/[A-Z][A-Za-z0-9]*/)) {\n eval(\"var that = \" + (this));\n return that;\n } else {\n return undefined;\n }\n};\n/***\nParse this string as though it is JSON and return the object it represents. If it\nis not valid JSON returns the string itself.\n\n@name parse\n@methodOf String#\n\n@returns Returns an object from the JSON this string contains. If it\nis not valid JSON returns the string itself.\n@type Object\n*/\nString.prototype.parse = function() {\n try {\n return JSON.parse(this);\n } catch (e) {\n return this;\n }\n};\n/***\nReturns true if this string only contains whitespace characters.\n\n@name blank\n@methodOf String#\n\n@returns Whether or not this string is blank.\n@type Boolean\n*/\nString.prototype.blank = function() {\n return /^\\s*$/.test(this);\n};;\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Boolean#\n*/\n/***\nReturns a string representing the specified Boolean object.\n\n<code><em>bool</em>.toString()</code>\n\n@name toString\n@methodOf Boolean#\n*/\n/***\nReturns the primitive value of a Boolean object.\n\n<code><em>bool</em>.valueOf()</code>\n\n@name valueOf\n@methodOf Boolean#\n*/\n/***\nReturns a string representing the Number object in exponential notation\n\n<code><i>number</i>.toExponential( [<em>fractionDigits</em>] )</code>\n@param fractionDigits\nAn integer specifying the number of digits after the decimal point. Defaults\nto as many digits as necessary to specify the number.\n@name toExponential\n@methodOf Number#\n*/\n/***\nFormats a number using fixed-point notation\n\n<code><i>number</i>.toFixed( [<em>digits</em>] )</code>\n@param digits The number of digits to appear after the decimal point; this\nmay be a value between 0 and 20, inclusive, and implementations may optionally\nsupport a larger range of values. If this argument is omitted, it is treated as\n0.\n@name toFixed\n@methodOf Number#\n*/\n/***\nnumber.toLocaleString();\n\n\n\n@name toLocaleString\n@methodOf Number#\n*/\n/***\nReturns a string representing the Number object to the specified precision.\n\n<code><em>number</em>.toPrecision( [ <em>precision</em> ] )</code>\n@param precision An integer specifying the number of significant digits.\n@name toPrecision\n@methodOf Number#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Number#\n*/\n/***\nReturns a string representing the specified Number object\n\n<code><i>number</i>.toString( [<em>radix</em>] )</code>\n@param radix\nAn integer between 2 and 36 specifying the base to use for representing\nnumeric values.\n@name toString\n@methodOf Number#\n*/\n/***\nReturns the primitive value of a Number object.\n\n\n\n@name valueOf\n@methodOf Number#\n*/\n/***\nReturns the specified character from a string.\n\n<code><em>string</em>.charAt(<em>index</em>)</code>\n@param index\u00a0 An integer between 0 and 1 less than the length of the string.\n@name charAt\n@methodOf String#\n*/\n/***\nReturns the numeric Unicode value of the character at the given index (except\nfor unicode codepoints > 0x10000).\n\n\n@param index\u00a0 An integer greater than 0 and less than the length of the string;\nif it is not a number, it defaults to 0.\n@name charCodeAt\n@methodOf String#\n*/\n/***\nCombines the text of two or more strings and returns a new string.\n\n<code><em>string</em>.concat(<em>string2</em>, <em>string3</em>[, ..., <em>stringN</em>])</code>\n@param string2...stringN\u00a0 Strings to concatenate to this string.\n@name concat\n@methodOf String#\n*/\n/***\nReturns the index within the calling String object of the first occurrence of\nthe specified value, starting the search at fromIndex,\nreturns -1 if the value is not found.\n\n<code><em>string</em>.indexOf(<em>searchValue</em>[, <em>fromIndex</em>]</code>\n@param searchValue\u00a0 A string representing the value to search for.\n@param fromIndex\u00a0 The location within the calling string to start the search\nfrom. It can be any integer between 0 and the length of the string. The default\nvalue is 0.\n@name indexOf\n@methodOf String#\n*/\n/***\nReturns the index within the calling String object of the last occurrence of the\nspecified value, or -1 if not found. The calling string is searched backward,\nstarting at fromIndex.\n\n<code><em>string</em>.lastIndexOf(<em>searchValue</em>[, <em>fromIndex</em>])</code>\n@param searchValue\u00a0 A string representing the value to search for.\n@param fromIndex\u00a0 The location within the calling string to start the search\nfrom, indexed from left to right. It can be any integer between 0 and the length\nof the string. The default value is the length of the string.\n@name lastIndexOf\n@methodOf String#\n*/\n/***\nReturns a number indicating whether a reference string comes before or after or\nis the same as the given string in sort order.\n\n<code> localeCompare(compareString) </code>\n\n@name localeCompare\n@methodOf String#\n*/\n/***\nUsed to retrieve the matches when matching a string against a regular\nexpression.\n\n<code><em>string</em>.match(<em>regexp</em>)</code>\n@param regexp A regular expression object. If a non-RegExp object obj is passed,\nit is implicitly converted to a RegExp by using new RegExp(obj).\n@name match\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name quote\n@methodOf String#\n*/\n/***\nReturns a new string with some or all matches of a pattern replaced by a\nreplacement.\u00a0 The pattern can be a string or a RegExp, and the replacement can\nbe a string or a function to be called for each match.\n\n<code><em>str</em>.replace(<em>regexp|substr</em>, <em>newSubStr|function[</em>, </code><code><em>flags]</em>);</code>\n@param regexp\u00a0 A RegExp object. The match is replaced by the return value of\nparameter #2.\n@param substr\u00a0 A String that is to be replaced by newSubStr.\n@param newSubStr\u00a0 The String that replaces the substring received from parameter\n#1. A number of special replacement patterns are supported; see the \"Specifying\na string as a parameter\" section below.\n@param function\u00a0 A function to be invoked to create the new substring (to put in\nplace of the substring received from parameter #1). The arguments supplied to\nthis function are described in the \"Specifying a function as a parameter\"\nsection below.\n@param flags\u00a0gimy\n\nNon-standardThe use of the flags parameter in the String.replace method is\nnon-standard. For cross-browser compatibility, use a RegExp object with\ncorresponding flags.A string containing any combination of the RegExp flags: g\nglobal match i ignore case m match over multiple lines y Non-standard\nsticky global matchignore casematch over multiple linesNon-standard sticky\n@name replace\n@methodOf String#\n*/\n/***\nExecutes the search for a match between a regular expression and this String\nobject.\n\n<code><em>string</em>.search(<em>regexp</em>)</code>\n@param regexp\u00a0 A regular expression object. If a non-RegExp object obj is\npassed, it is implicitly converted to a RegExp by using new RegExp(obj).\n@name search\n@methodOf String#\n*/\n/***\nExtracts a section of a string and returns a new string.\n\n<code><em>string</em>.slice(<em>beginslice</em>[, <em>endSlice</em>])</code>\n@param beginSlice\u00a0 The zero-based index at which to begin extraction.\n@param endSlice\u00a0 The zero-based index at which to end extraction. If omitted,\nslice extracts to the end of the string.\n@name slice\n@methodOf String#\n*/\n/***\nSplits a String object into an array of strings by separating the string into\nsubstrings.\n\n<code><em>string</em>.split([<em>separator</em>][, <em>limit</em>])</code>\n@param separator\u00a0 Specifies the character to use for separating the string. The\nseparator is treated as a string or a regular expression. If separator is\nomitted, the array returned contains one element consisting of the entire\nstring.\n@param limit\u00a0 Integer specifying a limit on the number of splits to be found.\n@name split\n@methodOf String#\n*/\n/***\nReturns the characters in a string beginning at the specified location through\nthe specified number of characters.\n\n<code><em>string</em>.substr(<em>start</em>[, <em>length</em>])</code>\n@param start\u00a0 Location at which to begin extracting characters.\n@param length\u00a0 The number of characters to extract.\n@name substr\n@methodOf String#\n*/\n/***\nReturns a subset of a string between one index and another, or through the end\nof the string.\n\n<code><em>string</em>.substring(<em>indexA</em>[, <em>indexB</em>])</code>\n@param indexA\u00a0 An integer between 0 and one less than the length of the string.\n@param indexB\u00a0 (optional) An integer between 0 and the length of the string.\n@name substring\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to lower case, according to any\nlocale-specific case mappings.\n\n<code> toLocaleLowerCase() </code>\n\n@name toLocaleLowerCase\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to upper case, according to any\nlocale-specific case mappings.\n\n<code> toLocaleUpperCase() </code>\n\n@name toLocaleUpperCase\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to lowercase.\n\n<code><em>string</em>.toLowerCase()</code>\n\n@name toLowerCase\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf String#\n*/\n/***\nReturns a string representing the specified object.\n\n<code><em>string</em>.toString()</code>\n\n@name toString\n@methodOf String#\n*/\n/***\nReturns the calling string value converted to uppercase.\n\n<code><em>string</em>.toUpperCase()</code>\n\n@name toUpperCase\n@methodOf String#\n*/\n/***\nRemoves whitespace from both ends of the string.\n\n<code><em>string</em>.trim()</code>\n\n@name trim\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name trimLeft\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name trimRight\n@methodOf String#\n*/\n/***\nReturns the primitive value of a String object.\n\n<code><em>string</em>.valueOf()</code>\n\n@name valueOf\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name anchor\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name big\n@methodOf String#\n*/\n/***\nNon-standard\n\n<code>BLINK</code>\n\n@name blink\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name bold\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name fixed\n@methodOf String#\n*/\n/***\nNon-standard\n\n<code><FONT COLOR=\"<i>color</i>\"></code>\n\n@name fontcolor\n@methodOf String#\n*/\n/***\nNon-standard\n\n<code><FONT SIZE=\"<i>size</i>\"></code>\n\n@name fontsize\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name italics\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name link\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name small\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name strike\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name sub\n@methodOf String#\n*/\n/***\nNon-standard\n\n\n\n@name sup\n@methodOf String#\n*/\n/***\nRemoves the last element from an array and returns that element.\n\n<code>\n<i>array</i>.pop()\n</code>\n\n@name pop\n@methodOf Array#\n*/\n/***\nMutates an array by appending the given elements and returning the new length of\nthe array.\n\n<code><em>array</em>.push(<em>element1</em>, ..., <em>elementN</em>)</code>\n@param element1, ..., elementN The elements to add to the end of the array.\n@name push\n@methodOf Array#\n*/\n/***\nReverses an array in place.\u00a0 The first array element becomes the last and the\nlast becomes the first.\n\n<code><em>array</em>.reverse()</code>\n\n@name reverse\n@methodOf Array#\n*/\n/***\nRemoves the first element from an array and returns that element. This method\nchanges the length of the array.\n\n<code><em>array</em>.shift()</code>\n\n@name shift\n@methodOf Array#\n*/\n/***\nSorts the elements of an array in place.\n\n<code><em>array</em>.sort([<em>compareFunction</em>])</code>\n@param compareFunction\u00a0 Specifies a function that defines the sort order. If\nomitted, the array is sorted lexicographically (in dictionary order) according\nto the string conversion of each element.\n@name sort\n@methodOf Array#\n*/\n/***\nChanges the content of an array, adding new elements while removing old\nelements.\n\n<code><em>array</em>.splice(<em>index</em>, <em>howMany</em>[, <em>element1</em>[, ...[, <em>elementN</em>]]])</code>\n@param index\u00a0 Index at which to start changing the array. If negative, will\nbegin that many elements from the end.\n@param howMany\u00a0 An integer indicating the number of old array elements to\nremove. If howMany is 0, no elements are removed. In this case, you should\nspecify at least one new element. If no howMany parameter is specified (second\nsyntax above, which is a SpiderMonkey extension), all elements after index are\nremoved.\n@param element1, ..., elementN\u00a0 The elements to add to the array. If you don't\nspecify any elements, splice simply removes elements from the array.\n@name splice\n@methodOf Array#\n*/\n/***\nAdds one or more elements to the beginning of an array and returns the new\nlength of the array.\n\n<code><em>arrayName</em>.unshift(<em>element1</em>, ..., <em>elementN</em>) </code>\n@param element1, ..., elementN The elements to add to the front of the array.\n@name unshift\n@methodOf Array#\n*/\n/***\nReturns a new array comprised of this array joined with other array(s) and/or\nvalue(s).\n\n<code><em>array</em>.concat(<em>value1</em>, <em>value2</em>, ..., <em>valueN</em>)</code>\n@param valueN\u00a0 Arrays and/or values to concatenate to the resulting array.\n@name concat\n@methodOf Array#\n*/\n/***\nJoins all elements of an array into a string.\n\n<code><em>array</em>.join(<em>separator</em>)</code>\n@param separator\u00a0 Specifies a string to separate each element of the array. The\nseparator is converted to a string if necessary. If omitted, the array elements\nare separated with a comma.\n@name join\n@methodOf Array#\n*/\n/***\nReturns a one-level deep copy of a portion of an array.\n\n<code><em>array</em>.slice(<em>begin</em>[, <em>end</em>])</code>\n@param begin\u00a0 Zero-based index at which to begin extraction.As a negative index,\nstart indicates an offset from the end of the sequence. slice(-2) extracts the\nsecond-to-last element and the last element in the sequence.\n@param end\u00a0 Zero-based index at which to end extraction. slice extracts up to\nbut not including end.slice(1,4) extracts the second element through the fourth\nelement (elements indexed 1, 2, and 3).As a negative index, end indicates an\noffset from the end of the sequence. slice(2,-1) extracts the third element\nthrough the second-to-last element in the sequence.If end is omitted, slice\nextracts to the end of the sequence.\n@name slice\n@methodOf Array#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Array#\n*/\n/***\nReturns a string representing the specified array and its elements.\n\n<code><em>array</em>.toString()</code>\n\n@name toString\n@methodOf Array#\n*/\n/***\nReturns the first index at which a given element can be found in the array, or\n-1 if it is not present.\n\n<code><em>array</em>.indexOf(<em>searchElement</em>[, <em>fromIndex</em>])</code>\n@param searchElement\u00a0fromIndex\u00a0 Element to locate in the array.The index at\nwhich to begin the search. Defaults to 0, i.e. the whole array will be searched.\nIf the index is greater than or equal to the length of the array, -1 is\nreturned, i.e. the array will not be searched. If negative, it is taken as the\noffset from the end of the array. Note that even when the index is negative, the\narray is still searched from front to back. If the calculated index is less than\n0, the whole array will be searched.\n@name indexOf\n@methodOf Array#\n*/\n/***\nReturns the last index at which a given element can be found in the array, or -1\nif it is not present. The array is searched backwards, starting at fromIndex.\n\n<code><em>array</em>.lastIndexOf(<em>searchElement</em>[, <em>fromIndex</em>])</code>\n@param searchElement\u00a0fromIndex\u00a0 Element to locate in the array.The index at\nwhich to start searching backwards. Defaults to the array's length, i.e. the\nwhole array will be searched. If the index is greater than or equal to the\nlength of the array, the whole array will be searched. If negative, it is taken\nas the offset from the end of the array. Note that even when the index is\nnegative, the array is still searched from back to front. If the calculated\nindex is less than 0, -1 is returned, i.e. the array will not be searched.\n@name lastIndexOf\n@methodOf Array#\n*/\n/***\nCreates a new array with all elements that pass the test implemented by the\nprovided function.\n\n<code><em>array</em>.filter(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callback\u00a0thisObject\u00a0 Function to test each element of the array.Object to\nuse as this when executing callback.\n@name filter\n@methodOf Array#\n*/\n/***\nExecutes a provided function once per array element.\n\n<code><em>array</em>.forEach(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callback\u00a0thisObject\u00a0 Function to execute for each element.Object to use\nas this when executing callback.\n@name forEach\n@methodOf Array#\n*/\n/***\nTests whether all elements in the array pass the test implemented by the\nprovided function.\n\n<code><em>array</em>.every(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callbackthisObject Function to test for each element.Object to use as\nthis when executing callback.\n@name every\n@methodOf Array#\n*/\n/***\nCreates a new array with the results of calling a provided function on every\nelement in this array.\n\n<code><em>array</em>.map(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callbackthisObject Function that produces an element of the new Array\nfrom an element of the current one.Object to use as this when executing\ncallback.\n@name map\n@methodOf Array#\n*/\n/***\nTests whether some element in the array passes the test implemented by the\nprovided function.\n\n<code><em>array</em>.some(<em>callback</em>[, <em>thisObject</em>])</code>\n@param callback\u00a0thisObject\u00a0 Function to test for each element.Object to use as\nthis when executing callback.\n@name some\n@methodOf Array#\n*/\n/***\nApply a function against an accumulator and each value of the array (from\nleft-to-right) as to reduce it to a single value.\n\n<code><em>array</em>.reduce(<em>callback</em>[, <em>initialValue</em>])</code>\n@param callbackinitialValue Function to execute on each value in the\narray.Object to use as the first argument to the first call of the callback.\n@name reduce\n@methodOf Array#\n*/\n/***\nApply a function simultaneously against two values of the array (from\nright-to-left) as to reduce it to a single value.\n\n<code><em>array</em>.reduceRight(<em>callback</em>[, <em>initialValue</em>])</code>\n@param callback\u00a0initialValue\u00a0 Function to execute on each value in the\narray.Object to use as the first argument to the first call of the callback.\n@name reduceRight\n@methodOf Array#\n*/\n/***\nReturns a boolean indicating whether the object has the specified property.\n\n<code><em>obj</em>.hasOwnProperty(<em>prop</em>)</code>\n@param prop The name of the property to test.\n@name hasOwnProperty\n@methodOf Object#\n*/\n/***\nCalls a function with a given this value and arguments provided as an array.\n\n<code><em>fun</em>.apply(<em>thisArg</em>[, <em>argsArray</em>])</code>\n@param thisArg\u00a0 Determines the value of this inside fun. If thisArg is null or\nundefined, this will be the global object. Otherwise, this will be equal to\nObject(thisArg) (which is thisArg if thisArg is already an object, or a String,\nBoolean, or Number if thisArg is a primitive value of the corresponding type).\nTherefore, it is always true that typeof this == \"object\" when the function\nexecutes.\n@param argsArray\u00a0 An argument array for the object, specifying the arguments\nwith which fun should be called, or null or undefined if no arguments should be\nprovided to the function.\n@name apply\n@methodOf Function#\n*/\n/***\nCreates a new function that, when called, itself calls this function in the\ncontext of the provided this value, with a given sequence of arguments preceding\nany provided when the new function was called.\n\n<code><em>fun</em>.bind(<em>thisArg</em>[, <em>arg1</em>[, <em>arg2</em>[, ...]]])</code>\n@param thisValuearg1, arg2, ... The value to be passed as the this parameter to\nthe target function when the bound function is called. \u00a0The value is ignored if\nthe bound function is constructed using the new operator.Arguments to prepend to\narguments provided to the bound function when invoking the target function.\n@name bind\n@methodOf Function#\n*/\n/***\nCalls a function with a given this value and arguments provided individually.\n\n<code><em>fun</em>.call(<em>thisArg</em>[, <em>arg1</em>[, <em>arg2</em>[, ...]]])</code>\n@param thisArg\u00a0 Determines the value of this inside fun. If thisArg is null or\nundefined, this will be the global object. Otherwise, this will be equal to\nObject(thisArg) (which is thisArg if thisArg is already an object, or a String,\nBoolean, or Number if thisArg is a primitive value of the corresponding type).\nTherefore, it is always true that typeof this == \"object\" when the function\nexecutes.\n@param arg1, arg2, ...\u00a0 Arguments for the object.\n@name call\n@methodOf Function#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Function#\n*/\n/***\nReturns a string representing the source code of the function.\n\n<code><em>function</em>.toString(<em>indentation</em>)</code>\n@param indentation Non-standard The amount of spaces to indent the string\nrepresentation of the source code. If indentation is less than or equal to -1,\nmost unnecessary spaces are removed.\n@name toString\n@methodOf Function#\n*/\n/***\nExecutes a search for a match in a specified string. Returns a result array, or\nnull.\n\n\n@param regexp\u00a0 The name of the regular expression. It can be a variable name or\na literal.\n@param str\u00a0 The string against which to match the regular expression.\n@name exec\n@methodOf RegExp#\n*/\n/***\nExecutes the search for a match between a regular expression and a specified\nstring. Returns true or false.\n\n<code> <em>regexp</em>.test([<em>str</em>]) </code>\n@param regexp\u00a0 The name of the regular expression. It can be a variable name or\na literal.\n@param str\u00a0 The string against which to match the regular expression.\n@name test\n@methodOf RegExp#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf RegExp#\n*/\n/***\nReturns a string representing the specified object.\n\n<code><i>regexp</i>.toString()</code>\n\n@name toString\n@methodOf RegExp#\n*/\n/***\nReturns a reference to the Date function that created the instance's prototype.\nNote that the value of this property is a reference to the function itself, not\na string containing the function's name.\n\n\n\n@name constructor\n@methodOf Date#\n*/\n/***\nReturns the day of the month for the specified date according to local time.\n\n<code>\ngetDate()\n</code>\n\n@name getDate\n@methodOf Date#\n*/\n/***\nReturns the day of the week for the specified date according to local time.\n\n<code>\ngetDay()\n</code>\n\n@name getDay\n@methodOf Date#\n*/\n/***\nReturns the year of the specified date according to local time.\n\n<code>\ngetFullYear()\n</code>\n\n@name getFullYear\n@methodOf Date#\n*/\n/***\nReturns the hour for the specified date according to local time.\n\n<code>\ngetHours()\n</code>\n\n@name getHours\n@methodOf Date#\n*/\n/***\nReturns the milliseconds in the specified date according to local time.\n\n<code>\ngetMilliseconds()\n</code>\n\n@name getMilliseconds\n@methodOf Date#\n*/\n/***\nReturns the minutes in the specified date according to local time.\n\n<code>\ngetMinutes()\n</code>\n\n@name getMinutes\n@methodOf Date#\n*/\n/***\nReturns the month in the specified date according to local time.\n\n<code>\ngetMonth()\n</code>\n\n@name getMonth\n@methodOf Date#\n*/\n/***\nReturns the seconds in the specified date according to local time.\n\n<code>\ngetSeconds()\n</code>\n\n@name getSeconds\n@methodOf Date#\n*/\n/***\nReturns the numeric value corresponding to the time for the specified date\naccording to universal time.\n\n<code> getTime() </code>\n\n@name getTime\n@methodOf Date#\n*/\n/***\nReturns the time-zone offset from UTC, in minutes, for the current locale.\n\n<code> getTimezoneOffset() </code>\n\n@name getTimezoneOffset\n@methodOf Date#\n*/\n/***\nReturns the day (date) of the month in the specified date according to universal\ntime.\n\n<code>\ngetUTCDate()\n</code>\n\n@name getUTCDate\n@methodOf Date#\n*/\n/***\nReturns the day of the week in the specified date according to universal time.\n\n<code>\ngetUTCDay()\n</code>\n\n@name getUTCDay\n@methodOf Date#\n*/\n/***\nReturns the year in the specified date according to universal time.\n\n<code>\ngetUTCFullYear()\n</code>\n\n@name getUTCFullYear\n@methodOf Date#\n*/\n/***\nReturns the hours in the specified date according to universal time.\n\n<code>\ngetUTCHours\n</code>\n\n@name getUTCHours\n@methodOf Date#\n*/\n/***\nReturns the milliseconds in the specified date according to universal time.\n\n<code>\ngetUTCMilliseconds()\n</code>\n\n@name getUTCMilliseconds\n@methodOf Date#\n*/\n/***\nReturns the minutes in the specified date according to universal time.\n\n<code>\ngetUTCMinutes()\n</code>\n\n@name getUTCMinutes\n@methodOf Date#\n*/\n/***\nReturns the month of the specified date according to universal time.\n\n<code>\ngetUTCMonth()\n</code>\n\n@name getUTCMonth\n@methodOf Date#\n*/\n/***\nReturns the seconds in the specified date according to universal time.\n\n<code>\ngetUTCSeconds()\n</code>\n\n@name getUTCSeconds\n@methodOf Date#\n*/\n/***\nDeprecated\n\n\n\n@name getYear\n@methodOf Date#\n*/\n/***\nSets the day of the month for a specified date according to local time.\n\n<code> setDate(<em>dayValue</em>) </code>\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setDate\n@methodOf Date#\n*/\n/***\nSets the full year for a specified date according to local time.\n\n<code>\nsetFullYear(<i>yearValue</i>[, <i>monthValue</i>[, <em>dayValue</em>]])\n</code>\n@param yearValue\u00a0 An integer specifying the numeric value of the year, for\nexample, 1995.\n@param monthValue\u00a0 An integer between 0 and 11 representing the months January\nthrough December.\n@param dayValue\u00a0 An integer between 1 and 31 representing the day of the\nmonth. If you specify the dayValue parameter, you must also specify the\nmonthValue.\n@name setFullYear\n@methodOf Date#\n*/\n/***\nSets the hours for a specified date according to local time.\n\n<code>\nsetHours(<i>hoursValue</i>[, <i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]]])\n</code>\n@param hoursValue\u00a0 An integer between 0 and 23, representing the hour.\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setHours\n@methodOf Date#\n*/\n/***\nSets the milliseconds for a specified date according to local time.\n\n<code>\nsetMilliseconds(<i>millisecondsValue</i>)\n</code>\n@param millisecondsValue\u00a0 A number between 0 and 999, representing the\nmilliseconds.\n@name setMilliseconds\n@methodOf Date#\n*/\n/***\nSets the minutes for a specified date according to local time.\n\n<code>\nsetMinutes(<i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]])\n</code>\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setMinutes\n@methodOf Date#\n*/\n/***\nSet the month for a specified date according to local time.\n\n<code>\nsetMonth(<i>monthValue</i>[, <em>dayValue</em>])\n</code>\n@param monthValue\u00a0 An integer between 0 and 11 (representing the months\nJanuary through December).\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setMonth\n@methodOf Date#\n*/\n/***\nSets the seconds for a specified date according to local time.\n\n<code>\nsetSeconds(<i>secondsValue</i>[, <em>msValue</em>])\n</code>\n@param secondsValue\u00a0 An integer between 0 and 59.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds.\n@name setSeconds\n@methodOf Date#\n*/\n/***\nSets the Date object to the time represented by a number of milliseconds since\nJanuary 1, 1970, 00:00:00 UTC.\n\n<code>\nsetTime(<i>timeValue</i>)\n</code>\n@param timeValue\u00a0 An integer representing the number of milliseconds since 1\nJanuary 1970, 00:00:00 UTC.\n@name setTime\n@methodOf Date#\n*/\n/***\nSets the day of the month for a specified date according to universal time.\n\n<code>\nsetUTCDate(<i>dayValue</i>)\n</code>\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setUTCDate\n@methodOf Date#\n*/\n/***\nSets the full year for a specified date according to universal time.\n\n<code>\nsetUTCFullYear(<i>yearValue</i>[, <i>monthValue</i>[, <em>dayValue</em>]])\n</code>\n@param yearValue\u00a0 An integer specifying the numeric value of the year, for\nexample, 1995.\n@param monthValue\u00a0 An integer between 0 and 11 representing the months January\nthrough December.\n@param dayValue\u00a0 An integer between 1 and 31 representing the day of the\nmonth. If you specify the dayValue parameter, you must also specify the\nmonthValue.\n@name setUTCFullYear\n@methodOf Date#\n*/\n/***\nSets the hour for a specified date according to universal time.\n\n<code>\nsetUTCHours(<i>hoursValue</i>[, <i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]]])\n</code>\n@param hoursValue\u00a0 An integer between 0 and 23, representing the hour.\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setUTCHours\n@methodOf Date#\n*/\n/***\nSets the milliseconds for a specified date according to universal time.\n\n<code>\nsetUTCMilliseconds(<i>millisecondsValue</i>)\n</code>\n@param millisecondsValue\u00a0 A number between 0 and 999, representing the\nmilliseconds.\n@name setUTCMilliseconds\n@methodOf Date#\n*/\n/***\nSets the minutes for a specified date according to universal time.\n\n<code>\nsetUTCMinutes(<i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]])\n</code>\n@param minutesValue\u00a0 An integer between 0 and 59, representing the minutes.\n@param secondsValue\u00a0 An integer between 0 and 59, representing the seconds. If\nyou specify the secondsValue parameter, you must also specify the minutesValue.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds. If\nyou specify the msValue parameter, you must also specify the minutesValue and\nsecondsValue.\n@name setUTCMinutes\n@methodOf Date#\n*/\n/***\nSets the month for a specified date according to universal time.\n\n<code>\nsetUTCMonth(<i>monthValue</i>[, <em>dayValue</em>])\n</code>\n@param monthValue\u00a0 An integer between 0 and 11, representing the months\nJanuary through December.\n@param dayValue\u00a0 An integer from 1 to 31, representing the day of the month.\n@name setUTCMonth\n@methodOf Date#\n*/\n/***\nSets the seconds for a specified date according to universal time.\n\n<code>\nsetUTCSeconds(<i>secondsValue</i>[, <em>msValue</em>])\n</code>\n@param secondsValue\u00a0 An integer between 0 and 59.\n@param msValue\u00a0 A number between 0 and 999, representing the milliseconds.\n@name setUTCSeconds\n@methodOf Date#\n*/\n/***\nDeprecated\n\n\n\n@name setYear\n@methodOf Date#\n*/\n/***\nReturns the date portion of a Date object in human readable form in American\nEnglish.\n\n<code><em>date</em>.toDateString()</code>\n\n@name toDateString\n@methodOf Date#\n*/\n/***\nReturns a JSON representation of the Date object.\n\n<code><em>date</em>.prototype.toJSON()</code>\n\n@name toJSON\n@methodOf Date#\n*/\n/***\nDeprecated\n\n\n\n@name toGMTString\n@methodOf Date#\n*/\n/***\nConverts a date to a string, returning the \"date\" portion using the operating\nsystem's locale's conventions.\n\n<code>\ntoLocaleDateString()\n</code>\n\n@name toLocaleDateString\n@methodOf Date#\n*/\n/***\nNon-standard\n\n\n\n@name toLocaleFormat\n@methodOf Date#\n*/\n/***\nConverts a date to a string, using the operating system's locale's conventions.\n\n<code>\ntoLocaleString()\n</code>\n\n@name toLocaleString\n@methodOf Date#\n*/\n/***\nConverts a date to a string, returning the \"time\" portion using the current\nlocale's conventions.\n\n<code> toLocaleTimeString() </code>\n\n@name toLocaleTimeString\n@methodOf Date#\n*/\n/***\nNon-standard\n\n\n\n@name toSource\n@methodOf Date#\n*/\n/***\nReturns a string representing the specified Date object.\n\n<code> toString() </code>\n\n@name toString\n@methodOf Date#\n*/\n/***\nReturns the time portion of a Date object in human readable form in American\nEnglish.\n\n<code><em>date</em>.toTimeString()</code>\n\n@name toTimeString\n@methodOf Date#\n*/\n/***\nConverts a date to a string, using the universal time convention.\n\n<code> toUTCString() </code>\n\n@name toUTCString\n@methodOf Date#\n*/\n/***\nReturns the primitive value of a Date object.\n\n<code>\nvalueOf()\n</code>\n\n@name valueOf\n@methodOf Date#\n*/;\n;\n(function() {\n var Animation, fromPixieId;\n Animation = function(data) {\n var activeAnimation, advanceFrame, currentSprite, spriteLookup;\n spriteLookup = {};\n activeAnimation = data.animations[0];\n currentSprite = data.animations[0].frames[0];\n advanceFrame = function(animation) {\n var frames;\n frames = animation.frames;\n return (currentSprite = frames[(frames.indexOf(currentSprite) + 1) % frames.length]);\n };\n data.tileset.each(function(spriteData, i) {\n return (spriteLookup[i] = Sprite.fromURL(spriteData.src));\n });\n return $.extend(data, {\n currentSprite: function() {\n return currentSprite;\n },\n draw: function(canvas, x, y) {\n return canvas.withTransform(Matrix.translation(x, y), function() {\n return spriteLookup[currentSprite].draw(canvas, 0, 0);\n });\n },\n frames: function() {\n return activeAnimation.frames;\n },\n update: function() {\n return advanceFrame(activeAnimation);\n },\n active: function(name) {\n if (name !== undefined) {\n return data.animations[name] ? (currentSprite = data.animations[name].frames[0]) : null;\n } else {\n return activeAnimation;\n }\n }\n });\n };\n window.Animation = function(name, callback) {\n return fromPixieId(App.Animations[name], callback);\n };\n fromPixieId = function(id, callback) {\n var proxy, url;\n url = (\"http://pixie.strd6.com/s3/animations/\" + (id) + \"/data.json\");\n proxy = {\n active: $.noop,\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Animation(data));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n return (window.Animation.fromPixieId = fromPixieId);\n})();;\nvar __slice = Array.prototype.slice;\n(function($) {\n var Bindable;\n /***\n Bindable module\n @name Bindable\n @module\n @constructor\n */\n Bindable = function() {\n var eventCallbacks;\n eventCallbacks = {};\n return {\n /***\n The bind method adds a function as an event listener.\n\n @name bind\n @methodOf Bindable#\n\n @param {String} event The event to listen to.\n @param {Function} callback The function to be called when the specified event\n is triggered.\n */\n bind: function(event, callback) {\n eventCallbacks[event] = eventCallbacks[event] || [];\n return eventCallbacks[event].push(callback);\n },\n /***\n The unbind method removes a specific event listener, or all event listeners if\n no specific listener is given.\n\n @name unbind\n @methodOf Bindable#\n\n @param {String} event The event to remove the listener from.\n @param {Function} [callback] The listener to remove.\n */\n unbind: function(event, callback) {\n eventCallbacks[event] = eventCallbacks[event] || [];\n return callback ? eventCallbacks.remove(callback) : (eventCallbacks[event] = []);\n },\n /***\n The trigger method calls all listeners attached to the specified event.\n\n @name trigger\n @methodOf Bindable#\n\n @param {String} event The event to trigger.\n @param {Array} [parameters] Additional parameters to pass to the event listener.\n */\n trigger: function(event) {\n var callbacks, parameters, self;\n parameters = __slice.call(arguments, 1);\n callbacks = eventCallbacks[event];\n if (callbacks && callbacks.length) {\n self = this;\n return callbacks.each(function(callback) {\n return callback.apply(self, parameters);\n });\n }\n }\n };\n };\n return (window.Bindable = Bindable);\n})(jQuery);;\nvar Bounded;\n/***\nThe Bounded module is used to provide basic data about the\nlocation and dimensions of the including object\n\nBounded module\n@name Bounded\n@module\n@constructor\n\n@param {Object} I Instance variables\n@param {Object} self Reference to including object\n*/\nBounded = function(I) {\n I || (I = {});\n $.reverseMerge(I, {\n x: 0,\n y: 0,\n width: 8,\n height: 8\n });\n return {\n /***\n The position of this game object, the top left point in the local transform.\n\n @returns The position of this object\n @type Point\n */\n position: function() {\n return Point(I.x, I.y);\n },\n collides: function(bounds) {\n return Collision.rectangular(I, bounds);\n },\n /***\n The bounds method returns infomation about the location\n of the object and its dimensions with optional offsets\n\n @name bounds\n @methodOf Bounded#\n\n @param {number} xOffset the amount to shift the x position\n @param {number} yOffset the amount to shift the y position\n */\n bounds: function(xOffset, yOffset) {\n return {\n x: I.x + (xOffset || 0),\n y: I.y + (yOffset || 0),\n width: I.width,\n height: I.height\n };\n },\n /***\n The centeredBounds method returns infomation about the center\n of the object along with the midpoint of the width and height\n\n @name centeredBounds\n @methodOf Bounded#\n */\n centeredBounds: function() {\n return {\n x: I.x + I.width / 2,\n y: I.y + I.height / 2,\n xw: I.width / 2,\n yw: I.height / 2\n };\n },\n /***\n The center method returns the {@link Point} that is\n the center of the object\n\n @name center\n @methodOf Bounded#\n */\n center: function() {\n return Point(I.x + I.width / 2, I.y + I.height / 2);\n }\n };\n};;\nvar CellularAutomata;\nCellularAutomata = function(I) {\n var currentState, get, neighbors, nextState, self;\n I || (I = {});\n $.reverseMerge(I, {\n cellUpdate: function(row, col, value, neighbors) {\n var neighborCounts;\n neighborCounts = neighbors.sum();\n return +((value + neighborCounts) >= 5);\n },\n initializeCell: function(row, col) {\n return rand() < 0.45;\n },\n outsideValue: function(row, col) {\n return 1;\n },\n width: 32,\n height: 32\n });\n currentState = [];\n nextState = [];\n get = function(row, col) {\n if (((0 <= row) && (row < I.height)) && ((0 <= col) && (col < I.width))) {\n return currentState[row][col];\n } else {\n return I.outsideValue(row, col);\n }\n };\n neighbors = function(row, col) {\n return [get(row - 1, col - 1), get(row - 1, col), get(row - 1, col + 1), get(row, col - 1), get(row, col + 1), get(row + 1, col - 1), get(row + 1, col), get(row + 1, col + 1)];\n };\n I.height.times(function(row) {\n currentState[row] = [];\n return I.width.times(function(col) {\n return (currentState[row][col] = I.initializeCell(row, col));\n });\n });\n self = {\n data: function() {\n return currentState;\n },\n get: function(row, col) {\n return currentState[row][col];\n },\n update: function(updateFn) {\n I.height.times(function(row) {\n return (nextState[row] = currentState[row].map(function(value, col) {\n return updateFn ? updateFn(row, col, value, neighbors(row, col)) : I.cellUpdate(row, col, value, neighbors(row, col));\n }));\n });\n currentState = nextState;\n return (nextState = []);\n }\n };\n return self;\n};;\nvar Collidable;\nCollidable = function(I) {\n I || (I = {});\n return {\n solid_collision: function(other) {\n if (other.solid && other.bounds) {\n if (Collision.rectangular(self, other)) {\n self.trigger('collision');\n return other.trigger('collision');\n }\n }\n },\n collides_with: function(other) {\n var nearby, quadTree;\n if (other.solid && other.bounds) {\n if (Object.isArray(other)) {\n quadTree = QuadTree();\n other.each(function(collidable) {\n return quadTree.insert(collidable);\n });\n nearby = quadTree.retrieve(self);\n return nearby.each(function(close_collider) {\n return self.solid_collision(close_collider);\n });\n } else {\n return solid_collision(other);\n }\n }\n }\n };\n};;\nvar Collision;\n/***\nCollision holds many methods useful for checking geometric overlap of various objects.\n\n@name Collision\n@namespace\n*/\nCollision = {\n rectangular: function(a, b) {\n return a.x < b.x + b.width && a.x + a.width > b.x && a.y < b.y + b.height && a.y + a.height > b.y;\n },\n circular: function(a, b) {\n var dx, dy, r;\n r = a.radius + b.radius;\n dx = b.x - a.x;\n dy = b.y - a.y;\n return r * r >= dx * dx + dy * dy;\n },\n rayCircle: function(source, direction, target) {\n var dt, hit, intersection, intersectionToTarget, intersectionToTargetLength, laserToTarget, projection, projectionLength, radius;\n radius = target.radius();\n target = target.position();\n laserToTarget = target.subtract(source);\n projectionLength = direction.dot(laserToTarget);\n if (projectionLength < 0) {\n return false;\n }\n projection = direction.scale(projectionLength);\n intersection = source.add(projection);\n intersectionToTarget = target.subtract(intersection);\n intersectionToTargetLength = intersectionToTarget.length();\n if (intersectionToTargetLength < radius) {\n hit = true;\n }\n if (hit) {\n dt = Math.sqrt(radius * radius - intersectionToTargetLength * intersectionToTargetLength);\n return (hit = direction.scale(projectionLength - dt).add(source));\n }\n },\n rayRectangle: function(source, direction, target) {\n var areaPQ0, areaPQ1, hit, p0, p1, t, tX, tY, xval, xw, yval, yw;\n xw = target.xw;\n yw = target.yw;\n if (source.x < target.x) {\n xval = target.x - xw;\n } else {\n xval = target.x + xw;\n }\n if (source.y < target.y) {\n yval = target.y - yw;\n } else {\n yval = target.y + yw;\n }\n if (direction.x === 0) {\n p0 = Point(target.x - xw, yval);\n p1 = Point(target.x + xw, yval);\n t = (yval - source.y) / direction.y;\n } else if (direction.y === 0) {\n p0 = Point(xval, target.y - yw);\n p1 = Point(xval, target.y + yw);\n t = (xval - source.x) / direction.x;\n } else {\n tX = (xval - source.x) / direction.x;\n tY = (yval - source.y) / direction.y;\n if ((tX < tY || ((-xw < source.x - target.x) && (source.x - target.x < xw))) && !((-yw < source.y - target.y) && (source.y - target.y < yw))) {\n p0 = Point(target.x - xw, yval);\n p1 = Point(target.x + xw, yval);\n t = tY;\n } else {\n p0 = Point(xval, target.y - yw);\n p1 = Point(xval, target.y + yw);\n t = tX;\n }\n }\n if (t > 0) {\n areaPQ0 = direction.cross(p0.subtract(source));\n areaPQ1 = direction.cross(p1.subtract(source));\n return areaPQ0 * areaPQ1 < 0 ? (hit = direction.scale(t).add(source)) : null;\n }\n }\n};;\nvar DebugConsole;\nDebugConsole = function() {\n var REPL, container, input, output, repl, runButton;\n REPL = function(input, output) {\n var print;\n print = function(message) {\n return output.append($(\"<li />\", {\n text: message\n }));\n };\n return {\n run: function() {\n var code, result, source;\n source = input.val();\n try {\n code = CoffeeScript.compile(source, {\n bare: true\n });\n if (code.indexOf(\"var\") === 0) {\n code = code.substring(code.indexOf(\"\\n\"));\n }\n result = eval(code);\n print(\" => \" + (result));\n return input.val('');\n } catch (error) {\n return error.stack ? print(error.stack) : print(error.toString());\n }\n }\n };\n };\n container = $(\"<div />\", {\n \"class\": \"console\"\n });\n input = $(\"<textarea />\");\n output = $(\"<ul />\");\n runButton = $(\"<button />\", {\n text: \"Run\"\n });\n repl = REPL(input, output);\n container.append(output).append(input).append(runButton);\n return $(function() {\n runButton.click(function() {\n return repl.run();\n });\n return $(\"body\").append(container);\n });\n};;\nfunction DialogBox(I) {\n I = I || {};\n \n $.reverseMerge(I, {\n backgroundColor: \"#000\",\n blinkRate: 8,\n cursor: true,\n cursorWidth: 10,\n height: 480,\n lineHeight: 16,\n paddingX: 24,\n paddingY: 24,\n text: \"\",\n textColor: \"#080\",\n width: 640,\n x: 0,\n y: 0\n });\n \n I.textWidth = I.width - 2*(I.paddingX);\n I.textHeight = I.height - 2*(I.paddingY);\n \n var blinkCount = 0;\n var cursorOn = true;\n \n var pageOffset = 0;\n var displayChars = 0;\n \n return {\n complete: function() {\n return displayChars >= I.text.length - 1;\n },\n \n draw: function(canvas) {\n //TODO: A lot of the logic in here should be moved into the\n // update method and pre-computed.\n var textStart = Point(I.paddingX, I.paddingY + I.lineHeight);\n \n canvas.withTransform(Matrix.translation(I.x, I.y), function() {\n canvas.fillColor(I.backgroundColor);\n canvas.fillRect(0, 0, I.width, I.height);\n \n canvas.fillColor(I.textColor);\n \n var pageCharCount = 0;\n var displayText = I.text.substr(pageOffset, displayChars);\n \n var piecesRemaining = displayText.split(' ');\n var lineWidth = 0;\n var line = 0;\n \n while(piecesRemaining.length > 0) {\n var currentLine = piecesRemaining.shift();\n \n while((canvas.measureText(currentLine) <= I.textWidth) && (piecesRemaining.length > 0)) {\n var proposedLine = currentLine + \" \" + piecesRemaining[0];\n \n if(canvas.measureText(proposedLine) <= I.textWidth) {\n piecesRemaining.shift();\n currentLine = proposedLine;\n } else {\n break;\n ;//NOOP\n }\n }\n \n pageCharCount += currentLine.length;\n \n canvas.fillText(currentLine, textStart.x, textStart.y + line * I.lineHeight);\n lineWidth = canvas.measureText(currentLine);\n \n if(line * I.lineHeight < I.textHeight) {\n line += 1;\n } else {\n pageOffset += pageCharCount + line;\n line = 0;\n pageCharCount = 0;\n displayChars = 0;\n break;\n ;\n }\n }\n \n if(cursorOn && I.cursor) {\n canvas.fillRect(textStart.x + lineWidth, textStart.y + (line - 2) *I.lineHeight, I.cursorWidth, I.lineHeight);\n }\n });\n \n },\n \n flush: function() {\n displayChars = I.text.length;\n },\n \n setText: function(text) {\n pageOffset = 0;\n displayChars = 0;\n I.text = text;\n },\n \n update: function() {\n displayChars += 1;\n blinkCount += 1;\n \n if(blinkCount >= I.blinkRate) {\n blinkCount = 0;\n cursorOn = !cursorOn;\n }\n }\n };\n};\nvar Drawable;\n/**\nThe Drawable module is used to provide a simple draw method to the including\nobject.\n\nBinds a default draw listener to draw a rectangle or a sprite, if one exists.\n\nBinds a step listener to update the transform of the object.\n\nAutoloads the sprite specified in I.spriteName, if any.\n\n@name Drawable\n@module\n@constructor\n\n@param {Object} I Instance variables\n@param {Object} self Reference to including object\n*/\nDrawable = function(I, self) {\n I || (I = {});\n $.reverseMerge(I, {\n color: \"#196\",\n spriteName: null\n });\n if (I.spriteName) {\n I.sprite = Sprite(I.spriteName, function(sprite) {\n I.width = sprite.width;\n return (I.height = sprite.height);\n });\n }\n self.bind('step', function() {\n var center;\n center = self.center();\n return I.rotation ? (I.transform = Matrix.translation(center.x, center.y).concat(Matrix.rotation(I.rotation)).concat(Matrix.translation(-I.width / 2, -I.height / 2))) : (I.transform = Matrix.translation(I.x, I.y));\n });\n self.bind('draw', function(canvas) {\n if (I.sprite) {\n return I.sprite.draw(canvas, 0, 0);\n } else {\n canvas.fillColor(I.color);\n return canvas.fillRect(0, 0, I.width, I.height);\n }\n });\n return {};\n};;\nvar Durable;\n/***\nThe Durable module deactives GameObjects after a specified duration.\nIf a duration is specified the object will update that many times. If -1 is\nspecified the object will have an unlimited duration.\n\n@name Durable\n@module\n@constructor\n\n@param {Object} I Instance variables\n*/\nDurable = function(I) {\n $.reverseMerge(I, {\n duration: -1\n });\n return {\n before: {\n update: function() {\n return I.duration !== -1 && (I.age >= I.duration) ? (I.active = false) : null;\n }\n }\n };\n};;\nvar Emitter;\nEmitter = function(I) {\n var self;\n self = GameObject(I);\n return self.include(Emitterable);\n};;\nvar Emitterable;\nEmitterable = function(I, self) {\n var n, particles;\n I || (I = {});\n $.reverseMerge(I, {\n batchSize: 1,\n emissionRate: 1,\n color: \"blue\",\n width: 0,\n height: 0,\n generator: {},\n particleCount: Infinity,\n particleData: {\n acceleration: Point(0, 0.1),\n age: 0,\n color: \"blue\",\n duration: 30,\n height: 2,\n maxSpeed: 2,\n offset: Point(0, 0),\n sprite: false,\n spriteName: false,\n velocity: Point(-0.25, 1),\n width: 2\n }\n });\n particles = [];\n n = 0;\n return {\n before: {\n draw: function(canvas) {\n return particles.invoke(\"draw\", canvas);\n },\n update: function() {\n I.batchSize.times(function() {\n var center, particleProperties;\n if (n < I.particleCount && rand() < I.emissionRate) {\n center = self.center();\n particleProperties = $.reverseMerge({\n x: center.x,\n y: center.y\n }, I.particleData);\n $.each(I.generator, function(key, value) {\n return I.generator[key].call ? (particleProperties[key] = I.generator[key](n, I)) : (particleProperties[key] = I.generator[key]);\n });\n particleProperties.x += particleProperties.offset.x;\n particleProperties.y += particleProperties.offset.y;\n particles.push(GameObject(particleProperties));\n return n += 1;\n }\n });\n particles = particles.select(function(particle) {\n return particle.update();\n });\n return n === I.particleCount && !particles.length ? (I.active = false) : null;\n }\n }\n };\n};;\n(function($) {\n var defaults;\n defaults = {\n FPS: 33.3333,\n age: 0,\n ambientLight: 1,\n backgroundColor: \"#FFFFFF\",\n cameraTransform: Matrix.IDENTITY,\n excludedModules: [],\n includedModules: [],\n paused: false,\n showFPS: false\n };\n /***\n The Engine controls the game world and manages game state. Once you\n set it up and let it run it pretty much takes care of itself.\n\n You can use the engine to add or remove objects from the game world.\n\n There are several modules that can include to add additional capabilities\n to the engine.\n\n The engine fires events that you may bind listeners to. Event listeners\n may be bound with <code>engine.bind(eventName, callback)</code>\n\n @name Engine\n @constructor\n @param I\n */\n /***\n Observe or modify the\n entity data before it is added to the engine.\n @name beforeAdd\n @methodOf Engine#\n @event\n\n @param {Object} entityData\n */\n /***\n Observe or configure a <code>gameObject</code> that has been added\n to the engine.\n @name afterAdd\n @methodOf Engine#\n @event\n\n @param {GameObject} object The object that has just been added to the\n engine.\n */\n /***\n Called when the engine updates all the game objects.\n\n @name update\n @methodOf Engine#\n @event\n */\n /***\n Called after the engine completes an update. Here it is\n safe to modify the game objects array.\n\n @name afterUpdate\n @methodOf Engine#\n @event\n */\n /***\n Called before the engine draws the game objects on the canvas.\n\n The current camera transform <b>is</b> applied.\n\n @name preDraw\n @methodOf Engine#\n @event\n */\n /***\n Called after the engine draws on the canvas.\n\n The current camera transform <b>is not</b> applied, you may\n choose to apply it yourself using <code>I.cameraTransform</code>.\n\n @name draw\n @methodOf Engine#\n @event\n */\n return (window.Engine = function(I) {\n var canvas, defaultModules, draw, frameAdvance, framerate, intervalId, modules, queuedObjects, self, step, update;\n I || (I = {});\n $.reverseMerge(I, {\n objects: []\n }, defaults);\n intervalId = null;\n frameAdvance = false;\n queuedObjects = [];\n framerate = Framerate({\n noDOM: true\n });\n update = function() {\n var _ref, toRemove;\n self.trigger(\"update\");\n _ref = I.objects.partition(function(object) {\n return object.update();\n });\n I.objects = _ref[0];\n toRemove = _ref[1];\n toRemove.invoke(\"trigger\", \"remove\");\n I.objects = I.objects.concat(queuedObjects);\n queuedObjects = [];\n return self.trigger(\"afterUpdate\");\n };\n draw = function() {\n canvas.withTransform(I.cameraTransform, function(canvas) {\n if (I.backgroundColor) {\n canvas.fill(I.backgroundColor);\n }\n self.trigger(\"preDraw\", canvas);\n return I.objects.invoke(\"draw\", canvas);\n });\n self.trigger(\"draw\", canvas);\n if (I.showFPS) {\n canvas.font(\"bold 9pt consolas, 'Courier New', 'andale mono', 'lucida console', monospace\");\n canvas.fillColor(\"#FFF\");\n canvas.fillText(\"fps: \" + framerate.fps, 6, 18);\n }\n return framerate.rendered();\n };\n step = function() {\n if (!I.paused || frameAdvance) {\n update();\n I.age += 1;\n }\n return draw();\n };\n canvas = I.canvas || $(\"<canvas />\").powerCanvas();\n self = Core(I).extend({\n /***\n The add method creates and adds an object to the game world.\n\n Events triggered:\n <code>beforeAdd(entityData)</code>\n <code>afterAdd(gameObject)</code>\n\n @name add\n @methodOf Engine#\n @param entityData The data used to create the game object.\n @type GameObject\n */\n add: function(entityData) {\n var obj;\n self.trigger(\"beforeAdd\", entityData);\n obj = GameObject.construct(entityData);\n self.trigger(\"afterAdd\", obj);\n if (intervalId && !I.paused) {\n queuedObjects.push(obj);\n } else {\n I.objects.push(obj);\n }\n return obj;\n },\n /***\n Returns a reference to the canvas.\n\n @name canvas\n @methodOf Engine#\n */\n canvas: function() {\n return canvas;\n },\n objects: function() {\n return I.objects;\n },\n objectAt: function(x, y) {\n var bounds, targetObject;\n targetObject = null;\n bounds = {\n x: x,\n y: y,\n width: 1,\n height: 1\n };\n self.eachObject(function(object) {\n if (object.collides(bounds)) {\n return (targetObject = object);\n }\n });\n return targetObject;\n },\n eachObject: function(iterator) {\n return I.objects.each(iterator);\n },\n /***\n Start the game simulation.\n @methodOf Engine#\n @name start\n */\n start: function() {\n return !(intervalId) ? (intervalId = setInterval(function() {\n return step();\n }, 1000 / I.FPS)) : null;\n },\n /***\n Stop the simulation.\n @methodOf Engine#\n @name stop\n */\n stop: function() {\n clearInterval(intervalId);\n return (intervalId = null);\n },\n frameAdvance: function() {\n I.paused = true;\n frameAdvance = true;\n step();\n return (frameAdvance = false);\n },\n play: function() {\n return (I.paused = false);\n },\n /***\n Pause the simulation\n @methodOf Engine#\n @name pause\n */\n pause: function() {\n return (I.paused = true);\n },\n paused: function() {\n return I.paused;\n },\n setFramerate: function(newFPS) {\n I.FPS = newFPS;\n self.stop();\n return self.start();\n }\n });\n self.attrAccessor(\"ambientLight\");\n self.attrAccessor(\"backgroundColor\");\n self.attrAccessor(\"cameraTransform\");\n self.include(Bindable);\n defaultModules = [\"Shadows\", \"HUD\", \"Developer\", \"SaveState\", \"Selector\", \"Collision\"];\n modules = defaultModules.concat(I.includedModules);\n modules = modules.without(I.excludedModules);\n modules.each(function(moduleName) {\n if (!(Engine[moduleName])) {\n throw \"#Engine.{moduleName} is not a valid engine module\";\n }\n return self.include(Engine[moduleName]);\n });\n return self;\n });\n})(jQuery);;\n/***\nThe <code>Tilemap</code> module provides a way to load tilemaps in the engine.\n\n@name Tilemap\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Tilemap = function(I, self) {\n var map;\n map = null;\n self.bind(\"preDraw\", function(canvas) {\n return (typeof map === \"undefined\" || map === null) ? undefined : map.draw(canvas);\n });\n return {\n loadMap: function(name, complete) {\n return (map = Tilemap.load({\n name: name,\n complete: complete,\n entity: self.add\n }));\n }\n };\n};;\n/***\nThe <code>Collision</code> module provides some simple collision detection methods to engine.\n\n@name Collision\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Collision = function(I, self) {\n return {\n /***\n Detects collisions between a bounds and the game objects.\n\n @name collides\n @methodOf Engine.Collision#\n @param bounds The bounds to check collisions with.\n @param [sourceObject] An object to exclude from the results.\n */\n collides: function(bounds, sourceObject) {\n return I.objects.inject(false, function(collided, object) {\n return collided || (object.solid() && (object !== sourceObject) && object.collides(bounds));\n });\n },\n /***\n Detects collisions between a ray and the game objects.\n\n @name rayCollides\n @methodOf Engine.Collision#\n @param source The origin point\n @param direction A point representing the direction of the ray\n @param [sourceObject] An object to exclude from the results.\n */\n rayCollides: function(source, direction, sourceObject) {\n var hits, nearestDistance, nearestHit;\n hits = I.objects.map(function(object) {\n var hit;\n hit = object.solid() && (object !== sourceObject) && Collision.rayRectangle(source, direction, object.centeredBounds());\n if (hit) {\n hit.object = object;\n }\n return hit;\n });\n nearestDistance = Infinity;\n nearestHit = null;\n hits.each(function(hit) {\n var d;\n if (hit && (d = hit.distance(source)) < nearestDistance) {\n nearestDistance = d;\n return (nearestHit = hit);\n }\n });\n return nearestHit;\n }\n };\n};;\nvar _i, _ref, developerMode, fn, key, objectToUpdate;\nvar __hasProp = Object.prototype.hasOwnProperty;\n/***\nThe <code>Developer</code> module provides a debug overlay and methods for debugging and live coding.\n\n@name Developer\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Developer = function(I, self) {\n self.bind(\"draw\", function(canvas) {\n if (I.paused) {\n canvas.withTransform(I.cameraTransform, function(canvas) {\n return I.objects.each(function(object) {\n canvas.fillColor('rgba(255, 0, 0, 0.5)');\n return canvas.fillRect(object.bounds().x, object.bounds().y, object.bounds().width, object.bounds().height);\n });\n });\n canvas.fillColor('rgba(0, 0, 0, 0.5)');\n canvas.fillRect(430, 10, 200, 60);\n canvas.fillColor('#fff');\n canvas.fillText(\"Developer Mode. Press Esc to resume\", 440, 25);\n canvas.fillText(\"Shift+Left click to add boxes\", 440, 43);\n return canvas.fillText(\"Right click red boxes to edit properties\", 440, 60);\n }\n });\n return {};\n};\ndeveloperMode = false;\nobjectToUpdate = null;\nwindow.updateObjectProperties = function(newProperties) {\n return objectToUpdate ? $.extend(objectToUpdate, GameObject.construct(newProperties)) : null;\n};\nif (window.developerModeMousedown) {\n $(document).unbind(window.developerModeMousedown);\n}\nif (window.developerHotkeys) {\n _ref = developerHotkeys;\n for (key in _ref) {\n if (!__hasProp.call(_ref, key)) continue;\n fn = _ref[key];\n $(document).unbind(\"keydown\", key, fn);\n }\n}\nwindow.developerModeMousedown = function(event) {\n var object;\n if (developerMode) {\n console.log(event.which);\n if (event.which === 3) {\n if (object = engine.objectAt(event.pageX, event.pageY)) {\n parent.editProperties(object.I);\n objectToUpdate = object;\n }\n return console.log(object);\n } else if (event.which === 2 || keydown.shift) {\n return (typeof window.developerAddObject === \"function\" ? window.developerAddObject(event) : undefined);\n }\n }\n};\n$(document).mousedown(window.developerModeMousedown);\nwindow.developerHotkeys = {\n esc: function() {\n developerMode = !developerMode;\n return developerMode ? engine.pause() : engine.play();\n },\n f3: function() {\n return Local.set(\"level\", engine.saveState());\n },\n f4: function() {\n return engine.loadState(Local.get(\"level\"));\n },\n f5: function() {\n return engine.reload();\n }\n};\n_ref = window.developerHotkeys;\nfor (_i in _ref) {\n if (!__hasProp.call(_ref, _i)) continue;\n (function() {\n var key = _i;\n var fn = _ref[_i];\n return (window.developerHotkeys[key] = function(event) {\n event.preventDefault();\n return fn();\n });\n })();\n}\n_ref = window.developerHotkeys;\nfor (key in _ref) {\n if (!__hasProp.call(_ref, key)) continue;\n fn = _ref[key];\n $(document).bind(\"keydown\", key, fn);\n};\n/***\nThe <code>HUD</code> module provides an extra canvas to draw to. GameObjects that respond to the\n<code>drawHUD</code> method will draw to the HUD canvas. The HUD canvas is not cleared each frame, it is\nthe responsibility of the objects drawing on it to manage that themselves.\n\n@name HUD\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.HUD = function(I, self) {\n var hudCanvas;\n hudCanvas = $(\"<canvas width=640 height=480 />\").powerCanvas();\n hudCanvas.font(\"bold 9pt consolas, 'Courier New', 'andale mono', 'lucida console', monospace\");\n self.bind(\"draw\", function(canvas) {\n var hud;\n I.objects.each(function(object) {\n return (typeof object.drawHUD === \"function\" ? object.drawHUD(hudCanvas) : undefined);\n });\n hud = hudCanvas.element();\n return canvas.drawImage(hud, 0, 0, hud.width, hud.height, 0, 0, hud.width, hud.height);\n });\n return {};\n};;\n(function($) {\n var _ref, b2DebugDraw, b2World;\n _ref = Box2D.Dynamics;\n b2World = _ref.b2World;\n b2DebugDraw = _ref.b2DebugDraw;\n /***\n (Module) The <code>Box2D</code> module provides physics integration via Box2D.\n\n @name Box2D\n @fieldOf Engine\n\n @param {Object} I Instance variables\n @param {Object} self Reference to the engine\n */\n return (Engine.Box2D = function(I, self) {\n var debugCanvas, debugDraw, debugElement, destroyPhysicsBodies, fireCollisionEvents, pendingCollisions, pendingDestructions, world;\n $.reverseMerge(I, {\n scale: 0.1,\n gravity: Point(0, 98),\n PHYSICS_DEBUG_DRAW: false\n });\n world = new b2World(new Box2D.Common.Math.b2Vec2(I.gravity.x, I.gravity.y), true);\n debugDraw = null;\n debugElement = null;\n debugCanvas = null;\n pendingCollisions = [];\n pendingDestructions = [];\n world.SetContactListener({\n BeginContact: function(contact) {\n var a, b;\n a = contact.GetFixtureA().GetBody().GetUserData();\n b = contact.GetFixtureB().GetBody().GetUserData();\n return pendingCollisions.push([a, b, contact]);\n },\n EndContact: function(contact) {},\n PreSolve: function(contact, oldManifold) {},\n PostSolve: function(contact, impulse) {}\n });\n fireCollisionEvents = function() {\n pendingCollisions.each(function(event) {\n var _ref2, a, b, contact;\n _ref2 = event;\n a = _ref2[0];\n b = _ref2[1];\n contact = _ref2[2];\n a.trigger(\"collision\", b, contact);\n return b.trigger(\"collision\", a, contact);\n });\n return (pendingCollisions = []);\n };\n destroyPhysicsBodies = function() {\n pendingDestructions.each(function(body) {\n return world.DestroyBody(body);\n });\n return (pendingDestructions = []);\n };\n self.bind(\"update\", function() {\n world.Step(1 / I.FPS, 10, 10);\n world.ClearForces();\n fireCollisionEvents();\n return destroyPhysicsBodies();\n });\n self.bind(\"draw\", function(canvas) {\n if (I.PHYSICS_DEBUG_DRAW) {\n if (!(debugDraw)) {\n debugElement = $(\"<canvas width=640 height=480 />\").get(0);\n debugCanvas = debugElement.getContext(\"2d\");\n debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(debugCanvas);\n debugDraw.SetDrawScale(10);\n debugDraw.SetFillAlpha(0.3);\n debugDraw.SetLineThickness(1.0);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n world.SetDebugDraw(debugDraw);\n }\n world.DrawDebugData();\n return canvas.withTransform(I.cameraTransform, function(canvas) {\n return canvas.drawImage(debugElement, 0, 0, debugElement.width, debugElement.height, 0, 0, debugElement.width, debugElement.height);\n });\n }\n });\n self.bind(\"beforeAdd\", function(entityData) {\n return (entityData.world = world);\n });\n self.bind(\"afterAdd\", function(object) {\n return object.bind(\"remove\", function() {\n return pendingDestructions.push(object.body());\n });\n });\n return {};\n });\n})(jQuery);;\n/***\nThe <code>SaveState</code> module provides methods to save and restore the current engine state.\n\n@name SaveState\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.SaveState = function(I, self) {\n var savedState;\n savedState = null;\n return {\n rewind: function() {},\n /***\n Save the current game state and returns a JSON object representing that state.\n\n @name saveState\n @methodOf Engine.SaveState#\n */\n saveState: function() {\n return (savedState = I.objects.map(function(object) {\n return $.extend({}, object.I);\n }));\n },\n /***\n Loads the game state passed in, or the last saved state, if any.\n\n @name loadState\n @methodOf Engine.SaveState#\n @param [newState] The game state to load.\n */\n loadState: function(newState) {\n if (newState || (newState = savedState)) {\n I.objects.invoke(\"trigger\", \"remove\");\n I.objects = [];\n return newState.each(function(objectData) {\n return self.add($.extend({}, objectData));\n });\n }\n },\n /***\n Reloads the current engine state, useful for hotswapping code.\n\n @name reload\n @methodOf Engine.SaveState#\n */\n reload: function() {\n var oldObjects;\n oldObjects = I.objects;\n I.objects = [];\n return oldObjects.each(function(object) {\n object.trigger(\"remove\");\n return self.add(object.I);\n });\n }\n };\n};;\n/***\nThe <code>Selector</code> module provides methods to query the engine to find game objects.\n\n@name Selector\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Selector = function(I, self) {\n var instanceMethods;\n instanceMethods = {\n set: function(attr, value) {\n return this.each(function(item) {\n return (item.I[attr] = value);\n });\n }\n };\n return {\n /***\n Get a selection of GameObjects that match the specified selector criteria. The selector language\n can select objects by id, class, or attributes.\n\n To select an object by id use \"#anId\"\n\n To select objects by class use \"MyClass\"\n\n To select objects by properties use \".someProperty\" or \".someProperty=someValue\"\n\n You may mix and match selectors. \"Wall.x=0\" to select all objects of class Wall with an x property of 0.\n\n @name find\n @methodOf Engine#\n @param {String} selector\n @type Array\n */\n find: function(selector) {\n var matcher, results;\n results = [];\n matcher = Engine.Selector.generate(selector);\n I.objects.each(function(object) {\n if (matcher.match(object)) {\n return results.push(object);\n }\n });\n return $.extend(results, instanceMethods);\n }\n };\n};\n$.extend(Engine.Selector, {\n parse: function(selector) {\n return selector.split(\",\").invoke(\"trim\");\n },\n process: function(item) {\n var result;\n result = /^(\\w+)?#?([\\w\\-]+)?\\.?([\\w\\-]+)?=?([\\w\\-]+)?/.exec(item);\n if (result) {\n if (result[4]) {\n result[4] = result[4].parse();\n }\n return result.splice(1);\n } else {\n return [];\n }\n },\n generate: function(selector) {\n var ATTR, ATTR_VALUE, ID, TYPE, components;\n components = Engine.Selector.parse(selector).map(function(piece) {\n return Engine.Selector.process(piece);\n });\n TYPE = 0;\n ID = 1;\n ATTR = 2;\n ATTR_VALUE = 3;\n return {\n match: function(object) {\n var _i, _len, _ref, _ref2, attr, attrMatch, component, idMatch, typeMatch, value;\n _ref = components;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n component = _ref[_i];\n idMatch = (component[ID] === object.I.id) || !component[ID];\n typeMatch = (component[TYPE] === object.I[\"class\"]) || !component[TYPE];\n if (attr = component[ATTR]) {\n if (typeof (_ref2 = (value = component[ATTR_VALUE])) !== \"undefined\" && _ref2 !== null) {\n attrMatch = (object.I[attr] === value);\n } else {\n attrMatch = object.I[attr];\n }\n } else {\n attrMatch = true;\n }\n if (idMatch && typeMatch && attrMatch) {\n return true;\n }\n }\n return false;\n }\n };\n }\n});;\n/***\nThe <code>Shadows</code> module provides a lighting extension to the Engine. Objects that have\nan illuminate method will add light to the scene. Objects that have an true opaque attribute will cast\nshadows.\n\n@name Shadows\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Shadows = function(I, self) {\n var shadowCanvas;\n shadowCanvas = $(\"<canvas width=640 height=480 />\").powerCanvas();\n self.bind(\"draw\", function(canvas) {\n var shadows;\n if (I.ambientLight < 1) {\n shadowCanvas.compositeOperation(\"source-over\");\n shadowCanvas.clear();\n shadowCanvas.fill(\"rgba(0, 0, 0, \" + (1 - I.ambientLight) + \")\");\n shadowCanvas.compositeOperation(\"destination-out\");\n shadowCanvas.withTransform(I.cameraTransform, function(shadowCanvas) {\n return I.objects.each(function(object, i) {\n if (object.illuminate) {\n shadowCanvas.globalAlpha(1);\n return object.illuminate(shadowCanvas);\n }\n });\n });\n shadows = shadowCanvas.element();\n return canvas.drawImage(shadows, 0, 0, shadows.width, shadows.height, 0, 0, shadows.width, shadows.height);\n }\n });\n return {};\n};;\nvar Framerate;\n/***\n@name Framerate\n@constructor\n\nThis object keeps track of framerate and displays it by creating and appending an\nhtml element to the DOM.\n\nOnce created you call snapshot at the end of every rendering cycle.\n*/\nFramerate = function(options) {\n var element, framerateUpdateInterval, framerates, numFramerates, renderTime, self, updateFramerate;\n options || (options = {});\n if (!(options.noDOM)) {\n element = $(\"<div>\", {\n css: {\n color: \"#FFF\",\n fontFamily: \"consolas, 'Courier New', 'andale mono', 'lucida console', monospace\",\n fontWeight: \"bold\",\n paddingLeft: 4,\n position: \"fixed\",\n top: 0,\n left: 0\n }\n }).appendTo('body').get(0);\n }\n numFramerates = 15;\n framerateUpdateInterval = 250;\n renderTime = -1;\n framerates = [];\n updateFramerate = function() {\n var _i, _len, _ref, framerate, rate, tot;\n tot = 0;\n _ref = framerates;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n rate = _ref[_i];\n tot += rate;\n }\n framerate = (tot / framerates.length).round();\n self.fps = framerate;\n if (element) {\n return (element.innerHTML = \"fps: \" + framerate);\n }\n };\n setInterval(updateFramerate, framerateUpdateInterval);\n /***\n @name rendered\n @methodOf Framerate#\n\n Call this method everytime you render.\n */\n return (self = {\n rendered: function() {\n var framerate, newTime, t;\n if (renderTime < 0) {\n return (renderTime = new Date().getTime());\n } else {\n newTime = new Date().getTime();\n t = newTime - renderTime;\n framerate = 1000 / t;\n framerates.push(framerate);\n while ((framerates.length > numFramerates)) {\n framerates.shift();\n }\n return (renderTime = newTime);\n }\n }\n });\n};;\nvar GameObject;\n/***\nThe default base class for all objects you can add to the engine.\n\nGameObjects fire events that you may bind listeners to. Event listeners\nmay be bound with <code>object.bind(eventName, callback)</code>\n\n@name GameObject\n@extends Core\n@constructor\n@instanceVariables age, active, created, destroyed, solid, includedModules, excludedModules\n*/\n/***\nTriggered when the object is created.\n@name create\n@methodOf GameObject#\n@event\n*/\n/***\nTriggered when object is destroyed. Use\nthe destroy event to add particle effects, play sounds, etc.\n\n@name destroy\n@methodOf GameObject#\n@event\n*/\n/***\nTriggered every update step.\n\n@name step\n@methodOf GameObject#\n@event\n*/\n/***\nTriggered when the object is removed from\nthe engine. Use the remove event to handle any clean up.\n\n@name remove\n@methodOf GameObject#\n@event\n*/\nGameObject = function(I) {\n var autobindEvents, defaultModules, modules, self;\n I || (I = {});\n /***\n @name I\n @memberOf GameObject#\n */\n $.reverseMerge(I, {\n age: 0,\n active: true,\n created: false,\n destroyed: false,\n solid: false,\n includedModules: [],\n excludedModules: []\n });\n self = Core(I).extend({\n /***\n Update the game object. This is generally called by the engine.\n\n @name update\n @methodOf GameObject#\n */\n update: function() {\n if (I.active) {\n self.trigger('step');\n I.age += 1;\n }\n return I.active;\n },\n draw: function(canvas) {\n return I.transform ? canvas.withTransform(I.transform, function(canvas) {\n return self.trigger('draw', canvas);\n }) : canvas.withTransform(Matrix.translation(I.x, I.y), function(canvas) {\n return self.trigger('draw', canvas);\n });\n },\n /***\n Destroys the object and triggers the destroyed callback.\n\n @name destroy\n @methodOf GameObject#\n */\n destroy: function() {\n if (!(I.destroyed)) {\n self.trigger('destroy');\n }\n I.destroyed = true;\n return (I.active = false);\n }\n });\n defaultModules = [Bindable, Bounded, Drawable, Durable, Movable];\n modules = defaultModules.concat(I.includedModules.invoke('constantize'));\n modules = modules.without(I.excludedModules.invoke('constantize'));\n modules.each(function(Module) {\n return self.include(Module);\n });\n self.attrAccessor(\"solid\");\n autobindEvents = ['create', 'destroy', 'step'];\n autobindEvents.each(function(eventName) {\n var event;\n return (event = I[eventName]) ? (typeof event === \"function\" ? self.bind(eventName, event) : self.bind(eventName, eval(\"(function() {\" + (event) + \"})\"))) : null;\n });\n if (!(I.created)) {\n self.trigger('create');\n }\n I.created = true;\n return self;\n};\n/***\nConstruct an object instance from the given entity data.\n@name construct\n@memberOf GameObject\n@param {Object} entityData\n*/\nGameObject.construct = function(entityData) {\n return entityData[\"class\"] ? entityData[\"class\"].constantize()(entityData) : GameObject(entityData);\n};;\nvar GameUtil;\nGameUtil = {\n readImageData: function(data, callback) {\n var ctx, getPixelColor, img;\n getPixelColor = function(imageData, x, y) {\n var index;\n index = (x + y * imageData.width) * 4;\n return [imageData.data[index + 0], imageData.data[index + 1], imageData.data[index + 2]].invoke(\"toColorPart\").join('');\n };\n ctx = document.createElement('canvas').getContext('2d');\n img = new Image();\n img.onload = function() {\n var colors, imageData;\n ctx.drawImage(img, 0, 0);\n imageData = ctx.getImageData(0, 0, img.width, img.height);\n colors = [];\n img.height.times(function(y) {\n return img.width.times(function(x) {\n return colors.push(getPixelColor(imageData, x, y));\n });\n });\n return callback({\n colors: colors,\n width: img.width,\n height: img.height\n });\n };\n return (img.src = data);\n }\n};;\nvar Heavy;\nHeavy = function(I) {\n I || (I = {});\n $.reverseMerge(I, {\n gravity: 0.2,\n maxSpeed: 5\n });\n return {\n before: {\n update: function() {\n return (I.velocity = I.velocity.add(Point(0, I.gravity)));\n }\n }\n };\n};;\nvar Hittable;\nHittable = function(I, self) {\n I || (I = {});\n $.reverseMerge(I, {\n health: 25\n });\n return {\n hit: function() {\n I.health--;\n if (I.health < 0) {\n return self.destroy();\n }\n }\n };\n};;\nvar Movable;\nMovable = function(I) {\n $.reverseMerge(I, {\n acceleration: Point(0, 0),\n velocity: Point(0, 0)\n });\n I.acceleration = Point(I.acceleration.x, I.acceleration.y);\n I.velocity = Point(I.velocity.x, I.velocity.y);\n return {\n before: {\n update: function() {\n var _ref, currentSpeed;\n I.velocity = I.velocity.add(I.acceleration);\n if (typeof (_ref = I.maxSpeed) !== \"undefined\" && _ref !== null) {\n currentSpeed = I.velocity.magnitude();\n if (currentSpeed > I.maxSpeed) {\n I.velocity = I.velocity.scale(I.maxSpeed / currentSpeed);\n }\n }\n I.x += I.velocity.x;\n return I.y += I.velocity.y;\n }\n }\n };\n};;\n(function($) {\n var SCALE, _ref, b2Body, b2BodyDef, b2CircleShape, b2Fixture, b2FixtureDef, b2MassData, b2PolygonShape, b2Vec2, b2World;\n SCALE = 0.1;\n _ref = Box2D.Common.Math;\n b2Vec2 = _ref.b2Vec2;\n _ref = Box2D.Dynamics;\n b2BodyDef = _ref.b2BodyDef;\n b2Body = _ref.b2Body;\n b2FixtureDef = _ref.b2FixtureDef;\n b2Fixture = _ref.b2Fixture;\n b2World = _ref.b2World;\n _ref = Box2D.Collision.Shapes;\n b2PolygonShape = _ref.b2PolygonShape;\n b2CircleShape = _ref.b2CircleShape;\n b2MassData = _ref.b2MassData;\n /***\n The Physical module, when included in a GameObject, gives the object a\n physical presence in the Box2D physics simulation of the engine.\n\n @name Physical\n @module\n @constructor\n\n @param {Object} I Instance variables\n @param {Object} self Reference to including object\n */\n return (window.Physical = function(I, self) {\n var body, bodyDef, center, fixDef;\n $.reverseMerge(I, {\n density: 1.0,\n dynamic: false,\n friction: 0.1,\n restitution: 0.5,\n rotatable: false\n });\n fixDef = new b2FixtureDef();\n fixDef.density = I.density;\n fixDef.friction = I.friction;\n fixDef.restitution = I.restitution;\n fixDef.shape = new b2PolygonShape();\n fixDef.shape.SetAsBox(I.width / 2 * SCALE, I.height / 2 * SCALE);\n bodyDef = new b2BodyDef();\n if (I.dynamic) {\n bodyDef.type = b2Body.b2_dynamicBody;\n bodyDef.fixedRotation = !I.rotatable;\n } else {\n bodyDef.type = b2Body.b2_staticBody;\n }\n center = self.center().scale(SCALE);\n bodyDef.position = new b2Vec2(center.x, center.y);\n if (I.rotation) {\n bodyDef.angle = I.rotation;\n }\n body = I.world.CreateBody(bodyDef);\n body.CreateFixture(fixDef);\n body.SetUserData(self);\n self.bind(\"step\", function() {\n I.x = (body.GetPosition().x / SCALE) - (I.width / 2);\n I.y = (body.GetPosition().y / SCALE) - (I.height / 2);\n return (I.rotation = body.GetAngle());\n });\n return {\n applyImpulse: function(vector) {\n return body.ApplyImpulse(new b2Vec2(vector.x, vector.y), body.GetPosition());\n },\n body: function() {\n return body;\n }\n };\n });\n})(jQuery);;\nvar Rotatable;\nRotatable = function(I) {\n I || (I = {});\n $.reverseMerge(I, {\n rotation: 0,\n rotationalVelocity: 0\n });\n return {\n before: {\n update: function() {\n return I.rotation += I.rotationalVelocity;\n }\n }\n };\n};;\nvar SpeechBox;\nSpeechBox = function(I) {\n var addLine, chars, counter, grad, line, self, stringLine, text;\n I || (I = {});\n $.reverseMerge(I, {\n backgroundColor: 'rgb(175, 175, 175)',\n strokeColor: '#000',\n strokeWidth: 5,\n textColor: 'rgb(0, 0, 0)',\n textDelay: 1,\n gradient: true,\n height: 50,\n padding: 15,\n width: 400,\n text: \"This is a test blah blah blh blah This is a test blah blah blah blah This is a test blah blah blah blah This is a test blah blah blah blah\",\n x: 50,\n y: 40\n });\n chars = I.text.split(\"\");\n text = [[]];\n line = 1;\n addLine = function() {\n line++;\n return (text[line - 1] = []);\n };\n stringLine = function(line) {\n return text[line - 1].join(\"\");\n };\n counter = 0;\n if (I.gradient) {\n grad = Game.canvas.createLinearGradient(0, 0, 0, 3 * I.height);\n grad.addColorStop(0, I.backgroundColor);\n grad.addColorStop(1, 'rgb(0, 0, 0)');\n }\n return (self = {\n draw: function(canvas) {\n if (I.gradient) {\n canvas.context().fillStyle = grad;\n } else {\n canvas.fillColor(I.backgroundColor);\n }\n canvas.strokeColor(I.strokeColor);\n canvas.fillRoundRect(I.x + I.strokeWidth / 2, I.y + I.strokeWidth / 2, I.width - I.strokeWidth, I.height, 20, I.strokeWidth);\n canvas.fillColor(I.textColor);\n return (line).times(function(i) {\n return canvas.fillText(stringLine(i + 1), I.x + I.padding, I.y + (15 * (i + 1)));\n });\n },\n update: function() {\n var currentChar;\n counter = (counter + 1) % I.textDelay;\n if (counter <= 0) {\n currentChar = chars.shift();\n text[line - 1].push(currentChar);\n return Game.canvas.measureText(stringLine(line)) > I.width - I.padding * 2 ? addLine() : null;\n }\n }\n });\n};;\n/***\n@name Sprite\n@constructor\n*/\n(function() {\n var LoaderProxy, Sprite, fromPixieId, pixieSpriteImagePath;\n LoaderProxy = function() {\n return {\n draw: $.noop,\n fill: $.noop,\n frame: $.noop,\n update: $.noop,\n width: null,\n height: null\n };\n };\n Sprite = function(image, sourceX, sourceY, width, height) {\n sourceX || (sourceX = 0);\n sourceY || (sourceY = 0);\n width || (width = image.width);\n height || (height = image.height);\n return {\n /***\n Draw this sprite on the given canvas at the given position.\n\n @name draw\n @methodOf Sprite#\n\n @param canvas\n @param x\n @param y\n */\n draw: function(canvas, x, y) {\n return canvas.drawImage(image, sourceX, sourceY, width, height, x, y, width, height);\n },\n fill: function(canvas, x, y, width, height, repeat) {\n var pattern;\n repeat || (repeat = \"repeat\");\n pattern = canvas.createPattern(image, repeat);\n canvas.fillColor(pattern);\n return canvas.fillRect(x, y, width, height);\n },\n width: width,\n height: height\n };\n };\n Sprite.load = function(url, loadedCallback) {\n var img, proxy;\n img = new Image();\n proxy = LoaderProxy();\n img.onload = function() {\n var tile;\n tile = Sprite(this);\n $.extend(proxy, tile);\n return loadedCallback ? loadedCallback(proxy) : null;\n };\n img.src = url;\n return proxy;\n };\n pixieSpriteImagePath = \"http://pixieengine.com/s3/sprites/\";\n fromPixieId = function(id, callback) {\n return Sprite.load(pixieSpriteImagePath + id + \"/original.png\", callback);\n };\n window.Sprite = function(name, callback) {\n var id;\n if (App.Sprites) {\n id = App.Sprites[name];\n return id ? fromPixieId(id, callback) : warn(\"Could not find sprite named: '\" + name + \"' in App.\");\n } else {\n return window.Sprite.fromURL(name, callback);\n }\n };\n /***\n A sprite that draws nothing.\n\n @name EMPTY\n @fieldOf Sprite\n @constant\n @type Sprite\n */\n /***\n A sprite that draws nothing.\n\n @name NONE\n @fieldOf Sprite\n @constant\n @type Sprite\n */\n window.Sprite.EMPTY = (window.Sprite.NONE = LoaderProxy());\n /***\n Loads a sprite with the given pixie id.\n\n @name fromPixieId\n @methodOf Sprite\n\n @param id\n @param [callback]\n\n @type Sprite\n */\n window.Sprite.fromPixieId = fromPixieId;\n /***\n Loads a sprite from a given url.\n\n @name fromURL\n @methodOf Sprite\n\n @param {String} url\n @param [callback]\n\n @type Sprite\n */\n window.Sprite.fromURL = Sprite.load;\n /***\n Loads a sprite with the given name.\n\n @name loadByName\n @methodOf Sprite\n\n @param {String} name\n @param [callback]\n\n @type Sprite\n */\n return (window.Sprite.loadByName = function(name, callback) {\n var url;\n url = (\"\" + (BASE_URL) + \"/images/\" + (name) + \".png\");\n return Sprite.load(url, callback);\n });\n})();;\n(function() {\n var Map, fromPixieId, loadByName;\n Map = function(data, entityCallback) {\n var loadEntities, spriteLookup, tileHeight, tileWidth;\n tileHeight = data.tileHeight;\n tileWidth = data.tileWidth;\n spriteLookup = {};\n data.tileset.each(function(tileData, i) {\n return (spriteLookup[i] = Sprite.fromURL(tileData.src));\n });\n loadEntities = function() {\n if (!(entityCallback)) {\n return null;\n }\n return data.layers.each(function(layer, layerIndex) {\n if (!(layer.name.match(/entities/i))) {\n return null;\n }\n return layer.tiles.each(function(row, y) {\n return row.each(function(tileIndex, x) {\n var entityData;\n if (spriteLookup[tileIndex]) {\n entityData = $.extend({\n layer: layerIndex,\n sprite: spriteLookup[tileIndex],\n tileIndex: tileIndex,\n x: x * tileWidth,\n y: y * tileHeight\n }, data.tileset[tileIndex] == null ? undefined : data.tileset[tileIndex].properties);\n return entityCallback(entityData);\n }\n });\n });\n });\n };\n loadEntities();\n return $.extend(data, {\n draw: function(canvas, x, y) {\n return canvas.withTransform(Matrix.translation(x, y), function() {\n return data.layers.each(function(layer) {\n if (layer.name.match(/entities/i)) {\n return null;\n }\n return layer.tiles.each(function(row, y) {\n return row.each(function(tileIndex, x) {\n var sprite;\n return (sprite = spriteLookup[tileIndex]) ? sprite.draw(canvas, x * tileWidth, y * tileHeight) : null;\n });\n });\n });\n });\n }\n });\n };\n window.Tilemap = function(name, callback, entityCallback) {\n return fromPixieId(App.Tilemaps[name], callback, entityCallback);\n };\n fromPixieId = function(id, callback, entityCallback) {\n var proxy, url;\n url = (\"http://pixieengine.com/s3/tilemaps/\" + (id) + \"/data.json\");\n proxy = {\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Map(data, entityCallback));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n loadByName = function(name, callback, entityCallback) {\n var proxy, url;\n url = (\"\" + (BASE_URL) + \"/data/\" + (name) + \".tilemap\");\n proxy = {\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Map(data, entityCallback));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n window.Tilemap.fromPixieId = fromPixieId;\n return (window.Tilemap.load = function(options) {\n if (options.pixieId) {\n return fromPixieId(options.pixieId, options.complete, options.entity);\n } else if (options.name) {\n return loadByName(options.name, options.complete, options.entity);\n }\n });\n})();;\n;$(function(){ undefined });;\nvar Bomb;\nBomb = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 16,\n height: 16\n });\n I.sprite = Sprite.loadByName(\"bomb\");\n self = GameObject(I);\n self.bind(\"step\", function() {\n if (I.age === 55) {\n Sound.play(\"explosion\");\n }\n return I.age >= 60 ? self.destroy() : null;\n });\n self.bind(\"destroy\", function() {\n return engine.find(\"BombDoor\").select(function(door) {\n return Collision.rectangular(self.bounds(), door.bounds());\n }).each(function(door) {\n return door.open();\n });\n });\n return self;\n};;\nvar BombDoor;\nBombDoor = function(I) {\n var openSprite, self;\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n solid: true\n });\n openSprite = Sprite.loadByName(\"cave_small\");\n self = GameObject(I).extend({\n open: function() {\n I.solid = false;\n I.sprite = openSprite;\n return Sound.play(\"secret\");\n }\n });\n self.bind(\"step\", function() {\n var player;\n if (I.cat) {\n player = engine.find(\"Cat\").first();\n } else {\n player = engine.find(\"Player\").first();\n }\n if (player && Collision.rectangular(self.bounds(), player.collisionBounds())) {\n engine.loadMap(I.destination, function() {\n player.I.location = I.destination;\n engine.add(player.I);\n return I.cat && player.I.playerData.location === I.destination ? engine.add(player.I.playerData) : null;\n });\n if (I.autoPosition) {\n if (I.x === 0) {\n player.I.x = 416;\n } else if (I.x === 448) {\n player.I.x = 32;\n }\n if (I.y === 0) {\n player.I.y = 256;\n } else if (I.y === 288) {\n player.I.y = 32;\n }\n }\n if (I.destinationPosition) {\n player.I.x = I.destinationPosition.x;\n return (player.I.y = I.destinationPosition.y);\n }\n }\n });\n return self;\n};;\nvar Cat;\nCat = function(I) {\n var carriedItem, collisionMargin, facing, mewDown, pickupCooldown, pickupItem, pickupSprite, self, walkCycle, walkSprites;\n $.reverseMerge(I, {\n name: \"kitten\",\n width: 16,\n height: 16,\n speed: 2,\n excludedModules: [\"Movable\"],\n items: {},\n state: {}\n });\n if (window.hasMouse) {\n I.items.mouse = true;\n }\n collisionMargin = {\n x: 1,\n y: 1\n };\n facing = Point(0, 0);\n walkCycle = 0;\n mewDown = 0;\n carriedItem = null;\n pickupItem = null;\n pickupCooldown = 0;\n pickupSprite = Sprite.loadByName(\"cat_get\");\n I.sprite = Sprite.loadByName(\"cat\");\n I.mouseCooldown = 0;\n walkSprites = {\n up: [Sprite.loadByName(\"cat_walk_up0\"), Sprite.loadByName(\"cat_walk_up1\")],\n right: [Sprite.loadByName(\"cat_walk_right0\"), Sprite.loadByName(\"cat_walk_right1\")],\n down: [Sprite.loadByName(\"cat_walk_down0\"), Sprite.loadByName(\"cat_walk_down1\")],\n left: [Sprite.loadByName(\"cat_walk_left0\"), Sprite.loadByName(\"cat_walk_left1\")]\n };\n self = GameObject(I).extend({\n collisionBounds: function(xOffset, yOffset) {\n return {\n x: I.x + (xOffset || 0) + collisionMargin.x,\n y: I.y + (yOffset || 0) + collisionMargin.y,\n width: I.width - 2 * collisionMargin.x,\n height: I.height - 2 * collisionMargin.y\n };\n },\n pickup: function(item) {\n pickupCooldown = 45;\n pickupItem = item;\n I.items[item.I.name] = true;\n window.hasMouse = true;\n return Sound.play(\"fanfare\");\n }\n });\n self.bind(\"draw\", function(canvas) {\n return pickupCooldown && pickupItem ? pickupItem.I.sprite.draw(canvas, 6, -6) : null;\n });\n self.bind(\"step\", function() {\n var inStream, mouseBounds, movement, player, target;\n mewDown = mewDown.approach(0, 1);\n pickupCooldown = pickupCooldown.approach(0, 1);\n I.mouseCooldown = I.mouseCooldown.approach(0, 1);\n if (I.state.mouse) {\n return null;\n }\n movement = Point(0, 0);\n inStream = false;\n if (I.age > 10 && keydown.space && !I.mouseCooldown) {\n player = engine.find(\"Player\").first();\n pickupItem = engine.find(\"Item\").select(function(item) {\n return Collision.rectangular(self.bounds(), item.bounds());\n }).first();\n if (player && Collision.rectangular(self.bounds(), player.collisionBounds())) {\n I.active = false;\n player.I.state.cat = false;\n player.pickup(self);\n } else if (pickupItem) {\n carriedItem = pickupItem;\n carriedItem.I.x = I.x;\n carriedItem.I.y = I.y;\n Sound.play(\"pickup\");\n } else if (I.items.mouse) {\n target = facing.scale(32).add(self.center()).subtract(Point(12, 12));\n mouseBounds = {\n x: target.x,\n y: target.y,\n width: 12,\n height: 12\n };\n if (!(engine.collides(mouseBounds))) {\n I.state.mouse = true;\n I.items.mouse = false;\n engine.add({\n \"class\": \"MousePlayer\",\n x: target.x,\n y: target.y\n });\n }\n } else {\n if (!(mewDown)) {\n Sound.play(\"mew\");\n mewDown += 60;\n }\n }\n }\n engine.find(\"Stream\").select(function(tile) {\n return Collision.rectangular({\n x: I.x + 8,\n y: I.y + 8,\n width: 1,\n height: 1\n }, tile.bounds());\n }).each(function(stream) {\n inStream = true;\n return (movement = movement.add(stream.I.flow));\n });\n if (inStream) {\n if (!(mewDown)) {\n Sound.play(\"mew\");\n mewDown += 30;\n }\n if (player = engine.find(\"Player\").first()) {\n player.I.state.cat = false;\n }\n } else if (pickupCooldown) {\n I.sprite = pickupSprite;\n } else {\n if (keydown.left) {\n movement = movement.add(Point(-1, 0));\n I.sprite = walkSprites.left.wrap((walkCycle / 4).floor());\n }\n if (keydown.right) {\n movement = movement.add(Point(1, 0));\n I.sprite = walkSprites.right.wrap((walkCycle / 4).floor());\n }\n if (keydown.up) {\n movement = movement.add(Point(0, -1));\n I.sprite = walkSprites.up.wrap((walkCycle / 4).floor());\n }\n if (keydown.down) {\n movement = movement.add(Point(0, 1));\n I.sprite = walkSprites.down.wrap((walkCycle / 4).floor());\n }\n }\n if (movement.equal(Point(0, 0))) {\n I.velocity = movement;\n } else {\n walkCycle += 1;\n if (!(inStream)) {\n movement = movement.norm().scale(I.speed);\n }\n I.velocity = movement;\n I.velocity.x.abs().times(function() {\n return !engine.collides(self.collisionBounds(I.velocity.x.sign(), 0), self) ? I.x += I.velocity.x.sign() : (I.velocity.x = 0);\n });\n I.velocity.y.abs().times(function() {\n return !engine.collides(self.collisionBounds(0, I.velocity.y.sign()), self) ? I.y += I.velocity.y.sign() : (I.velocity.y = 0);\n });\n if (carriedItem) {\n carriedItem.I.x = I.x;\n carriedItem.I.y = I.y;\n }\n }\n I.x = I.x.clamp(0, 480 - I.width);\n return (I.y = I.y.clamp(0, 320 - I.height));\n });\n return self;\n};;\nvar Door;\nDoor = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 32,\n height: 32\n });\n if (!(I.keepSprite)) {\n I.sprite = Sprite.NONE;\n }\n self = GameObject(I);\n self.bind(\"step\", function() {\n var player;\n if (I.cat) {\n player = engine.find(\"Cat\").first();\n if (engine.find(\"MousePlayer\").first()) {\n return null;\n }\n } else if (I.mouse) {\n player = engine.find(\"MousePlayer\").first();\n } else {\n player = engine.find(\"Player\").first();\n if (engine.find(\"Cat\").first()) {\n return null;\n }\n }\n if (player && Collision.rectangular(self.bounds(), player.collisionBounds())) {\n engine.loadMap(I.destination, function() {\n player.I.location = I.destination;\n engine.add(player.I);\n return I.cat && player.I.playerData.location === I.destination ? engine.add(player.I.playerData) : null;\n });\n if (I.autoPosition) {\n if (I.x === 0) {\n player.I.x = 416;\n } else if (I.x === 448) {\n player.I.x = 32;\n }\n if (I.y === 0) {\n player.I.y = 256;\n } else if (I.y === 288) {\n player.I.y = 32;\n }\n }\n if (I.destinationPosition) {\n player.I.x = I.destinationPosition.x;\n return (player.I.y = I.destinationPosition.y);\n }\n }\n });\n return self;\n};;\nvar Drawable;\n/**\nThe Drawable module is used to provide a simple draw method to the including\nobject.\n\nBinds a default draw listener to draw a rectangle or a sprite, if one exists.\n\nBinds a step listener to update the transform of the object.\n\nAutoloads the sprite specified in I.spriteName, if any.\n\n@name Drawable\n@module\n@constructor\n\n@param {Object} I Instance variables\n@param {Object} self Reference to including object\n*/\nDrawable = function(I, self) {\n I || (I = {});\n $.reverseMerge(I, {\n color: \"#196\",\n spriteName: null\n });\n if (I.spriteName) {\n I.sprite = Sprite.loadByName(I.spriteName, function(sprite) {\n I.width = sprite.width;\n return (I.height = sprite.height);\n });\n } else if (I.spriteURL) {\n I.sprite = Sprite.fromURL(I.spriteURL, function(sprite) {\n I.width = sprite.width;\n return (I.height = sprite.height);\n });\n }\n self.bind('step', function() {\n var center;\n center = self.center();\n return I.rotation ? (I.transform = Matrix.translation(center.x, center.y).concat(Matrix.rotation(I.rotation)).concat(Matrix.translation(-I.width / 2, -I.height / 2))) : (I.transform = Matrix.translation(I.x, I.y));\n });\n self.bind('draw', function(canvas) {\n if (I.sprite) {\n return I.sprite.draw(canvas, 0, 0);\n } else {\n canvas.fillColor(I.color);\n return canvas.fillRect(0, 0, I.width, I.height);\n }\n });\n return {};\n};;\nvar Drawbridge;\nDrawbridge = function(I) {\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n solid: true\n });\n I.sprite = Sprite.NONE;\n if (leverTriggered(\"bridgeLever\")) {\n I.sprite = Sprite.loadByName(\"wood_floor\");\n I.solid = false;\n }\n return GameObject(I);\n};;\n/***\nThe <code>Tilemap</code> module provides a way to load tilemaps in the engine.\n\n@name Tilemap\n@fieldOf Engine\n@module\n\n@param {Object} I Instance variables\n@param {Object} self Reference to the engine\n*/\nEngine.Tilemap = function(I, self) {\n var clearObjects, map, updating;\n map = null;\n updating = false;\n clearObjects = false;\n self.bind(\"preDraw\", function(canvas) {\n return (typeof map === \"undefined\" || map === null) ? undefined : map.draw(canvas);\n });\n self.bind(\"update\", function() {\n return (updating = true);\n });\n self.bind(\"afterUpdate\", function() {\n updating = false;\n if (clearObjects) {\n I.objects.clear();\n return (clearObjects = false);\n }\n });\n return {\n loadMap: function(name, complete) {\n clearObjects = updating;\n return (map = Tilemap.load({\n name: name,\n complete: complete,\n entity: self.add\n }));\n }\n };\n};;\nvar Gate;\nGate = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n solid: true\n });\n if (leverTriggered(I.lever)) {\n I.sprite = Sprite.NONE;\n I.solid = false;\n }\n self = GameObject(I);\n return self;\n};;\nvar Item;\nItem = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 16,\n height: 16\n });\n I.x += 8;\n I.y += 8;\n if (I.cat) {\n I.x += 2;\n }\n self = GameObject(I);\n self.bind(\"step\", function() {\n var player;\n if (I.cat) {\n player = engine.find(\"Cat\").first();\n } else {\n player = engine.find(\"Player\").first();\n }\n if (!(player)) {\n return null;\n }\n if (player.I.items[I.name]) {\n I.active = false;\n }\n if (Collision.rectangular(self.bounds(), player.collisionBounds())) {\n if (I.active) {\n player.pickup(self);\n return (I.active = false);\n }\n }\n });\n return self;\n};;\nvar Lava;\nLava = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n solid: true\n });\n self = GameObject(I).extend({\n draw: function(canvas) {\n var offsetX, offsetY, source;\n offsetX = (-I.age / 7).floor().mod(I.width);\n offsetY = (-I.age / 16).floor().mod(I.height);\n source = Lava.fillSource.element();\n return canvas.drawImage(source, offsetX, offsetY, I.width, I.height, I.x, I.y, I.width, I.height);\n }\n });\n if (!(Lava.fillSource)) {\n Lava.fillSource = $(\"<canvas width='128' height='128'></canvas>\").powerCanvas();\n Sprite.loadByName(\"lava\", function(lavaSprite) {\n return lavaSprite.fill(Lava.fillSource, 0, 0, 128, 128);\n });\n }\n return self;\n};;\nvar Lever;\nLever = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n triggered: false\n });\n if (leverTriggered(I.id)) {\n I.sprite = Sprite.loadByName(\"lever_triggered\");\n }\n self = GameObject(I);\n self.bind(\"step\", function() {\n var player;\n if (!(I.triggered)) {\n player = engine.find(\"Cat\").first();\n if (player && Collision.rectangular(self.bounds(), player.collisionBounds())) {\n I.triggered = true;\n triggerLever(I.id);\n I.sprite = Sprite.loadByName(\"lever_triggered\");\n return Sound.play(\"trigger\");\n }\n }\n });\n return self;\n};;\nvar MousePlayer;\nMousePlayer = function(I) {\n var collisionMargin, cooldown, self;\n $.reverseMerge(I, {\n name: \"mouse\",\n width: 12,\n height: 12,\n speed: 1,\n excludedModules: [\"Movable\"]\n });\n cooldown = 0;\n collisionMargin = {\n x: 2,\n y: 1\n };\n I.sprite = Sprite.loadByName(\"mouse\");\n self = GameObject(I).extend({\n collisionBounds: function(xOffset, yOffset) {\n return {\n x: I.x + (xOffset || 0) + collisionMargin.x,\n y: I.y + (yOffset || 0) + collisionMargin.y,\n width: I.width - 2 * collisionMargin.x,\n height: I.height - 2 * collisionMargin.y\n };\n }\n });\n self.bind(\"step\", function() {\n var cat, movement;\n movement = Point(0, 0);\n cooldown = cooldown.approach(0, 1);\n if (I.age > 10 && keydown.space) {\n cat = engine.find(\"Cat\").first();\n if (cat && Collision.rectangular(self.bounds(), cat.bounds())) {\n I.active = false;\n cat.I.state.mouse = false;\n cat.pickup(self);\n cat.I.mouseCooldown = 30;\n } else {\n if (!(cooldown)) {\n Sound.play(\"squeak\");\n cooldown += 30;\n }\n }\n }\n if (keydown.left) {\n movement = movement.add(Point(-1, 0));\n }\n if (keydown.right) {\n movement = movement.add(Point(1, 0));\n }\n if (keydown.up) {\n movement = movement.add(Point(0, -1));\n }\n if (keydown.down) {\n movement = movement.add(Point(0, 1));\n }\n if (movement.equal(Point(0, 0))) {\n I.velocity = movement;\n } else {\n movement = movement.norm().scale(I.speed);\n I.velocity = movement;\n I.velocity.x.abs().times(function() {\n return !engine.collides(self.collisionBounds(I.velocity.x.sign(), 0), self) ? I.x += I.velocity.x.sign() : (I.velocity.x = 0);\n });\n I.velocity.y.abs().times(function() {\n return !engine.collides(self.collisionBounds(0, I.velocity.y.sign()), self) ? I.y += I.velocity.y.sign() : (I.velocity.y = 0);\n });\n }\n I.x = I.x.clamp(0, 480 - I.width);\n return (I.y = I.y.clamp(0, 320 - I.height));\n });\n return self;\n};;\nvar Player;\nPlayer = function(I) {\n var bombCooldown, collisionMargin, facing, pickupItem, pickupSprite, self, walkCycle, walkSprites;\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n x: 160,\n y: 160,\n state: {},\n speed: 4,\n items: {},\n excludedModules: [\"Movable\"]\n });\n I.sprite = Sprite.loadByName(\"player\");\n walkSprites = {\n up: [Sprite.loadByName(\"walk_up0\"), Sprite.loadByName(\"walk_up1\")],\n right: [Sprite.loadByName(\"walk_right0\"), Sprite.loadByName(\"walk_right1\")],\n down: [Sprite.loadByName(\"walk_down0\"), Sprite.loadByName(\"walk_down1\")],\n left: [Sprite.loadByName(\"walk_left0\"), Sprite.loadByName(\"walk_left1\")]\n };\n pickupSprite = Sprite.loadByName(\"player_get\");\n bombCooldown = 0;\n pickupItem = null;\n self = GameObject(I).extend({\n collisionBounds: function(xOffset, yOffset) {\n return {\n x: I.x + (xOffset || 0) + collisionMargin.x,\n y: I.y + (yOffset || 0) + collisionMargin.y,\n width: I.width - 2 * collisionMargin.x,\n height: I.height - 2 * collisionMargin.y\n };\n },\n pickup: function(item) {\n I.state.pickup = 45;\n pickupItem = item;\n I.items[item.I.name] = true;\n if (item.I.message) {\n engine.add({\n \"class\": \"Text\",\n duration: 150,\n message: item.I.message,\n y: 32\n });\n }\n return Sound.play(\"fanfare\");\n }\n });\n walkCycle = 0;\n facing = Point(0, 0);\n collisionMargin = {\n x: 2,\n y: 2\n };\n self.bind(\"draw\", function(canvas) {\n return I.state.pickup && pickupItem ? pickupItem.I.sprite.draw(canvas, 8, -8) : null;\n });\n self.bind(\"step\", function() {\n var catBounds, movement, target;\n bombCooldown = bombCooldown.approach(0, 1);\n movement = Point(0, 0);\n if (I.state.pickup) {\n I.state.pickup -= 1;\n I.sprite = pickupSprite;\n } else if (I.state.cat) {\n\n } else {\n if (keydown.left) {\n movement = movement.add(Point(-1, 0));\n I.sprite = walkSprites.left.wrap((walkCycle / 4).floor());\n }\n if (keydown.right) {\n movement = movement.add(Point(1, 0));\n I.sprite = walkSprites.right.wrap((walkCycle / 4).floor());\n }\n if (keydown.up) {\n movement = movement.add(Point(0, -1));\n I.sprite = walkSprites.up.wrap((walkCycle / 4).floor());\n }\n if (keydown.down) {\n movement = movement.add(Point(0, 1));\n I.sprite = walkSprites.down.wrap((walkCycle / 4).floor());\n }\n if (I.items.bomb && keydown[\"return\"] && !bombCooldown) {\n bombCooldown += 90;\n target = facing.scale(32).add(self.center()).subtract(Point(8, 8));\n engine.add({\n \"class\": \"Bomb\",\n x: target.x,\n y: target.y\n });\n }\n if (I.items.kitten && keydown.space) {\n target = facing.scale(32).add(self.center()).subtract(Point(8, 8));\n catBounds = {\n x: target.x,\n y: target.y,\n width: 16,\n height: 16\n };\n if (!(engine.collides(catBounds))) {\n I.state.cat = true;\n I.items.kitten = false;\n engine.add({\n \"class\": \"Cat\",\n playerData: I,\n x: target.x,\n y: target.y\n });\n }\n }\n }\n if (movement.equal(Point(0, 0))) {\n I.velocity = movement;\n } else {\n walkCycle += 1;\n facing = movement.norm();\n I.velocity = facing.scale(I.speed);\n I.velocity.x.abs().times(function() {\n return !engine.collides(self.collisionBounds(I.velocity.x.sign(), 0), self) ? I.x += I.velocity.x.sign() : (I.velocity.x = 0);\n });\n I.velocity.y.abs().times(function() {\n return !engine.collides(self.collisionBounds(0, I.velocity.y.sign()), self) ? I.y += I.velocity.y.sign() : (I.velocity.y = 0);\n });\n }\n I.x = I.x.clamp(0, 480 - I.width);\n return (I.y = I.y.clamp(0, 320 - I.height));\n });\n return self;\n};;\n\nvar Sound = (function($) {\n // TODO: detecting audio with canPlay is f***ed\n // Hopefully get more robust later\n // audio.canPlayType(\"audio/ogg\") === \"maybe\" WTF?\n // http://ajaxian.com/archives/the-doctor-subscribes-html-5-audio-cross-browser-support\n var format = \".wav\";\n var soundPath = BASE_URL + \"/sounds/\";\n var sounds = {};\n\n function loadSoundChannel(name) {\n var sound = $('<audio />').get(0);\n sound.autobuffer = true;\n sound.preload = 'auto';\n sound.src = soundPath + name + format;\n\n return sound;\n }\n\n function Sound(id, maxChannels) {\n return {\n play: function() {\n Sound.play(id, maxChannels);\n },\n\n stop: function() {\n Sound.stop(id);\n }\n }\n }\n\n return $.extend(Sound, {\n play: function(id, maxChannels) {\n // TODO: Too many channels crash Chrome!!!1\n maxChannels = maxChannels || 4;\n\n if(!sounds[id]) {\n sounds[id] = [loadSoundChannel(id)];\n }\n\n var freeChannels = $.grep(sounds[id], function(sound) {\n return sound.currentTime == sound.duration || sound.currentTime == 0\n });\n\n if(freeChannels[0]) {\n try {\n freeChannels[0].currentTime = 0;\n } catch(e) {\n }\n freeChannels[0].play();\n } else {\n if(!maxChannels || sounds[id].length < maxChannels) {\n var sound = loadSoundChannel(id);\n sounds[id].push(sound);\n sound.play();\n }\n }\n },\n\n playFromUrl: function(url) {\n var sound = $('<audio />').get(0);\n sound.src = url;\n\n sound.play();\n\n return sound;\n },\n\n stop: function(id) {\n if(sounds[id]) {\n sounds[id].stop();\n }\n }\n });\n}(jQuery));\n;;\nvar Stream;\nStream = function(I) {\n var self;\n $.reverseMerge(I, {\n width: 32,\n height: 32\n });\n self = GameObject(I).extend({\n draw: function(canvas) {\n var offsetX, offsetY, source;\n offsetY = (-I.flow.y * I.age).floor().mod(32);\n offsetX = (-I.flow.x * I.age).floor().mod(32);\n source = Stream.fillSource.element();\n return canvas.drawImage(source, offsetX, offsetY, I.width, I.height, I.x, I.y, I.width, I.height);\n }\n });\n if (!(Stream.fillSource)) {\n Stream.fillSource = $(\"<canvas width='128' height='128'></canvas>\").powerCanvas();\n Sprite.loadByName(\"water0\", function(waterSprite) {\n return waterSprite.fill(Stream.fillSource, 0, 0, 128, 128);\n });\n }\n return self;\n};;\nvar Text;\nText = function(I) {\n $.reverseMerge(I, {\n width: 32,\n height: 32\n });\n return GameObject(I).extend({\n draw: function(canvas) {\n canvas.font(\"bold 11pt consolas, 'Courier New', 'andale mono', 'lucida console', monospace\");\n canvas.fillColor(\"#FFF\");\n return canvas.centerText(I.message, I.y);\n }\n });\n};;\n(function() {\n var Map, fromPixieId, loadByName;\n Map = function(data, entityCallback) {\n var loadEntities, spriteLookup, tileHeight, tileWidth;\n tileHeight = data.tileHeight;\n tileWidth = data.tileWidth;\n spriteLookup = {};\n data.tileset.each(function(tileData, i) {\n return (spriteLookup[i] = Sprite.fromURL(tileData.src));\n });\n loadEntities = function() {\n if (!(entityCallback)) {\n return null;\n }\n return data.layers.each(function(layer, layerIndex) {\n if (!(layer.name.match(/entities/i))) {\n return null;\n }\n return layer.tiles.each(function(row, y) {\n return row.each(function(tileIndex, x) {\n var entityData;\n if (spriteLookup[tileIndex]) {\n entityData = $.extend({\n layer: layerIndex,\n sprite: spriteLookup[tileIndex],\n tileIndex: tileIndex,\n x: x * tileWidth,\n y: y * tileHeight\n }, data.tileset[tileIndex] == null ? undefined : data.tileset[tileIndex].properties);\n return entityCallback(entityData);\n }\n });\n });\n });\n };\n loadEntities();\n return $.extend(data, {\n draw: function(canvas, x, y) {\n return canvas.withTransform(Matrix.translation(x, y), function() {\n return data.layers.each(function(layer) {\n if (layer.name.match(/entities/i)) {\n return null;\n }\n return layer.tiles.each(function(row, y) {\n return row.each(function(tileIndex, x) {\n var sprite;\n return (sprite = spriteLookup[tileIndex]) ? sprite.draw(canvas, x * tileWidth, y * tileHeight) : null;\n });\n });\n });\n });\n }\n });\n };\n window.Tilemap = function(name, callback, entityCallback) {\n return fromPixieId(App.Tilemaps[name], callback, entityCallback);\n };\n fromPixieId = function(id, callback, entityCallback) {\n var proxy, url;\n url = (\"http://pixieengine.com/s3/tilemaps/\" + (id) + \"/data.json\");\n proxy = {\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Map(data, entityCallback));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n loadByName = function(name, callback, entityCallback) {\n var proxy, url;\n url = (\"\" + (BASE_URL) + \"/data/\" + (name) + \".tilemap?\" + (new Date().getTime()));\n proxy = {\n draw: $.noop\n };\n $.getJSON(url, function(data) {\n $.extend(proxy, Map(data, entityCallback));\n return (typeof callback === \"function\" ? callback(proxy) : undefined);\n });\n return proxy;\n };\n window.Tilemap.fromPixieId = fromPixieId;\n return (window.Tilemap.load = function(options) {\n if (options.pixieId) {\n return fromPixieId(options.pixieId, options.complete, options.entity);\n } else if (options.name) {\n return loadByName(options.name, options.complete, options.entity);\n }\n });\n})();;\nvar Wall;\nWall = function(I) {\n $.reverseMerge(I, {\n width: 32,\n height: 32,\n solid: true\n });\n if (I.invisible) {\n I.sprite = Sprite.NONE;\n }\n return GameObject(I);\n};;\n;$(function(){ var leversTriggered;\nwindow.engine = Engine({\n canvas: $(\"canvas\").powerCanvas(),\n includedModules: \"Tilemap\"\n});\nengine.loadMap(\"start\", function() {\n return engine.add({\n \"class\": \"Player\",\n location: \"start\"\n });\n});\nengine.start();\nleversTriggered = {};\nwindow.triggerLever = function(name) {\n return (leversTriggered[name] = true);\n};\nwindow.leverTriggered = function(name) {\n return leversTriggered[name];\n};\nparent.gameControlData = {\n Movement: \"Arrow Keys\",\n \"Deploy/Return Cat\": \"Spacebar\",\n \"Place Bomb\": \"Enter\"\n}; });","docSelector":"#file_game_js","extension":"js","language":"javascript","hidden":false,"type":"text","size":896890,"mtime":1304293029},{"name":"images","files":[{"name":"brick_blue","contents":null,"docSelector":"#file_images_brick_blue_png","extension":"png","language":null,"hidden":false,"type":"image","size":196,"mtime":1304289053},{"name":"wood_floor","contents":null,"docSelector":"#file_images_wood_floor_png","extension":"png","language":null,"hidden":false,"type":"image","size":243,"mtime":1304273520},{"name":"water3","contents":null,"docSelector":"#file_images_water3_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"bed_right","contents":null,"docSelector":"#file_images_bed_right_png","extension":"png","language":null,"hidden":false,"type":"image","size":270,"mtime":1304273520},{"name":"cat_red_32","contents":null,"docSelector":"#file_images_cat_red_32_png","extension":"png","language":null,"hidden":false,"type":"image","size":613,"mtime":1304273520},{"name":"water14","contents":null,"docSelector":"#file_images_water14_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"lever","contents":null,"docSelector":"#file_images_lever_png","extension":"png","language":null,"hidden":false,"type":"image","size":322,"mtime":1304213960},{"name":"bed","contents":null,"docSelector":"#file_images_bed_png","extension":"png","language":null,"hidden":false,"type":"image","size":221,"mtime":1304273520},{"name":"water9","contents":null,"docSelector":"#file_images_water9_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"walk_left0","contents":null,"docSelector":"#file_images_walk_left0_png","extension":"png","language":null,"hidden":false,"type":"image","size":482,"mtime":1304195507},{"name":"water1","contents":null,"docSelector":"#file_images_water1_png","extension":"png","language":null,"hidden":false,"type":"image","size":233,"mtime":1304278513},{"name":"walk_right1","contents":null,"docSelector":"#file_images_walk_right1_png","extension":"png","language":null,"hidden":false,"type":"image","size":458,"mtime":1304196461},{"name":"lava","contents":null,"docSelector":"#file_images_lava_png","extension":"png","language":null,"hidden":false,"type":"image","size":352,"mtime":1304279588},{"name":"lever_triggered","contents":null,"docSelector":"#file_images_lever_triggered_png","extension":"png","language":null,"hidden":false,"type":"image","size":368,"mtime":1304213960},{"name":"mouse32","contents":null,"docSelector":"#file_images_mouse32_png","extension":"png","language":null,"hidden":false,"type":"image","size":294,"mtime":1304289053},{"name":"empty","contents":null,"docSelector":"#file_images_empty_png","extension":"png","language":null,"hidden":false,"type":"image","size":68,"mtime":1304147573},{"name":"water7","contents":null,"docSelector":"#file_images_water7_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"water13","contents":null,"docSelector":"#file_images_water13_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"water8","contents":null,"docSelector":"#file_images_water8_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"water4","contents":null,"docSelector":"#file_images_water4_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"water5","contents":null,"docSelector":"#file_images_water5_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"brick_green","contents":null,"docSelector":"#file_images_brick_green_png","extension":"png","language":null,"hidden":false,"type":"image","size":211,"mtime":1304191885},{"name":"walk_down1","contents":null,"docSelector":"#file_images_walk_down1_png","extension":"png","language":null,"hidden":false,"type":"image","size":498,"mtime":1304193384},{"name":"cat_walk_down1","contents":null,"docSelector":"#file_images_cat_walk_down1_png","extension":"png","language":null,"hidden":false,"type":"image","size":458,"mtime":1304206739},{"name":"fire","contents":null,"docSelector":"#file_images_fire_png","extension":"png","language":null,"hidden":false,"type":"image","size":560,"mtime":1304182712},{"name":"tree","contents":null,"docSelector":"#file_images_tree_png","extension":"png","language":null,"hidden":false,"type":"image","size":438,"mtime":1304273520},{"name":"dirt","contents":null,"docSelector":"#file_images_dirt_png","extension":"png","language":null,"hidden":false,"type":"image","size":206,"mtime":1304191885},{"name":"player_get","contents":null,"docSelector":"#file_images_player_get_png","extension":"png","language":null,"hidden":false,"type":"image","size":513,"mtime":1304146153},{"name":"walk_down0","contents":null,"docSelector":"#file_images_walk_down0_png","extension":"png","language":null,"hidden":false,"type":"image","size":501,"mtime":1304192448},{"name":"cat_red","contents":null,"docSelector":"#file_images_cat_red_png","extension":"png","language":null,"hidden":false,"type":"image","size":523,"mtime":1304273520},{"name":"walk_right0","contents":null,"docSelector":"#file_images_walk_right0_png","extension":"png","language":null,"hidden":false,"type":"image","size":494,"mtime":1304196461},{"name":"cave_small","contents":null,"docSelector":"#file_images_cave_small_png","extension":"png","language":null,"hidden":false,"type":"image","size":140,"mtime":1304213501},{"name":"walk_up0","contents":null,"docSelector":"#file_images_walk_up0_png","extension":"png","language":null,"hidden":false,"type":"image","size":409,"mtime":1304194450},{"name":"water11","contents":null,"docSelector":"#file_images_water11_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"cat_walk_right0","contents":null,"docSelector":"#file_images_cat_walk_right0_png","extension":"png","language":null,"hidden":false,"type":"image","size":502,"mtime":1304204797},{"name":"walk_left1","contents":null,"docSelector":"#file_images_walk_left1_png","extension":"png","language":null,"hidden":false,"type":"image","size":472,"mtime":1304196288},{"name":"water0","contents":null,"docSelector":"#file_images_water0_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"cat_walk_left0","contents":null,"docSelector":"#file_images_cat_walk_left0_png","extension":"png","language":null,"hidden":false,"type":"image","size":506,"mtime":1304207004},{"name":"water10","contents":null,"docSelector":"#file_images_water10_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"walk_up1","contents":null,"docSelector":"#file_images_walk_up1_png","extension":"png","language":null,"hidden":false,"type":"image","size":400,"mtime":1304194455},{"name":"player","contents":null,"docSelector":"#file_images_player_png","extension":"png","language":null,"hidden":false,"type":"image","size":532,"mtime":1304132280},{"name":"table","contents":null,"docSelector":"#file_images_table_png","extension":"png","language":null,"hidden":false,"type":"image","size":341,"mtime":1304273520},{"name":"cat_walk_up0","contents":null,"docSelector":"#file_images_cat_walk_up0_png","extension":"png","language":null,"hidden":false,"type":"image","size":386,"mtime":1304205425},{"name":"player_action","contents":null,"docSelector":"#file_images_player_action_png","extension":"png","language":null,"hidden":false,"type":"image","size":532,"mtime":1304134221},{"name":"cat","contents":null,"docSelector":"#file_images_cat_png","extension":"png","language":null,"hidden":false,"type":"image","size":520,"mtime":1304135224},{"name":"water2","contents":null,"docSelector":"#file_images_water2_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"cat_walk_left1","contents":null,"docSelector":"#file_images_cat_walk_left1_png","extension":"png","language":null,"hidden":false,"type":"image","size":502,"mtime":1304206998},{"name":"waterfall","contents":null,"docSelector":"#file_images_waterfall_png","extension":"png","language":null,"hidden":false,"type":"image","size":526,"mtime":1304213501},{"name":"water6","contents":null,"docSelector":"#file_images_water6_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"cat_walk_right1","contents":null,"docSelector":"#file_images_cat_walk_right1_png","extension":"png","language":null,"hidden":false,"type":"image","size":501,"mtime":1304204790},{"name":"cave","contents":null,"docSelector":"#file_images_cave_png","extension":"png","language":null,"hidden":false,"type":"image","size":133,"mtime":1304199935},{"name":"cat_get","contents":null,"docSelector":"#file_images_cat_get_png","extension":"png","language":null,"hidden":false,"type":"image","size":460,"mtime":1304289249},{"name":"door_light","contents":null,"docSelector":"#file_images_door_light_png","extension":"png","language":null,"hidden":false,"type":"image","size":296,"mtime":1304273520},{"name":"bomb","contents":null,"docSelector":"#file_images_bomb_png","extension":"png","language":null,"hidden":false,"type":"image","size":198,"mtime":1304227615},{"name":"cat_walk_up1","contents":null,"docSelector":"#file_images_cat_walk_up1_png","extension":"png","language":null,"hidden":false,"type":"image","size":369,"mtime":1304206207},{"name":"brick_red","contents":null,"docSelector":"#file_images_brick_red_png","extension":"png","language":null,"hidden":false,"type":"image","size":223,"mtime":1304182712},{"name":"cat_walk_down0","contents":null,"docSelector":"#file_images_cat_walk_down0_png","extension":"png","language":null,"hidden":false,"type":"image","size":499,"mtime":1304205871},{"name":"water12","contents":null,"docSelector":"#file_images_water12_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392},{"name":"mouse","contents":null,"docSelector":"#file_images_mouse_png","extension":"png","language":null,"hidden":false,"type":"image","size":280,"mtime":1304289053},{"name":"water15","contents":null,"docSelector":"#file_images_water15_png","extension":"png","language":null,"hidden":false,"type":"image","size":212,"mtime":1304277392}]},{"name":"sounds","files":[{"name":"explosion","contents":"ZgAAAAMAAACuR+E+BWoTPgAAAAB+5na+AAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAO9XLz6CfuI+V5QYPwAAAAAAAACAPwAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAKUAOj/sGyW+\n","docSelector":"#file_sounds_explosion_sfs","extension":"sfs","language":null,"hidden":false,"type":"sound","size":105,"mtime":1304280295},{"name":"fanfare","contents":null,"docSelector":"#file_sounds_fanfare_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":88800,"mtime":1304296562},{"name":"secret","contents":null,"docSelector":"#file_sounds_secret_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":95116,"mtime":1304296562},{"name":"pickup","contents":"ZgAAAAAAAAA9Ctc+CtejPgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAALgeBT6F6xE/bjazPgAAAAAASOE6Pylcj74K1yM9exSuPgAAAAC4\nHgW/AAAAAOF6FD9bAQw/\n","docSelector":"#file_sounds_pickup_sfs","extension":"sfs","language":null,"hidden":false,"type":"sound","size":105,"mtime":1304280252},{"name":"mew","contents":null,"docSelector":"#file_sounds_mew_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":175122,"mtime":1304211976},{"name":"trigger","contents":null,"docSelector":"#file_sounds_trigger_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":31624,"mtime":1304223380},{"name":"mew","contents":"ZgAAAAAAAAAzM7M+FK5HP83MTD6PwnW9CtcjvZRkpT7OgCo+AAAAAAAAAAAA\nAAAA7FE4PgAAAD+4HkU/AAAAAAAAAAAAAACAPwAAAABNwpY+AAAAAAAAAAAA\nAAAAAAAAAAAAAACPwnW9\n","docSelector":"#file_sounds_mew_sfs","extension":"sfs","language":null,"hidden":false,"type":"sound","size":105,"mtime":1304211968},{"name":"trigger","contents":"ZgAAAAMAAAAAAAA/FK7HPgAAAACuR2G+CtejvhDWAD4RzLM8SOE6P4/C9T4A\nAAAAAACAPrgeBT4pXI8+SOE6PwAK1yM+9ijcPgrXI70pXI89j8J1PT0KV78z\nMzM/PQpXPlK4Xj/hehS/\n","docSelector":"#file_sounds_trigger_sfs","extension":"sfs","language":null,"hidden":false,"type":"sound","size":105,"mtime":1304223369},{"name":"squeak","contents":null,"docSelector":"#file_sounds_squeak_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":47644,"mtime":1304291287},{"name":"pickup","contents":null,"docSelector":"#file_sounds_pickup_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":68424,"mtime":1304280259},{"name":"explosion","contents":null,"docSelector":"#file_sounds_explosion_wav","extension":"wav","language":null,"hidden":true,"type":"binary","size":45066,"mtime":1304280302},{"name":"squeak","contents":"ZgAAAAEAAAA9Ctc+AACAPwAAAACPwnU9zczMPQAAAAAAAAAAAAAAAAAAAAAA\nAAAAuB4FPgrXIzzXo/A+AAAAAAAAAAAAAACAPwAAAADNzMw9AAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAA\n","docSelector":"#file_sounds_squeak_sfs","extension":"sfs","language":null,"hidden":false,"type":"sound","size":105,"mtime":1304291280}]},{"name":"pixie","contents":"{\n \"author\": \"STRd6\",\n \"name\": \"Dangerous\",\n \"libs\": {\n \"gamelib.js\": \"https://github.com/STRd6/gamelib/raw/pixie/gamelib.js\"\n },\n \"directories\": {\n \"lib\": \"lib\",\n \"source\": \"src\",\n \"test\": \"test\"\n },\n \"width\": 480,\n \"height\": 320\n}\n\n","docSelector":"#file_pixie_json","extension":"json","language":"javascript","hidden":false,"type":"json","size":254,"mtime":1304131142}]}
Next
Show me how!