forked from apla/dataflo.ws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
require.js
31 lines (31 loc) · 12.6 KB
/
require.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
RequireJS 1.0.4 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(){function J(b){return M.call(b)==="[object Function]"}function E(b){return M.call(b)==="[object Array]"}function Z(b,c,i){for(var j in c)if(!(j in K)&&(!(j in b)||i))b[j]=c[j];return d}function N(b,c,d){b=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);if(d)b.originalError=d;return b}function $(b,c,d){var j,k,q;for(j=0;q=c[j];j++){q=typeof q==="string"?{name:q}:q;k=q.location;if(d&&(!k||k.indexOf("/")!==0&&k.indexOf(":")===-1))k=d+"/"+(k||q.name);b[q.name]={name:q.name,location:k||
q.name,main:(q.main||"main").replace(ea,"").replace(aa,"")}}}function U(b,c){b.holdReady?b.holdReady(c):c?b.readyWait+=1:b.ready(!0)}function fa(b){function c(a,h){var e,s;if(a&&a.charAt(0)===".")if(h){o.pkgs[h]?h=[h]:(h=h.split("/"),h=h.slice(0,h.length-1));e=a=h.concat(a.split("/"));var b;for(s=0;b=e[s];s++)if(b===".")e.splice(s,1),s-=1;else if(b==="..")if(s===1&&(e[2]===".."||e[0]===".."))break;else s>0&&(e.splice(s-1,2),s-=2);s=o.pkgs[e=a[0]];a=a.join("/");s&&a===e+"/"+s.main&&(a=e)}else a.indexOf("./")===
0&&(a=a.substring(2));return a}function i(a,h){var e=a?a.indexOf("!"):-1,b=null,d=h?h.name:null,p=a,g,i;e!==-1&&(b=a.substring(0,e),a=a.substring(e+1,a.length));b&&(b=c(b,d));a&&(b?g=(e=l[b])&&e.normalize?e.normalize(a,function(a){return c(a,d)}):c(a,d):(g=c(a,d),i=E[g],i||(i=f.nameToUrl(a,null,h),E[g]=i)));return{prefix:b,name:g,parentMap:h,url:i,originalName:p,fullName:b?b+"!"+(g||""):g}}function j(){var a=!0,h=o.priorityWait,e,b;if(h){for(b=0;e=h[b];b++)if(!t[e]){a=!1;break}a&&delete o.priorityWait}return a}
function k(a,h,e){return function(){var b=ga.call(arguments,0),c;if(e&&J(c=b[b.length-1]))c.__requireJsBuild=!0;b.push(h);return a.apply(null,b)}}function q(a,h){var e=k(f.require,a,h);Z(e,{nameToUrl:k(f.nameToUrl,a),toUrl:k(f.toUrl,a),defined:k(f.requireDefined,a),specified:k(f.requireSpecified,a),isBrowser:d.isBrowser});return e}function n(a){var h,e,b,c=a.callback,p=a.map,g=p.fullName,ba=a.deps;b=a.listeners;if(c&&J(c)){if(o.catchError.define)try{e=d.execCb(g,a.callback,ba,l[g])}catch(j){h=j}else e=
d.execCb(g,a.callback,ba,l[g]);if(g)(c=a.cjsModule)&&c.exports!==void 0&&c.exports!==l[g]?e=l[g]=a.cjsModule.exports:e===void 0&&a.usingExports?e=l[g]:(l[g]=e,F[g]&&(R[g]=!0))}else g&&(e=l[g]=c,F[g]&&(R[g]=!0));if(C[a.id])delete C[a.id],a.isDone=!0,f.waitCount-=1,f.waitCount===0&&(I=[]);delete S[g];if(d.onResourceLoad&&!a.placeholder)d.onResourceLoad(f,p,a.depArray);if(h)return e=(g?i(g).url:"")||h.fileName||h.sourceURL,b=h.moduleTree,h=N("defineerror",'Error evaluating module "'+g+'" at location "'+
e+'":\n'+h+"\nfileName:"+e+"\nlineNumber: "+(h.lineNumber||h.line),h),h.moduleName=g,h.moduleTree=b,d.onError(h);for(h=0;c=b[h];h++)c(e)}function r(a,h){return function(e){a.depDone[h]||(a.depDone[h]=!0,a.deps[h]=e,a.depCount-=1,a.depCount||n(a))}}function v(a,h){var e=h.map,b=e.fullName,c=e.name,p=L[a]||(L[a]=l[a]),g;if(!h.loading)h.loading=!0,g=function(a){h.callback=function(){return a};n(h);t[h.id]=!0;x()},g.fromText=function(a,h){var e=O;t[a]=!1;f.scriptCount+=1;f.fake[a]=!0;e&&(O=!1);d.exec(h);
e&&(O=!0);f.completeLoad(a)},b in l?g(l[b]):p.load(c,q(e.parentMap,!0),g,o)}function w(a){C[a.id]||(C[a.id]=a,I.push(a),f.waitCount+=1)}function D(a){this.listeners.push(a)}function u(a,h){var e=a.fullName,b=a.prefix,c=b?L[b]||(L[b]=l[b]):null,d,g;e&&(d=S[e]);if(!d&&(g=!0,d={id:(b&&!c?M++ +"__p@:":"")+(e||"__r@"+M++),map:a,depCount:0,depDone:[],depCallbacks:[],deps:[],listeners:[],add:D},y[d.id]=!0,e&&(!b||L[b])))S[e]=d;b&&!c?(e=i(b),b in l&&!l[b]&&(delete l[b],delete P[e.url]),b=u(e,!0),b.add(function(){var b=
i(a.originalName,a.parentMap),b=u(b,!0);d.placeholder=!0;b.add(function(a){d.callback=function(){return a};n(d)})})):g&&h&&(t[d.id]=!1,f.paused.push(d),w(d));return d}function B(a,b,e,c){var a=i(a,c),d=a.name,p=a.fullName,g=u(a),j=g.id,k=g.deps,m;if(p){if(p in l||t[j]===!0||p==="jquery"&&o.jQuery&&o.jQuery!==e().fn.jquery)return;y[j]=!0;t[j]=!0;p==="jquery"&&e&&V(e())}g.depArray=b;g.callback=e;for(e=0;e<b.length;e++)if(j=b[e])j=i(j,d?a:c),m=j.fullName,b[e]=m,m==="require"?k[e]=q(a):m==="exports"?
(k[e]=l[p]={},g.usingExports=!0):m==="module"?g.cjsModule=k[e]={id:d,uri:d?f.nameToUrl(d,null,c):void 0,exports:l[p]}:m in l&&!(m in C)&&(!(p in F)||p in F&&R[m])?k[e]=l[m]:(p in F&&(F[m]=!0,delete l[m],P[j.url]=!1),g.depCount+=1,g.depCallbacks[e]=r(g,e),u(j,!0).add(g.depCallbacks[e]));g.depCount?w(g):n(g)}function m(a){B.apply(null,a)}function z(a,b){if(!a.isDone){var e=a.map.fullName,c=a.depArray,d,f,g,j;if(e){if(b[e])return l[e];b[e]=!0}if(c)for(d=0;d<c.length;d++)if(f=c[d])if((g=i(f).prefix)&&
(j=C[g])&&z(j,b),(g=C[f])&&!g.isDone&&t[f])f=z(g,b),a.depCallbacks[d](f);return e?l[e]:void 0}}function A(){var a=o.waitSeconds*1E3,b=a&&f.startTime+a<(new Date).getTime(),a="",e=!1,c=!1,i;if(!(f.pausedCount>0)){if(o.priorityWait)if(j())x();else return;for(i in t)if(!(i in K)&&(e=!0,!t[i]))if(b)a+=i+" ";else{c=!0;break}if(e||f.waitCount){if(b&&a)return i=N("timeout","Load timeout for modules: "+a),i.requireType="timeout",i.requireModules=a,d.onError(i);if(c||f.scriptCount){if((G||ca)&&!W)W=setTimeout(function(){W=
0;A()},50)}else{if(f.waitCount){for(H=0;a=I[H];H++)z(a,{});f.paused.length&&x();X<5&&(X+=1,A())}X=0;d.checkReadyState()}}}}var f,x,o={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},catchError:{}},Q=[],y={require:!0,exports:!0,module:!0},E={},l={},t={},C={},I=[],P={},M=0,S={},L={},F={},R={},Y=0;V=function(a){if(!f.jQuery&&(a=a||(typeof jQuery!=="undefined"?jQuery:null))&&!(o.jQuery&&a.fn.jquery!==o.jQuery)&&("holdReady"in a||"readyWait"in a))if(f.jQuery=a,m(["jquery",[],function(){return jQuery}]),f.scriptCount)U(a,
!0),f.jQueryIncremented=!0};x=function(){var a,b,e,c,i,k;Y+=1;if(f.scriptCount<=0)f.scriptCount=0;for(;Q.length;)if(a=Q.shift(),a[0]===null)return d.onError(N("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));else m(a);if(!o.priorityWait||j())for(;f.paused.length;){i=f.paused;f.pausedCount+=i.length;f.paused=[];for(c=0;a=i[c];c++)b=a.map,e=b.url,k=b.fullName,b.prefix?v(b.prefix,a):!P[e]&&!t[k]&&(d.load(f,k,e),e.indexOf("empty:")!==0&&(P[e]=!0));f.startTime=(new Date).getTime();f.pausedCount-=
i.length}Y===1&&A();Y-=1};f={contextName:b,config:o,defQueue:Q,waiting:C,waitCount:0,specified:y,loaded:t,urlMap:E,urlFetched:P,scriptCount:0,defined:l,paused:[],pausedCount:0,plugins:L,needFullExec:F,fake:{},fullExec:R,managerCallbacks:S,makeModuleMap:i,normalize:c,configure:function(a){var b,e,c;a.baseUrl&&a.baseUrl.charAt(a.baseUrl.length-1)!=="/"&&(a.baseUrl+="/");b=o.paths;c=o.pkgs;Z(o,a,!0);if(a.paths){for(e in a.paths)e in K||(b[e]=a.paths[e]);o.paths=b}if((b=a.packagePaths)||a.packages){if(b)for(e in b)e in
K||$(c,b[e],e);a.packages&&$(c,a.packages);o.pkgs=c}if(a.priority)e=f.requireWait,f.requireWait=!1,f.takeGlobalQueue(),x(),f.require(a.priority),x(),f.requireWait=e,o.priorityWait=a.priority;if(a.deps||a.callback)f.require(a.deps||[],a.callback)},requireDefined:function(a,b){return i(a,b).fullName in l},requireSpecified:function(a,b){return i(a,b).fullName in y},require:function(a,c,e){if(typeof a==="string"){if(J(c))return d.onError(N("requireargs","Invalid require call"));if(d.get)return d.get(f,
a,c);c=i(a,c);a=c.fullName;return!(a in l)?d.onError(N("notloaded","Module name '"+c.fullName+"' has not been loaded yet for context: "+b)):l[a]}(a&&a.length||c)&&B(null,a,c,e);if(!f.requireWait)for(;!f.scriptCount&&f.paused.length;)f.takeGlobalQueue(),x();return f.require},takeGlobalQueue:function(){T.length&&(ha.apply(f.defQueue,[f.defQueue.length-1,0].concat(T)),T=[])},completeLoad:function(a){var b;for(f.takeGlobalQueue();Q.length;)if(b=Q.shift(),b[0]===null){b[0]=a;break}else if(b[0]===a)break;
else m(b),b=null;b?m(b):m([a,[],a==="jquery"&&typeof jQuery!=="undefined"?function(){return jQuery}:null]);d.isAsync&&(f.scriptCount-=1);x();d.isAsync||(f.scriptCount-=1)},toUrl:function(a,b){var c=a.lastIndexOf("."),d=null;c!==-1&&(d=a.substring(c,a.length),a=a.substring(0,c));return f.nameToUrl(a,d,b)},nameToUrl:function(a,b,e){var i,j,k,g,l=f.config,a=c(a,e&&e.fullName);if(d.jsExtRegExp.test(a))b=a+(b?b:"");else{i=l.paths;j=l.pkgs;e=a.split("/");for(g=e.length;g>0;g--)if(k=e.slice(0,g).join("/"),
i[k]){e.splice(0,g,i[k]);break}else if(k=j[k]){a=a===k.name?k.location+"/"+k.main:k.location;e.splice(0,g,a);break}b=e.join("/")+(b||".js");b=(b.charAt(0)==="/"||b.match(/^\w+:/)?"":l.baseUrl)+b}return l.urlArgs?b+((b.indexOf("?")===-1?"?":"&")+l.urlArgs):b}};f.jQueryCheck=V;f.resume=x;return f}function ia(){var b,c,d;if(m&&m.readyState==="interactive")return m;b=document.getElementsByTagName("script");for(c=b.length-1;c>-1&&(d=b[c]);c--)if(d.readyState==="interactive")return m=d;return null}var ja=
/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ka=/require\(\s*["']([^'"\s]+)["']\s*\)/g,ea=/^\.\//,aa=/\.js$/,M=Object.prototype.toString,r=Array.prototype,ga=r.slice,ha=r.splice,G=!!(typeof window!=="undefined"&&navigator&&document),ca=!G&&typeof importScripts!=="undefined",la=G&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,da=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",K={},D={},T=[],m=null,X=0,O=!1,d,r={},I,w,u,y,v,z,A,H,B,V,W;if(typeof define==="undefined"){if(typeof requirejs!==
"undefined")if(J(requirejs))return;else r=requirejs,requirejs=void 0;typeof require!=="undefined"&&!J(require)&&(r=require,require=void 0);d=requirejs=function(b,c,d){var j="_",k;!E(b)&&typeof b!=="string"&&(k=b,E(c)?(b=c,c=d):b=[]);if(k&&k.context)j=k.context;d=D[j]||(D[j]=fa(j));k&&d.configure(k);return d.require(b,c)};d.config=function(b){return d(b)};require||(require=d);d.toUrl=function(b){return D._.toUrl(b)};d.version="1.0.4";d.jsExtRegExp=/^\/|:|\?|\.js$/;w=d.s={contexts:D,skipAsync:{}};if(d.isAsync=
d.isBrowser=G)if(u=w.head=document.getElementsByTagName("head")[0],y=document.getElementsByTagName("base")[0])u=w.head=y.parentNode;d.onError=function(b){throw b;};d.load=function(b,c,i){d.resourcesReady(!1);b.scriptCount+=1;d.attach(i,b,c);if(b.jQuery&&!b.jQueryIncremented)U(b.jQuery,!0),b.jQueryIncremented=!0};define=function(b,c,d){var j,k;typeof b!=="string"&&(d=c,c=b,b=null);E(c)||(d=c,c=[]);!c.length&&J(d)&&d.length&&(d.toString().replace(ja,"").replace(ka,function(b,d){c.push(d)}),c=(d.length===
1?["require"]:["require","exports","module"]).concat(c));if(O&&(j=I||ia()))b||(b=j.getAttribute("data-requiremodule")),k=D[j.getAttribute("data-requirecontext")];(k?k.defQueue:T).push([b,c,d])};define.amd={multiversion:!0,plugins:!0,jQuery:!0};d.exec=function(b){return eval(b)};d.execCb=function(b,c,d,j){return c.apply(j,d)};d.addScriptToDom=function(b){I=b;y?u.insertBefore(b,y):u.appendChild(b);I=null};d.onScriptLoad=function(b){var c=b.currentTarget||b.srcElement,i;if(b.type==="load"||c&&la.test(c.readyState))m=
null,b=c.getAttribute("data-requirecontext"),i=c.getAttribute("data-requiremodule"),D[b].completeLoad(i),c.detachEvent&&!da?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach=function(b,c,i,j,k,m){var n;if(G)return j=j||d.onScriptLoad,n=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),n.type=k||c&&c.config.scriptType||"text/javascript",n.charset="utf-8",n.async=
!w.skipAsync[b],c&&n.setAttribute("data-requirecontext",c.contextName),n.setAttribute("data-requiremodule",i),n.attachEvent&&!da?(O=!0,m?n.onreadystatechange=function(){if(n.readyState==="loaded")n.onreadystatechange=null,n.attachEvent("onreadystatechange",j),m(n)}:n.attachEvent("onreadystatechange",j)):n.addEventListener("load",j,!1),n.src=b,m||d.addScriptToDom(n),n;else ca&&(importScripts(b),c.completeLoad(i));return null};if(G){v=document.getElementsByTagName("script");for(H=v.length-1;H>-1&&(z=
v[H]);H--){if(!u)u=z.parentNode;if(A=z.getAttribute("data-main")){if(!r.baseUrl)v=A.split("/"),z=v.pop(),v=v.length?v.join("/")+"/":"./",r.baseUrl=v,A=z.replace(aa,"");r.deps=r.deps?r.deps.concat(A):[A];break}}}d.checkReadyState=function(){var b=w.contexts,c;for(c in b)if(!(c in K)&&b[c].waitCount)return;d.resourcesReady(!0)};d.resourcesReady=function(b){var c,i;d.resourcesDone=b;if(d.resourcesDone)for(i in b=w.contexts,b)if(!(i in K)&&(c=b[i],c.jQueryIncremented))U(c.jQuery,!1),c.jQueryIncremented=
!1};d.pageLoaded=function(){if(document.readyState!=="complete")document.readyState="complete"};if(G&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load",d.pageLoaded,!1);d(r);if(d.isAsync&&typeof setTimeout!=="undefined")B=w.contexts[r.context||"_"],B.requireWait=!0,setTimeout(function(){B.requireWait=!1;B.takeGlobalQueue();B.scriptCount||B.resume();d.checkReadyState()},0)}})();