Comparing version 0.2.10 to 0.2.12
/*! | ||
* fluir v0.2.9 | ||
* fluir v0.2.12 | ||
* Url: https://github.com/z5h/fluir | ||
@@ -7,3 +7,3 @@ * Copyright (c) Mark Bolusmjak | ||
*/ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.fluir=t()}}(function(){var t;return function e(t,n,r){function i(s,u){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){(function(e){function r(t){this._stores=i.values(t),o.call(this),i.extend(this,o.prototype),s.call(this,t),this.get=s.prototype.get,u.call(this,this._stores),i.extend(this,u.prototype),a.call(this,this._stores),this.dispatch=i.bind(function(t,e){return a.prototype.dispatch.call(this,t,e)},this),this.emitChange=i.bind(function(){return r.prototype.emitChange.call(this)},this);var e=this;i.each(this._stores,function(t){t.on("change",function(){e.emitChange(t)}),t.go=i.bind(e.go,e),t.scope=i.bind(e.push,e)})}var i="undefined"!=typeof window?window._:"undefined"!=typeof e?e._:null,o=t("events").EventEmitter,s=t("./lib/scope").Scope,u=t("./lib/routeHandler").RouteHandler,a=t("./lib/dispatchHandler").DispatchHandler;r.prototype.push=function(t){var e=s.prototype.push.call(this,t);return e.dispatch=this.dispatch,e.emitChange=this.emitChange,e.push=r.prototype.push,e},r.prototype.emitChange=function(){this.emit("change")};var h={scope:function(t){return t?this.props.scope.push(t):this.props.scope},resolve:function(t){return this.props.scope.get(t)},dispatch:function(t,e){return this.props.scope.dispatch(t,e)},dispatcher:function(t){return i.bind(function(e){this.props.scope.dispatch(t,e.target.value)},this)}},c={debounceTime:10,componentWillMount:function(){this.callback=function(){this.forceUpdate()}.bind(this),this.props.scope.on("change",i.debounce(this.callback,this.debounceTime))}};i.extend(c,h),n.Application=r,n.ViewMixin=h,n.RootViewMixin=c,n.Scope=s,Promise=t("es6-promise").Promise}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/dispatchHandler":2,"./lib/routeHandler":3,"./lib/scope":4,"es6-promise":8,events:5}],2:[function(t,e,n){(function(e){function r(t){this._listeners=t}var i="undefined"!=typeof window?window._:"undefined"!=typeof e?e._:null,o=t("es6-promise").Promise;r.prototype.dispatch=function(t,e){var n=[];return i.each(this._listeners,function(r){var i=r[t];"function"==typeof i&&n.push(i.call(r,e))}),o.all(n)},n.DispatchHandler=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":8}],3:[function(t,e,n){(function(e){function r(t){function e(e){this._router=new t;var n={},r=this;i.each(e,function(t){i.chain(t).functions().filter(function(t){return"/"===t.charAt(0)}).each(function(e){var i=function(){var n=Array.prototype.slice.call(arguments);t[e].apply(t,n),r.emitChange()};n[e]=i,r._router.on(e,i)}),i.chain(t).keys().filter(function(e){return"/"===e.charAt(0)&&"string"==typeof t[e]}).each(function(e){var i=t[e];r._router.on(e,n[i])})})}return e.prototype.initRoute=function(t){this._router.init(t)},e.prototype.go=function(t){this._router.setRoute(t)},e}var i="undefined"!=typeof window?window._:"undefined"!=typeof e?e._:null,o=t("director").Router;n.RouteHandler=r(o),n.defineRouteHandler=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{director:7}],4:[function(t,e,n){function r(t){t&&(this._values=t)}r.prototype.push=function(t){var e=new r(t||{});return e._parent=this,e},r.prototype.get=function(t){for(var e=this,n=e._values[t];void 0===n&&e;)e=e._parent,n=e?e._values[t]:n;if(e)return n;throw t+" not found"},n.Scope=r},{}],5:[function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,u,a,h;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,u=new Array(i-1),a=1;i>a;a++)u[a-1]=arguments[a];n.apply(this,u)}else if(o(n)){for(i=arguments.length,u=new Array(i-1),a=1;i>a;a++)u[a-1]=arguments[a];for(h=n.slice(),i=h.length,a=0;i>a;a++)h[a].apply(this,u)}return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,u;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(u=s;u-->0;)if(n[u]===e||n[u].listener&&n[u].listener===e){i=u;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0}},{}],6:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],7:[function(t,e,n){!function(t){function e(){return""===h.hash||"#"===h.hash}function n(t,e){for(var n=0;n<t.length;n+=1)if(e(t[n],n,t)===!1)return}function r(t){for(var e=[],n=0,r=t.length;r>n;n++)e=e.concat(t[n]);return e}function i(t,e,n){if(!t.length)return n();var r=0;!function i(){e(t[r],function(e){e||e===!1?(n(e),n=function(){}):(r+=1,r===t.length?n():i())})}()}function o(t,e,n){n=t;for(var r in e)if(e.hasOwnProperty(r)&&(n=e[r](t),n!==t))break;return n===t?"([._a-zA-Z0-9-]+)":n}function u(t,e){for(var n,r=0,i="";n=t.substr(r).match(/[^\w\d\- %@&]*\*[^\w\d\- %@&]*/);)r=n.index+n[0].length,n[0]=n[0].replace(/^\*/,"([_.()!\\ %@&a-zA-Z0-9-]+)"),i+=t.substr(0,n.index)+n[0];t=i+=t.substr(r);var s,u,a=t.match(/:([^\/]+)/gi);if(a){u=a.length;for(var h=0;u>h;h++)s=a[h],t="::"===s.slice(0,2)?s.slice(1):t.replace(s,o(s,e))}return t}function a(t,e,n,r){var i,o=0,s=0,u=0,n=(n||"(").toString(),r=(r||")").toString();for(i=0;i<t.length;i++){var a=t[i];if(a.indexOf(n,o)>a.indexOf(r,o)||~a.indexOf(n,o)&&!~a.indexOf(r,o)||!~a.indexOf(n,o)&&~a.indexOf(r,o)){if(s=a.indexOf(n,o),u=a.indexOf(r,o),~s&&!~u||!~s&&~u){var h=t.slice(0,(i||1)+1).join(e);t=[h].concat(t.slice((i||1)+1))}o=(u>s?u:s)+1,i=0}else o=0}return t}Array.prototype.filter||(Array.prototype.filter=function(t,e){for(var n,r=[],i=0,o=this.length;o>i;i++)i in this&&t.call(e,n=this[i],i,this)&&r.push(n);return r}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var h=document.location,c={mode:"modern",hash:h.hash,history:!1,check:function(){var t=h.hash;t!=this.hash&&(this.hash=t,this.onHashChanged())},fire:function(){"modern"===this.mode?this.history===!0?window.onpopstate():window.onhashchange():this.onHashChanged()},init:function(t,e){function n(t){for(var e=0,n=f.listeners.length;n>e;e++)f.listeners[e](t)}var r=this;if(this.history=e,f.listeners||(f.listeners=[]),"onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7))this.history===!0?setTimeout(function(){window.onpopstate=n},500):window.onhashchange=n,this.mode="modern";else{var i=document.createElement("iframe");i.id="state-frame",i.style.display="none",document.body.appendChild(i),this.writeFrame(""),"onpropertychange"in document&&"attachEvent"in document&&document.attachEvent("onpropertychange",function(){"location"===event.propertyName&&r.check()}),window.setInterval(function(){r.check()},50),this.onHashChanged=n,this.mode="legacy"}return f.listeners.push(t),this.mode},destroy:function(t){if(f&&f.listeners)for(var e=f.listeners,n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},setHash:function(t){return"legacy"===this.mode&&this.writeFrame(t),this.history===!0?(window.history.pushState({},document.title,t),this.fire()):h.hash="/"===t[0]?t:"/"+t,this},writeFrame:function(t){var e=document.getElementById("state-frame"),n=e.contentDocument||e.contentWindow.document;n.open(),n.write("<script>_hash = '"+t+"'; onload = parent.listener.syncHash;<script>"),n.close()},syncHash:function(){var t=this._hash;return t!=h.hash&&(h.hash=t),this},onHashChanged:function(){}},f=t.Router=function(t){return this instanceof f?(this.params={},this.routes={},this.methods=["on","once","after","before"],this.scope=[],this._methods={},this._insert=this.insert,this.insert=this.insertEx,this.historySupport=null!=(null!=window.history?window.history.pushState:null),this.configure(),void this.mount(t||{})):new f(t)};f.prototype.init=function(t){var n=this;if(this.handler=function(t){var e=t&&t.newURL||window.location.hash,r=n.history===!0?n.getPath():e.replace(/.*#/,"");n.dispatch("on","/"===r.charAt(0)?r:"/"+r)},c.init(this.handler,this.history),this.history===!1)e()&&t?h.hash=t:e()||n.dispatch("on","/"+h.hash.replace(/^(#\/|#|\/)/,""));else{var r=e()&&t?t:e()?null:h.hash.replace(/^#/,"");r&&window.history.replaceState({},document.title,r),(r||this.run_in_init===!0)&&this.handler()}return this},f.prototype.explode=function(){var t=this.history===!0?this.getPath():h.hash;return"/"===t.charAt(1)&&(t=t.slice(1)),t.slice(1,t.length).split("/")},f.prototype.setRoute=function(t,e,n){var r=this.explode();return"number"==typeof t&&"string"==typeof e?r[t]=e:"string"==typeof n?r.splice(t,e,s):r=[t],c.setHash(r.join("/")),r},f.prototype.insertEx=function(t,e,n,r){return"once"===t&&(t="on",n=function(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}(n)),this._insert(t,e,n,r)},f.prototype.getRoute=function(t){var e=t;if("number"==typeof t)e=this.explode()[t];else if("string"==typeof t){var n=this.explode();e=n.indexOf(t)}else e=this.explode();return e},f.prototype.destroy=function(){return c.destroy(this.handler),this},f.prototype.getPath=function(){var t=window.location.pathname;return"/"!==t.substr(0,1)&&(t="/"+t),t},f.prototype.configure=function(t){t=t||{};for(var e=0;e<this.methods.length;e++)this._methods[this.methods[e]]=!0;return this.recurse=t.recurse||this.recurse||!1,this.async=t.async||!1,this.delimiter=t.delimiter||"/",this.strict="undefined"==typeof t.strict?!0:t.strict,this.notfound=t.notfound,this.resource=t.resource,this.history=t.html5history&&this.historySupport||!1,this.run_in_init=this.history===!0&&t.run_handler_in_init!==!1,this.every={after:t.after||null,before:t.before||null,on:t.on||null},this},f.prototype.param=function(t,e){":"!==t[0]&&(t=":"+t);var n=new RegExp(t,"g");this.params[t]=function(t){return t.replace(n,e.source||e)}},f.prototype.on=f.prototype.route=function(t,e,n){var r=this;return n||"function"!=typeof e||(n=e,e=t,t="on"),Array.isArray(e)?e.forEach(function(e){r.on(t,e,n)}):(e.source&&(e=e.source.replace(/\\\//gi,"/")),Array.isArray(t)?t.forEach(function(t){r.on(t.toLowerCase(),e,n)}):(e=e.split(new RegExp(this.delimiter)),e=a(e,this.delimiter),void this.insert(t,this.scope.concat(e),n)))},f.prototype.dispatch=function(t,e,n){function r(){o.last=s.after,o.invoke(o.runlist(s),o,n)}var i,o=this,s=this.traverse(t,e,this.routes,""),u=this._invoked;return this._invoked=!0,s&&0!==s.length?("forward"===this.recurse&&(s=s.reverse()),i=this.every&&this.every.after?[this.every.after].concat(this.last):[this.last],i&&i.length>0&&u?(this.async?this.invoke(i,this,r):(this.invoke(i,this),r()),!0):(r(),!0)):(this.last=[],"function"==typeof this.notfound&&this.invoke([this.notfound],{method:t,path:e},n),!1)},f.prototype.invoke=function(t,e,r){var o,s=this;this.async?(o=function(n,r){return Array.isArray(n)?i(n,o,r):void("function"==typeof n&&n.apply(e,t.captures.concat(r)))},i(t,o,function(){r&&r.apply(e,arguments)})):(o=function(r){return Array.isArray(r)?n(r,o):"function"==typeof r?r.apply(e,t.captures||[]):void("string"==typeof r&&s.resource&&s.resource[r].apply(e,t.captures||[]))},n(t,o))},f.prototype.traverse=function(t,e,n,r,i){function o(t){function e(t){for(var n=[],r=0;r<t.length;r++)n[r]=Array.isArray(t[r])?e(t[r]):t[r];return n}function n(t){for(var e=t.length-1;e>=0;e--)Array.isArray(t[e])?(n(t[e]),0===t[e].length&&t.splice(e,1)):i(t[e])||t.splice(e,1)}if(!i)return t;var r=e(t);return r.matched=t.matched,r.captures=t.captures,r.after=t.after.filter(i),n(r),r}var s,u,a,h,c=[];if(e===this.delimiter&&n[t])return h=[[n.before,n[t]].filter(Boolean)],h.after=[n.after].filter(Boolean),h.matched=!0,h.captures=[],o(h);for(var f in n)if(n.hasOwnProperty(f)&&(!this._methods[f]||this._methods[f]&&"object"==typeof n[f]&&!Array.isArray(n[f]))){if(s=u=r+this.delimiter+f,this.strict||(u+="["+this.delimiter+"]?"),a=e.match(new RegExp("^"+u)),!a)continue;if(a[0]&&a[0]==e&&n[f][t])return h=[[n[f].before,n[f][t]].filter(Boolean)],h.after=[n[f].after].filter(Boolean),h.matched=!0,h.captures=a.slice(1),this.recurse&&n===this.routes&&(h.push([n.before,n.on].filter(Boolean)),h.after=h.after.concat([n.after].filter(Boolean))),o(h);if(h=this.traverse(t,e,n[f],s),h.matched)return h.length>0&&(c=c.concat(h)),this.recurse&&(c.push([n[f].before,n[f].on].filter(Boolean)),h.after=h.after.concat([n[f].after].filter(Boolean)),n===this.routes&&(c.push([n.before,n.on].filter(Boolean)),h.after=h.after.concat([n.after].filter(Boolean)))),c.matched=!0,c.captures=h.captures,c.after=h.after,o(c)}return!1},f.prototype.insert=function(t,e,n,r){var i,o,s,a,h;if(e=e.filter(function(t){return t&&t.length>0}),r=r||this.routes,h=e.shift(),/\:|\*/.test(h)&&!/\\d|\\w/.test(h)&&(h=u(h,this.params)),e.length>0)return r[h]=r[h]||{},this.insert(t,e,n,r[h]);if(h||e.length||r!==this.routes){if(o=typeof r[h],s=Array.isArray(r[h]),r[h]&&!s&&"object"==o)switch(i=typeof r[h][t]){case"function":return void(r[h][t]=[r[h][t],n]);case"object":return void r[h][t].push(n);case"undefined":return void(r[h][t]=n)}else if("undefined"==o)return a={},a[t]=n,void(r[h]=a);throw new Error("Invalid route context: "+o)}switch(i=typeof r[t]){case"function":return void(r[t]=[r[t],n]);case"object":return void r[t].push(n);case"undefined":return void(r[t]=n)}},f.prototype.extend=function(t){function e(t){r._methods[t]=!0,r[t]=function(){var e=1===arguments.length?[t,""]:[t];r.on.apply(r,e.concat(Array.prototype.slice.call(arguments)))}}var n,r=this,i=t.length;for(n=0;i>n;n++)e(t[n])},f.prototype.runlist=function(t){var e=this.every&&this.every.before?[this.every.before].concat(r(t)):r(t);return this.every&&this.every.on&&e.push(this.every.on),e.captures=t.captures,e.source=t.source,e},f.prototype.mount=function(t,e){function n(e,n){var i=e,o=e.split(r.delimiter),s=typeof t[e],u=""===o[0]||!r._methods[o[0]],h=u?"on":i;return u&&(i=i.slice((i.match(new RegExp("^"+r.delimiter))||[""])[0].length),o.shift()),u&&"object"===s&&!Array.isArray(t[e])?(n=n.concat(o),void r.mount(t[e],n)):(u&&(n=n.concat(i.split(r.delimiter)),n=a(n,r.delimiter)),void r.insert(h,n,t[e]))}if(t&&"object"==typeof t&&!Array.isArray(t)){var r=this;e=e||[],Array.isArray(e)||(e=e.split(r.delimiter));for(var i in t)t.hasOwnProperty(i)&&n(i,e.slice(0))}}}("object"==typeof n?n:window)},{}],8:[function(e,n){(function(e,r){/*! | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.fluir=t()}}(function(){var t;return function e(t,n,r){function i(s,u){if(!n[s]){if(!t[s]){var a="function"==typeof require&&require;if(!u&&a)return a(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){(function(e){function r(t){this._stores=i.values(t),o.call(this),i.extend(this,o.prototype),s.call(this,t),this.get=s.prototype.get,u.call(this,this._stores),i.extend(this,u.prototype),a.call(this,this._stores),this.dispatch=i.bind(function(t,e){return a.prototype.dispatch.call(this,t,e)},this),this.emitChange=i.bind(function(){return r.prototype.emitChange.call(this)},this);var e=this;i.each(this._stores,function(t){t.on("change",function(){e.emitChange(t)}),t.go=i.bind(e.go,e),t.scope=i.bind(e.push,e)})}var i="undefined"!=typeof window?window._:"undefined"!=typeof e?e._:null,o=t("events").EventEmitter,s=t("./lib/scope").Scope,u=t("./lib/routeHandler").RouteHandler,a=t("./lib/dispatchHandler").DispatchHandler;r.prototype.push=function(t){var e=s.prototype.push.call(this,t);return e.dispatch=this.dispatch,e.emitChange=this.emitChange,e.push=r.prototype.push,e},r.prototype.emitChange=function(){this.emit("change")};var h={scope:function(t){return t?this.props.scope.push(t):this.props.scope},resolve:function(t){return this.props.scope.get(t)},dispatch:function(t,e){return this.props.scope.dispatch(t,e)},dispatcher:function(t){return i.bind(function(e){this.props.scope.dispatch(t,e.target.value)},this)}},c={debounceTime:10,componentWillMount:function(){this.callback=function(){this.forceUpdate()}.bind(this),this.props.scope.on("change",i.debounce(this.callback,this.debounceTime))}};i.extend(c,h),n.Application=r,n.ViewMixin=h,n.RootViewMixin=c,n.Scope=s,n.Promise=t("es6-promise").Promise}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/dispatchHandler":2,"./lib/routeHandler":3,"./lib/scope":4,"es6-promise":8,events:5}],2:[function(t,e,n){(function(e){function r(t){this._listeners=t}var i="undefined"!=typeof window?window._:"undefined"!=typeof e?e._:null,o=t("es6-promise").Promise;r.prototype.dispatch=function(t,e){var n=[];return i.each(this._listeners,function(r){var i=r[t];"function"==typeof i&&n.push(i.call(r,e))}),o.all(n)},n.DispatchHandler=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"es6-promise":8}],3:[function(t,e,n){(function(e){function r(t){function e(e){this._router=new t;var n={},r=this;i.each(e,function(t){i.chain(t).functions().filter(function(t){return"/"===t.charAt(0)}).each(function(e){var i=function(){var n=Array.prototype.slice.call(arguments);t[e].apply(t,n),r.emitChange()};n[e]=i,r._router.on(e,i)}),i.chain(t).keys().filter(function(e){return"/"===e.charAt(0)&&"string"==typeof t[e]}).each(function(e){var i=t[e];r._router.on(e,n[i])})})}return e.prototype.initRoute=function(t){this._router.init(t)},e.prototype.go=function(t){this._router.setRoute(t)},e}var i="undefined"!=typeof window?window._:"undefined"!=typeof e?e._:null,o=t("director").Router;n.RouteHandler=r(o),n.defineRouteHandler=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{director:7}],4:[function(t,e,n){function r(t){t&&(this._values=t)}r.prototype.push=function(t){var e=new r(t||{});return e._parent=this,e},r.prototype.get=function(t){for(var e=this,n=e._values[t];void 0===n&&e;)e=e._parent,n=e?e._values[t]:n;if(e)return n;throw t+" not found"},n.Scope=r},{}],5:[function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,i,u,a,h;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],s(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,u=new Array(i-1),a=1;i>a;a++)u[a-1]=arguments[a];n.apply(this,u)}else if(o(n)){for(i=arguments.length,u=new Array(i-1),a=1;i>a;a++)u[a-1]=arguments[a];for(h=n.slice(),i=h.length,a=0;i>a;a++)h[a].apply(this,u)}return!0},n.prototype.addListener=function(t,e){var i;if(!r(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,r(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function n(){this.removeListener(t,n),i||(i=!0,e.apply(this,arguments))}if(!r(e))throw TypeError("listener must be a function");var i=!1;return n.listener=e,this.on(t,n),this},n.prototype.removeListener=function(t,e){var n,i,s,u;if(!r(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],s=n.length,i=-1,n===e||r(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(n)){for(u=s;u-->0;)if(n[u]===e||n[u].listener&&n[u].listener===e){i=u;break}if(0>i)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],r(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?r(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?r(t._events[e])?1:t._events[e].length:0}},{}],6:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],7:[function(t,e,n){!function(t){function e(){return""===h.hash||"#"===h.hash}function n(t,e){for(var n=0;n<t.length;n+=1)if(e(t[n],n,t)===!1)return}function r(t){for(var e=[],n=0,r=t.length;r>n;n++)e=e.concat(t[n]);return e}function i(t,e,n){if(!t.length)return n();var r=0;!function i(){e(t[r],function(e){e||e===!1?(n(e),n=function(){}):(r+=1,r===t.length?n():i())})}()}function o(t,e,n){n=t;for(var r in e)if(e.hasOwnProperty(r)&&(n=e[r](t),n!==t))break;return n===t?"([._a-zA-Z0-9-]+)":n}function u(t,e){for(var n,r=0,i="";n=t.substr(r).match(/[^\w\d\- %@&]*\*[^\w\d\- %@&]*/);)r=n.index+n[0].length,n[0]=n[0].replace(/^\*/,"([_.()!\\ %@&a-zA-Z0-9-]+)"),i+=t.substr(0,n.index)+n[0];t=i+=t.substr(r);var s,u,a=t.match(/:([^\/]+)/gi);if(a){u=a.length;for(var h=0;u>h;h++)s=a[h],t="::"===s.slice(0,2)?s.slice(1):t.replace(s,o(s,e))}return t}function a(t,e,n,r){var i,o=0,s=0,u=0,n=(n||"(").toString(),r=(r||")").toString();for(i=0;i<t.length;i++){var a=t[i];if(a.indexOf(n,o)>a.indexOf(r,o)||~a.indexOf(n,o)&&!~a.indexOf(r,o)||!~a.indexOf(n,o)&&~a.indexOf(r,o)){if(s=a.indexOf(n,o),u=a.indexOf(r,o),~s&&!~u||!~s&&~u){var h=t.slice(0,(i||1)+1).join(e);t=[h].concat(t.slice((i||1)+1))}o=(u>s?u:s)+1,i=0}else o=0}return t}Array.prototype.filter||(Array.prototype.filter=function(t,e){for(var n,r=[],i=0,o=this.length;o>i;i++)i in this&&t.call(e,n=this[i],i,this)&&r.push(n);return r}),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var h=document.location,c={mode:"modern",hash:h.hash,history:!1,check:function(){var t=h.hash;t!=this.hash&&(this.hash=t,this.onHashChanged())},fire:function(){"modern"===this.mode?this.history===!0?window.onpopstate():window.onhashchange():this.onHashChanged()},init:function(t,e){function n(t){for(var e=0,n=f.listeners.length;n>e;e++)f.listeners[e](t)}var r=this;if(this.history=e,f.listeners||(f.listeners=[]),"onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7))this.history===!0?setTimeout(function(){window.onpopstate=n},500):window.onhashchange=n,this.mode="modern";else{var i=document.createElement("iframe");i.id="state-frame",i.style.display="none",document.body.appendChild(i),this.writeFrame(""),"onpropertychange"in document&&"attachEvent"in document&&document.attachEvent("onpropertychange",function(){"location"===event.propertyName&&r.check()}),window.setInterval(function(){r.check()},50),this.onHashChanged=n,this.mode="legacy"}return f.listeners.push(t),this.mode},destroy:function(t){if(f&&f.listeners)for(var e=f.listeners,n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)},setHash:function(t){return"legacy"===this.mode&&this.writeFrame(t),this.history===!0?(window.history.pushState({},document.title,t),this.fire()):h.hash="/"===t[0]?t:"/"+t,this},writeFrame:function(t){var e=document.getElementById("state-frame"),n=e.contentDocument||e.contentWindow.document;n.open(),n.write("<script>_hash = '"+t+"'; onload = parent.listener.syncHash;<script>"),n.close()},syncHash:function(){var t=this._hash;return t!=h.hash&&(h.hash=t),this},onHashChanged:function(){}},f=t.Router=function(t){return this instanceof f?(this.params={},this.routes={},this.methods=["on","once","after","before"],this.scope=[],this._methods={},this._insert=this.insert,this.insert=this.insertEx,this.historySupport=null!=(null!=window.history?window.history.pushState:null),this.configure(),void this.mount(t||{})):new f(t)};f.prototype.init=function(t){var n=this;if(this.handler=function(t){var e=t&&t.newURL||window.location.hash,r=n.history===!0?n.getPath():e.replace(/.*#/,"");n.dispatch("on","/"===r.charAt(0)?r:"/"+r)},c.init(this.handler,this.history),this.history===!1)e()&&t?h.hash=t:e()||n.dispatch("on","/"+h.hash.replace(/^(#\/|#|\/)/,""));else{var r=e()&&t?t:e()?null:h.hash.replace(/^#/,"");r&&window.history.replaceState({},document.title,r),(r||this.run_in_init===!0)&&this.handler()}return this},f.prototype.explode=function(){var t=this.history===!0?this.getPath():h.hash;return"/"===t.charAt(1)&&(t=t.slice(1)),t.slice(1,t.length).split("/")},f.prototype.setRoute=function(t,e,n){var r=this.explode();return"number"==typeof t&&"string"==typeof e?r[t]=e:"string"==typeof n?r.splice(t,e,s):r=[t],c.setHash(r.join("/")),r},f.prototype.insertEx=function(t,e,n,r){return"once"===t&&(t="on",n=function(t){var e=!1;return function(){return e?void 0:(e=!0,t.apply(this,arguments))}}(n)),this._insert(t,e,n,r)},f.prototype.getRoute=function(t){var e=t;if("number"==typeof t)e=this.explode()[t];else if("string"==typeof t){var n=this.explode();e=n.indexOf(t)}else e=this.explode();return e},f.prototype.destroy=function(){return c.destroy(this.handler),this},f.prototype.getPath=function(){var t=window.location.pathname;return"/"!==t.substr(0,1)&&(t="/"+t),t},f.prototype.configure=function(t){t=t||{};for(var e=0;e<this.methods.length;e++)this._methods[this.methods[e]]=!0;return this.recurse=t.recurse||this.recurse||!1,this.async=t.async||!1,this.delimiter=t.delimiter||"/",this.strict="undefined"==typeof t.strict?!0:t.strict,this.notfound=t.notfound,this.resource=t.resource,this.history=t.html5history&&this.historySupport||!1,this.run_in_init=this.history===!0&&t.run_handler_in_init!==!1,this.every={after:t.after||null,before:t.before||null,on:t.on||null},this},f.prototype.param=function(t,e){":"!==t[0]&&(t=":"+t);var n=new RegExp(t,"g");this.params[t]=function(t){return t.replace(n,e.source||e)}},f.prototype.on=f.prototype.route=function(t,e,n){var r=this;return n||"function"!=typeof e||(n=e,e=t,t="on"),Array.isArray(e)?e.forEach(function(e){r.on(t,e,n)}):(e.source&&(e=e.source.replace(/\\\//gi,"/")),Array.isArray(t)?t.forEach(function(t){r.on(t.toLowerCase(),e,n)}):(e=e.split(new RegExp(this.delimiter)),e=a(e,this.delimiter),void this.insert(t,this.scope.concat(e),n)))},f.prototype.dispatch=function(t,e,n){function r(){o.last=s.after,o.invoke(o.runlist(s),o,n)}var i,o=this,s=this.traverse(t,e,this.routes,""),u=this._invoked;return this._invoked=!0,s&&0!==s.length?("forward"===this.recurse&&(s=s.reverse()),i=this.every&&this.every.after?[this.every.after].concat(this.last):[this.last],i&&i.length>0&&u?(this.async?this.invoke(i,this,r):(this.invoke(i,this),r()),!0):(r(),!0)):(this.last=[],"function"==typeof this.notfound&&this.invoke([this.notfound],{method:t,path:e},n),!1)},f.prototype.invoke=function(t,e,r){var o,s=this;this.async?(o=function(n,r){return Array.isArray(n)?i(n,o,r):void("function"==typeof n&&n.apply(e,t.captures.concat(r)))},i(t,o,function(){r&&r.apply(e,arguments)})):(o=function(r){return Array.isArray(r)?n(r,o):"function"==typeof r?r.apply(e,t.captures||[]):void("string"==typeof r&&s.resource&&s.resource[r].apply(e,t.captures||[]))},n(t,o))},f.prototype.traverse=function(t,e,n,r,i){function o(t){function e(t){for(var n=[],r=0;r<t.length;r++)n[r]=Array.isArray(t[r])?e(t[r]):t[r];return n}function n(t){for(var e=t.length-1;e>=0;e--)Array.isArray(t[e])?(n(t[e]),0===t[e].length&&t.splice(e,1)):i(t[e])||t.splice(e,1)}if(!i)return t;var r=e(t);return r.matched=t.matched,r.captures=t.captures,r.after=t.after.filter(i),n(r),r}var s,u,a,h,c=[];if(e===this.delimiter&&n[t])return h=[[n.before,n[t]].filter(Boolean)],h.after=[n.after].filter(Boolean),h.matched=!0,h.captures=[],o(h);for(var f in n)if(n.hasOwnProperty(f)&&(!this._methods[f]||this._methods[f]&&"object"==typeof n[f]&&!Array.isArray(n[f]))){if(s=u=r+this.delimiter+f,this.strict||(u+="["+this.delimiter+"]?"),a=e.match(new RegExp("^"+u)),!a)continue;if(a[0]&&a[0]==e&&n[f][t])return h=[[n[f].before,n[f][t]].filter(Boolean)],h.after=[n[f].after].filter(Boolean),h.matched=!0,h.captures=a.slice(1),this.recurse&&n===this.routes&&(h.push([n.before,n.on].filter(Boolean)),h.after=h.after.concat([n.after].filter(Boolean))),o(h);if(h=this.traverse(t,e,n[f],s),h.matched)return h.length>0&&(c=c.concat(h)),this.recurse&&(c.push([n[f].before,n[f].on].filter(Boolean)),h.after=h.after.concat([n[f].after].filter(Boolean)),n===this.routes&&(c.push([n.before,n.on].filter(Boolean)),h.after=h.after.concat([n.after].filter(Boolean)))),c.matched=!0,c.captures=h.captures,c.after=h.after,o(c)}return!1},f.prototype.insert=function(t,e,n,r){var i,o,s,a,h;if(e=e.filter(function(t){return t&&t.length>0}),r=r||this.routes,h=e.shift(),/\:|\*/.test(h)&&!/\\d|\\w/.test(h)&&(h=u(h,this.params)),e.length>0)return r[h]=r[h]||{},this.insert(t,e,n,r[h]);if(h||e.length||r!==this.routes){if(o=typeof r[h],s=Array.isArray(r[h]),r[h]&&!s&&"object"==o)switch(i=typeof r[h][t]){case"function":return void(r[h][t]=[r[h][t],n]);case"object":return void r[h][t].push(n);case"undefined":return void(r[h][t]=n)}else if("undefined"==o)return a={},a[t]=n,void(r[h]=a);throw new Error("Invalid route context: "+o)}switch(i=typeof r[t]){case"function":return void(r[t]=[r[t],n]);case"object":return void r[t].push(n);case"undefined":return void(r[t]=n)}},f.prototype.extend=function(t){function e(t){r._methods[t]=!0,r[t]=function(){var e=1===arguments.length?[t,""]:[t];r.on.apply(r,e.concat(Array.prototype.slice.call(arguments)))}}var n,r=this,i=t.length;for(n=0;i>n;n++)e(t[n])},f.prototype.runlist=function(t){var e=this.every&&this.every.before?[this.every.before].concat(r(t)):r(t);return this.every&&this.every.on&&e.push(this.every.on),e.captures=t.captures,e.source=t.source,e},f.prototype.mount=function(t,e){function n(e,n){var i=e,o=e.split(r.delimiter),s=typeof t[e],u=""===o[0]||!r._methods[o[0]],h=u?"on":i;return u&&(i=i.slice((i.match(new RegExp("^"+r.delimiter))||[""])[0].length),o.shift()),u&&"object"===s&&!Array.isArray(t[e])?(n=n.concat(o),void r.mount(t[e],n)):(u&&(n=n.concat(i.split(r.delimiter)),n=a(n,r.delimiter)),void r.insert(h,n,t[e]))}if(t&&"object"==typeof t&&!Array.isArray(t)){var r=this;e=e||[],Array.isArray(e)||(e=e.split(r.delimiter));for(var i in t)t.hasOwnProperty(i)&&n(i,e.slice(0))}}}("object"==typeof n?n:window)},{}],8:[function(e,n){(function(e,r){/*! | ||
* @overview es6-promise - a tiny implementation of Promises/A+. | ||
@@ -15,2 +15,2 @@ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) | ||
*/ | ||
(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function s(t){return"object"==typeof t&&null!==t}function u(){}function a(){return function(){e.nextTick(l)}}function h(){var t=0,e=new F(l),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=l,function(){t.port2.postMessage(0)}}function f(){return function(){setTimeout(l,1)}}function l(){for(var t=0;I>t;t+=2){var e=W[t],n=W[t+1];e(n),W[t]=void 0,W[t+1]=void 0}I=0}function p(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function y(t){try{return t.then}catch(e){return Z.error=e,Z}}function m(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function _(t,e,n){U(function(t){var r=!1,i=m(n,e,function(n){r||(r=!0,e!==n?b(t,n):x(t,n))},function(e){r||(r=!0,E(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,E(t,i))},t)}function w(t,e){e._state===z?x(t,e._result):t._state===V?E(t,e._result):L(e,void 0,function(e){b(t,e)},function(e){E(t,e)})}function g(t,e){if(e.constructor===t.constructor)w(t,e);else{var n=y(e);n===Z?E(t,Z.error):void 0===n?x(t,e):o(n)?_(t,e,n):x(t,e)}}function b(t,e){t===e?E(t,d()):i(e)?g(t,e):x(t,e)}function A(t){t._onerror&&t._onerror(t._result),k(t)}function x(t,e){t._state===Y&&(t._result=e,t._state=z,0===t._subscribers.length||U(k,t))}function E(t,e){t._state===Y&&(t._state=V,t._result=e,U(A,t))}function L(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+z]=n,i[o+V]=r,0===o&&t._state&&U(k,t)}function k(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?P(n,r,i,o):i(o);t._subscribers.length=0}}function j(){this.error=null}function O(t,e){try{return t(e)}catch(n){return K.error=n,K}}function P(t,e,n,r){var i,s,u,a,h=o(n);if(h){if(i=O(n,r),i===K?(a=!0,s=i.error,i=null):u=!0,e===i)return void E(e,v())}else i=r,u=!0;e._state!==Y||(h&&u?b(e,i):a?E(e,s):t===z?x(e,i):t===V&&E(e,i))}function T(t,e){try{e(function(e){b(t,e)},function(e){E(t,e)})}catch(n){E(t,n)}}function C(t,e,n,r){this._instanceConstructor=t,this.promise=new t(p,r),this._abortOnReject=n,this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&x(this.promise,this._result))):E(this.promise,this._validationError())}function R(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function S(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function M(t,e){this._id=te++,this._label=e,this._state=void 0,this._result=void 0,this._subscribers=[],p!==t&&(o(t)||R(),this instanceof M||S(),T(this,t))}var H;H=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B,D=H,I=(Date.now||function(){return(new Date).getTime()},Object.create||function(t){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof t)throw new TypeError("Argument must be an object");return u.prototype=t,new u},0),U=function(t,e){W[I]=t,W[I+1]=e,I+=2,2===I&&B()},N="undefined"!=typeof window?window:{},F=N.MutationObserver||N.WebKitMutationObserver,q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,W=new Array(1e3);B="undefined"!=typeof e&&"[object process]"==={}.toString.call(e)?a():F?h():q?c():f();var Y=void 0,z=1,V=2,Z=new j,K=new j;C.prototype._validateInput=function(t){return D(t)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var G=C;C.prototype._enumerate=function(){for(var t=this.length,e=this.promise,n=this._input,r=0;e._state===Y&&t>r;r++)this._eachEntry(n[r],r)},C.prototype._eachEntry=function(t,e){var n=this._instanceConstructor;s(t)?t.constructor===n&&t._state!==Y?(t._onerror=null,this._settledAt(t._state,e,t._result)):this._willSettleAt(n.resolve(t),e):(this._remaining--,this._result[e]=this._makeResult(z,e,t))},C.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===Y&&(this._remaining--,this._abortOnReject&&t===V?E(r,n):this._result[e]=this._makeResult(t,e,n)),0===this._remaining&&x(r,this._result)},C.prototype._makeResult=function(t,e,n){return n},C.prototype._willSettleAt=function(t,e){var n=this;L(t,void 0,function(t){n._settledAt(z,e,t)},function(t){n._settledAt(V,e,t)})};var J=function(t,e){return new G(this,t,!0,e).promise},Q=function(t,e){function n(t){b(o,t)}function r(t){E(o,t)}var i=this,o=new i(p,e);if(!D(t))return E(o,new TypeError("You must pass an array to race.")),o;for(var s=t.length,u=0;o._state===Y&&s>u;u++)L(i.resolve(t[u]),void 0,n,r);return o},X=function(t,e){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var r=new n(p,e);return b(r,t),r},$=function(t,e){var n=this,r=new n(p,e);return E(r,t),r},te=0,ee=M;M.all=J,M.race=Q,M.resolve=X,M.reject=$,M.prototype={constructor:M,then:function(t,e,n){var r=this,i=r._state;if(i===z&&!t||i===V&&!e)return this;r._onerror=null;var o=new this.constructor(p,n),s=r._result;if(i){var u=arguments[i-1];U(function(){P(i,o,u,s)})}else L(r,o,t,e);return o},"catch":function(t,e){return this.then(null,t,e)}};var ne=function(){var t;t="undefined"!=typeof r?r:"undefined"!=typeof window&&window.document?window:self;var e="Promise"in t&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var e;return new t.Promise(function(t){e=t}),o(e)}();e||(t.Promise=ee)},re={Promise:ee,polyfill:ne};"function"==typeof t&&t.amd?t(function(){return re}):"undefined"!=typeof n&&n.exports?n.exports=re:"undefined"!=typeof this&&(this.ES6Promise=re)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:6}]},{},[1])(1)}),fluir.version="0.2.9"; | ||
(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function s(t){return"object"==typeof t&&null!==t}function u(){}function a(){return function(){e.nextTick(l)}}function h(){var t=0,e=new F(l),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=l,function(){t.port2.postMessage(0)}}function f(){return function(){setTimeout(l,1)}}function l(){for(var t=0;I>t;t+=2){var e=W[t],n=W[t+1];e(n),W[t]=void 0,W[t+1]=void 0}I=0}function p(){}function d(){return new TypeError("You cannot resolve a promise with itself")}function v(){return new TypeError("A promises callback cannot return that same promise.")}function y(t){try{return t.then}catch(e){return Z.error=e,Z}}function m(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function _(t,e,n){U(function(t){var r=!1,i=m(n,e,function(n){r||(r=!0,e!==n?b(t,n):x(t,n))},function(e){r||(r=!0,E(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,E(t,i))},t)}function w(t,e){e._state===z?x(t,e._result):t._state===V?E(t,e._result):L(e,void 0,function(e){b(t,e)},function(e){E(t,e)})}function g(t,e){if(e.constructor===t.constructor)w(t,e);else{var n=y(e);n===Z?E(t,Z.error):void 0===n?x(t,e):o(n)?_(t,e,n):x(t,e)}}function b(t,e){t===e?E(t,d()):i(e)?g(t,e):x(t,e)}function A(t){t._onerror&&t._onerror(t._result),k(t)}function x(t,e){t._state===Y&&(t._result=e,t._state=z,0===t._subscribers.length||U(k,t))}function E(t,e){t._state===Y&&(t._state=V,t._result=e,U(A,t))}function L(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+z]=n,i[o+V]=r,0===o&&t._state&&U(k,t)}function k(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,s=0;s<e.length;s+=3)r=e[s],i=e[s+n],r?P(n,r,i,o):i(o);t._subscribers.length=0}}function j(){this.error=null}function O(t,e){try{return t(e)}catch(n){return K.error=n,K}}function P(t,e,n,r){var i,s,u,a,h=o(n);if(h){if(i=O(n,r),i===K?(a=!0,s=i.error,i=null):u=!0,e===i)return void E(e,v())}else i=r,u=!0;e._state!==Y||(h&&u?b(e,i):a?E(e,s):t===z?x(e,i):t===V&&E(e,i))}function T(t,e){try{e(function(e){b(t,e)},function(e){E(t,e)})}catch(n){E(t,n)}}function C(t,e,n,r){this._instanceConstructor=t,this.promise=new t(p,r),this._abortOnReject=n,this._validateInput(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._init(),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&x(this.promise,this._result))):E(this.promise,this._validationError())}function R(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function S(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function M(t,e){this._id=te++,this._label=e,this._state=void 0,this._result=void 0,this._subscribers=[],p!==t&&(o(t)||R(),this instanceof M||S(),T(this,t))}var H;H=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B,D=H,I=(Date.now||function(){return(new Date).getTime()},Object.create||function(t){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof t)throw new TypeError("Argument must be an object");return u.prototype=t,new u},0),U=function(t,e){W[I]=t,W[I+1]=e,I+=2,2===I&&B()},N="undefined"!=typeof window?window:{},F=N.MutationObserver||N.WebKitMutationObserver,q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,W=new Array(1e3);B="undefined"!=typeof e&&"[object process]"==={}.toString.call(e)?a():F?h():q?c():f();var Y=void 0,z=1,V=2,Z=new j,K=new j;C.prototype._validateInput=function(t){return D(t)},C.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},C.prototype._init=function(){this._result=new Array(this.length)};var G=C;C.prototype._enumerate=function(){for(var t=this.length,e=this.promise,n=this._input,r=0;e._state===Y&&t>r;r++)this._eachEntry(n[r],r)},C.prototype._eachEntry=function(t,e){var n=this._instanceConstructor;s(t)?t.constructor===n&&t._state!==Y?(t._onerror=null,this._settledAt(t._state,e,t._result)):this._willSettleAt(n.resolve(t),e):(this._remaining--,this._result[e]=this._makeResult(z,e,t))},C.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===Y&&(this._remaining--,this._abortOnReject&&t===V?E(r,n):this._result[e]=this._makeResult(t,e,n)),0===this._remaining&&x(r,this._result)},C.prototype._makeResult=function(t,e,n){return n},C.prototype._willSettleAt=function(t,e){var n=this;L(t,void 0,function(t){n._settledAt(z,e,t)},function(t){n._settledAt(V,e,t)})};var J=function(t,e){return new G(this,t,!0,e).promise},Q=function(t,e){function n(t){b(o,t)}function r(t){E(o,t)}var i=this,o=new i(p,e);if(!D(t))return E(o,new TypeError("You must pass an array to race.")),o;for(var s=t.length,u=0;o._state===Y&&s>u;u++)L(i.resolve(t[u]),void 0,n,r);return o},X=function(t,e){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var r=new n(p,e);return b(r,t),r},$=function(t,e){var n=this,r=new n(p,e);return E(r,t),r},te=0,ee=M;M.all=J,M.race=Q,M.resolve=X,M.reject=$,M.prototype={constructor:M,then:function(t,e,n){var r=this,i=r._state;if(i===z&&!t||i===V&&!e)return this;r._onerror=null;var o=new this.constructor(p,n),s=r._result;if(i){var u=arguments[i-1];U(function(){P(i,o,u,s)})}else L(r,o,t,e);return o},"catch":function(t,e){return this.then(null,t,e)}};var ne=function(){var t;t="undefined"!=typeof r?r:"undefined"!=typeof window&&window.document?window:self;var e="Promise"in t&&"resolve"in t.Promise&&"reject"in t.Promise&&"all"in t.Promise&&"race"in t.Promise&&function(){var e;return new t.Promise(function(t){e=t}),o(e)}();e||(t.Promise=ee)},re={Promise:ee,polyfill:ne};"function"==typeof t&&t.amd?t(function(){return re}):"undefined"!=typeof n&&n.exports?n.exports=re:"undefined"!=typeof this&&(this.ES6Promise=re)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:6}]},{},[1])(1)}),fluir.version="0.2.12"; |
{ | ||
"name": "fluir", | ||
"version": "0.2.10", | ||
"version": "0.2.12", | ||
"description": "Dispatcher, router, store helper for React apps.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
181112
2737