/**
 * @license
 * Inject (c) 2011 LinkedIn [https://github.com/linkedin/inject] Apache Software License 2.0
 * lscache (c) 2011 Pamela Fox [https://github.com/pamelafox/lscache] Apache Software License 2.0
 * GoWithTheFlow.js (c) 2011 Jerome Etienne, [https://github.com/jeromeetienne/gowiththeflow.js] MIT License
 */
!function(context,undefined){function proxy(e,t){if(!t)throw Error("proxying requires a scope");if(!e)throw Error("proxying requires a function");return function(){return e.apply(t,arguments)}}function each(e,t){for(var n=0,r=e.length;r>n;n++)t(e[n])}function addListener(e,t,n){window.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function getDomainName(e){return e.match(reURI)[3]}function sendMessage(e,t,n,r){r||(r={}),r=JSON.stringify(r),e.postMessage([n,r].join(":"),t)}var IS_IE=eval("/*@cc_on!@*/false");(function(){var e=navigator.userAgent.toLowerCase();-1!==e.indexOf("gecko")&&(IS_GK=!0)})();var FILE_STORAGE_TOKEN="INJECT",LSCACHE_SCHEMA_VERSION=1,LSCACHE_SCHEMA_VERSION_STRING="!version",LSCACHE_APP_KEY_STRING="!appCacheKey",AMD_DEFERRED="###DEFERRED###",NAMESPACE="Inject",FILE_SUFFIX_REGEX=/.*?\.(js|txt)(\?.*)?$/,BASIC_FILE_SUFFIX=".js",HOST_PREFIX_REGEX=/^https?:\/\//,HOST_SUFFIX_REGEX=/^(.*?)(\/.*|$)/,RESPONSE_SLICER_REGEX=/^(.+?)[\s]+([\w\W]+?)[\s]+([\w\W]+)$/m,FUNCTION_REGEX=/^[\s\(]*function[^\(]*\(([^)]*)\)/,FUNCTION_NEWLINES_REGEX=/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,FUNCTION_BODY_REGEX=/[\w\W]*?\{([\w\W]*)\}/m,WHITESPACE_REGEX=/\s+/g,REQUIRE_REGEX=RegExp("(?:^|[\\s;,=\\?:\\}\\)\\(])require[\\s]*\\(['\"]([^'\"]+?)['\"]\\)","gim"),DEFINE_REGEX=RegExp("(?:^|[\\s;,\\?\\}\\)\\(])define[\\s]*\\([\\w\\W]*?\\[([\\w\\W]*?)\\]","gim"),DEFINE_TERM_REGEX=RegExp("['\"]([\\w\\W]*?)['\"]","gim"),IS_AMD_REGEX=/(?:^|[\s]+)define[\s]*\(/g,BUILTINS={require:!0,exports:!0,module:!0},BUILTINS_REPLACE_REGEX=/[\s]|"|'|(require)|(exports)|(module)/g,GREEDY_REQUIRE_REXEX=/require.*/,JS_COMMENTS_REGEX=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,RELATIVE_PATH_REGEX=/^(\.{1,2}\/).+/,ABSOLUTE_PATH_REGEX=/^([A-Za-z]+:)?\/\//,PROTOCOL_REGEX=/:\/\//,PROTOCOL_STRING="://",PROTOCOL_EXPANDED_REGEX=/__INJECT_PROTOCOL_COLON_SLASH_SLASH__/,PROTOCOL_EXPANDED_STRING="__INJECT_PROTOCOL_COLON_SLASH_SLASH__",HAS_OWN_PROPERTY=Object.prototype.hasOwnProperty,HAS_LOCAL_STORAGE=function(){try{return localStorage.setItem("injectLStest","ok"),localStorage.removeItem("injectLStest"),!0}catch(e){return!1}}(),userConfig={moduleRoot:null,fileExpires:0,useSuffix:!0,xd:{relayFile:null},debug:{sourceMap:!1,logging:!1}},context=this,userModules={},isHostMethod=function(e,t){var n=typeof e[t];return"function"===n||!("object"!==n||!e[t])||"unknown"===n},debugLog=function(){};(function(){var e="undefined"!=typeof console&&console.log&&"function"==typeof console.log,t=function(e,t){userConfig.debug&&userConfig.debug.logging&&console.log("## "+e+" ##"+"\n"+t)};e&&(debugLog=t)})();var addListener,removeListener;(function(e){e.addEventListener?(addListener=function(e,t,n,r){e.addEventListener(t,n,r||!1)},removeListener=function(e,t,n,r){e.removeEventListener(t,n,r||!1)}):(addListener=function(e,t,n){e.attachEvent("on"+t,n)},removeListener=function(e,t,n){e.detachEvent("on"+t,n)})})(window);var commonJSHeader=["","__INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.fn = function() {","  with (window) {","    __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.innerFn = function() {","      // id: __MODULE_ID__ uri: __MODULE_URI__","      var module = __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.module,","          require = __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.require,","          define = __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.define,","          exports = module.exports;","      try{module.undefined_function();}catch(e){module.__error_line = e;}"].join("\n"),commonJSFooter=["","      __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.module = module;","    };",'    __INJECT_NS__.INTERNAL.defineExecutingModuleAs("__MODULE_ID__", "__MODULE_URI__");',"    try {","      __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.innerFn.call(__INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.module);","    }","    catch (__EXCEPTION__) {","      __INJECT_NS__.INTERNAL.executor.__FUNCTION_ID__.module.__error = __EXCEPTION__;","    }","    __INJECT_NS__.INTERNAL.undefineExecutingModule();","  }","};",""].join("\n");(function(){(function(e,t){"object"==typeof exports?module.exports=t(this):"function"==typeof define&&define.amd?define(function(){return t(e)}):e.Fiber=t(e)})(this,function(e){function t(e,t){var n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function n(){}var r=!1,o=Array.prototype,i=e.Fiber;return n.extend=function(e){function o(){r||(this.init.apply(this,arguments),this.init=void 0)}var i,u=this.prototype,s=e(u);return r=!0,i=o.prototype=new this,r=!1,i.init=function(){"function"==typeof u.init&&u.init.apply(this,arguments)},t(s,i),i.constructor=o,o.__base__=u,o.extend=o.prototype.extend||n.extend,o},n.proxy=function(e,t){var n,r,o={};1===arguments.length&&(t=e,e=t.constructor.__base__),r=function(n){return function(){return e[n].apply(t,arguments)}};for(n in e)e.hasOwnProperty(n)&&"function"==typeof e[n]&&(o[n]=r(n));return o},n.decorate=function(e){var n,r=e.constructor.__base__,i=o.slice.call(arguments,1),u=i.length;for(n=0;u>n;n++)t(i[n].call(e,r),e)},n.mixin=function(e){var n,r=e.__base__,i=o.slice.call(arguments,1),u=i.length;for(n=0;u>n;n++)t(i[n](r),e.prototype)},n.noConflict=function(){return e.Fiber=i,n},n})})();var Fiber=this.Fiber.noConflict(),Flow=function(){var e,t=[],n=setTimeout(function(){n=null,e._next()},0);return e={destroy:function(){n&&clearTimeout(n)},par:function(n,r){return!r&&t[t.length-1]instanceof Array||t.push([]),t[t.length-1].push(n),e},seq:function(t){return e.par(t,!0)},_next:function(n,r){for(var o=[],i=[],u=t.shift()||[],s=u.length,a=1==s,c=0;u.length>c;c++)(function(t,u){t(function(t,n){o[u]=t,i[u]=n,0==--s&&e._next(a?o[0]:o,a?i[0]:i)},n,r)})(u[c],c)}}},lscache=function(){function e(){if(void 0!==o)return o;try{n("__lscachetest__","__lscachetest__"),r("__lscachetest__"),o=!0}catch(e){o=!1}return o}function t(){return void 0===i&&(i=null!=window.JSON),i}function n(e,t){localStorage.removeItem(u+a+e),localStorage.setItem(u+a+e,t)}function r(e){localStorage.removeItem(u+a+e)}var o,i,u="lscache-",s=Math.floor(144e9),a="";return{set:function(o,i,c){if(e()){if("string"!=typeof i){if(!t())return;try{i=JSON.stringify(i)}catch(l){return}}try{n(o,i)}catch(f){if("QUOTA_EXCEEDED_ERR"!==f.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==f.name)return;for(var d,h=[],g=0;localStorage.length>g;g++)if(d=localStorage.key(g),0===d.indexOf(u+a)&&0>d.indexOf("-cacheexpiration")){d=d.substr((u+a).length);var p=localStorage.getItem(u+a+(d+"-cacheexpiration")),p=p?parseInt(p,10):s;h.push({key:d,size:(localStorage.getItem(u+a+d)||"").length,expiration:p})}for(h.sort(function(e,t){return t.expiration-e.expiration}),g=(i||"").length;h.length&&g>0;)d=h.pop(),r(d.key),r(d.key+"-cacheexpiration"),g-=d.size;try{n(o,i)}catch(_){return}}c?n(o+"-cacheexpiration",(Math.floor((new Date).getTime()/6e4)+c).toString(10)):r(o+"-cacheexpiration")}},get:function(n){if(!e())return null;var o=n+"-cacheexpiration",i=localStorage.getItem(u+a+o);if(i&&(i=parseInt(i,10),Math.floor((new Date).getTime()/6e4)>=i))return r(n),r(o),null;if(n=localStorage.getItem(u+a+n),!n||!t())return n;try{return JSON.parse(n)}catch(s){return n}},remove:function(t){return e()?(r(t),r(t+"-cacheexpiration"),undefined):null},supported:function(){return e()},flush:function(){if(e())for(var t=localStorage.length-1;t>=0;--t){var n=localStorage.key(t);0===n.indexOf(u+a)&&localStorage.removeItem(n)}},setBucket:function(e){a=e},resetBucket:function(){a=""}}}();(function(){var e;HAS_LOCAL_STORAGE&&lscache&&(lscache.setBucket(FILE_STORAGE_TOKEN),e=lscache.get(LSCACHE_SCHEMA_VERSION_STRING),e&&e>0&&LSCACHE_SCHEMA_VERSION>e&&(lscache.flush(),lscache.set(LSCACHE_SCHEMA_VERSION_STRING,LSCACHE_SCHEMA_VERSION)))})();var reURI=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,getXHR=function(){for(var e=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],t=!1,n=0;e.length>n;n++){try{e[n](),t=e[n]}catch(r){continue}break}return t}(),Analyzer;(function(){var e=Fiber.extend(function(){return{init:function(){},stripBuiltins:function(e){var t=[],n=e.length,r=0;for(r;n>r;r++)BUILTINS[e[r]]||t.push(e[r]);return t},extractRequires:function(e){var t,n,r,o=[],i={require:1,module:1,exports:1};if(!e)return[];for(e=e.replace(JS_COMMENTS_REGEX,"");t=REQUIRE_REGEX.exec(e);)r=t[1],i[r]||(i[r]=1,o.push(r));for(;t=DEFINE_REGEX.exec(e);)for(;n=DEFINE_TERM_REGEX.exec(t[1]);)r=n[1],i[r]||(i[r]=1,o.push(r));return o}}});Analyzer=new e})();var Communicator;(function(){var e=Fiber.extend(function(){function e(){var e=d;d=[],h={};for(var t=0,n=e.length;n>t;t++)sendMessage(c.contentWindow,userConfig.xd.relayFile,"fetch",{url:e[t]})}function t(e){h[e]||(h[e]=1,d.push(e))}function n(){f||(f=!0,addListener(window,"message",function(t){var n,r,o;if(userConfig.xd.relayFile&&getDomainName(t.origin)===getDomainName(userConfig.xd.relayFile)&&t.source&&t.source===c.contentWindow)switch(n=t.data.split(/:/),r=n.shift()){case"ready":l=!1,e();break;case"fetchFail":case"fetchOk":o=JSON.parse(n.join(":")),u(o.url,o.status,o.responseText)}}))}function r(){downloadCompleteQueue={}}function o(e,t){return userConfig.fileExpires>0?lscache.set(e,t,userConfig.fileExpires):null}function i(e){return userConfig.fileExpires>0?lscache.get(e):null}function u(e,t,n){t=1*t,debugLog("Communicator ("+e+")","status "+t+". Length: "+(n?n.length:"NaN")),200!==t||userConfig.xd.relayFile||o(e,n),200!==t&&(n="throw new Error('Error "+t+": Unable to retrieve "+e+"');"),each(downloadCompleteQueue[e],function(e){e(n)}),downloadCompleteQueue[e]=[]}function s(e){if(n(),c&&!l)sendMessage(c.contentWindow,userConfig.xd.relayFile,"fetch",{url:e});else{if(c&&l)return t(e),undefined;l=!0,t(e);var r=userConfig.xd.relayFile;c=document.createElement("iframe"),r+=0>r.indexOf("?")?"?":"&",r+="injectReturn="+encodeURIComponent(location.href),c.src=r,c.style.visibility="hidden",c.style.border=0,c.style.width="1px",c.style.height="1px",c.style.left="-5000px",c.style.top="-5000px",c.style.opacity="0",window.setTimeout(function(){document.body.firsChild?document.body.insertBefore(c,document.body.firstChild):document.body.appendChild(c)})}}function a(e){var t=getXHR();t.open("GET",e),t.onreadystatechange=function(){4===t.readyState&&u(e,t.status,t.responseText)},t.send(null)}var c,l,f=!1,d=[],h={};return{init:function(){this.clearCaches()},clearCaches:function(){r()},noop:function(e,t,n){n("")},get:function(e,t,n){if(downloadCompleteQueue[t]||(downloadCompleteQueue[t]=[]),debugLog("Communicator ("+t+")","requesting"),!userConfig.xd.relayFile){var r=i(t);if(r)return debugLog("Communicator ("+t+")","retireved from cache. length: "+r.length),n(r),undefined}return debugLog("Communicator ("+t+")","queued"),downloadCompleteQueue[t].length?(downloadCompleteQueue[t].push(n),debugLog("Communicator ("+t+")","request already in progress"),undefined):(downloadCompleteQueue[t].push(n),userConfig.xd.relayFile?(s(t),undefined):(a(t),undefined))}}});Communicator=new e})();var Executor;(function(){function hasOwnProperty(e,t){return{}.prototype.hasOwnProperty.call(e,t)}function executeJavaScriptModule(code,functionId){var meta=context.Inject.INTERNAL.executor[functionId],module=meta.module,failed=!1,sourceString=IS_IE?"":"//@ sourceURL="+module.uri,result,err;code=[code,sourceString].join("\n");try{eval(code)}catch(ex){ex.message="Parse error in "+module.id+" ("+module.uri+") please check for an uncaught error "+ex.message;var scr=document.createElement("script");return scr.src=module.uri,scr.type="text/javascript",docHead.appendChild(scr),{__error:ex}}if(userConfig.debug.sourceMap){var toExec=code.replace(/([\w\W]+?)=([\w\W]*\})[\w\W]*?$/,"$1 = ($2)();");toExec=[toExec,sourceString].join("\n"),eval(toExec),module.__error&&(module.__error.message="Runtime error in "+module.id+"("+module.uri+") "+module.__error.message)}else context.Inject.INTERNAL.executor[functionId].fn(),module.__error&&(module.__error.message="Runtime error in "+module.id+"("+module.uri+") "+module.__error.message)}var moduleFailureCache={},docHead=!1;try{docHead=document.getElementsByTagName("head")[0]}catch(e){docHead=!1}var stacknorm={mode:function(e){if(e.arguments&&e.stack)return"chrome";if(e.stack&&e.sourceURL)return"safari";if(e.stack&&e.number)return"ie";if(e.stack&&e.fileName)return"firefox";if(e.message&&e["opera#sourceloc"])return e.stacktrace?e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?"opera9":"opera10a":"opera9";if(e.message&&e.stack&&e.stacktrace)return 0>e.stacktrace.indexOf("called from line")?"opera10b":"opera11";if(e.stack&&!e.fileName){var t=/:[\d]+:[\d]+\)?(\n|$)/;return t.test(e.stack)?"chrome":"phantom"}return"other"},chrome:function(e){return(e.stack+"\n").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}() ($1)$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}() ($1)").replace(/^(.+) \((.+)\)$/gm,"$1@$2").split("\n").slice(1,-1)},phantom:function(e){return(e.stack+"\n").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}() ($1)$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}() ($1)").replace(/^(.+) \((.+)\)$/gm,"$1@$2").replace(/(.+):([0-9]+)(\)?)/g,"$1:$2:0$3").split("\n").slice(1,-1)},safari:function(e){return e.stack.replace(/\[native code\]\n/m,"").replace(/^(?=\w+Error\:).*$\n/m,"").replace(/^@/gm,"{anonymous}()@").split("\n")},ie:function(e){return e.stack.replace(/^\s*at\s+(.*)$/gm,"$1").replace(/^Anonymous function\s+/gm,"{anonymous}() ").replace(/^(.+)\s+\((.+)\)$/gm,"$1@$2").split("\n").slice(1)},firefox:function(e){return e.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^(?:\((\S*)\))?@/gm,"{anonymous}($1)@").split("\n")},opera11:function(e){for(var t="{anonymous}",n=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/,r=e.stacktrace.split("\n"),o=[],i=0,u=r.length;u>i;i+=2){var s=n.exec(r[i]);if(s){var a=s[4]+":"+s[1]+":"+s[2],c=s[3]||"global code";c=c.replace(/<anonymous function: (\S+)>/,"$1").replace(/<anonymous function>/,t),o.push(c+"@"+a+" -- "+r[i+1].replace(/^\s+/,""))}}return o},opera10b:function(e){for(var t=/^(.*)@(.+):(\d+)$/,n=e.stacktrace.split("\n"),r=[],o=0,i=n.length;i>o;o++){var u=t.exec(n[o]);if(u){var s=u[1]?u[1]+"()":"global code";r.push(s+"@"+u[2]+":"+u[3])}}return r},opera10a:function(e){for(var t="{anonymous}",n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),o=[],i=0,u=r.length;u>i;i+=2){var s=n.exec(r[i]);if(s){var a=s[3]||t;o.push(a+"()@"+s[2]+":"+s[1]+" -- "+r[i+1].replace(/^\s+/,""))}}return o},opera9:function(e){for(var t="{anonymous}",n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),o=[],i=2,u=r.length;u>i;i+=2){var s=n.exec(r[i]);s&&o.push(t+"()@"+s[2]+":"+s[1]+" -- "+r[i+1].replace(/^\s+/,""))}return o},other:function(e){for(var t,n,r="{anonymous}",o=/function\s*([\w\-$]+)?\s*\(/i,i=[],u=10;e&&e.arguments&&u>i.length;)t=o.test(""+e)?RegExp.$1||r:r,n=Array.prototype.slice.call(e.arguments||[]),i[i.length]=t+"("+this.stringifyArguments(n)+")",e=e.caller;return i}},AsStatic=Fiber.extend(function(){var e=0;return{init:function(){this.clearCaches()},clearCaches:function(){this.cache={},this.errors={},this.anonymousAMDStack=[]},defineExecutingModuleAs:function(e,t){return this.anonymousAMDStack.push({id:e,path:t})},undefineExecutingModule:function(){return this.anonymousAMDStack.pop()},getCurrentExecutingAMD:function(){return this.anonymousAMDStack[this.anonymousAMDStack.length-1]},getFromCache:function(e){var t,n,r,o,i,u,s,a,c,l,f=RulesEngine.getOriginalName(e);if(HAS_OWN_PROPERTY.call(this.errors,e)&&this.errors[e]?t=this.errors[e]:f&&HAS_OWN_PROPERTY.call(this.errors,f)&&this.errors[f]&&(t=this.errors[f]),this.cache[e]?r=this.cache[e]:f&&this.cache[f]&&(this.cache[e]=this.cache[f],r=this.cache[f]),t)throw n="module "+e+" failed to load successfully",n+=t?": "+t.message:"",r&&r.__error_line&&(o=stacknorm.mode(t),i=stacknorm[o](t),u=stacknorm[o](r.__error_line),s=i[0].split(/:/),a=u[0].split(/:/),c=s[s.length-2]-a[a.length-2],c-=1,l=s[s.length-1],n=n+" @ Line: "+c+" Column: "+l+" "),t.message=n,t;return r||null},createModule:function(e,t,n){var r;return!/\!/.test(e)&&this.cache[e]?(this.cache[t]=this.cache[e],this.cache[e]):(r={},r.id=e||null,r.qualifiedId=t||null,r.uri=n||null,r.exports={},r.exec=!1,r.setExports=function(e){var t;for(t in r.exports)if(Object.hasOwnProperty.call(r.exports,t))return debugLog("cannot setExports when exports have already been set. setExports skipped"),undefined;switch(typeof e){case"object":for(t in e)r.exports[t]=e[t];break;case"function":r.exports=e;break;default:r.exports=e}},/\!/.test(e)||(this.cache[e]=r),this.cache[t]=r,r)},getModule:function(e,t){return this.getFromCache(e)||t},runModule:function(t,n){function r(e){return e.replace(/__MODULE_ID__/g,t.id).replace(/__MODULE_URI__/g,t.uri).replace(/__FUNCTION_ID__/g,o).replace(/__INJECT_NS__/g,NAMESPACE)}debugLog("Executor","executing "+t.uri);var o="exec"+e++,i={};context.Inject.INTERNAL.executor[o]=i,i.module=t,i.require=RequireContext.createRequire(t.id,t.uri,t.qualifiedId),i.define=RequireContext.createInlineDefine(t,i.require);var u=r(commonJSHeader),s=r(commonJSFooter),a=[u,";",n,s].join("\n");executeJavaScriptModule(a,o),t.__error&&(debugLog("Executor","broken",t.id,t.uri,t.exports),this.errors[t.id]=t.__error),debugLog("Executor","executed",t.id,t.uri,t.exports)}}});Executor=new AsStatic})();var InjectCore;(function(){var e=Fiber.extend(function(){return{init:function(){},plugin:function(e,t,n,r){RulesEngine.addRule(RegExp("^"+e+"!"),t),r.plugins=r.plugins||{},r.plugins[e]=n},setModuleRoot:function(e){userConfig.moduleRoot=e},setCrossDomain:function(e){userConfig.xd.relayFile=e.relayFile||null},setUseSuffix:function(e){userConfig.useSuffix=e},clearCache:function(){HAS_LOCAL_STORAGE&&lscache&&lscache.flush()},setExpires:function(e){userConfig.fileExpires=e||0},setCacheKey:function(e){var t;return HAS_LOCAL_STORAGE&&lscache?(t=lscache.get(LSCACHE_APP_KEY_STRING),(!e&&t||null!==t&&t!==e||null===t&&e)&&(lscache.flush(),lscache.set(LSCACHE_APP_KEY_STRING,e)),undefined):!1},reset:function(){this.clearCache(),Executor.clearCaches(),Communicator.clearCaches()},enableDebug:function(e,t){userConfig.debug[e]=t||!0}}});InjectCore=new e})();var RequireContext=Fiber.extend(function(){return{init:function(e,t,n){this.id=e||null,this.path=t||null,this.qualifiedId=n||null},log:function(e){debugLog("RequireContext for "+this.path,e)},getPath:function(){if(!userConfig.moduleRoot)throw Error("moduleRoot must be defined. Please use Inject.setModuleRoot()");return this.path||userConfig.moduleRoot},getId:function(){return this.id||""},require:function(e,t){var n,r,o;if("string"==typeof e){if(this.log("CommonJS require(string) of "+e),/^[\d]+$/.test(e))throw Error("require() must be a string containing a-z, slash(/), dash(-), and dots(.)");if(r=RulesEngine.resolveModule(e,this.getId()),o=RequireContext.qualifiedId(r,this.qualifiedId),o&&(n=Executor.getModule(o)),n||(n=Executor.getModule(r)),!n)throw Error("module "+e+" is not available");if(n.__error)throw n.__error;return n.exports}this.log("AMD require(Array) of "+e.join(", "));var i=[];this.ensure(e,proxy(function(n){for(var r=0,o=e.length;o>r;r++)switch(e[r]){case"require":i.push(n);break;case"module":case"exports":throw Error("require(array, callback) doesn't create a module. You cannot use module/exports here");default:i.push(n(e[r]))}t.apply(context,i)},this))},ensure:function(e,t){if("[object Array]"!==Object.prototype.toString.call(e))throw Error("require.ensure() must take an Array as the first argument");this.log("CommonJS require.ensure(array) of "+e.join(", ")),e=Analyzer.stripBuiltins(e);var require=proxy(this.require,this);this.process(e,function(){"function"==typeof t&&t(require)})},run:function(e){this.log("AMD require.run(string) of "+e),this.ensure([e])},define:function(){var e,t,n=Array.prototype.slice.call(arguments,0),r=null,o=["require","exports","module"],i=!1,u={},s={"string array object":["id","dependencies","factory"],"string object":["id","factory"],"array object":["dependencies","factory"],object:["factory"]},a=[];for(t=0,len=n.length;len>t;t++)"[object Array]"===Object.prototype.toString.apply(n[t])?a.push("array"):"object"==typeof n[t]||"function"==typeof n[t]?a.push("object"):a.push(typeof n[t]);if(a=a.join(" "),!s[a])throw Error("You did not use an AMD compliant interface. Please check your define() calls");for(a=s[a],t=0,len=a.length;len>t;t++)switch(e=n[t],a[t]){case"id":r=e;break;case"dependencies":o=e,i=!0;break;case"factory":u=e}if(!r){if(currentExecutingAMD=Executor.getCurrentExecutingAMD(),!currentExecutingAMD)throw Error("Anonymous AMD module used, but it was not included as a dependency. This is most often caused by an anonymous define() from a script tag.");r=currentExecutingAMD.id,this.log("AMD identified anonymous module as "+r)}this.process(r,o,function(e){if(e.data.resolvedId){for(var t,n=[],r=i?o:["require","exports","module"],require=RequireContext.createRequire(e.data.resolvedId,e.data.resolvedUrl),s=Executor.createModule(e.data.resolvedId,RequireContext.qualifiedId(e),e.data.resolvedUrl),a=0,c=r.length;c>a;a++)switch(r[a]){case"require":n.push(require);break;case"module":n.push(s);break;case"exports":n.push(s.exports);break;default:n.push(require(r[a]))}"function"==typeof u?(t=u.apply(s,n),t&&(s.exports=t)):"object"==typeof u&&(s.exports=u),s.amd=!0,s.exec=!0}})},process:function(e){var t,n,r;"string"!=typeof e?(t=this.id,n=arguments[0],r=arguments[1]):(t=arguments[0],n=arguments[1],r=arguments[2]);var o,u,s=new TreeNode,a=n.length,c=[],l=function(){(0===a||0===--a)&&(u=new TreeRunner(s),u.execute(function(){r(s)}))};if(s.data.originalId=t,s.data.resolvedId=t,s.data.resolvedUrl=RulesEngine.resolveFile(t,this.path),n.length)for(i=0,len=n.length;len>i;i++)BUILTINS[n[i]]?l():(o=new TreeNode,o.data.originalId=n[i],s.addChild(o),Executor.getModule(n[i])?l():Executor.getModule(RequireContext.qualifiedId(RulesEngine.resolveModule(o.data.originalId,s.data.resolvedId),o))?l():(u=new TreeRunner(o),c.push(u),u.download(l)));else l()}}});RequireContext.createRequire=function(e,t,n){var r=new RequireContext(e,t,n),require=proxy(r.require,r);return require.ensure=proxy(r.ensure,r),require.run=proxy(r.run,r),require.toUrl=function(n){var r=RulesEngine.resolveModule(n,e),o=RulesEngine.resolveFile(r,t,!0);return o},require},RequireContext.createDefine=function(e,t,n){var r=new RequireContext(e,t),define=proxy(r.define,r);return define.amd=n?!1:{},define},RequireContext.qualifiedId=function(e,t){var n=[];return"string"==typeof e?t?[e,t].join("(from)"):e:(e.parents(function(e){e.data.resolvedId&&n.push(e.data.resolvedId)}),n.join("(from)"))},RequireContext.createInlineDefine=function(e,require){var define=function(){function t(e){return"[object Array]"===Object.prototype.toString.call(e)}for(var n,r=[],o=["require","exports","module"],i={},u=0,s=arguments.length;s>u;u++)if(t(arguments[u])){o=arguments[u];break}i=arguments[arguments.length-1];for(var a=0,c=o.length;c>a;a++)switch(o[a]){case"require":r.push(require);break;case"module":r.push(e);break;case"exports":r.push(e.exports);break;default:r.push(require(o[a]))}"function"==typeof i?(n=i.apply(e,r),n&&(e.exports=n)):"object"==typeof i&&(e.exports=i),e.amd=!0,e.exec=!0};return define.amd={},define};var RulesEngine;(function(){var e=/^\/+/g,t=function(e){return e=e.split("/"),e.pop(),e=e.join("/")},n=Fiber.extend(function(){return{init:function(){this.clearRules()},clearRules:function(){this.moduleRules=[],this.fileRules=[],this.contentRules=[],this.fetchRules=[],this.aliasRules={},this.revAliasRules={},this.dirty={moduleRules:!0,fileRules:!0,contentRules:!0,fetchRules:!0,aliasRules:!0,revAliasRules:!0},this.caches={moduleRules:{},fileRules:{},contentRules:{},fetchRules:{},aliasRules:{},revAliasRules:{}},this.addRuleCounter=0,this.addRulePointcuts={}},add:function(e,t,n,r){this.dirty[e]=!0,r=r||{};var o=r.weight||this[e].length,i=r.last||!1;this[e].push({matches:t,fn:"function"==typeof n?n:function(){return n},weight:o,last:i,all:r})},clearCache:function(e){this.caches[e]={}},sort:function(e){this.dirty[e]&&(this.clearCache(e),this[e].sort(function(e,t){return t.weight-e.weight}),this.dirty[e]=!1)},getDeprecatedPointcuts:function(e){return this.addRulePointcuts[e]||[]},addRule:function(e,t,n){n||(n=t,t=null),n||(n={}),"string"==typeof n&&(n={path:n}),n.weight||(n.weight=this.addRuleCounter++),n.path?this.addFileRule(e,n.path,{weight:n.weight,last:n.last,useSuffix:n.useSuffix,afterFetch:n.pointcuts&&n.pointcuts.afterFetch?n.pointcuts.afterFetch:null}):n.pointcuts&&n.pointcuts.afterFetch&&this.addContentRule(e,n.pointcuts.afterFetch,{weight:n.weight})},addModuleRule:function(e,t,n){return this.add("moduleRules",e,t,n)},addFileRule:function(e,t,n){return this.add("fileRules",e,t,n)},addContentRule:function(e,t,n){return this.add("contentRules",e,t,n)},addFetchRule:function(e,t,n){return this.add("fetchRules",e,t,n)},addPackage:function(e,t){if(this.dirty.aliasRules=!0,this.revAliasRules[e])throw Error("An alias can only map back to 1 origin");this.aliasRules[e]||(this.aliasRules[e]=[]),this.aliasRules[e].push(t),this.revAliasRules[t]=e},resolveModule:function(n,r){n=n||"",r=r||"",this.sort("moduleRules");var o,i,u=n,s=0,a=this.moduleRules,c=a.length,l=!1;for(s;c>s&&(o=a[s].matches,i=a[s].fn,l=!1,"string"==typeof o?o===n&&(l=!0):"function"==typeof o.test&&(l=o.test(n)),!l||(u=i(u),!o.last));s++);return u=u.replace(e,""),0!==u.indexOf(".")&&(r=null),r&&(r=t(r)),u=this.getRelative(u,r),u=u.replace(e,""),this.caches.moduleRules[n]=u,u},resolveFile:function(e,t,n){e=e||"",t=t||"",this.sort("fileRules");var r,o,i=e,u=0,s=this.fileRules,a=s.length,c=!1,l=[];for(u;a>u&&(r=s[u].matches,o=s[u].fn,c=!1,"string"==typeof r?r===e&&(c=!0):"function"==typeof r.test&&(c=r.test(e)),!c||(i=o(i),s[u].all&&s[u].all.afterFetch&&l.push(s[u].all.afterFetch),!s[u].last));u++);return userConfig.moduleRoot||"undefined"==typeof console||"function"!=typeof console.log||console.log("Without moduleRoot defined, Inject will default to the URL of the current page. This may cause unexpected behavior"),i?(t&&!userConfig.baseDir?(t=t.replace(PROTOCOL_REGEX,PROTOCOL_EXPANDED_STRING).split("/"),t[t.length-1]&&1!==t.length&&t.pop(),t=t.join("/").replace(PROTOCOL_EXPANDED_REGEX,PROTOCOL_STRING)):t=t?userConfig.baseDir(t):userConfig.moduleRoot?userConfig.moduleRoot:location.pathname,ABSOLUTE_PATH_REGEX.test(i)?(this.caches.fileRules[e]=i,i):(t=t.replace(PROTOCOL_REGEX,PROTOCOL_EXPANDED_STRING),i=i.replace(PROTOCOL_REGEX,PROTOCOL_EXPANDED_STRING),i=/\?/.test(t)?t+i:this.getRelative(i,t),i=i.replace(PROTOCOL_EXPANDED_REGEX,PROTOCOL_STRING),n||!userConfig.useSuffix||FILE_SUFFIX_REGEX.test(i)||(i+=BASIC_FILE_SUFFIX),this.addRulePointcuts[i]=l,this.caches.fileRules[e]=i,i)):(this.addRulePointcuts[i]=l,this.caches.fileRules[e]=i,i)},getAliases:function(e){return this.aliasRules[e]||[]},getOriginalName:function(e){return this.revAliasRules[e]||null},getFetchRules:function(e){this.sort("fetchRules");var t,n,r=0,o=this.fetchRules,i=o.length,u=!1,s=[];for(r;i>r;r++)t=o[r].matches,n=o[r].fn,u=!1,"string"==typeof t?t===e&&(u=!0):"function"==typeof t.test&&(u=t.test(e)),u&&s.push(n);return this.caches.contentRules[e]=s,s},getContentRules:function(e){this.sort("contentRules");var t,n,r=0,o=this.contentRules,i=o.length,u=!1,s=[],a=!1,c=this.addRulePointcuts[e]||[];for(r;i>r;r++)t=o[r].matches,n=o[r].fn,u=!1,"string"==typeof t?t===e&&(u=!0):"function"==typeof t.test&&(u=t.test(e)),u&&s.push(n);return each(c,function(e){a=!1,each(s,function(t){t===e&&(a=!0)}),a||s.push(e)}),this.caches.contentRules[e]=s,s},getRelative:function(e,t){var n,r,o=[];if(t=t||"",ABSOLUTE_PATH_REGEX.test(e))return e;n=[].concat(t.split("/"),e.split("/"));for(var i=0,u=n.length;u>i;i++)if(r=n[i],!("."===r||""===r&&i>0))if(".."===r){if(0===o.length)throw Error("could not traverse higher than highest path: "+e+", "+t);o.pop()}else o.push(r);return o=o.join("/")}}});RulesEngine=new n})();var TreeRunner=Fiber.extend(function(){function e(e){var t=e.data,n=e.getParent()?e.getParent().data:null,r=RulesEngine.getFetchRules(t.resolvedId),o=new Flow,i={module:function(){return RulesEngine.resolveModule.apply(RulesEngine,arguments)},url:function(){return RulesEngine.resolveFile.apply(RulesEngine,arguments)}},u={get:function(){return Communicator.get.apply(Communicator,arguments)}},s=function(e){o.seq(function(r,o,s){e(r,s,i,u,{moduleId:t.originalId,parentId:n?n.originalId:"",parentUrl:n?n.resolvedUrl:""})})};return Executor.getModule(t.resolvedId)?function(e,t,n){n("")}:Executor.getModule(RequireContext.qualifiedId(e))?function(e,t,n){n("")}:r.length>0?function(e,t,n){var i=0,u=r.length;for(o.seq(function(e){e(null,"")}),i;u>i;i++)s(r[i]);o.seq(function(e,t,r){n(r)})}:Communicator.get}function t(e,t){var r,o,i=Analyzer.extractRequires(e.data.file),u=i.length,s=0,a=u,c=function(){u--,0===u&&t()},l=function(e){n(function(){e.download(c)})};if(!i.length)return t();for(s;a>s;s++)r=new TreeNode,r.data.originalId=i[s],e.addChild(r),Executor.getModule(i[s])&&Executor.getModule(i[s]).exec?c():(o=new TreeRunner(r),l(o))}var n=function(){function e(){var e=o;for(o=[],s=!1,fn=e.shift();fn;)fn(),fn=e.shift()}function t(e){o.push(e),s||(s=!0,n())}var n,r,o=[],i=!!window.postMessage,u="inject-nexttick",s=!1;return i?(n=function(){window.postMessage(u,"*")},r=function(t){t.source==window&&t.data===u&&(t.stopPropagation?t.stopPropagation():t.returnValue=!1,e())},t.listener=addListener(window,"message",r,!0)):(n=function(){window.setTimeout(function(){r()},0)},r=e),t.removeListener=function(){removeListener(window,"message",r,!0)},t}();return{init:function(e){this.root=e},download:function(n){var r,o=this.root,i=o.data,u=o.getParent();i.resolvedId=u?RulesEngine.resolveModule(i.originalId,u.data.resolvedId):RulesEngine.resolveModule(i.originalId,""),i.resolvedUrl=RulesEngine.resolveFile(i.resolvedId),r=e(o),r(i.originalId,i.resolvedUrl,function(e){var r=RulesEngine.getContentRules(i.resolvedUrl),s=new Flow,a=0,c=r.length;for(addContent=function(e){s.seq(function(t,n,r){e(t,r)})},s.seq(function(t){t(null,e)}),a;c>a;a++)addContent(r[a]);s.seq(function(e,r,s){var a,c=!1,l={},f=u;for("string"==typeof s?i.file=s:i.exports=s,l[i.originalId]=!0;f&&!c;)l[f.data.originalId]?c=!0:(l[f.data.originalId]=!0,f=f.getParent());i.circular=c,i.exports?(a=Executor.createModule(i.resolvedId,RequireContext.qualifiedId(o),i.resolvedUrl),a.exec=!0,a.exports=s,n()):i.circular?n():t(o,n)})})},execute:function(e){var t=this.root.postOrder(),n=t.length,r=0,o=function(e){var t,n=e.data;n.resolvedId&&(t=Executor.createModule(n.resolvedId,RequireContext.qualifiedId(e),n.resolvedUrl),n.module=t,t.exec||n.circular||(n.exports?(t.exports=n.exports,t.exec=!0):"string"==typeof n.file&&(Executor.runModule(t,n.file),t.exec=!0,t.amd||(n.exports=t.exports))))};for(r;n>r;r++)o(t[r]);e()}}}),TreeNode=Fiber.extend(function(){return{init:function(){this.data={},this.children=[],this.left=null,this.right=null,this.parent=null},addChild:function(e){var t;return this.children.length>0&&(t=this.children[this.children.length-1],e.setLeft(t),t.setRight(e)),this.children.push(e),e.setParent(this)},getChildren:function(){return this.children},setLeft:function(e){return this.left=e,this.left},getLeft:function(){return this.left},setRight:function(e){return this.right=e,this.right},getRight:function(){return this.right},setParent:function(e){return this.parent=e,this.parent},getParent:function(){return this.parent},parents:function(e){for(var t=[],n=this;n;)e&&e(n),t.push(n),n=n.getParent();return t},postOrder:function(e){for(var t=this,n=null,r=[];t;)if(t.getChildren().length>0&&"up"!==n)n="down",t=t.getChildren()[0];else if(r.push(t),e&&e(t),t.getRight())n="right",t=t.getRight();else{if(!t.getParent())return r;n="up",t=t.getParent()}}}});TreeNode=TreeNode;var globalRequire=new RequireContext,errorQueue=[];
context.Inject={INTERNAL:{Classes:{Analyzer:Analyzer,Communicator:Communicator,Executor:Executor,InjectCore:InjectCore,RequireContext:RequireContext,RulesEngine:RulesEngine,TreeNode:TreeNode,TreeRunner:TreeRunner},defineExecutingModuleAs:proxy(Executor.defineExecutingModuleAs,Executor),undefineExecutingModule:proxy(Executor.undefineExecutingModule,Executor),executor:{},globalRequire:globalRequire},plugins:{},reset:proxy(InjectCore.reset,InjectCore),enableDebug:function(){InjectCore.enableDebug.apply(this,arguments)},onError:function(e){errorQueue.push(e)},emit:function(e){for(var t=0,n=errorQueue.length;n>t;t++)errorQueue[t].call(context,e)},enableAMDPlugins:function(){RulesEngine.addFetchRule(/^.+?\!.+$/,function(e,t,n,r,o){var i=o.moduleId,u=o.parentId,s=o.parentUrl,a=i.split("!"),c=n.module(a[0],u);n.url(c,s);var l=a[1],f=RequireContext.createRequire(u,s),d=!1,h=function(){return d?undefined:f.apply(f,arguments)},g=function(e){h[e]=function(){return f[e].apply(f,arguments)}};for(var p in f)HAS_OWN_PROPERTY.call(f,p)&&g(p);var _=function(e){return n.module(e,u)};f([c],function(t){var n=t.normalize?t.normalize(l,_):_(l),r=function(t){d||(d=!0,"string"==typeof t&&(t=['module.exports = decodeURIComponent("',encodeURIComponent(t),'");'].join("")),e(null,t))};r.fromText=function(t,n){d||(d=!0,n||(n=t,t=null),e(null,n))},t.load(n,h,r,{})})})},setModuleRoot:function(){InjectCore.setModuleRoot.apply(this,arguments)},setExpires:function(){InjectCore.setExpires.apply(this,arguments)},setCacheKey:function(){InjectCore.setCacheKey.apply(this,arguments)},setCrossDomain:function(){InjectCore.setCrossDomain.apply(this,arguments)},setUseSuffix:function(e){InjectCore.setUseSuffix(e)},disableGlobalAMD:function(e){context.define=e?RequireContext.createDefine(null,null,!0):RequireContext.createDefine()},clearCache:proxy(InjectCore.clearCache,InjectCore),addRule:function(){RulesEngine.addRule.apply(RulesEngine,arguments)},addModuleRule:function(){RulesEngine.addModuleRule.apply(RulesEngine,arguments)},addFileRule:function(){RulesEngine.addFileRule.apply(RulesEngine,arguments)},addContentRule:function(){RulesEngine.addContentRule.apply(RulesEngine,arguments)},addFetchRule:function(){RulesEngine.addFetchRule.apply(RulesEngine,arguments)},addPackage:function(){RulesEngine.addPackage.apply(RulesEngine,arguments)},plugin:function(){var e=[].slice.call(arguments,0);e.push(context.Inject),InjectCore.plugin.apply(InjectCore,e)},require:RequireContext.createRequire(),define:RequireContext.createDefine(),version:"undefined"},context.require=context.Inject.require,context.define=context.Inject.define,context.Inject.version="0.6.1"}(this);