-
Notifications
You must be signed in to change notification settings - Fork 3
/
bundle.map
1 lines (1 loc) · 58.5 KB
/
bundle.map
1
{"version":3,"file":"bundle.js","sources":["/Users/michaelhayes/work/altr/node_modules/browserify/node_modules/browser-pack/_prelude.js","/Users/michaelhayes/work/altr/lib/index.js","/Users/michaelhayes/work/altr/lib/tags/placeholder.js","/Users/michaelhayes/work/altr/lib/tags/children.js","/Users/michaelhayes/work/altr/lib/tags/include.js","/Users/michaelhayes/work/altr/lib/tags/text.js","/Users/michaelhayes/work/altr/lib/tags/html.js","/Users/michaelhayes/work/altr/lib/tags/with.js","/Users/michaelhayes/work/altr/lib/tags/for.js","/Users/michaelhayes/work/altr/lib/tags/if.js","/Users/michaelhayes/work/altr/lib/altr.js","/Users/michaelhayes/work/altr/lib/template_string.js","/Users/michaelhayes/work/altr/lib/element_node.js","/Users/michaelhayes/work/altr/lib/text_node.js","/Users/michaelhayes/work/altr/lib/get_element.js","/Users/michaelhayes/work/altr/lib/render.js","/Users/michaelhayes/work/altr/lib/raf.js","/Users/michaelhayes/work/altr/lib/set_children.js","/Users/michaelhayes/work/altr/node_modules/browserify/node_modules/events/events.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/index.js","/Users/michaelhayes/work/altr/node_modules/batch-queue/index.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/operators.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/create.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/lookup.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/filter.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/parens.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/types.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/arrow.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/lib/split.js","/Users/michaelhayes/work/altr/node_modules/altr-accessors/node_modules/just-debounce/index.js"],"names":["placeholder","require","children_tag","include_tag","text_tag","html_tag","with_tag","for_tag","if_tag","altr","module","exports","addTag","el","accessor","update","val","nodeName","parent","parentNode","insertBefore","removeChild","emit","_altr_placeholder","this","batch","add","createAccessor","children","nodes","Array","isArray","set_children","call","filter","is_node","bind","nodeType","include","name","innerHTML","includes","updateNodes","childNodes","text","textContent","html","getAttribute","forEach","getElementsByTagName","run","script","fixed","document","createElement","attrs","attributes","i","l","length","setAttribute","value","for_handler","root","args","update_children","data","item_data","Object","create","prop","items","new_items","index","new_children","dom_nodes","find_index","unique","splice","make_children","concat","slice","run_updates","d","indexOf","temp","createElementNS","namespaceURI","template","prototype","run_dom_updates","parts","match","for_regexp","Error","split","key","toggle","show","hide","createComment","hidden","replaceChild","sync","doc","global","window","stream","EE","dom_module","filters","accessors","runBatch","raf","Buffer","toString","createDocumentFragment","firstChild","appendChild","_update","rootNodes","state","update_nodes","hooks","self","initNodes","init_nodes","flatten","lhs","rhs","map","init_node","Boolean","reduce","node_handlers","root_nodes","DOCUMENT_FRAGMENT_NODE","add_filter","add_tag","attr","tag","tags","tagList","push","constructor","outer_html","clone","node","cloneNode","COMMENT_NODE","TEXT_NODE","outerHTML","join","append_to","get_el","create_accessor","description","change","fn","run_batch","template_string","element_node","EventEmitter","text_node","render","addFilter","templateString","initNode","getElement","into","set_part","idx","hook","TAG","next","remaining","create_element_node","altr_tags","removeAttribute","attr_hook","create_text_node","instance","requestAnimationFrame","callback","timeout","setTimeout","webkitRequestAnimationFrame","mozRequestAnimationFrame","inserted","prev","get","nextSibling","lastChild","_events","_maxListeners","undefined","isFunction","arg","isNumber","isObject","isUndefined","defaultMaxListeners","setMaxListeners","n","isNaN","TypeError","type","er","handler","len","listeners","error","arguments","apply","addListener","listener","m","newListener","warned","console","trace","on","once","g","removeListener","fired","list","position","removeAllListeners","ret","listenerCount","emitter","delay","str","all","write","out","part","create_part","debounce","add_operators","create_accesor","add_lookup","add_parens","add_types","add_arrow","types","Batch","ready","jobs","queud","queue","queued","create_ternary","binary","unary","regex","RegExp","create_binary","create_unary","context","ok","not","ternary_regexp","condition","rest","on_data","ctx","check_lhs","check_rhs","is_rhs","changed","Function","finish","build_part","create_lookup","path","lookup","done","search","obj","create_filter","filter_regexp","create_parens","parens_regexp","body","count","content","Math","random","create_string_accessor","create_number_accessor","string_regexp","number_regexp","create_arrow","right","left","opens","closes","split_point","all_closes","all_opens","sum","counts","j","at_start","guarantee","clear","clearTimeout"],"mappings":"AAAA;AUkBA,QAASS,MAAKsD,EAAMG,EAAMqC,EAAMC,GAC9B,KAAKhF,eAAgBf,OACnB,MAAO,IAAIA,MAAKsD,EAAMG,EAAMqC,EAAMC,EAyBpC,IAtBIC,OAAOC,OAKTlF,KAAK+E,KAAuB,mBAATA,IAAuB,EAAQA,GAJlDC,EAAMA,GAAOvG,QAAQ,aAAaoD,SAClC7B,KAAKmF,OAAS1G,QAAQ,WAAWuB,KAAKT,OAAOqB,KAAKZ,OAClDA,KAAK+E,KAAuB,mBAATA,IAAuB,EAAOA,GAKnDK,GAAG3E,KAAKT,MACRA,KAAKuC,KAAOA,EACZvC,KAAK6B,SAAWmD,GAAOC,OAAOpD,UAAYpD,QAAQ4G,YAClDrF,KAAKsF,QAAU1C,OAAOC,OAAO5D,KAAKqG,SAClCtF,KAAKiB,SAAW2B,OAAOC,OAAO5D,KAAKgC,UACnCjB,KAAKuF,UAAYA,UAAUvF,KAAKsF,SAAS,GACzCtF,KAAKC,MAAQA,MAAM,WACjBD,KAAK+E,KAAO/E,KAAKwF,WAAaC,IAAIzF,KAAKwF,SAAS5E,KAAKZ,QACpDY,KAAKZ,OAELiF,OAAOS,QAAUnD,YAAgB0C,QAAOS,SACzCnD,EAAOA,EAAKoD,YAGK,gBAATpD,GAAmB,CAC3B,GAAIsB,GAAO7D,KAAK6B,SAASC,cAAc,MAKvC,KAHA+B,EAAK7C,UAAYuB,EACjBvC,KAAKuC,KAAOvC,KAAK6B,SAAS+D,yBAEpB/B,EAAKgC,YACT7F,KAAKuC,KAAKuD,YAAYjC,EAAKgC,YAI/B7F,KA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QAAQa,IAEpBoB,EAAKpJ,OAAOqJ,EAAU,GAGpB3M,KAAKyK,QAAQ+B,gBACfxM,KAAKF,KAAK,iBAAkBwL,EAAMS,GAGtC,MAAO/L,OAGT0I,aAAazE,UAAU2I,mBAAqB,SAAStB,GACnD,GAAI9G,GAAKkH,CAET,KAAK1L,KAAKyK,QACR,MAAOzK,KAGT,KAAKA,KAAKyK,QAAQ+B,eAKhB,MAJyB,KAArBZ,UAAUzJ,OACZnC,KAAKyK,WACEzK,KAAKyK,QAAQa,UACbtL,MAAKyK,QAAQa,GACftL,IAIT,IAAyB,IAArB4L,UAAUzJ,OAAc,CAC1B,IAAKqC,IAAOxE,MAAKyK,QACH,mBAARjG,GACJxE,KAAK4M,mBAAmBpI,EAI1B,OAFAxE,MAAK4M,mBAAmB,kBACxB5M,KAAKyK,WACEzK,KAKT,GAFA0L,EAAY1L,KAAKyK,QAAQa,GAErBV,WAAWc,GACb1L,KAAKwM,eAAelB,EAAMI,OAG1B,MAAOA,EAAUvJ,QACfnC,KAAKwM,eAAelB,EAAMI,EAAUA,EAAUvJ,OAAS,GAI3D,cAFOnC,MAAKyK,QAAQa,GAEbtL,MAGT0I,aAAazE,UAAUyH,UAAY,SAASJ,GAC1C,GAAIuB,EAOJ,OAHEA,GAHG7M,KAAKyK,SAAYzK,KAAKyK,QAAQa,GAE1BV,WAAW5K,KAAKyK,QAAQa,KACxBtL,KAAKyK,QAAQa,IAEdtL,KAAKyK,QAAQa,GAAM7H,YAI7BiF,aAAaoE,cAAgB,SAASC,EAASzB,GAC7C,GAAIuB,EAOJ,OAHEA,GAHGE,EAAQtC,SAAYsC,EAAQtC,QAAQa,GAEhCV,WAAWmC,EAAQtC,QAAQa,IAC5B,EAEAyB,EAAQtC,QAAQa,GAAMnJ,OAJtB","sourcesContent":["(function e(t,n,r){function s(o,u){if (!n[o]){if (!t[o]){var a=typeof require==\"function\"&&require;if (!u&&a)return a(o,!0);if (i)return i(o,!0);throw new Error(\"Cannot find module '\"+o+\"'\")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for (var o=0;o<r.length;o++)s(r[o]);return s})","var placeholder = require('./tags/placeholder')\n , children_tag = require('./tags/children')\n , include_tag = require('./tags/include')\n , text_tag = require('./tags/text')\n , html_tag = require('./tags/html')\n , with_tag = require('./tags/with')\n , for_tag = require('./tags/for')\n , if_tag = require('./tags/if')\n , altr = require('./altr')\n\nmodule.exports = altr\n\naltr.addTag('altr-placeholder', placeholder)\naltr.addTag('altr-children', children_tag)\naltr.addTag('altr-include', include_tag)\naltr.addTag('altr-text', text_tag)\naltr.addTag('altr-html', html_tag)\naltr.addTag('altr-with', with_tag)\naltr.addTag('altr-for', for_tag)\naltr.addTag('altr-if', if_tag)\n","module.exports = placeholder\n\nfunction placeholder(el, accessor) {\n var altr = this\n\n return this.batch.add(this.createAccessor(accessor, update))\n\n function update(val) {\n if (!val.nodeName) {\n return\n }\n\n var parent = el.parentNode\n\n parent.insertBefore(val, el)\n parent.removeChild(el)\n altr.emit('removed', el, parent)\n altr.emit('added', val)\n el._altr_placeholder = val\n el = val\n }\n}\n","var set_children = require('../set_children')\n\nmodule.exports = children\n\nfunction children(el, accessor) {\n return this.batch.add(this.createAccessor(accessor, update.bind(this)))\n\n function update(val) {\n var nodes = Array.isArray(val) ? val : [val]\n\n set_children.call(this, el, nodes.filter(is_node))\n }\n}\n\nfunction is_node(el) {\n return el && el.nodeType\n}\n","module.exports = include\n\nfunction include(el, name) {\n el.innerHTML = this.includes[name]\n\n return this.updateNodes(el.childNodes)\n}\n","module.exports = text\n\nfunction text(el, accessor) {\n return this.batch.add(this.createAccessor(accessor, update))\n\n function update(val) {\n el.textContent = typeof val === 'undefined' ? '' : val\n }\n}\n","module.exports = html\n\nfunction html(el, accessor) {\n return this.batch.add(this.createAccessor(accessor, update))\n\n function update(val) {\n el.innerHTML = typeof val === 'undefined' ? '' : val\n\n if (el.getAttribute('altr-run-scripts')) {\n [].forEach.call(el.getElementsByTagName('script'), run)\n }\n }\n}\n\nfunction run(script) {\n var fixed = document.createElement('script')\n , parent = script.parentNode\n , attrs = script.attributes\n , src\n\n for (var i = 0, l = attrs.length; i < l; ++i) {\n fixed.setAttribute(attrs[i].name, attrs[i].value)\n }\n\n fixed.textContent = script.textContent\n parent.insertBefore(fixed, script)\n parent.removeChild(script)\n}\n","module.exports = with_tag\n\nfunction with_tag(el, accessor) {\n return this.createAccessor(accessor, this.updateNodes(el.childNodes))\n}\n","var set_children = require('../set_children')\n , for_regexp = /^(.*?)\\s+in\\s+(.*$)/\n\nmodule.exports = for_handler\n\nfunction for_handler(root, args) {\n var parts = args.match(for_regexp)\n , template = root.innerHTML\n , dom_nodes = []\n , children = []\n , altr = this\n , items = []\n\n if (!parts) {\n throw new Error('invalid for tag: ' + args)\n }\n\n root.innerHTML = ''\n\n var unique = parts[1].split(':')[1]\n , prop = parts[1].split(':')[0]\n , key = parts[2]\n\n var run_updates = this.batch.add(run_dom_updates)\n\n return altr.createAccessor(key, update)\n\n function update_children(data) {\n var item_data\n\n for (var i = 0, l = children.length; i < l; ++i) {\n item_data = Object.create(data)\n item_data[prop] = items[i]\n item_data['$index'] = i\n\n children[i].update && children[i].update(item_data)\n }\n }\n\n function update(new_items, data) {\n if (!Array.isArray(new_items)) {\n new_items = []\n }\n\n var new_children = new Array(new_items.length)\n , index\n\n dom_nodes = []\n\n for (var i = 0, l = new_items.length; i < l; ++i) {\n index = find_index(items, new_items[i], unique)\n\n if (index !== -1) {\n new_children[i] = (children.splice(index, 1)[0])\n items.splice(index, 1)\n } else {\n new_children[i] = make_children()\n }\n\n dom_nodes = dom_nodes.concat(new_children[i].dom_nodes)\n }\n\n children = new_children.slice()\n items = new_items.slice()\n run_updates.call(altr)\n update_children(data)\n }\n\n function find_index(items, d, unique) {\n if (!unique) {\n return items.indexOf(d)\n }\n\n for (var i = 0, l = items.length; i < l; ++i) {\n if (items[i][unique] === d[unique]) {\n return i\n }\n }\n\n return -1\n }\n\n function make_children() {\n var temp = altr.document.createElementNS(root.namespaceURI, 'div')\n , dom_nodes\n , update\n\n temp.innerHTML = template\n\n dom_nodes = Array.prototype.slice.call(temp.childNodes)\n update = altr.updateNodes(dom_nodes)\n\n return {\n dom_nodes: dom_nodes\n , update: update\n }\n }\n\n function run_dom_updates() {\n set_children.call(this, root, dom_nodes)\n }\n}\n","module.exports = if_tag\n\nfunction if_tag(el, accessor) {\n var placeholder = this.document.createComment('altr-if-placeholder')\n , update_children = this.updateNodes(el.childNodes)\n , hidden = null\n , altr = this\n\n var hide = this.batch.add(function() {\n var parent = el.parentNode\n\n if (!hidden) {\n parent.replaceChild(placeholder, el)\n el._altr_placeholder = placeholder\n hidden = true\n altr.emit('removed', el, parent)\n }\n })\n\n var show = this.batch.add(function() {\n if (hidden) {\n placeholder.parentNode.replaceChild(el, placeholder)\n delete el._altr_placeholder\n hidden = false\n altr.emit('added', el)\n }\n })\n\n return this.createAccessor(accessor, toggle)\n\n function toggle(val, data) {\n if (!val) {\n return hide()\n }\n\n show()\n update_children(data)\n }\n}\n","var template_string = require('./template_string')\n , element_node = require('./element_node')\n , accessors = require('altr-accessors')\n , EE = require('events').EventEmitter\n , text_node = require('./text_node')\n , get_el = require('./get_element')\n , batch = require('batch-queue')\n , render = require('./render')\n , raf = require('./raf')\n\naltr.filters = {}\naltr.includes = {}\naltr.render = render\nmodule.exports = altr\naltr.addTag = add_tag\naltr.include = include\naltr.addFilter = add_filter\n\nfunction altr(root, data, sync, doc) {\n if (!(this instanceof altr)) {\n return new altr(root, data, sync, doc)\n }\n\n if (!global.window) {\n doc = doc || require('micro-dom').document\n this.stream = require('through')(this.update.bind(this))\n this.sync = typeof sync === 'undefined' ? true : sync\n } else {\n this.sync = typeof sync === 'undefined' ? false : sync\n }\n\n EE.call(this)\n this.root = root\n this.document = doc || global.document || require(dom_module)\n this.filters = Object.create(altr.filters)\n this.includes = Object.create(altr.includes)\n this.accessors = accessors(this.filters, false)\n this.batch = batch((function() {\n this.sync ? this.runBatch() : raf(this.runBatch.bind(this))\n }).bind(this))\n\n if (global.Buffer && root instanceof global.Buffer) {\n root = root.toString()\n }\n\n if (typeof root === 'string') {\n var temp = this.document.createElement('div')\n\n temp.innerHTML = root\n this.root = this.document.createDocumentFragment()\n\n while(temp.firstChild) {\n this.root.appendChild(temp.firstChild)\n }\n }\n\n this._update = this.updateNodes(this.rootNodes())\n\n if (data) {\n this.update(data, true)\n }\n}\n\naltr.prototype = Object.create(EE.prototype)\naltr.prototype.constructor = altr\n\naltr.prototype.templateString = template_string\naltr.prototype.createAccessor = create_accessor\naltr.prototype.updateNodes = update_nodes\naltr.prototype.initNodes = init_nodes\naltr.prototype.rootNodes = root_nodes\naltr.prototype.addFilter = add_filter\naltr.prototype.toString = outer_html\naltr.prototype.runBatch = run_batch\naltr.prototype.initNode = init_node\naltr.prototype.getElement = get_el\naltr.prototype.include = include\naltr.prototype.into = append_to\naltr.prototype.update = update\naltr.prototype.tagList = []\naltr.prototype.tags = {}\n\nvar node_handlers = {}\n\nnode_handlers[1] = element_node\nnode_handlers[3] = text_node\n\nfunction update(data, sync) {\n this.state = data\n this._update(data)\n\n if (sync) {\n this.batch.run()\n }\n}\n\nfunction update_nodes(nodes) {\n var hooks = this.initNodes(nodes)\n , self = this\n\n return update\n\n function update(data) {\n for (var i = 0, l = hooks.length; i < l; ++i) {\n hooks[i].call(self, data)\n }\n }\n}\n\nfunction init_nodes(nodes, list) {\n var hooks = [].slice.call(nodes)\n .map(init_node.bind(this))\n .filter(Boolean)\n .reduce(flatten, [])\n\n return hooks\n\n function flatten(lhs, rhs) {\n return lhs.concat(rhs)\n }\n}\n\nfunction init_node(el) {\n return node_handlers[el.nodeType] ?\n node_handlers[el.nodeType].call(this, el) :\n el.childNodes && el.childNodes.length ?\n this.initNodes(el.childNodes) :\n null\n}\n\nfunction root_nodes() {\n return this.root.nodeType === this.document.DOCUMENT_FRAGMENT_NODE ?\n [].slice.call(this.root.childNodes) :\n [this.root]\n}\n\nfunction add_filter(name, filter) {\n altr.filters[name] = filter\n}\n\nfunction add_tag(attr, tag) {\n altr.prototype.tags[attr] = tag\n altr.prototype.tagList.push({\n attr: attr\n , constructor: tag\n })\n}\n\nfunction outer_html() {\n return this.rootNodes().map(function(node) {\n switch(node.nodeType) {\n case this.document.DOCUMENT_FRAGMENT_NODE:\n case this.document.COMMENT_NODE: return clone.call(this, node)\n case this.document.TEXT_NODE: return node.textContent\n default: return node.outerHTML\n }\n }, this).join('')\n\n function clone(node) {\n var temp = this.document.createElement('div')\n\n temp.appendChild(node.cloneNode())\n\n return temp.innerHTML\n }\n}\n\nfunction append_to(node) {\n var root_nodes = this.rootNodes()\n\n for (var i = 0, l = root_nodes.length; i < l; ++i) {\n node.appendChild(get_el(root_nodes[i]))\n }\n}\n\nfunction include(name, template) {\n return this.includes[name] = template\n}\n\nfunction create_accessor(description, change) {\n return this.accessors.create(description, change, false)\n}\n\nfunction add_filter(name, fn) {\n return this.filters[name] = fn\n}\n\nfunction run_batch() {\n this.batch.run()\n this.emit('update', this.state)\n}\n","var TAG = /{{\\s*(.*?)\\s*}}/\n\nmodule.exports = template_string\n\nfunction template_string(template, change) {\n if (!template.match(TAG)) {\n return\n }\n\n var remaining = template\n , parts = []\n , hooks = []\n , timer\n , index\n , next\n\n while(remaining && (next = remaining.match(TAG))) {\n if (index = remaining.indexOf(next[0])) {\n parts.push(remaining.slice(0, index))\n }\n\n parts.push('')\n remaining = remaining.slice(index + next[0].length)\n hooks.push(\n this.createAccessor(next[1], set_part.bind(this, parts.length - 1))\n )\n }\n\n parts.push(remaining)\n\n return update\n\n function set_part(idx, val) {\n parts[idx] = val\n change(parts.join(''))\n }\n\n function update(data) {\n hooks.forEach(function(hook) {\n hook(data)\n })\n }\n}\n","module.exports = create_element_node\n\nfunction create_element_node(el) {\n var altr_tags = {}\n , altr = this\n , hooks = []\n , attr\n\n var attrs = Array.prototype.filter.call(el.attributes, function(attr) {\n return altr.tags[attr.name] ?\n (altr_tags[attr.name] = attr.value) && false :\n true\n })\n\n attrs.forEach(function(attr) {\n var value = attr.value\n , name = attr.name\n\n if (!name.indexOf('altr-attr-')) {\n name = attr.name.slice('altr-attr-'.length)\n el.removeAttribute(attr.name)\n }\n\n var attr_hook = altr.templateString(value, altr.batch.add(function(val) {\n el.setAttribute(name, val)\n }))\n\n if (attr_hook) {\n hooks.push(attr_hook)\n }\n })\n\n for (var i = 0, l = altr.tagList.length; i < l; ++i) {\n if (attr = altr_tags[altr.tagList[i].attr]) {\n hooks.push(altr.tagList[i].constructor.call(altr, el, attr))\n\n return hooks\n }\n }\n\n return hooks.concat(altr.initNodes(el.childNodes))\n}\n","module.exports = create_text_node\n\nfunction create_text_node(el) {\n var hook = this.templateString(el.textContent, this.batch.add(update))\n\n return hook ? [hook] : null\n\n function update(val) {\n el.textContent = val\n }\n}\n","module.exports = get_el\n\nfunction get_el(el) {\n while(el && el._altr_placeholder) {\n el = el._altr_placeholder\n }\n\n return el\n}\n","module.exports = render\n\nfunction render(template, state, el) {\n if (this.includes[template]) {\n template = this.includes[template]\n }\n\n var instance = this(template)\n\n instance.update(state || {}, true)\n\n if (el) {\n instance.into(el)\n }\n\n return instance\n}\n","module.exports = requestAnimationFrame\n\nfunction requestAnimationFrame(callback) {\n var raf = global.requestAnimationFrame ||\n global.webkitRequestAnimationFrame ||\n global.mozRequestAnimationFrame ||\n timeout\n\n return raf(callback)\n\n function timeout(callback) {\n return setTimeout(callback, 1000 / 60)\n }\n}\n","var get = require('./get_element')\n\nmodule.exports = set_children\n\nfunction set_children(root, nodes) {\n var prev = null\n , inserted\n , el\n\n for (var i = nodes.length - 1; i >= 0; --i) {\n el = get(nodes[i])\n\n if ((prev && el.nextSibling !== prev) || root.lastChild !== el) {\n inserted = el.parentNode !== root\n root.insertBefore(el, prev)\n\n if (inserted) {\n this.emit('added', el)\n }\n }\n\n prev = el\n }\n\n while((el = root.firstChild) !== prev) {\n root.removeChild(el)\n this.emit('remove', el, root)\n }\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n throw TypeError('Uncaught, unspecified \"error\" event.');\n }\n return false;\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n len = arguments.length;\n args = new Array(len - 1);\n for (i = 1; i < len; i++)\n args[i - 1] = arguments[i];\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n len = arguments.length;\n args = new Array(len - 1);\n for (i = 1; i < len; i++)\n args[i - 1] = arguments[i];\n\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n var m;\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n var ret;\n if (!emitter._events || !emitter._events[type])\n ret = 0;\n else if (isFunction(emitter._events[type]))\n ret = 1;\n else\n ret = emitter._events[type].length;\n return ret;\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n","var add_operators = require('./lib/operators')\n , create_accesor = require('./lib/create')\n , add_lookup = require('./lib/lookup')\n , add_filter = require('./lib/filter')\n , add_parens = require('./lib/parens')\n , debounce = require('just-debounce')\n , add_types = require('./lib/types')\n , add_arrow = require('./lib/arrow')\n , split = require('./lib/split')\n , types = []\n\nmodule.exports = accessors\n\n// order is important\nadd_types(types)\nadd_arrow(types)\nadd_filter(types)\nadd_parens(types)\nadd_operators(types)\nadd_lookup(types)\n\naccessors.prototype.create_part = create_accesor\naccessors.prototype.add_filter = add_filter\naccessors.prototype.create = create\naccessors.prototype.types = types\naccessors.prototype.split = split\n\nfunction accessors(filters, delay) {\n if (!(this instanceof accessors)) {\n return new accessors(filters, delay)\n }\n\n if (!delay && delay !== false) {\n delay = 0\n }\n\n this.delay = delay\n this.filters = filters || {}\n}\n\nfunction add_filter(name, fn) {\n this.filters[name] = fn\n}\n\nfunction create(str, change, all) {\n var part = this.create_part(\n str\n , this.delay === false ? update : debounce(change, this.delay, false, true)\n )\n\n var sync = false\n , prev = {}\n , out\n\n return write\n\n function write(data) {\n sync = true\n out = null\n part(data)\n sync = false\n\n if (out) {\n change.apply(null, out)\n }\n }\n\n function update(val, ctx) {\n if (!all && typeof val !== 'object' && val === prev) {\n return\n }\n\n out = [].slice.call(arguments)\n prev = val\n\n if (!sync) {\n change.apply(null, out)\n }\n }\n}\n","module.exports = Batch\n\nfunction Batch(ready, all) {\n if (!(this instanceof Batch)) {\n return new Batch(ready, all)\n }\n\n this.jobs = []\n this.all = all\n this.ready = ready\n this.queud = false\n this.run = this.run.bind(this)\n}\n\nBatch.prototype.queue = queue\nBatch.prototype.add = add\nBatch.prototype.run = run\n\nfunction add(fn) {\n var queued = false\n , batch = this\n , self\n , args\n\n return queue\n\n function queue() {\n args = [].slice.call(arguments)\n self = this\n\n if (queued) {\n return batch.all && batch.ready()\n }\n\n queued = true\n batch.queue(run)\n }\n\n function run() {\n queued = false\n fn.apply(self, args)\n }\n}\n\nfunction queue(fn) {\n this.jobs.push(fn)\n\n if (this.all || !this.queued) {\n this.queued = true\n this.ready(this)\n }\n}\n\nfunction run() {\n var jobs = this.jobs\n\n this.jobs = []\n this.queued = false\n\n for (var i = 0, l = jobs.length; i < l; ++i) {\n jobs[i]()\n }\n}\n","var ternary_regexp = /^\\s*(.+?)\\s*\\?(.*)\\s*$/\n\nmodule.exports = add_operators\n\nfunction add_operators(types) {\n types.push(create_ternary)\n types.push(binary(['|\\\\|']))\n types.push(binary(['&&']))\n types.push(binary(['|']))\n types.push(binary(['^']))\n types.push(binary(['&']))\n types.push(binary(['===', '!==', '==', '!=']))\n types.push(binary(['>=', '<=', '>', '<', ' in ', ' instanceof ']))\n // types.push(binary(['<<', '>>', '>>>'])) //conflics with < and >\n types.push(binary(['+', '-']))\n types.push(binary(['*', '/', '%']))\n types.push(unary(['!', '+', '-', '~']))\n}\n\nfunction binary(list) {\n var regex = new RegExp(\n '^\\\\s*(.+?)\\\\s\\*(\\\\' +\n list.join('|\\\\') +\n ')\\\\s*(.+?)\\\\s*$'\n )\n\n return function(parts, change) {\n return create_binary.call(this, regex, parts, change)\n }\n}\n\nfunction unary(list) {\n var regex = new RegExp(\n '^\\\\s*(\\\\' +\n list.join('|\\\\') +\n ')\\\\s*(.+?)\\\\s*$'\n )\n\n return function(parts, change) {\n return create_unary.call(this, regex, parts, change)\n }\n}\n\nfunction create_ternary(parts, change) {\n if (!(parts = parts.match(ternary_regexp))) {\n return\n }\n\n var condition = parts[1]\n , rest = parts[2]\n , count = 1\n\n rest = this.split(rest, ':', ['?'], [':'])\n\n if (rest.length !== 2) {\n throw new Error('Unmatched ternary: ' + parts[0])\n }\n\n var not = this.create_part(rest[1], change)\n , ok = this.create_part(rest[0], change)\n\n return this.create_part(condition, update)\n\n function update(val, context) {\n return val ? ok(context) : not(context)\n }\n}\n\nfunction create_binary(regex, parts, change) {\n if (!(parts = parts.match(regex))) {\n return\n }\n\n var check_lhs = this.create_part(parts[1], update.bind(null, false))\n , check_rhs = this.create_part(parts[3], update.bind(null, true))\n , lhs\n , rhs\n\n var changed = Function(\n 'change, lhs, rhs'\n , 'return change(lhs ' + parts[2] + ' rhs)'\n ).bind(null, change)\n\n return on_data\n\n function on_data(data, ctx) {\n check_lhs(data, ctx)\n check_rhs(data, ctx)\n }\n\n function update(is_rhs, val) {\n is_rhs ? rhs = val : lhs = val\n changed(lhs, rhs)\n }\n}\n\nfunction create_unary(regex, parts, change) {\n if (!(parts = parts.match(regex))) {\n return\n }\n\n var changed = Function(\n 'change, val'\n , 'return change(' + parts[1] + 'val)'\n ).bind(null, change)\n\n return this.create_part(parts[2], changed)\n}\n","module.exports = accessor\n\nfunction accessor(key, change) {\n var part = build_part.call(this, key, finish)\n , context\n\n return call.bind(this)\n\n function call(val, ctx) {\n part(val, context = ctx || val)\n }\n\n function finish(val) {\n change.call(this, val, context)\n }\n}\n\nfunction build_part(part, change) {\n var accessor\n\n for (var i = 0, l = this.types.length; i < l; ++i) {\n if (accessor = this.types[i].call(this, part, change)) {\n return accessor\n }\n }\n}\n","module.exports = add_lookup\n\nfunction add_lookup(types) {\n types.push(create_lookup)\n}\n\nfunction create_lookup(path, change) {\n if (!path.indexOf('$data')) {\n path = path.slice('$data.'.length)\n\n if (!path) {\n return change\n }\n }\n\n return lookup(path.match(/\\s*(.*[^\\s])\\s*/)[1], change)\n}\n\nfunction lookup(path, done) {\n var parts = path ? path.split('.') : []\n\n return function search(obj, ctx) {\n for (var i = 0, l = parts.length; obj && i < l; ++i) {\n obj = obj[parts[i]]\n }\n\n if (typeof obj === 'undefined' && ctx) {\n return search(ctx)\n }\n\n if (i === l) {\n return done(obj)\n }\n\n done()\n }\n}\n","var filter_regexp = /^\\s*([^\\s(]+)\\((.*)\\)\\s*$/\n\nmodule.exports = add_filter\n\nfunction add_filter(types) {\n types.push(create_filter)\n}\n\nfunction create_filter(parts, change) {\n if (!(parts = parts.match(filter_regexp))) {\n return\n }\n\n var filter = this.filters[parts[1]]\n\n if (!filter) {\n throw new Error('could not find filter: ' + parts[1])\n }\n\n return filter.call(this, this.split(parts[2], ',', null, null, true), change)\n}\n","var parens_regexp = /^\\s*\\((.*)$/\n\nmodule.exports = add_parens\n\nfunction add_parens(types) {\n types.push(create_parens)\n}\n\nfunction create_parens(parts, change) {\n if (!(parts = parts.match(parens_regexp))) {\n return\n }\n\n var body = parts[1]\n , count = 1\n\n for (var i = 0, l = body.length; i < l; ++i) {\n if (body[i] === ')') {\n --count\n } else if (body[i] === '(') {\n ++count\n }\n\n if (!count) {\n break\n }\n }\n\n if (!i || i === l) {\n throw new Error('Unmatched ternary: ' + parts[0])\n }\n\n var content = this.create_part(body.slice(0, i), update)\n , key = 'paren_' + Math.random().toString(16).slice(2)\n\n var template = this.create_part(key + body.slice(i + 1), change)\n\n return content\n\n function update(val, context) {\n context = Object.create(context)\n context[key] = val\n template(context)\n }\n}\n","var string_regexp = /^\\s*(?:'((?:[^'\\\\]|(?:\\\\.))*)'|\"((?:[^\"\\\\]|(?:\\\\.))*)\")\\s*$/\n , number_regexp = /^\\s*(\\d*(?:\\.\\d+)?)\\s*$/\n\nmodule.exports = add_types\n\nfunction add_types(types) {\n types.push(create_string_accessor)\n types.push(create_number_accessor)\n}\n\nfunction create_string_accessor(parts, change) {\n if (!(parts = parts.match(string_regexp))) {\n return\n }\n\n return function() {\n change(parts[1] || parts[2])\n }\n}\n\nfunction create_number_accessor(parts, change) {\n if (!(parts = parts.match(number_regexp))) {\n return\n }\n\n return function() {\n change(+parts[1])\n }\n}\n","module.exports = add_arrow\n\nfunction add_arrow(types) {\n types.push(create_arrow)\n}\n\nfunction create_arrow(parts, change) {\n parts = this.split(parts, '->')\n\n if (parts.length < 2) {\n return\n }\n\n var right = this.create_part(parts[1], change)\n , left = this.create_part(parts[0], update)\n\n return left\n\n function update(val, ctx) {\n right(val, ctx)\n }\n}\n","module.exports = split\n\nfunction split(parts, key, opens, closes, all) {\n var all_closes = [')', '}', ']']\n , all_opens = ['(', '{', '[']\n , sum = 0\n , split_point\n , index\n\n if (opens) {\n all_opens = all_opens.concat(opens)\n }\n\n if (closes) {\n all_closes = all_closes.concat(closes)\n }\n\n var counts = all_opens.map(function() {\n return 0\n })\n\n for (var i = 0, l = parts.length; i < l; ++i) {\n if (!sum && (split_point = parts.slice(i).indexOf(key)) === -1) {\n return [parts]\n }\n\n if (!sum && !split_point) {\n break\n }\n\n if ((index = all_opens.indexOf(parts[i])) !== -1) {\n ++counts[index]\n ++sum\n } else if ((index = all_closes.indexOf(parts[i])) !== -1) {\n --counts[index]\n --sum\n }\n\n for (var j = 0; j < counts.length; ++j) {\n if (counts[j] < 0) {\n throw new Error('Unmatched \"' + all_opens[j] + '\"\" in ' + parts)\n }\n }\n }\n\n if (sum || i === parts.length) {\n return [parts]\n }\n\n var right = parts.slice(i + key.length)\n , left = parts.slice(0, i)\n\n if (!all) {\n return [left, right]\n }\n\n return [left].concat(split(right, key, opens, closes, all))\n}\n","module.exports = debounce\n\nfunction debounce(fn, delay, at_start, guarantee) {\n var timeout\n , args\n\n return function() {\n var self = this\n\n args = Array.prototype.slice.call(arguments)\n\n if (timeout && (at_start || guarantee)) {\n return\n } else if (!at_start) {\n clear()\n\n return timeout = setTimeout(run, delay)\n }\n\n timeout = setTimeout(clear, delay)\n fn.apply(self, args)\n\n function run() {\n clear()\n fn.apply(self, args)\n }\n\n function clear() {\n clearTimeout(timeout)\n timeout = null\n }\n }\n}\n"]}