/*
 RequireJS text 0.24.0 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
 RequireJS i18n 0.24.0 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
*/
(function(){function c(a,d,e){(function(){if(typeof this.loadFirebugConsole=="function")this.loadFirebugConsole();else{this.console=this.console||{};for(var f=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"],i=0,j;j=f[i++];)console[j]||function(){var s=j+"";console[s]="log"in console?function(){var q=Array.apply({},arguments);q.unshift(s+":");console.log(q.join(" "))}:function(){};console[s]._fake=true}()}if(typeof a==
"undefined")a={_scopeName:"dojo",_scopePrefix:"",_scopePrefixArgs:"",_scopeSuffix:"",_scopeMap:{},_scopeMapRev:{}};var h=a;if(typeof d=="undefined")d={_scopeName:"dijit"};if(typeof e=="undefined")e={_scopeName:"dojox"};if(!h._scopeArgs)h._scopeArgs=[a,d,e];h.global=this;h.config={isDebug:false,debugAtAllCosts:false};if(f=typeof djConfig!="undefined"?djConfig:typeof dojoConfig!="undefined"?dojoConfig:null)for(var l in f)h.config[l]=f[l];a.locale=h.config.locale;l="$Rev: 24595 $".match(/\d+/);a.version=
{major:1,minor:6,patch:1,flag:"",revision:l?+l[0]:NaN,toString:function(){with(h.version)return major+"."+minor+"."+patch+flag+" ("+revision+")"}};typeof OpenAjax!="undefined"&&OpenAjax.hub.registerLibrary(a._scopeName,"http://dojotoolkit.org",h.version.toString());var o,r,u={};for(i in{toString:1}){o=[];break}a._extraNames=o=o||["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];r=o.length;a._mixin=function(s,q){var v,y,x;for(v in q){y=q[v];
if(!(v in s)||s[v]!==y&&(!(v in u)||u[v]!==y))s[v]=y}if(r&&q)for(x=0;x<r;++x){v=o[x];y=q[v];if(!(v in s)||s[v]!==y&&(!(v in u)||u[v]!==y))s[v]=y}return s};a.mixin=function(s){s||(s={});for(var q=1,v=arguments.length;q<v;q++)h._mixin(s,arguments[q]);return s};a._getProp=function(s,q,v){v=v||h.global;for(var y=0,x;v&&(x=s[y]);y++){if(y==0&&h._scopeMap[x])x=h._scopeMap[x];v=x in v?v[x]:q?(v[x]={}):undefined}return v};a.setObject=function(s,q,v){var y=s.split(".");s=y.pop();return(v=h._getProp(y,true,
v))&&s?(v[s]=q):undefined};a.getObject=function(s,q,v){return h._getProp(s.split("."),q,v)};a.exists=function(s,q){return h.getObject(s,false,q)!==undefined};a.eval=function(s){return h.global.eval?h.global.eval(s):eval(s)};h.deprecated=h.experimental=function(){}})();return{dojo:a,dijit:d,dojox:e}}if(this.define)define("dojo/_base/_loader/bootstrap",[],function(){var a=c();a.dojo._dijit=a.dijit;a.dojo._dojox=a.dojox;return a.dojo});else{var g=c();dojo=g.dojo;dijit=g.dijit;dojox=g.dojox}})();
define("dojo/lib/backCompat",["require","dojo/_base/_loader/bootstrap"],function(c,g){var a=["_moduleHasPrefix","_loadPath","_loadUri","_loadUriAndCheck","loaded","_callLoaded","_getModuleSymbols","_loadModule","require","provide","platformRequire","requireIf","requireAfterIf","registerModulePath"],d,e;for(d=0;d<a.length;){e=a[d++];g[e]=function(s){return function(){console.warn("dojo."+s+" not available when using an AMD loader.")}}(e)}var f=function(s){var q=[],v;for(v=0;v<s.length;)q.push(s[v++]);
return q},i=function(s,q){return q?typeof q=="string"?function(){s[q]()}:function(){q.call(s)}:s};g.ready=g.addOnLoad=function(s,q){c.ready(q?i(s,q):s)};g.addOnLoad(function(){g.postLoad=g.config.afterOnLoad=true});if(a=g.config.addOnLoad)g.addOnLoad[a instanceof Array?"apply":"call"](g,a);var j=g._loaders=[],h=function(){var s=j.slice(0);for(Array.prototype.splice.apply(j,[0,j.length]);s.length;)s.shift().call()};j.unshift=function(){Array.prototype.unshift.apply(j,f(arguments));c.ready(h)};j.splice=
function(){Array.prototype.splice.apply(j,f(arguments));c.ready(h)};var l=g._unloaders=[];g.unloaded=function(){for(;l.length;)l.pop().call()};g._onto=function(s,q,v){s.push(v?i(q,v):q)};g._modulesLoaded=function(){};g.loadInit=function(s){s()};var o=function(s){return s.replace(/\./g,"/")};g.getL10nName=function(s,q,v){v=v?v.toLowerCase():g.locale;s="i18n!"+o(s);return/root/i.test(v)?s+"/nls/"+q:s+"/nls/"+v+"/"+q};g.requireLocalization=function(s,q,v){if(c.vendor!="altoviso.com")v=!v||v.toLowerCase()===
g.locale?"root":v;return c(g.getL10nName(s,q,v))};g.i18n={getLocalization:g.requireLocalization,normalizeLocale:function(s){s=s?s.toLowerCase():g.locale;if(s=="root")s="ROOT";return s}};var r=/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/,u=/^((([^\[:]+):)?([^@]+)@)?(\[([^\]]+)\]|([^\[:]*))(:([0-9]+))?$/;g._Url=function(){for(var s=arguments,q=[s[0]],v=1;v<s.length;v++)if(s[v]){var y=new g._Url(s[v]+"");q=new g._Url(q[0]+"");if(y.path==""&&!y.scheme&&!y.authority&&!y.query){if(y.fragment!=
null)q.fragment=y.fragment;y=q}else if(!y.scheme){y.scheme=q.scheme;if(!y.authority){y.authority=q.authority;if(y.path.charAt(0)!="/"){q=(q.path.substring(0,q.path.lastIndexOf("/")+1)+y.path).split("/");for(var x=0;x<q.length;x++)if(q[x]==".")if(x==q.length-1)q[x]="";else{q.splice(x,1);x--}else if(x>0&&!(x==1&&q[0]=="")&&q[x]==".."&&q[x-1]!="..")if(x==q.length-1){q.splice(x,1);q[x-1]=""}else{q.splice(x-1,2);x-=2}y.path=q.join("/")}}}q=[];y.scheme&&q.push(y.scheme,":");y.authority&&q.push("//",y.authority);
q.push(y.path);y.query&&q.push("?",y.query);y.fragment&&q.push("#",y.fragment)}this.uri=q.join("");v=this.uri.match(r);this.scheme=v[2]||(v[1]?"":null);this.authority=v[4]||(v[3]?"":null);this.path=v[5];this.query=v[7]||(v[6]?"":null);this.fragment=v[9]||(v[8]?"":null);if(this.authority!=null){v=this.authority.match(u);this.user=v[3]||null;this.password=v[4]||null;this.host=v[6]||v[7];this.port=v[9]||null}};g._Url.prototype.toString=function(){return this.uri};g.moduleUrl=function(s,q){if(!s)return null;
s=o(s)+(q?"/"+q:"");q="";var v=s.match(/(.+)(\.[^\/]*)$/);if(v){s=v[1];q=v[2]}return new g._Url(c.nameToUrl(s,q))};return g});
define("dojo/_base/_loader/hostenv_browser",["dojo/lib/backCompat"],function(c){if(typeof window!="undefined"){c.isBrowser=true;c._name="browser";(function(){var a=c;if(document&&document.getElementsByTagName)for(var d=document.getElementsByTagName("script"),e=/dojo(\.xd)?\.js(\W|$)/i,f=0;f<d.length;f++){var i=d[f].getAttribute("src");if(i){var j=i.match(e);if(j){if(!a.config.baseUrl)a.config.baseUrl=i.substring(0,j.index);if(d=d[f].getAttribute("djConfig")||d[f].getAttribute("data-dojo-config")){d=
eval("({ "+d+" })");for(var h in d)c.config[h]=d[h]}break}}}a.baseUrl=a.config.baseUrl;h=navigator;d=h.userAgent;e=h.appVersion;f=parseFloat(e);if(d.indexOf("Opera")>=0)a.isOpera=f;if(d.indexOf("AdobeAIR")>=0)a.isAIR=1;a.isKhtml=e.indexOf("Konqueror")>=0?f:0;a.isWebKit=parseFloat(d.split("WebKit/")[1])||undefined;a.isChrome=parseFloat(d.split("Chrome/")[1])||undefined;a.isMac=e.indexOf("Macintosh")>=0;if((i=Math.max(e.indexOf("WebKit"),e.indexOf("Safari"),0))&&!c.isChrome){a.isSafari=parseFloat(e.split("Version/")[1]);
if(!a.isSafari||parseFloat(e.substr(i+7))<=419.3)a.isSafari=2}if(d.indexOf("Gecko")>=0&&!a.isKhtml&&!a.isWebKit)a.isMozilla=a.isMoz=f;if(a.isMoz)a.isFF=parseFloat(d.split("Firefox/")[1]||d.split("Minefield/")[1])||undefined;if(document.all&&!a.isOpera){a.isIE=parseFloat(e.split("MSIE ")[1])||undefined;if((d=document.documentMode)&&d!=5&&Math.floor(a.isIE)!=d)a.isIE=d}if(c.isIE&&window.location.protocol==="file:")c.config.ieForceActiveXXhr=true;a.isQuirks=document.compatMode=="BackCompat";a.locale=
c.config.locale||(a.isIE?h.userLanguage:h.language).toLowerCase();a._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];a._xhrObj=function(){var v,y;if(!c.isIE||!c.config.ieForceActiveXXhr)try{v=new XMLHttpRequest}catch(x){}if(!v)for(var k=0;k<3;++k){var m=a._XMLHTTP_PROGIDS[k];try{v=new ActiveXObject(m)}catch(n){y=n}if(v){a._XMLHTTP_PROGIDS=[m];break}}if(!v)throw new Error("XMLHTTP not available: "+y);return v};a._isDocumentOk=function(v){v=v.status||0;var y=location.protocol;
return v>=200&&v<300||v==304||v==1223||!v&&(y=="file:"||y=="chrome:"||y=="chrome-extension:"||y=="app:")};var l=window.location+"";var o=(h=document.getElementsByTagName("base"))&&h.length>0;a._getText=function(v,y){var x=a._xhrObj();if(!o&&c._Url)v=(new c._Url(l,v)).toString();if(a.config.cacheBust){v+="";v+=(v.indexOf("?")==-1?"?":"&")+String(a.config.cacheBust).replace(/\W+/g,"")}x.open("GET",v,false);try{x.send(null);if(!a._isDocumentOk(x)){var k=Error("Unable to load "+v+" status:"+x.status);
k.status=x.status;k.responseText=x.responseText;throw k;}}catch(m){if(y)return null;throw m;}return x.responseText};var r=window,u=function(v,y){var x=r.attachEvent||r.addEventListener;v=r.attachEvent?v:v.substring(2);x(v,function(){y.apply(r,arguments)},false)};a._windowUnloaders=[];a.windowUnloaded=function(){for(var v=a._windowUnloaders;v.length;)v.pop()();a=null};var s=0;a.addOnWindowUnload=function(v,y){a._onto(a._windowUnloaders,v,y);if(!s){s=1;u("onunload",a.windowUnloaded)}};var q=0;a.addOnUnload=
function(v,y){a._onto(a._unloaders,v,y);if(!q){q=1;u("onbeforeunload",c.unloaded)}}})();c._initFired=false;c._loadInit=function(){if(c._scrollIntervalId){clearInterval(c._scrollIntervalId);c._scrollIntervalId=0}if(!c._initFired){c._initFired=true;!c.config.afterOnLoad&&window.detachEvent&&window.detachEvent("onload",c._loadInit);c._inFlightCount==0&&c._modulesLoaded()}};if(!c.config.afterOnLoad)if(document.addEventListener){document.addEventListener("DOMContentLoaded",c._loadInit,false);window.addEventListener("load",
c._loadInit,false)}else if(window.attachEvent){window.attachEvent("onload",c._loadInit);if(!c.config.skipIeDomLoaded&&self===self.top)c._scrollIntervalId=setInterval(function(){try{if(document.body){document.documentElement.doScroll("left");c._loadInit()}}catch(a){}},30)}if(c.isIE)try{(function(){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var a=["*","group","roundrect","oval","shape","rect","imagedata","path","textpath","text"],d=0,e=1,f=document.createStyleSheet();if(c.isIE>=8){d=
1;e=a.length}for(;d<e;++d)f.addRule("v\\:"+a[d],"behavior:url(#default#VML); display:inline-block")})()}catch(g){}}(function(){var a=c.config.modulePaths;if(a)for(var d in a)c.registerModulePath(d,a[d])})();c.config.isDebug&&c.require("dojo._firebug.firebug");if(c.config.debugAtAllCosts){c.require("dojo._base._loader.loader_debug");c.require("dojo.i18n")}return c});define("dojo/lib/kernel",["dojo/_base/_loader/hostenv_browser"],function(c){return dojo=c});
define("dojo/_base/lang",["dojo/lib/kernel"],function(c){(function(){var g=Object.prototype.toString;c.isString=function(h){return typeof h=="string"||h instanceof String};c.isArray=function(h){return h&&(h instanceof Array||typeof h=="array")};c.isFunction=function(h){return g.call(h)==="[object Function]"};c.isObject=function(h){return h!==undefined&&(h===null||typeof h=="object"||c.isArray(h)||c.isFunction(h))};c.isArrayLike=function(h){return h&&h!==undefined&&!c.isString(h)&&!c.isFunction(h)&&
!(h.tagName&&h.tagName.toLowerCase()=="form")&&(c.isArray(h)||isFinite(h.length))};c.isAlien=function(h){return h&&!c.isFunction(h)&&/\{\s*\[native code\]\s*\}/.test(String(h))};c.extend=function(h){for(var l=1,o=arguments.length;l<o;l++)c._mixin(h.prototype,arguments[l]);return h};c._hitchArgs=function(h,l){var o=c._toArray(arguments,2),r=c.isString(l);return function(){var u=c._toArray(arguments),s=r?(h||c.global)[l]:l;return s&&s.apply(h||this,o.concat(u))}};c.hitch=function(h,l){if(arguments.length>
2)return c._hitchArgs.apply(c,arguments);if(!l){l=h;h=null}if(c.isString(l)){h=h||c.global;if(!h[l])throw['dojo.hitch: scope["',l,'"] is null (scope="',h,'")'].join("");return function(){return h[l].apply(h,arguments||[])}}return!h?l:function(){return l.apply(h,arguments||[])}};c.delegate=c._delegate=function(){function h(){}return function(l,o){h.prototype=l;l=new h;h.prototype=null;o&&c._mixin(l,o);return l}}();var a=function(h,l,o){return(o||[]).concat(Array.prototype.slice.call(h,l||0))},d=function(h,
l,o){o=o||[];for(l=l||0;l<h.length;l++)o.push(h[l]);return o};c._toArray=c.isIE?function(h){return(h.item?d:a).apply(this,arguments)}:a;c.partial=function(){return c.hitch.apply(c,[null].concat(c._toArray(arguments)))};var e=c._extraNames,f=e.length,i={};c.clone=function(h){if(!h||typeof h!="object"||c.isFunction(h))return h;if(h.nodeType&&"cloneNode"in h)return h.cloneNode(true);if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp)return new RegExp(h);var l,o,r,u;if(c.isArray(h)){l=
[];o=0;for(r=h.length;o<r;++o)o in h&&l.push(c.clone(h[o]))}else l=h.constructor?new h.constructor:{};for(u in h){r=h[u];if(!(u in l)||l[u]!==r&&(!(u in i)||i[u]!==r))l[u]=c.clone(r)}if(f)for(o=0;o<f;++o){u=e[o];r=h[u];if(!(u in l)||l[u]!==r&&(!(u in i)||i[u]!==r))l[u]=r}return l};c.trim=String.prototype.trim?function(h){return h.trim()}:function(h){return h.replace(/^\s\s*/,"").replace(/\s\s*$/,"")};var j=/\{([^\}]+)\}/g;c.replace=function(h,l,o){return h.replace(o||j,c.isFunction(l)?l:function(r,
u){return c.getObject(u,false,l)})}})();return c});
define("dojo/_base/array",["dojo/lib/kernel","dojo/_base/lang"],function(c){(function(){var g=function(d,e,f){return[typeof d=="string"?d.split(""):d,e||c.global,typeof f=="string"?new Function("item","index","array",f):f]},a=function(d,e,f,i){var j=g(e,i,f);e=j[0];f=0;for(i=e.length;f<i;++f){var h=!!j[2].call(j[1],e[f],f,e);if(d^h)return h}return d};c.mixin(c,{indexOf:function(d,e,f,i){var j=1,h=d.length||0,l=0;if(i){l=h-1;j=h=-1}if(f!=undefined)l=f;if(i&&l>h||l<h)for(;l!=h;l+=j)if(d[l]==e)return l;
return-1},lastIndexOf:function(d,e,f){return c.indexOf(d,e,f,true)},forEach:function(d,e,f){if(d&&d.length){var i=g(d,f,e);d=i[0];e=0;for(f=d.length;e<f;++e)i[2].call(i[1],d[e],e,d)}},every:function(d,e,f){return a(true,d,e,f)},some:function(d,e,f){return a(false,d,e,f)},map:function(d,e,f,i){var j=g(d,f,e);d=j[0];e=i?new i:[];f=0;for(i=d.length;f<i;++f)e.push(j[2].call(j[1],d[f],f,d));return e},filter:function(d,e,f){var i=g(d,f,e);d=i[0];e=[];f=0;for(var j=d.length;f<j;++f)i[2].call(i[1],d[f],f,
d)&&e.push(d[f]);return e}})})();return c});
define("dojo/_base/declare",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array"],function(c){(function(){function g(t,w){throw new Error("declare"+(w?" "+w:"")+": "+t);}function a(t,w){for(var z=[],A=[{cls:0,refs:[]}],C={},F=1,E=t.length,H=0,K,L,P,S,Y;H<E;++H){if(K=t[H])k.call(K)!="[object Function]"&&g("mixin #"+H+" is not a callable constructor.",w);else g("mixin #"+H+" is unknown. Did you use dojo.require to pull it in?",w);L=K._meta?K._meta.bases:[K];P=0;for(K=L.length-1;K>=0;--K){S=L[K].prototype;
if(!S.hasOwnProperty("declaredClass"))S.declaredClass="uniqName_"+n++;S=S.declaredClass;if(!C.hasOwnProperty(S)){C[S]={count:0,refs:[],cls:L[K]};++F}S=C[S];if(P&&P!==S){S.refs.push(P);++P.count}P=S}++P.count;A[0].refs.push(P)}for(;A.length;){P=A.pop();z.push(P.cls);for(--F;Y=P.refs,Y.length==1;){P=Y[0];if(!P||--P.count){P=0;break}z.push(P.cls);--F}if(P){H=0;for(E=Y.length;H<E;++H){P=Y[H];--P.count||A.push(P)}}}F&&g("can't build consistent linearization",w);K=t[0];z[0]=K?K._meta&&K===z[z.length-K._meta.bases.length]?
K._meta.bases.length:1:0;return z}function d(t,w,z){var A,C,F,E,H,K,L,P=this._inherited=this._inherited||{};if(typeof t=="string"){A=t;t=w;w=z}z=0;E=t.callee;(A=A||E.nom)||g("can't deduce a name to call inherited()",this.declaredClass);H=this.constructor._meta;F=H.bases;L=P.p;if(A!=p){if(P.c!==E){L=0;K=F[0];H=K._meta;if(H.hidden[A]!==E){(C=H.chains)&&typeof C[A]=="string"&&g("calling chained method with inherited: "+A,this.declaredClass);do{H=K._meta;C=K.prototype;if(H&&(C[A]===E&&C.hasOwnProperty(A)||
H.hidden[A]===E))break}while(K=F[++L]);L=K?L:-1}}if(K=F[++L]){C=K.prototype;if(K._meta&&C.hasOwnProperty(A))z=C[A];else{E=x[A];do{C=K.prototype;if((z=C[A])&&(K._meta?C.hasOwnProperty(A):z!==E))break}while(K=F[++L])}}z=K&&z||x[A]}else{if(P.c!==E){L=0;if((H=F[0]._meta)&&H.ctor!==E){C=H.chains;if(!C||C.constructor!=="manual")g("calling chained constructor with inherited",this.declaredClass);for(;K=F[++L];)if((H=K._meta)&&H.ctor===E)break;L=K?L:-1}}for(;K=F[++L];)if(z=(H=K._meta)?H.ctor:K)break;z=K&&
z}P.c=z;P.p=L;if(z)return w===true?z:z.apply(this,w||t)}function e(t,w){if(typeof t=="string")return this.inherited(t,w,true);return this.inherited(t,true)}function f(t){for(var w=this.constructor._meta.bases,z=0,A=w.length;z<A;++z)if(w[z]===t)return true;return this instanceof t}function i(t,w){var z,A=0,C=v._extraNames.length;for(z in w)if(z!=p&&w.hasOwnProperty(z))t[z]=w[z];for(;A<C;++A){z=v._extraNames[A];if(z!=p&&w.hasOwnProperty(z))t[z]=w[z]}}function j(t,w){var z,A,C=0,F=v._extraNames.length;
for(z in w){A=w[z];if((A!==x[z]||!(z in x))&&z!=p){if(k.call(A)=="[object Function]")A.nom=z;t[z]=A}}for(;C<F;++C){z=v._extraNames[C];A=w[z];if((A!==x[z]||!(z in x))&&z!=p){if(k.call(A)=="[object Function]")A.nom=z;t[z]=A}}return t}function h(t){j(this.prototype,t);return this}function l(t,w){return function(){var z=arguments,A=z,C=z[0],F,E;E=t.length;var H;if(!(this instanceof z.callee))return q(z);if(w&&(C&&C.preamble||this.preamble)){H=new Array(t.length);H[0]=z;for(F=0;;){if(C=z[0])if(C=C.preamble)z=
C.apply(this,z)||z;C=t[F].prototype;if(C=C.hasOwnProperty("preamble")&&C.preamble)z=C.apply(this,z)||z;if(++F==E)break;H[F]=z}}for(F=E-1;F>=0;--F){C=t[F];if(C=(E=C._meta)?E.ctor:C)C.apply(this,H?H[F]:z)}(C=this.postscript)&&C.apply(this,A)}}function o(t,w){return function(){var z=arguments,A=z,C=z[0];if(!(this instanceof z.callee))return q(z);if(w){if(C)if(C=C.preamble)A=C.apply(this,A)||A;(C=this.preamble)&&C.apply(this,A)}t&&t.apply(this,z);(C=this.postscript)&&C.apply(this,z)}}function r(t){return function(){var w=
arguments,z=0,A,C;if(!(this instanceof w.callee))return q(w);for(;A=t[z];++z)if(A=(C=A._meta)?C.ctor:A){A.apply(this,w);break}(A=this.postscript)&&A.apply(this,w)}}function u(t,w,z){return function(){var A,C,F=0,E=1;if(z){F=w.length-1;E=-1}for(;A=w[F];F+=E){C=A._meta;(A=(C?C.hidden:A.prototype)[t])&&A.apply(this,arguments)}}}function s(t){m.prototype=t.prototype;t=new m;m.prototype=null;return t}function q(t){var w=t.callee,z=s(w);w.apply(z,t);return z}var v=c,y=v._mixin,x=Object.prototype,k=x.toString,
m=new Function,n=0,p="constructor";v.declare=function(t,w,z){if(typeof t!="string"){z=w;w=t;t=""}z=z||{};var A,C,F,E,H,K,L,P=1,S=w;if(k.call(w)=="[object Array]"){K=a(w,t);F=K[0];P=K.length-F;w=K[P]}else{K=[0];if(w)if(k.call(w)=="[object Function]"){F=w._meta;K=K.concat(F?F.bases:w)}else g("base class is not a callable constructor.",t);else w!==null&&g("unknown base class. Did you use dojo.require to pull it in?",t)}if(w)for(C=P-1;;--C){A=s(w);if(!C)break;F=K[C];(F._meta?i:y)(A,F.prototype);E=new Function;
E.superclass=w;E.prototype=A;w=A.constructor=E}else A={};j(A,z);F=z.constructor;if(F!==x.constructor){F.nom=p;A.constructor=F}for(C=P-1;C;--C)if((F=K[C]._meta)&&F.chains)L=y(L||{},F.chains);if(A["-chains-"])L=y(L||{},A["-chains-"]);F=!L||!L.hasOwnProperty(p);K[0]=E=L&&L.constructor==="manual"?r(K):K.length==1?o(z.constructor,F):l(K,F);E._meta={bases:K,hidden:z,chains:L,parents:S,ctor:z.constructor};E.superclass=w&&w.prototype;E.extend=h;E.prototype=A;A.constructor=E;A.getInherited=e;A.inherited=d;
A.isInstanceOf=f;if(t){A.declaredClass=t;v.setObject(t,E)}if(L)for(H in L)if(A[H]&&typeof L[H]=="string"&&H!=p){F=A[H]=u(H,K,L[H]==="after");F.nom=H}return E};v.safeMixin=j})();return c.declare});
define("dojo/_base/connect",["dojo/lib/kernel","dojo/_base/lang"],function(c){c._listener={getDispatcher:function(){return function(){var g=Array.prototype,a=arguments.callee,d=a._listeners;a=(a=a.target)&&a.apply(this,arguments);var e;d=[].concat(d);for(e in d)e in g||d[e].apply(this,arguments);return a}},add:function(g,a,d){g=g||c.global;var e=g[a];if(!e||!e._listeners){var f=c._listener.getDispatcher();f.target=e;f._listeners=[];e=g[a]=f}return e._listeners.push(d)},remove:function(g,a,d){(g=(g||
c.global)[a])&&g._listeners&&d--&&delete g._listeners[d]}};c.connect=function(){var g=arguments,a=[],d=0;a.push(c.isString(g[0])?null:g[d++],g[d++]);var e=g[d+1];a.push(c.isString(e)||c.isFunction(e)?g[d++]:null,g[d++]);for(e=g.length;d<e;d++)a.push(g[d]);return c._connect.apply(this,a)};c._connect=function(g,a,d,e){var f=c._listener;d=f.add(g,a,c.hitch(d,e));return[g,a,d,f]};c.disconnect=function(g){if(g&&g[0]!==undefined){c._disconnect.apply(this,g);delete g[0]}};c._disconnect=function(g,a,d,e){e.remove(g,
a,d)};c._topics={};c.subscribe=function(g,a,d){return[g,c._listener.add(c._topics,g,c.hitch(a,d))]};c.unsubscribe=function(g){g&&c._listener.remove(c._topics,g[0],g[1])};c.publish=function(g,a){if(g=c._topics[g])g.apply(this,a||[])};c.connectPublisher=function(g,a,d){var e=function(){c.publish(g,arguments)};return d?c.connect(a,d,e):c.connect(a,e)};return c.connect});
define("dojo/_base/Deferred",["dojo/lib/kernel","dojo/_base/lang"],function(c){(function(){var g=function(){},a=Object.freeze||function(){};c.Deferred=function(d){function e(s){if(j)throw new Error("This deferred has already been resolved");i=s;j=true;f()}function f(){for(var s;!s&&o;){var q=o;o=o.next;if(s=q.progress==g)j=false;var v=h?q.error:q.resolved;if(v)try{var y=v(i);if(y&&typeof y.then==="function")y.then(c.hitch(q.deferred,"resolve"),c.hitch(q.deferred,"reject"));else{v=s&&y===undefined;
if(s&&!v)h=y instanceof Error;q.deferred[v&&h?"reject":"resolve"](v?i:y)}}catch(x){q.deferred.reject(x)}else h?q.deferred.reject(i):q.deferred.resolve(i)}}var i,j,h,l,o,r=this.promise={};this.resolve=this.callback=function(s){this.fired=0;this.results=[s,null];e(s)};this.reject=this.errback=function(s){h=true;this.fired=1;e(s);this.results=[null,s];if(!s||s.log!==false)(c.config.deferredOnError||function(q){console.error(q)})(s)};this.progress=function(s){for(var q=o;q;){var v=q.progress;v&&v(s);
q=q.next}};this.addCallbacks=function(s,q){this.then(s,q,g);return this};this.then=r.then=function(s,q,v){var y=v==g?this:new c.Deferred(r.cancel);s={resolved:s,error:q,progress:v,deferred:y};if(o)l=l.next=s;else o=l=s;j&&f();return y.promise};var u=this;this.cancel=r.cancel=function(){if(!j){var s=d&&d(u);if(!j){s instanceof Error||(s=new Error(s));s.log=false;u.reject(s)}}};a(r)};c.extend(c.Deferred,{addCallback:function(){return this.addCallbacks(c.hitch.apply(c,arguments))},addErrback:function(){return this.addCallbacks(null,
c.hitch.apply(c,arguments))},addBoth:function(){var d=c.hitch.apply(c,arguments);return this.addCallbacks(d,d)},fired:-1})})();c.when=function(g,a,d,e){if(g&&typeof g.then==="function")return g.then(a,d,e);return a(g)};return c.Deferred});
define("dojo/_base/json",["dojo/lib/kernel"],function(c){c.fromJson=function(g){return eval("("+g+")")};c._escapeString=function(g){return('"'+g.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")};c.toJsonIndentStr="\t";c.toJson=function(g,a,d){if(g===undefined)return"undefined";var e=typeof g;if(e=="number"||e=="boolean")return g+"";if(g===null)return"null";if(c.isString(g))return c._escapeString(g);var f=
arguments.callee,i;d=d||"";var j=a?d+c.toJsonIndentStr:"";i=g.__json__||g.json;if(c.isFunction(i)){i=i.call(g);if(g!==i)return f(i,a,j)}if(g.nodeType&&g.cloneNode)throw new Error("Can't serialize DOM nodes");i=a?" ":"";var h=a?"\n":"";if(c.isArray(g))return"["+c.map(g,function(u){u=f(u,a,j);if(typeof u!="string")u="undefined";return h+j+u}).join(","+i)+h+d+"]";if(e=="function")return null;e=[];var l;for(l in g){var o,r;if(typeof l=="number")o='"'+l+'"';else if(typeof l=="string")o=c._escapeString(l);
else continue;r=f(g[l],a,j);typeof r=="string"&&e.push(h+j+o+":"+i+r)}return"{"+e.join(","+i)+h+d+"}"};return c});
define("dojo/_base/Color",["dojo/lib/kernel","dojo/_base/array","dojo/_base/lang"],function(c){(function(){c.Color=function(g){g&&this.setColor(g)};c.Color.named={black:[0,0,0],silver:[192,192,192],gray:[128,128,128],white:[255,255,255],maroon:[128,0,0],red:[255,0,0],purple:[128,0,128],fuchsia:[255,0,255],green:[0,128,0],lime:[0,255,0],olive:[128,128,0],yellow:[255,255,0],navy:[0,0,128],blue:[0,0,255],teal:[0,128,128],aqua:[0,255,255],transparent:c.config.transparentColor||[255,255,255]};c.extend(c.Color,
{r:255,g:255,b:255,a:1,_set:function(g,a,d,e){this.r=g;this.g=a;this.b=d;this.a=e},setColor:function(g){if(c.isString(g))c.colorFromString(g,this);else if(c.isArray(g))c.colorFromArray(g,this);else{this._set(g.r,g.g,g.b,g.a);g instanceof c.Color||this.sanitize()}return this},sanitize:function(){return this},toRgb:function(){return[this.r,this.g,this.b]},toRgba:function(){return[this.r,this.g,this.b,this.a]},toHex:function(){return"#"+c.map(["r","g","b"],function(g){g=this[g].toString(16);return g.length<
2?"0"+g:g},this).join("")},toCss:function(g){var a=this.r+", "+this.g+", "+this.b;return(g?"rgba("+a+", "+this.a:"rgb("+a)+")"},toString:function(){return this.toCss(true)}});c.blendColors=function(g,a,d,e){var f=e||new c.Color;c.forEach(["r","g","b","a"],function(i){f[i]=g[i]+(a[i]-g[i])*d;if(i!="a")f[i]=Math.round(f[i])});return f.sanitize()};c.colorFromRgb=function(g,a){return(g=g.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/))&&c.colorFromArray(g[1].split(/\s*,\s*/),a)};c.colorFromHex=function(g,
a){var d=a||new c.Color,e=g.length==4?4:8,f=(1<<e)-1;g=Number("0x"+g.substr(1));if(isNaN(g))return null;c.forEach(["b","g","r"],function(i){var j=g&f;g>>=e;d[i]=e==4?17*j:j});d.a=1;return d};c.colorFromArray=function(g,a){a=a||new c.Color;a._set(Number(g[0]),Number(g[1]),Number(g[2]),Number(g[3]));if(isNaN(a.a))a.a=1;return a.sanitize()};c.colorFromString=function(g,a){var d=c.Color.named[g];return d&&c.colorFromArray(d,a)||c.colorFromRgb(g,a)||c.colorFromHex(g,a)}})();return c.Color});
define("dojo/_base/window",["dojo/lib/kernel"],function(c){c.doc=window.document||null;c.body=function(){return c.doc.body||c.doc.getElementsByTagName("body")[0]};c.setContext=function(g,a){c.global=g;c.doc=a};c.withGlobal=function(g,a,d,e){var f=c.global;try{c.global=g;return c.withDoc.call(null,g.document,a,d,e)}finally{c.global=f}};c.withDoc=function(g,a,d,e){var f=c.doc,i=c._bodyLtr,j=c.isQuirks;try{c.doc=g;delete c._bodyLtr;c.isQuirks=c.doc.compatMode=="BackCompat";if(d&&typeof a=="string")a=
d[a];return a.apply(d,e||[])}finally{c.doc=f;delete c._bodyLtr;if(i!==undefined)c._bodyLtr=i;c.isQuirks=j}};return c});
define("dojo/_base/event",["dojo/lib/kernel","dojo/_base/connect"],function(c){(function(){var g=c._event_listener={add:function(h,l,o){if(h){l=g._normalizeEventName(l);o=g._fixCallback(l,o);if(!c.isIE&&(l=="mouseenter"||l=="mouseleave")){var r=o;l=l=="mouseenter"?"mouseover":"mouseout";o=function(u){if(!c.isDescendant(u.relatedTarget,h))return r.call(this,u)}}h.addEventListener(l,o,false);return o}},remove:function(h,l,o){if(h){l=g._normalizeEventName(l);if(!c.isIE&&(l=="mouseenter"||l=="mouseleave"))l=
l=="mouseenter"?"mouseover":"mouseout";h.removeEventListener(l,o,false)}},_normalizeEventName:function(h){return h.slice(0,2)=="on"?h.slice(2):h},_fixCallback:function(h,l){return h!="keypress"?l:function(o){return l.call(this,g._fixEvent(o,this))}},_fixEvent:function(h){switch(h.type){case "keypress":g._setKeyChar(h);break}return h},_setKeyChar:function(h){h.keyChar=h.charCode>=32?String.fromCharCode(h.charCode):"";h.charOrCode=h.keyChar||h.keyCode},_punctMap:{106:42,111:47,186:59,187:43,188:44,
189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39}};c.fixEvent=function(h,l){return g._fixEvent(h,l)};c.stopEvent=function(h){h.preventDefault();h.stopPropagation()};var a=c._listener;c._connect=function(h,l,o,r,u){u=h&&(h.nodeType||h.attachEvent||h.addEventListener)?u?2:1:0;o=[c._listener,g,a][u].add(h,l,c.hitch(o,r));return[h,l,o,u]};c._disconnect=function(h,l,o,r){[c._listener,g,a][r].remove(h,l,o)};c.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:c.isSafari?91:224,
PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,
F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,copyKey:c.isMac&&!c.isAIR?c.isSafari?91:224:17};var d=c.isMac?"metaKey":"ctrlKey";c.isCopyKey=function(h){return h[d]};c.mouseButtons=c.isIE<9||c.isIE&&c.isQuirks?{LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(h,l){return h.button&l},isLeft:function(h){return h.button&1},isMiddle:function(h){return h.button&4},isRight:function(h){return h.button&2}}:{LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(h,l){return h.button==l},isLeft:function(h){return h.button==
0},isMiddle:function(h){return h.button==1},isRight:function(h){return h.button==2}};if(c.isIE){var e=function(h,l){try{return h.keyCode=l}catch(o){return 0}},f=c._listener,i=c._ieListenersName="_"+c._scopeName+"_listeners";if(!c.config._allow_leaks){a=f=c._ie_listener={handlers:[],add:function(h,l,o){h=h||c.global;var r=h[l];if(!r||!r[i]){var u=c._getIeDispatcher();u.target=r&&j.push(r)-1;u[i]=[];r=h[l]=u}return r[i].push(j.push(o)-1)},remove:function(h,l,o){l=(h=(h||c.global)[l])&&h[i];if(h&&l&&
o--){delete j[l[o]];delete l[o]}}};var j=f.handlers}c.mixin(g,{add:function(h,l,o){if(h){l=g._normalizeEventName(l);if(l=="onkeypress"){var r=h.onkeydown;if(!r||!r[i]||!r._stealthKeydownHandle){var u=g.add(h,"onkeydown",g._stealthKeyDown);r=h.onkeydown;r._stealthKeydownHandle=u;r._stealthKeydownRefs=1}else r._stealthKeydownRefs++}return f.add(h,l,g._fixCallback(o))}},remove:function(h,l,o){l=g._normalizeEventName(l);f.remove(h,l,o);if(l=="onkeypress"){l=h.onkeydown;if(--l._stealthKeydownRefs<=0){f.remove(h,
"onkeydown",l._stealthKeydownHandle);delete l._stealthKeydownHandle}}},_normalizeEventName:function(h){return h.slice(0,2)!="on"?"on"+h:h},_nop:function(){},_fixEvent:function(h,l){if(!h)h=(l&&(l.ownerDocument||l.document||l).parentWindow||window).event;if(!h)return h;h.target=h.srcElement;h.currentTarget=l||h.srcElement;h.layerX=h.offsetX;h.layerY=h.offsetY;l=(l=h.srcElement)&&l.ownerDocument||document;l=c.isIE<6||l.compatMode=="BackCompat"?l.body:l.documentElement;var o=c._getIeDocumentElementOffset();
h.pageX=h.clientX+c._fixIeBiDiScrollLeft(l.scrollLeft||0)-o.x;h.pageY=h.clientY+(l.scrollTop||0)-o.y;if(h.type=="mouseover")h.relatedTarget=h.fromElement;if(h.type=="mouseout")h.relatedTarget=h.toElement;if(c.isIE<9||c.isQuirks){h.stopPropagation=g._stopPropagation;h.preventDefault=g._preventDefault}return g._fixKeys(h)},_fixKeys:function(h){switch(h.type){case "keypress":var l="charCode"in h?h.charCode:h.keyCode;if(l==10){l=0;h.keyCode=13}else if(l==13||l==27)l=0;else if(l==3)l=99;h.charCode=l;g._setKeyChar(h);
break}return h},_stealthKeyDown:function(h){var l=h.currentTarget.onkeypress;if(l&&l[i]){var o=h.keyCode,r=(o!=13||c.isIE>=9&&!c.isQuirks)&&o!=32&&o!=27&&(o<48||o>90)&&(o<96||o>111)&&(o<186||o>192)&&(o<219||o>222);if(r||h.ctrlKey){r=r?0:o;if(h.ctrlKey)if(o==3||o==13)return;else if(r>95&&r<106)r-=48;else if(!h.shiftKey&&r>=65&&r<=90)r+=32;else r=g._punctMap[r]||r;o=g._synthesizeEvent(h,{type:"keypress",faux:true,charCode:r});l.call(h.currentTarget,o);if(c.isIE<9||c.isIE&&c.isQuirks)h.cancelBubble=
o.cancelBubble;h.returnValue=o.returnValue;e(h,o.keyCode)}}},_stopPropagation:function(){this.cancelBubble=true},_preventDefault:function(){this.bubbledKeyCode=this.keyCode;this.ctrlKey&&e(this,0);this.returnValue=false}});c.stopEvent=c.isIE<9||c.isQuirks?function(h){h=h||window.event;g._stopPropagation.call(h);g._preventDefault.call(h)}:c.stopEvent}g._synthesizeEvent=function(h,l){l=c.mixin({},h,l);g._setKeyChar(l);l.preventDefault=function(){h.preventDefault()};l.stopPropagation=function(){h.stopPropagation()};
return l};c.isOpera&&c.mixin(g,{_fixEvent:function(h){switch(h.type){case "keypress":var l=h.which;if(l==3)l=99;l=l<41&&!h.shiftKey?0:l;if(h.ctrlKey&&!h.shiftKey&&l>=65&&l<=90)l+=32;return g._synthesizeEvent(h,{charCode:l})}return h}});if(c.isWebKit){g._add=g.add;g._remove=g.remove;c.mixin(g,{add:function(h,l,o){if(h){var r=g._add(h,l,o);if(g._normalizeEventName(l)=="keypress")r._stealthKeyDownHandle=g._add(h,"keydown",function(u){var s=u.keyCode,q=s!=13&&s!=32&&(s<48||s>90)&&(s<96||s>111)&&(s<186||
s>192)&&(s<219||s>222);if(q||u.ctrlKey){q=q?0:s;if(u.ctrlKey)if(s==3||s==13)return;else if(q>95&&q<106)q-=48;else if(!u.shiftKey&&q>=65&&q<=90)q+=32;else q=g._punctMap[q]||q;s=g._synthesizeEvent(u,{type:"keypress",faux:true,charCode:q});o.call(u.currentTarget,s)}});return r}},remove:function(h,l,o){if(h){o._stealthKeyDownHandle&&g._remove(h,"keydown",o._stealthKeyDownHandle);g._remove(h,l,o)}},_fixEvent:function(h){switch(h.type){case "keypress":if(h.faux)return h;var l=h.charCode;l=l>=32?l:0;return g._synthesizeEvent(h,
{charCode:l,faux:true})}return h}})}})();if(c.isIE){c._ieDispatcher=function(g,a){var d=Array.prototype,e=c._ie_listener.handlers,f=g.callee,i=f[c._ieListenersName];f=(f=e[f.target])&&f.apply(a,g);i=[].concat(i);for(var j in i){var h=e[i[j]];!(j in d)&&h&&h.apply(a,g)}return f};c._getIeDispatcher=function(){return new Function(c._scopeName+"._ieDispatcher(arguments, this)")};c._event_listener._fixCallback=function(g){var a=c._event_listener._fixEvent;return function(d){return g.call(this,a(d,this))}}}return c.connect});
define("dojo/_base/html",["dojo/lib/kernel","dojo/_base/lang"],function(c){try{document.execCommand("BackgroundImageCache",false,true)}catch(g){}c.byId=c.isIE?function(a,d){if(typeof a!="string")return a;var e=d||c.doc;if((d=e.getElementById(a))&&(d.attributes.id.value==a||d.id==a))return d;else{var f=e.all[a];if(!f||f.nodeName)f=[f];for(var i=0;d=f[i++];)if(d.attributes&&d.attributes.id&&d.attributes.id.value==a||d.id==a)return d}}:function(a,d){return(typeof a=="string"?(d||c.doc).getElementById(a):
a)||null};(function(){var a=c.byId,d=null,e;c.addOnWindowUnload(function(){d=null});c._destroyElement=c.destroy=function(B){B=a(B);try{var D=B.ownerDocument;if(!d||e!=D){d=D.createElement("div");e=D}d.appendChild(B.parentNode?B.parentNode.removeChild(B):B);d.innerHTML=""}catch(I){}};c.isDescendant=function(B,D){try{B=a(B);for(D=a(D);B;){if(B==D)return true;B=B.parentNode}}catch(I){}return false};c.setSelectable=function(B,D){B=a(B);if(c.isMozilla)B.style.MozUserSelect=D?"":"none";else if(c.isKhtml||
c.isWebKit)B.style.KhtmlUserSelect=D?"auto":"none";else if(c.isIE){D=B.unselectable=D?"":"on";c.query("*",B).forEach("item.unselectable = '"+D+"'")}};var f=function(B,D){var I=D.parentNode;I&&I.insertBefore(B,D)},i=function(B,D){var I=D.parentNode;if(I)I.lastChild==D?I.appendChild(B):I.insertBefore(B,D.nextSibling)};c.place=function(B,D,I){D=a(D);if(typeof B=="string")B=/^\s*</.test(B)?c._toDom(B,D.ownerDocument):a(B);if(typeof I=="number"){var O=D.childNodes;!O.length||O.length<=I?D.appendChild(B):
f(B,O[I<0?0:I])}else switch(I){case "before":f(B,D);break;case "after":i(B,D);break;case "replace":D.parentNode.replaceChild(B,D);break;case "only":c.empty(D);D.appendChild(B);break;case "first":if(D.firstChild){f(B,D.firstChild);break}default:D.appendChild(B)}return B};c.boxModel="content-box";if(c.isIE)c.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";var j;j=c.isWebKit?function(B){var D;if(B.nodeType==1){var I=B.ownerDocument.defaultView;D=I.getComputedStyle(B,null);if(!D&&
B.style){B.style.display="";D=I.getComputedStyle(B,null)}}return D||{}}:c.isIE?function(B){return B.nodeType==1?B.currentStyle:{}}:function(B){return B.nodeType==1?B.ownerDocument.defaultView.getComputedStyle(B,null):{}};c.getComputedStyle=j;c._toPixelValue=c.isIE?function(B,D){if(!D)return 0;if(D=="medium")return 4;if(D.slice&&D.slice(-2)=="px")return parseFloat(D);with(B){B=style.left;var I=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=D;D=style.pixelLeft}catch(O){D=0}style.left=
B;runtimeStyle.left=I}return D}:function(B,D){return parseFloat(D)||0};var h=c._toPixelValue,l=function(B,D){try{return B.filters.item("DXImageTransform.Microsoft.Alpha")}catch(I){return D?{}:null}};c._getOpacity=c.isIE<9?function(B){try{return l(B).Opacity/100}catch(D){return 1}}:function(B){return j(B).opacity};c._setOpacity=c.isIE<9?function(B,D){var I=D*100,O=D==1;B.style.zoom=O?"":1;if(l(B))l(B,1).Opacity=I;else{if(O)return D;B.style.filter+=" progid:DXImageTransform.Microsoft.Alpha(Opacity="+
I+")"}l(B,1).Enabled=!O;B.nodeName.toLowerCase()=="tr"&&c.query("> td",B).forEach(function(R){c._setOpacity(R,D)});return D}:function(B,D){return B.style.opacity=D};var o={left:true,top:true},r=/margin|padding|width|height|max|min|offset/,u=function(B,D,I){D=D.toLowerCase();if(c.isIE){if(I=="auto"){if(D=="height")return B.offsetHeight;if(D=="width")return B.offsetWidth}if(D=="fontweight")switch(I){case 700:return"bold";case 400:default:return"normal"}}D in o||(o[D]=r.test(D));return o[D]?h(B,I):I},
s=c.isIE?"styleFloat":"cssFloat",q={cssFloat:s,styleFloat:s,"float":s};c.style=function(B,D,I){var O=a(B),R=arguments.length,T=D=="opacity";D=q[D]||D;if(R==3)return T?c._setOpacity(O,I):(O.style[D]=I);if(R==2&&T)return c._getOpacity(O);T=j(O);if(R==2&&typeof D!="string"){for(var X in D)c.style(B,X,D[X]);return T}return R==1?T:u(O,D,T[D]||O.style[D])};c._getPadExtents=function(B,D){D=D||j(B);var I=h(B,D.paddingLeft),O=h(B,D.paddingTop);return{l:I,t:O,w:I+h(B,D.paddingRight),h:O+h(B,D.paddingBottom)}};
c._getBorderExtents=function(B,D){D=D||j(B);var I=D.borderLeftStyle!="none"?h(B,D.borderLeftWidth):0,O=D.borderTopStyle!="none"?h(B,D.borderTopWidth):0;return{l:I,t:O,w:I+(D.borderRightStyle!="none"?h(B,D.borderRightWidth):0),h:O+(D.borderBottomStyle!="none"?h(B,D.borderBottomWidth):0)}};c._getPadBorderExtents=function(B,D){var I=D||j(B);D=c._getPadExtents(B,I);B=c._getBorderExtents(B,I);return{l:D.l+B.l,t:D.t+B.t,w:D.w+B.w,h:D.h+B.h}};c._getMarginExtents=function(B,D){D=D||j(B);var I=h(B,D.marginLeft),
O=h(B,D.marginTop),R=h(B,D.marginRight);B=h(B,D.marginBottom);if(c.isWebKit&&D.position!="absolute")R=I;return{l:I,t:O,w:I+R,h:O+B}};c._getMarginBox=function(B,D){var I=D||j(B);D=c._getMarginExtents(B,I);var O=B.offsetLeft-D.l,R=B.offsetTop-D.t,T=B.parentNode;if(c.isMoz){var X=parseFloat(I.left);I=parseFloat(I.top);if(!isNaN(X)&&!isNaN(I)){O=X;R=I}else if(T&&T.style){X=j(T);if(X.overflow!="visible"){T=c._getBorderExtents(T,X);O+=T.l;R+=T.t}}}else if(c.isOpera||c.isIE>7&&!c.isQuirks)if(T){T=c._getBorderExtents(T);
O-=T.l;R-=T.t}return{l:O,t:R,w:B.offsetWidth+D.w,h:B.offsetHeight+D.h}};c._getMarginSize=function(B,D){B=a(B);D=c._getMarginExtents(B,D||j(B));B=B.getBoundingClientRect();return{w:B.right-B.left+D.w,h:B.bottom-B.top+D.h}};c._getContentBox=function(B,D){var I=D||j(B);D=c._getPadExtents(B,I);I=c._getBorderExtents(B,I);var O=B.clientWidth;if(O){B=B.clientHeight;I.w=I.h=0}else{O=B.offsetWidth;B=B.offsetHeight}if(c.isOpera){D.l+=I.l;D.t+=I.t}return{l:D.l,t:D.t,w:O-D.w-I.w,h:B-D.h-I.h}};c._getBorderBox=
function(B,D){var I=D||j(B);D=c._getPadExtents(B,I);B=c._getContentBox(B,I);return{l:B.l-D.l,t:B.t-D.t,w:B.w+D.w,h:B.h+D.h}};c._setBox=function(B,D,I,O,R,T){T=T||"px";B=B.style;if(!isNaN(D))B.left=D+T;if(!isNaN(I))B.top=I+T;if(O>=0)B.width=O+T;if(R>=0)B.height=R+T};c._isButtonTag=function(B){return B.tagName=="BUTTON"||B.tagName=="INPUT"&&(B.getAttribute("type")||"").toUpperCase()=="BUTTON"};c._usesBorderBox=function(B){var D=B.tagName;return c.boxModel=="border-box"||D=="TABLE"||c._isButtonTag(B)};
c._setContentSize=function(B,D,I,O){if(c._usesBorderBox(B)){O=c._getPadBorderExtents(B,O);if(D>=0)D+=O.w;if(I>=0)I+=O.h}c._setBox(B,NaN,NaN,D,I)};c._setMarginBox=function(B,D,I,O,R,T){var X=T||j(B);T=c._usesBorderBox(B)?v:c._getPadBorderExtents(B,X);if(c.isWebKit)if(c._isButtonTag(B)){var da=B.style;if(O>=0&&!da.width)da.width="4px";if(R>=0&&!da.height)da.height="4px"}X=c._getMarginExtents(B,X);if(O>=0)O=Math.max(O-T.w-X.w,0);if(R>=0)R=Math.max(R-T.h-X.h,0);c._setBox(B,D,I,O,R)};var v={l:0,t:0,w:0,
h:0};c.marginBox=function(B,D){B=a(B);var I=j(B);return!D?c._getMarginBox(B,I):c._setMarginBox(B,D.l,D.t,D.w,D.h,I)};c.contentBox=function(B,D){B=a(B);var I=j(B);return!D?c._getContentBox(B,I):c._setContentSize(B,D.w,D.h,I)};c._docScroll=function(){var B=c.global;return"pageXOffset"in B?{x:B.pageXOffset,y:B.pageYOffset}:(B=c.isQuirks?c.doc.body:c.doc.documentElement,{x:c._fixIeBiDiScrollLeft(B.scrollLeft||0),y:B.scrollTop||0})};c._isBodyLtr=function(){return"_bodyLtr"in c?c._bodyLtr:(c._bodyLtr=(c.body().dir||
c.doc.documentElement.dir||"ltr").toLowerCase()=="ltr")};c._getIeDocumentElementOffset=function(){var B=c.doc.documentElement;if(c.isIE<8){var D=B.getBoundingClientRect(),I=D.left;D=D.top;if(c.isIE<7){I+=B.clientLeft;D+=B.clientTop}return{x:I<0?0:I,y:D<0?0:D}}else return{x:0,y:0}};c._fixIeBiDiScrollLeft=function(B){var D=c.isIE;if(D&&!c._isBodyLtr()){var I=c.isQuirks,O=I?c.doc.body:c.doc.documentElement;if(D==6&&!I&&c.global.frameElement&&O.scrollHeight>O.clientHeight)B+=O.clientLeft;return D<8||
I?B+O.clientWidth-O.scrollWidth:-B}return B};c._abs=c.position=function(B,D){B=a(B);var I=c.body(),O=I.parentNode;B=B.getBoundingClientRect();B={x:B.left,y:B.top,w:B.right-B.left,h:B.bottom-B.top};if(c.isIE){O=c._getIeDocumentElementOffset();B.x-=O.x+(c.isQuirks?I.clientLeft+I.offsetLeft:0);B.y-=O.y+(c.isQuirks?I.clientTop+I.offsetTop:0)}else if(c.isFF==3){I=j(O);B.x-=h(O,I.marginLeft)+h(O,I.borderLeftWidth);B.y-=h(O,I.marginTop)+h(O,I.borderTopWidth)}if(D){D=c._docScroll();B.x+=D.x;B.y+=D.y}return B};
c.coords=function(B,D){B=a(B);var I=j(B);I=c._getMarginBox(B,I);D=c.position(B,D);I.x=D.x;I.y=D.y;return I};var y={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"},x={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"},k={innerHTML:1,className:1,htmlFor:c.isIE,value:1},m=function(B){return x[B.toLowerCase()]||B},n=function(B,D){return(B=B.getAttributeNode&&B.getAttributeNode(D))&&
B.specified};c.hasAttr=function(B,D){var I=D.toLowerCase();return k[y[I]||D]||n(a(B),x[I]||D)};var p={},t=0,w=c._scopeName+"attrid",z={col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1};c.attr=function(B,D,I){B=a(B);var O=arguments.length;if(O==2&&typeof D!="string"){for(var R in D)c.attr(B,R,D[R]);return B}var T=D.toLowerCase();R=y[T]||D;var X=k[R];T=x[T]||D;if(O==3){if(R=="style"&&typeof I!="string")c.style(B,I);else if(R=="innerHTML")if(c.isIE&&B.tagName.toLowerCase()in z){c.empty(B);
B.appendChild(c._toDom(I,B.ownerDocument))}else B[R]=I;else if(c.isFunction(I)){O=c.attr(B,w);if(!O){O=t++;c.attr(B,w,O)}p[O]||(p[O]={});if(X=p[O][R])c.disconnect(X);else try{delete B[R]}catch(da){}p[O][R]=c.connect(B,R,I)}else if(X||typeof I=="boolean")B[R]=I;else B.setAttribute(T,I);return B}I=B[R];if(X&&typeof I!="undefined")return I;if(R!="href"&&(typeof I=="boolean"||c.isFunction(I)))return I;return n(B,T)?B.getAttribute(T):null};c.removeAttr=function(B,D){a(B).removeAttribute(m(D))};c.getNodeProp=
function(B,D){B=a(B);var I=D.toLowerCase(),O=y[I]||D;if(O in B&&O!="href")return B[O];D=x[I]||D;return n(B,D)?B.getAttribute(D):null};c.create=function(B,D,I,O){var R=c.doc;if(I){I=a(I);R=I.ownerDocument}if(typeof B=="string")B=R.createElement(B);D&&c.attr(B,D);I&&c.place(B,I,O);return B};c.empty=c.isIE?function(B){B=a(B);for(var D;D=B.lastChild;)c.destroy(D)}:function(B){a(B).innerHTML=""};var A={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody",
"tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},C=/<\s*([\w\:]+)/,F={},E=0,H="__"+c._scopeName+"ToDomId";for(var K in A)if(A.hasOwnProperty(K)){var L=A[K];L.pre=K=="option"?'<select multiple="multiple">':"<"+L.join("><")+">";L.post="</"+L.reverse().join("></")+">"}c._toDom=function(B,D){D=D||c.doc;var I=D[H];if(!I){D[H]=I=++E+"";F[I]=D.createElement("div")}B+="";var O=B.match(C),R=O?O[1].toLowerCase():"";I=F[I];if(O&&A[R]){O=
A[R];I.innerHTML=O.pre+B+O.post;for(B=O.length;B;--B)I=I.firstChild}else I.innerHTML=B;if(I.childNodes.length==1)return I.removeChild(I.firstChild);for(B=D.createDocumentFragment();D=I.firstChild;)B.appendChild(D);return B};var P="className";c.hasClass=function(B,D){return(" "+a(B)[P]+" ").indexOf(" "+D+" ")>=0};var S=/\s+/,Y=[""],Q={},ea=function(B){if(typeof B=="string"||B instanceof String)if(B.indexOf(" ")<0){Y[0]=B;return Y}else return B.split(S);return B||""};c.addClass=function(B,D){B=a(B);
D=ea(D);var I=B[P],O;I=I?" "+I+" ":" ";O=I.length;for(var R=0,T=D.length,X;R<T;++R)if((X=D[R])&&I.indexOf(" "+X+" ")<0)I+=X+" ";if(O<I.length)B[P]=I.substr(1,I.length-2)};c.removeClass=function(B,D){B=a(B);var I;if(D!==undefined){D=ea(D);I=" "+B[P]+" ";for(var O=0,R=D.length;O<R;++O)I=I.replace(" "+D[O]+" "," ");I=c.trim(I)}else I="";if(B[P]!=I)B[P]=I};c.replaceClass=function(B,D,I){B=a(B);Q.className=B.className;c.removeClass(Q,I);c.addClass(Q,D);if(B.className!==Q.className)B.className=Q.className};
c.toggleClass=function(B,D,I){if(I===undefined)I=!c.hasClass(B,D);c[I?"addClass":"removeClass"](B,D)}})();return c});
define("dojo/_base/NodeList",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/_base/html"],function(c){(function(){var g=Array.prototype,a=g.slice,d=g.concat,e=function(s,q,v){s.sort||(s=a.call(s,0));v=v||this._NodeListCtor||c._NodeListCtor;s.constructor=v;c._mixin(s,v.prototype);s._NodeListCtor=v;return q?s._stash(q):s},f=function(s,q,v){q=[0].concat(a.call(q,0));v=v||c.global;return function(y){q[0]=y;return s.apply(v,q)}},i=function(s,q){return function(){this.forEach(f(s,
arguments,q));return this}},j=function(s,q){return function(){return this.map(f(s,arguments,q))}},h=function(s,q,v){return function(){var y=arguments,x=f(s,y,v);if(q.call(v||c.global,y))return this.map(x);this.forEach(x);return this}},l=function(s){return s.length==1&&typeof s[0]=="string"},o=function(s){var q=s.parentNode;q&&q.removeChild(s)};c.NodeList=function(){return e(Array.apply(null,arguments))};var r=c._NodeListCtor=c.NodeList,u=r.prototype;r._wrap=u._wrap=e;r._adaptAsMap=j;r._adaptAsForEach=
i;r._adaptAsFilter=function(s,q){return function(){return this.filter(f(s,arguments,q))}};r._adaptWithCondition=h;c.forEach(["slice","splice"],function(s){var q=g[s];u[s]=function(){return this._wrap(q.apply(this,arguments),s=="slice"?this:null)}});c.forEach(["indexOf","lastIndexOf","every","some"],function(s){var q=c[s];u[s]=function(){return q.apply(c,[this].concat(a.call(arguments,0)))}});c.forEach(["attr","style"],function(s){u[s]=h(c[s],l)});c.forEach(["connect","addClass","removeClass","replaceClass",
"toggleClass","empty","removeAttr"],function(s){u[s]=i(c[s])});c.extend(c.NodeList,{_normalize:function(s,q){var v=s.parse===true?true:false;if(typeof s.template=="string"){var y=s.templateFunc||c.string&&c.string.substitute;s=y?y(s.template,s):s}y=typeof s;if(y=="string"||y=="number"){s=c._toDom(s,q&&q.ownerDocument);s=s.nodeType==11?c._toArray(s.childNodes):[s]}else if(c.isArrayLike(s))c.isArray(s)||(s=c._toArray(s));else s=[s];if(v)s._runParse=true;return s},_cloneNode:function(s){return s.cloneNode(true)},
_place:function(s,q,v,y){if(!(q.nodeType!=1&&v=="only")){q=q;for(var x,k=s.length,m=k-1;m>=0;m--){var n=y?this._cloneNode(s[m]):s[m];if(s._runParse&&c.parser&&c.parser.parse){x||(x=q.ownerDocument.createElement("div"));x.appendChild(n);c.parser.parse(x);for(n=x.firstChild;x.firstChild;)x.removeChild(x.firstChild)}m==k-1?c.place(n,q,v):q.parentNode.insertBefore(n,q);q=n}}},_stash:function(s){this._parent=s;return this},end:function(){return this._parent?this._parent:new this._NodeListCtor},concat:function(){var s=
c.isArray(this)?this:a.call(this,0),q=c.map(arguments,function(v){return v&&!c.isArray(v)&&(typeof NodeList!="undefined"&&v.constructor===NodeList||v.constructor===this._NodeListCtor)?a.call(v,0):v});return this._wrap(d.apply(s,q),this)},map:function(s,q){return this._wrap(c.map(this,s,q),this)},forEach:function(s,q){c.forEach(this,s,q);return this},coords:j(c.coords),position:j(c.position),place:function(s,q){var v=c.query(s)[0];return this.forEach(function(y){c.place(y,v,q)})},orphan:function(s){return(s?
c._filterQueryResult(this,s):this).forEach(o)},adopt:function(s,q){return c.query(s).place(this[0],q)._stash(this)},query:function(s){if(!s)return this;var q=this.map(function(v){return c.query(s,v).filter(function(y){return y!==undefined})});return this._wrap(d.apply([],q),this)},filter:function(s){var q=arguments,v=this,y=0;if(typeof s=="string"){v=c._filterQueryResult(this,q[0]);if(q.length==1)return v._stash(this);y=1}return this._wrap(c.filter(v,q[y],q[y+1]),this)},addContent:function(s,q){s=
this._normalize(s,this[0]);for(var v=0,y;y=this[v];v++)this._place(s,y,q,v>0);return this},instantiate:function(s,q){var v=c.isFunction(s)?s:c.getObject(s);q=q||{};return this.forEach(function(y){new v(q,y)})},at:function(){var s=new this._NodeListCtor;c.forEach(arguments,function(q){if(q<0)q=this.length+q;this[q]&&s.push(this[q])},this);return s._stash(this)}});r.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove",
"mouseout","mouseover","mouseup","submit"];c.forEach(r.events,function(s){var q="on"+s;u[q]=function(v,y){return this.connect(q,v,y)}})})();return c.NodeList});
(function(){var c=function(a){var d=a.trim,e=a.forEach,f=a._NodeListCtor=a.NodeList,i=function(){return a.doc},j=(a.isWebKit||a.isMozilla)&&i().compatMode=="BackCompat",h=i().firstChild.children?"children":"childNodes",l=false,o=function(){return true},r=function(G){G+=">~+".indexOf(G.slice(-1))>=0?" * ":" ";for(var J=function(na,oa){return d(G.slice(na,oa))},M=[],N=-1,U=-1,W=-1,Z=-1,V=-1,$=-1,ca=-1,ha="",fa="",ja,ba=0,pa=G.length,aa=null,ia=null,qa=function(){if(ca>=0){var na=ca==ba?null:J(ca,ba);
aa[">~+".indexOf(na)<0?"tag":"oper"]=na;ca=-1}},ra=function(){if($>=0){aa.id=J($,ba).replace(/\\/g,"");$=-1}},sa=function(){if(V>=0){aa.classes.push(J(V+1,ba).replace(/\\/g,""));V=-1}},ma=function(){ra();qa();sa()},ta=function(){ma();Z>=0&&aa.pseudos.push({name:J(Z+1,ba)});aa.loops=aa.pseudos.length||aa.attrs.length||aa.classes.length;aa.oquery=aa.query=J(ja,ba);aa.otag=aa.tag=aa.oper?null:aa.tag||"*";if(aa.tag)aa.tag=aa.tag.toUpperCase();if(M.length&&M[M.length-1].oper){aa.infixOper=M.pop();aa.query=
aa.infixOper.query+" "+aa.query}M.push(aa);aa=null};ha=fa,fa=G.charAt(ba),ba<pa;ba++)if(ha!="\\"){if(!aa){ja=ba;aa={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return l?this.otag:this.tag}};ca=ba}if(N>=0)if(fa=="]"){if(ia.attr)ia.matchFor=J(W||N+1,ba);else ia.attr=J(N+1,ba);if(N=ia.matchFor)if(N.charAt(0)=='"'||N.charAt(0)=="'")ia.matchFor=N.slice(1,-1);aa.attrs.push(ia);ia=null;N=W=-1}else{if(fa=="="){W="|~^$*".indexOf(ha)>=0?ha:"";ia.type=W+fa;ia.attr=
J(N+1,ba-W.length);W=ba+1}}else if(U>=0){if(fa==")"){if(Z>=0)ia.value=J(U+1,ba);Z=U=-1}}else if(fa=="#"){ma();$=ba+1}else if(fa=="."){ma();V=ba}else if(fa==":"){ma();Z=ba}else if(fa=="["){ma();N=ba;ia={}}else if(fa=="("){if(Z>=0){ia={name:J(Z+1,ba),value:null};aa.pseudos.push(ia)}U=ba}else fa==" "&&ha!=fa&&ta()}return M},u=function(G,J){if(!G)return J;if(!J)return G;return function(){return G.apply(window,arguments)&&J.apply(window,arguments)}},s=function(G,J){J=J||[];G&&J.push(G);return J},q=function(G){return 1==
G.nodeType},v=function(G,J){if(!G)return"";if(J=="class")return G.className||"";if(J=="for")return G.htmlFor||"";if(J=="style")return G.style.cssText||"";return(l?G.getAttribute(J):G.getAttribute(J,2))||""},y={"*=":function(G,J){return function(M){return v(M,G).indexOf(J)>=0}},"^=":function(G,J){return function(M){return v(M,G).indexOf(J)==0}},"$=":function(G,J){return function(M){M=" "+v(M,G);return M.lastIndexOf(J)==M.length-J.length}},"~=":function(G,J){var M=" "+J+" ";return function(N){return(" "+
v(N,G)+" ").indexOf(M)>=0}},"|=":function(G,J){var M=" "+J+"-";return function(N){N=" "+v(N,G);return N==J||N.indexOf(M)==0}},"=":function(G,J){return function(M){return v(M,G)==J}}},x=typeof i().firstChild.nextElementSibling=="undefined",k=!x?"nextElementSibling":"nextSibling",m=!x?"previousElementSibling":"previousSibling",n=x?q:o,p=function(G){for(;G=G[m];)if(n(G))return false;return true},t=function(G){for(;G=G[k];)if(n(G))return false;return true},w=function(G){var J=G.parentNode,M=0,N=J[h],
U=G._i||-1,W=J._l||-1;if(!N)return-1;N=N.length;if(W==N&&U>=0&&W>=0)return U;J._l=N;U=-1;for(J=J.firstElementChild||J.firstChild;J;J=J[k])if(n(J)){J._i=++M;if(G===J)U=M}return U},z=function(G){return!(w(G)%2)},A=function(G){return w(G)%2},C={checked:function(){return function(G){return!!("checked"in G?G.checked:G.selected)}},"first-child":function(){return p},"last-child":function(){return t},"only-child":function(){return function(G){if(!p(G))return false;if(!t(G))return false;return true}},empty:function(){return function(G){var J=
G.childNodes;for(G=G.childNodes.length-1;G>=0;G--){var M=J[G].nodeType;if(M===1||M==3)return false}return true}},contains:function(G,J){G=J.charAt(0);if(G=='"'||G=="'")J=J.slice(1,-1);return function(M){return M.innerHTML.indexOf(J)>=0}},not:function(G,J){G=r(J)[0];J={el:1};if(G.tag!="*")J.tag=1;if(!G.classes.length)J.classes=1;var M=E(G,J);return function(N){return!M(N)}},"nth-child":function(G,J){G=parseInt;if(J=="odd")return A;else if(J=="even")return z;if(J.indexOf("n")!=-1){J=J.split("n",2);
var M=J[0]?J[0]=="-"?-1:G(J[0]):1,N=J[1]?G(J[1]):0,U=0,W=-1;if(M>0)if(N<0)N=N%M&&M+N%M;else{if(N>0){if(N>=M)U=N-N%M;N%=M}}else if(M<0){M*=-1;if(N>0){W=N;N%=M}}if(M>0)return function(V){V=w(V);return V>=U&&(W<0||V<=W)&&V%M==N};else J=N}var Z=G(J);return function(V){return w(V)==Z}}},F=a.isIE<9||dojo.isIE&&dojo.isQuirks?function(G){var J=G.toLowerCase();if(J=="class")G="className";return function(M){return l?M.getAttribute(G):M[G]||M[J]}}:function(G){return function(J){return J&&J.getAttribute&&J.hasAttribute(G)}},
E=function(G,J){if(!G)return o;J=J||{};var M=null;"el"in J||(M=u(M,q));if(!("tag"in J))if(G.tag!="*")M=u(M,function(N){return N&&N.tagName==G.getTag()});"classes"in J||e(G.classes,function(N,U){var W=new RegExp("(?:^|\\s)"+N+"(?:\\s|$)");M=u(M,function(Z){return W.test(Z.className)});M.count=U});"pseudos"in J||e(G.pseudos,function(N){var U=N.name;if(C[U])M=u(M,C[U](U,N.value))});"attrs"in J||e(G.attrs,function(N){var U,W=N.attr;if(N.type&&y[N.type])U=y[N.type](W,N.matchFor);else if(W.length)U=F(W);
if(U)M=u(M,U)});if(!("id"in J))if(G.id)M=u(M,function(N){return!!N&&N.id==G.id});M||"default"in J||(M=o);return M},H=function(G){return function(J,M,N){for(;J=J[k];)if(!(x&&!q(J))){if((!N||ka(J,N))&&G(J))M.push(J);break}return M}},K=function(G){return function(J,M,N){for(J=J[k];J;){if(n(J)){if(N&&!ka(J,N))break;G(J)&&M.push(J)}J=J[k]}return M}},L=function(G){G=G||o;return function(J,M,N){for(var U=0,W=J[h];J=W[U++];)if(n(J)&&(!N||ka(J,N))&&G(J,U))M.push(J);return M}},P=function(G,J){for(G=G.parentNode;G;){if(G==
J)break;G=G.parentNode}return!!G},S={},Y=function(G){var J=S[G.query];if(J)return J;var M=G.infixOper;M=M?M.oper:"";var N=E(G,{el:1}),U="*"==G.tag,W=i().getElementsByClassName;if(M){W={el:1};if(U)W.tag=1;N=E(G,W);if("+"==M)J=H(N);else if("~"==M)J=K(N);else if(">"==M)J=L(N)}else if(G.id){N=!G.loops&&U?o:E(G,{el:1,id:1});J=function(V,$){var ca=a.byId(G.id,V.ownerDocument||V);if(ca&&N(ca))if(9==V.nodeType)return s(ca,$);else if(P(ca,V))return s(ca,$)}}else if(W&&/\{\s*\[native code\]\s*\}/.test(String(W))&&
G.classes.length&&!j){N=E(G,{el:1,classes:1,id:1});var Z=G.classes.join(" ");J=function(V,$,ca){$=s(0,$);for(var ha,fa=0,ja=V.getElementsByClassName(Z);ha=ja[fa++];)N(ha,V)&&ka(ha,ca)&&$.push(ha);return $}}else if(!U&&!G.loops)J=function(V,$,ca){$=s(0,$);for(var ha=0,fa=V.getElementsByTagName(G.getTag());V=fa[ha++];)ka(V,ca)&&$.push(V);return $};else{N=E(G,{el:1,tag:1,id:1});J=function(V,$,ca){$=s(0,$);for(var ha,fa=0,ja=V.getElementsByTagName(G.getTag());ha=ja[fa++];)N(ha,V)&&ka(ha,ca)&&$.push(ha);
return $}}return S[G.query]=J},Q=function(G,J){G=s(G);for(var M,N,U=J.length,W,Z,V=0;V<U;V++){Z=[];M=J[V];N=G.length-1;if(N>0){W={};Z.nozip=true}N=Y(M);for(var $=0;M=G[$];$++)N(M,Z,W);if(!Z.length)break;G=Z}return Z},ea={},B={},D=function(G){var J=r(d(G));if(J.length==1){var M=Y(J[0]);return function(N){if(N=M(N,new f))N.nozip=true;return N}}return function(N){return Q(N,J)}},I=navigator.userAgent;I=a.isWebKit&&I.indexOf("WebKit/")>0&&parseFloat(I.split("WebKit/")[1])>528;var O=a.isIE?"commentStrip":
"nozip",R=!!i().querySelectorAll&&(!a.isSafari||a.isSafari>3.1||I),T=/n\+\d|([^ ])?([>~+])([^ =])?/g,X=function(G,J,M,N){return M?(J?J+" ":"")+M+(N?" "+N:""):G},da=function(G,J){G=G.replace(T,X);if(R){var M=B[G];if(M&&!J)return M}if(M=ea[G])return M;M=G.charAt(0);var N=-1==G.indexOf(" ");if(G.indexOf("#")>=0&&N)J=true;if(R&&!J&&">~+".indexOf(M)==-1&&(!a.isIE||G.indexOf(":")==-1)&&!(j&&G.indexOf(".")>=0)&&G.indexOf(":contains")==-1&&G.indexOf(":checked")==-1&&G.indexOf("|=")==-1){var U=">~+".indexOf(G.charAt(G.length-
1))>=0?G+" *":G;return B[G]=function(Z){try{if(!(9==Z.nodeType||N))throw"";var V=Z.querySelectorAll(U);V[O]=true;return V}catch($){return da(G,true)(Z)}}}else{var W=G.split(/\s*,\s*/);return ea[G]=W.length<2?D(G):function(Z){for(var V=0,$=[],ca;ca=W[V++];)$=$.concat(D(ca)(Z));return $}}},ga=0,ua=a.isIE?function(G){return l?G.getAttribute("_uid")||G.setAttribute("_uid",++ga)||ga:G.uniqueID}:function(G){return G._uid||(G._uid=++ga)},ka=function(G,J){if(!J)return 1;G=ua(G);if(!J[G])return J[G]=1;return 0},
la="_zipIdx",va=function(G){if(G&&G.nozip)return f._wrap?f._wrap(G):G;var J=new f;if(!G||!G.length)return J;G[0]&&J.push(G[0]);if(G.length<2)return J;ga++;if(a.isIE&&l){var M=ga+"";G[0].setAttribute(la,M);for(var N=1,U;U=G[N];N++){G[N].getAttribute(la)!=M&&J.push(U);U.setAttribute(la,M)}}else if(a.isIE&&G.commentStrip)try{for(N=1;U=G[N];N++)q(U)&&J.push(U)}catch(W){}else{if(G[0])G[0][la]=ga;for(N=1;U=G[N];N++){G[N][la]!=ga&&J.push(U);U[la]=ga}}return J};a.query=function(G,J){f=a._NodeListCtor;if(!G)return new f;
if(G.constructor==f)return G;if(typeof G!="string")return new f(G);if(typeof J=="string"){J=a.byId(J);if(!J)return new f}J=J||i();var M=J.ownerDocument||J.documentElement;l=J.contentType&&J.contentType=="application/xml"||a.isOpera&&(J.doctype||M.toString()=="[object XMLDocument]")||!!M&&(a.isIE?M.xml:J.xmlVersion||M.xmlVersion);if((G=da(G)(J))&&G.nozip&&!f._wrap)return G;return va(G)};a.query.pseudos=C;a._filterQueryResult=function(G,J,M){var N=new a._NodeListCtor,U=r(J);U=U.length==1&&!/[^\w#\.]/.test(J)?
E(U[0]):function(V){return dojo.query(J,M).indexOf(V)!=-1};for(var W=0,Z;Z=G[W];W++)U(Z)&&N.push(Z);return N}},g=function(){acme={trim:function(f){f=f.replace(/^\s+/,"");for(var i=f.length-1;i>=0;i--)if(/\S/.test(f.charAt(i))){f=f.substring(0,i+1);break}return f},forEach:function(f,i,j){if(f&&f.length)for(var h=0,l=f.length;h<l;++h)i.call(j||window,f[h],h,f)},byId:function(f,i){return typeof f=="string"?(i||document).getElementById(f):f},doc:document,NodeList:Array};var a=navigator,d=a.userAgent;
a=a.appVersion;var e=parseFloat(a);acme.isOpera=d.indexOf("Opera")>=0?e:undefined;acme.isKhtml=a.indexOf("Konqueror")>=0?e:undefined;acme.isWebKit=parseFloat(d.split("WebKit/")[1])||undefined;acme.isChrome=parseFloat(d.split("Chrome/")[1])||undefined;if((d=Math.max(a.indexOf("WebKit"),a.indexOf("Safari"),0))&&!acme.isChrome){acme.isSafari=parseFloat(a.split("Version/")[1]);if(!acme.isSafari||parseFloat(a.substr(d+7))<=419.3)acme.isSafari=2}if(document.all&&!acme.isOpera)acme.isIE=parseFloat(a.split("MSIE ")[1])||
undefined;Array._wrap=function(f){return f};return acme};typeof define=="function"&&define("dojo/_base/query",["dojo/lib/kernel","dojo/_base/NodeList","dojo/_base/lang","dojo/_base/window"],function(a){c(this.queryPortability||this.acme||a)});if(typeof define!="function")if(this.dojo){dojo.provide("dojo._base.query");dojo.require("dojo._base.NodeList");dojo.require("dojo._base.lang");c(this.queryPortability||this.acme||dojo)}else c(this.queryPortability||this.acme||g())})();
define("dojo/_base/xhr",["dojo/lib/kernel","dojo/_base/Deferred","dojo/_base/json","dojo/_base/lang","dojo/_base/query"],function(c){(function(){function g(x,k,m){if(m!==null){var n=x[k];if(typeof n=="string")x[k]=[n,m];else if(a.isArray(n))n.push(m);else x[k]=m}}var a=c,d=a.config;c.fieldToObject=function(x){var k=null;if(x=a.byId(x)){var m=x.name,n=(x.type||"").toLowerCase();if(m&&n&&!x.disabled)if(n=="radio"||n=="checkbox"){if(x.checked)k=x.value}else if(x.multiple){k=[];a.query("option",x).forEach(function(p){p.selected&&
k.push(p.value)})}else k=x.value}return k};c.formToObject=function(x){var k={};a.forEach(c.byId(x).elements,function(m){var n=m.name,p=(m.type||"").toLowerCase();if(n&&p&&"file|submit|image|reset|button|".indexOf(p)==-1&&!m.disabled){g(k,n,a.fieldToObject(m));if(p=="image")k[n+".x"]=k[n+".y"]=k[n].x=k[n].y=0}});return k};c.objectToQuery=function(x){var k=encodeURIComponent,m=[],n={};for(var p in x){var t=x[p];if(t!=n[p]){var w=k(p)+"=";if(a.isArray(t))for(var z=0;z<t.length;z++)m.push(w+k(t[z]));
else m.push(w+k(t))}}return m.join("&")};c.formToQuery=function(x){return a.objectToQuery(a.formToObject(x))};c.formToJson=function(x,k){return a.toJson(a.formToObject(x),k)};c.queryToObject=function(x){var k={};x=x.split("&");var m=decodeURIComponent;a.forEach(x,function(n){if(n.length){var p=n.split("=");n=m(p.shift());p=m(p.join("="));if(typeof k[n]=="string")k[n]=[k[n]];if(a.isArray(k[n]))k[n].push(p);else k[n]=p}});return k};c._blockAsync=false;var e=a._contentHandlers=c.contentHandlers={text:function(x){return x.responseText},
json:function(x){return a.fromJson(x.responseText||null)},"json-comment-filtered":function(x){c.config.useCommentedJson||console.warn("Consider using the standard mimetype:application/json. json-commenting can introduce security issues. To decrease the chances of hijacking, use the standard the 'json' handler and prefix your json with: {}&&\nUse djConfig.useCommentedJson=true to turn off this message.");x=x.responseText;var k=x.indexOf("/*"),m=x.lastIndexOf("*/");if(k==-1||m==-1)throw new Error("JSON was not comment filtered");
return a.fromJson(x.substring(k+2,m))},javascript:function(x){return a.eval(x.responseText)},xml:function(x){var k=x.responseXML;if(a.isIE&&(!k||!k.documentElement)){var m=function(n){return"MSXML"+n+".DOMDocument"};m=["Microsoft.XMLDOM",m(6),m(4),m(3),m(2)];a.some(m,function(n){try{var p=new ActiveXObject(n);p.async=false;p.loadXML(x.responseText);k=p}catch(t){return false}return true})}return k},"json-comment-optional":function(x){return x.responseText&&/^[^{\[]*\/\*/.test(x.responseText)?e["json-comment-filtered"](x):
e.json(x)}};c._ioSetArgs=function(x,k,m,n){var p={args:x,url:x.url},t=null;if(x.form){t=a.byId(x.form);var w=t.getAttributeNode("action");p.url=p.url||(w?w.value:null);t=a.formToObject(t)}w=[{}];t&&w.push(t);x.content&&w.push(x.content);x.preventCache&&w.push({"dojo.preventCache":(new Date).valueOf()});p.query=a.objectToQuery(a.mixin.apply(null,w));p.handleAs=x.handleAs||"text";var z=new a.Deferred(k);z.addCallbacks(m,function(E){return n(E,z)});var A=x.load;A&&a.isFunction(A)&&z.addCallback(function(E){return A.call(x,
E,p)});var C=x.error;C&&a.isFunction(C)&&z.addErrback(function(E){return C.call(x,E,p)});var F=x.handle;F&&a.isFunction(F)&&z.addBoth(function(E){return F.call(x,E,p)});if(d.ioPublish&&a.publish&&p.args.ioPublish!==false){z.addCallbacks(function(E){a.publish("/dojo/io/load",[z,E]);return E},function(E){a.publish("/dojo/io/error",[z,E]);return E});z.addBoth(function(E){a.publish("/dojo/io/done",[z,E]);return E})}z.ioArgs=p;return z};var f=function(x){x.canceled=true;var k=x.ioArgs.xhr,m=typeof k.abort;
if(m=="function"||m=="object"||m=="unknown")k.abort();x=x.ioArgs.error;if(!x){x=new Error("xhr cancelled");x.dojoType="cancel"}return x},i=function(x){x=e[x.ioArgs.handleAs](x.ioArgs.xhr);return x===undefined?null:x},j=function(x,k){k.ioArgs.args.failOk||console.error(x);return x},h=null,l=[],o=0,r=function(x){if(o<=0){o=0;if(d.ioPublish&&a.publish&&(!x||x&&x.ioArgs.args.ioPublish!==false))a.publish("/dojo/io/stop")}},u=function(){var x=(new Date).getTime();if(!a._blockAsync)for(var k=0,m;k<l.length&&
(m=l[k]);k++){var n=m.dfd,p=function(){if(!n||n.canceled||!m.validCheck(n)){l.splice(k--,1);o-=1}else if(m.ioCheck(n)){l.splice(k--,1);m.resHandle(n);o-=1}else if(n.startTime)if(n.startTime+(n.ioArgs.args.timeout||0)<x){l.splice(k--,1);var w=new Error("timeout exceeded");w.dojoType="timeout";n.errback(w);n.cancel();o-=1}};if(c.config.debugAtAllCosts)p.call(this);else try{p.call(this)}catch(t){n.errback(t)}}r(n);if(!l.length){clearInterval(h);h=null}};c._ioCancelAll=function(){try{a.forEach(l,function(k){try{k.dfd.cancel()}catch(m){}})}catch(x){}};
a.isIE&&a.addOnWindowUnload(a._ioCancelAll);a._ioNotifyStart=function(x){if(d.ioPublish&&a.publish&&x.ioArgs.args.ioPublish!==false){o||a.publish("/dojo/io/start");o+=1;a.publish("/dojo/io/send",[x])}};a._ioWatch=function(x,k,m,n){var p=x.ioArgs.args;if(p.timeout)x.startTime=(new Date).getTime();l.push({dfd:x,validCheck:k,ioCheck:m,resHandle:n});h||(h=setInterval(u,50));p.sync&&u()};var s="application/x-www-form-urlencoded",q=function(x){return x.ioArgs.xhr.readyState},v=function(x){return 4==x.ioArgs.xhr.readyState},
y=function(x){var k=x.ioArgs.xhr;if(a._isDocumentOk(k))x.callback(x);else{var m=new Error("Unable to load "+x.ioArgs.url+" status:"+k.status);m.status=k.status;m.responseText=k.responseText;x.errback(m)}};c._ioAddQueryToUrl=function(x){if(x.query.length){x.url+=(x.url.indexOf("?")==-1?"?":"&")+x.query;x.query=null}};c.xhr=function(x,k,m){var n=a._ioSetArgs(k,f,i,j),p=n.ioArgs,t=p.xhr=a._xhrObj(p.args);if(!t){n.cancel();return n}if("postData"in k)p.query=k.postData;else if("putData"in k)p.query=k.putData;
else if("rawBody"in k)p.query=k.rawBody;else if(arguments.length>2&&!m||"POST|PUT".indexOf(x.toUpperCase())==-1)a._ioAddQueryToUrl(p);t.open(x,p.url,k.sync!==true,k.user||undefined,k.password||undefined);if(k.headers)for(var w in k.headers)if(w.toLowerCase()==="content-type"&&!k.contentType)k.contentType=k.headers[w];else k.headers[w]&&t.setRequestHeader(w,k.headers[w]);t.setRequestHeader("Content-Type",k.contentType||s);if(!k.headers||!("X-Requested-With"in k.headers))t.setRequestHeader("X-Requested-With",
"XMLHttpRequest");a._ioNotifyStart(n);if(c.config.debugAtAllCosts)t.send(p.query);else try{t.send(p.query)}catch(z){p.error=z;n.cancel()}a._ioWatch(n,q,v,y);return n};c.xhrGet=function(x){return a.xhr("GET",x)};c.rawXhrPost=c.xhrPost=function(x){return a.xhr("POST",x,true)};c.rawXhrPut=c.xhrPut=function(x){return a.xhr("PUT",x,true)};c.xhrDelete=function(x){return a.xhr("DELETE",x)}})();return c.xhr});
define("dojo/_base/fx",["dojo/lib/kernel","dojo/_base/Color","dojo/_base/connect","dojo/_base/lang","dojo/_base/html"],function(c){(function(){var g=c._mixin;c._Line=function(j,h){this.start=j;this.end=h};c._Line.prototype.getValue=function(j){return(this.end-this.start)*j+this.start};c.Animation=function(j){g(this,j);if(c.isArray(this.curve))this.curve=new c._Line(this.curve[0],this.curve[1])};c._Animation=c.Animation;c.extend(c.Animation,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,
_getStep:function(){var j=this._percent,h=this.easing;return h?h(j):j},_fire:function(j,h){h=h||[];if(this[j])if(c.config.debugAtAllCosts)this[j].apply(this,h);else try{this[j].apply(this,h)}catch(l){console.error("exception in animation handler for:",j);console.error(l)}return this},play:function(j,h){var l=this;l._delayTimer&&l._clearTimer();if(h){l._stopTimer();l._active=l._paused=false;l._percent=0}else if(l._active&&!l._paused)return l;l._fire("beforeBegin",[l.node]);j=j||l.delay;var o=c.hitch(l,
"_play",h);if(j>0){l._delayTimer=setTimeout(o,j);return l}o();return l},_play:function(){var j=this;j._delayTimer&&j._clearTimer();j._startTime=(new Date).valueOf();if(j._paused)j._startTime-=j.duration*j._percent;j._active=true;j._paused=false;var h=j.curve.getValue(j._getStep());if(!j._percent){if(!j._startRepeatCount)j._startRepeatCount=j.repeat;j._fire("onBegin",[h])}j._fire("onPlay",[h]);j._cycle();return j},pause:function(){var j=this;j._delayTimer&&j._clearTimer();j._stopTimer();if(!j._active)return j;
j._paused=true;j._fire("onPause",[j.curve.getValue(j._getStep())]);return j},gotoPercent:function(j,h){var l=this;l._stopTimer();l._active=l._paused=true;l._percent=j;h&&l.play();return l},stop:function(j){var h=this;h._delayTimer&&h._clearTimer();if(!h._timer)return h;h._stopTimer();if(j)h._percent=1;h._fire("onStop",[h.curve.getValue(h._getStep())]);h._active=h._paused=false;return h},status:function(){if(this._active)return this._paused?"paused":"playing";return"stopped"},_cycle:function(){var j=
this;if(j._active){var h=((new Date).valueOf()-j._startTime)/j.duration;if(h>=1)h=1;j._percent=h;if(j.easing)h=j.easing(h);j._fire("onAnimate",[j.curve.getValue(h)]);if(j._percent<1)j._startTimer();else{j._active=false;if(j.repeat>0){j.repeat--;j.play(null,true)}else if(j.repeat==-1)j.play(null,true);else if(j._startRepeatCount){j.repeat=j._startRepeatCount;j._startRepeatCount=0}j._percent=0;j._fire("onEnd",[j.node]);!j.repeat&&j._stopTimer()}}return j},_clearTimer:function(){clearTimeout(this._delayTimer);
delete this._delayTimer}});var a=0,d=null,e={run:function(){}};c.extend(c.Animation,{_startTimer:function(){if(!this._timer){this._timer=c.connect(e,"run",this,"_cycle");a++}d||(d=setInterval(c.hitch(e,"run"),this.rate))},_stopTimer:function(){if(this._timer){c.disconnect(this._timer);this._timer=null;a--}if(a<=0){clearInterval(d);d=null;a=0}}});var f=c.isIE?function(j){var h=j.style;if(!h.width.length&&c.style(j,"width")=="auto")h.width="auto"}:function(){};c._fade=function(j){j.node=c.byId(j.node);
var h=g({properties:{}},j);j=h.properties.opacity={};j.start=!("start"in h)?function(){return+c.style(h.node,"opacity")||0}:h.start;j.end=h.end;j=c.animateProperty(h);c.connect(j,"beforeBegin",c.partial(f,h.node));return j};c.fadeIn=function(j){return c._fade(g({end:1},j))};c.fadeOut=function(j){return c._fade(g({end:0},j))};c._defaultEasing=function(j){return 0.5+Math.sin((j+1.5)*Math.PI)/2};var i=function(j){this._properties=j;for(var h in j){var l=j[h];if(l.start instanceof c.Color)l.tempColor=
new c.Color}};i.prototype.getValue=function(j){var h={};for(var l in this._properties){var o=this._properties[l],r=o.start;if(r instanceof c.Color)h[l]=c.blendColors(r,o.end,j,o.tempColor).toCss();else c.isArray(r)||(h[l]=(o.end-r)*j+r+(l!="opacity"?o.units||"px":0))}return h};c.animateProperty=function(j){var h=j.node=c.byId(j.node);if(!j.easing)j.easing=c._defaultEasing;j=new c.Animation(j);c.connect(j,"beforeBegin",j,function(){var l={};for(var o in this.properties){if(o=="width"||o=="height")this.node.display=
"block";var r=this.properties[o];if(c.isFunction(r))r=r(h);r=l[o]=g({},c.isObject(r)?r:{end:r});if(c.isFunction(r.start))r.start=r.start(h);if(c.isFunction(r.end))r.end=r.end(h);var u=o.toLowerCase().indexOf("color")>=0,s=function(q,v){var y={height:q.offsetHeight,width:q.offsetWidth}[v];if(y!==undefined)return y;y=c.style(q,v);return v=="opacity"?+y:u?y:parseFloat(y)};if("end"in r){if(!("start"in r))r.start=s(h,o)}else r.end=s(h,o);if(u){r.start=new c.Color(r.start);r.end=new c.Color(r.end)}else r.start=
o=="opacity"?+r.start:parseFloat(r.start)}this.curve=new i(l)});c.connect(j,"onAnimate",c.hitch(c,"style",j.node));return j};c.anim=function(j,h,l,o,r,u){return c.animateProperty({node:j,duration:l||c.Animation.prototype.duration,properties:h,easing:o,onEnd:r}).play(u||0)}})();return c.animateProperty});
define("dojo",["dojo/lib/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/declare","dojo/_base/connect","dojo/_base/Deferred","dojo/_base/json","dojo/_base/Color","dojo/_base/window","dojo/_base/event","dojo/_base/html","dojo/_base/NodeList","dojo/_base/query","dojo/_base/xhr","dojo/_base/fx"],function(c){return c});
define("orion/serviceregistry",["dojo"],function(c){function g(i,j,h){this.serviceId=i;this.name=j;this.properties=h}function a(i,j,h){this.serviceId=i;this.serviceReference=j;this.internalRegistry=h}function d(i,j,h){this.serviceId=i;this.implementation=j;this.internalRegistry=h;var l;for(l in j)if(typeof j[l]==="function")this[l]=function(o){return function(){if(h.isRegistered(i)){var r=new c.Deferred;try{var u=j[o].apply(j,Array.prototype.slice.call(arguments));c.when(u,c.hitch(r,r.resolve),c.hitch(r,
r.reject))}catch(s){r.reject(s)}return r.promise}throw new Error("Service was unregistered");}}(l)}function e(){this._namedlisteners={}}function f(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new e;var i=this;this.internalRegistry={isRegistered:function(j){return i._entries[j]?true:false},unregisterService:function(j){var h=i._entries[j];if(h){for(var l=h.reference,o=i._namedReferences[l.getName()],r=0;r<o.length;r++)if(o[r]===l){if(o.length===1)delete i._namedReferences[l.getName()];
else o.splice(r,1);break}i._entries[j]=null;i._serviceEventTarget.dispatchEvent("serviceRemoved",l,h.service)}},dispatchEvent:function(j,h){var l=i._entries[j];l&&l.eventTarget.dispatchEvent.apply(l.eventTarget,[h].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(j,h,l){(j=i._entries[j])&&j.eventTarget.addEventListener(h,l)},removeEventListener:function(j,h,l){(j=i._entries[j])&&j.eventTarget.removeEventListener(h,l)}}}g.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var i=[],j;for(j in this.properties)this.properties.hasOwnProperty(j)&&i.push(j);return i},getProperty:function(i){return this.properties[i]}};g.prototype.constructor=g;a.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(i){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,i].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
a.prototype.constructor=a;d.prototype={addEventListener:function(i,j){this.internalRegistry.addEventListener(this.serviceId,i,j)},removeEventListener:function(i,j){this.internalRegistry.removeEventListener(this.serviceId,i,j)}};d.prototype.constructor=d;e.prototype={dispatchEvent:function(i){var j=this._namedlisteners[i];if(j)for(var h=0;h<j.length;h++)try{var l=Array.prototype.slice.call(arguments,1);j[h].apply(null,l)}catch(o){console.log(o)}},addEventListener:function(i,j){this._namedlisteners[i]=
this._namedlisteners[i]||[];this._namedlisteners[i].push(j)},removeEventListener:function(i,j){var h=this._namedlisteners[i];if(h)for(var l=0;l<h.length;l++)if(h[l]===j){if(h.length===1)delete this._namedlisteners[i];else h.splice(l,1);break}}};e.prototype.constructor=e;f.prototype={getService:function(i,j){var h,l=new c.Deferred;if(typeof i==="string"){if(this._namedReferences[i])for(var o=0;o<this._namedReferences[i].length;o++)if(h=this._entries[this._namedReferences[i][o].getServiceId()].service)break}else h=
this._entries[i.getServiceId()].service;if(h)l.resolve(h);else if(j===0)l.reject(new Error("timeout: getService"));else{var r=this,u=function(s,q){if(i===s||i===s.getName()){l.resolve(q);r._serviceEventTarget.removeEventListener("serviceAdded",u)}};this._serviceEventTarget.addEventListener("serviceAdded",u)}return l.promise},getServiceReferences:function(i){if(i)return this._namedReferences[i]?this._namedReferences[i]:[];i=[];for(var j=0;j<this._entries.length;j++)this._entries[j]&&i.push(this._entries[j].reference);
return i},registerService:function(i,j,h){var l=this._entries.length;h=new g(l,i,h);j=new d(l,j,this.internalRegistry);this._namedReferences[i]=this._namedReferences[i]||[];this._namedReferences[i].push(h);this._entries.push({reference:h,service:j,eventTarget:new e});this._serviceEventTarget.dispatchEvent("serviceAdded",h,j);return new a(l,h,this.internalRegistry)},addEventListener:function(i,j){this._serviceEventTarget.addEventListener(i,j)},removeEventListener:function(i,j){this._serviceEventTarget.removeEventListener(i,
j)}};f.prototype.constructor=f;return{ServiceReference:g,ServiceRegistration:a,Service:d,EventTarget:e,ServiceRegistry:f}});define("dijit",["dojo"],function(c){return dijit=c._dijit||{}});
define("dojo/hash",["dojo"],function(c){(function(){function g(r,u){u=r.indexOf(u);return u>=0?r.substring(u+1):""}function a(){return g(location.href,"#")}function d(){c.publish("/dojo/hashchange",[a()])}function e(){if(a()!==j){j=a();d()}}function f(r){if(h)if(h.isTransitioning())setTimeout(c.hitch(null,f,r),o);else{var u=h.iframe.location.href,s=u.indexOf("?");h.iframe.location.replace(u.substring(0,s)+"?"+r)}else{location.replace("#"+r);!l&&e()}}function i(){function r(){j=a();q=k?j:g(m.href,
"?");v=false;y=null}var u=document.createElement("iframe"),s=c.config.dojoBlankHtmlUrl||c.moduleUrl("dojo","resources/blank.html");c.config.useXDomain&&!c.config.dojoBlankHtmlUrl&&console.warn("dojo.hash: When using cross-domain Dojo builds, please save dojo/resources/blank.html to your domain and set djConfig.dojoBlankHtmlUrl to the path on your domain to blank.html");u.id="dojo-hash-iframe";u.src=s+"?"+a();u.style.display="none";document.body.appendChild(u);this.iframe=c.global["dojo-hash-iframe"];
var q,v,y,x,k,m=this.iframe.location;this.isTransitioning=function(){return v};this.pollLocation=function(){if(!k)try{var n=g(m.href,"?");if(document.title!=x)x=this.iframe.document.title=document.title}catch(p){k=true;console.error("dojo.hash: Error adding history entry. Server unreachable.")}var t=a();if(v&&j===t)if(k||n===y){r();d()}else{setTimeout(c.hitch(this,this.pollLocation),0);return}else if(!(j===t&&(k||q===n)))if(j!==t){j=t;v=true;y=t;u.src=s+"?"+y;k=false;setTimeout(c.hitch(this,this.pollLocation),
0);return}else if(!k){location.href="#"+m.search.substring(1);r();d()}setTimeout(c.hitch(this,this.pollLocation),o)};r();setTimeout(c.hitch(this,this.pollLocation),o)}c.hash=function(r,u){if(!arguments.length)return a();if(r.charAt(0)=="#")r=r.substring(1);if(u)f(r);else location.href="#"+r;return r};var j,h,l,o=c.config.hashPollFrequency||100;c.addOnLoad(function(){if("onhashchange"in c.global&&(!c.isIE||c.isIE>=8&&document.compatMode!="BackCompat"))l=c.connect(c.global,"onhashchange",d);else if(document.addEventListener){j=
a();setInterval(e,o)}else if(document.attachEvent)h=new i})})();return c.hash});
(function(){var c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],g=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,d=[];define("text",["require","exports","module"],function(){var e,f,i;if(typeof window!=="undefined"&&window.navigator&&window.document)f=function(j,h){var l=e.createXhr();l.open("GET",j,true);l.onreadystatechange=function(){l.readyState===4&&h(l.responseText)};l.send(null)};else if(typeof process!=="undefined"&&process.versions&&
process.versions.node){i=require.nodeRequire("fs");f=function(j,h){h(i.readFileSync(j,"utf8"))}}else if(typeof Packages!=="undefined")f=function(j,h){var l=new java.io.File(j);j=java.lang.System.getProperty("line.separator");l=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(l),"utf-8"));var o,r,u="";try{o=new java.lang.StringBuffer;if((r=l.readLine())&&r.length()&&r.charAt(0)===65279)r=r.substring(1);for(o.append(r);(r=l.readLine())!==null;){o.append(j);o.append(r)}u=
String(o.toString())}finally{l.close()}h(u)};return e={version:"0.24.0",strip:function(j){if(j){j=j.replace(g,"");var h=j.match(a);if(h)j=h[1]}else j="";return j},jsEscape:function(j){return j.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var j,h,l;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else for(h=0;h<3;h++){l=c[h];try{j=new ActiveXObject(l)}catch(o){}if(j){c=
[l];break}}if(!j)throw new Error("require.getXhr(): XMLHttpRequest not available");return j},get:f,load:function(j,h,l,o){var r=false,u=j.indexOf("."),s=j.substring(0,u),q=j.substring(u+1,j.length);u=q.indexOf("!");if(u!==-1){r=q.substring(u+1,q.length);r=r==="strip";q=q.substring(0,u)}h=h.nameToUrl(s,"."+q);e.get(h,function(v){v=r?e.strip(v):v;if(o.isBuild&&o.inlineText)d[j]=v;l(v)})},write:function(j,h,l){if(h in d){var o=e.jsEscape(d[h]);l("define('"+j+"!"+h+"', function () { return '"+o+"';});\n")}}}})})();
define("text!dijit/form/templates/ValidationTextBox.html",function(){return'<div class="dijit dijitReset dijitInlineTable dijitLeft"\n\tid="widget_${id}" role="presentation"\n\t><div class=\'dijitReset dijitValidationContainer\'\n\t\t><input class="dijitReset dijitInputField dijitValidationIcon dijitValidationInner" value="&#935; " type="text" tabIndex="-1" readonly="readonly" role="presentation"\n\t/></div\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/i18n",["require","dojo"],function(c,g){g.getObject("i18n",true,g);g.i18n.getLocalization=g.i18n.getLocalization||function(a,d,e){e=g.i18n.normalizeLocale(e);var f=e.split("-"),i=[a,"nls",d].join(".");if(typeof g.global.require!=="undefined"){var j=c("i18n!"+[a.replace(/\./g,"/"),"nls",d].join("/"));(g._loadedModules[i]=g._loadedModules[i]||{})[f.join("_")]=j.root||j}if(i=g._loadedModules[i]){var h;for(j=f.length;j>0;j--){var l=f.slice(0,j).join("_");if(i[l]){h=i[l];break}}if(!h)h=i.ROOT;
if(h){a=function(){};a.prototype=h;return new a}}throw new Error("Bundle not found: "+d+" in "+a+" , locale="+e);};g.i18n.normalizeLocale=function(a){a=a?a.toLowerCase():g.locale;if(a=="root")a="ROOT";return a};g.i18n._requireLocalization=function(a,d,e,f){e=g.i18n.normalizeLocale(e);var i=[a,"nls",d].join("."),j="";if(f){for(var h=f.split(","),l=0;l<h.length;l++)if(e.indexOf(h[l])==0)if(h[l].length>j.length)j=h[l];j||(j="ROOT")}h=f?j:e;var o=g._loadedModules[i];l=null;if(o){if(g.config.localizationComplete&&
o._built)return;l=h.replace(/-/g,"_");l=g._loadedModules[i+"."+l]}if(!l){o=g.provide(i);var r=g._getModuleSymbols(a).concat("nls").join("/"),u;g.i18n._searchLocalePath(h,f,function(s){var q=s.replace(/-/g,"_"),v=i+"."+q,y=false;if(g._loadedModules[v])y=true;else{g.provide(v);v=[r];s!="ROOT"&&v.push(s);v.push(d);s=v.join("/")+".js";y=g._loadPath(s,null,function(x){x=x.root||x;var k=function(){};k.prototype=u;o[q]=new k;for(var m in x)o[q][m]=x[m]})}if(y&&o[q])u=o[q];else o[q]=u;if(f)return true})}if(f&&
e!=j)o[e.replace(/-/g,"_")]=o[j.replace(/-/g,"_")]};(function(){var a=g.config.extraLocale;if(a){if(!a instanceof Array)a=[a];var d=g.i18n._requireLocalization;g.i18n._requireLocalization=function(e,f,i,j){d(e,f,i,j);if(!i)for(i=0;i<a.length;i++)d(e,f,a[i],j)}}})();g.i18n._searchLocalePath=function(a,d,e){a=g.i18n.normalizeLocale(a);var f=a.split("-");a=[];for(var i=f.length;i>0;i--)a.push(f.slice(0,i).join("-"));a.push(false);d&&a.reverse();for(d=a.length-1;d>=0;d--)if(e(a[d]||"ROOT"))break};g.i18n._preloadLocalizations=
function(a,d){function e(j){j=g.i18n.normalizeLocale(j);g.i18n._searchLocalePath(j,true,function(h){for(var l=0;l<d.length;l++)if(d[l]==h){g.require(a+"_"+h);return true}return false})}e();for(var f=g.config.extraLocale||[],i=0;i<f.length;i++)e(f[i])};return g.i18n});define("text!dijit/form/templates/TextBox.html",function(){return'<div class="dijit dijitReset dijitInline dijitLeft" id="widget_${id}" role="presentation"\n\t><div class="dijitReset dijitInputField dijitInputContainer"\n\t\t><input class="dijitReset dijitInputInner" dojoAttachPoint=\'textbox,focusNode\' autocomplete="off"\n\t\t\t${!nameAttrSetting} type=\'${type}\'\n\t/></div\n></div>'});
define("dojo/window",["dojo"],function(c){c.getObject("window",true,c);c.window.getBox=function(){var g=c.doc.compatMode=="BackCompat"?c.body():c.doc.documentElement,a=c._docScroll();return{w:g.clientWidth,h:g.clientHeight,l:a.x,t:a.y}};c.window.get=function(g){if(c.isIE&&window!==document.parentWindow){g.parentWindow.execScript("document._parentWindow = window;","Javascript");var a=g._parentWindow;g._parentWindow=null;return a}return g.parentWindow||g.defaultView};c.window.scrollIntoView=function(g,
a){try{g=c.byId(g);var d=g.ownerDocument||c.doc,e=d.body||c.body(),f=d.documentElement||e.parentNode,i=c.isIE,j=c.isWebKit;if((!(c.isMoz||i||j||c.isOpera)||g==e||g==f)&&typeof g.scrollIntoView!="undefined")g.scrollIntoView(false);else{var h=d.compatMode=="BackCompat",l=i>=9&&g.ownerDocument.parentWindow.frameElement?f.clientHeight>0&&f.clientWidth>0&&(e.clientHeight==0||e.clientWidth==0||e.clientHeight>f.clientHeight||e.clientWidth>f.clientWidth)?f:e:h?e:f;d=j?e:l;var o=l.clientWidth,r=l.clientHeight,
u=!c._isBodyLtr(),s=a||c.position(g),q=g.parentNode;a=function(C){return i<=6||i&&h?false:c.style(C,"position").toLowerCase()=="fixed"};if(!a(g))for(;q;){if(q==e)q=d;var v=c.position(q),y=a(q);if(q==d){v.w=o;v.h=r;if(d==f&&i&&u)v.x+=d.offsetWidth-v.w;if(v.x<0||!i)v.x=0;if(v.y<0||!i)v.y=0}else{var x=c._getPadBorderExtents(q);v.w-=x.w;v.h-=x.h;v.x+=x.l;v.y+=x.t;var k=q.clientWidth,m=v.w-k;if(k>0&&m>0){v.w=k;v.x+=u&&(i||q.clientLeft>x.l)?m:0}k=q.clientHeight;m=v.h-k;if(k>0&&m>0)v.h=k}if(y){if(v.y<0){v.h+=
v.y;v.y=0}if(v.x<0){v.w+=v.x;v.x=0}if(v.y+v.h>r)v.h=r-v.y;if(v.x+v.w>o)v.w=o-v.x}var n=s.x-v.x,p=s.y-Math.max(v.y,0),t=n+s.w-v.w,w=p+s.h-v.h;if(t*n>0){var z=Math[n<0?"max":"min"](n,t);if(u&&(i==8&&!h||i>=9))z=-z;s.x+=q.scrollLeft;q.scrollLeft+=z;s.x-=q.scrollLeft}if(w*p>0){s.y+=q.scrollTop;q.scrollTop+=Math[p<0?"max":"min"](p,w);s.y-=q.scrollTop}q=q!=d&&!y&&q.parentNode}}}catch(A){console.error("scrollIntoView: "+A);g.scrollIntoView(false)}};return c.window});
define("dijit/_base/manager",["dojo","dijit"],function(c,g){c.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0},add:function(a){if(this._hash[a.id])throw new Error("Tried to register widget with id=="+a.id+" but that id is already registered");this._hash[a.id]=a;this.length++},remove:function(a){if(this._hash[a]){delete this._hash[a];this.length--}},forEach:function(a,d){d=d||c.global;var e=0,f;for(f in this._hash)a.call(d,this._hash[f],e++,this._hash);return this},
filter:function(a,d){d=d||c.global;var e=new g.WidgetSet,f=0,i;for(i in this._hash){var j=this._hash[i];a.call(d,j,f++,this._hash)&&e.add(j)}return e},byId:function(a){return this._hash[a]},byClass:function(a){var d=new g.WidgetSet,e,f;for(e in this._hash){f=this._hash[e];f.declaredClass==a&&d.add(f)}return d},toArray:function(){var a=[];for(var d in this._hash)a.push(this._hash[d]);return a},map:function(a,d){return c.map(this.toArray(),a,d)},every:function(a,d){d=d||c.global;var e=0,f;for(f in this._hash)if(!a.call(d,
this._hash[f],e++,this._hash))return false;return true},some:function(a,d){d=d||c.global;var e=0,f;for(f in this._hash)if(a.call(d,this._hash[f],e++,this._hash))return true;return false}});(function(){g.registry=new g.WidgetSet;var a=g.registry._hash,d=c.attr,e=c.hasAttr,f=c.style;g.byId=function(l){return typeof l=="string"?a[l]:l};var i={};g.getUniqueId=function(l){var o;do o=l+"_"+(l in i?++i[l]:(i[l]=0));while(a[o]);return g._scopeName=="dijit"?o:g._scopeName+"_"+o};g.findWidgets=function(l){function o(u){for(u=
u.firstChild;u;u=u.nextSibling)if(u.nodeType==1){var s=u.getAttribute("widgetId");if(s)(s=a[s])&&r.push(s);else o(u)}}var r=[];o(l);return r};g._destroyAll=function(){g._curFocus=null;g._prevFocus=null;g._activeStack=[];c.forEach(g.findWidgets(c.body()),function(l){if(!l._destroyed)if(l.destroyRecursive)l.destroyRecursive();else l.destroy&&l.destroy()})};c.isIE&&c.addOnWindowUnload(function(){g._destroyAll()});g.byNode=function(l){return a[l.getAttribute("widgetId")]};g.getEnclosingWidget=function(l){for(;l;){var o=
l.getAttribute&&l.getAttribute("widgetId");if(o)return a[o];l=l.parentNode}return null};var j=g._isElementShown=function(l){var o=f(l);return o.visibility!="hidden"&&o.visibility!="collapsed"&&o.display!="none"&&d(l,"type")!="hidden"};g.hasDefaultTabStop=function(l){switch(l.nodeName.toLowerCase()){case "a":return e(l,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var o;try{var r=l.contentDocument;if("designMode"in r&&r.designMode==
"on")return true;o=r.body}catch(u){try{o=l.contentWindow.document.body}catch(s){return false}}return o.contentEditable=="true"||o.firstChild&&o.firstChild.contentEditable=="true";default:return l.contentEditable=="true"}};var h=g.isTabNavigable=function(l){return d(l,"disabled")?false:e(l,"tabIndex")?d(l,"tabIndex")>=0:g.hasDefaultTabStop(l)};g._getTabNavigable=function(l){function o(n){return n&&n.tagName.toLowerCase()=="input"&&n.type&&n.type.toLowerCase()=="radio"&&n.name&&n.name.toLowerCase()}
function r(n){return k[o(n)]||n}var u,s,q,v,y,x,k={},m=function(n){c.query("> *",n).forEach(function(p){if(!(c.isIE&&p.scopeName!=="HTML"||!j(p))){if(h(p)){var t=d(p,"tabIndex");if(!e(p,"tabIndex")||t==0){u||(u=p);s=p}else if(t>0){if(!q||t<v){v=t;q=p}if(!y||t>=x){x=t;y=p}}t=o(p);if(c.attr(p,"checked")&&t)k[t]=p}p.nodeName.toUpperCase()!="SELECT"&&m(p)}})};j(l)&&m(l);return{first:r(u),last:r(s),lowest:r(q),highest:r(y)}};g.getFirstInTabbingOrder=function(l){l=g._getTabNavigable(c.byId(l));return l.lowest?
l.lowest:l.first};g.getLastInTabbingOrder=function(l){l=g._getTabNavigable(c.byId(l));return l.last?l.last:l.highest};g.defaultDuration=c.config.defaultDuration||200})();return g});
define("dojo/Stateful",["dojo"],function(c){c.declare("dojo.Stateful",null,{postscript:function(g){g&&c.mixin(this,g)},get:function(g){return this[g]},set:function(g,a){if(typeof g==="object"){for(var d in g)this.set(d,g[d]);return this}d=this[g];this[g]=a;this._watchCallbacks&&this._watchCallbacks(g,d,a);return this},watch:function(g,a){var d=this._watchCallbacks;if(!d){var e=this;d=this._watchCallbacks=function(i,j,h,l){var o=function(r){if(r){r=r.slice();for(var u=0,s=r.length;u<s;u++)try{r[u].call(e,
i,j,h)}catch(q){console.error(q)}}};o(d["_"+i]);l||o(d["*"])}}if(!a&&typeof g==="function"){a=g;g="*"}else g="_"+g;var f=d[g];if(typeof f!=="object")f=d[g]=[];f.push(a);return{unwatch:function(){f.splice(c.indexOf(f,a),1)}}}});return c.Stateful});
define("dijit/_WidgetBase",["dojo","dijit","dijit/_base/manager","dojo/Stateful"],function(c,g){(function(){c.declare("dijit._WidgetBase",c.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(c.config.blankGif||c.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(a,d){this.create(a,d)},create:function(a,d){this.srcNodeRef=
c.byId(d);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&typeof this.srcNodeRef.id=="string")this.id=this.srcNodeRef.id;if(a){this.params=a;c._mixin(this,a)}this.postMixInProperties();if(!this.id)this.id=g.getUniqueId(this.declaredClass.replace(/\./g,"_"));g.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();(a=this.srcNodeRef)&&a.parentNode&&this.domNode!==a&&a.parentNode.replaceChild(this.domNode,a)}this.domNode&&this.domNode.setAttribute("widgetId",this.id);
this.postCreate();this.srcNodeRef&&!this.srcNodeRef.parentNode&&delete this.srcNodeRef;this._created=true},_applyAttributes:function(){var a=function(e,f){if(f.params&&e in f.params||f[e])f.set(e,f[e])};for(var d in this.attributeMap)a(d,this);c.forEach(this._getSetterAttributes(),function(e){e in this.attributeMap||a(e,this)},this)},_getSetterAttributes:function(){var a=this.constructor;if(!a._setterAttrs){var d=a._setterAttrs=[],e,f=a.prototype;for(var i in f)if(c.isFunction(f[i])&&(e=i.match(/^_set([a-zA-Z]*)Attr$/))&&
e[1])d.push(e[1].charAt(0).toLowerCase()+e[1].substr(1))}return a._setterAttrs},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode)this.domNode=this.srcNodeRef||c.create("div");if(this.baseClass){var a=this.baseClass.split(" ");this.isLeftToRight()||(a=a.concat(c.map(a,function(d){return d+"Rtl"})));c.addClass(this.domNode,a)}},postCreate:function(){},startup:function(){this._started=true},destroyRecursive:function(a){this._beingDestroyed=true;this.destroyDescendants(a);this.destroy(a)},
destroy:function(a){this._beingDestroyed=true;this.uninitialize();var d=c.forEach,e=c.unsubscribe;d(this._connects,function(f){d(f,c.disconnect)});d(this._subscribes,function(f){e(f)});d(this._supportingWidgets||[],function(f){if(f.destroyRecursive)f.destroyRecursive();else f.destroy&&f.destroy()});this.destroyRendering(a);g.registry.remove(this.id);this._destroyed=true},destroyRendering:function(a){if(this.bgIframe){this.bgIframe.destroy(a);delete this.bgIframe}if(this.domNode){a?c.removeAttr(this.domNode,
"widgetId"):c.destroy(this.domNode);delete this.domNode}if(this.srcNodeRef){a||c.destroy(this.srcNodeRef);delete this.srcNodeRef}},destroyDescendants:function(a){c.forEach(this.getChildren(),function(d){d.destroyRecursive&&d.destroyRecursive(a)})},uninitialize:function(){return false},_setClassAttr:function(a){c.replaceClass(this[this.attributeMap["class"]||"domNode"],a,this["class"]);this._set("class",a)},_setStyleAttr:function(a){var d=this[this.attributeMap.style||"domNode"];if(c.isObject(a))c.style(d,
a);else if(d.style.cssText)d.style.cssText+="; "+a;else d.style.cssText=a;this._set("style",a)},_attrToDom:function(a,d){var e=this.attributeMap[a];c.forEach(c.isArray(e)?e:[e],function(f){var i=this[f.node||f||"domNode"];switch(f.type||"attribute"){case "attribute":if(c.isFunction(d))d=c.hitch(this,d);f=f.attribute?f.attribute:/^on[A-Z][a-zA-Z]*$/.test(a)?a.toLowerCase():a;c.attr(i,f,d);break;case "innerText":i.innerHTML="";i.appendChild(c.doc.createTextNode(d));break;case "innerHTML":i.innerHTML=
d;break;case "class":c.replaceClass(i,d,this[a]);break}},this)},get:function(a){var d=this._getAttrNames(a);return this[d.g]?this[d.g]():this[a]},set:function(a,d){if(typeof a==="object"){for(var e in a)this.set(e,a[e]);return this}e=this._getAttrNames(a);if(this[e.s])var f=this[e.s].apply(this,Array.prototype.slice.call(arguments,1));else{a in this.attributeMap&&this._attrToDom(a,d);this._set(a,d)}return f||this},_attrPairNames:{},_getAttrNames:function(a){var d=this._attrPairNames;if(d[a])return d[a];
var e=a.charAt(0).toUpperCase()+a.substr(1);return d[a]={n:a+"Node",s:"_set"+e+"Attr",g:"_get"+e+"Attr"}},_set:function(a,d){var e=this[a];this[a]=d;this._watchCallbacks&&this._created&&d!==e&&this._watchCallbacks(a,e,d)},toString:function(){return"[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]"},getDescendants:function(){return this.containerNode?c.query("[widgetId]",this.containerNode).map(g.byNode):[]},getChildren:function(){return this.containerNode?g.findWidgets(this.containerNode):
[]},connect:function(a,d,e){a=[c._connect(a,d,this,e)];this._connects.push(a);return a},disconnect:function(a){for(var d=0;d<this._connects.length;d++)if(this._connects[d]==a){c.forEach(a,c.disconnect);this._connects.splice(d,1);return}},subscribe:function(a,d){a=c.subscribe(a,this,d);this._subscribes.push(a);return a},unsubscribe:function(a){for(var d=0;d<this._subscribes.length;d++)if(this._subscribes[d]==a){c.unsubscribe(a);this._subscribes.splice(d,1);return}},isLeftToRight:function(){return this.dir?
this.dir=="ltr":c._isBodyLtr()},placeAt:function(a,d){a.declaredClass&&a.addChild?a.addChild(this,d):c.place(this.domNode,a,d);return this}})})();return g._WidgetBase});
define("dijit/_base/focus",["dojo","dijit","dojo/window","dijit/_base/manager"],function(c,g){c.mixin(g,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return g.getBookmark().isCollapsed},getBookmark:function(){var a,d,e=c.doc.selection,f=g._curFocus;if(c.global.getSelection){if(e=c.global.getSelection())if(e.isCollapsed){if(a=f?f.tagName:""){a=a.toLowerCase();if(a=="textarea"||a=="input"&&(!f.type||f.type.toLowerCase()=="text")){e={start:f.selectionStart,end:f.selectionEnd,node:f,pRange:true};
return{isCollapsed:e.end<=e.start,mark:e}}}a={isCollapsed:true};if(e.rangeCount)a.mark=e.getRangeAt(0).cloneRange()}else{d=e.getRangeAt(0);a={isCollapsed:false,mark:d.cloneRange()}}}else if(e){a=f?f.tagName:"";a=a.toLowerCase();if(f&&a&&(a=="button"||a=="textarea"||a=="input"))if(e.type&&e.type.toLowerCase()=="none")return{isCollapsed:true,mark:null};else{d=e.createRange();return{isCollapsed:d.text&&d.text.length?false:true,mark:{range:d,pRange:true}}}a={};try{d=e.createRange();a.isCollapsed=!(e.type==
"Text"?d.htmlText.length:d.length)}catch(i){a.isCollapsed=true;return a}if(e.type.toUpperCase()=="CONTROL")if(d.length){a.mark=[];e=0;for(f=d.length;e<f;)a.mark.push(d.item(e++))}else{a.isCollapsed=true;a.mark=null}else a.mark=d.getBookmark()}else console.warn("No idea how to store the current selection for this browser!");return a},moveToBookmark:function(a){var d=c.doc;if(a=a.mark)if(c.global.getSelection){var e=c.global.getSelection();if(e&&e.removeAllRanges)if(a.pRange){e=a.node;e.selectionStart=
a.start;e.selectionEnd=a.end}else{e.removeAllRanges();e.addRange(a)}else console.warn("No idea how to restore selection for this browser!")}else if(d.selection&&a){var f;if(a.pRange)f=a.range;else if(c.isArray(a)){f=d.body.createControlRange();c.forEach(a,function(i){f.addElement(i)})}else{f=d.body.createTextRange();f.moveToBookmark(a)}f.select()}},getFocus:function(a,d){a=!g._curFocus||a&&c.isDescendant(g._curFocus,a.domNode)?g._prevFocus:g._curFocus;return{node:a,bookmark:a==g._curFocus&&c.withGlobal(d||
c.global,g.getBookmark),openedForWindow:d}},focus:function(a){if(a){var d="node"in a?a.node:a,e=a.bookmark;a=a.openedForWindow;var f=e?e.isCollapsed:false;if(d){var i=d.tagName.toLowerCase()=="iframe"?d.contentWindow:d;if(i&&i.focus)try{i.focus()}catch(j){}g._onFocusNode(d)}if(e&&c.withGlobal(a||c.global,g.isCollapsed)&&!f){a&&a.focus();try{c.withGlobal(a||c.global,g.moveToBookmark,null,[e])}catch(h){}}}},_activeStack:[],registerIframe:function(a){return g.registerWin(a.contentWindow,a)},unregisterIframe:function(a){g.unregisterWin(a)},
registerWin:function(a,d){var e=function(o){g._justMouseDowned=true;setTimeout(function(){g._justMouseDowned=false},0);c.isIE&&o&&o.srcElement&&o.srcElement.parentNode==null||g._onTouchNode(d||o.target||o.srcElement,"mouse")},f=c.isIE?a.document.documentElement:a.document;if(f)if(c.isIE){a.document.body.attachEvent("onmousedown",e);var i=function(o){o.srcElement.tagName.toLowerCase()!="#document"&&g.isTabNavigable(o.srcElement)?g._onFocusNode(d||o.srcElement):g._onTouchNode(d||o.srcElement)};f.attachEvent("onactivate",
i);var j=function(o){g._onBlurNode(d||o.srcElement)};f.attachEvent("ondeactivate",j);return function(){a.document.detachEvent("onmousedown",e);f.detachEvent("onactivate",i);f.detachEvent("ondeactivate",j);f=null}}else{f.body.addEventListener("mousedown",e,true);var h=function(o){g._onFocusNode(d||o.target)};f.addEventListener("focus",h,true);var l=function(o){g._onBlurNode(d||o.target)};f.addEventListener("blur",l,true);return function(){f.body.removeEventListener("mousedown",e,true);f.removeEventListener("focus",
h,true);f.removeEventListener("blur",l,true);f=null}}},unregisterWin:function(a){a&&a()},_onBlurNode:function(){g._prevFocus=g._curFocus;g._curFocus=null;if(!g._justMouseDowned){g._clearActiveWidgetsTimer&&clearTimeout(g._clearActiveWidgetsTimer);g._clearActiveWidgetsTimer=setTimeout(function(){delete g._clearActiveWidgetsTimer;g._setStack([]);g._prevFocus=null},100)}},_onTouchNode:function(a,d){if(g._clearActiveWidgetsTimer){clearTimeout(g._clearActiveWidgetsTimer);delete g._clearActiveWidgetsTimer}var e=
[];try{for(;a;){var f=c.attr(a,"dijitPopupParent");if(f)a=g.byId(f).domNode;else if(a.tagName&&a.tagName.toLowerCase()=="body"){if(a===c.body())break;a=c.window.get(a.ownerDocument).frameElement}else{var i=a.getAttribute&&a.getAttribute("widgetId"),j=i&&g.byId(i);j&&!(d=="mouse"&&j.get("disabled"))&&e.unshift(i);a=a.parentNode}}}catch(h){}g._setStack(e,d)},_onFocusNode:function(a){if(a)if(a.nodeType!=9){g._onTouchNode(a);if(a!=g._curFocus){if(g._curFocus)g._prevFocus=g._curFocus;g._curFocus=a;c.publish("focusNode",
[a])}}},_setStack:function(a,d){var e=g._activeStack;g._activeStack=a;for(var f=0;f<Math.min(e.length,a.length);f++)if(e[f]!=a[f])break;for(var i,j=e.length-1;j>=f;j--)if(i=g.byId(e[j])){i._focused=false;i.set("focused",false);i._hasBeenBlurred=true;i._onBlur&&i._onBlur(d);c.publish("widgetBlur",[i,d])}for(j=f;j<a.length;j++)if(i=g.byId(a[j])){i._focused=true;i.set("focused",true);i._onFocus&&i._onFocus(d);c.publish("widgetFocus",[i,d])}}});c.addOnLoad(function(){var a=g.registerWin(window);c.isIE&&
c.addOnWindowUnload(function(){g.unregisterWin(a);a=null})});return g});
define("dojo/AdapterRegistry",["dojo"],function(c){c.AdapterRegistry=function(g){this.pairs=[];this.returnWrappers=g||false};c.extend(c.AdapterRegistry,{register:function(g,a,d,e,f){this.pairs[f?"unshift":"push"]([g,a,d,e])},match:function(){for(var g=0;g<this.pairs.length;g++){var a=this.pairs[g];if(a[1].apply(this,arguments))return a[3]||this.returnWrappers?a[2]:a[2].apply(this,arguments)}throw new Error("No match found");},unregister:function(g){for(var a=0;a<this.pairs.length;a++)if(this.pairs[a][0]==
g){this.pairs.splice(a,1);return true}return false}});return c.AdapterRegistry});
define("dijit/_base/place",["dojo","dijit","dojo/window","dojo/AdapterRegistry"],function(c,g){g.getViewport=function(){return c.window.getBox()};g.placeOnScreen=function(a,d,e,f){e=c.map(e,function(i){var j={corner:i,pos:{x:d.x,y:d.y}};if(f){j.pos.x+=i.charAt(1)=="L"?f.x:-f.x;j.pos.y+=i.charAt(0)=="T"?f.y:-f.y}return j});return g._place(a,e)};g._place=function(a,d,e,f){var i=c.window.getBox();if(!a.parentNode||String(a.parentNode.tagName).toLowerCase()!="body")c.body().appendChild(a);var j=null;
c.some(d,function(l){var o=l.corner,r=l.pos,u=0,s={w:o.charAt(1)=="L"?i.l+i.w-r.x:r.x-i.l,h:o.charAt(1)=="T"?i.t+i.h-r.y:r.y-i.t};if(e){u=e(a,l.aroundCorner,o,s,f);u=typeof u=="undefined"?0:u}var q=a.style,v=q.display,y=q.visibility;q.visibility="hidden";q.display="";var x=c.marginBox(a);q.display=v;q.visibility=y;q=Math.max(i.l,o.charAt(1)=="L"?r.x:r.x-x.w);v=Math.max(i.t,o.charAt(0)=="T"?r.y:r.y-x.h);y=Math.min(i.l+i.w,o.charAt(1)=="L"?q+x.w:r.x);r=Math.min(i.t+i.h,o.charAt(0)=="T"?v+x.h:r.y);y=
y-q;r=r-v;u+=x.w-y+(x.h-r);if(j==null||u<j.overflow)j={corner:o,aroundCorner:l.aroundCorner,x:q,y:v,w:y,h:r,overflow:u,spaceAvailable:s};return!u});j.overflow&&e&&e(a,j.aroundCorner,j.corner,j.spaceAvailable,f);d=c._isBodyLtr();var h=a.style;h.top=j.y+"px";h[d?"left":"right"]=(d?j.x:i.w-j.x-j.w)+"px";return j};g.placeOnScreenAroundNode=function(a,d,e,f){d=c.byId(d);d=c.position(d,true);return g._placeOnScreenAroundRect(a,d.x,d.y,d.w,d.h,e,f)};g.placeOnScreenAroundRectangle=function(a,d,e,f){return g._placeOnScreenAroundRect(a,
d.x,d.y,d.width,d.height,e,f)};g._placeOnScreenAroundRect=function(a,d,e,f,i,j,h){var l=[];for(var o in j)l.push({aroundCorner:o,corner:j[o],pos:{x:d+(o.charAt(1)=="L"?0:f),y:e+(o.charAt(0)=="T"?0:i)}});return g._place(a,l,h,{w:f,h:i})};g.placementRegistry=new c.AdapterRegistry;g.placementRegistry.register("node",function(a,d){return typeof d=="object"&&typeof d.offsetWidth!="undefined"&&typeof d.offsetHeight!="undefined"},g.placeOnScreenAroundNode);g.placementRegistry.register("rect",function(a,
d){return typeof d=="object"&&"x"in d&&"y"in d&&"width"in d&&"height"in d},g.placeOnScreenAroundRectangle);g.placeOnScreenAroundElement=function(){return g.placementRegistry.match.apply(g.placementRegistry,arguments)};g.getPopupAroundAlignment=function(a,d){var e={};c.forEach(a,function(f){switch(f){case "after":e[d?"BR":"BL"]=d?"BL":"BR";break;case "before":e[d?"BL":"BR"]=d?"BR":"BL";break;case "below-alt":d=!d;case "below":e[d?"BL":"BR"]=d?"TL":"TR";e[d?"BR":"BL"]=d?"TR":"TL";break;case "above-alt":d=
!d;case "above":default:e[d?"TL":"TR"]=d?"BL":"BR";e[d?"TR":"TL"]=d?"BR":"BL";break}});return e};return g});define("dijit/_base/window",["dojo","dijit","dojo/window"],function(c,g){g.getDocumentWindow=function(a){return c.window.get(a)};return g});
define("dijit/_base/popup",["dojo","dijit","dijit/_base/focus","dijit/_base/place","dijit/_base/window"],function(c,g){g.popup={_stack:[],_beginZIndex:1E3,_idGen:1,_createWrapper:function(a){var d=a.declaredClass?a._popupWrapper:a.parentNode&&c.hasClass(a.parentNode,"dijitPopup"),e=a.domNode||a;if(!d){d=c.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},c.body());d.appendChild(e);e=e.style;e.display="";e.visibility="";e.position="";e.top="0px";if(a.declaredClass){a._popupWrapper=
d;c.connect(a,"destroy",function(){c.destroy(d);delete a._popupWrapper})}}return d},moveOffScreen:function(a){a=this._createWrapper(a);c.style(a,{visibility:"hidden",top:"-9999px",display:""})},hide:function(a){a=this._createWrapper(a);c.style(a,"display","none")},getTopPopup:function(){for(var a=this._stack,d=a.length-1;d>0&&a[d].parent===a[d-1].widget;d--);return a[d]},open:function(a){for(var d=this._stack,e=a.popup,f=a.orient||((a.parent?a.parent.isLeftToRight():c._isBodyLtr())?{BL:"TL",BR:"TR",
TL:"BL",TR:"BR"}:{BR:"TR",BL:"TL",TR:"BR",TL:"BL"}),i=a.around,j=a.around&&a.around.id?a.around.id+"_dropdown":"popup_"+this._idGen++;d.length&&(!a.parent||!c.isDescendant(a.parent.domNode,d[d.length-1].widget.domNode));)g.popup.close(d[d.length-1].widget);var h=this._createWrapper(e);c.attr(h,{id:j,style:{zIndex:this._beginZIndex+d.length},"class":"dijitPopup "+(e.baseClass||e["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:a.parent?a.parent.id:""});if(c.isIE||c.isMoz)if(!e.bgIframe)e.bgIframe=
new g.BackgroundIframe(h);f=i?g.placeOnScreenAroundElement(h,i,f,e.orient?c.hitch(e,"orient"):null):g.placeOnScreen(h,a,f=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],a.padding);h.style.display="";h.style.visibility="visible";e.domNode.style.visibility="visible";i=[];i.push(c.connect(h,"onkeypress",this,function(l){if(l.charOrCode==c.keys.ESCAPE&&a.onCancel){c.stopEvent(l);a.onCancel()}else if(l.charOrCode===c.keys.TAB){c.stopEvent(l);(l=this.getTopPopup())&&l.onCancel&&l.onCancel()}}));e.onCancel&&
i.push(c.connect(e,"onCancel",a.onCancel));i.push(c.connect(e,e.onExecute?"onExecute":"onChange",this,function(){var l=this.getTopPopup();l&&l.onExecute&&l.onExecute()}));d.push({widget:e,parent:a.parent,onExecute:a.onExecute,onCancel:a.onCancel,onClose:a.onClose,handlers:i});e.onOpen&&e.onOpen(f);return f},close:function(a){for(var d=this._stack;a&&c.some(d,function(j){return j.widget==a})||!a&&d.length;){var e=d.pop(),f=e.widget,i=e.onClose;f.onClose&&f.onClose();c.forEach(e.handlers,c.disconnect);
f&&f.domNode&&this.hide(f);i&&i()}}};g._frames=new (function(){var a=[];this.pop=function(){var d;if(a.length){d=a.pop();d.style.display=""}else{if(c.isIE<9){d="<iframe src='"+(c.config.dojoBlankHtmlUrl||c.moduleUrl("dojo","resources/blank.html")+""||'javascript:""')+"' style='position: absolute; left: 0px; top: 0px;z-index: -1; filter:Alpha(Opacity=\"0\");'>";d=c.doc.createElement(d)}else{d=c.create("iframe");d.src='javascript:""';d.className="dijitBackgroundIframe";c.style(d,"opacity",0.1)}d.tabIndex=
-1;g.setWaiRole(d,"presentation")}return d};this.push=function(d){d.style.display="none";a.push(d)}});g.BackgroundIframe=function(a){if(!a.id)throw new Error("no id");if(c.isIE||c.isMoz){var d=this.iframe=g._frames.pop();a.appendChild(d);if(c.isIE<7||c.isQuirks){this.resize(a);this._conn=c.connect(a,"onresize",this,function(){this.resize(a)})}else c.style(d,{width:"100%",height:"100%"})}};c.extend(g.BackgroundIframe,{resize:function(a){this.iframe&&c.style(this.iframe,{width:a.offsetWidth+"px",height:a.offsetHeight+
"px"})},destroy:function(){if(this._conn){c.disconnect(this._conn);this._conn=null}if(this.iframe){g._frames.push(this.iframe);delete this.iframe}}});return g.popup});define("dijit/_base/scroll",["dojo","dijit","dojo/window"],function(c,g){g.scrollIntoView=function(a,d){c.window.scrollIntoView(a,d)};return g.scrollIntoView});
define("dojo/uacss",["dojo"],function(c){(function(){var g=c.doc.documentElement,a=c.isIE,d=c.isOpera,e=Math.floor,f=c.isFF,i=c.boxModel.replace(/-/,"");a={dj_ie:a,dj_ie6:e(a)==6,dj_ie7:e(a)==7,dj_ie8:e(a)==8,dj_ie9:e(a)==9,dj_quirks:c.isQuirks,dj_iequirks:a&&c.isQuirks,dj_opera:d,dj_khtml:c.isKhtml,dj_webkit:c.isWebKit,dj_safari:c.isSafari,dj_chrome:c.isChrome,dj_gecko:c.isMozilla,dj_ff3:e(f)==3};a["dj_"+i]=true;var j="";for(var h in a)if(a[h])j+=h+" ";g.className=c.trim(g.className+" "+j);c._loaders.unshift(function(){if(!c._isBodyLtr()){var l=
"dj_rtl dijitRtl "+j.replace(/ /g,"-rtl ");g.className=c.trim(g.className+" "+l)}})})();return c});define("dijit/_base/sniff",["dojo","dijit","dojo/uacss"],function(c,g){return g});
define("dijit/_base/typematic",["dojo","dijit"],function(c,g){g.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay),this._minDelay);this._timer=setTimeout(c.hitch(this,"_fireEventAndReload"),this._currentTimeout)},trigger:function(a,d,e,f,i,j,h,l){if(i!=this._obj){this.stop();
this._initialDelay=h||500;this._subsequentDelay=j||0.9;this._minDelay=l||10;this._obj=i;this._evt=a;this._node=e;this._count=this._currentTimeout=-1;this._callback=c.hitch(d,f);this._fireEventAndReload();this._evt=c.mixin({faux:true},a)}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null}},addKeyListener:function(a,d,e,f,i,j,h){if(d.keyCode){d.charOrCode=d.keyCode;c.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.",
"","2.0")}else if(d.charCode){d.charOrCode=String.fromCharCode(d.charCode);c.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0")}return[c.connect(a,"onkeypress",this,function(l){if(l.charOrCode==d.charOrCode&&(d.ctrlKey===undefined||d.ctrlKey==l.ctrlKey)&&(d.altKey===undefined||d.altKey==l.altKey)&&(d.metaKey===undefined||d.metaKey==(l.metaKey||false))&&(d.shiftKey===undefined||d.shiftKey==l.shiftKey)){c.stopEvent(l);g.typematic.trigger(l,
e,a,f,d,i,j,h)}else g.typematic._obj==d&&g.typematic.stop()}),c.connect(a,"onkeyup",this,function(){g.typematic._obj==d&&g.typematic.stop()})]},addMouseListener:function(a,d,e,f,i,j){var h=c.connect;return[h(a,"mousedown",this,function(l){c.stopEvent(l);g.typematic.trigger(l,d,a,e,a,f,i,j)}),h(a,"mouseup",this,function(l){c.stopEvent(l);g.typematic.stop()}),h(a,"mouseout",this,function(l){c.stopEvent(l);g.typematic.stop()}),h(a,"mousemove",this,function(l){l.preventDefault()}),h(a,"dblclick",this,
function(l){c.stopEvent(l);if(c.isIE){g.typematic.trigger(l,d,a,e,a,f,i,j);setTimeout(c.hitch(this,g.typematic.stop),50)}})]},addListener:function(a,d,e,f,i,j,h,l){return this.addKeyListener(d,e,f,i,j,h,l).concat(this.addMouseListener(a,f,i,j,h,l))}};return g.typematic});
define("dijit/_base/wai",["dojo","dijit"],function(c,g){g.wai={onload:function(){var a=c.create("div",{id:"a11yTestNode",style:{cssText:'border: 1px solid;border-color:red green;position: absolute;height: 5px;top: -999px;background-image: url("'+(c.config.blankGif||c.moduleUrl("dojo","resources/blank.gif"))+'");'}},c.body()),d=c.getComputedStyle(a);if(d){var e=d.backgroundImage;c[d.borderTopColor==d.borderRightColor||e!=null&&(e=="none"||e=="url(invalid-url:)")?"addClass":"removeClass"](c.body(),
"dijit_a11y");if(c.isIE)a.outerHTML="";else c.body().removeChild(a)}}};if(c.isIE||c.isMoz)c._loaders.unshift(g.wai.onload);c.mixin(g,{hasWaiRole:function(a,d){a=this.getWaiRole(a);return d?a.indexOf(d)>-1:a.length>0},getWaiRole:function(a){return c.trim((c.attr(a,"role")||"").replace("wairole:",""))},setWaiRole:function(a,d){c.attr(a,"role",d)},removeWaiRole:function(a,d){var e=c.attr(a,"role");if(e)if(d){d=c.trim((" "+e+" ").replace(" "+d+" "," "));c.attr(a,"role",d)}else a.removeAttribute("role")},
hasWaiState:function(a,d){return a.hasAttribute?a.hasAttribute("aria-"+d):!!a.getAttribute("aria-"+d)},getWaiState:function(a,d){return a.getAttribute("aria-"+d)||""},setWaiState:function(a,d,e){a.setAttribute("aria-"+d,e)},removeWaiState:function(a,d){a.removeAttribute("aria-"+d)}});return g});
define("dijit/_base",["dojo","dijit","dijit/_base/focus","dijit/_base/manager","dijit/_base/place","dijit/_base/popup","dijit/_base/scroll","dijit/_base/sniff","dijit/_base/typematic","dijit/_base/wai","dijit/_base/window"],function(c,g){return g._base});
define("dijit/_Widget",["dojo","dijit","dijit/_WidgetBase","dijit/_base"],function(c,g){c.connect(c,"_connect",function(a,d){a&&c.isFunction(a._onConnect)&&a._onConnect(d)});g._connectOnUseEventHandler=function(){};g._lastKeyDownNode=null;c.isIE?function(){var a=function(d){g._lastKeyDownNode=d.srcElement};c.doc.attachEvent("onkeydown",a);c.addOnWindowUnload(function(){c.doc.detachEvent("onkeydown",a)})}():c.doc.addEventListener("keydown",function(a){g._lastKeyDownNode=a.target},true);(function(){c.declare("dijit._Widget",
g._WidgetBase,{_deferredConnects:{onClick:"",onDblClick:"",onKeyDown:"",onKeyPress:"",onKeyUp:"",onMouseMove:"",onMouseDown:"",onMouseOut:"",onMouseOver:"",onMouseLeave:"",onMouseEnter:"",onMouseUp:""},onClick:g._connectOnUseEventHandler,onDblClick:g._connectOnUseEventHandler,onKeyDown:g._connectOnUseEventHandler,onKeyPress:g._connectOnUseEventHandler,onKeyUp:g._connectOnUseEventHandler,onMouseDown:g._connectOnUseEventHandler,onMouseMove:g._connectOnUseEventHandler,onMouseOut:g._connectOnUseEventHandler,
onMouseOver:g._connectOnUseEventHandler,onMouseLeave:g._connectOnUseEventHandler,onMouseEnter:g._connectOnUseEventHandler,onMouseUp:g._connectOnUseEventHandler,create:function(){this._deferredConnects=c.clone(this._deferredConnects);for(var a in this.attributeMap)delete this._deferredConnects[a];for(a in this._deferredConnects)this[a]!==g._connectOnUseEventHandler&&delete this._deferredConnects[a];this.inherited(arguments);if(this.domNode)for(a in this.params)this._onConnect(a)},_onConnect:function(a){if(a in
this._deferredConnects){this.connect(this[this._deferredConnects[a]||"domNode"],a.toLowerCase(),a);delete this._deferredConnects[a]}},focused:false,isFocusable:function(){return this.focus&&c.style(this.domNode,"display")!="none"},onFocus:function(){},onBlur:function(){},_onFocus:function(){this.onFocus()},_onBlur:function(){this.onBlur()},setAttribute:function(a,d){c.deprecated(this.declaredClass+"::setAttribute(attr, value) is deprecated. Use set() instead.","","2.0");this.set(a,d)},attr:function(a){if(c.config.isDebug){var d=
arguments.callee._ach||(arguments.callee._ach={}),e=(arguments.callee.caller||"unknown caller").toString();if(!d[e]){c.deprecated(this.declaredClass+"::attr() is deprecated. Use get() or set() instead, called from "+e,"","2.0");d[e]=true}}return arguments.length>=2||typeof a==="object"?this.set.apply(this,arguments):this.get(a)},nodesWithKeyClick:["input","button"],connect:function(a,d,e){var f=c._connect,i=this.inherited(arguments,[a,d=="ondijitclick"?"onclick":d,e]);if(d=="ondijitclick")if(c.indexOf(this.nodesWithKeyClick,
a.nodeName.toLowerCase())==-1){var j=c.hitch(this,e);i.push(f(a,"onkeydown",this,function(h){if((h.keyCode==c.keys.ENTER||h.keyCode==c.keys.SPACE)&&!h.ctrlKey&&!h.shiftKey&&!h.altKey&&!h.metaKey){g._lastKeyDownNode=h.target;"openDropDown"in this&&a==this._buttonNode||h.preventDefault()}}),f(a,"onkeyup",this,function(h){if((h.keyCode==c.keys.ENTER||h.keyCode==c.keys.SPACE)&&h.target==g._lastKeyDownNode&&!h.ctrlKey&&!h.shiftKey&&!h.altKey&&!h.metaKey){g._lastKeyDownNode=null;return j(h)}}))}return i},
_onShow:function(){this.onShow()},onShow:function(){},onHide:function(){},onClose:function(){return true}})})();return g._Widget});
define("dojo/string",["dojo"],function(c){c.getObject("string",true,c);c.string.rep=function(g,a){if(a<=0||!g)return"";for(var d=[];;){a&1&&d.push(g);if(!(a>>=1))break;g+=g}return d.join("")};c.string.pad=function(g,a,d,e){d||(d="0");g=String(g);a=c.string.rep(d,Math.ceil((a-g.length)/d.length));return e?g+a:a+g};c.string.substitute=function(g,a,d,e){e=e||c.global;d=d?c.hitch(e,d):function(f){return f};return g.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(f,i,j){f=c.getObject(i,false,
a);if(j)f=c.getObject(j,false,e).call(e,f,i);return d(f,i).toString()})};c.string.trim=String.prototype.trim?c.trim:function(g){g=g.replace(/^\s+/,"");for(var a=g.length-1;a>=0;a--)if(/\S/.test(g.charAt(a))){g=g.substring(0,a+1);break}return g};return c.string});
define("dojo/date/stamp",["dojo"],function(c){c.getObject("date.stamp",true,c);c.date.stamp.fromISOString=function(g,a){if(!c.date.stamp._isoRegExp)c.date.stamp._isoRegExp=/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(.\d+)?)?((?:[+-](\d{2}):(\d{2}))|Z)?)?$/;var d=c.date.stamp._isoRegExp.exec(g);g=null;if(d){d.shift();d[1]&&d[1]--;if(d[6])d[6]*=1E3;if(a){a=new Date(a);c.forEach(c.map(["FullYear","Month","Date","Hours","Minutes","Seconds","Milliseconds"],function(i){return a["get"+
i]()}),function(i,j){d[j]=d[j]||i})}g=new Date(d[0]||1970,d[1]||0,d[2]||1,d[3]||0,d[4]||0,d[5]||0,d[6]||0);if(d[0]<100)g.setFullYear(d[0]||1970);var e=0,f=d[7]&&d[7].charAt(0);if(f!="Z"){e=(d[8]||0)*60+(Number(d[9])||0);if(f!="-")e*=-1}if(f)e-=g.getTimezoneOffset();e&&g.setTime(g.getTime()+e*6E4)}return g};c.date.stamp.toISOString=function(g,a){var d=function(j){return j<10?"0"+j:j};a=a||{};var e=[],f=a.zulu?"getUTC":"get",i="";if(a.selector!="time"){i=g[f+"FullYear"]();i=["0000".substr((i+"").length)+
i,d(g[f+"Month"]()+1),d(g[f+"Date"]())].join("-")}e.push(i);if(a.selector!="date"){i=[d(g[f+"Hours"]()),d(g[f+"Minutes"]()),d(g[f+"Seconds"]())].join(":");f=g[f+"Milliseconds"]();if(a.milliseconds)i+="."+(f<100?"0":"")+d(f);if(a.zulu)i+="Z";else if(a.selector!="time"){g=g.getTimezoneOffset();a=Math.abs(g);i+=(g>0?"-":"+")+d(Math.floor(a/60))+":"+d(a%60)}e.push(i)}return e.join("T")};return c.date.stamp});
define("dojo/parser",["dojo","dojo/date/stamp"],function(c){c.parser=new (function(){function g(h){if(f.isString(h))return"string";if(typeof h=="number")return"number";if(typeof h=="boolean")return"boolean";if(f.isFunction(h))return"function";if(f.isArray(h))return"array";if(h instanceof Date)return"date";if(h instanceof f._Url)return"url";return"object"}function a(h,l){switch(l){case "string":return h;case "number":return h.length?Number(h):NaN;case "boolean":return typeof h=="boolean"?h:h.toLowerCase()!=
"false";case "function":if(f.isFunction(h)){h=h.toString();h=f.trim(h.substring(h.indexOf("{")+1,h.length-1))}try{return h===""||h.search(/[^\w\.]+/i)!=-1?new Function(h):f.getObject(h,false)||new Function(h)}catch(o){return new Function}case "array":return h?h.split(/\s*,\s*/):[];case "date":switch(h){case "":return new Date("");case "now":return new Date;default:return f.date.stamp.fromISOString(h)}case "url":return f.baseUrl+h;default:return f.fromJson(h)}}function d(h,l){for(var o in h)if(o.charAt(0)!=
"_")o in i||(l[o]=g(h[o]));return l}function e(h,l){var o=j[h];if(o){if(!l&&!o.params)o.params=d(o.cls.prototype,{})}else{h=f.getObject(h);o=null;if(!h)return null;l||(o=d(h.prototype,{}));o={cls:h,params:o}}return o}var f=c,i={},j={};f.connect(f,"extend",function(){j={}});this._functionFromScript=function(h,l){var o="",r="";(l=h.getAttribute(l+"args")||h.getAttribute("args"))&&f.forEach(l.split(/\s*,\s*/),function(u,s){o+="var "+u+" = arguments["+s+"]; "});(l=h.getAttribute("with"))&&l.length&&f.forEach(l.split(/\s*,\s*/),
function(u){o+="with("+u+"){";r+="}"});return new Function(o+h.innerHTML+r)};this.instantiate=function(h,l,o){var r=[];l=l||{};o=o||{};var u=(o.scope||f._scopeName)+"Type",s="data-"+(o.scope||f._scopeName)+"-";f.forEach(h,function(q){if(q){var v,y,x,k,m,n;if(q.node){v=q.node;y=q.type;n=q.fastpath;k=(x=q.clsInfo||y&&e(y,n))&&x.cls;m=q.scripts}else{v=q;m=(k=(x=(y=u in l?l[u]:v.getAttribute(u))&&e(y))&&x.cls)&&(k._noScript||k.prototype._noScript)?[]:f.query("> script[type^='dojo/']",v)}if(!x)throw new Error("Could not load class '"+
y);var p={};o.defaults&&f._mixin(p,o.defaults);q.inherited&&f._mixin(p,q.inherited);if(n){if((x=v.getAttribute(s+"props"))&&x.length)try{x=f.fromJson.call(o.propsThis,"{"+x+"}");f._mixin(p,x)}catch(t){throw new Error(t.toString()+" in data-dojo-props='"+x+"'");}if(x=v.getAttribute(s+"attach-point"))p.dojoAttachPoint=x;if(x=v.getAttribute(s+"attach-event"))p.dojoAttachEvent=x;c.mixin(p,l)}else{q=v.attributes;for(var w in x.params){y=w in l?{value:l[w],specified:true}:q.getNamedItem(w);if(!(!y||!y.specified&&
(!c.isIE||w.toLowerCase()!="value"))){y=y.value;switch(w){case "class":y="className"in l?l.className:v.className;break;case "style":y="style"in l?l.style:v.style&&v.style.cssText}var z=x.params[w];p[w]=typeof y=="string"?a(y,z):y}}}var A=[],C=[];f.forEach(m,function(E){v.removeChild(E);var H=E.getAttribute(s+"event")||E.getAttribute("event"),K=E.getAttribute("type");E=f.parser._functionFromScript(E,s);if(H)if(K=="dojo/connect")A.push({event:H,func:E});else p[H]=E;else C.push(E)});var F=(m=k.markupFactory||
k.prototype&&k.prototype.markupFactory)?m(p,v,k):new k(p,v);r.push(F);(k=v.getAttribute(s+"id")||v.getAttribute("jsId"))&&f.setObject(k,F);f.forEach(A,function(E){f.connect(F,E.event,null,E.func)});f.forEach(C,function(E){E.call(F)})}});l._started||f.forEach(r,function(q){if(!o.noStart&&q&&c.isFunction(q.startup)&&!q._started&&(!q.getParent||!q.getParent()))q.startup()});return r};this.parse=function(h,l){function o(v,y){var x=c.clone(v.inherited);c.forEach(["dir","lang"],function(w){var z=v.node.getAttribute(w);
if(z)x[w]=z});for(var k=v.clsInfo&&!v.clsInfo.cls.prototype._noScript?v.scripts:null,m=!v.clsInfo||!v.clsInfo.cls.prototype.stopParser||l&&l.template,n=v.node.firstChild;n;n=n.nextSibling)if(n.nodeType==1){var p,t=m&&n.getAttribute(u+"type");p=t?t:m&&n.getAttribute(r);t=t==p;if(p){p={type:p,fastpath:t,clsInfo:e(p,t),node:n,scripts:[],inherited:x};y.push(p);o(p,y)}else if(k&&n.nodeName.toLowerCase()=="script")(p=n.getAttribute("type"))&&/^dojo\/\w/i.test(p)&&k.push(n);else m&&o({node:n,inherited:x},
y)}}if(!l&&h&&h.rootNode){l=h;h=l.rootNode}else h=h;h=h?c.byId(h):c.body();l=l||{};var r=(l.scope||f._scopeName)+"Type",u="data-"+(l.scope||f._scopeName)+"-",s={};if(l&&l.inherited)for(var q in l.inherited)if(l.inherited[q])s[q]=l.inherited[q];q=[];o({node:h,inherited:s},q);return this.instantiate(q,l&&l.template?{template:true}:null,l)}});(function(){var g=function(){c.config.parseOnLoad&&c.parser.parse()};c.getObject("dijit.wai.onload")===c._loaders[0]?c._loaders.splice(1,0,g):c._loaders.unshift(g)})();
return c.parser});
define("dojo/cache",["dojo"],function(c){var g={};c.cache=function(a,d,e){if(typeof a=="string")var f=c.moduleUrl(a,d);else{f=a;e=d}f=f.toString();var i=e;if(e!=undefined&&!c.isString(e))i="value"in e?e.value:undefined;e=e&&e.sanitize?true:false;if(typeof i=="string")i=g[f]=e?c.cache._sanitize(i):i;else if(i===null)delete g[f];else{if(!(f in g)){i=undefined;if(c.isFunction(require)&&c.isString(a))try{var j=(a?a.replace(/\./g,"/")+"/":"")+d;i=require("text!"+j)}catch(h){}if(typeof i==="undefined")i=
c._getText(f);g[f]=e?c.cache._sanitize(i):i}i=g[f]}return i};c.cache._sanitize=function(a){if(a){a=a.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var d=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(d)a=d[1]}else a="";return a};return c.cache});
define("dijit/_Templated",["dojo","dijit","dijit/_Widget","dojo/string","dojo/parser","dojo/cache"],function(c,g){c.declare("dijit._Templated",null,{templateString:null,templatePath:null,widgetsInTemplate:false,_skipNodeCache:false,_earlyTemplatedStartup:false,constructor:function(){this._attachPoints=[];this._attachEvents=[]},_stringRepl:function(a){var d=this.declaredClass,e=this;return c.string.substitute(a,this,function(f,i){if(i.charAt(0)=="!")f=c.getObject(i.substr(1),false,e);if(typeof f==
"undefined")throw new Error(d+" template:"+i);if(f==null)return"";return i.charAt(0)=="!"?f:f.toString().replace(/"/g,"&quot;")},this)},buildRendering:function(){var a=g._Templated.getCachedTemplate(this.templatePath,this.templateString,this._skipNodeCache),d;if(c.isString(a)){d=c._toDom(this._stringRepl(a));if(d.nodeType!=1)throw new Error("Invalid template: "+a);}else d=a.cloneNode(true);this.domNode=d;this.inherited(arguments);this._attachTemplateNodes(d);if(this.widgetsInTemplate){a=this._startupWidgets=
c.parser.parse(d,{noStart:!this._earlyTemplatedStartup,template:true,inherited:{dir:this.dir,lang:this.lang},propsThis:this,scope:"dojo"});this._supportingWidgets=g.findWidgets(d);this._attachTemplateNodes(a,function(e,f){return e[f]})}this._fillContent(this.srcNodeRef)},_fillContent:function(a){var d=this.containerNode;if(a&&d)for(;a.hasChildNodes();)d.appendChild(a.firstChild)},_attachTemplateNodes:function(a,d){d=d||function(r,u){return r.getAttribute(u)};for(var e=c.isArray(a)?a:a.all||a.getElementsByTagName("*"),
f=c.isArray(a)?0:-1;f<e.length;f++){var i=f==-1?a:e[f];if(!(this.widgetsInTemplate&&(d(i,"dojoType")||d(i,"data-dojo-type")))){var j=d(i,"dojoAttachPoint")||d(i,"data-dojo-attach-point");if(j)for(var h=j.split(/\s*,\s*/);j=h.shift();){if(c.isArray(this[j]))this[j].push(i);else this[j]=i;this._attachPoints.push(j)}if(j=d(i,"dojoAttachEvent")||d(i,"data-dojo-attach-event")){h=j.split(/\s*,\s*/);for(var l=c.trim;j=h.shift();)if(j){var o=null;if(j.indexOf(":")!=-1){o=j.split(":");j=l(o[0]);o=l(o[1])}else j=
l(j);o||(o=j);this._attachEvents.push(this.connect(i,j,o))}}(j=d(i,"waiRole"))&&g.setWaiRole(i,j);(j=d(i,"waiState"))&&c.forEach(j.split(/\s*,\s*/),function(r){if(r.indexOf("-")!=-1){r=r.split("-");g.setWaiState(i,r[0],r[1])}})}}},startup:function(){c.forEach(this._startupWidgets,function(a){a&&!a._started&&a.startup&&a.startup()});this.inherited(arguments)},destroyRendering:function(){c.forEach(this._attachPoints,function(a){delete this[a]},this);this._attachPoints=[];c.forEach(this._attachEvents,
this.disconnect,this);this._attachEvents=[];this.inherited(arguments)}});g._Templated._templateCache={};g._Templated.getCachedTemplate=function(a,d,e){var f=g._Templated._templateCache,i=d||a,j=f[i];if(j){try{if(!j.ownerDocument||j.ownerDocument==c.doc)return j}catch(h){}c.destroy(j)}d||(d=c.cache(a,{sanitize:true}));d=c.string.trim(d);if(e||d.match(/\$\{([^\}]+)\}/g))return f[i]=d;else{a=c._toDom(d);if(a.nodeType!=1)throw new Error("Invalid template: "+d);return f[i]=a}};c.isIE&&c.addOnWindowUnload(function(){var a=
g._Templated._templateCache;for(var d in a){var e=a[d];typeof e=="object"&&c.destroy(e);delete a[d]}});c.extend(g._Widget,{dojoAttachEvent:"",dojoAttachPoint:"",waiRole:"",waiState:""});return g._Templated});
define("dijit/_CssStateMixin",["dojo","dijit"],function(c,g){c.declare("dijit._CssStateMixin",[],{cssStateNodes:{},hovering:false,active:false,_applyAttributes:function(){this.inherited(arguments);c.forEach(["onmouseenter","onmouseleave","onmousedown"],function(d){this.connect(this.domNode,d,"_cssMouseEvent")},this);c.forEach(["disabled","readOnly","checked","selected","focused","state","hovering","active"],function(d){this.watch(d,c.hitch(this,"_setStateClass"))},this);for(var a in this.cssStateNodes)this._trackMouseState(this[a],
this.cssStateNodes[a]);this._setStateClass()},_cssMouseEvent:function(a){if(!this.disabled)switch(a.type){case "mouseenter":case "mouseover":this._set("hovering",true);this._set("active",this._mouseDown);break;case "mouseleave":case "mouseout":this._set("hovering",false);this._set("active",false);break;case "mousedown":this._set("active",true);this._mouseDown=true;var d=this.connect(c.body(),"onmouseup",function(){this._mouseDown=false;this._set("active",false);this.disconnect(d)});break}},_setStateClass:function(){function a(h){d=
d.concat(c.map(d,function(l){return l+h}),"dijit"+h)}var d=this.baseClass.split(" ");this.isLeftToRight()||a("Rtl");this.checked&&a("Checked");this.state&&a(this.state);this.selected&&a("Selected");if(this.disabled)a("Disabled");else if(this.readOnly)a("ReadOnly");else if(this.active)a("Active");else this.hovering&&a("Hover");this._focused&&a("Focused");var e=this.stateNode||this.domNode,f={};c.forEach(e.className.split(" "),function(h){f[h]=true});"_stateClasses"in this&&c.forEach(this._stateClasses,
function(h){delete f[h]});c.forEach(d,function(h){f[h]=true});var i=[];for(var j in f)i.push(j);e.className=i.join(" ");this._stateClasses=d},_trackMouseState:function(a,d){function e(){var o="disabled"in h&&h.disabled||"readonly"in h&&h.readonly;c.toggleClass(a,d+"Hover",f&&!i&&!o);c.toggleClass(a,d+"Active",i&&!o);c.toggleClass(a,d+"Focused",j&&!o)}var f=false,i=false,j=false,h=this,l=c.hitch(this,"connect",a);l("onmouseenter",function(){f=true;e()});l("onmouseleave",function(){i=f=false;e()});
l("onmousedown",function(){i=true;e()});l("onmouseup",function(){i=false;e()});l("onfocus",function(){j=true;e()});l("onblur",function(){j=false;e()});this.watch("disabled",e);this.watch("readOnly",e)}});return g._CssStateMixin});
define("dijit/form/_FormWidget",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin"],function(c,g){c.declare("dijit.form._FormWidget",[g._Widget,g._Templated,g._CssStateMixin],{name:"",alt:"",value:"",type:"text",tabIndex:"0",disabled:false,intermediateChanges:false,scrollOnFocus:true,attributeMap:c.delegate(g._Widget.prototype.attributeMap,{value:"focusNode",id:"focusNode",tabIndex:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=
this.name?'name="'+this.name.replace(/'/g,"&quot;")+'"':"";this.inherited(arguments)},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown")},_setDisabledAttr:function(a){this._set("disabled",a);c.attr(this.focusNode,"disabled",a);this.valueNode&&c.attr(this.valueNode,"disabled",a);g.setWaiState(this.focusNode,"disabled",a);if(a){this._set("hovering",false);this._set("active",false);a="tabIndex"in this.attributeMap?this.attributeMap.tabIndex:"focusNode";
c.forEach(c.isArray(a)?a:[a],function(d){d=this[d];c.isWebKit||g.hasDefaultTabStop(d)?d.setAttribute("tabIndex","-1"):d.removeAttribute("tabIndex")},this)}else this.tabIndex!=""&&this.focusNode.setAttribute("tabIndex",this.tabIndex)},setDisabled:function(a){c.deprecated("setDisabled("+a+") is deprecated. Use set('disabled',"+a+") instead.","","2.0");this.set("disabled",a)},_onFocus:function(){this.scrollOnFocus&&c.window.scrollIntoView(this.domNode);this.inherited(arguments)},isFocusable:function(){return!this.disabled&&
this.focusNode&&c.style(this.domNode,"display")!="none"},focus:function(){this.disabled||g.focus(this.focusNode)},compare:function(a,d){return typeof a=="number"&&typeof d=="number"?isNaN(a)&&isNaN(d)?0:a-d:a>d?1:a<d?-1:0},onChange:function(){},_onChangeActive:false,_handleOnChange:function(a,d){if(this._lastValueReported==undefined&&(d===null||!this._onChangeActive))this._resetValue=this._lastValueReported=a;this._pendingOnChange=this._pendingOnChange||typeof a!=typeof this._lastValueReported||this.compare(a,
this._lastValueReported)!=0;if((this.intermediateChanges||d||d===undefined)&&this._pendingOnChange){this._lastValueReported=a;this._pendingOnChange=false;if(this._onChangeActive){this._onChangeHandle&&clearTimeout(this._onChangeHandle);this._onChangeHandle=setTimeout(c.hitch(this,function(){this._onChangeHandle=null;this.onChange(a)}),0)}}},create:function(){this.inherited(arguments);this._onChangeActive=true},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported)}this.inherited(arguments)},
setValue:function(a){c.deprecated("dijit.form._FormWidget:setValue("+a+") is deprecated.  Use set('value',"+a+") instead.","","2.0");this.set("value",a)},getValue:function(){c.deprecated(this.declaredClass+"::getValue() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_onMouseDown:function(a){if(!a.ctrlKey&&c.mouseButtons.isLeft(a)&&this.isFocusable())var d=this.connect(c.body(),"onmouseup",function(){this.isFocusable()&&this.focus();this.disconnect(d)})}});c.declare("dijit.form._FormValueWidget",
g.form._FormWidget,{readOnly:false,attributeMap:c.delegate(g.form._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(a){c.attr(this.focusNode,"readOnly",a);g.setWaiState(this.focusNode,"readonly",a);this._set("readOnly",a)},postCreate:function(){this.inherited(arguments);if(c.isIE<9||c.isIE&&c.isQuirks)this.connect(this.focusNode||this.domNode,"onkeydown",this._onKeyDown);if(this._resetValue===undefined)this._lastValueReported=this._resetValue=this.value},
_setValueAttr:function(a,d){this._handleOnChange(a,d)},_handleOnChange:function(a){this._set("value",a);this.inherited(arguments)},undo:function(){this._setValueAttr(this._lastValueReported,false)},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true)},_onKeyDown:function(a){if(a.keyCode==c.keys.ESCAPE&&!(a.ctrlKey||a.altKey||a.metaKey)){var d;if(c.isIE){a.preventDefault();d=document.createEventObject();d.keyCode=c.keys.ESCAPE;d.shiftKey=a.shiftKey;a.srcElement.fireEvent("onkeypress",
d)}}},_layoutHackIE7:function(){if(c.isIE==7)for(var a=this.domNode,d=a.parentNode,e=a.firstChild||a,f=e.style.filter,i=this;d&&d.clientHeight==0;){(function(){var j=i.connect(d,"onscroll",function(){i.disconnect(j);e.style.filter=(new Date).getMilliseconds();setTimeout(function(){e.style.filter=f},0)})})();d=d.parentNode}}});return g.form._FormWidget});
define("dijit/form/TextBox",["dojo","dijit","text!dijit/form/templates/TextBox.html","dijit/form/_FormWidget"],function(c,g){c.declare("dijit.form.TextBox",g.form._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",templateString:c.cache("dijit.form","templates/TextBox.html"),_singleNodeTemplate:'<input class="dijit dijitReset dijitLeft dijitInputField" dojoAttachPoint="textbox,focusNode" autocomplete="off" type="${type}" ${!nameAttrSetting} />',
_buttonInputDisabled:c.isIE?"disabled":"",baseClass:"dijitTextBox",attributeMap:c.delegate(g.form._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),postMixInProperties:function(){var a=this.type.toLowerCase();if(this.templateString&&this.templateString.toLowerCase()=="input"||(a=="hidden"||a=="file")&&this.templateString==g.form.TextBox.prototype.templateString)this.templateString=this._singleNodeTemplate;this.inherited(arguments)},_setPlaceHolderAttr:function(a){this._set("placeHolder",
a);if(!this._phspan){this._attachPoints.push("_phspan");this._phspan=c.create("span",{className:"dijitPlaceHolder dijitInputField"},this.textbox,"after")}this._phspan.innerHTML="";this._phspan.appendChild(document.createTextNode(a));this._updatePlaceHolder()},_updatePlaceHolder:function(){if(this._phspan)this._phspan.style.display=this.placeHolder&&!this._focused&&!this.textbox.value?"":"none"},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints)},_setValueAttr:function(a,
d,e){var f;if(a!==undefined){f=this.filter(a);if(typeof e!="string")e=f!==null&&(typeof f!="number"||!isNaN(f))?this.filter(this.format(f,this.constraints)):""}if(e!=null&&e!=undefined&&(typeof e!="number"||!isNaN(e))&&this.textbox.value!=e){this.textbox.value=e;this._set("displayedValue",this.get("displayedValue"))}this._updatePlaceHolder();this.inherited(arguments,[f,d])},displayedValue:"",getDisplayedValue:function(){c.deprecated(this.declaredClass+"::getDisplayedValue() is deprecated. Use set('displayedValue') instead.",
"","2.0");return this.get("displayedValue")},_getDisplayedValueAttr:function(){return this.filter(this.textbox.value)},setDisplayedValue:function(a){c.deprecated(this.declaredClass+"::setDisplayedValue() is deprecated. Use set('displayedValue', ...) instead.","","2.0");this.set("displayedValue",a)},_setDisplayedValueAttr:function(a){if(a===null||a===undefined)a="";else if(typeof a!="string")a=String(a);this.textbox.value=a;this._setValueAttr(this.get("value"),undefined);this._set("displayedValue",
this.get("displayedValue"))},format:function(a){return a==null||a==undefined?"":a.toString?a.toString():a},parse:function(a){return a},_refreshState:function(){},_onInput:function(a){if(a&&a.type&&/key/i.test(a.type)&&a.keyCode)switch(a.keyCode){case c.keys.SHIFT:case c.keys.ALT:case c.keys.CTRL:case c.keys.TAB:return}if(this.intermediateChanges){var d=this;setTimeout(function(){d._handleOnChange(d.get("value"),false)},0)}this._refreshState();this._set("displayedValue",this.get("displayedValue"))},
postCreate:function(){c.isIE&&setTimeout(c.hitch(this,function(){var a=c.getComputedStyle(this.domNode);if(a)if(a=a.fontFamily){var d=this.domNode.getElementsByTagName("INPUT");if(d)for(var e=0;e<d.length;e++)d[e].style.fontFamily=a}}),0);this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(c.isMoz||c.isOpera)this.connect(this.textbox,"oninput","_onInput");else{this.connect(this.textbox,"onkeydown","_onInput");this.connect(this.textbox,"onkeyup","_onInput");this.connect(this.textbox,
"onpaste","_onInput");this.connect(this.textbox,"oncut","_onInput")}},_blankValue:"",filter:function(a){if(a===null)return this._blankValue;if(typeof a!="string")return a;if(this.trim)a=c.trim(a);if(this.uppercase)a=a.toUpperCase();if(this.lowercase)a=a.toLowerCase();if(this.propercase)a=a.replace(/[^\s]+/g,function(d){return d.substring(0,1).toUpperCase()+d.substring(1)});return a},_setBlurValue:function(){this._setValueAttr(this.get("value"),true)},_onBlur:function(){if(!this.disabled){this._setBlurValue();
this.inherited(arguments);this._selectOnClickHandle&&this.disconnect(this._selectOnClickHandle);if(this.selectOnClick&&c.isMoz)this.textbox.selectionStart=this.textbox.selectionEnd=undefined;this._updatePlaceHolder()}},_onFocus:function(a){if(!(this.disabled||this.readOnly)){if(this.selectOnClick&&a=="mouse")this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var d;if(c.isIE){d=c.doc.selection.createRange();d=d.parentElement()==this.textbox&&
d.text.length==0}else d=this.textbox.selectionStart==this.textbox.selectionEnd;d&&g.selectInputText(this.textbox)});this._updatePlaceHolder();this.inherited(arguments);this._refreshState()}},reset:function(){this.textbox.value="";this.inherited(arguments)}});g.selectInputText=function(a,d,e){var f=c.global,i=c.doc;a=c.byId(a);if(isNaN(d))d=0;if(isNaN(e))e=a.value?a.value.length:0;g.focus(a);if(i.selection&&c.body().createTextRange){if(a.createTextRange){a=a.createTextRange();a.collapse(true);a.moveStart("character",
-99999);a.moveStart("character",d);a.moveEnd("character",e-d);a.select()}}else f.getSelection&&a.setSelectionRange&&a.setSelectionRange(d,e)};return g.form.TextBox});define("text!dijit/templates/Tooltip.html",function(){return'<div class="dijitTooltip dijitTooltipLeft" id="dojoTooltip"\n\t><div class="dijitTooltipContainer dijitTooltipContents" dojoAttachPoint="containerNode" role=\'alert\'></div\n\t><div class="dijitTooltipConnector" dojoAttachPoint="connectorNode"></div\n></div>'});
define("dijit/Tooltip",["dojo","dijit","dijit/_Widget","dijit/_Templated","text!dijit/templates/Tooltip.html"],function(c,g){c.declare("dijit._MasterTooltip",[g._Widget,g._Templated],{duration:g.defaultDuration,templateString:c.cache("dijit","templates/Tooltip.html"),postCreate:function(){c.body().appendChild(this.domNode);this.bgIframe=new g.BackgroundIframe(this.domNode);this.fadeIn=c.fadeIn({node:this.domNode,duration:this.duration,onEnd:c.hitch(this,"_onShow")});this.fadeOut=c.fadeOut({node:this.domNode,
duration:this.duration,onEnd:c.hitch(this,"_onHide")})},show:function(a,d,e,f){if(!(this.aroundNode&&this.aroundNode===d)){this.domNode.width="auto";if(this.fadeOut.status()=="playing")this._onDeck=arguments;else{this.containerNode.innerHTML=a;g.placeOnScreenAroundElement(this.domNode,d,g.getPopupAroundAlignment(e&&e.length?e:g.Tooltip.defaultPosition,!f),c.hitch(this,"orient"));c.style(this.domNode,"opacity",0);this.fadeIn.play();this.isShowingNow=true;this.aroundNode=d}}},orient:function(a,d,e,
f,i){this.connectorNode.style.top="";var j=f.w-this.connectorNode.offsetWidth;a.className="dijitTooltip "+{"BL-TL":"dijitTooltipBelow dijitTooltipABLeft","TL-BL":"dijitTooltipAbove dijitTooltipABLeft","BR-TR":"dijitTooltipBelow dijitTooltipABRight","TR-BR":"dijitTooltipAbove dijitTooltipABRight","BR-BL":"dijitTooltipRight","BL-BR":"dijitTooltipLeft"}[d+"-"+e];this.domNode.style.width="auto";var h=c.contentBox(this.domNode),l=Math.min(Math.max(j,1),h.w),o=l<h.w;this.domNode.style.width=l+"px";if(o){this.containerNode.style.overflow=
"auto";o=this.containerNode.scrollWidth;this.containerNode.style.overflow="visible";if(o>l){o=o+c.style(this.domNode,"paddingLeft")+c.style(this.domNode,"paddingRight");this.domNode.style.width=o+"px"}}if(e.charAt(0)=="B"&&d.charAt(0)=="B"){a=c.marginBox(a);d=this.connectorNode.offsetHeight;if(a.h>f.h){this.connectorNode.style.top=f.h-i.h/2-d/2+"px";this.connectorNode.style.bottom=""}else{this.connectorNode.style.bottom=Math.min(Math.max(i.h/2-d/2,0),a.h-d)+"px";this.connectorNode.style.top=""}}else{this.connectorNode.style.top=
"";this.connectorNode.style.bottom=""}return Math.max(0,h.w-j)},_onShow:function(){if(c.isIE)this.domNode.style.filter=""},hide:function(a){if(this._onDeck&&this._onDeck[1]==a)this._onDeck=null;else if(this.aroundNode===a){this.fadeIn.stop();this.isShowingNow=false;this.aroundNode=null;this.fadeOut.play()}},_onHide:function(){this.domNode.style.cssText="";this.containerNode.innerHTML="";if(this._onDeck){this.show.apply(this,this._onDeck);this._onDeck=null}}});g.showTooltip=function(a,d,e,f){if(!g._masterTT)g._masterTT=
new g._MasterTooltip;return g._masterTT.show(a,d,e,f)};g.hideTooltip=function(a){if(!g._masterTT)g._masterTT=new g._MasterTooltip;return g._masterTT.hide(a)};c.declare("dijit.Tooltip",g._Widget,{label:"",showDelay:400,connectId:[],position:[],_setConnectIdAttr:function(a){c.forEach(this._connections||[],function(e){c.forEach(e,c.hitch(this,"disconnect"))},this);var d=c.isArrayLike(a)?a:a?[a]:[];this._connections=c.map(d,function(e){return(e=c.byId(e))?[this.connect(e,"onmouseenter","_onTargetMouseEnter"),
this.connect(e,"onmouseleave","_onTargetMouseLeave"),this.connect(e,"onfocus","_onTargetFocus"),this.connect(e,"onblur","_onTargetBlur")]:[]},this);this._set("connectId",a);this._connectIds=d},addTarget:function(a){a=a.id||a;c.indexOf(this._connectIds,a)==-1&&this.set("connectId",this._connectIds.concat(a))},removeTarget:function(a){a=c.indexOf(this._connectIds,a.id||a);if(a>=0){this._connectIds.splice(a,1);this.set("connectId",this._connectIds)}},buildRendering:function(){this.inherited(arguments);
c.addClass(this.domNode,"dijitTooltipData")},startup:function(){this.inherited(arguments);var a=this.connectId;c.forEach(c.isArrayLike(a)?a:[a],this.addTarget,this)},_onTargetMouseEnter:function(a){this._onHover(a)},_onTargetMouseLeave:function(a){this._onUnHover(a)},_onTargetFocus:function(a){this._focus=true;this._onHover(a)},_onTargetBlur:function(a){this._focus=false;this._onUnHover(a)},_onHover:function(a){if(!this._showTimer){var d=a.target;this._showTimer=setTimeout(c.hitch(this,function(){this.open(d)}),
this.showDelay)}},_onUnHover:function(){if(!this._focus){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}this.close()}},open:function(a){if(this._showTimer){clearTimeout(this._showTimer);delete this._showTimer}g.showTooltip(this.label||this.domNode.innerHTML,a,this.position,!this.isLeftToRight());this._connectNode=a;this.onShow(a,this.position)},close:function(){if(this._connectNode){g.hideTooltip(this._connectNode);delete this._connectNode;this.onHide()}if(this._showTimer){clearTimeout(this._showTimer);
delete this._showTimer}},onShow:function(){},onHide:function(){},uninitialize:function(){this.close();this.inherited(arguments)}});g.Tooltip.defaultPosition=["after","before"];return g.Tooltip});
(function(){function c(d,e,f,i,j,h){if(e[d]){f.push(d);if(e[d]===true||e[d]===1)i.push(j+d+"/"+h)}}function g(d,e,f,i,j){e=i+e+"/"+j;require._fileExists(d.nameToUrl(e,null))&&f.push(e)}var a=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",{version:"0.24.0",load:function(d,e,f,i){i=i||{};var j=a.exec(d),h=j[1],l=j[4],o=j[5],r=l.split("-"),u=[],s={},q,v,y="";if(j[5]){h=j[1];d=h+o}else{d=d;o=j[4];l=i.locale||(i.locale=typeof navigator==="undefined"?"root":(navigator.language||navigator.userLanguage||
"root").toLowerCase());r=l.split("-")}if(i.isBuild){u.push(d);g(e,"root",u,h,o);for(q=0;v=r[q];q++){y+=(y?"-":"")+v;g(e,y,u,h,o)}e(u);f()}else e([d],function(x){var k=[];c("root",x,k,u,h,o);for(q=0;v=r[q];q++){y+=(y?"-":"")+v;c(y,x,k,u,h,o)}e(u,function(){var m,n;for(m=k.length-1;m>-1&&(v=k[m]);m--){n=x[v];if(n===true||n===1)n=e(h+v+"/"+o);require.mixin(s,n)}f(s)})})}})})();
define("dijit/form/nls/validate",{root:{invalidMessage:"The value entered is not valid.",missingMessage:"This value is required.",rangeMessage:"This value is out of range."},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/form/ValidationTextBox",["dojo","dijit","text!dijit/form/templates/ValidationTextBox.html","dojo/i18n","dijit/form/TextBox","dijit/Tooltip","i18n!dijit/form/nls/validate"],function(c,g){c.declare("dijit.form.ValidationTextBox",g.form.TextBox,{templateString:c.cache("dijit.form","templates/ValidationTextBox.html"),baseClass:"dijitTextBox dijitValidationTextBox",required:false,promptMessage:"",invalidMessage:"$_unset_$",missingMessage:"$_unset_$",message:"",constraints:{},regExp:".*",
regExpGen:function(){return this.regExp},state:"",tooltipPosition:[],_setValueAttr:function(){this.inherited(arguments);this.validate(this._focused)},validator:function(a,d){return(new RegExp("^(?:"+this.regExpGen(d)+")"+(this.required?"":"?")+"$")).test(a)&&(!this.required||!this._isEmpty(a))&&(this._isEmpty(a)||this.parse(a,d)!==undefined)},_isValidSubset:function(){return this.textbox.value.search(this._partialre)==0},isValid:function(){return this.validator(this.textbox.value,this.constraints)},
_isEmpty:function(a){return(this.trim?/^\s*$/:/^$/).test(a)},getErrorMessage:function(){return this.required&&this._isEmpty(this.textbox.value)?this.missingMessage:this.invalidMessage},getPromptMessage:function(){return this.promptMessage},_maskValidSubsetError:true,validate:function(a){var d="",e=this.disabled||this.isValid(a);if(e)this._maskValidSubsetError=true;var f=this._isEmpty(this.textbox.value),i=!e&&a&&this._isValidSubset();this._set("state",e?"":((!this._hasBeenBlurred||a)&&f||i)&&this._maskValidSubsetError?
"Incomplete":"Error");g.setWaiState(this.focusNode,"invalid",e?"false":"true");if(this.state=="Error"){this._maskValidSubsetError=a&&i;d=this.getErrorMessage(a)}else if(this.state=="Incomplete"){d=this.getPromptMessage(a);this._maskValidSubsetError=!this._hasBeenBlurred||a}else if(f)d=this.getPromptMessage(a);this.set("message",d);return e},displayMessage:function(a){g.hideTooltip(this.domNode);a&&this._focused&&g.showTooltip(a,this.domNode,this.tooltipPosition,!this.isLeftToRight())},_refreshState:function(){this.validate(this._focused);
this.inherited(arguments)},constructor:function(){this.constraints={}},_setConstraintsAttr:function(a){if(!a.locale&&this.lang)a.locale=this.lang;this._set("constraints",a);this._computePartialRE()},_computePartialRE:function(){var a=this.regExpGen(this.constraints);this.regExp=a;var d="";a!=".*"&&this.regExp.replace(/\\.|\[\]|\[.*?[^\\]{1}\]|\{.*?\}|\(\?[=:!]|./g,function(f){switch(f.charAt(0)){case "{":case "+":case "?":case "*":case "^":case "$":case "|":case "(":d+=f;break;case ")":d+="|$)";break;
default:d+="(?:"+f+"|$)";break}});try{"".search(d)}catch(e){d=this.regExp;console.warn("RegExp error in "+this.declaredClass+": "+this.regExp)}this._partialre="^(?:"+d+")$"},postMixInProperties:function(){this.inherited(arguments);this.messages=c.i18n.getLocalization("dijit.form","validate",this.lang);if(this.invalidMessage=="$_unset_$")this.invalidMessage=this.messages.invalidMessage;if(!this.invalidMessage)this.invalidMessage=this.promptMessage;if(this.missingMessage=="$_unset_$")this.missingMessage=
this.messages.missingMessage;if(!this.missingMessage)this.missingMessage=this.invalidMessage;this._setConstraintsAttr(this.constraints)},_setDisabledAttr:function(){this.inherited(arguments);this._refreshState()},_setRequiredAttr:function(a){this._set("required",a);g.setWaiState(this.focusNode,"required",a);this._refreshState()},_setMessageAttr:function(a){this._set("message",a);this.displayMessage(a)},reset:function(){this._maskValidSubsetError=true;this.inherited(arguments)},_onBlur:function(){this.displayMessage("");
this.inherited(arguments)}});c.declare("dijit.form.MappedTextBox",g.form.ValidationTextBox,{postMixInProperties:function(){this.inherited(arguments);this.nameAttrSetting=""},serialize:function(a){return a.toString?a.toString():""},toString:function(){var a=this.filter(this.get("value"));return a!=null?typeof a=="string"?a:this.serialize(a,this.constraints):""},validate:function(){this.valueNode.value=this.toString();return this.inherited(arguments)},buildRendering:function(){this.inherited(arguments);
this.valueNode=c.place("<input type='hidden'"+(this.name?" name='"+this.name.replace(/'/g,"&quot;")+"'":"")+"/>",this.textbox,"after")},reset:function(){this.valueNode.value="";this.inherited(arguments)}});c.declare("dijit.form.RangeBoundTextBox",g.form.MappedTextBox,{rangeMessage:"",rangeCheck:function(a,d){return("min"in d?this.compare(a,d.min)>=0:true)&&("max"in d?this.compare(a,d.max)<=0:true)},isInRange:function(){return this.rangeCheck(this.get("value"),this.constraints)},_isDefinitelyOutOfRange:function(){var a=
this.get("value"),d=false,e=false;if("min"in this.constraints){d=this.constraints.min;d=this.compare(a,typeof d=="number"&&d>=0&&a!=0?0:d);d=typeof d=="number"&&d<0}if("max"in this.constraints){e=this.constraints.max;e=this.compare(a,typeof e!="number"||e>0?e:0);e=typeof e=="number"&&e>0}return d||e},_isValidSubset:function(){return this.inherited(arguments)&&!this._isDefinitelyOutOfRange()},isValid:function(a){return this.inherited(arguments)&&(this._isEmpty(this.textbox.value)&&!this.required||
this.isInRange(a))},getErrorMessage:function(a){var d=this.get("value");if(d!==null&&d!==""&&d!==undefined&&(typeof d!="number"||!isNaN(d))&&!this.isInRange(a))return this.rangeMessage;return this.inherited(arguments)},postMixInProperties:function(){this.inherited(arguments);if(!this.rangeMessage){this.messages=c.i18n.getLocalization("dijit.form","validate",this.lang);this.rangeMessage=this.messages.rangeMessage}},_setConstraintsAttr:function(){this.inherited(arguments);if(this.focusNode){this.constraints.min!==
undefined?g.setWaiState(this.focusNode,"valuemin",this.constraints.min):g.removeWaiState(this.focusNode,"valuemin");this.constraints.max!==undefined?g.setWaiState(this.focusNode,"valuemax",this.constraints.max):g.removeWaiState(this.focusNode,"valuemax")}},_setValueAttr:function(a){g.setWaiState(this.focusNode,"valuenow",a);this.inherited(arguments)}});return g.form.ValidationTextBox});
define("orion/util",["dojo","dijit","dojo/hash","dijit/form/ValidationTextBox"],function(c,g){function a(n){m=n}function d(){return m}function e(n){var p="",t=navigator.platform.indexOf("Mac")!==-1;if(n.mod1)p+=t?"Cmd+":"Ctrl+";if(n.mod2)p+="Shift+";if(n.mod3)p+="Alt+";if(n.alphaKey)return p+n.alphaKey;for(var w in c.keys)if(typeof(c.keys[w]==="number"))if(c.keys[w]===n.keyCode)return p+w;var z;switch(n.keyCode){case 59:z=n.mod2?":":";";break;case 61:z=n.mod2?"+":"=";break;case 188:z=n.mod2?"<":",";
break;case 190:z=n.mod2?">":".";break;case 191:z=n.mod2?"?":"/";break;case 192:z=n.mod2?"~":"`";break;case 219:z=n.mod2?"{":"[";break;case 220:z=n.mod2?"|":"\\";break;case 221:z=n.mod2?"}":"]";break;case 222:z=n.mod2?'"':"'";break}if(z)return p+z;return p+String.fromCharCode(n.keyCode)}function f(n,p){n.startup();if(typeof p==="string"){var t=c.byId(p);if(!t)if(t=g.byId(p))t=t.domNode;p=t?t:null}if(p){p=c.position(p);n._setStyleAttr("left:"+(p.x+16)+"px !important;");n._setStyleAttr("top:"+(p.y+16)+
"px !important;")}n.show()}function i(n,p,t,w,z,A,C,F){C=function(H){return function(K){var L=g.byId(n),P=L.get("value");if(H&&K.keyCode===c.keys.ESCAPE){t&&c.style(p,"display","inline");L.destroyRecursive();A&&A()}else if(!(H&&K.keyCode!==c.keys.ENTER)){if(!L.isValid()||P===w)t&&c.style(p,"display","inline");else z(P);L.destroyRecursive();A&&A()}}};var E=new g.form.ValidationTextBox({id:n,required:true,value:w||""});c.place(E.domNode,p,"after");c.addClass(E.domNode,"userEditBoxPrompt");t&&c.style(p,
"display","none");c.connect(E,"onKeyDown",C(true));c.connect(E,"onBlur",C(false));window.setTimeout(function(){E.focus();if(w){var H=c.byId(n),K=F?w.indexOf(F):-1;K>0?g.selectInputText(H,0,K):H.select()}},0)}function j(n){var p=window.navigator.platform.indexOf("Mac")!==-1;return p&&n.metaKey||!p&&n.ctrlKey}function h(n,p){if(p&&j(p))window.open(n);else window.location=n}function l(n){if(!n)return n;var p=window.location.href.split("#")[0];p=p.substring(0,p.length-window.location.pathname.length);
if(n.indexOf(p)===0)return n.substring(p.length);return n}function o(n){var p,t,w,z,A;n=n.split("#");var C=n[n.length-1].split(/\?(?=(?:line|char))/);n=l(C[0]);if(C.length>1){C=C[1].split(/\&(?=(?:line|char))/);for(var F=0;F<C.length;F++){var E=C[F].split("=");if(E.length>1)switch(E[0]){case "char":E=E[1].split(",");if(w===undefined){p=window.parseInt(E[0]);if(E.length>1)t=window.parseInt(E[1])}else{z=E[0];if(E.length>1)A=window.parseInt(E[1]-z)}break;case "line":E=E[1].split(",");w=window.parseInt(E[0]);
break;default:break}}}return{filePath:n,start:p,end:t,line:w,offset:z,length:A}}function r(n,p,t,w,z,A){if(typeof p==="number"){n="#"+n+"?char="+p;if(typeof t==="number")n=n+","+t;else if(typeof A==="number")n=n+","+(p+A);return n}if(typeof w==="number"){n="#"+n+"?line="+w;if(typeof z==="number"){n=n+"&char="+z;if(typeof A==="number")n=n+","+(z+A)}return n}return"#"+n}function u(n){if(!n)return n;var p=window.location.href.split("#")[0];return p.substring(0,p.length-window.location.pathname.length)+
n}function s(n){return this.makeRelative(n).indexOf("/workspace")===0}function q(n,p){n.children=p;for(var t in p)p[t].parent=n;n.children.sort(function(w,z){var A=w.Directory;if(A!==z.Directory)return A?-1:1;w=w.Name&&w.Name.toLowerCase();z=z.Name&&z.Name.toLowerCase();if(w<z)return-1;if(w>z)return 1;return 0})}function v(n,p){n.Parents&&n.Parents.length===0&&p.getService("orion.core.preference").then(function(t){return t.getPreferences("/window/recent")}).then(function(t){var w=t.get("projects");
if(typeof w==="string")w=JSON.parse(w);var z=[];if(w&&w.length&&w.length>0)for(var A=0;A<w.length;A++)w[A].location!==n.ChildrenLocation&&w[A].name!==n.Name&&z.push(w[A]);z.push({name:n.Name,location:n.ChildrenLocation});if(z.length>5)z=z.slice(-5,z.length);t.put("projects",z)})}function y(n){return typeof n.textContent!=="undefined"?n.textContent:n.innerText}function x(n){return y(document.createTextNode(n))}function k(n,p){if(typeof n.textContent!=="undefined")n.textContent=p;else n.innerText=p}
var m=null;return{setUserName:a,getUserName:d,getUserKeyString:e,openDialog:f,getUserText:i,openInNewWindow:j,followLink:h,getPositionInfo:o,hashFromPosition:r,makeRelative:l,makeFullPath:u,isAtRoot:s,processNavigatorParent:q,rememberSuccessfulTraversal:v,getText:y,safeText:x,setText:k}});define("text!dijit/templates/Menu.html",function(){return'<table class="dijit dijitMenu dijitMenuPassive dijitReset dijitMenuTable" role="menu" tabIndex="${tabIndex}" dojoAttachEvent="onkeypress:_onKeyPress" cellspacing="0">\n\t<tbody class="dijitReset" dojoAttachPoint="containerNode"></tbody>\n</table>'});
define("dijit/_Container",["dojo","dijit"],function(c,g){c.declare("dijit._Container",null,{isContainer:true,buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode},addChild:function(a,d){var e=this.containerNode;if(d&&typeof d=="number"){var f=this.getChildren();if(f&&f.length>=d){e=f[d-1].domNode;d="after"}}c.place(a.domNode,e,d);this._started&&!a._started&&a.startup()},removeChild:function(a){if(typeof a=="number")a=this.getChildren()[a];if(a)(a=
a.domNode)&&a.parentNode&&a.parentNode.removeChild(a)},hasChildren:function(){return this.getChildren().length>0},destroyDescendants:function(a){c.forEach(this.getChildren(),function(d){d.destroyRecursive(a)})},_getSiblingOfChild:function(a,d){a=a.domNode;d=d>0?"nextSibling":"previousSibling";do a=a[d];while(a&&(a.nodeType!=1||!g.byNode(a)));return a&&g.byNode(a)},getIndexOfChild:function(a){return c.indexOf(this.getChildren(),a)},startup:function(){if(!this._started){c.forEach(this.getChildren(),
function(a){a.startup()});this.inherited(arguments)}}});return g._Container});
define("dijit/_KeyNavContainer",["dojo","dijit","dijit/_Container"],function(c,g){c.declare("dijit._KeyNavContainer",g._Container,{tabIndex:"0",_keyNavCodes:{},connectKeyNavHandlers:function(a,d){var e=this._keyNavCodes={},f=c.hitch(this,this.focusPrev),i=c.hitch(this,this.focusNext);c.forEach(a,function(j){e[j]=f});c.forEach(d,function(j){e[j]=i});e[c.keys.HOME]=c.hitch(this,"focusFirstChild");e[c.keys.END]=c.hitch(this,"focusLastChild");this.connect(this.domNode,"onkeypress","_onContainerKeypress");
this.connect(this.domNode,"onfocus","_onContainerFocus")},startupKeyNavChildren:function(){c.forEach(this.getChildren(),c.hitch(this,"_startupChild"))},addChild:function(a){g._KeyNavContainer.superclass.addChild.apply(this,arguments);this._startupChild(a)},focus:function(){this.focusFirstChild()},focusFirstChild:function(){var a=this._getFirstFocusableChild();a&&this.focusChild(a)},focusLastChild:function(){var a=this._getLastFocusableChild();a&&this.focusChild(a)},focusNext:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,
1))},focusPrev:function(){this.focusChild(this._getNextFocusableChild(this.focusedChild,-1),true)},focusChild:function(a,d){this.focusedChild&&a!==this.focusedChild&&this._onChildBlur(this.focusedChild);a.set("tabIndex",this.tabIndex);a.focus(d?"end":"start");this._set("focusedChild",a)},_startupChild:function(a){a.set("tabIndex","-1");this.connect(a,"_onFocus",function(){a.set("tabIndex",this.tabIndex)});this.connect(a,"_onBlur",function(){a.set("tabIndex","-1")})},_onContainerFocus:function(a){if(a.target===
this.domNode){this.focusFirstChild();c.attr(this.domNode,"tabIndex","-1")}},_onBlur:function(){this.tabIndex&&c.attr(this.domNode,"tabIndex",this.tabIndex);this.inherited(arguments)},_onContainerKeypress:function(a){if(!(a.ctrlKey||a.altKey)){var d=this._keyNavCodes[a.charOrCode];if(d){d();c.stopEvent(a)}}},_onChildBlur:function(){},_getFirstFocusableChild:function(){return this._getNextFocusableChild(null,1)},_getLastFocusableChild:function(){return this._getNextFocusableChild(null,-1)},_getNextFocusableChild:function(a,
d){if(a)a=this._getSiblingOfChild(a,d);for(var e=this.getChildren(),f=0;f<e.length;f++){a||(a=e[d>0?0:e.length-1]);if(a.isFocusable())return a;a=this._getSiblingOfChild(a,d)}return null}});return g._KeyNavContainer});define("text!dijit/templates/MenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitem" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitIcon dijitMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">\n\t\t<div dojoAttachPoint="arrowWrapper" style="visibility: hidden">\n\t\t\t<img src="${_blankGif}" alt="" class="dijitMenuExpand"/>\n\t\t\t<span class="dijitMenuExpandA11y">+</span>\n\t\t</div>\n\t</td>\n</tr>'});
define("dijit/_Contained",["dojo","dijit"],function(c,g){c.declare("dijit._Contained",null,{getParent:function(){var a=g.getEnclosingWidget(this.domNode.parentNode);return a&&a.isContainer?a:null},_getSibling:function(a){var d=this.domNode;do d=d[a+"Sibling"];while(d&&d.nodeType!=1);return d&&g.byNode(d)},getPreviousSibling:function(){return this._getSibling("previous")},getNextSibling:function(){return this._getSibling("next")},getIndexInParent:function(){var a=this.getParent();if(!a||!a.getIndexOfChild)return-1;
return a.getIndexOfChild(this)}});return g._Contained});
define("dijit/MenuItem",["dojo","dijit","text!dijit/templates/MenuItem.html","dijit/_Widget","dijit/_Templated","dijit/_Contained","dijit/_CssStateMixin"],function(c,g){c.declare("dijit.MenuItem",[g._Widget,g._Templated,g._Contained,g._CssStateMixin],{templateString:c.cache("dijit","templates/MenuItem.html"),attributeMap:c.delegate(g._Widget.prototype.attributeMap,{label:{node:"containerNode",type:"innerHTML"},iconClass:{node:"iconNode",type:"class"}}),baseClass:"dijitMenuItem",label:"",iconClass:"",
accelKey:"",disabled:false,_fillContent:function(a){a&&!("label"in this.params)&&this.set("label",a.innerHTML)},buildRendering:function(){this.inherited(arguments);var a=this.id+"_text";c.attr(this.containerNode,"id",a);if(this.accelKeyNode){c.attr(this.accelKeyNode,"id",this.id+"_accel");a+=" "+this.id+"_accel"}g.setWaiState(this.domNode,"labelledby",a);c.setSelectable(this.domNode,false)},_onHover:function(){this.getParent().onItemHover(this)},_onUnhover:function(){this.getParent().onItemUnhover(this);
this._set("hovering",false)},_onClick:function(a){this.getParent().onItemClick(this,a);c.stopEvent(a)},onClick:function(){},focus:function(){try{c.isIE==8&&this.containerNode.focus();g.focus(this.focusNode)}catch(a){}},_onFocus:function(){this._setSelected(true);this.getParent()._onItemFocus(this);this.inherited(arguments)},_setSelected:function(a){c.toggleClass(this.domNode,"dijitMenuItemSelected",a)},setLabel:function(a){c.deprecated("dijit.MenuItem.setLabel() is deprecated.  Use set('label', ...) instead.",
"","2.0");this.set("label",a)},setDisabled:function(a){c.deprecated("dijit.Menu.setDisabled() is deprecated.  Use set('disabled', bool) instead.","","2.0");this.set("disabled",a)},_setDisabledAttr:function(a){g.setWaiState(this.focusNode,"disabled",a?"true":"false");this._set("disabled",a)},_setAccelKeyAttr:function(a){this.accelKeyNode.style.display=a?"":"none";this.accelKeyNode.innerHTML=a;c.attr(this.containerNode,"colSpan",a?"1":"2");this._set("accelKey",a)}});return g.MenuItem});
define("dijit/PopupMenuItem",["dojo","dijit","dijit/MenuItem"],function(c,g){c.declare("dijit.PopupMenuItem",g.MenuItem,{_fillContent:function(){if(this.srcNodeRef){var a=c.query("*",this.srcNodeRef);g.PopupMenuItem.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){this.inherited(arguments);if(!this.popup){var a=c.query("[widgetId]",this.dropDownContainer)[0];this.popup=g.byNode(a)}c.body().appendChild(this.popup.domNode);this.popup.startup();
this.popup.domNode.style.display="none";this.arrowWrapper&&c.style(this.arrowWrapper,"visibility","");g.setWaiState(this.focusNode,"haspopup","true")}},destroyDescendants:function(){if(this.popup){this.popup._destroyed||this.popup.destroyRecursive();delete this.popup}this.inherited(arguments)}});return g.PopupMenuItem});define("text!dijit/templates/CheckedMenuItem.html",function(){return'<tr class="dijitReset dijitMenuItem" dojoAttachPoint="focusNode" role="menuitemcheckbox" tabIndex="-1"\n\t\tdojoAttachEvent="onmouseenter:_onHover,onmouseleave:_onUnhover,ondijitclick:_onClick">\n\t<td class="dijitReset dijitMenuItemIconCell" role="presentation">\n\t\t<img src="${_blankGif}" alt="" class="dijitMenuItemIcon dijitCheckedMenuItemIcon" dojoAttachPoint="iconNode"/>\n\t\t<span class="dijitCheckedMenuItemIconChar">&#10003;</span>\n\t</td>\n\t<td class="dijitReset dijitMenuItemLabel" colspan="2" dojoAttachPoint="containerNode,labelNode"></td>\n\t<td class="dijitReset dijitMenuItemAccelKey" style="display: none" dojoAttachPoint="accelKeyNode"></td>\n\t<td class="dijitReset dijitMenuArrowCell" role="presentation">&nbsp;</td>\n</tr>'});
define("dijit/CheckedMenuItem",["dojo","dijit","text!dijit/templates/CheckedMenuItem.html","dijit/MenuItem"],function(c,g){c.declare("dijit.CheckedMenuItem",g.MenuItem,{templateString:c.cache("dijit","templates/CheckedMenuItem.html"),checked:false,_setCheckedAttr:function(a){c.toggleClass(this.domNode,"dijitCheckedMenuItemChecked",a);g.setWaiState(this.domNode,"checked",a);this._set("checked",a)},onChange:function(){},_onClick:function(){if(!this.disabled){this.set("checked",!this.checked);this.onChange(this.checked)}this.inherited(arguments)}});
return g.CheckedMenuItem});define("text!dijit/templates/MenuSeparator.html",function(){return'<tr class="dijitMenuSeparator">\n\t<td class="dijitMenuSeparatorIconCell">\n\t\t<div class="dijitMenuSeparatorTop"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n\t<td colspan="3" class="dijitMenuSeparatorLabelCell">\n\t\t<div class="dijitMenuSeparatorTop dijitMenuSeparatorLabel"></div>\n\t\t<div class="dijitMenuSeparatorBottom"></div>\n\t</td>\n</tr>'});
define("dijit/MenuSeparator",["dojo","dijit","text!dijit/templates/MenuSeparator.html","dijit/_Widget","dijit/_Templated","dijit/_Contained"],function(c,g){c.declare("dijit.MenuSeparator",[g._Widget,g._Templated,g._Contained],{templateString:c.cache("dijit","templates/MenuSeparator.html"),buildRendering:function(){this.inherited(arguments);c.setSelectable(this.domNode,false)},isFocusable:function(){return false}});return g.MenuSeparator});
define("dijit/Menu",["dojo","dijit","text!dijit/templates/Menu.html","dojo/window","dijit/_Widget","dijit/_KeyNavContainer","dijit/_Templated","dijit/MenuItem","dijit/PopupMenuItem","dijit/CheckedMenuItem","dijit/MenuSeparator"],function(c,g){c.declare("dijit._MenuBase",[g._Widget,g._Templated,g._KeyNavContainer],{parentMenu:null,popupDelay:500,startup:function(){if(!this._started){c.forEach(this.getChildren(),function(a){a.startup()});this.startupKeyNavChildren();this.inherited(arguments)}},onExecute:function(){},
onCancel:function(){},_moveToPopup:function(a){if(this.focusedChild&&this.focusedChild.popup&&!this.focusedChild.disabled)this.focusedChild._onClick(a);else(a=this._getTopMenu())&&a._isMenuBar&&a.focusNext()},_onPopupHover:function(){if(this.currentPopup&&this.currentPopup._pendingClose_timer){var a=this.currentPopup.parentMenu;a.focusedChild&&a.focusedChild._setSelected(false);a.focusedChild=this.currentPopup.from_item;a.focusedChild._setSelected(true);this._stopPendingCloseTimer(this.currentPopup)}},
onItemHover:function(a){if(this.isActive){this.focusChild(a);if(this.focusedChild.popup&&!this.focusedChild.disabled&&!this.hover_timer)this.hover_timer=setTimeout(c.hitch(this,"_openPopup"),this.popupDelay)}this.focusedChild&&this.focusChild(a);this._hoveredChild=a},_onChildBlur:function(a){this._stopPopupTimer();a._setSelected(false);var d=a.popup;if(d){this._stopPendingCloseTimer(d);d._pendingClose_timer=setTimeout(function(){d._pendingClose_timer=null;if(d.parentMenu)d.parentMenu.currentPopup=
null;g.popup.close(d)},this.popupDelay)}},onItemUnhover:function(a){this.isActive&&this._stopPopupTimer();if(this._hoveredChild==a)this._hoveredChild=null},_stopPopupTimer:function(){if(this.hover_timer){clearTimeout(this.hover_timer);this.hover_timer=null}},_stopPendingCloseTimer:function(a){if(a._pendingClose_timer){clearTimeout(a._pendingClose_timer);a._pendingClose_timer=null}},_stopFocusTimer:function(){if(this._focus_timer){clearTimeout(this._focus_timer);this._focus_timer=null}},_getTopMenu:function(){for(var a=
this;a.parentMenu;a=a.parentMenu);return a},onItemClick:function(a,d){typeof this.isShowingNow=="undefined"&&this._markActive();this.focusChild(a);if(a.disabled)return false;if(a.popup)this._openPopup();else{this.onExecute();a.onClick(d)}},_openPopup:function(){this._stopPopupTimer();var a=this.focusedChild;if(a){var d=a.popup;if(!d.isShowingNow){if(this.currentPopup){this._stopPendingCloseTimer(this.currentPopup);g.popup.close(this.currentPopup)}d.parentMenu=this;d.from_item=a;var e=this;g.popup.open({parent:this,
popup:d,around:a.domNode,orient:this._orient||(this.isLeftToRight()?{TR:"TL",TL:"TR",BR:"BL",BL:"BR"}:{TL:"TR",TR:"TL",BL:"BR",BR:"BL"}),onCancel:function(){e.focusChild(a);e._cleanUp();a._setSelected(true);e.focusedChild=a},onExecute:c.hitch(this,"_cleanUp")});this.currentPopup=d;d.connect(d.domNode,"onmouseenter",c.hitch(e,"_onPopupHover"));if(d.focus)d._focus_timer=setTimeout(c.hitch(d,function(){this._focus_timer=null;this.focus()}),0)}}},_markActive:function(){this.isActive=true;c.replaceClass(this.domNode,
"dijitMenuActive","dijitMenuPassive")},onOpen:function(){this.isShowingNow=true;this._markActive()},_markInactive:function(){this.isActive=false;c.replaceClass(this.domNode,"dijitMenuPassive","dijitMenuActive")},onClose:function(){this._stopFocusTimer();this._markInactive();this.isShowingNow=false;this.parentMenu=null},_closeChild:function(){this._stopPopupTimer();if(this.currentPopup){g._curFocus&&c.isDescendant(g._curFocus,this.currentPopup.domNode)&&this.focusedChild.focusNode.focus();g.popup.close(this.currentPopup);
this.currentPopup=null}if(this.focusedChild){this.focusedChild._setSelected(false);this.focusedChild._onUnhover();this.focusedChild=null}},_onItemFocus:function(a){this._hoveredChild&&this._hoveredChild!=a&&this._hoveredChild._onUnhover()},_onBlur:function(){this._cleanUp();this.inherited(arguments)},_cleanUp:function(){this._closeChild();typeof this.isShowingNow=="undefined"&&this._markInactive()}});c.declare("dijit.Menu",g._MenuBase,{constructor:function(){this._bindings=[]},templateString:c.cache("dijit",
"templates/Menu.html"),baseClass:"dijitMenu",targetNodeIds:[],contextMenuForWindow:false,leftClickToOpen:false,refocus:true,postCreate:function(){this.contextMenuForWindow?this.bindDomNode(c.body()):c.forEach(this.targetNodeIds,this.bindDomNode,this);var a=c.keys,d=this.isLeftToRight();this._openSubMenuKey=d?a.RIGHT_ARROW:a.LEFT_ARROW;this._closeSubMenuKey=d?a.LEFT_ARROW:a.RIGHT_ARROW;this.connectKeyNavHandlers([a.UP_ARROW],[a.DOWN_ARROW])},_onKeyPress:function(a){if(!(a.ctrlKey||a.altKey))switch(a.charOrCode){case this._openSubMenuKey:this._moveToPopup(a);
c.stopEvent(a);break;case this._closeSubMenuKey:if(this.parentMenu)this.parentMenu._isMenuBar?this.parentMenu.focusPrev():this.onCancel(false);else c.stopEvent(a);break}},_iframeContentWindow:function(a){return c.window.get(this._iframeContentDocument(a))||this._iframeContentDocument(a).__parent__||a.name&&c.doc.frames[a.name]||null},_iframeContentDocument:function(a){return a.contentDocument||a.contentWindow&&a.contentWindow.document||a.name&&c.doc.frames[a.name]&&c.doc.frames[a.name].document||
null},bindDomNode:function(a){a=c.byId(a);var d;if(a.tagName.toLowerCase()=="iframe"){var e=a,f=this._iframeContentWindow(e);d=c.withGlobal(f,c.body)}else d=a==c.body()?c.doc.documentElement:a;var i={node:a,iframe:e};c.attr(a,"_dijitMenu"+this.id,this._bindings.push(i));var j=c.hitch(this,function(h){return[c.connect(h,this.leftClickToOpen?"onclick":"oncontextmenu",this,function(l){c.stopEvent(l);this._scheduleOpen(l.target,e,{x:l.pageX,y:l.pageY})}),c.connect(h,"onkeydown",this,function(l){if(l.shiftKey&&
l.keyCode==c.keys.F10){c.stopEvent(l);this._scheduleOpen(l.target,e)}})]});i.connects=d?j(d):[];if(e){i.onloadHandler=c.hitch(this,function(){var h=this._iframeContentWindow(e);d=c.withGlobal(h,c.body);i.connects=j(d)});e.addEventListener?e.addEventListener("load",i.onloadHandler,false):e.attachEvent("onload",i.onloadHandler)}},unBindDomNode:function(a){var d;try{d=c.byId(a)}catch(e){return}a="_dijitMenu"+this.id;if(d&&c.hasAttr(d,a)){var f=c.attr(d,a)-1,i=this._bindings[f];c.forEach(i.connects,c.disconnect);
var j=i.iframe;if(j)j.removeEventListener?j.removeEventListener("load",i.onloadHandler,false):j.detachEvent("onload",i.onloadHandler);c.removeAttr(d,a);delete this._bindings[f]}},_scheduleOpen:function(a,d,e){if(!this._openTimer)this._openTimer=setTimeout(c.hitch(this,function(){delete this._openTimer;this._openMyself({target:a,iframe:d,coords:e})}),1)},_openMyself:function(a){function d(){o.refocus&&g.focus(r);g.popup.close(o)}var e=a.target,f=a.iframe;if(a=a.coords){if(f){e=c.position(f,true);var i=
this._iframeContentWindow(f);i=c.withGlobal(i,"_docScroll",c);var j=c.getComputedStyle(f),h=c._toPixelValue,l=(c.isIE&&c.isQuirks?0:h(f,j.paddingLeft))+(c.isIE&&c.isQuirks?h(f,j.borderLeftWidth):0);f=(c.isIE&&c.isQuirks?0:h(f,j.paddingTop))+(c.isIE&&c.isQuirks?h(f,j.borderTopWidth):0);a.x+=e.x+l-i.x;a.y+=e.y+f-i.y}}else{a=c.position(e,true);a.x+=10;a.y+=10}var o=this,r=g.getFocus(this);g.popup.open({popup:this,x:a.x,y:a.y,onExecute:d,onCancel:d,orient:this.isLeftToRight()?"L":"R"});this.focus();this._onBlur=
function(){this.inherited("_onBlur",arguments);g.popup.close(this)}},uninitialize:function(){c.forEach(this._bindings,function(a){a&&this.unBindDomNode(a.node)},this);this.inherited(arguments)}});return g.Menu});define("text!dijit/form/templates/Button.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class="dijitReset dijitInline dijitButtonNode"\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode,focusNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode"></span\n\t\t\t><span class="dijitReset dijitToggleButtonIconChar">&#x25CF;</span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tid="${id}_label"\n\t\t\t\tdojoAttachPoint="containerNode"\n\t\t\t></span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/DropDownButton.html",function(){return'<span class="dijit dijitReset dijitInline"\n\t><span class=\'dijitReset dijitInline dijitButtonNode\'\n\t\tdojoAttachEvent="ondijitclick:_onButtonClick" dojoAttachPoint="_buttonNode"\n\t\t><span class="dijitReset dijitStretch dijitButtonContents"\n\t\t\tdojoAttachPoint="focusNode,titleNode,_arrowWrapperNode"\n\t\t\trole="button" aria-haspopup="true" aria-labelledby="${id}_label"\n\t\t\t><span class="dijitReset dijitInline dijitIcon"\n\t\t\t\tdojoAttachPoint="iconNode"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitButtonText"\n\t\t\t\tdojoAttachPoint="containerNode,_popupStateNode"\n\t\t\t\tid="${id}_label"\n\t\t\t></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonInner"></span\n\t\t\t><span class="dijitReset dijitInline dijitArrowButtonChar">&#9660;</span\n\t\t></span\n\t></span\n\t><input ${!nameAttrSetting} type="${type}" value="${value}" class="dijitOffScreen" tabIndex="-1"\n\t\tdojoAttachPoint="valueNode"\n/></span>'});
define("text!dijit/form/templates/ComboButton.html",function(){return'<table class="dijit dijitReset dijitInline dijitLeft"\n\tcellspacing=\'0\' cellpadding=\'0\' role="presentation"\n\t><tbody role="presentation"><tr role="presentation"\n\t\t><td class="dijitReset dijitStretch dijitButtonNode" dojoAttachPoint="buttonNode" dojoAttachEvent="ondijitclick:_onButtonClick,onkeypress:_onButtonKeyPress"\n\t\t><div id="${id}_button" class="dijitReset dijitButtonContents"\n\t\t\tdojoAttachPoint="titleNode"\n\t\t\trole="button" aria-labelledby="${id}_label"\n\t\t\t><div class="dijitReset dijitInline dijitIcon" dojoAttachPoint="iconNode" role="presentation"></div\n\t\t\t><div class="dijitReset dijitInline dijitButtonText" id="${id}_label" dojoAttachPoint="containerNode" role="presentation"></div\n\t\t></div\n\t\t></td\n\t\t><td id="${id}_arrow" class=\'dijitReset dijitRight dijitButtonNode dijitArrowButton\'\n\t\t\tdojoAttachPoint="_popupStateNode,focusNode,_buttonNode"\n\t\t\tdojoAttachEvent="onkeypress:_onArrowKeyPress"\n\t\t\ttitle="${optionsTitle}"\n\t\t\trole="button" aria-haspopup="true"\n\t\t\t><div class="dijitReset dijitArrowButtonInner" role="presentation"></div\n\t\t\t><div class="dijitReset dijitArrowButtonChar" role="presentation">&#9660;</div\n\t\t></td\n\t\t><td style="display:none !important;"\n\t\t\t><input ${!nameAttrSetting} type="${type}" value="${value}" dojoAttachPoint="valueNode"\n\t\t/></td></tr></tbody\n></table>'});
define("dijit/_HasDropDown",["dojo","dijit","dijit/_Widget"],function(c,g){c.declare("dijit._HasDropDown",null,{_buttonNode:null,_arrowWrapperNode:null,_popupStateNode:null,_aroundNode:null,dropDown:null,autoWidth:true,forceWidth:false,maxHeight:0,dropDownPosition:["below","above"],_stopClickEvents:true,_onDropDownMouseDown:function(a){if(!(this.disabled||this.readOnly)){c.stopEvent(a);this._docHandler=this.connect(c.doc,"onmouseup","_onDropDownMouseUp");this.toggleDropDown()}},_onDropDownMouseUp:function(a){a&&
this._docHandler&&this.disconnect(this._docHandler);var d=this.dropDown,e=false;if(a&&this._opened){var f=c.position(this._buttonNode,true);if(!(a.pageX>=f.x&&a.pageX<=f.x+f.w)||!(a.pageY>=f.y&&a.pageY<=f.y+f.h)){for(f=a.target;f&&!e;)if(c.hasClass(f,"dijitPopup"))e=true;else f=f.parentNode;if(e){f=a.target;if(d.onItemClick){for(var i;f&&!(i=g.byNode(f));)f=f.parentNode;i&&i.onClick&&i.getParent&&i.getParent().onItemClick(i,a)}return}}}this._opened&&d.focus&&d.autoFocus!==false&&window.setTimeout(c.hitch(d,
"focus"),1)},_onDropDownClick:function(a){this._stopClickEvents&&c.stopEvent(a)},buildRendering:function(){this.inherited(arguments);this._buttonNode=this._buttonNode||this.focusNode||this.domNode;this._popupStateNode=this._popupStateNode||this.focusNode||this._buttonNode;var a={after:this.isLeftToRight()?"Right":"Left",before:this.isLeftToRight()?"Left":"Right",above:"Up",below:"Down",left:"Left",right:"Right"}[this.dropDownPosition[0]]||this.dropDownPosition[0]||"Down";c.addClass(this._arrowWrapperNode||
this._buttonNode,"dijit"+a+"ArrowButton")},postCreate:function(){this.inherited(arguments);this.connect(this._buttonNode,"onmousedown","_onDropDownMouseDown");this.connect(this._buttonNode,"onclick","_onDropDownClick");this.connect(this.focusNode,"onkeypress","_onKey");this.connect(this.focusNode,"onkeyup","_onKeyUp")},destroy:function(){if(this.dropDown){this.dropDown._destroyed||this.dropDown.destroyRecursive();delete this.dropDown}this.inherited(arguments)},_onKey:function(a){if(!(this.disabled||
this.readOnly)){var d=this.dropDown,e=a.target;if(d&&this._opened&&d.handleKey)if(d.handleKey(a)===false){c.stopEvent(a);return}if(d&&this._opened&&a.charOrCode==c.keys.ESCAPE){this.closeDropDown();c.stopEvent(a)}else if(!this._opened&&(a.charOrCode==c.keys.DOWN_ARROW||(a.charOrCode==c.keys.ENTER||a.charOrCode==" ")&&((e.tagName||"").toLowerCase()!=="input"||e.type&&e.type.toLowerCase()!=="text"))){this._toggleOnKeyUp=true;c.stopEvent(a)}}},_onKeyUp:function(){if(this._toggleOnKeyUp){delete this._toggleOnKeyUp;
this.toggleDropDown();var a=this.dropDown;a&&a.focus&&setTimeout(c.hitch(a,"focus"),1)}},_onBlur:function(){this.closeDropDown(g._curFocus&&this.dropDown&&c.isDescendant(g._curFocus,this.dropDown.domNode));this.inherited(arguments)},isLoaded:function(){return true},loadDropDown:function(a){a()},toggleDropDown:function(){if(!(this.disabled||this.readOnly))if(this._opened)this.closeDropDown();else this.isLoaded()?this.openDropDown():this.loadDropDown(c.hitch(this,"openDropDown"))},openDropDown:function(){var a=
this.dropDown,d=a.domNode,e=this._aroundNode||this.domNode,f=this;if(!this._preparedNode){this._preparedNode=true;if(d.style.width)this._explicitDDWidth=true;if(d.style.height)this._explicitDDHeight=true}if(this.maxHeight||this.forceWidth||this.autoWidth){var i={display:"",visibility:"hidden"};if(!this._explicitDDWidth)i.width="";if(!this._explicitDDHeight)i.height="";c.style(d,i);i=this.maxHeight;if(i==-1){i=c.window.getBox();var j=c.position(e,false);i=Math.floor(Math.max(j.y,i.h-(j.y+j.h)))}a.startup&&
!a._started&&a.startup();g.popup.moveOffScreen(a);j=c._getMarginSize(d);var h=i&&j.h>i;c.style(d,{overflowX:"hidden",overflowY:h?"auto":"hidden"});if(h){j.h=i;if("w"in j)j.w+=16}else delete j.h;if(this.forceWidth)j.w=e.offsetWidth;else if(this.autoWidth)j.w=Math.max(j.w,e.offsetWidth);else delete j.w;c.isFunction(a.resize)?a.resize(j):c.marginBox(d,j)}a=g.popup.open({parent:this,popup:a,around:e,orient:g.getPopupAroundAlignment(this.dropDownPosition&&this.dropDownPosition.length?this.dropDownPosition:
["below"],this.isLeftToRight()),onExecute:function(){f.closeDropDown(true)},onCancel:function(){f.closeDropDown(true)},onClose:function(){c.attr(f._popupStateNode,"popupActive",false);c.removeClass(f._popupStateNode,"dijitHasDropDownOpen");f._opened=false}});c.attr(this._popupStateNode,"popupActive","true");c.addClass(f._popupStateNode,"dijitHasDropDownOpen");this._opened=true;return a},closeDropDown:function(a){if(this._opened){a&&this.focus();g.popup.close(this.dropDown);this._opened=false}}});
return g._HasDropDown});
define("dijit/form/Button",["dojo","dijit","text!dijit/form/templates/Button.html","text!dijit/form/templates/DropDownButton.html","text!dijit/form/templates/ComboButton.html","dijit/form/_FormWidget","dijit/_Container","dijit/_HasDropDown"],function(c,g){c.declare("dijit.form.Button",g.form._FormWidget,{label:"",showLabel:true,iconClass:"",type:"button",baseClass:"dijitButton",templateString:c.cache("dijit.form","templates/Button.html"),attributeMap:c.delegate(g.form._FormWidget.prototype.attributeMap,{value:"valueNode"}),
_onClick:function(a){if(this.disabled)return false;this._clicked();return this.onClick(a)},_onButtonClick:function(a){if(this._onClick(a)===false)a.preventDefault();else if(this.type=="submit"&&!(this.valueNode||this.focusNode).form)for(var d=this.domNode;d.parentNode;d=d.parentNode){var e=g.byNode(d);if(e&&typeof e._onSubmit=="function"){e._onSubmit(a);break}}else if(this.valueNode){this.valueNode.click();a.preventDefault()}},buildRendering:function(){this.inherited(arguments);c.setSelectable(this.focusNode,
false)},_fillContent:function(a){if(a&&(!this.params||!("label"in this.params)))this.set("label",a.innerHTML)},_setShowLabelAttr:function(a){this.containerNode&&c.toggleClass(this.containerNode,"dijitDisplayNone",!a);this._set("showLabel",a)},onClick:function(){return true},_clicked:function(){},setLabel:function(a){c.deprecated("dijit.form.Button.setLabel() is deprecated.  Use set('label', ...) instead.","","2.0");this.set("label",a)},_setLabelAttr:function(a){this._set("label",a);this.containerNode.innerHTML=
a;if(this.showLabel==false&&!this.params.title)this.titleNode.title=c.trim(this.containerNode.innerText||this.containerNode.textContent||"")},_setIconClassAttr:function(a){c.replaceClass(this.iconNode,a||"dijitNoIcon",this.iconClass||"dijitNoIcon");this._set("iconClass",a)}});c.declare("dijit.form.DropDownButton",[g.form.Button,g._Container,g._HasDropDown],{baseClass:"dijitDropDownButton",templateString:c.cache("dijit.form","templates/DropDownButton.html"),_fillContent:function(){if(this.srcNodeRef){var a=
c.query("*",this.srcNodeRef);g.form.DropDownButton.superclass._fillContent.call(this,a[0]);this.dropDownContainer=this.srcNodeRef}},startup:function(){if(!this._started){if(!this.dropDown&&this.dropDownContainer){var a=c.query("[widgetId]",this.dropDownContainer)[0];this.dropDown=g.byNode(a);delete this.dropDownContainer}this.dropDown&&g.popup.hide(this.dropDown);this.inherited(arguments)}},isLoaded:function(){var a=this.dropDown;return!!a&&(!a.href||a.isLoaded)},loadDropDown:function(){var a=this.dropDown;
if(a)if(this.isLoaded())this.openDropDown();else{var d=c.connect(a,"onLoad",this,function(){c.disconnect(d);this.openDropDown()});a.refresh()}},isFocusable:function(){return this.inherited(arguments)&&!this._mouseDown}});c.declare("dijit.form.ComboButton",g.form.DropDownButton,{templateString:c.cache("dijit.form","templates/ComboButton.html"),attributeMap:c.mixin(c.clone(g.form.Button.prototype.attributeMap),{id:"",tabIndex:["focusNode","titleNode"],title:"titleNode"}),optionsTitle:"",baseClass:"dijitComboButton",
cssStateNodes:{buttonNode:"dijitButtonNode",titleNode:"dijitButtonContents",_popupStateNode:"dijitDownArrowButton"},_focusedNode:null,_onButtonKeyPress:function(a){if(a.charOrCode==c.keys[this.isLeftToRight()?"RIGHT_ARROW":"LEFT_ARROW"]){g.focus(this._popupStateNode);c.stopEvent(a)}},_onArrowKeyPress:function(a){if(a.charOrCode==c.keys[this.isLeftToRight()?"LEFT_ARROW":"RIGHT_ARROW"]){g.focus(this.titleNode);c.stopEvent(a)}},focus:function(a){this.disabled||g.focus(a=="start"?this.titleNode:this._popupStateNode)}});
c.declare("dijit.form.ToggleButton",g.form.Button,{baseClass:"dijitToggleButton",checked:false,attributeMap:c.mixin(c.clone(g.form.Button.prototype.attributeMap),{checked:"focusNode"}),_clicked:function(){this.set("checked",!this.checked)},_setCheckedAttr:function(a,d){this._set("checked",a);c.attr(this.focusNode||this.domNode,"checked",a);g.setWaiState(this.focusNode||this.domNode,"pressed",a);this._handleOnChange(a,d)},setChecked:function(a){c.deprecated("setChecked("+a+") is deprecated. Use set('checked',"+
a+") instead.","","2.0");this.set("checked",a)},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||false)}});return g.form.Button});define("dijit/form/DropDownButton",["dojo","dijit","dijit/form/Button"],function(c,g){return g.form.DropDownButton});
define("orion/commands",["dojo","dijit","orion/util","dijit/Menu","dijit/form/DropDownButton","dijit/MenuItem","dijit/PopupMenuItem","dijit/MenuSeparator"],function(c,g,a){function d(j){this._domScope={};this._objectScope={};this._globalScope={};this._namedGroups={};this._activeBindings={};this._init(j)}function e(j){this._init(j)}function f(j,h,l,o,r){this.keyCode=typeof j==="string"?j.toUpperCase().charCodeAt(0):j;this.mod1=h!==undefined&&h!==null?h:false;this.mod2=l!==undefined&&l!==null?l:false;
this.mod3=o!==undefined&&o!==null?o:false;this.mod4=r!==undefined&&r!==null?r:false}d.prototype={_init:function(j){this._registry=j.serviceRegistry;this._serviceRegistration=this._registry.registerService("orion.page.command",this);this._selection=j.selection;c.connect(window.document,"onkeydown",c.hitch(this,function(h){h=h||window.event;var l=h.target.nodeName.toLowerCase();if(l==="input")switch(h.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(l===
"textarea")return;this._processKey(h)}))},_processKey:function(j){function h(u){if(window.document.all)u.keyCode=0;else{u.preventDefault();u.stopPropagation()}}for(var l in this._activeBindings)if(this._activeBindings[l]&&this._activeBindings[l].keyBinding&&this._activeBindings[l].command)if(this._activeBindings[l].keyBinding.match(j)){var o=this._activeBindings[l],r=o.command;if(r.hrefCallback){h(j);j=r.hrefCallback.call(o.handler||window,o.items,l,o.userData);j.then?j.then(function(u){window.open(u)}):
window.open(j);return}else if(r.callback){h(j);window.setTimeout(function(){r.callback.call(o.handler||window,o.items,l,null,o.userData)},0);return}}},getSelectionService:function(){return this._selection},showKeyBindings:function(j){for(var h in this._activeBindings)this._activeBindings[h]&&this._activeBindings[h].keyBinding&&this._activeBindings[h].command&&c.place("<span>"+a.getUserKeyString(this._activeBindings[h].keyBinding)+" = "+this._activeBindings[h].command.name+"<br></span>",j,"last")},
addCommand:function(j,h){switch(h){case "dom":this._domScope[j.id]=j;break;case "object":this._objectScope[j.id]=j;break;case "global":this._globalScope[j.id]=j;break;default:throw"unrecognized command scope "+h;}},addCommandGroup:function(j,h,l,o,r){var u=this._namedGroups;if(o)u=this._createEntryForPath(o);if(u[j]){if(l)u[j].title=l;if(h)u[j].position=h;if(r)u[j].scopeId=r}else{u[j]={title:l,position:h,children:{},scopeId:r};u.sortedCommands=null}},_createEntryForPath:function(j){var h=this._namedGroups;
if(j){j=j.split("/");for(var l=0;l<j.length;l++)if(j[l].length>1){h[j[l]]||(h[j[l]]={position:0,children:{}});h=h[j[l]].children}}return h},registerCommandContribution:function(j,h,l,o,r,u){o=this._createEntryForPath(o);o[j]={scopeId:l,position:h};if(r)if(h=this._domScope[j]||this._globalScope[j])this._activeBindings[j]={command:h,keyBinding:r,keyOnly:u};o.sortedCommands=null},_isLastChildSeparator:function(j,h){if(h==="image")return j.childNodes.length>0&&c.hasClass(j.childNodes[j.childNodes.length-
1],"commandSeparator");if(h==="menu"){j=j.getChildren();return j.length>0&&j[j.length-1]instanceof g.MenuSeparator}return false},renderCommands:function(j,h,l,o,r,u,s,q){if(typeof j==="string")j=c.byId(j);if(l){var v;if(h==="object")v=this._objectScope;else if(h==="dom")v=this._domScope;else if(h==="global")v=this._globalScope;else throw"Unrecognized command scope "+h;this._render(this._namedGroups,j,h,l,o,r,u,s,v,q);if(r==="image")this._isLastChildSeparator(j,r)&&j.removeChild(j.childNodes[j.childNodes.length-
1]);else if(r==="menu")if(this._isLastChildSeparator(j,r)){l=j.getChildren()[j.getChildren().length-1];j.removeChild(l);l.destroy()}}else{var y=this;this._selection&&this._selection.getSelections(function(x){y.renderCommands(j,h,x,o,r,u,s,q)})}},_render:function(j,h,l,o,r,u,s,q,v,y){var x=j.sortedCommands;if(!x){x=[];for(var k in j){var m=j[k];if(m&&typeof m.position==="number"){m.id=k;x.push(m)}}x.sort(function(A,C){return A.position-C.position});j.sortedCommands=x}for(j=0;j<x.length;j++){var n;
if(x[j].children){k=x[j];if(!(k.scopeId&&h.id!==k.scopeId)){var p;if(u==="image")if(k.title){m=new g.Menu({style:"display: none;"});m.eclipseScopeId=h.eclipseScopeId||h.id;this._render(x[j].children,m,l,o,r,"menu",s,q,v,y);p=m.getChildren();if(this._isLastChildSeparator(m,"menu")){n=p[p.length-1];m.removeChild(n);n.destroy();p=m.getChildren()}if(p.length>0){var t=true;n=p[0].eclipseCommand;if(p.length===1)t=!(n&&n.hasImage());if(t){n=new g.form.DropDownButton({label:k.title,dropDown:m});c.addClass(n.domNode,
"commandLink");s&&c.addClass(n.domNode,s);c.place(n.domNode,h,"last")}else{m="image"+n.id+j;k=n._asImage(m,o,r,q,y);c.place(k,h,"last")}}}else{var w;if(h.childNodes.length>0&&!this._isLastChildSeparator(h,u)){w=this.generateSeparatorImage();c.place(w,h,"last")}this._render(x[j].children,h,l,o,r,u,s,q,v,y);if(h.childNodes.length>0)if(h.childNodes[h.childNodes.length-1]!==w){w=this.generateSeparatorImage();c.place(w,h,"last")}}else if(k.title){m=new g.Menu;this._render(x[j].children,m,l,o,r,u,s,q,v,
y);m.getChildren().length>0&&h.addChild(new g.PopupMenuItem({label:k.title,popup:m}))}else{var z;if(h.getChildren().length>0&&!this._isLastChildSeparator(h,u)){z=new g.MenuSeparator;h.addChild(z)}this._render(x[j].children,h,l,o,r,u,s,q,v,y);k=h.getChildren();if(k[k.length-1]!==z){z=new g.MenuSeparator;h.addChild(z)}}}}else{m=(k=v[x[j].id])?true:false;if(k){if(l==="dom")m=u==="image"?h.id===x[j].scopeId:u==="menu"?h.eclipseScopeId===x[j].scopeId:false;if(this._activeBindings[k.id]&&this._activeBindings[k.id].keyBinding){n=
this._activeBindings[k.id];n.items=o;n.userData=q;n.handler=r;if(n.keyOnly)m=false}if(m&&k.visibleWhen)m=k.visibleWhen(o)}if(m)if(k.choiceCallback){m=new g.Menu({style:"display: none;"});if(u==="image"){n=new g.form.DropDownButton({label:k.name,dropDown:m});if(k.image){c.addClass(n.iconNode,"commandImage");s&&c.addClass(n.iconNode,s);n.iconNode.src=k.image}c.place(n.domNode,h,"last");n.eclipseCommand=k;n.eclipseChoices=m;c.connect(n,"onClick",n,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,
o,r,q)})}else if(u==="menu"){n=new g.PopupMenuItem({label:k.name,popup:m});h.addChild(n);n.eclipseCommand=k;n.eclipseChoices=m;c.connect(h,"_openPopup",n,function(){this.eclipseCommand.populateChoicesMenu(this.eclipseChoices,o,r,q)})}}else if(u==="image"){m="image"+k.id+j;k=k._asImage(m,o,r,q,s,y);c.place(k,h,"last")}else u==="menu"&&k._addMenuItem(h,o,r,q,s)}}},generateSeparatorImage:function(){var j=new Image;j.src="/images/sep.gif";c.addClass(j,"commandImage");c.addClass(j,"commandSeparator");
return j}};d.prototype.constructor=d;e.prototype={_init:function(j){this.id=j.id;this.name=j.name||"Empty Command";this.tooltip=j.tooltip||j.name;this.callback=j.callback;this.hrefCallback=j.hrefCallback;this.choiceCallback=j.choiceCallback;this.image=j.image||"/images/none.png";this.visibleWhen=j.visibleWhen;this._deviceSupportsHover=false},_asImage:function(j,h,l,o,r,u){l=l||this;var s=new Image,q=c.create("a");q.id=this.name+"link";s.alt=this.name;s.title=this.name;s.name=j;s.id=j;if(u||!this.hasImage()){j=
window.document.createTextNode(this.name);c.place(j,q,"last")}if(this.hrefCallback){j=this.hrefCallback.call(l,h,this.id,o);if(j.then)j.then(function(v){q.href=v});else q.href=j}else if(this.callback)!u&&this.hasImage()?c.connect(s,"onclick",this,function(){this.callback.call(l,h,this.id,s.id,o)}):c.connect(q,"onclick",this,function(){this.callback.call(l,h,this.id,q.id,o)});if(!u&&this.hasImage()){if(this._deviceSupportsHover){s.src="/images/none.png";c.connect(s,"onmouseover",this,function(){s.src=
this.image});c.connect(s,"onmouseout",this,function(){s.src="/images/none.png"})}else{s.src=this.image;c.connect(s,"onmouseover",this,function(){c.addClass(s,"commandOver")});c.connect(s,"onmouseout",this,function(){s.src=this.image;c.removeClass(s,"commandOver")})}c.addClass(s,"commandImage");r&&c.addClass(s,r);c.place(s,q,"last")}c.addClass(q,"commandLink");r&&c.addClass(q,r);return q},_asLink:function(j,h,l){h=h||this;var o=window.document.createElement("a");c.place(window.document.createTextNode(this.name),
o,"only");o.href="";o.id=this.id+"link";if(this.callback)c.connect(o,"onclick",this,function(){this.callback.call(h,j,this.id,o.id)});else if(this.hrefCallback){var r=this.hrefCallback.call(h,j,this.id);if(r)if(r.then)r.then(function(u){o.href=u});else o.href=r}c.addClass(o,"commandLink");l&&c.addClass(o,l);return o},_addMenuItem:function(j,h,l,o,r){var u=new g.MenuItem({labelType:this.hrefCallback?"html":"text",label:this.name,tooltip:this.tooltip});if(this.hrefCallback){var s=this.hrefCallback.call(l,
h,this.id,j.id,o);if(s)if(s.then)s.then(c.hitch(this,function(q){u.set("label","<a href='"+q+"'>"+this.name+"</a>");u.onClick=function(v){a.followLink(q,v)}}));else{u.set("label","<a href='"+s+"'>"+this.name+"</a>");u.onClick=function(q){a.followLink(s,q)}}}else if(this.callback)u.onClick=c.hitch(this,function(){this.callback.call(l,h,this.id,null,o)});u.eclipseCommand=this;j.addChild(u);if(this.image){c.addClass(u.iconNode,"commandImage");r&&c.addClass(u.iconNode,r);u.iconNode.src=this.image}},populateChoicesMenu:function(j,
h,l,o){j.focusedChild=null;c.forEach(j.getChildren(),function(s){j.removeChild(s);s.destroy()});l=this.getChoices(h,l,o);for(o=0;o<l.length;o++){var r=l[o],u;if(r.name){u=new g.MenuItem({label:r.name,onClick:this.makeChoiceCallback(r,h)});if(r.image){c.addClass(u.iconNode,"commandImage");u.iconNode.src=r.image}}else u=new g.MenuSeparator;j.addChild(u)}},getChoices:function(j,h,l){if(this.choiceCallback)return this.choiceCallback.call(h,j,l);return null},makeChoiceCallback:function(j,h){return function(l){j.callback&&
j.callback.call(j,h,l)}},hasImage:function(){return this.image!=="/images/none.png"}};e.prototype.constructor=e;var i=window.navigator.platform.indexOf("Mac")!==-1;f.prototype={match:function(j){if(this.keyCode===j.keyCode){if(this.mod1!==(i?j.metaKey:j.ctrlKey))return false;if(this.mod2!==j.shiftKey)return false;if(this.mod3!==j.altKey)return false;if(i&&this.mod4!==j.ctrlKey)return false;return true}return false},equals:function(j){if(!j)return false;if(this.keyCode!==j.keyCode)return false;if(this.mod1!==
j.mod1)return false;if(this.mod2!==j.mod2)return false;if(this.mod3!==j.mod3)return false;if(this.mod4!==j.mod4)return false;return true}};f.prototype.constructor=f;return{CommandService:d,CommandKeyBinding:f,Command:e}});var orion=orion||{};orion.textview=orion.textview||{};
orion.textview.KeyBinding=function(){function c(a,d,e,f,i){this.keyCode=typeof a==="string"?a.toUpperCase().charCodeAt(0):a;this.mod1=d!==undefined&&d!==null?d:false;this.mod2=e!==undefined&&e!==null?e:false;this.mod3=f!==undefined&&f!==null?f:false;this.mod4=i!==undefined&&i!==null?i:false}var g=window.navigator.platform.indexOf("Mac")!==-1;c.prototype={match:function(a){if(this.keyCode===a.keyCode){if(this.mod1!==(g?a.metaKey:a.ctrlKey))return false;if(this.mod2!==a.shiftKey)return false;if(this.mod3!==
a.altKey)return false;if(g&&this.mod4!==a.ctrlKey)return false;return true}return false},equals:function(a){if(!a)return false;if(this.keyCode!==a.keyCode)return false;if(this.mod1!==a.mod1)return false;if(this.mod2!==a.mod2)return false;if(this.mod3!==a.mod3)return false;if(this.mod4!==a.mod4)return false;return true}};return c}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/keyBinding",[],function(){return orion.textview});
define("text!dijit/templates/Dialog.html",function(){return'<div class="dijitDialog" role="dialog" aria-labelledby="${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="ondijitclick: onCancel" title="${buttonCancel}" role="button" tabIndex="-1">\n\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t</span>\n\t</div>\n\t\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent"></div>\n</div>'});
define("dojo/dnd/common",["dojo"],function(c){c.getObject("dnd",true,c);c.dnd.getCopyKeyState=c.isCopyKey;c.dnd._uniqueId=0;c.dnd.getUniqueId=function(){var g;do g=c._scopeName+"Unique"+ ++c.dnd._uniqueId;while(c.byId(g));return g};c.dnd._empty={};c.dnd.isFormElement=function(g){g=g.target;if(g.nodeType==3)g=g.parentNode;return" button textarea input select option ".indexOf(" "+g.tagName.toLowerCase()+" ")>=0};return c.dnd});
define("dojo/dnd/autoscroll",["dojo","dojo/window"],function(c){c.getObject("dnd",true,c);c.dnd.getViewport=c.window.getBox;c.dnd.V_TRIGGER_AUTOSCROLL=32;c.dnd.H_TRIGGER_AUTOSCROLL=32;c.dnd.V_AUTOSCROLL_VALUE=16;c.dnd.H_AUTOSCROLL_VALUE=16;c.dnd.autoScroll=function(g){var a=c.window.getBox(),d=0,e=0;if(g.clientX<c.dnd.H_TRIGGER_AUTOSCROLL)d=-c.dnd.H_AUTOSCROLL_VALUE;else if(g.clientX>a.w-c.dnd.H_TRIGGER_AUTOSCROLL)d=c.dnd.H_AUTOSCROLL_VALUE;if(g.clientY<c.dnd.V_TRIGGER_AUTOSCROLL)e=-c.dnd.V_AUTOSCROLL_VALUE;
else if(g.clientY>a.h-c.dnd.V_TRIGGER_AUTOSCROLL)e=c.dnd.V_AUTOSCROLL_VALUE;window.scrollBy(d,e)};c.dnd._validNodes={div:1,p:1,td:1};c.dnd._validOverflow={auto:1,scroll:1};c.dnd.autoScrollNodes=function(g){for(var a=g.target;a;){if(a.nodeType==1&&a.tagName.toLowerCase()in c.dnd._validNodes){var d=c.getComputedStyle(a);if(d.overflow.toLowerCase()in c.dnd._validOverflow){var e=c._getContentBox(a,d);d=c.position(a,true);var f=Math.min(c.dnd.H_TRIGGER_AUTOSCROLL,e.w/2),i=Math.min(c.dnd.V_TRIGGER_AUTOSCROLL,
e.h/2),j=g.pageX-d.x,h=g.pageY-d.y,l=d=0;if(c.isWebKit||c.isOpera){j+=c.body().scrollLeft;h+=c.body().scrollTop}if(j>0&&j<e.w)if(j<f)d=-f;else if(j>e.w-f)d=f;if(h>0&&h<e.h)if(h<i)l=-i;else if(h>e.h-i)l=i;e=a.scrollLeft;f=a.scrollTop;a.scrollLeft+=d;a.scrollTop+=l;if(e!=a.scrollLeft||f!=a.scrollTop)return}}try{a=a.parentNode}catch(o){a=null}}c.dnd.autoScroll(g)};return c.dnd});
define("dojo/dnd/Mover",["dojo","dojo/dnd/common","dojo/dnd/autoscroll"],function(c){c.declare("dojo.dnd.Mover",null,{constructor:function(g,a,d){this.node=c.byId(g);var e=a.touches?a.touches[0]:a;this.marginBox={l:e.pageX,t:e.pageY};this.mouseButton=a.button;a=this.host=d;g=g.ownerDocument;this.events=[c.connect(g,"onmousemove",this,"onFirstMove"),c.connect(g,"ontouchmove",this,"onFirstMove"),c.connect(g,"onmousemove",this,"onMouseMove"),c.connect(g,"ontouchmove",this,"onMouseMove"),c.connect(g,
"onmouseup",this,"onMouseUp"),c.connect(g,"ontouchend",this,"onMouseUp"),c.connect(g,"ondragstart",c.stopEvent),c.connect(g.body,"onselectstart",c.stopEvent)];a&&a.onMoveStart&&a.onMoveStart(this)},onMouseMove:function(g){c.dnd.autoScroll(g);var a=this.marginBox,d=g.touches?g.touches[0]:g;this.host.onMove(this,{l:a.l+d.pageX,t:a.t+d.pageY},g);c.stopEvent(g)},onMouseUp:function(g){if(c.isWebKit&&c.isMac&&this.mouseButton==2?g.button==0:this.mouseButton==g.button)this.destroy();c.stopEvent(g)},onFirstMove:function(g){var a=
this.node.style,d,e=this.host;switch(a.position){case "relative":case "absolute":d=Math.round(parseFloat(a.left))||0;a=Math.round(parseFloat(a.top))||0;break;default:a.position="absolute";a=c.marginBox(this.node);d=c.doc.body;var f=c.getComputedStyle(d),i=c._getMarginBox(d,f);f=c._getContentBox(d,f);d=a.l-(f.l-i.l);a=a.t-(f.t-i.t);break}this.marginBox.l=d-this.marginBox.l;this.marginBox.t=a-this.marginBox.t;e&&e.onFirstMove&&e.onFirstMove(this,g);c.disconnect(this.events.shift());c.disconnect(this.events.shift())},
destroy:function(){c.forEach(this.events,c.disconnect);var g=this.host;g&&g.onMoveStop&&g.onMoveStop(this);this.events=this.node=this.host=null}});return c.dnd.Mover});
define("dojo/dnd/Moveable",["dojo","dojo/dnd/Mover"],function(c){c.declare("dojo.dnd.Moveable",null,{handle:"",delay:0,skip:false,constructor:function(g,a){this.node=c.byId(g);a||(a={});this.handle=a.handle?c.byId(a.handle):null;if(!this.handle)this.handle=this.node;this.delay=a.delay>0?a.delay:0;this.skip=a.skip;this.mover=a.mover?a.mover:c.dnd.Mover;this.events=[c.connect(this.handle,"onmousedown",this,"onMouseDown"),c.connect(this.handle,"ontouchstart",this,"onMouseDown"),c.connect(this.handle,
"ondragstart",this,"onSelectStart"),c.connect(this.handle,"onselectstart",this,"onSelectStart")]},markupFactory:function(g,a){return new c.dnd.Moveable(a,g)},destroy:function(){c.forEach(this.events,c.disconnect);this.events=this.node=this.handle=null},onMouseDown:function(g){if(!(this.skip&&c.dnd.isFormElement(g))){if(this.delay){this.events.push(c.connect(this.handle,"onmousemove",this,"onMouseMove"),c.connect(this.handle,"ontouchmove",this,"onMouseMove"),c.connect(this.handle,"onmouseup",this,
"onMouseUp"),c.connect(this.handle,"ontouchend",this,"onMouseUp"));var a=g.touches?g.touches[0]:g;this._lastX=a.pageX;this._lastY=a.pageY}else this.onDragDetected(g);c.stopEvent(g)}},onMouseMove:function(g){var a=g.touches?g.touches[0]:g;if(Math.abs(a.pageX-this._lastX)>this.delay||Math.abs(a.pageY-this._lastY)>this.delay){this.onMouseUp(g);this.onDragDetected(g)}c.stopEvent(g)},onMouseUp:function(g){for(var a=0;a<2;++a)c.disconnect(this.events.pop());c.stopEvent(g)},onSelectStart:function(g){if(!this.skip||
!c.dnd.isFormElement(g))c.stopEvent(g)},onDragDetected:function(g){new this.mover(this.node,g,this)},onMoveStart:function(g){c.publish("/dnd/move/start",[g]);c.addClass(c.body(),"dojoMove");c.addClass(this.node,"dojoMoveItem")},onMoveStop:function(g){c.publish("/dnd/move/stop",[g]);c.removeClass(c.body(),"dojoMove");c.removeClass(this.node,"dojoMoveItem")},onFirstMove:function(){},onMove:function(g,a){this.onMoving(g,a);var d=g.node.style;d.left=a.l+"px";d.top=a.t+"px";this.onMoved(g,a)},onMoving:function(){},
onMoved:function(){}});return c.dnd.Moveable});
define("dojo/dnd/move",["dojo","dojo/dnd/Mover","dojo/dnd/Moveable"],function(c){c.declare("dojo.dnd.move.constrainedMoveable",c.dnd.Moveable,{constraints:function(){},within:false,markupFactory:function(g,a){return new c.dnd.move.constrainedMoveable(a,g)},constructor:function(g,a){a||(a={});this.constraints=a.constraints;this.within=a.within},onFirstMove:function(g){var a=this.constraintBox=this.constraints.call(this,g);a.r=a.l+a.w;a.b=a.t+a.h;if(this.within){g=c._getMarginSize(g.node);a.r-=g.w;
a.b-=g.h}},onMove:function(g,a){var d=this.constraintBox,e=g.node.style;this.onMoving(g,a);a.l=a.l<d.l?d.l:d.r<a.l?d.r:a.l;a.t=a.t<d.t?d.t:d.b<a.t?d.b:a.t;e.left=a.l+"px";e.top=a.t+"px";this.onMoved(g,a)}});c.declare("dojo.dnd.move.boxConstrainedMoveable",c.dnd.move.constrainedMoveable,{box:{},markupFactory:function(g,a){return new c.dnd.move.boxConstrainedMoveable(a,g)},constructor:function(g,a){var d=a&&a.box;this.constraints=function(){return d}}});c.declare("dojo.dnd.move.parentConstrainedMoveable",
c.dnd.move.constrainedMoveable,{area:"content",markupFactory:function(g,a){return new c.dnd.move.parentConstrainedMoveable(a,g)},constructor:function(g,a){var d=a&&a.area;this.constraints=function(){var e=this.node.parentNode,f=c.getComputedStyle(e),i=c._getMarginBox(e,f);if(d=="margin")return i;var j=c._getMarginExtents(e,f);i.l+=j.l;i.t+=j.t;i.w-=j.w;i.h-=j.h;if(d=="border")return i;j=c._getBorderExtents(e,f);i.l+=j.l;i.t+=j.t;i.w-=j.w;i.h-=j.h;if(d=="padding")return i;j=c._getPadExtents(e,f);i.l+=
j.l;i.t+=j.t;i.w-=j.w;i.h-=j.h;return i}}});c.dnd.constrainedMover=c.dnd.move.constrainedMover;c.dnd.boxConstrainedMover=c.dnd.move.boxConstrainedMover;c.dnd.parentConstrainedMover=c.dnd.move.parentConstrainedMover;return c.dnd.move});
define("dojo/dnd/TimedMoveable",["dojo","dojo/dnd/Moveable"],function(c){(function(){var g=c.dnd.Moveable.prototype.onMove;c.declare("dojo.dnd.TimedMoveable",c.dnd.Moveable,{timeout:40,constructor:function(a,d){d||(d={});if(d.timeout&&typeof d.timeout=="number"&&d.timeout>=0)this.timeout=d.timeout},markupFactory:function(a,d){return new c.dnd.TimedMoveable(d,a)},onMoveStop:function(a){if(a._timer){clearTimeout(a._timer);g.call(this,a,a._leftTop)}c.dnd.Moveable.prototype.onMoveStop.apply(this,arguments)},
onMove:function(a,d){a._leftTop=d;if(!a._timer){var e=this;a._timer=setTimeout(function(){a._timer=null;g.call(e,a,a._leftTop)},this.timeout)}}})})();return c.dnd.TimedMoveable});
define("dojo/fx/Toggler",["dojo"],function(c){c.declare("dojo.fx.Toggler",null,{node:null,showFunc:c.fadeIn,hideFunc:c.fadeOut,showDuration:200,hideDuration:200,constructor:function(g){var a=this;c.mixin(a,g);a.node=g.node;a._showArgs=c.mixin({},g);a._showArgs.node=a.node;a._showArgs.duration=a.showDuration;a.showAnim=a.showFunc(a._showArgs);a._hideArgs=c.mixin({},g);a._hideArgs.node=a.node;a._hideArgs.duration=a.hideDuration;a.hideAnim=a.hideFunc(a._hideArgs);c.connect(a.showAnim,"beforeBegin",c.hitch(a.hideAnim,
"stop",true));c.connect(a.hideAnim,"beforeBegin",c.hitch(a.showAnim,"stop",true))},show:function(g){return this.showAnim.play(g||0)},hide:function(g){return this.hideAnim.play(g||0)}});return c.fx.Toggler});
define("dojo/fx",["dojo","dojo/fx/Toggler"],function(c){(function(){var g={_fire:function(e,f){if(this[e])this[e].apply(this,f||[]);return this}},a=function(e){this._index=-1;this._animations=e||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;c.forEach(this._animations,function(f){this.duration+=f.duration;if(f.delay)this.duration+=f.delay},this)};c.extend(a,{_onAnimate:function(){this._fire("onAnimate",arguments)},_onEnd:function(){c.disconnect(this._onAnimateCtx);c.disconnect(this._onEndCtx);
this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length)this._fire("onEnd");else{this._current=this._animations[++this._index];this._onAnimateCtx=c.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=c.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true)}},play:function(e,f){if(!this._current)this._current=this._animations[this._index=0];if(!f&&this._current.status()=="playing")return this;var i=c.connect(this._current,"beforeBegin",this,
function(){this._fire("beforeBegin")}),j=c.connect(this._current,"onBegin",this,function(){this._fire("onBegin",arguments)}),h=c.connect(this._current,"onPlay",this,function(){this._fire("onPlay",arguments);c.disconnect(i);c.disconnect(j);c.disconnect(h)});this._onAnimateCtx&&c.disconnect(this._onAnimateCtx);this._onAnimateCtx=c.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx&&c.disconnect(this._onEndCtx);this._onEndCtx=c.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,
arguments);return this},pause:function(){if(this._current){var e=c.connect(this._current,"onPause",this,function(){this._fire("onPause",arguments);c.disconnect(e)});this._current.pause()}return this},gotoPercent:function(e,f){this.pause();var i=this.duration*e;this._current=null;c.some(this._animations,function(j){if(j.duration<=i){this._current=j;return true}i-=j.duration;return false});this._current&&this._current.gotoPercent(i/this._current.duration,f);return this},stop:function(e){if(this._current){if(e){for(;this._index+
1<this._animations.length;++this._index)this._animations[this._index].stop(true);this._current=this._animations[this._index]}var f=c.connect(this._current,"onStop",this,function(){this._fire("onStop",arguments);c.disconnect(f)});this._current.stop()}return this},status:function(){return this._current?this._current.status():"stopped"},destroy:function(){this._onAnimateCtx&&c.disconnect(this._onAnimateCtx);this._onEndCtx&&c.disconnect(this._onEndCtx)}});c.extend(a,g);c.fx.chain=function(e){return new a(e)};
var d=function(e){this._animations=e||[];this._connects=[];this.duration=this._finished=0;c.forEach(e,function(i){var j=i.duration;if(i.delay)j+=i.delay;if(this.duration<j)this.duration=j;this._connects.push(c.connect(i,"onEnd",this,"_onEnd"))},this);this._pseudoAnimation=new c.Animation({curve:[0,1],duration:this.duration});var f=this;c.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(i){f._connects.push(c.connect(f._pseudoAnimation,i,function(){f._fire(i,
arguments)}))})};c.extend(d,{_doAction:function(e,f){c.forEach(this._animations,function(i){i[e].apply(i,f)});return this},_onEnd:function(){++this._finished>this._animations.length&&this._fire("onEnd")},_call:function(e,f){var i=this._pseudoAnimation;i[e].apply(i,f)},play:function(){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this},gotoPercent:function(e,f){var i=
this.duration*e;c.forEach(this._animations,function(j){j.gotoPercent(j.duration<i?1:i/j.duration,f)});this._call("gotoPercent",arguments);return this},stop:function(){this._doAction("stop",arguments);this._call("stop",arguments);return this},status:function(){return this._pseudoAnimation.status()},destroy:function(){c.forEach(this._connects,c.disconnect)}});c.extend(d,g);c.fx.combine=function(e){return new d(e)};c.fx.wipeIn=function(e){var f=e.node=c.byId(e.node),i=f.style,j;e=c.animateProperty(c.mixin({properties:{height:{start:function(){j=
i.overflow;i.overflow="hidden";if(i.visibility=="hidden"||i.display=="none"){i.height="1px";i.display="";i.visibility="";return 1}else{var h=c.style(f,"height");return Math.max(h,1)}},end:function(){return f.scrollHeight}}}},e));c.connect(e,"onEnd",function(){i.height="auto";i.overflow=j});return e};c.fx.wipeOut=function(e){var f=(e.node=c.byId(e.node)).style,i;e=c.animateProperty(c.mixin({properties:{height:{end:1}}},e));c.connect(e,"beforeBegin",function(){i=f.overflow;f.overflow="hidden";f.display=
""});c.connect(e,"onEnd",function(){f.overflow=i;f.height="auto";f.display="none"});return e};c.fx.slideTo=function(e){var f=null,i=null,j=function(h){return function(){var l=c.getComputedStyle(h),o=l.position;f=o=="absolute"?h.offsetTop:parseInt(l.top)||0;i=o=="absolute"?h.offsetLeft:parseInt(l.left)||0;if(o!="absolute"&&o!="relative"){l=c.position(h,true);f=l.y;i=l.x;h.style.position="absolute";h.style.top=f+"px";h.style.left=i+"px"}}}(e.node=c.byId(e.node));j();e=c.animateProperty(c.mixin({properties:{top:e.top||
0,left:e.left||0}},e));c.connect(e,"beforeBegin",e,j);return e}})();return c.fx});
define("dijit/form/_FormMixin",["dojo","dijit","dojo/window"],function(c,g){c.declare("dijit.form._FormMixin",null,{state:"",reset:function(){c.forEach(this.getDescendants(),function(a){a.reset&&a.reset()})},validate:function(){var a=false;return c.every(c.map(this.getDescendants(),function(d){d._hasBeenBlurred=true;var e=d.disabled||!d.validate||d.validate();if(!e&&!a){c.window.scrollIntoView(d.containerNode||d.domNode);d.focus();a=true}return e}),function(d){return d})},setValues:function(a){c.deprecated(this.declaredClass+
"::setValues() is deprecated. Use set('value', val) instead.","","2.0");return this.set("value",a)},_setValueAttr:function(a){var d={};c.forEach(this.getDescendants(),function(j){if(j.name)(d[j.name]||(d[j.name]=[])).push(j)});for(var e in d)if(d.hasOwnProperty(e)){var f=d[e],i=c.getObject(e,false,a);if(i!==undefined){c.isArray(i)||(i=[i]);if(typeof f[0].checked=="boolean")c.forEach(f,function(j){j.set("value",c.indexOf(i,j.value)!=-1)});else f[0].multiple?f[0].set("value",i):c.forEach(f,function(j,
h){j.set("value",i[h])})}}},getValues:function(){c.deprecated(this.declaredClass+"::getValues() is deprecated. Use get('value') instead.","","2.0");return this.get("value")},_getValueAttr:function(){var a={};c.forEach(this.getDescendants(),function(d){var e=d.name;if(!(!e||d.disabled)){var f=d.get("value");if(typeof d.checked=="boolean")if(/Radio/.test(d.declaredClass))if(f!==false)c.setObject(e,f,a);else{f=c.getObject(e,false,a);f===undefined&&c.setObject(e,null,a)}else{d=c.getObject(e,false,a);
if(!d){d=[];c.setObject(e,d,a)}f!==false&&d.push(f)}else{d=c.getObject(e,false,a);if(typeof d!="undefined")c.isArray(d)?d.push(f):c.setObject(e,[d,f],a);else c.setObject(e,f,a)}}});return a},isValid:function(){return this.state==""},onValidStateChange:function(){},_getState:function(){var a=c.map(this._descendants,function(d){return d.get("state")||""});return c.indexOf(a,"Error")>=0?"Error":c.indexOf(a,"Incomplete")>=0?"Incomplete":""},disconnectChildren:function(){c.forEach(this._childConnections||
[],c.hitch(this,"disconnect"));c.forEach(this._childWatches||[],function(a){a.unwatch()})},connectChildren:function(a){var d=this;this.disconnectChildren();this._descendants=this.getDescendants();a=a?function(j,h){d[j]=h}:c.hitch(this,"_set");a("value",this.get("value"));a("state",this._getState());var e=this._childConnections=[],f=this._childWatches=[];c.forEach(c.filter(this._descendants,function(j){return j.validate}),function(j){c.forEach(["state","disabled"],function(h){f.push(j.watch(h,function(){d.set("state",
d._getState())}))})});var i=function(){d._onChangeDelayTimer&&clearTimeout(d._onChangeDelayTimer);d._onChangeDelayTimer=setTimeout(function(){delete d._onChangeDelayTimer;d._set("value",d.get("value"))},10)};c.forEach(c.filter(this._descendants,function(j){return j.onChange}),function(j){e.push(d.connect(j,"onChange",i));f.push(j.watch("disabled",i))})},startup:function(){this.inherited(arguments);this.connectChildren(true);this.watch("state",function(a,d,e){this.onValidStateChange(e=="")})},destroy:function(){this.disconnectChildren();
this.inherited(arguments)}});return g.form._FormMixin});
define("dijit/_DialogMixin",["dojo","dijit","dijit/_Widget"],function(c,g){c.declare("dijit._DialogMixin",null,{attributeMap:g._Widget.prototype.attributeMap,execute:function(){},onCancel:function(){},onExecute:function(){},_onSubmit:function(){this.onExecute();this.execute(this.get("value"))},_getFocusItems:function(){var a=g._getTabNavigable(this.containerNode);this._firstFocusItem=a.lowest||a.first||this.closeButtonNode||this.domNode;this._lastFocusItem=a.last||a.highest||this._firstFocusItem}});
return g._DialogMixin});
define("dijit/DialogUnderlay",["dojo","dijit","dojo/window","dijit/_Widget","dijit/_Templated"],function(c,g){c.declare("dijit.DialogUnderlay",[g._Widget,g._Templated],{templateString:"<div class='dijitDialogUnderlayWrapper'><div class='dijitDialogUnderlay' dojoAttachPoint='node'></div></div>",dialogId:"","class":"",attributeMap:{id:"domNode"},_setDialogIdAttr:function(a){c.attr(this.node,"id",a+"_underlay");this._set("dialogId",a)},_setClassAttr:function(a){this.node.className="dijitDialogUnderlay "+
a;this._set("class",a)},postCreate:function(){c.body().appendChild(this.domNode)},layout:function(){var a=this.node.style,d=this.domNode.style;d.display="none";var e=c.window.getBox();d.top=e.t+"px";d.left=e.l+"px";a.width=e.w+"px";a.height=e.h+"px";d.display="block"},show:function(){this.domNode.style.display="block";this.layout();this.bgIframe=new g.BackgroundIframe(this.domNode)},hide:function(){this.bgIframe.destroy();delete this.bgIframe;this.domNode.style.display="none"}});return g.DialogUnderlay});
define("dijit/layout/_LayoutWidget",["dojo","dijit","dijit/_Widget","dijit/_Container","dijit/_Contained"],function(c,g){c.declare("dijit.layout._LayoutWidget",[g._Widget,g._Container,g._Contained],{baseClass:"dijitLayoutContainer",isLayoutContainer:true,buildRendering:function(){this.inherited(arguments);c.addClass(this.domNode,"dijitContainer")},startup:function(){if(!this._started){this.inherited(arguments);var a=this.getParent&&this.getParent();if(!(a&&a.isLayoutContainer)){this.resize();this.connect(c.isIE?
this.domNode:c.global,"onresize",function(){this.resize()})}}},resize:function(a,d){var e=this.domNode;if(a){c.marginBox(e,a);if(a.t)e.style.top=a.t+"px";if(a.l)e.style.left=a.l+"px"}d=d||{};c.mixin(d,a||{});if(!("h"in d)||!("w"in d))d=c.mixin(c.marginBox(e),d);a=c.getComputedStyle(e);var f=c._getMarginExtents(e,a),i=c._getBorderExtents(e,a);d=this._borderBox={w:d.w-(f.w+i.w),h:d.h-(f.h+i.h)};f=c._getPadExtents(e,a);this._contentBox={l:c._toPixelValue(e,a.paddingLeft),t:c._toPixelValue(e,a.paddingTop),
w:d.w-f.w,h:d.h-f.h};this.layout()},layout:function(){},_setupChild:function(a){c.addClass(a.domNode,this.baseClass+"-child "+(a.baseClass?this.baseClass+"-"+a.baseClass:""))},addChild:function(a){this.inherited(arguments);this._started&&this._setupChild(a)},removeChild:function(a){c.removeClass(a.domNode,this.baseClass+"-child"+(a.baseClass?" "+this.baseClass+"-"+a.baseClass:""));this.inherited(arguments)}});g.layout.marginBox2contentBox=function(a,d){var e=c.getComputedStyle(a),f=c._getMarginExtents(a,
e),i=c._getPadBorderExtents(a,e);return{l:c._toPixelValue(a,e.paddingLeft),t:c._toPixelValue(a,e.paddingTop),w:d.w-(f.w+i.w),h:d.h-(f.h+i.h)}};(function(){var a=function(e){return e.substring(0,1).toUpperCase()+e.substring(1)},d=function(e,f){var i=e.resize?e.resize(f):c.marginBox(e.domNode,f);if(i)c.mixin(e,i);else{c.mixin(e,c.marginBox(e.domNode));c.mixin(e,f)}};g.layout.layoutChildren=function(e,f,i,j,h){f=c.mixin({},f);c.addClass(e,"dijitLayoutContainer");i=c.filter(i,function(l){return l.region!=
"center"&&l.layoutAlign!="client"}).concat(c.filter(i,function(l){return l.region=="center"||l.layoutAlign=="client"}));c.forEach(i,function(l){var o=l.domNode,r=l.region||l.layoutAlign,u=o.style;u.left=f.l+"px";u.top=f.t+"px";u.position="absolute";c.addClass(o,"dijitAlign"+a(r));o={};if(j&&j==l.id)o[l.region=="top"||l.region=="bottom"?"h":"w"]=h;if(r=="top"||r=="bottom"){o.w=f.w;d(l,o);f.h-=l.h;if(r=="top")f.t+=l.h;else u.top=f.t+f.h+"px"}else if(r=="left"||r=="right"){o.h=f.h;d(l,o);f.w-=l.w;if(r==
"left")f.l+=l.w;else u.left=f.l+f.w+"px"}else if(r=="client"||r=="center")d(l,f)})}})();return g.layout._LayoutWidget});
define("dijit/layout/_ContentPaneResizeMixin",["dojo","dijit","dijit/_Contained","dijit/layout/_LayoutWidget"],function(c,g){c.declare("dijit.layout._ContentPaneResizeMixin",null,{doLayout:true,isContainer:true,isLayoutContainer:true,_startChildren:function(){c.forEach(this.getChildren(),function(a){a.startup();a._started=true})},startup:function(){if(!this._started){var a=g._Contained.prototype.getParent.call(this);this._childOfLayoutWidget=a&&a.isLayoutContainer;this._needLayout=!this._childOfLayoutWidget;
this.inherited(arguments);this._startChildren();this._isShown()&&this._onShow();this._childOfLayoutWidget||this.connect(c.isIE?this.domNode:c.global,"onresize",function(){this._needLayout=!this._childOfLayoutWidget;this.resize()})}},_checkIfSingleChild:function(){var a=c.query("> *",this.containerNode).filter(function(f){return f.tagName!=="SCRIPT"}),d=a.filter(function(f){return c.hasAttr(f,"data-dojo-type")||c.hasAttr(f,"dojoType")||c.hasAttr(f,"widgetId")}),e=c.filter(d.map(g.byNode),function(f){return f&&
f.domNode&&f.resize});if(a.length==d.length&&e.length==1)this._singleChild=e[0];else delete this._singleChild;c.toggleClass(this.containerNode,this.baseClass+"SingleChild",!!this._singleChild)},resize:function(a,d){!this._wasShown&&this.open!==false&&this._onShow();this._resizeCalled=true;this._scheduleLayout(a,d)},_scheduleLayout:function(a,d){if(this._isShown())this._layout(a,d);else{this._needLayout=true;this._changeSize=a;this._resultSize=d}},_layout:function(a,d){a&&c.marginBox(this.domNode,
a);var e=this.containerNode;if(e===this.domNode){d=d||{};c.mixin(d,a||{});if(!("h"in d)||!("w"in d))d=c.mixin(c.marginBox(e),d);this._contentBox=g.layout.marginBox2contentBox(e,d)}else this._contentBox=c.contentBox(e);this._layoutChildren();delete this._needLayout},_layoutChildren:function(){this.doLayout&&this._checkIfSingleChild();if(this._singleChild&&this._singleChild.resize){var a=this._contentBox||c.contentBox(this.containerNode);this._singleChild.resize({w:a.w,h:a.h})}else c.forEach(this.getChildren(),
function(d){d.resize&&d.resize()})},_isShown:function(){if(this._childOfLayoutWidget){if(this._resizeCalled&&"open"in this)return this.open;return this._resizeCalled}else if("open"in this)return this.open;else{var a=this.domNode,d=this.domNode.parentNode;return a.style.display!="none"&&a.style.visibility!="hidden"&&!c.hasClass(a,"dijitHidden")&&d&&d.style&&d.style.display!="none"}},_onShow:function(){this._needLayout&&this._layout(this._changeSize,this._resultSize);this.inherited(arguments);this._wasShown=
true}});return g.layout._ContentPaneResizeMixin});
define("dojo/html",["dojo","dojo/parser"],function(c){c.getObject("html",true,c);(function(){var g=0;c.html._secureForInnerHtml=function(a){return a.replace(/(?:\s*<!DOCTYPE\s[^>]+>|<title[^>]*>[\s\S]*?<\/title>)/ig,"")};c.html._emptyNode=c.empty;c.html._setNodeContent=function(a,d){c.empty(a);if(d){if(typeof d=="string")d=c._toDom(d,a.ownerDocument);if(!d.nodeType&&c.isArrayLike(d))for(var e=d.length,f=0;f<d.length;f=e==d.length?f+1:0)c.place(d[f],a,"last");else c.place(d,a,"last")}return a};c.declare("dojo.html._ContentSetter",
null,{node:"",content:"",id:"",cleanContent:false,extractContent:false,parseContent:false,parserScope:c._scopeName,startup:true,constructor:function(a,d){c.mixin(this,a||{});d=this.node=c.byId(this.node||d);if(!this.id)this.id=["Setter",d?d.id||d.tagName:"",g++].join("_")},set:function(a,d){if(undefined!==a)this.content=a;d&&this._mixin(d);this.onBegin();this.setContent();this.onEnd();return this.node},setContent:function(){var a=this.node;if(!a)throw new Error(this.declaredClass+": setContent given no node");
try{a=c.html._setNodeContent(a,this.content)}catch(d){var e=this.onContentError(d);try{a.innerHTML=e}catch(f){console.error("Fatal "+this.declaredClass+".setContent could not change content due to "+f.message,f)}}this.node=a},empty:function(){if(this.parseResults&&this.parseResults.length){c.forEach(this.parseResults,function(a){a.destroy&&a.destroy()});delete this.parseResults}c.html._emptyNode(this.node)},onBegin:function(){var a=this.content;if(c.isString(a)){if(this.cleanContent)a=c.html._secureForInnerHtml(a);
if(this.extractContent){var d=a.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(d)a=d[1]}}this.empty();this.content=a;return this.node},onEnd:function(){this.parseContent&&this._parse();return this.node},tearDown:function(){delete this.parseResults;delete this.node;delete this.content},onContentError:function(a){return"Error occured setting content: "+a},_mixin:function(a){var d={},e;for(e in a)e in d||(this[e]=a[e])},_parse:function(){var a=this.node;try{var d={};c.forEach(["dir","lang","textDir"],
function(f){if(this[f])d[f]=this[f]},this);this.parseResults=c.parser.parse({rootNode:a,noStart:!this.startup,inherited:d,scope:this.parserScope})}catch(e){this._onError("Content",e,"Error parsing in _ContentSetter#"+this.id)}},_onError:function(a,d,e){a=this["on"+a+"Error"].call(this,d);if(e)console.error(e,d);else a&&c.html._setNodeContent(this.node,a,true)}});c.html.set=function(a,d,e){if(undefined==d){console.warn("dojo.html.set: no cont argument provided, using empty string");d=""}return e?(new c.html._ContentSetter(c.mixin(e,
{content:d,node:a}))).set():c.html._setNodeContent(a,d,true)}})();return c.html});define("dijit/nls/loading",{root:{loadingState:"Loading...",errorState:"Sorry, an error occurred"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});
define("dijit/layout/ContentPane",["dojo","dijit","dijit/_Widget","dijit/layout/_ContentPaneResizeMixin","dojo/string","dojo/html","i18n!dijit/nls/loading"],function(c,g){c.declare("dijit.layout.ContentPane",[g._Widget,g.layout._ContentPaneResizeMixin],{href:"",extractContent:false,parseOnLoad:true,parserScope:c._scopeName,preventCache:false,preload:false,refreshOnShow:false,loadingMessage:"<span class='dijitContentPaneLoading'>${loadingState}</span>",errorMessage:"<span class='dijitContentPaneError'>${errorState}</span>",
isLoaded:false,baseClass:"dijitContentPane",ioArgs:{},onLoadDeferred:null,attributeMap:c.delegate(g._Widget.prototype.attributeMap,{title:[]}),stopParser:true,template:false,create:function(a,d){if((!a||!a.template)&&d&&!("href"in a)&&!("content"in a)){var e=c.doc.createDocumentFragment();for(d=c.byId(d);d.firstChild;)e.appendChild(d.firstChild);a=c.delegate(a,{content:e})}this.inherited(arguments,[a,d])},postMixInProperties:function(){this.inherited(arguments);var a=c.i18n.getLocalization("dijit",
"loading",this.lang);this.loadingMessage=c.string.substitute(this.loadingMessage,a);this.errorMessage=c.string.substitute(this.errorMessage,a)},buildRendering:function(){this.inherited(arguments);if(!this.containerNode)this.containerNode=this.domNode;this.domNode.title="";c.attr(this.domNode,"role")||g.setWaiRole(this.domNode,"group")},_startChildren:function(){this.inherited(arguments);this._contentSetter&&c.forEach(this._contentSetter.parseResults,function(a){if(!a._started&&!a._destroyed&&c.isFunction(a.startup)){a.startup();
a._started=true}},this)},setHref:function(a){c.deprecated("dijit.layout.ContentPane.setHref() is deprecated. Use set('href', ...) instead.","","2.0");return this.set("href",a)},_setHrefAttr:function(a){this.cancel();this.onLoadDeferred=new c.Deferred(c.hitch(this,"cancel"));this.onLoadDeferred.addCallback(c.hitch(this,"onLoad"));this._set("href",a);if(this.preload||this._created&&this._isShown())this._load();else this._hrefChanged=true;return this.onLoadDeferred},setContent:function(a){c.deprecated("dijit.layout.ContentPane.setContent() is deprecated.  Use set('content', ...) instead.",
"","2.0");this.set("content",a)},_setContentAttr:function(a){this._set("href","");this.cancel();this.onLoadDeferred=new c.Deferred(c.hitch(this,"cancel"));this._created&&this.onLoadDeferred.addCallback(c.hitch(this,"onLoad"));this._setContent(a||"");this._isDownloaded=false;return this.onLoadDeferred},_getContentAttr:function(){return this.containerNode.innerHTML},cancel:function(){this._xhrDfd&&this._xhrDfd.fired==-1&&this._xhrDfd.cancel();delete this._xhrDfd;this.onLoadDeferred=null},uninitialize:function(){this._beingDestroyed&&
this.cancel();this.inherited(arguments)},destroyRecursive:function(){this._beingDestroyed||this.inherited(arguments)},_onShow:function(){this.inherited(arguments);if(this.href)if(!this._xhrDfd&&(!this.isLoaded||this._hrefChanged||this.refreshOnShow))return this.refresh()},refresh:function(){this.cancel();this.onLoadDeferred=new c.Deferred(c.hitch(this,"cancel"));this.onLoadDeferred.addCallback(c.hitch(this,"onLoad"));this._load();return this.onLoadDeferred},_load:function(){this._setContent(this.onDownloadStart(),
true);var a=this,d={preventCache:this.preventCache||this.refreshOnShow,url:this.href,handleAs:"text"};c.isObject(this.ioArgs)&&c.mixin(d,this.ioArgs);var e=this._xhrDfd=(this.ioMethod||c.xhrGet)(d);e.addCallback(function(f){try{a._isDownloaded=true;a._setContent(f,false);a.onDownloadEnd()}catch(i){a._onError("Content",i)}delete a._xhrDfd;return f});e.addErrback(function(f){e.canceled||a._onError("Download",f);delete a._xhrDfd;return f});delete this._hrefChanged},_onLoadHandler:function(a){this._set("isLoaded",
true);try{this.onLoadDeferred.callback(a)}catch(d){console.error("Error "+this.widgetId+" running custom onLoad code: "+d.message)}},_onUnloadHandler:function(){this._set("isLoaded",false);try{this.onUnload()}catch(a){console.error("Error "+this.widgetId+" running custom onUnload code: "+a.message)}},destroyDescendants:function(){this.isLoaded&&this._onUnloadHandler();var a=this._contentSetter;c.forEach(this.getChildren(),function(d){d.destroyRecursive&&d.destroyRecursive()});if(a){c.forEach(a.parseResults,
function(d){d.destroyRecursive&&d.domNode&&d.domNode.parentNode==c.body()&&d.destroyRecursive()});delete a.parseResults}c.html._emptyNode(this.containerNode);delete this._singleChild},_setContent:function(a,d){this.destroyDescendants();var e=this._contentSetter;if(!(e&&e instanceof c.html._ContentSetter))e=this._contentSetter=new c.html._ContentSetter({node:this.containerNode,_onError:c.hitch(this,this._onError),onContentError:c.hitch(this,function(i){i=this.onContentError(i);try{this.containerNode.innerHTML=
i}catch(j){console.error("Fatal "+this.id+" could not change content due to "+j.message,j)}})});var f=c.mixin({cleanContent:this.cleanContent,extractContent:this.extractContent,parseContent:this.parseOnLoad,parserScope:this.parserScope,startup:false,dir:this.dir,lang:this.lang},this._contentSetterParams||{});e.set(c.isObject(a)&&a.domNode?a.domNode:a,f);delete this._contentSetterParams;this.doLayout&&this._checkIfSingleChild();if(!d){if(this._started){this._startChildren();this._scheduleLayout()}this._onLoadHandler(a)}},
_onError:function(a,d,e){this.onLoadDeferred.errback(d);a=this["on"+a+"Error"].call(this,d);if(e)console.error(e,d);else a&&this._setContent(a,true)},onLoad:function(){},onUnload:function(){},onDownloadStart:function(){return this.loadingMessage},onContentError:function(){},onDownloadError:function(){return this.errorMessage},onDownloadEnd:function(){}});return g.layout.ContentPane});
define("dijit/nls/common",{root:{buttonOk:"OK",buttonCancel:"Cancel",buttonSave:"Save",itemClose:"Close"},zh:true,"zh-tw":true,tr:true,th:true,sv:true,sl:true,sk:true,ru:true,ro:true,pt:true,"pt-pt":true,pl:true,nl:true,nb:true,ko:true,kk:true,ja:true,it:true,hu:true,he:true,fr:true,fi:true,es:true,el:true,de:true,da:true,cs:true,ca:true,ar:true});define("text!dijit/templates/TooltipDialog.html",function(){return'<div role="presentation" tabIndex="-1">\n\t<div class="dijitTooltipContainer" role="presentation">\n\t\t<div class ="dijitTooltipContents dijitTooltipFocusNode" dojoAttachPoint="containerNode" role="dialog"></div>\n\t</div>\n\t<div class="dijitTooltipConnector" role="presentation"></div>\n</div>'});
define("dijit/TooltipDialog",["dojo","dijit","text!dijit/templates/TooltipDialog.html","dijit/layout/ContentPane","dijit/_Templated","dijit/form/_FormMixin","dijit/_DialogMixin"],function(c,g){c.declare("dijit.TooltipDialog",[g.layout.ContentPane,g._Templated,g.form._FormMixin,g._DialogMixin],{title:"",doLayout:false,autofocus:true,baseClass:"dijitTooltipDialog",_firstFocusItem:null,_lastFocusItem:null,templateString:c.cache("dijit","templates/TooltipDialog.html"),_setTitleAttr:function(a){this.containerNode.title=
a;this._set("title",a)},postCreate:function(){this.inherited(arguments);this.connect(this.containerNode,"onkeypress","_onKey")},orient:function(a,d,e){a="dijitTooltipAB"+(e.charAt(1)=="L"?"Left":"Right")+" dijitTooltip"+(e.charAt(0)=="T"?"Below":"Above");c.replaceClass(this.domNode,a,this._currentOrientClass||"");this._currentOrientClass=a},focus:function(){this._getFocusItems(this.containerNode);g.focus(this._firstFocusItem)},onOpen:function(a){this.orient(this.domNode,a.aroundCorner,a.corner);this._onShow()},
onClose:function(){this.onHide()},_onKey:function(a){var d=a.target,e=c.keys;a.charOrCode===e.TAB&&this._getFocusItems(this.containerNode);var f=this._firstFocusItem==this._lastFocusItem;if(a.charOrCode==e.ESCAPE){setTimeout(c.hitch(this,"onCancel"),0);c.stopEvent(a)}else if(d==this._firstFocusItem&&a.shiftKey&&a.charOrCode===e.TAB){f||g.focus(this._lastFocusItem);c.stopEvent(a)}else if(d==this._lastFocusItem&&a.charOrCode===e.TAB&&!a.shiftKey){f||g.focus(this._firstFocusItem);c.stopEvent(a)}else a.charOrCode===
e.TAB&&a.stopPropagation()}});return g.TooltipDialog});
define("dijit/Dialog",["dojo","dijit","text!dijit/templates/Dialog.html","dojo/dnd/move","dojo/dnd/TimedMoveable","dojo/fx","dojo/window","dijit/_Widget","dijit/_Templated","dijit/_CssStateMixin","dijit/form/_FormMixin","dijit/_DialogMixin","dijit/DialogUnderlay","dijit/layout/ContentPane","i18n!dijit/nls/common","dijit/TooltipDialog"],function(c,g){c.declare("dijit._DialogBase",[g._Templated,g.form._FormMixin,g._DialogMixin,g._CssStateMixin],{templateString:c.cache("dijit","templates/Dialog.html"),
baseClass:"dijitDialog",cssStateNodes:{closeButtonNode:"dijitDialogCloseIcon"},attributeMap:c.delegate(g._Widget.prototype.attributeMap,{title:[{node:"titleNode",type:"innerHTML"},{node:"titleBar",type:"attribute"}],"aria-describedby":""}),open:false,duration:g.defaultDuration,refocus:true,autofocus:true,_firstFocusItem:null,_lastFocusItem:null,doLayout:false,draggable:true,"aria-describedby":"",postMixInProperties:function(){var a=c.i18n.getLocalization("dijit","common");c.mixin(this,a);this.inherited(arguments)},
postCreate:function(){c.style(this.domNode,{display:"none",position:"absolute"});c.body().appendChild(this.domNode);this.inherited(arguments);this.connect(this,"onExecute","hide");this.connect(this,"onCancel","hide");this._modalconnects=[]},onLoad:function(){this._position();if(this.autofocus&&g._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);g.focus(this._firstFocusItem)}this.inherited(arguments)},_endDrag:function(a){if(a&&a.node&&a.node===this.domNode)this._relativePosition=
c.position(a.node)},_setup:function(){var a=this.domNode;if(this.titleBar&&this.draggable){this._moveable=c.isIE==6?new c.dnd.TimedMoveable(a,{handle:this.titleBar}):new c.dnd.Moveable(a,{handle:this.titleBar,timeout:0});this._dndListener=c.subscribe("/dnd/move/stop",this,"_endDrag")}else c.addClass(a,"dijitDialogFixed");this.underlayAttrs={dialogId:this.id,"class":c.map(this["class"].split(/\s/),function(d){return d+"_underlay"}).join(" ")}},_size:function(){this._checkIfSingleChild();if(this._singleChild){if(this._singleChildOriginalStyle)this._singleChild.domNode.style.cssText=
this._singleChildOriginalStyle;delete this._singleChildOriginalStyle}else c.style(this.containerNode,{width:"auto",height:"auto"});var a=c._getMarginSize(this.domNode),d=c.window.getBox();if(a.w>=d.w||a.h>=d.h){var e=Math.min(a.w,Math.floor(d.w*0.75));a=Math.min(a.h,Math.floor(d.h*0.75));if(this._singleChild&&this._singleChild.resize){this._singleChildOriginalStyle=this._singleChild.domNode.style.cssText;this._singleChild.resize({w:e,h:a})}else c.style(this.containerNode,{width:e+"px",height:a+"px",
overflow:"auto",position:"relative"})}else this._singleChild&&this._singleChild.resize&&this._singleChild.resize()},_position:function(){if(!c.hasClass(c.body(),"dojoMove")){var a=this.domNode,d=c.window.getBox(),e=this._relativePosition,f=e?null:c._getBorderBox(a),i=Math.floor(d.l+(e?e.x:(d.w-f.w)/2));d=Math.floor(d.t+(e?e.y:(d.h-f.h)/2));c.style(a,{left:i+"px",top:d+"px"})}},_onKey:function(a){if(a.charOrCode){var d=c.keys,e=a.target;a.charOrCode===d.TAB&&this._getFocusItems(this.domNode);var f=
this._firstFocusItem==this._lastFocusItem;if(e==this._firstFocusItem&&a.shiftKey&&a.charOrCode===d.TAB){f||g.focus(this._lastFocusItem);c.stopEvent(a)}else if(e==this._lastFocusItem&&a.charOrCode===d.TAB&&!a.shiftKey){f||g.focus(this._firstFocusItem);c.stopEvent(a)}else{for(;e;){if(e==this.domNode||c.hasClass(e,"dijitPopup"))if(a.charOrCode==d.ESCAPE)this.onCancel();else return;e=e.parentNode}if(a.charOrCode!==d.TAB)c.stopEvent(a);else if(!c.isOpera)try{this._firstFocusItem.focus()}catch(i){}}}},
show:function(){if(!this.open){this._started||this.startup();if(!this._alreadyInitialized){this._setup();this._alreadyInitialized=true}this._fadeOutDeferred&&this._fadeOutDeferred.cancel();this._modalconnects.push(c.connect(window,"onscroll",this,"layout"));this._modalconnects.push(c.connect(window,"onresize",this,function(){var d=c.window.getBox();if(!this._oldViewport||d.h!=this._oldViewport.h||d.w!=this._oldViewport.w){this.layout();this._oldViewport=d}}));this._modalconnects.push(c.connect(this.domNode,
"onkeypress",this,"_onKey"));c.style(this.domNode,{opacity:0,display:""});this._set("open",true);this._onShow();this._size();this._position();var a;this._fadeInDeferred=new c.Deferred(c.hitch(this,function(){a.stop();delete this._fadeInDeferred}));a=c.fadeIn({node:this.domNode,duration:this.duration,beforeBegin:c.hitch(this,function(){g._DialogLevelManager.show(this,this.underlayAttrs)}),onEnd:c.hitch(this,function(){if(this.autofocus&&g._DialogLevelManager.isTop(this)){this._getFocusItems(this.domNode);
g.focus(this._firstFocusItem)}this._fadeInDeferred.callback(true);delete this._fadeInDeferred})}).play();return this._fadeInDeferred}},hide:function(){if(this._alreadyInitialized){this._fadeInDeferred&&this._fadeInDeferred.cancel();var a;this._fadeOutDeferred=new c.Deferred(c.hitch(this,function(){a.stop();delete this._fadeOutDeferred}));a=c.fadeOut({node:this.domNode,duration:this.duration,onEnd:c.hitch(this,function(){this.domNode.style.display="none";g._DialogLevelManager.hide(this);this.onHide();
this._fadeOutDeferred.callback(true);delete this._fadeOutDeferred})}).play();if(this._scrollConnected)this._scrollConnected=false;c.forEach(this._modalconnects,c.disconnect);this._modalconnects=[];this._relativePosition&&delete this._relativePosition;this._set("open",false);return this._fadeOutDeferred}},layout:function(){if(this.domNode.style.display!="none"){g._underlay&&g._underlay.layout();this._position()}},destroy:function(){this._fadeInDeferred&&this._fadeInDeferred.cancel();this._fadeOutDeferred&&
this._fadeOutDeferred.cancel();this._moveable&&this._moveable.destroy();this._dndListener&&c.unsubscribe(this._dndListener);c.forEach(this._modalconnects,c.disconnect);g._DialogLevelManager.hide(this);this.inherited(arguments)}});c.declare("dijit.Dialog",[g.layout.ContentPane,g._DialogBase],{});g._DialogLevelManager={show:function(a,d){var e=g._dialogStack;e[e.length-1].focus=g.getFocus(a);var f=g._underlay;if(!f||f._destroyed)f=g._underlay=new g.DialogUnderlay(d);else f.set(a.underlayAttrs);var i=
e[e.length-1].dialog?e[e.length-1].zIndex+2:950;e.length==1&&f.show();c.style(g._underlay.domNode,"zIndex",i-1);c.style(a.domNode,"zIndex",i);e.push({dialog:a,underlayAttrs:d,zIndex:i})},hide:function(a){var d=g._dialogStack;if(d[d.length-1].dialog==a){d.pop();var e=d[d.length-1];if(d.length==1)g._underlay._destroyed||g._underlay.hide();else{c.style(g._underlay.domNode,"zIndex",e.zIndex-1);g._underlay.set(e.underlayAttrs)}if(a.refocus){d=e.focus;if(!d||e.dialog&&!c.isDescendant(d.node,e.dialog.domNode)){e.dialog._getFocusItems(e.dialog.domNode);
d=e.dialog._firstFocusItem}try{g.focus(d)}catch(f){}}}else{e=c.indexOf(c.map(d,function(i){return i.dialog}),a);e!=-1&&d.splice(e,1)}},isTop:function(a){var d=g._dialogStack;return d[d.length-1].dialog==a}};g._dialogStack=[{dialog:null,focus:null,underlayAttrs:null}];return g.Dialog});define("text!orion/widgets/templates/OpenResourceDialog.html",function(){return'<div dojoAttachPoint="containerNode">\n\t<div dojoAttachPoint="dialog" dojoType="dijit.Dialog" title="${title}" widgetsInTemplate="true">\n\t\t<div style="display:table">\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<label for="resourceName" style="padding-right:10">${selectFile}</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div style="display:table-cell; padding:5;">\n\t\t\t\t\t<input type="text" dojoType="dijit.form.TextBox" dojoAttachPoint="resourceName" \n\t\t\t\t\t\tplaceHolder="${searchPlaceHolder}"\n\t\t\t\t\t\tintermediateChanges="true" style="width:30em;">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="results" style="max-height:400px; height:auto; overflow-y:auto;"></div>\n\t\t\t</div>\n\t\t\t<div style="display:table-row">\n\t\t\t\t<div dojoAttachPoint="statusbar" style="display:table-cell;"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/OpenResourceDialog",["dojo","dijit","dijit/Dialog","dijit/form/TextBox","text!orion/widgets/templates/OpenResourceDialog.html"],function(c,g){return c.declare("orion.widgets.OpenResourceDialog",[g._Widget,g._Templated],{widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/OpenResourceDialog.html"),SEARCH_DELAY:500,timeoutId:null,time:null,searchLocation:null,searcher:null,constructor:function(){this.inherited(arguments);this.timeoutId=null;this.time=0;this.searchLocation=
arguments[0]&&arguments[0].SearchLocation;this.searcher=arguments[0]&&arguments[0].searcher;if(!this.searchLocation)throw new Error("Missing required argument: SearchLocation");if(!this.searcher)throw new Error("Missing required argument: searcher");},postMixInProperties:function(){this.inherited(arguments);this.title="Open Resource";this.selectFile="Type the name of a file to open (? = any character, * = any string):";this.searchPlaceHolder="Search"},postCreate:function(){this.inherited(arguments);
c.connect(this.resourceName,"onChange",this,function(){this.time=+new Date;clearTimeout(this.timeoutId);this.timeoutId=setTimeout(c.hitch(this,this.checkSearch),0)});c.connect(this.resourceName,"onKeyPress",this,function(a){if(a.keyCode===c.keys.ENTER&&this.results){a=c.query("a",this.results);if(a.length>0){window.open(a[0].href);this.dialog.hide()}}});c.connect(this.dialog,"onMouseUp",function(a){a.target.focus()});c.connect(this.dialog,"onHide",this,function(){this.onHide()});this.dialog.refocus=
false},checkSearch:function(){clearTimeout(this.timeoutId);var a=+new Date;if(a-this.time>this.SEARCH_DELAY){this.time=a;this.doSearch()}else this.timeoutId=setTimeout(c.hitch(this,arguments.callee),50)},doSearch:function(){var a=this.resourceName&&this.resourceName.get("value");if(a){c.place("<div>Searching&#x2026;</div>",this.results,"only");var d=this;setTimeout(function(){var e=a+=/\*$/.test(a)?"":"*";d.searcher.search(d.results,d.searchLocation+"Name:"+e,false,false,c.hitch(d,d.decorateResult),
true)},0)}},decorateResult:function(a){var d=this;c.query("a",a).forEach(function(e){c.connect(e,"onmouseup",function(f){!c.mouseButtons.isMiddle(f)&&!c.isCopyKey(f)&&d.dialog.hide()})})},show:function(){this.dialog.show();this.resourceName.focus()},onHide:function(){clearTimeout(this.timeoutId);setTimeout(c.hitch(this,function(){this.dialog.destroyRecursive();this.destroyRecursive()}),this.dialog.duration)}})});
define("orion/globalCommands",["dojo","dijit","orion/commands","orion/util","orion/textview/keyBinding","dijit/Menu","dijit/MenuItem","dijit/form/DropDownButton","orion/widgets/OpenResourceDialog"],function(c,g,a,d,e){function f(r,u){var s=c.byId("userInfo");if(s){c.addClass(s,"globalActions");var q=g.byId("userMenu");q&&q.destroy();c.empty(s);if(r){d.setUserName(r);q=new g.Menu({style:"display: none;",id:"userMenu"});var v=new g.MenuItem({label:"Profile",onClick:c.hitch(this,function(){window.location=
"/profile/user-profile.html#/users/"+r})});q.addChild(v);v=new g.MenuItem({label:"Sign out",onClick:logout});q.addChild(v);u=new g.form.DropDownButton({label:r,dropDown:q,title:u});c.addClass(u.domNode,"commandImage");c.place(u.domNode,s,"last")}else{u=document.createElement("span");u.appendChild(document.createTextNode("Sign in"));u.onclick=function(){login()};u.id="signOutUser";s.appendChild(u);c.addClass(u,"commandLink")}o=null}else o={userName:r,userStatusText:u}}function i(r,u,s,q){var v=c.byId("pageActions");
if(s)v=c.byId(s);if(v){c.empty(v);r.renderCommands(v,"dom",u,u,"image",null,null,!q)}}function j(r,u,s,q,v,y,x,k){var m;q=c.byId(r);if(!q)throw"could not find banner parent, id was "+r;c.place(h,q,"only");c.place('<div id="keyAssist" class="keyAssistFloat"></div>',document.body,"last");var n=c.byId("primaryNav");if(n)for(var p=u.getServiceReferences("orion.page.link"),t=0;t<p.length;t++)u.getService(p[t]).then(function(){for(var C={},F=p[t].getPropertyNames(),E=0;E<F.length;E++)C[F[E]]=p[t].getProperty(F[E]);
if(C.href&&C.name){F=c.create("a",{href:C.href},n,"last");c.addClass(F,"commandLink");m=document.createTextNode(C.name);c.place(m,F,"only")}});var w=c.byId("search");if(!w)throw"failed to generate HTML for banner";c.connect(w,"onkeypress",function(C){if(C.charOrCode===c.keys.ENTER)if(w.value.length>0)window.location="/search/search.html#"+("/filesearch?q="+w.value)});if(r=c.byId("pageTitle")){m=document.createTextNode(document.title);c.place(m,r,"last")}var z=function(C,F,E){var H=new orion.widgets.OpenResourceDialog({SearchLocation:C,
searcher:F});E&&c.connect(H,"onHide",function(){E.getTextView().focus()});window.setTimeout(function(){H.show()},0)};r=new a.Command({name:"Find File Named...",id:"eclipse.openResource",callback:function(){z("/filesearch?q=",v,x)}});if(x){x.getTextView().setKeyBinding(new e.KeyBinding("r",true,true,false),"Find File Named...");x.getTextView().setAction("Find File Named...",function(){z("/filesearch?q=",v,x);return true})}s.addCommand(r,"global");s.registerCommandContribution("eclipse.openResource",
1,"globalActions",null,new a.CommandKeyBinding("t"),true);var A=c.byId("keyAssist");c.connect(document,"onkeypress",c.hitch(this,function(C){if(C.charOrCode===c.keys.ESCAPE)A.style.display="none"}));k&&k.addHandler({isActive:function(){return A.style.display==="block"},cancel:function(){if(this.isActive()){A.style.display="none";return true}return false}});k=new a.Command({name:"Show Keys",id:"eclipse.keyAssist",callback:function(){c.empty(A);if(x){c.place("<h2>Editor</h2>",A,"last");for(var C=x.getTextView().getActions(false),
F=0;F<C.length;F++)for(var E=C[F],H=x.getTextView().getKeyBindings(E),K=0;K<H.length;K++)c.place("<span>"+d.getUserKeyString(H[K])+" = "+E+"<br></span>",A,"last")}c.place("<h2>Global</h2>",A,"last");s.showKeyBindings(A);A.style.display="block";return true}});s.addCommand(k,"global");s.registerCommandContribution("eclipse.keyAssist",1,"globalActions",null,new a.CommandKeyBinding(191,false,true),true);if(x){x.getTextView().setKeyBinding(new a.CommandKeyBinding("L",true,true),"Show Keys");x.getTextView().setAction("Show Keys",
k.callback)}if(k=c.byId("globalActions")){c.empty(k);s.renderCommands(k,"global",y||{},y,"image")}o&&f(o.userName,o.userStatusText);if(l)(y=c.byId("footer"))&&c.place(l,y,"only")}var h='<table style="border: 2px solid white; margin: 0; padding: 0; border-collapse: collapse; width: 100%;"><tr class="topRowBanner" id="bannerRow1"><td rowspan=3 style="padding-top: 12px; padding-bottom: 12px; padding-left: 8px; width: 148px"><a id="home" href="/index.html"><img class="toolbarLabel" src="/images/orion.gif" alt="Orion Logo" align="top"></a></td><td class="leftGlobalToolbar" style="padding-top: 16px"><span id="pageTitle" class="pageTitle"></span></td><td class="rightGlobalToolbar" style="padding-top: 16px"><span id="primaryNav" class="globalActions"></span><span id="globalActions" class="globalActions"></span><input type="search" id="search" class="searchbox"><span id="userInfo"></span><span id="help" class="help"><a id="help" href="/help/index.jsp">?</a></span></td></tr><tr class="topRowBanner" id="bannerRow2"><td colspan=2 style="text-wrap: normal"><span id="location" class="currentLocation" style="text-wrap: normal"></span></td></tr><tr class="topRowBanner" id="bannerRow3"><td colspan=2 style="height: 16px; text-align: left"><span id="statusPane" style="color: #5a5a5a;"></span><span id="notifications"></span></td></tr><tr class="pageToolbar"><td colspan=3 style="padding-left: 16px;" id="pageToolbar" class="pageToolbar"><span id="pageActions" class="pageActions"></span></td></tr></table>',
l='<img src="http://dev.eclipse.org/small_icons/emblems/emblem-important.png"/> This is a Beta build of Orion.  You can use it, play with it and explore the capabilities but BEWARE your data may be lost. &nbsp;| <a href="http://wiki.eclipse.org/Orion/FAQ">FAQ</a> | <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=e4&component=Orion&version=0.2">Report a Bug</a> | <a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a> | <a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a> | <a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a>',
o=null;return{generateUserInfo:f,generateDomCommandsInBanner:i,generateBanner:j}});
define("dojo/date",["dojo"],function(c){c.getObject("date",true,c);c.date.getDaysInMonth=function(g){var a=g.getMonth();if(a==1&&c.date.isLeapYear(g))return 29;return[31,28,31,30,31,30,31,31,30,31,30,31][a]};c.date.isLeapYear=function(g){g=g.getFullYear();return!(g%400)||!(g%4)&&!!(g%100)};c.date.getTimezoneName=function(g){var a=g.toString(),d="",e=a.indexOf("(");if(e>-1)d=a.substring(++e,a.indexOf(")"));else{e=/([A-Z\/]+) \d{4}$/;if(a=a.match(e))d=a[1];else{a=g.toLocaleString();e=/ ([A-Z\/]+)$/;
if(a=a.match(e))d=a[1]}}return d=="AM"||d=="PM"?"":d};c.date.compare=function(g,a,d){g=new Date(+g);a=new Date(+(a||new Date));if(d=="date"){g.setHours(0,0,0,0);a.setHours(0,0,0,0)}else if(d=="time"){g.setFullYear(0,0,0);a.setFullYear(0,0,0)}if(g>a)return 1;if(g<a)return-1;return 0};c.date.add=function(g,a,d){var e=new Date(+g),f=false,i="Date";switch(a){case "day":break;case "weekday":var j;if(a=d%5){a=a;j=parseInt(d/5)}else{a=d>0?5:-5;j=d>0?(d-5)/5:(d+5)/5}var h=g.getDay(),l=0;if(h==6&&d>0)l=1;
else if(h==0&&d<0)l=-1;h=h+a;if(h==0||h==6)l=d>0?2:-2;d=7*j+a+l;break;case "year":i="FullYear";f=true;break;case "week":d*=7;break;case "quarter":d*=3;case "month":f=true;i="Month";break;default:i="UTC"+a.charAt(0).toUpperCase()+a.substring(1)+"s"}i&&e["set"+i](e["get"+i]()+d);f&&e.getDate()<g.getDate()&&e.setDate(0);return e};c.date.difference=function(g,a,d){a=a||new Date;d=d||"day";var e=a.getFullYear()-g.getFullYear(),f=1;switch(d){case "quarter":g=g.getMonth();a=a.getMonth();g=Math.floor(g/3)+
1;a=Math.floor(a/3)+1;a+=e*4;f=a-g;break;case "weekday":e=Math.round(c.date.difference(g,a,"day"));d=parseInt(c.date.difference(g,a,"week"));f=e%7;if(f==0)e=d*5;else{var i=0,j=g.getDay();a=a.getDay();d=parseInt(e/7);f=e%7;g=new Date(g);g.setDate(g.getDate()+d*7);g=g.getDay();if(e>0)switch(true){case j==6:i=-1;break;case j==0:i=0;break;case a==6:i=-1;break;case a==0:i=-2;break;case g+f>5:i=-2}else if(e<0)switch(true){case j==6:i=0;break;case j==0:i=1;break;case a==6:i=2;break;case a==0:i=1;break;case g+
f<0:i=2}e+=i;e-=d*2}f=e;break;case "year":f=e;break;case "month":f=a.getMonth()-g.getMonth()+e*12;break;case "week":f=parseInt(c.date.difference(g,a,"day")/7);break;case "day":f/=24;case "hour":f/=60;case "minute":f/=60;case "second":f/=1E3;case "millisecond":f*=a.getTime()-g.getTime()}return Math.round(f)};return c.date});
define("dojo/cldr/supplemental",["dojo","dojo/i18n"],function(c){c.getObject("cldr.supplemental",true,c);c.cldr.supplemental.getFirstDayOfWeek=function(g){g={mv:5,ae:6,af:6,bh:6,dj:6,dz:6,eg:6,er:6,et:6,iq:6,ir:6,jo:6,ke:6,kw:6,ly:6,ma:6,om:6,qa:6,sa:6,sd:6,so:6,sy:6,tn:6,ye:6,ar:0,as:0,az:0,bw:0,ca:0,cn:0,fo:0,ge:0,gl:0,gu:0,hk:0,il:0,"in":0,jm:0,jp:0,kg:0,kr:0,la:0,mh:0,mn:0,mo:0,mp:0,mt:0,nz:0,ph:0,pk:0,sg:0,th:0,tt:0,tw:0,um:0,us:0,uz:0,vi:0,zw:0}[c.cldr.supplemental._region(g)];return g===undefined?
1:g};c.cldr.supplemental._region=function(g){g=c.i18n.normalizeLocale(g);g=g.split("-");var a=g[1];if(a){if(a.length==4)a=g[2]}else a={de:"de",en:"us",es:"es",fi:"fi",fr:"fr",he:"il",hu:"hu",it:"it",ja:"jp",ko:"kr",nl:"nl",pt:"br",sv:"se",zh:"cn"}[g[0]];return a};c.cldr.supplemental.getWeekend=function(g){var a=c.cldr.supplemental._region(g);g={"in":0,af:4,dz:4,ir:4,om:4,sa:4,ye:4,ae:5,bh:5,eg:5,il:5,iq:5,jo:5,kw:5,ly:5,ma:5,qa:5,sd:5,sy:5,tn:5}[a];a={af:5,dz:5,ir:5,om:5,sa:5,ye:5,ae:6,bh:5,eg:6,
il:6,iq:6,jo:6,kw:6,ly:6,ma:6,qa:6,sd:6,sy:6,tn:6}[a];if(g===undefined)g=6;if(a===undefined)a=0;return{start:g,end:a}};return c.cldr.supplemental});
define("dojo/regexp",["dojo"],function(c){c.getObject("regexp",true,c);c.regexp.escapeString=function(g,a){return g.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(d){if(a&&a.indexOf(d)!=-1)return d;return"\\"+d})};c.regexp.buildGroupRE=function(g,a,d){if(!(g instanceof Array))return a(g);for(var e=[],f=0;f<g.length;f++)e.push(a(g[f]));return c.regexp.group(e.join("|"),d)};c.regexp.group=function(g,a){return"("+(a?"?:":"")+g+")"};return c.regexp});
define("dojo/cldr/nls/gregorian",{root:{"months-format-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-standAlone-narrow":["1","2","3","4"],"field-weekday":"Day of the Week","dateFormatItem-yQQQ":"y QQQ","dateFormatItem-yMEd":"EEE, y-M-d","dateFormatItem-MMMEd":"E MMM d",eraNarrow:["BCE","CE"],"dateTimeFormats-appendItem-Day-Of-Week":"{0} {1}","dateFormat-long":"y MMMM d","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateTimeFormat-medium":"{1} {0}",
"dateFormatItem-EEEd":"d EEE","dayPeriods-format-wide-pm":"PM","dateFormat-full":"EEEE, y MMMM dd","dateFormatItem-Md":"M-d","dayPeriods-format-abbr-am":"AM","dateTimeFormats-appendItem-Second":"{0} ({2}: {1})","field-era":"Era","dateFormatItem-yM":"y-M","months-standAlone-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-short":"HH:mm","quarters-format-wide":["Q1","Q2","Q3","Q4"],"timeFormat-long":"HH:mm:ss z","field-year":"Year","dateFormatItem-yMMM":"y MMM","dateFormatItem-yQ":"y Q",
"dateTimeFormats-appendItem-Era":"{0} {1}","field-hour":"Hour","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-full":"HH:mm:ss zzzz","dateTimeFormats-appendItem-Week":"{0} ({2}: {1})","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","dateFormatItem-H":"HH","months-standAlone-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"quarters-format-abbr":["Q1","Q2","Q3","Q4"],"quarters-standAlone-wide":["Q1","Q2","Q3","Q4"],"dateFormatItem-M":"L",
"days-standAlone-wide":["1","2","3","4","5","6","7"],"timeFormat-medium":"HH:mm:ss","dateFormatItem-Hm":"HH:mm","quarters-standAlone-abbr":["Q1","Q2","Q3","Q4"],eraAbbr:["BCE","CE"],"field-minute":"Minute","field-dayperiod":"Dayperiod","days-standAlone-abbr":["1","2","3","4","5","6","7"],"dateFormatItem-d":"d","dateFormatItem-ms":"mm:ss","quarters-format-narrow":["1","2","3","4"],"field-day-relative+-1":"Yesterday","dateFormatItem-h":"h a","dateTimeFormat-long":"{1} {0}","dayPeriods-format-narrow-am":"AM",
"dateFormatItem-MMMd":"MMM d","dateFormatItem-MEd":"E, M-d","dateTimeFormat-full":"{1} {0}","field-day":"Day","days-format-wide":["1","2","3","4","5","6","7"],"field-zone":"Zone","dateTimeFormats-appendItem-Day":"{0} ({2}: {1})","dateFormatItem-y":"y","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"dateFormatItem-hm":"h:mm a","dateTimeFormats-appendItem-Year":"{0} {1}","dateTimeFormats-appendItem-Hour":"{0} ({2}: {1})","dayPeriods-format-abbr-pm":"PM","days-format-abbr":["1",
"2","3","4","5","6","7"],eraNames:["BCE","CE"],"days-format-narrow":["1","2","3","4","5","6","7"],"days-standAlone-narrow":["1","2","3","4","5","6","7"],"dateFormatItem-MMM":"LLL","field-month":"Month","dateTimeFormats-appendItem-Quarter":"{0} ({2}: {1})","dayPeriods-format-wide-am":"AM","dateTimeFormats-appendItem-Month":"{0} ({2}: {1})","dateTimeFormats-appendItem-Minute":"{0} ({2}: {1})","dateFormat-short":"yyyy-MM-dd","field-second":"Second","dateFormatItem-yMMMEd":"EEE, y MMM d","dateTimeFormats-appendItem-Timezone":"{0} {1}",
"field-week":"Week","dateFormat-medium":"y MMM d","dayPeriods-format-narrow-pm":"PM","dateTimeFormat-short":"{1} {0}","dateFormatItem-Hms":"HH:mm:ss","dateFormatItem-hms":"h:mm:ss a"},ar:true,ca:true,cs:true,da:true,de:true,el:true,en:true,"en-au":true,"en-ca":true,"en-gb":true,es:true,fi:true,fr:true,"fr-ch":true,he:true,hu:true,it:true,ja:true,ko:true,nb:true,nl:true,pl:true,pt:true,"pt-pt":true,ro:true,ru:true,sk:true,sl:true,sv:true,th:true,tr:true,zh:true,"zh-hant":true,"zh-hk":true,"zh-tw":true});
define("dojo/cldr/nls/en/gregorian",{"dateFormatItem-yM":"M/y","field-dayperiod":"AM/PM","dateFormatItem-yQ":"Q y","dayPeriods-format-wide-pm":"PM","field-minute":"Minute",eraNames:["Before Christ","Anno Domini"],"dateFormatItem-MMMEd":"E, MMM d","dateTimeFormat-full":"{1} {0}","field-day-relative+-1":"Yesterday","field-weekday":"Day of the Week","dateFormatItem-hms":"h:mm:ss a","dateFormatItem-yQQQ":"QQQ y","days-standAlone-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dateFormatItem-MMM":"LLL","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateTimeFormat-short":"{1} {0}","field-era":"Era","field-hour":"Hour","dayPeriods-format-wide-am":"AM","dateTimeFormat-medium":"{1} {0}","dateFormatItem-y":"y","timeFormat-full":"h:mm:ss a zzzz","months-standAlone-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormatItem-yMMM":"MMM y","field-day-relative+0":"Today","field-day-relative+1":"Tomorrow","days-standAlone-narrow":["S",
"M","T","W","T","F","S"],eraAbbr:["BC","AD"],"dateFormat-long":"MMMM d, y","timeFormat-medium":"h:mm:ss a","dateFormatItem-EEEd":"d EEE","field-zone":"Zone","dateFormatItem-Hm":"HH:mm","dateFormat-medium":"MMM d, y","dateFormatItem-Hms":"HH:mm:ss","quarters-standAlone-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"dateFormatItem-ms":"mm:ss","field-year":"Year","quarters-standAlone-narrow":["1","2","3","4"],"dateTimeFormat-long":"{1} {0}","field-week":"Week","months-standAlone-wide":["January",
"February","March","April","May","June","July","August","September","October","November","December"],"dateFormatItem-MMMd":"MMM d","timeFormat-long":"h:mm:ss a z","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dayPeriods-format-wide-noon":"noon","timeFormat-short":"h:mm a","field-month":"Month","quarters-format-abbr":["Q1","Q2","Q3","Q4"],"days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormatItem-M":"L","days-format-narrow":["S",
"M","T","W","T","F","S"],"field-second":"Second","field-day":"Day","dateFormatItem-MEd":"E, M/d","months-format-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormatItem-hm":"h:mm a","days-standAlone-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dateFormat-short":"M/d/yy","dateFormatItem-yMMMEd":"EEE, MMM d, y","dateFormat-full":"EEEE, MMMM d, y","dateFormatItem-Md":"M/d","dateFormatItem-yMEd":"EEE, M/d/y","months-format-wide":["January","February","March","April","May","June",
"July","August","September","October","November","December"],"dateFormatItem-d":"d","quarters-format-wide":["1st quarter","2nd quarter","3rd quarter","4th quarter"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eraNarrow:["B","A"]});
define("dojo/date/locale",["dojo","dojo/date","dojo/cldr/supplemental","dojo/regexp","dojo/string","dojo/i18n","i18n!dojo/cldr/nls/gregorian"],function(c){c.getObject("date.locale",true,c);(function(){function g(e,f,i,j){return j.replace(/([a-z])\1*/ig,function(h){var l,o,r=h.charAt(0);h=h.length;var u=["abbr","wide","narrow"];switch(r){case "G":l=f[h<4?"eraAbbr":"eraNames"][e.getFullYear()<0?0:1];break;case "y":l=e.getFullYear();switch(h){case 1:break;case 2:if(!i.fullYear){l=String(l);l=l.substr(l.length-
2);break}default:o=true}break;case "Q":case "q":l=Math.ceil((e.getMonth()+1)/3);o=true;break;case "M":l=e.getMonth();if(h<3){l=l+1;o=true}else{r=["months-format",u[h-3]].join("-");l=f[r][l]}break;case "w":l=c.date.locale._getWeekOfYear(e,0);o=true;break;case "d":l=e.getDate();o=true;break;case "D":l=c.date.locale._getDayOfYear(e);o=true;break;case "E":l=e.getDay();if(h<3){l=l+1;o=true}else{r=["days-format",u[h-3]].join("-");l=f[r][l]}break;case "a":l=e.getHours()<12?"am":"pm";l=i[l]||f["dayPeriods-format-wide-"+
l];break;case "h":case "H":case "K":case "k":o=e.getHours();switch(r){case "h":l=o%12||12;break;case "H":l=o;break;case "K":l=o%12;break;case "k":l=o||24;break}o=true;break;case "m":l=e.getMinutes();o=true;break;case "s":l=e.getSeconds();o=true;break;case "S":l=Math.round(e.getMilliseconds()*Math.pow(10,h-3));o=true;break;case "v":case "z":if(l=c.date.locale._getZone(e,true,i))break;h=4;case "Z":l=c.date.locale._getZone(e,false,i);l=[l<=0?"+":"-",c.string.pad(Math.floor(Math.abs(l)/60),2),c.string.pad(Math.abs(l)%
60,2)];if(h==4){l.splice(0,0,"GMT");l.splice(3,0,":")}l=l.join("");break;default:throw new Error("dojo.date.locale.format: invalid pattern char: "+j);}if(o)l=c.string.pad(l,h);return l})}function a(e,f,i,j){var h=function(r){return r};f=f||h;i=i||h;j=j||h;var l=e.match(/(''|[^'])+/g),o=e.charAt(0)=="'";c.forEach(l,function(r,u){if(r){l[u]=(o?i:f)(r.replace(/''/g,"'"));o=!o}else l[u]=""});return j(l.join(""))}function d(e,f,i,j){j=c.regexp.escapeString(j);i.strict||(j=j.replace(" a"," ?a"));return j.replace(/([a-z])\1*/ig,
function(h){var l;l=h.charAt(0);var o=h.length,r="",u="";if(i.strict){if(o>1)r="0{"+(o-1)+"}";if(o>2)u="0{"+(o-2)+"}"}else{r="0?";u="0{0,2}"}switch(l){case "y":l="\\d{2,4}";break;case "M":l=o>2?"\\S+?":"1[0-2]|"+r+"[1-9]";break;case "D":l="[12][0-9][0-9]|3[0-5][0-9]|36[0-6]|"+u+"[1-9][0-9]|"+r+"[1-9]";break;case "d":l="3[01]|[12]\\d|"+r+"[1-9]";break;case "w":l="[1-4][0-9]|5[0-3]|"+r+"[1-9]";break;case "E":l="\\S+";break;case "h":l="1[0-2]|"+r+"[1-9]";break;case "k":l="1[01]|"+r+"\\d";break;case "H":l=
"1\\d|2[0-3]|"+r+"\\d";break;case "K":l="1\\d|2[0-4]|"+r+"[1-9]";break;case "m":case "s":l="[0-5]\\d";break;case "S":l="\\d{"+o+"}";break;case "a":o=i.am||f["dayPeriods-format-wide-am"];r=i.pm||f["dayPeriods-format-wide-pm"];l=o+"|"+r;if(!i.strict){if(o!=o.toLowerCase())l+="|"+o.toLowerCase();if(r!=r.toLowerCase())l+="|"+r.toLowerCase();if(l.indexOf(".")!=-1)l+="|"+l.replace(/\./g,"")}l=l.replace(/\./g,"\\.");break;default:l=".*"}e&&e.push(h);return"("+l+")"}).replace(/[\xa0 ]/g,"[\\s\\xa0]")}c.date.locale._getZone=
function(e,f){return f?c.date.getTimezoneName(e):e.getTimezoneOffset()};c.date.locale.format=function(e,f){f=f||{};var i=c.i18n.normalizeLocale(f.locale),j=f.formatLength||"short";i=c.date.locale._getGregorianBundle(i);var h=[];e=c.hitch(this,g,e,i,f);if(f.selector=="year")return a(i["dateFormatItem-yyyy"]||"yyyy",e);var l;if(f.selector!="date")(l=f.timePattern||i["timeFormat-"+j])&&h.push(a(l,e));if(f.selector!="time")(l=f.datePattern||i["dateFormat-"+j])&&h.push(a(l,e));return h.length==1?h[0]:
i["dateTimeFormat-"+j].replace(/\{(\d+)\}/g,function(o,r){return h[r]})};c.date.locale.regexp=function(e){return c.date.locale._parseInfo(e).regexp};c.date.locale._parseInfo=function(e){e=e||{};var f=c.i18n.normalizeLocale(e.locale);f=c.date.locale._getGregorianBundle(f);var i=e.formatLength||"short",j=e.datePattern||f["dateFormat-"+i],h=e.timePattern||f["timeFormat-"+i];i=e.selector=="date"?j:e.selector=="time"?h:f["dateTimeFormat-"+i].replace(/\{(\d+)\}/g,function(o,r){return[h,j][r]});var l=[];
return{regexp:a(i,c.hitch(this,d,l,f,e)),tokens:l,bundle:f}};c.date.locale.parse=function(e,f){var i=/[\u200E\u200F\u202A\u202E]/g,j=c.date.locale._parseInfo(f),h=j.tokens,l=j.bundle;e=(new RegExp("^"+j.regexp.replace(i,"")+"$",j.strict?"":"i")).exec(e&&e.replace(i,""));if(!e)return null;var o=["abbr","wide","narrow"],r=[1970,0,1,0,0,0,0],u="";e=c.every(e,function(q,v){if(!v)return true;v=h[v-1];var y=v.length;switch(v.charAt(0)){case "y":if(y!=2&&f.strict)r[0]=q;else if(q<100){q=Number(q);y=""+(new Date).getFullYear();
v=y.substring(0,2)*100;y=Math.min(Number(y.substring(2,4))+20,99);r[0]=q<y?v+q:v-100+q}else{if(f.strict)return false;r[0]=q}break;case "M":if(y>2){v=l["months-format-"+o[y-3]].concat();if(!f.strict){q=q.replace(".","").toLowerCase();v=c.map(v,function(k){return k.replace(".","").toLowerCase()})}q=c.indexOf(v,q);if(q==-1)return false}else q--;r[1]=q;break;case "E":case "e":v=l["days-format-"+o[y-3]].concat();if(!f.strict){q=q.toLowerCase();v=c.map(v,function(k){return k.toLowerCase()})}q=c.indexOf(v,
q);if(q==-1)return false;break;case "D":r[1]=0;case "d":r[2]=q;break;case "a":v=f.am||l["dayPeriods-format-wide-am"];y=f.pm||l["dayPeriods-format-wide-pm"];if(!f.strict){var x=/\./g;q=q.replace(x,"").toLowerCase();v=v.replace(x,"").toLowerCase();y=y.replace(x,"").toLowerCase()}if(f.strict&&q!=v&&q!=y)return false;u=q==y?"p":q==v?"a":"";break;case "K":if(q==24)q=0;case "h":case "H":case "k":if(q>23)return false;r[3]=q;break;case "m":r[4]=q;break;case "s":r[5]=q;break;case "S":r[6]=q}return true});
i=+r[3];if(u==="p"&&i<12)r[3]=i+12;else if(u==="a"&&i==12)r[3]=0;i=new Date(r[0],r[1],r[2],r[3],r[4],r[5],r[6]);f.strict&&i.setFullYear(r[0]);var s=h.join("");j=s.indexOf("d")!=-1;s=s.indexOf("M")!=-1;if(!e||s&&i.getMonth()>r[1]||j&&i.getDate()>r[2])return null;if(s&&i.getMonth()<r[1]||j&&i.getDate()<r[2])i=c.date.add(i,"hour",1);return i}})();(function(){var g=[];c.date.locale.addCustomFormats=function(a,d){g.push({pkg:a,name:d})};c.date.locale._getGregorianBundle=function(a){var d={};c.forEach(g,
function(e){e=c.i18n.getLocalization(e.pkg,e.name,a);d=c.mixin(d,e)},this);return d}})();c.date.locale.addCustomFormats("dojo.cldr","gregorian");c.date.locale.getNames=function(g,a,d,e){var f;e=c.date.locale._getGregorianBundle(e);g=[g,d,a];if(d=="standAlone"){d=g.join("-");f=e[d];if(f[0]==1)f=undefined}g[1]="format";return(f||e[g.join("-")]).concat()};c.date.locale.isWeekend=function(g,a){a=c.cldr.supplemental.getWeekend(a);g=(g||new Date).getDay();if(a.end<a.start){a.end+=7;if(g<a.start)g+=7}return g>=
a.start&&g<=a.end};c.date.locale._getDayOfYear=function(g){return c.date.difference(new Date(g.getFullYear(),0,1,g.getHours()),g)+1};c.date.locale._getWeekOfYear=function(g,a){if(arguments.length==1)a=0;var d=(new Date(g.getFullYear(),0,1)).getDay(),e=(d-a+7)%7;e=Math.floor((c.date.locale._getDayOfYear(g)+e-1)/7);d==a&&e++;return e};return c.date.locale});
define("orion/auth",["dojo","orion/globalCommands","dojo/date/locale"],function(c,g){function a(l,o,r,u){i(o.xhr,function(){var s=c.xhrGet(l);r&&s.then(r,u)})}function d(l,o){i(o.xhr,function(){c.xhrPost(l)})}function e(l,o){i(o.xhr,function(){c.xhrDelete(l)})}function f(l,o){i(o.xhr,function(){c.xhrPut(l)})}function i(l,o){if(l.status===403){if(h==null)h=new dijit.Dialog({title:"Forbidden access"});h.set("content",l.message);h.show()}if(l.status===401){var r=c.subscribe("/auth",function(){o();c.unsubscribe(r)});
if(!j){j=true;eval(l.responseText)}}}var j=false,h;c.addOnLoad(function(){window.dojo=c;window.eclipse=window.eclipse||{};eclipse.globalCommandUtils=g;c.xhrGet({url:"/auth2",handleAs:"javascript",headers:{"Orion-Version":"1"}})});return{handleGetAuthenticationError:a,handlePostAuthenticationError:d,handleDeleteAuthenticationError:e,handlePutAuthenticationError:f,handleAuthenticationError:i}});
define("orion/preferences",["dojo","orion/auth"],function(c,g){function a(j,h,l){this._name=j;this._userProvider=h;this._defaultsProvider=l;this._flushPending=false;this._defaults=this._store=null}function d(j){this.location=j;this._currentPromises={}}function e(j){this.location=j;this._currentPromise=null}function f(j,h,l){h=h||"/prefs/user";l=l||"/defaults.pref";this._userProvider=new d(h);this._defaultsProvider=new e(l);this._serviceRegistration=j.registerService("orion.core.preference",this)}
a.prototype={_flush:function(){return this._userProvider.put(this._name,this._store)},_scheduleFlush:function(){if(!this._flushPending){this._flushPending=true;window.setTimeout(c.hitch(this,function(){if(this._flushPending){this._flushPending=false;this._flush()}}),0)}},keys:function(){var j,h=[];for(j in this._store)this._store.hasOwnProperty(j)&&j.charAt(0)!=="/"&&h.push(j);for(j in this._defaults)this._defaults.hasOwnProperty(j)&&!this._store.hasOwnProperty(j)&&j.charAt(0)!=="/"&&h.push(j);return h},
get:function(j){if(j.charAt(0)==="/")throw new Error("Bad character in key name: "+j);return this._store.hasOwnProperty(j)?this._store[j]:this._defaults[j]},put:function(j,h){if(j.charAt(0)==="/")throw new Error("Bad character in key name: "+j);if(this._store[j]!==h){this._store[j]=h;this._scheduleFlush()}},remove:function(j){if(j.charAt(0)==="/")throw new Error("Bad character in key name: "+j);if(this._store[j]){delete this._store[j];this._scheduleFlush();return true}return false},clear:function(){var j;
for(j in this._store)this._store.hasOwnProperty(j)&&j.charAt(0)!=="/"&&delete this._store[j];this._scheduleFlush()},sync:function(){if(this._flushPending){this._flushPending=false;return this._flush()}return this._defaultsProvider.get(this._name).then(c.hitch(this,function(j){this._defaults=j;return this._userProvider.get(this._name).then(c.hitch(this,function(h){this._store=h}))}))},flush:function(){this._flush()}};var i={get:function(j,h){j=localStorage.getItem(j);if(j==null)return null;j=JSON.parse(j);
if(h||j._expires&&j._expires>(new Date).getTime()){delete j._expires;return j}return null},set:function(j,h){h._expires=(new Date).getTime()+36E5;var l=JSON.stringify(h);localStorage.setItem(j,l);delete h._expires}};d.prototype={get:function(j){if(this._currentPromises[j])return this._currentPromises[j];var h=new c.Deferred,l="/orion/preferences/user"+j,o=i.get(l);if(o!==null)h.resolve(o);else{this._currentPromises[j]=h;var r=this;c.xhrGet({url:this.location+j,headers:{"Orion-Version":"1"},handleAs:"json",
timeout:15E3,load:function(u){i.set(l,u);delete r._currentPromises[j];h.resolve(u)},error:function(u,s){u.log=false;if(s.xhr.status===401)g.handleGetAuthenticationError(this,s);else if(s.xhr.status===404){u={};i.set(l,u);delete r._currentPromises[j];h.resolve(u)}else{delete r._currentPromises[j];h.resolve(i.get(l,true)||{})}},failOk:true})}return h},put:function(j,h){var l=new c.Deferred;i.set("/orion/preferences/user"+j,h);c.xhrPut({url:this.location+j,putData:JSON.stringify(h),headers:{"Orion-Version":"1"},
handleAs:"json",contentType:"application/json",timeout:15E3,load:function(){l.resolve()},error:function(o,r){r.xhr.status===401?g.handlePutAuthenticationError(this,r):l.resolve()}});return l}};e.prototype={get:function(j){if(this._currentPromise)return this._currentPromise;var h=new c.Deferred,l=i.get("/orion/preferences/default");if(l!==null)h.resolve(l[j]||{});else{this._currentPromise=h;var o=this;c.xhrGet({url:this.location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(r){i.set("/orion/preferences/default",
r);o._currentPromise=null;h.resolve(r[j]||{})},error:function(r,u){if(u.xhr.status===401)g.handleGetAuthenticationError(u.xhr,u);else if(u.xhr.status===404){i.set("/orion/preferences/default",{});o._currentPromise=null;h.resolve({})}else{o._currentPromise=null;r=i.get("/orion/preferences/default",true);r!==null?h.resolve(r[j]||{}):h.resolve({})}}})}return h}};f.prototype={getPreferences:function(j){var h=new a(j,this._userProvider,this._defaultsProvider);return h.sync().then(function(){return h})}};
return{Preferences:a,PreferencesService:f}});
define("dojo/DeferredList",["dojo"],function(c){c.DeferredList=function(g,a,d,e){var f=[];c.Deferred.call(this);var i=this;g.length===0&&!a&&this.resolve([0,[]]);var j=0;c.forEach(g,function(h,l){function o(r,u){f[l]=[r,u];j++;j===g.length&&i.resolve(f)}h.then(function(r){a?i.resolve([l,r]):o(true,r)},function(r){d?i.reject(r):o(false,r);if(e)return null;throw r;})})};c.DeferredList.prototype=new c.Deferred;c.DeferredList.prototype.gatherResults=function(g){g=new c.DeferredList(g,false,true,false);
g.addCallback(function(a){var d=[];c.forEach(a,function(e){d.push(e[1])});return d});return g};return c.DeferredList});
define("orion/pluginregistry",["dojo","orion/serviceregistry","dojo/DeferredList"],function(c,g){var a=a||{};a.Plugin=function(d,e,f){function i(x,k,m,n){if(!r)throw new Error("plugin not connected");var p=q++;v[String(p)]=n;f.postMessage({id:p,serviceId:x,method:k,params:m},r)}function j(x){var k={};if(x.methods)for(var m=0;m<x.methods.length;m++){var n=x.methods[m];k[n]=function(p){return function(){var t=Array.prototype.slice.call(arguments),w=new c.Deferred;o._load().then(function(){i(x.serviceId,
p,t,w)});return w.promise}}(n)}return k}function h(){var x=e.services;if(x)for(var k=0;k<x.length;k++){var m=x[k],n=j(m);y[m.serviceId]=f.registerService(m.type,n,m.properties)}}function l(x){try{if(x.method)if("plugin"===x.method){if(e){if(JSON.stringify(e)!=JSON.stringify(x.params[0])){for(var k in y)if(y.hasOwnProperty(k)){y[k].unregister();delete y[k]}e=x.params[0];h();f.updatePlugin(o)}}else{e=x.params[0];h()}if(!s){s=true;u.resolve(o)}}else if("dispatchEvent"===x.method){var m=y[x.serviceId];
m.dispatchEvent.apply(m,x.params)}else throw new Error("Bad response method: "+x.method);else{var n=v[String(x.id)];delete v[String(x.id)];x.error?n.reject(x.error):n.resolve(x.result)}}catch(p){console.log(p)}}var o=this,r=null,u=new c.Deferred,s=false,q=0,v={},y={};this.getLocation=function(){return d};this.getData=function(){return e};this.uninstall=function(){for(var x in y)if(y.hasOwnProperty(x)){y[x].unregister();delete y[x]}if(r){f.disconnect(r);r=null}f.uninstallPlugin(this)};this.getServiceReferences=
function(){var x=[],k;for(k in y)y.hasOwnProperty(k)&&x.push(y[k].getServiceReference());return x};this._load=function(x){if(!r){r=f.connect(d,l);window.setTimeout(function(){if(!s){if(!x){e={};f.updatePlugin(o)}u.reject(new Error("Load timeout for plugin: "+d))}},15E3)}return u.promise};if(typeof d!=="string")throw new Error("invalid url:"+d);e&&h()};a.PluginRegistry=function(d,e){function f(){var k,m,n=[];if((k=o["/orion/preferences/default"]?JSON.parse(o["/orion/preferences/default"]):null)&&k["/plugins"]){v=
k["/plugins"];for(m in v)if(v.hasOwnProperty(m)){m=h(m);k="plugin."+m;if(o[k]){k=JSON.parse(o[k]);k=new a.Plugin(m,k,x);r.push(k)}else n.push(l.installPlugin(m))}}(y=o["/orion/preferences/user/plugins"]?JSON.parse(o["/orion/preferences/user/plugins"]):null)||(y={});for(m in y)if(y.hasOwnProperty(m)&&m!=="_expires"){m=h(m);k="plugin."+m;if(o[k]){k=JSON.parse(o[k]);k=new a.Plugin(m,k,x);r.push(k)}else n.push(l.installPlugin(m))}q=new c.DeferredList(n)}function i(k){var m;o["plugin."+k.getLocation()]=
JSON.stringify(k.getData());for(m in v)if(v.hasOwnProperty(m))if(k.getLocation()===h(m))return;for(m in y)if(y.hasOwnProperty(m))if(k.getLocation()===h(m))return;y[k.getLocation()]=true;o["/orion/preferences/user/plugins"]=JSON.stringify(y)}function j(k){var m;delete o["plugin."+k.getLocation()];for(m in y)if(y.hasOwnProperty(m))if(k.getLocation()===h(m)){delete y[k.getLocation()];o["/orion/preferences/user/plugins"]=JSON.stringify(y);return}}function h(k){if(k.indexOf("://")===-1){var m=document.createElement("a");
m.href=k;return m.href}return k}var l=this,o=e||localStorage||{},r=[],u=[],s=new g.EventTarget,q,v={},y;window.addEventListener("message",function(k){for(var m=0,n=k.source;m<u.length;m++)if(n===u[m].target){u[m].handler(JSON.parse(k.data));break}},false);var x={registerService:c.hitch(d,d.registerService),connect:function(k,m){var n=document.createElement("iframe");n.id=k;n.name=k;n.style.display="none";n.style.visibility="hidden";n.src=k;document.body.appendChild(n);k={iframe:n,target:n.contentWindow,
handler:m,url:k};u.push(k);return k},disconnect:function(k){for(var m=0;m<u.length;m++)if(k===u[m]){u.splice(m,1);try{document.body.removeChild(k.iframe)}catch(n){}break}},uninstallPlugin:function(k){j(k);for(var m=0;m<r.length;m++)if(k===r[m]){r.splice(m,1);s.dispatchEvent("pluginRemoved",k);break}},updatePlugin:function(k){o["plugin."+k.getLocation()]=JSON.stringify(k.getData());s.dispatchEvent("pluginUpdated",k)},postMessage:function(k,m){m.target.postMessage(JSON.stringify(k),m.url)}};this.startup=
function(){return q.promise};this.shutdown=function(){for(var k=0;k<u.length;k++)try{document.body.removeChild(u[k].iframe)}catch(m){}};this.installPlugin=function(k,m){k=h(k);for(var n=new c.Deferred,p,t=0;t<r.length;t++)if(k===r[t].getLocation()){p=r[t];break}if(p)if(p.getData())n.resolve(p);else{var w=function(z){if(z.getLocation()===k){n.resolve(z);s.removeEventListener("pluginAdded",w)}};s.addEventListener("pluginAdded",w)}else{p=new a.Plugin(k,m,x);r.push(p);if(p.getData()){i(p);s.dispatchEvent("pluginAdded",
p);n.resolve(p)}else p._load(!!q).then(function(){i(p);s.dispatchEvent("pluginAdded",p);n.resolve(p)},function(z){n.reject(z)})}return n.promise};this.getPlugins=function(){for(var k=[],m=0;m<r.length;m++)r[m].getData()&&k.push(r[m]);return k};this.getPlugin=function(k){k=h(k);for(var m=0;m<r.length;m++)if(r[m].getData()&&k===r[m].getLocation())return r[m];return null};this.addEventListener=function(k,m){s.addEventListener(k,m)};this.removeEventListener=function(k,m){s.removeEventListener(k,m)};f()};
return a});
define("orion/status",["dojo"],function(c){function g(a,d,e){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.page.message",this);this.domId=d;this.progressDomId=e||d}g.prototype={setMessage:function(a,d){c.place(window.document.createTextNode(a),this.domId,"only");if(typeof d==="number"){var e=this;window.setTimeout(function(){var f=c.byId(e.domId);(typeof f.textContent==="string"?f.textContent:f.innerText)===a&&c.place(window.document.createTextNode(""),e.domId,"only")},
d)}},setErrorMessage:function(a){var d=a.responseText||a;try{d=JSON.parse(d)}catch(e){}a=d.Message||d;var f="red";if(d.Severity)switch(d.Severity){case "Warning":f="#FFCC00";break;case "Error":f="red";break;case "Info":case "Ok":f="green";break}d=c.create("span",{style:{color:f}});c.place(window.document.createTextNode(a),d);c.place(d,this.domId,"only")},setProgressMessage:function(a){c.place(window.document.createTextNode(a),this.progressDomId,"only")},setProgressResult:function(a){a=a.responseText||
a;try{a=JSON.parse(a)}catch(d){}var e=a.Message||a,f="/images/info.gif",i="info";if(a.Severity)switch(a.Severity){case "Warning":f="/images/warning.gif";i="warning";break;case "Error":f="/images/error.gif";i="error";break}var j=new Image;j.alt=i;j.title="Press to clear message";j.name=i;j.src=f;c.style(j,"opacity","0.7");c.connect(j,"onmouseover",this,function(){c.style(j,"opacity","1")});c.connect(j,"onmouseout",this,function(){c.style(j,"opacity","0.7")});c.connect(j,"onclick",this,function(){this.setProgressMessage("")});
c.place(j,this.progressDomId,"only");a.HTML?c.place(e,this.progressDomId,"last"):c.place(window.document.createTextNode("   "+e),this.progressDomId,"last")},showWhile:function(a,d){var e=this;e.setProgressMessage(d);return a.then(function(f){if(f&&f.Location&&f.Message&&f.Running)return e._doProgressWhile(f);e.setProgressMessage("");f&&f.Result&&e.setProgressResult(f.Result);return f})},_doProgressWhile:function(a){var d=new c.Deferred;window.setTimeout(function(){c.xhrGet({url:a.Location,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:15E3,load:function(e){d.callback(e)}})},2E3);return this.showWhile(d,a.Message)}};g.prototype.constructor=g;return{StatusReportingService:g}});
define("orion/fileClient",["dojo","orion/auth"],function(c,g){function a(d){this.fileService=d}a.prototype={setFileService:function(d){this.fileService=d},fetchChildren:function(){return this._doServiceCall("fetchChildren",arguments)},createWorkspace:function(){return this._doServiceCall("createWorkspace",arguments)},loadWorkspaces:function(){return this._doServiceCall("loadWorkspaces",arguments)},loadWorkspace:function(){return this._doServiceCall("loadWorkspace",arguments)},createProject:function(){return this._doServiceCall("createProject",
arguments)},createFolder:function(){return this._doServiceCall("createFolder",arguments)},createFile:function(){return this._doServiceCall("createFile",arguments)},deleteFile:function(){return this._doServiceCall("deleteFile",arguments)},moveFile:function(){return this._doServiceCall("moveFile",arguments)},copyFile:function(){return this._doServiceCall("copyFile",arguments)},read:function(){return this._doServiceCall("read",arguments)},write:function(){return this._doServiceCall("write",arguments)},
remoteImport:function(){return this._doServiceCall("remoteImport",arguments)},remoteExport:function(){return this._doServiceCall("remoteExport",arguments)},_doServiceCall:function(d,e){var f=new c.Deferred,i=this.fileService;i[d].apply(i,e).then(function(j){f.callback(j)},function(j){j.status===401||j.status===403?g.handleAuthenticationError(j,function(){i[d].apply(i,e).then(function(h){f.callback(h)},function(h){f.errback(h)})}):f.errback(j)});return f}};a.prototype.constructor=a;return{FileClient:a}});
define("dojo/cookie",["dojo","dojo/regexp"],function(c){c.cookie=function(g,a,d){var e=document.cookie;if(arguments.length==1){var f=e.match(new RegExp("(?:^|; )"+c.regexp.escapeString(g)+"=([^;]*)"));return f?decodeURIComponent(f[1]):undefined}else{d=d||{};e=d.expires;if(typeof e=="number"){var i=new Date;i.setTime(i.getTime()+e*24*60*60*1E3);e=d.expires=i}if(e&&e.toUTCString)d.expires=e.toUTCString();a=encodeURIComponent(a);e=g+"="+a;for(f in d){e+="; "+f;i=d[f];if(i!==true)e+="="+i}document.cookie=
e}};c.cookie.isSupported=function(){if(!("cookieEnabled"in navigator)){this("__djCookieTest__","CookiesAllowed");navigator.cookieEnabled=this("__djCookieTest__")=="CookiesAllowed";navigator.cookieEnabled&&this("__djCookieTest__","",{expires:-1})}return navigator.cookieEnabled};return c.cookie});
define("dijit/layout/BorderContainer",["dojo","dijit","dijit/layout/_LayoutWidget","dojo/cookie","dijit/_Templated"],function(c,g){c.declare("dijit.layout.BorderContainer",g.layout._LayoutWidget,{design:"headline",gutters:true,liveSplitters:true,persist:false,baseClass:"dijitBorderContainer",_splitterClass:"dijit.layout._Splitter",postMixInProperties:function(){this.gutters||(this.baseClass+="NoGutter");this.inherited(arguments)},startup:function(){if(!this._started){c.forEach(this.getChildren(),
this._setupChild,this);this.inherited(arguments)}},_setupChild:function(a){var d=a.region;if(d){this.inherited(arguments);c.addClass(a.domNode,this.baseClass+"Pane");var e=this.isLeftToRight();if(d=="leading")d=e?"left":"right";if(d=="trailing")d=e?"right":"left";if(d!="center"&&(a.splitter||this.gutters)&&!a._splitterWidget){var f=c.getObject(a.splitter?this._splitterClass:"dijit.layout._Gutter");e=new f({id:a.id+"_splitter",container:this,child:a,region:d,live:this.liveSplitters});e.isSplitter=
true;a._splitterWidget=e;c.place(e.domNode,a.domNode,"after");e.startup()}a.region=d}},layout:function(){this._layoutChildren()},addChild:function(){this.inherited(arguments);this._started&&this.layout()},removeChild:function(a){var d=a.region,e=a._splitterWidget;if(e){e.destroy();delete a._splitterWidget}this.inherited(arguments);this._started&&this._layoutChildren();c.removeClass(a.domNode,this.baseClass+"Pane");c.style(a.domNode,{top:"auto",bottom:"auto",left:"auto",right:"auto",position:"static"});
c.style(a.domNode,d=="top"||d=="bottom"?"width":"height","auto")},getChildren:function(){return c.filter(this.inherited(arguments),function(a){return!a.isSplitter})},getSplitter:function(a){return c.filter(this.getChildren(),function(d){return d.region==a})[0]._splitterWidget},resize:function(){if(!this.cs||!this.pe){var a=this.domNode;this.cs=c.getComputedStyle(a);this.pe=c._getPadExtents(a,this.cs);this.pe.r=c._toPixelValue(a,this.cs.paddingRight);this.pe.b=c._toPixelValue(a,this.cs.paddingBottom);
c.style(a,"padding","0px")}this.inherited(arguments)},_layoutChildren:function(a,d){if(this._borderBox&&this._borderBox.h){var e=c.map(this.getChildren(),function(i,j){return{pane:i,weight:[i.region=="center"?Infinity:0,i.layoutPriority,(this.design=="sidebar"?1:-1)*(/top|bottom/.test(i.region)?1:-1),j]}},this);e.sort(function(i,j){i=i.weight;j=j.weight;for(var h=0;h<i.length;h++)if(i[h]!=j[h])return i[h]-j[h];return 0});var f=[];c.forEach(e,function(i){i=i.pane;f.push(i);i._splitterWidget&&f.push(i._splitterWidget)});
g.layout.layoutChildren(this.domNode,{l:this.pe.l,t:this.pe.t,w:this._borderBox.w-this.pe.w,h:this._borderBox.h-this.pe.h},f,a,d)}},destroyRecursive:function(){c.forEach(this.getChildren(),function(a){var d=a._splitterWidget;d&&d.destroy();delete a._splitterWidget});this.inherited(arguments)}});c.extend(g._Widget,{region:"",layoutPriority:0,splitter:false,minSize:0,maxSize:Infinity});c.declare("dijit.layout._Splitter",[g._Widget,g._Templated],{live:true,templateString:'<div class="dijitSplitter" dojoAttachEvent="onkeypress:_onKeyPress,onmousedown:_startDrag,onmouseenter:_onMouse,onmouseleave:_onMouse" tabIndex="0" role="separator"><div class="dijitSplitterThumb"></div></div>',
postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region);this._factor=/top|left/.test(this.region)?1:-1;this._cookieName=this.container.id+"_"+this.region},buildRendering:function(){this.inherited(arguments);c.addClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V"));if(this.container.persist){var a=c.cookie(this._cookieName);if(a)this.child.domNode.style[this.horizontal?"height":"width"]=a}},_computeMaxSize:function(){var a=this.horizontal?"h":
"w",d=c.marginBox(this.child.domNode)[a],e=c.filter(this.container.getChildren(),function(f){return f.region=="center"})[0];a=c.marginBox(e.domNode)[a];return Math.min(this.child.maxSize,d+a)},_startDrag:function(a){if(!this.cover){this.cover=c.doc.createElement("div");c.addClass(this.cover,"dijitSplitterCover");c.place(this.cover,this.child.domNode,"after")}c.addClass(this.cover,"dijitSplitterCoverActive");this.fake&&c.destroy(this.fake);if(!(this._resize=this.live)){(this.fake=this.domNode.cloneNode(true)).removeAttribute("id");
c.addClass(this.domNode,"dijitSplitterShadow");c.place(this.fake,this.domNode,"after")}c.addClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active");if(this.fake)c.removeClass(this.fake,"dijitSplitterHover dijitSplitter"+(this.horizontal?"H":"V")+"Hover");var d=this._factor,e=this.horizontal,f=e?"pageY":"pageX",i=a[f],j=this.domNode.style;e=e?"h":"w";var h=c.marginBox(this.child.domNode)[e],l=this._computeMaxSize(),o=this.child.minSize||20;e=this.region;var r=e==
"top"||e=="bottom"?"top":"left",u=parseInt(j[r],10),s=this._resize,q=c.hitch(this.container,"_layoutChildren",this.child.id);e=c.doc;this._handlers=(this._handlers||[]).concat([c.connect(e,"onmousemove",this._drag=function(v,y){v=v[f]-i;var x=d*v+h,k=Math.max(Math.min(x,l),o);if(s||y)q(k);j[r]=v+u+d*(k-x)+"px"}),c.connect(e,"ondragstart",c.stopEvent),c.connect(c.body(),"onselectstart",c.stopEvent),c.connect(e,"onmouseup",this,"_stopDrag")]);c.stopEvent(a)},_onMouse:function(a){a=a.type=="mouseover"||
a.type=="mouseenter";c.toggleClass(this.domNode,"dijitSplitterHover",a);c.toggleClass(this.domNode,"dijitSplitter"+(this.horizontal?"H":"V")+"Hover",a)},_stopDrag:function(a){try{this.cover&&c.removeClass(this.cover,"dijitSplitterCoverActive");this.fake&&c.destroy(this.fake);c.removeClass(this.domNode,"dijitSplitterActive dijitSplitter"+(this.horizontal?"H":"V")+"Active dijitSplitterShadow");this._drag(a);this._drag(a,true)}finally{this._cleanupHandlers();delete this._drag}if(this.container.persist)c.cookie(this._cookieName,
this.child.domNode.style[this.horizontal?"height":"width"],{expires:365})},_cleanupHandlers:function(){c.forEach(this._handlers,c.disconnect);delete this._handlers},_onKeyPress:function(a){this._resize=true;var d=this.horizontal,e=1,f=c.keys;switch(a.charOrCode){case d?f.UP_ARROW:f.LEFT_ARROW:e*=-1;case d?f.DOWN_ARROW:f.RIGHT_ARROW:break;default:return}d=c._getMarginSize(this.child.domNode)[d?"h":"w"]+this._factor*e;this.container._layoutChildren(this.child.id,Math.max(Math.min(d,this._computeMaxSize()),
this.child.minSize));c.stopEvent(a)},destroy:function(){this._cleanupHandlers();delete this.child;delete this.container;delete this.cover;delete this.fake;this.inherited(arguments)}});c.declare("dijit.layout._Gutter",[g._Widget,g._Templated],{templateString:'<div class="dijitGutter" role="presentation"></div>',postMixInProperties:function(){this.inherited(arguments);this.horizontal=/top|bottom/.test(this.region)},buildRendering:function(){this.inherited(arguments);c.addClass(this.domNode,"dijitGutter"+
(this.horizontal?"H":"V"))}});return g.layout.BorderContainer});
define("orion/searchClient",["dojo","dijit","orion/auth","orion/util","dijit/form/Button","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(c,g,a,d){function e(f){this.registry=f.serviceRegistry}e.prototype={search:function(f,i,j,h,l,o){c.xhrGet({url:i,handleAs:"json",headers:{Accept:"application/json","Orion-Version":"1"},sync:false,timeout:15E3,error:c.hitch(this,function(r,u){this.handleError(r,f);a.handleGetAuthenticationError(this,u,c.hitch(this,this.showSearchResult),c.hitch(this,
function(s){this.handleError(s,f)}));return r}),load:c.hitch(this,function(r){this.showSearchResult(f,i,j,h,l,o,r)})})},handleError:function(f,i){console.error(f);var j=document.createTextNode(f);c.place(j,i,"only");return f},saveSearch:function(f,i){this.registry.getService("orion.core.favorite").then(function(j){j.addFavoriteSearch(f,i)})},formatHighlight:function(f){f=f.split(/(##match|match##)/);for(var i=c.create("div"),j,h=0;h<f.length;h++){var l=f[h];if(l==="##match")j=c.create("b");else if(l===
"match##"){c.place(j,i,"last");j=null}else c.place(document.createTextNode(l),j||i,"last")}return i},showSearchResult:function(f,i,j,h,l,o,r){i=window.location.href.split("#")[0];var u=i.substring(0,i.length-window.location.pathname.length),s=false;c.empty(f);i=r.responseHeader.params.q;i=i.substring(i.indexOf("}")+1);if(r.response.numFound>0){for(var q=document.createElement("table"),v=0;v<r.response.docs.length;v++){var y=r.response.docs[v];if(!y.Directory&&y.Location!==j){var x;if(!s){s=true;if(h){x=
q.insertRow(0).insertCell(0);x.innerHTML="<h2>Search Results</h2>"}}x=q.insertRow(-1).insertCell(0);x.colspan=2;var k=document.createElement("a");c.place(document.createTextNode(y.Name),k);y.LineNumber&&c.place(document.createTextNode(" (Line "+y.LineNumber+")"),k);var m;m=i&&y.LineNumber?u+"/edit/edit.html#"+d.hashFromPosition(y.Location,null,null,y.LineNumber,y.Offset,i.length):u+"/edit/edit.html#"+y.Location;k.setAttribute("href",m);x.appendChild(k);if(!o&&r.highlighting&&r.highlighting[y.Id]&&
r.highlighting[y.Id].Text){y=r.highlighting[y.Id].Text[0];x=q.insertRow(-1).insertCell(0);x.colspan=2;c.place(this.formatHighlight(y),x,"only")}}}c.place(q,f,"last");typeof l==="function"&&l(f)}if(!s){f=c.place("<div>No matches found for </div>",f,"only");f=c.create("b",null,f,"last");c.place(document.createTextNode(i),f,"only")}}};e.prototype.constructor=e;return{Searcher:e}});
define("orion/git/gitClient",["dojo","orion/auth"],function(c,g){var a=a||{};a.GitService=function(){function d(e){if(e){this._serviceRegistry=e;this._serviceRegistration=e.registerService("orion.git.provider",this);var f=this;e.getService("orion.net.ssh").then(function(i){f._sshService=i})}}d.prototype={checkGitService:function(){},cloneGitRepository:function(e,f,i,j,h,l,o,r,u){var s={};if(e)s.Name=e;if(i)s.Path=i;if(f)s.GitUrl=f;s.Location=j;if(h)s.GitSshUsername=h;if(l)s.GitSshPassword=l;if(o)s.GitSshKnownHost=
o;if(r)s.GitSshPrivateKey=r;if(u)s.GitSshPassphrase=u;return c.xhrPost({url:"/gitapi/clone/",headers:{"Orion-Version":"1"},postData:c.toJson(s),handleAs:"json",timeout:15E3,load:function(q){return q},error:function(q,v){g.handleGetAuthenticationError(this,v);console.error("HTTP status code: ",v.xhr.status);return q}})},initGitRepository:function(){console.error("Not implemented yet")},removeGitRepository:function(e){return c.xhrDelete({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,
load:function(f){return f},error:function(f,i){g.handleGetAuthenticationError(this,i);console.error("HTTP status code: ",i.xhr.status);return f}})},getDiffContent:function(e,f,i){var j=this;c.xhrGet({url:e,headers:{"Orion-Version":"1"},content:{parts:"diff"},handleAs:"text",timeout:15E3,load:function(h,l){if(f)typeof f==="function"?f(h,l):j._serviceRegistration.dispatchEvent(f,h)},error:function(h,l){i&&i(h,l);g.handleGetAuthenticationError(this,l);return h}})},getDiffFileURI:function(e,f,i){c.xhrGet({url:e,
headers:{"Orion-Version":"1"},content:{parts:"uris"},handleAs:"json",timeout:15E3,load:function(j,h){if(f)typeof f==="function"?f(j,h):service._serviceRegistration.dispatchEvent(f,j)},error:function(j,h){i&&i(j,h);g.handleGetAuthenticationError(this,h);return j}})},getGitStatus:function(e,f,i){c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(j,h){if(f)typeof f==="function"?f(j,h):service._serviceRegistration.dispatchEvent(f,j)},error:function(j,h){i&&i(j,h);
g.handleGetAuthenticationError(this,h);return j}})},stage:function(e,f,i){return c.xhrPut({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(j,h){if(f)typeof f==="function"?f(j,h):service._serviceRegistration.dispatchEvent(f,j)},error:function(j,h){i&&i(j,h);g.handleGetAuthenticationError(this,h);return j}})},unstageAll:function(e,f,i,j){return c.xhrPost({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:c.toJson({Reset:f}),load:function(h,l){if(i)typeof i===
"function"?i(h,l):service._serviceRegistration.dispatchEvent(i,h)},error:function(h,l){j&&j(h,l);g.handleGetAuthenticationError(this,l);return h}})},unstage:function(e,f,i,j){return c.xhrPost({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:c.toJson({Path:f}),load:function(h,l){if(i)typeof i==="function"?i(h,l):service._serviceRegistration.dispatchEvent(i,h)},error:function(h,l){j&&j(h,l);g.handleGetAuthenticationError(this,l);return h}})},checkoutPath:function(e,f,i,j){return c.xhrPut({url:e,
headers:{"Orion-Version":"1"},putData:c.toJson({Path:f}),handleAs:"json",timeout:15E3,load:function(h,l){if(i)typeof i==="function"?i(h,l):service._serviceRegistration.dispatchEvent(i,h)},error:function(h,l){j&&j(h,l);handleGetAuthenticationError(this,l);return h}})},commitAll:function(e,f,i,j,h){c.xhrPost({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,postData:i,load:function(l,o){if(j)typeof j==="function"?j(l,o):service._serviceRegistration.dispatchEvent(j,l)},error:function(l,
o){h&&h(l,o);g.handleGetAuthenticationError(this,o);return l}})},getGitClone:function(e,f){var i=this;return c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,h){if(f)typeof f==="function"?f(j,h):i._serviceRegistration.dispatchEvent(f,j)},error:function(j,h){g.handleGetAuthenticationError(this,h);console.error("HTTP status code: ",h.xhr.status)}})},getGitCloneConfig:function(e){return c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,
load:function(f){return f},error:function(f,i){g.handleGetAuthenticationError(this,i);console.error("HTTP status code: ",i.xhr.status)}})},getGitBranch:function(e){return c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(f){return f},error:function(f,i){g.handleGetAuthenticationError(this,i);console.error("HTTP status code: ",i.xhr.status)}})},getGitRemote:function(e){return c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(f){return f},
error:function(f,i){g.handleGetAuthenticationError(this,i);console.error("HTTP status code: ",i.xhr.status)}})},checkoutBranch:function(e,f){return c.xhrPut({url:e,headers:{"Orion-Version":"1"},putData:c.toJson({Branch:f}),handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){g.handleGetAuthenticationError(this,j);console.error("HTTP status code: ",j.xhr.status);return i}})},resetIndex:function(e,f){return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({Commit:f,
Reset:"HARD"}),handleAs:"json",timeout:5E3,load:function(i){return i},error:function(i,j){g.handleGetAuthenticationError(this,j);console.error("HTTP status code: ",j.xhr.status)}})},addBranch:function(e,f,i){var j={};if(f)j.Name=f;if(i)j.Branch=i;return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson(j),handleAs:"json",timeout:5E3,load:function(h){return h},error:function(h,l){g.handleGetAuthenticationError(this,l);console.error("HTTP status code: ",l.xhr.status);return h}})},removeBranch:function(e){return c.xhrDelete({url:e,
headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(f){return f},error:function(f,i){g.handleGetAuthenticationError(this,i);console.error("HTTP status code: ",i.xhr.status);return f}})},addRemote:function(e,f,i){return c.xhrPost({url:e,headers:{"Orion-Version":"1"},putData:c.toJson({Remote:f,RemoteURI:i}),handleAs:"json",timeout:5E3,load:function(j){return j},error:function(j,h){g.handleGetAuthenticationError(this,h);console.error("HTTP status code: ",h.xhr.status);return j}})},
removeRemote:function(e){return c.xhrDelete({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(f){return f},error:function(f,i){g.handleGetAuthenticationError(this,i);console.error("HTTP status code: ",i.xhr.status);return f}})},doGitLog:function(e,f){var i=this;return c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j,h){if(f)typeof f==="function"?f(j.Children,h):i._serviceRegistration.dispatchEvent(f,j.Children);return j.Children},
error:function(j,h){g.handleGetAuthenticationError(this,h);console.error("HTTP status code: ",h.xhr.status)}})},getDiff:function(e,f,i){var j=this;c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({New:f}),handleAs:"json",timeout:5E3,load:function(h,l){if(i)typeof i==="function"?i(h,l,l):j._serviceRegistration.dispatchEvent(i,h)},error:function(h,l){g.handleGetAuthenticationError(this,l);console.error("HTTP status code: ",l.xhr.status)}})},doFetch:function(e,f,i,j,h,l,o){var r=this;
return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({Fetch:"true",GitSshUsername:i,GitSshPassword:j,GitSshKnownHost:h,GitSshPrivateKey:l,GitSshPassphrase:o}),handleAs:"json",timeout:5E3,load:function(u,s){if(f)typeof f==="function"?f(u,s,s):r._serviceRegistration.dispatchEvent(f,u)},error:function(u,s){g.handleGetAuthenticationError(this,s);console.error("HTTP status code: ",s.xhr.status)}})},doMerge:function(e,f){return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({Merge:f}),
handleAs:"json",timeout:5E3,load:function(i,j){return{jsonData:i,secondArg:j}},error:function(i,j){g.handleGetAuthenticationError(this,j);console.error("HTTP status code: ",j.xhr.status);return{error:i,ioArgs:j}}})},doPush:function(e,f,i,j,h,l,o,r){var u=this;return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({PushSrcRef:f,PushTags:true,GitSshUsername:j,GitSshPassword:h,GitSshKnownHost:l,GitSshPrivateKey:o,GitSshPassphrase:r}),handleAs:"json",timeout:5E3,load:function(s,q){if(i)typeof i===
"function"?i(s,q,q):u._serviceRegistration.dispatchEvent(i,s)},error:function(s,q){g.handleGetAuthenticationError(this,q);console.error("HTTP status code: ",q.xhr.status);return s}})},getLog:function(e,f,i){var j=this;return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({New:f}),handleAs:"json",timeout:5E3,load:function(h,l){return l.xhr.getResponseHeader("Location")},error:function(h,l){g.handleGetAuthenticationError(this,l);console.error("HTTP status code: ",l.xhr.status)}}).then(function(h){c.xhrGet({url:h,
headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(l,o){if(i)typeof i==="function"?i(l.Children,o):j._serviceRegistration.dispatchEvent(i,l.Children);return l.Children},error:function(l,o){g.handleGetAuthenticationError(this,o);console.error("HTTP status code: ",o.xhr.status)}})})},getDefaultRemoteBranch:function(e,f){var i=this;c.xhrGet({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(j){return j},error:function(j,h){g.handleGetAuthenticationError(this,
h);console.error("HTTP status code: ",h.xhr.status)}}).then(function(j){if(j.Children[0]==null)return null;c.xhrGet({url:j.Children[0].Location,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(h,l){if(f)typeof f==="function"?f(h.Children[0],l):i._serviceRegistration.dispatchEvent(f,h.Children[0]);return h},error:function(h,l){g.handleGetAuthenticationError(this,l);console.error("HTTP status code: ",l.xhr.status)}})})},doAddTag:function(e,f,i){var j=this;return c.xhrPut({url:e,
headers:{"Orion-Version":"1"},putData:c.toJson({Name:f}),handleAs:"json",timeout:5E3,load:function(h,l){if(i)typeof i==="function"?i(h,l,l):j._serviceRegistration.dispatchEvent(i,h)},error:function(h,l){g.handleGetAuthenticationError(this,l);console.error("HTTP status code: ",l.xhr.status)}})},addCloneConfigurationProperty:function(e,f,i,j,h){return c.xhrPost({url:e,headers:{"Orion-Version":"1"},postData:c.toJson({Key:f,Value:i}),handleAs:"json",timeout:15E3,load:function(l,o){if(j)typeof j==="function"?
j(l,o):service._serviceRegistration.dispatchEvent(j,l)},error:function(l,o){h&&h(l,o);g.handleGetAuthenticationError(this,o);return l}})},editCloneConfigurationProperty:function(e,f,i,j){return c.xhrPut({url:e,headers:{"Orion-Version":"1"},putData:c.toJson({Value:f}),handleAs:"json",timeout:15E3,load:function(h,l){if(i)typeof i==="function"?i(h,l):service._serviceRegistration.dispatchEvent(i,h)},error:function(h,l){j&&j(h,l);g.handleGetAuthenticationError(this,l);return h}})},deleteCloneConfigurationProperty:function(e,
f,i){return c.xhrDelete({url:e,headers:{"Orion-Version":"1"},handleAs:"json",timeout:15E3,load:function(j,h){if(f)typeof f==="function"?f(j,h):service._serviceRegistration.dispatchEvent(f,j)},error:function(j,h){i&&i(j,h);g.handleGetAuthenticationError(this,h);return j}})}};return d}();return a});
define("orion/compare/diff-provider",["dojo","orion/auth"],function(c,g){var a=a||{};a.DiffProvider=function(){function d(e){if(e)this._serviceRegistry=e}d.prototype={getDiffContent:function(e,f,i){var j=this;c.xhrGet({url:e,headers:{"Orion-Version":"1"},content:{parts:"diff"},handleAs:"text",timeout:15E3,load:function(h,l){if(f)typeof f==="function"?f(h,l):j._serviceRegistration.dispatchEvent(f,h)},error:function(h,l){i&&i(h,l);g.handleGetAuthenticationError(this,l);return h}})},getDiffFileURI:function(e,
f,i){c.xhrGet({url:e,headers:{"Orion-Version":"1"},content:{parts:"uris"},handleAs:"json",timeout:15E3,load:function(j,h){if(f)typeof f==="function"?f(j,h):service._serviceRegistration.dispatchEvent(f,j)},error:function(j,h){i&&i(j,h);g.handleGetAuthenticationError(this,h);return j}})}};return d}();return a});
define("orion/compare/diff-parser",[],function(){var c=c||{};c.DiffParser=function(){function g(d){this._lineDelimiter=d?d:a?"\r\n":"\n"}var a=navigator.platform.indexOf("Win")!==-1;g.prototype={_init:function(){this._oFileContents=[];this._diffContents=[];this._oBlocks=[];this._nBlocks=[];this._hunkRanges=[];this._lastToken=" ";this._deltaMap=[];this._nFileContents=[];this._nNewLineAtEnd=this._oNewLineAtEnd=true;this._diffContentIndex=1},setLineDelim:function(d){this._lineDelimiter=d},getDiffArray:function(){return{array:this._diffContents,
index:this._diffContentIndex}},parse:function(d,e,f,i){this._init();if(e==="")return{outPutFile:d,mapper:[]};this._oFileContents=d===""?[]:d.split(this._lineDelimiter);this._diffContents=e.split(this._lineDelimiter);e=this._diffContents.length;this._hunkRanges=[];for(var j=0;j<e;j++){var h=this._parseHunkRange(j);h&&this._hunkRanges.push(h)}if(0===this._hunkRanges.length)return{outPutFile:d,mapper:[]};for(d=0;d<this._hunkRanges.length;d++)this._parsehunkBlock(d);this._buildMap(f);if(i===undefined||
!i)this._buildNewFile();return{outPutFile:this._nFileContents.join(this._lineDelimiter),mapper:this._deltaMap}},_logMap:function(){for(var d=0;d<this._deltaMap.length;d++)console.log(JSON.stringify(this._deltaMap[d]))},_logNewFile:function(){for(var d=0;d<this._nFileContents.length;d++)console.log(this._nFileContents[d])},_createBlock:function(d,e,f,i){if(!(i===f&&d===" ")){f=[f,i-f,"s"];if(d==="-")f[2]="r";else if(d==="+")f[2]="a";else if(d==="c")f[2]="c";e.push(f)}},_createMinusBlock:function(d,
e,f){var i=this._oBlocks.length;if(i===0||d!==this._oBlocks[i-1][0]){this._oBlocks.push([d===0?1:d,f]);this._nBlocks.push([e,0,-2])}else this._oBlocks[i-1][1]+=f},_createPlusBlock:function(d,e,f,i){var j=this._nBlocks.length;if(j===0||e!==this._nBlocks[j-1][0]){this._oBlocks.push([d===0?1:d,0]);this._nBlocks.push([e,f,i])}else{this._nBlocks[j-1][1]+=f;this._nBlocks[j-1][2]=i}},_parsehunkBlock:function(d){for(var e=" ",f=this._hunkRanges[d][0]+1,i=d===this._hunkRanges.length-1?this._diffContents.length:
this._hunkRanges[d+1][0],j=0,h=0,l=this._hunkRanges[d][1],o=this._hunkRanges[d][3],r=f,u=f;u<i;u++)if(0!==this._diffContents[u].length){var s=this._diffContents[u][0];if(s==="\\")if("\\ No newline at end of file"===this._diffContents[u].substring(0,this._diffContents[u].length-1)||"\\ No newline at end of file"===this._diffContents[u]){e==="-"?(this._oNewLineAtEnd=false):(this._nNewLineAtEnd=false);if(u>f&&"\r"===this._diffContents[u-1].substring(this._diffContents[u-1].length-1))this._diffContents[u-
1]=this._diffContents[u-1].substring(0,this._diffContents[u-1].length-1);continue}switch(s){case "-":case "+":case " ":break;default:continue}if(e!==s){if(s==="+")r=u;switch(e){case " ":l=this._hunkRanges[d][1]+j;o=this._hunkRanges[d][3]+h;break;case "-":this._createMinusBlock(l,o,this._hunkRanges[d][1]+j-l);break;case "+":this._createPlusBlock(l,o,this._hunkRanges[d][3]+h-o,r);break;default:}e=s}switch(s){case "-":j++;break;case "+":h++;break;case " ":j++;h++;break}}switch(e){case "-":this._createMinusBlock(l,
o,this._hunkRanges[d][1]+j-l);break;case "+":this._createPlusBlock(l,o,this._hunkRanges[d][3]+h-o,r);break}},_detectConflictes:function(d,e){if(d<0)return false;e=d+e;for(d=d;d<e;d++){var f=this._diffContents[d];if(f.indexOf("<<<<<")>-1||f.indexOf(">>>>>")>-1)return true}return false},_buildMap:function(d){for(var e=this._oBlocks.length,f=this._oFileContents.length,i=0,j=1,h=0;h<e;h++){j=this._oBlocks[h][0]-j;if(j>0){this._deltaMap.push([j,j,0]);i+=j}d&&this._detectConflictes(this._nBlocks[h][2],
this._nBlocks[h][1])?this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],this._nBlocks[h][2]+1,1]):this._deltaMap.push([this._nBlocks[h][1],this._oBlocks[h][1],this._nBlocks[h][2]+1]);i+=this._oBlocks[h][1];j=this._oBlocks[h][0]+this._oBlocks[h][1]}if(0<f-j){this._deltaMap.push([f-j+1,f-j+1,0]);i+=f-j+1}if(i<f){j=f-i;d=this._deltaMap[this._deltaMap.length-1];if(d[2]===0){d[0]+=j;d[1]+=j}else if(d[2]===-1)this._deltaMap.push([j,j,0]);else d[1]+=j}},_buildNewFile:function(){for(var d=1,e=false,
f=this._deltaMap.length,i=0;i<f;i++){e=false;if(this._deltaMap[i][2]===0){for(var j=0;j<this._deltaMap[i][0];j++)this._nFileContents.push(this._oFileContents[d+j-1]);e=true}else if(this._deltaMap[i][2]>0)for(j=0;j<this._deltaMap[i][0];j++)this._nFileContents.push(this._diffContents[this._deltaMap[i][2]+j-1].substring(1));d+=this._deltaMap[i][1]}if(this._nNewLineAtEnd&&!e){this._nFileContents.push("");this._deltaMap[f-1][0]+=1}},_parseHRangeBody:function(d,e){if(0<d.indexOf(",")){d=d.split(",");e.push(parseInt(d[0]));
e.push(parseInt(d[1]))}else{e.push(parseInt(d));e.push(1)}},_parseHunkRange:function(d){var e=this._diffContents[d];if(!(8>e.length))if("@@"===e.substring(0,2)){e=e.substring(2);var f=e.indexOf("@@");if(!(f<0)){e=e.substring(0,f);f=e.indexOf("-");var i=e.indexOf("+");if(!(f<0||i<0)){d=[d];if(f<i){e=e.substring(f+1).split("+");this._parseHRangeBody(e[0],d);this._parseHRangeBody(e[1],d)}else{e=e.substring(i+1).split("-");this._parseHRangeBody(e[1],d);this._parseHRangeBody(e[0],d)}return d}}}}};return g}();
return c});
define("orion/compare/compareUtils",[],function(){var c=c||{};c.compareUtils=c.compareUtils||{};c.compareUtils.lookUpMapper=function(g,a,d){for(var e=0,f=0;f<g.length;f++){var i=g[f][a];if(i===0)i=1;if(d>=e&&d<e+i)return{mapperIndex:f,startFrom:e};if(f===g.length-1)break;e+=g[f][a]}return{mapperIndex:g.length-1,startFrom:e}};c.compareUtils.lookUpLineIndex=function(g,a,d){if(d===0)return 0;for(var e=0,f=0;f<d;f++)e+=g[f][a];return e};c.compareUtils.updateMapper=function(g,a,d,e,f){if(e!==f)if(e>0||
f>0){var i=c.compareUtils.lookUpMapper(g,a,d);if(!(i.mapperIndex<0)){if(e>0){e=e;var j=d-i.startFrom;for(d=i.mapperIndex;d<g.length;d++){j=g[d][a]-j;if(e<=j){g[d][a]-=e;break}g[d][a]-=j;e-=j;j=0}}if(f>0)g[i.mapperIndex][a]+=f}}};c.compareUtils.overlapMapper=function(g,a,d,e,f){g=d+g[a]-1;if(g<d)g=d;if(f<e)f=e;if(g<e||f<d)return false;return true};c.compareUtils.findFirstDiff=function(g,a,d,e){for(var f=0,i=undefined,j=0;j<g.length;j++){if(f>e)break;if(c.compareUtils.overlapMapper(g[j],a,f,d,e)){i=
{mapperIndex:j,startFrom:f};if(g[j][2]!==0)break}f+=g[j][a]}return i};c.compareUtils.matchMapper=function(g,a,d,e){if(g.length===0)return d;var f=d+Math.round((e-d)/3),i=c.compareUtils.findFirstDiff(g,a,d,e),j=g[i.mapperIndex][a]===0?i.startFrom:i.startFrom+g[i.mapperIndex][a]-1,h=c.compareUtils.lookUpLineIndex(g,1-a,i.mapperIndex),l=i.startFrom-d;if(g[i.mapperIndex][2]===0)return h-l;if(f>=i.startFrom&&f<=j)return h-Math.round((e-d)/3);if(f<i.startFrom)return h-l;return(g[i.mapperIndex][1-a]===0?
h:h+g[i.mapperIndex][1-a]-1)-(j-d)};c.compareUtils.getMapperLineCount=function(g){for(var a=0,d=0;d<g.length;d++)a+=Math.max(g[d][0],g[d][1]);return a};c.compareUtils.findNextDiff=function(g,a){var d=0;if(a>=0&&a<g.length-1)d=a+1;for(var e=d;e<g.length;e++)if(g[e][2]!==0)return e;for(e=0;e<d;e++)if(g[e][2]!==0)return e;return a};return c.compareUtils});
define("orion/compare/rulers",["orion/compare/compareUtils"],function(c){var g=g||{};g.CompareRuler=function(){function a(d,e,f){this._location=d||"left";this._overview=e||"page";this._rulerStyle=f;this._editor=null}a.prototype={setView:function(d){this._onModelChanged&&this._editor&&this._editor.removeEventListener("ModelChanged",this,this._onModelChanged);this._editor=d;this._onModelChanged&&this._editor&&this._editor.addEventListener("ModelChanged",this,this._onModelChanged)},getLocation:function(){return this._location},
getOverview:function(){return this._overview}};return a}();g.LineNumberCompareRuler=function(){function a(d,e,f,i,j){g.CompareRuler.call(this,e,"page",f);this._oddStyle=i||{style:{backgroundColor:"white"}};this._evenStyle=j||{style:{backgroundColor:"white"}};this._numOfDigits=0;this._mapperColumnIndex=d}a.prototype=new g.CompareRuler;a.prototype.getStyle=function(d){return d===undefined?this._rulerStyle:this._evenStyle};a.prototype.getHTML=function(d){var e=this._editor.getModel();if(d===-1)return e.getLineCount();
else{if(e.getLineNumber){d=e.getLineNumber(d,this._mapperColumnIndex);if(d===-1)return"";return d+1}return d+1}};a.prototype._onModelChanged=function(d){d=d.start;var e=this._editor.getModel(),f=e.getLineCount(),i=(f+"").length;if(this._numOfDigits!==i){this._numOfDigits=i;this._editor.redrawLines(e.getLineAtOffset(d),f,this)}};return a}();g.CompareOverviewRuler=function(){function a(d,e){g.CompareRuler.call(this,d,"document",e)}a.prototype=new g.CompareRuler;a.prototype.getAnnotations=function(){var d=
this._editor.getModel(),e=[];if(d.getAnnotations){d=d.getAnnotations();for(var f=0;f<d.length;f++)d[f]!==undefined&&e.push(d[f][0])}return e};a.prototype.getStyle=function(d){var e,f;if(d===undefined){e=this._rulerStyle||{};f=e.style||(e.style={});f.lineHeight="1px";f.fontSize="1px";f.width="14px"}else{e=d!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:{};f=e.style||(e.style={});f.cursor="pointer";f.width="8px";f.left="2px";var i=this._editor.getModel();if(d>=0&&i.getAnnotationH){d=i.getAnnotationH(d);
i=i.getLineCount();var j=this._editor.getClientArea();d=Math.floor(j.height*d/i);if(d<2)d=2;f.height=d+"px"}else f.height="3px"}return e};a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(d){if(d!==undefined){var e=this._editor.getLineHeight(),f=this._editor.getClientArea();e=Math.floor(f.height/e/3);this._editor.setTopIndex(d-e>0?d-e:0)}};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();g.CompareMergeOverviewRuler=
function(){function a(d,e,f){this._compareMatchRenderer=d;g.CompareRuler.call(this,e,"document",f)}a.prototype=new g.CompareRuler;a.prototype.getAnnotations=function(){var d=this._editor.getModel(),e=[];if(d.getAnnotations){d=d.getAnnotations();for(var f=0;f<d.length;f++)d[f]!==undefined&&e.push(d[f][0])}return e};a.prototype.getStyle=function(d){var e,f;if(d===undefined){e=this._rulerStyle||{};f=e.style||(e.style={});f.lineHeight="1px";f.fontSize="1px";f.width="14px"}else{e=d!==-1?{styleClass:"ruler_annotation_breakpoint_overview"}:
{};f=e.style||(e.style={});f.cursor="pointer";f.width="8px";f.left="2px";var i=this._editor.getModel();if(d>=0&&i.getAnnotationH){d=i.getAnnotationIndex(d);var j=i.getAnnotationMapperIndex(d);if(j=i.isMapperConflict(j))f.border="1px #FF0000 solid";if(d===this._compareMatchRenderer.getCurrentAnnotationIndex())f.backgroundColor=j?"red":"blue";d=i.getAnnotationH(d);i=i.getAnnotationLineCount();j=this._editor.getClientArea();i=Math.floor(j.height*d/i);if(i<2)i=2;f.height=i+"px"}else f.height="3px"}return e};
a.prototype.getHTML=function(){return"&nbsp;"};a.prototype.onClick=function(d){d!==undefined&&this._compareMatchRenderer.matchPositionFromAnnotation(d)};a.prototype._onModelChanged=function(){this._editor.getModel().getLineCount()>0&&this._editor.redrawLines(0,1,this)};return a}();g.CompareMatchRenderer=function(){function a(d){this._canvasDiv=d;this._mapper=undefined}a.prototype={init:function(d,e,f){this._mapper=d;this._leftEditor=e;this._rightEditor=f;this._currentAnnotationIndex=0;this.render()},
getCurrentAnnotationIndex:function(){return this._currentAnnotationIndex},getCurrentMapperIndex:function(){var d=this._rightEditor.getModel().getAnnotations();return d.length===0?-1:d[this._currentAnnotationIndex][1]},setOverviewRuler:function(d){this._overviewRuler=d},_setEditorPosition:function(d,e){var f=d.getLineHeight(),i=d.getClientArea();f=Math.floor(i.height/f/3);d.setTopIndex(e-f>0?e-f:0)},_findBaseLine:function(d){var e=d.getLineHeight(),f=d.getClientArea();e=Math.floor(f.height/e/3);return d.getTopIndex()+
e},matchPositionFrom:function(d){var e=d?this._leftEditor:this._rightEditor,f=d?this._rightEditor:this._leftEditor,i=e.getTopIndex();e=e.getBottomIndex();d=c.matchMapper(this._mapper,d?0:1,i,e);f.setTopIndex(d)},matchPositionFromAnnotation:function(d){var e=d;this._currentAnnotationIndex=e=d===-1?0:this._rightEditor.getModel().getAnnotationIndex(d);this.positionAnnotation(e)},positionAnnotation:function(d){var e=this._rightEditor.getModel().getAnnotations();if(e.length!==0){this._setEditorPosition(this._rightEditor,
e[d][0]);this._setEditorPosition(this._leftEditor,this._leftEditor.getModel().getLineIndexFromMapper(e[d][1]));this._leftEditor.redrawRange();this._rightEditor.redrawRange();d=this._rightEditor.getTopIndex();this._rightEditor.redrawLines(d,d+1,this._overviewRuler)}},nextDiff:function(){var d=this._rightEditor.getModel().getAnnotations();if(d.length!==0)if(d.length-1===this._currentAnnotationIndex)this._currentAnnotationIndex=0;else this._currentAnnotationIndex+=1;this.positionAnnotation(this._currentAnnotationIndex);
this.render()},prevDiff:function(){var d=this._rightEditor.getModel().getAnnotations();if(d.length!==0)if(0===this._currentAnnotationIndex)this._currentAnnotationIndex=d.length-1;else this._currentAnnotationIndex-=1;this.positionAnnotation(this._currentAnnotationIndex);this.render()},getMapperTextRange:function(d,e,f){var i=d.getModel().getLineIndexFromMapper(e);e=i+this._mapper[e][f]-1;i=d.getModel().getLineStart(i);d=d.getModel().getLineEnd(e,true);return{start:i,end:d}},copyToLeft:function(){var d=
this.getCurrentMapperIndex(),e=this.getMapperTextRange(this._rightEditor,d,1);d=this.getMapperTextRange(this._leftEditor,d,0);this._leftEditor.setText(this._rightEditor.getText(e.start,e.end),d.start,d.end);this._leftEditor.redrawRange();this._rightEditor.redrawRange()},render:function(){if(this._mapper){var d=this._canvasDiv.getContext("2d");d.clearRect(0,0,this._canvasDiv.width,this._canvasDiv.height);d.strokeStyle="#AAAAAA";d.lineWidth=1;d.beginPath();var e=this._leftEditor.getTopIndex(),f=this._leftEditor.getBottomIndex(),
i=this._rightEditor.getTopIndex(),j=this._rightEditor.getBottomIndex();this._leftLineH=this._leftEditor.getLineHeight();this._rightLineH=this._rightEditor.getLineHeight();for(var h=0,l=0,o=false,r=0;r<this._mapper.length;r++){if(this._mapper[r][2]!==0)if(c.overlapMapper(this._mapper[r],0,h,e,f)||c.overlapMapper(this._mapper[r],1,l,i,j)){this._renderCurve(r,h,l,this._canvasDiv,d,e,f,i,j);o=true}else if(o)break;h+=this._mapper[r][0];l+=this._mapper[r][1]}d.stroke()}},_renderCurve:function(d,e,f,i,j){var h=
this._mapper[d];e=this._leftEditor.getLinePixel(e+h[0]/2)+h[0]%2*this._leftLineH/3-this._leftEditor.getTopPixel();f=this._rightEditor.getLinePixel(f+h[1]/2)+h[1]%2*this._rightLineH/3-this._rightEditor.getTopPixel();i=i.parentNode.clientWidth;if(d===this.getCurrentMapperIndex()){j.stroke();j.strokeStyle="#000";j.lineWidth=1;j.beginPath();j.moveTo(0,e);j.bezierCurveTo(i/3,e,i*0.666,f,i,f);j.stroke();j.strokeStyle="#AAAAAA";j.lineWidth=1;j.beginPath()}else{j.moveTo(0,e);j.bezierCurveTo(i/3,e,i*0.666,
f,i,f);j.stroke()}},onChanged:function(d,e,f,i,j){if(i!==j)if(i>0||j>0)this.render()}};return a}();return g});
define("orion/compare/compare-model",[],function(){var c=c||{};c.CompareTextModel=function(){function g(a,d,e){this._model=a;this._mapperColumnIndex=d.columnIndex;this._mapper=d.mapper;this._listeners=[];a.addListener(this);this._lineFeeder=e;this.init()}navigator.platform.indexOf("Win");g.prototype={init:function(a,d){if(a)this._mapper=a;a=this._lineFeeder.generateGapBlocks(this._mapper,this._mapperColumnIndex,d);this._dummyLBlock=a.gapBlocks;this._dummyLNumber=a.gapNumber},_getDummyCharCountAt:function(a,
d){if(a.blockNumber<0)return 0;for(var e=0,f=0;f<=a.blockNumber;f++){if(f>=this._dummyLBlock.length)break;for(var i=f===a.blockNumber?a.stopAtDelta:this._dummyLBlock[f][1]-1,j=0;j<=i;j++){var h=d?this._lineFeeder.getLineAt(this._dummyLBlock,f,j,true):this._lineFeeder.getLineAt(this._dummyLBlock,f,j,!(f===a.blockNumber&&j===i));e+=h.length}}return e},lookUpRealIndex:function(a){for(var d=0,e=0,f=0;f<this._dummyLBlock.length;f++){var i=this._dummyLBlock[f][0],j=i+this._dummyLBlock[f][1]-1;if(a<i)break;
if(a>=i&&a<=j)return{lineIndex:-1,gapsBefore:d+a-i,lastGapInfo:{blockNumber:f,stopAtDelta:a-i}};e=this._dummyLBlock[f][1];d+=e}return{lineIndex:a-d,gapsBefore:d,lastGapInfo:{blockNumber:f-1,stopAtDelta:e-1}}},getLineType:function(a){return this._lineFeeder.getLineType(a,this._mapperColumnIndex)},getAnnotations:function(){return this._lineFeeder.getAnnotations()},getAnnotationH:function(a){return this._lineFeeder.getAnnotationH(a)},getLineNumber:function(a,d){if(this._lineFeeder.getLineNumber)return this._lineFeeder.getLineNumber(a,
d);return this.lookUpRealIndex(a).lineIndex},addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var d=0;d<this._listeners.length;d++)if(this._listeners[d]===a){this._listeners.splice(d,1);return}},getCharCount:function(){var a=this._model.getCharCount();if(this._dummyLBlock.length>0)a+=this._getDummyCharCountAt({blockNumber:this._dummyLBlock.length-1,stopAtDelta:this._dummyLBlock[this._dummyLBlock.length-1][1]-1},true);return a},getLine:function(a,d){var e=this.getLineCount();
if(!(0<=a&&a<e))return null;a=this.lookUpRealIndex(a);return a.lineIndex<0?this._lineFeeder.getLineAt(this._dummyLBlock,a.lastGapInfo.blockNumber,a.lastGapInfo.stopAtDelta,d):this._model.getLine(a.lineIndex,d)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;for(var d=this.getLineCount(),e=0,f=0;e<d;){var i=this.lookUpRealIndex(e);if(i.lineIndex<0)f+=this._lineFeeder.getLineAt(this._dummyLBlock,i.lastGapInfo.blockNumber,i.lastGapInfo.stopAtDelta,true).length;else{i=this._model.getLine(i.lineIndex,
true);f+=i?i.length:0}e++;if(f>a)break}if(e>d)return d-1;return e-1},getLineCount:function(){return this._model.getLineCount()+this._dummyLNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,d){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;var f=this.lookUpRealIndex(a);e=0;if(f.lineIndex<0){e+=this._getDummyCharCountAt(f.lastGapInfo,d);a=a-f.gapsBefore;if(a>0)e+=this._model.getLineEnd(a-1,true)}else{e+=this._getDummyCharCountAt(f.lastGapInfo,true);
e+=this._model.getLineEnd(f.lineIndex,d)}return e},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;if(a===0)return 0;return this.getLineEnd(a-1,true)},getText:function(a,d){if(a===d)return this._model.getText(a,d);if(a===undefined)a=0;if(d===undefined)d=this.getCharCount();var e=this.getLineAtOffset(a),f=this.getLineAtOffset(d),i=this.getLineStart(e),j=this.getLineEnd(f,true),h=this.getLine(e,true);if(!h)return this._model.getText(a,d);if(e===f)return h.substring(a-i,h.length-
j+d);i=h.substring(a-i);h=this.getLine(f,true);if(!h)return this._model.getText(a,d);a=h.substring(0,h.length-j+d);d="";for(e=e+1;e<f;e++)d+=this.getLine(e,true);return i+d+a},onChanging:function(a,d,e,f,i,j){for(var h=0;h<this._listeners.length;h++){var l=this._listeners[h];l&&l.onChanging&&l.onChanging(a,d,e,f,i,j)}},onChanged:function(a,d,e,f,i){for(var j=0;j<this._listeners.length;j++){var h=this._listeners[j];h&&h.onChanged&&h.onChanged(a,d,e,f,i)}},setText:function(a){this._model.setText(a,
0,this._model.getCharCount())}};return g}();c.DiffLineFeeder=function(){function g(a,d){if(a){this._diffLinesArray=a.array;this._diffLinesArrayIndex=a.index}this._lineDelimeter=d;this._annotations=[]}navigator.platform.indexOf("Win");g.prototype={generateGapBlocks:function(a,d,e){var f=[];this._mapper=a;if(e){this._diffLinesArray=e.array;this._diffLinesArrayIndex=e.index}this._annotations=[];e=a=0;for(var i=1-d,j=0,h=0;h<this._mapper.length;h++){j=this._mapper[h][2]===0?this._mapper[h][d]:this._mapper[h][d]+
this._mapper[h][i];if(this._mapper[h][2]>0){var l=this._mapper[h][d];a+=l;f.push([e+this._mapper[h][i],l,this._mapper[h][2]])}this._mapper[h][2]!==0&&this._annotations.push([e,j]);e+=j}return{gapBlocks:f,gapNumber:a}},getLineAt:function(a,d,e,f){d=a[d][2];d+=e-1;e=this._diffLinesArray[d];e===undefined&&console.log(a);e=e.substring(this._diffLinesArrayIndex);if(f)return e+this._lineDelimeter;return e},getLineType:function(a,d){for(var e=0,f=1-d,i=0,j=0;j<this._mapper.length;j++){i=this._mapper[j][2]===
0?this._mapper[j][d]:this._mapper[j][d]+this._mapper[j][f];if(a>=e&&a<e+i){if(this._mapper[j][2]===0)return"unchnaged";else if(this._mapper[j][2]<0)return"removed";else if(this._mapper[j][1]===0)return"added";else if(a<this._mapper[j][f]+e)return"removed";return"added"}e+=i}return"unchnaged"},getLineNumber:function(a,d){if(this._mapper.length===0)return a;for(var e=0,f=0,i=1-d,j=0,h=0;h<this._mapper.length;h++){j=this._mapper[h][2]===0?this._mapper[h][d]:this._mapper[h][d]+this._mapper[h][i];if(a>=
e&&a<e+j){i=a-e;if(this._mapper[h][2]===0)return f+i;else if(this._mapper[h][2]<0)return d===0?-1:f+i;else if(this._mapper[h][1]===0)return d===0?f+i:-1;else if(a<this._mapper[h][1]+e)return d===0?-1:f+i;return d===0?f+i-this._mapper[h][1]:-1}e+=j;f+=this._mapper[h][d]}return a},getAnnotations:function(){return this._annotations},getAnnotationH:function(a){for(var d=0;d<this._annotations.length;d++)if(this._annotations[d][0]===a)return this._annotations[d][1];return 0}};return g}();c.GapLineFeeder=
function(){function g(a){this._lineDelimeter=a;this._annotations=[]}navigator.platform.indexOf("Win");g.prototype={generateGapBlocks:function(a,d){var e=[];this._mapper=a;this._annotations=[];for(var f=a=0,i=1-d,j=0;j<this._mapper.length;j++){if(this._mapper[j][d]<this._mapper[j][i]){var h=this._mapper[j][i]-this._mapper[j][d];a+=h;e.push([f+this._mapper[j][d],h,1])}h=Math.max(this._mapper[j][i],this._mapper[j][d]);this._mapper[j][2]!==0&&this._annotations.push([f,h]);f+=h}return{gapBlocks:e,gapNumber:a}},
getLineAt:function(a,d,e,f){if(f)return this._lineDelimeter;return""},getLineType:function(a,d){for(var e=0,f=1-d,i=0;i<this._mapper.length;i++){var j=Math.max(this._mapper[i][d],this._mapper[i][f]);if(a>=e&&a<e+j){if(this._mapper[i][2]===0)return"unchnaged";else if(this._mapper[i][2]<0)return"removed";else if(this._mapper[i][1]===0)return"added";else if(a<this._mapper[i][d]+e)return"changed";return"changed_gap"}e+=Math.max(this._mapper[i][d],this._mapper[i][f])}return"unchnaged"},getAnnotations:function(){return this._annotations},
getAnnotationH:function(a){for(var d=0;d<this._annotations.length;d++)if(this._annotations[d][0]===a)return this._annotations[d][1];return 0}};return g}();return c});
define("orion/compare/compare-m-model",["orion/compare/compareUtils"],function(c){var g=g||{};g.CompareMergeModel=function(){function a(d,e){this._model=d;this._mapperColumnIndex=e.columnIndex;this._mapper=e.mapper;this._listeners=[];d.addListener(this);this.init()}navigator.platform.indexOf("Win");a.prototype={init:function(d){this._initing=true;if(d){this._mapper=d;this._annotations=undefined}},getLineType:function(d){var e=c.lookUpMapper(this._mapper,this._mapperColumnIndex,d);if(e.mapperIndex>
-1)if(this._mapper[e.mapperIndex][2]!==0){var f=this._mapper[e.mapperIndex][this._mapperColumnIndex];if(f===0)return{type:"top-only",mapperIndex:e.mapperIndex};if(f===1)return{type:"oneline",mapperIndex:e.mapperIndex};if(d===e.startFrom)return{type:"top",mapperIndex:e.mapperIndex};if(d===e.startFrom+f-1)return{type:"bottom",mapperIndex:e.mapperIndex};return{type:"middle",mapperIndex:e.mapperIndex}}return{type:"unchanged",mapperIndex:e.mapperIndex}},isMapperEmpty:function(){return this._mapper.length===
0},isMapperConflict:function(d){if(d<0)return false;if(!this._mapper[d][3])return false;return this._mapper[d][3]===1},getAnnotations:function(){if(this._annotations===undefined){this._annotations=[];for(var d=0,e=0;e<this._mapper.length;e++){this._mapper[e][2]!==0&&this._annotations.push([d,e]);d+=this._mapper[e][this._mapperColumnIndex]}}return this._annotations},getAnnotationH:function(d){d=this._annotations[d][1];return d===-1?0:this._mapper[d][this._mapperColumnIndex]},getAnnotationLineCount:function(){return this.getLineCount()},
getAnnotationIndex:function(d){this._annotations===undefined&&this.getAnnotations();for(var e=0;e<this._annotations.length;e++)if(this._annotations[e][0]===d)return e;return-1},getAnnotationMapperIndex:function(d){this._annotations===undefined&&this.getAnnotations();return this._annotations[d][1]},getAnnotationIndexByMapper:function(d){this._annotations===undefined&&this.getAnnotations();for(var e=0;e<this._annotations.length;e++)if(this._annotations[e][1]===d)return e;return-1},getLineNumber:function(d){return d},
getLineIndexFromMapper:function(d){return c.lookUpLineIndex(this._mapper,this._mapperColumnIndex,d)},lookUpMapper:function(d){return c.lookUpMapper(this._mapper,this._mapperColumnIndex,d)},updateMapper:function(d,e,f,i,j){i!==j&&c.updateMapper(this._mapper,this._mapperColumnIndex,this.getLineAtOffset(d),i,j)},addListener:function(d){this._listeners.push(d)},removeListener:function(d){for(var e=0;e<this._listeners.length;e++)if(this._listeners[e]===d){this._listeners.splice(e,1);return}},getCharCount:function(){return this._model.getCharCount()},
getLine:function(d,e){return this._model.getLine(d,e)},getLineAtOffset:function(d){return this._model.getLineAtOffset(d)},getLineCount:function(){return this._model.getLineCount()},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(d,e){return this._model.getLineEnd(d,e)},getLineStart:function(d){return this._model.getLineStart(d)},setText:function(d,e,f){this._model.setText(d,e,f)},getText:function(d,e){return this._model.getText(d,e)},onChanging:function(d,e,
f,i,j,h){for(var l=0;l<this._listeners.length;l++){var o=this._listeners[l];o&&o.onChanging&&o.onChanging(d,e,f,i,j,h)}},onChanged:function(d,e,f,i,j){if(this._initing)this._initing=false;else this.updateMapper(d,e,f,i,j);for(var h=0;h<this._listeners.length;h++){var l=this._listeners[h];l&&l.onChanged&&l.onChanged(d,e,f,i,j)}}};return a}();return g});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.ContentAssist=function(){function c(g,a,d){this.editor=g;this.textView=g.getTextView();this.contentAssistPanel=dojo.byId(a);this.active=false;this.prefix="";this.serviceRegistry=d;this.contentAssistProviders=[];this.activeServiceReferences=[];this.activeContentAssistProviders=[];this.contentAssistListener={onVerify:function(){this.showContentAssist(false)},onSelectionChanged:function(){this.showContentAssist(false)}};this.init()}c.prototype={init:function(){this.textView.setKeyBinding(navigator.platform.indexOf("Mac")!==
-1?new orion.textview.KeyBinding(" ",false,false,false,true):new orion.textview.KeyBinding(" ",true),"Content Assist");this.textView.setAction("Content Assist",dojo.hitch(this,function(){this.showContentAssist(true);return true}));dojo.connect(this.editor,"onInputChange",this,this.inputChanged)},inputChanged:function(g){if(this.serviceRegistry){this.activeServiceReferences=[];var a=this.serviceRegistry.getServiceReferences("orion.edit.contentAssist");dojo.forEach(a,dojo.hitch(this,function(e){for(var f=
{},i=e.getPropertyNames(),j=0;j<i.length;j++)f[i[j]]=e.getProperty(i[j]);(new RegExp(f.pattern)).test(g)&&this.activeServiceReferences.push(e)}))}for(a=0;a<this.contentAssistProviders.length;a++){var d=this.contentAssistProviders[a];(new RegExp(d.pattern)).test(g)&&this.activeContentAssistProviders.push(d.provider)}},cancel:function(){this.showContentAssist(false)},isActive:function(){return this.active},lineUp:function(){if(this.contentAssistPanel){for(var g=dojo.query("> div",this.contentAssistPanel),
a=0,d=0;d<g.length;d++)if(g[d].className==="selected"){g[d].className="";a=d;break}if(a>0)g[a-1].className="selected";else g[g.length-1].className="selected";return true}},lineDown:function(){if(this.contentAssistPanel){for(var g=dojo.query("> div",this.contentAssistPanel),a=0,d=0;d<g.length;d++)if(g[d].className==="selected"){g[d].className="";a=d;break}if(a<g.length-1)g[a+1].className="selected";else g[0].className="selected";return true}},enter:function(){if(this.contentAssistPanel){this.textView.setText(dojo.query("> .selected",
this.contentAssistPanel)[0].innerHTML.substring(this.prefix.length),this.textView.getCaretOffset(),this.textView.getCaretOffset());this.showContentAssist(false);return true}},showContentAssist:function(g){function a(i,j,h){var l={innerHTML:i,onclick:function(){alert(i)}};if(j)l.className="selected";dojo.create("div",l,h,this)}if(this.contentAssistPanel)if(g){var d=this.textView.getCaretOffset();g=d;for(var e;g>0&&(97<=(e=this.textView.getText(g-1,g).charCodeAt(0))&&e<=122||65<=e&&e<=90||e===95||48<=
e&&e<=57);)g--;this.prefix=this.textView.getText(g,d);var f=[];e=this.textView.getText();g=this.textView.getSelection();this.getKeywords(this.prefix,e,g).then(dojo.hitch(this,function(i){for(var j=0;j<i.length;j++){var h=i[j];h.substr(0,this.prefix.length)===this.prefix&&f.push(h)}if(f.length!==0){i=this.textView.getLocationAtOffset(d);i.y+=this.textView.getLineHeight();this.contentAssistPanel.innerHTML="";for(j=0;j<f.length;j++)a(f[j],j===0,this.contentAssistPanel);this.textView.convert(i,"document",
"page");this.contentAssistPanel.style.position="absolute";this.contentAssistPanel.style.left=i.x+"px";this.contentAssistPanel.style.top=i.y+"px";this.contentAssistPanel.style.display="block";this.textView.addEventListener("Verify",this,this.contentAssistListener.onVerify);this.textView.addEventListener("Selection",this,this.contentAssistListener.onSelectionChanged);this.active=true}}))}else{this.textView.removeEventListener("Verify",this,this.contentAssistListener.onVerify);this.textView.removeEventListener("Selection",
this,this.contentAssistListener.onSelectionChanged);this.active=false;this.contentAssistPanel.style.display="none"}},getKeywords:function(g,a,d){var e=[];dojo.forEach(this.activeContentAssistProviders,function(l){e=e.concat(l.getKeywords()||[])});var f=new dojo.Deferred;if(this.serviceRegistry)for(var i=dojo.map(this.activeServiceReferences,dojo.hitch(this,function(l){return this.serviceRegistry.getService(l).then(function(o){return o.getKeywords(g,a,d)})})),j=0,h=0;h<i.length;h++)i[h].then(function(l){j++;
e=e.concat(l);j===i.length&&f.resolve(e)},function(l){j=-1;f.reject(l)});else f.resolve(e);return f},addProvider:function(g,a,d){this.contentAssistProviders=this.contentAssistProviders||[];this.contentAssistProviders.push({name:a,pattern:d,provider:g})}};return c}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/contentAssist",["dojo","orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.UndoStack=function(){function c(d,e){this.view=d;this.size=e!==undefined?e:100;this.reset();d.addEventListener("ModelChanging",this,this._onModelChanging);d.addEventListener("Destroy",this,this._onDestroy)}var g=function(){function d(e,f,i){this.offset=e;this.text=f;this.previousText=i}d.prototype={undo:function(e,f){this._doUndoRedo(this.offset,this.previousText,this.text,e,f)},redo:function(e,f){this._doUndoRedo(this.offset,this.text,this.previousText,e,f)},_doUndoRedo:function(e,
f,i,j,h){j.setText(f,e,e+i.length);h&&j.setSelection(e,e+f.length)}};return d}(),a=function(){function d(e,f){this.selection=e;this.caret=f;this.changes=[]}d.prototype={add:function(e){this.changes.push(e)},undo:function(e,f){for(var i=this.changes.length-1;i>=0;i--)this.changes[i].undo(e,false);if(f){f=this.selection.start;i=this.selection.end;e.setSelection(this.caret?f:i,this.caret?i:f)}},redo:function(e,f){for(var i=0;i<this.changes.length;i++)this.changes[i].redo(e,false);if(f){f=this.selection.start;
i=this.selection.end;e.setSelection(this.caret?f:i,this.caret?i:f)}}};return d}();c.prototype={add:function(d){if(this.compoundChange)this.compoundChange.add(d);else{this.stack.splice(this.index,this.stack.length-this.index,d);this.index++;if(this.stack.length>this.size){this.stack.shift();this.index--;this.cleanIndex--}}},markClean:function(){this.endCompoundChange();this._commitUndo();this.cleanIndex=this.index},isClean:function(){return this.cleanIndex===this.getSize().undo},canUndo:function(){return this.getSize().undo>
0},canRedo:function(){return this.getSize().redo>0},endCompoundChange:function(){this.compoundChange=undefined},getSize:function(){var d=this.index,e=this.stack.length;this._undoStart!==undefined&&d++;return{undo:d,redo:e-d}},undo:function(){this._commitUndo();if(this.index<=0)return false;var d=this.stack[--this.index];this._ignoreUndo=true;d.undo(this.view,true);this._ignoreUndo=false;return true},redo:function(){this._commitUndo();if(this.index>=this.stack.length)return false;var d=this.stack[this.index++];
this._ignoreUndo=true;d.redo(this.view,true);this._ignoreUndo=false;return true},reset:function(){this.index=this.cleanIndex=0;this.stack=[];this._undoStart=undefined;this._undoText="";this._ignoreUndo=false;this._compoundChange=undefined},startCompoundChange:function(){this._commitUndo();var d=new a(this.view.getSelection(),this.view.getCaretOffset());this.add(d);this.compoundChange=d},_commitUndo:function(){if(this._undoStart!==undefined){this._undoStart<0?this.add(new g(-this._undoStart,"",this._undoText,
"")):this.add(new g(this._undoStart,this._undoText,""));this._undoStart=undefined;this._undoText=""}},_onDestroy:function(){this.view.removeEventListener("ModelChanging",this,this._onModelChanging);this.view.removeEventListener("Destroy",this,this._onDestroy)},_onModelChanging:function(d){var e=d.text,f=d.start,i=d.removedCharCount;d=d.addedCharCount;if(!this._ignoreUndo){if(this._undoStart!==undefined&&!(d===1&&i===0&&f===this._undoStart+this._undoText.length||d===0&&i===1&&(f+1===-this._undoStart||
f===-this._undoStart)))this._commitUndo();if(!this.compoundChange)if(d===1&&i===0){if(this._undoStart===undefined)this._undoStart=f;this._undoText+=e;return}else if(d===0&&i===1){e=this._undoText.length>0&&-this._undoStart===f;this._undoStart=-f;if(e)this._undoText+=this.view.getText(f,f+i);else this._undoText=this.view.getText(f,f+i)+this._undoText;return}this.add(new g(f,e,this.view.getText(f,f+i)))}}};return c}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/undoStack",[],function(){return orion.textview});
define("orion/editorCommands",["dojo","orion/commands","orion/globalCommands","orion/textview/keyBinding","orion/textview/undoStack"],function(c,g,a,d,e){var f={};f.EditorCommandFactory=function(){function i(j,h,l,o,r,u){this.serviceRegistry=j;this.commandService=h;this.fileClient=l;this.inputManager=o;this.toolbarId=r;this.isReadOnly=u}i.prototype={generateEditorCommands:function(j){function h(r){return d.KeyBinding.apply(this,r)}if(!this.isReadOnly){j.getTextView().setKeyBinding(new d.KeyBinding("s",
true),"Save");j.getTextView().setAction("Save",c.hitch(this,function(){var r=j.getTextView().getText();this.fileClient.write(this.inputManager.getInput(),r).then(c.hitch(this,function(){j.onInputChange(this.inputManager.getInput(),null,r,true);this.inputManager.afterSave&&this.inputManager.afterSave()}));return true}));this.commandService.addCommand(new g.Command({name:"Save",id:"orion.save",callback:function(r){r.getTextView().invokeAction("Save")}}),"dom");this.commandService.addCommandGroup("orion.editorActions.unlabeled",
200,null,null,this.toolbarId);this.commandService.registerCommandContribution("orion.save",1,this.toolbarId,"orion.editorActions.unlabeled",new g.CommandKeyBinding("s",true));this.commandService.addCommandGroup("orion.editorActions.contributed.noImages",100,"More",null,this.toolbarId);this.commandService.addCommandGroup("orion.editorActions.contributed.images",101,null,null,this.toolbarId);for(var l=this.serviceRegistry.getServiceReferences("orion.edit.command"),o=0;o<l.length;o++)this.serviceRegistry.getService(l[o]).then(c.hitch(this,
function(r){for(var u={},s=l[o].getPropertyNames(),q=0;q<s.length;q++)u[s[q]]=l[o].getProperty(s[q]);s=j.getTextView();q=new g.Command({name:u.name,image:u.img,id:u.name,callback:c.hitch(j,function(v){var y=v?v.getTextView():this.getTextView();v=y.getText();var x=y.getSelection();r.run(y.getText(x.start,x.end),v,x).then(function(k){if(k.text){y.setText(k.text);if(k.selection){y.setSelection(k.selection.start,k.selection.end);y.focus()}}else if(typeof k==="string"){y.setText(k,x.start,x.end);y.setSelection(x.start,
x.end);y.focus()}});return true})});this.commandService.addCommand(q,"dom");u.img?this.commandService.registerCommandContribution(q.id,o,this.toolbarId,"orion.editorActions.contributed.images"):this.commandService.registerCommandContribution(q.id,o,this.toolbarId,"orion.editorActions.contributed.noImages");a.generateDomCommandsInBanner(this.commandService,j);if(u.key){h.prototype=d.KeyBinding.prototype;s.setKeyBinding(new h(u.key),q.id);s.setAction(q.id,q.callback)}}))}}};return i}();f.UndoCommandFactory=
function(){function i(j,h,l){this.serviceRegistry=j;this.commandService=h;this.toolbarId=l}i.prototype={createUndoStack:function(j){var h=new e.UndoStack(j.getTextView(),200);j.getTextView().setKeyBinding(new d.KeyBinding("z",true),"Undo");j.getTextView().setAction("Undo",function(){h.undo();return true});this.commandService.addCommand(new g.Command({name:"Undo",id:"orion.undo",callback:function(o){o.getTextView().invokeAction("Undo")}}),"dom");var l=navigator.platform.indexOf("Mac")!==-1?new d.KeyBinding("z",
true,true):new d.KeyBinding("y",true);j.getTextView().setKeyBinding(l,"Redo");j.getTextView().setAction("Redo",function(){h.redo();return true});this.commandService.addCommand(new g.Command({name:"Redo",id:"orion.redo",callback:function(o){o.getTextView().invokeAction("Redo")}}),"dom");this.commandService.registerCommandContribution("orion.undo",400,this.toolbarId,"orion.editorActions.unlabeled",new g.CommandKeyBinding("z",true),true);this.commandService.registerCommandContribution("orion.redo",401,
this.toolbarId,"orion.editorActions.unlabeled",l,true);return h}};return i}();return f});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.Editor=function(){function c(g){this._textViewFactory=g.textViewFactory;this._undoStackFactory=g.undoStackFactory;this._annotationFactory=g.annotationFactory;this._lineNumberRulerFactory=g.lineNumberRulerFactory;this._contentAssistFactory=g.contentAssistFactory;this._keyBindingFactory=g.keyBindingFactory;this._statusReporter=g.statusReporter;this._domNode=g.domNode;this._syntaxHighlightProviders=g.syntaxHighlightProviders;this._overviewRuler=this._annotationsRuler=null;this._dirty=false;
this._contentAssist=null;this._keyModes=[]}c.prototype={getTextView:function(){return this._textView},reportStatus:function(g,a){this._statusReporter?this._statusReporter(g,a):window.alert(a?"ERROR: "+g:g)},moveSelection:function(g,a,d){d=d||a;g.setSelection(a,d,false);d=g.getTopPixel();var e=g.getBottomPixel();a=g.getModel().getLineAtOffset(a);a=g.getLinePixel(a);if(a<d||a>e){e=Math.max(0,a-Math.floor((a<d?3:1)*(e-d)/4));(new dojo.Animation({node:g,duration:300,curve:[d,e],onAnimate:function(f){g.setTopPixel(Math.floor(f))},
onEnd:function(){g.showSelection();g.focus()}})).play()}else{g.showSelection();g.focus()}},getContents:function(){if(this._textView)return this._textView.getText()},isDirty:function(){return this._dirty},checkDirty:function(){var g=!this._undoStack.isClean();this._dirty!==g&&this.onDirtyChange(g)},getAnnotationsRuler:function(){return this._annotationsRuler},doFind:function(g,a,d,e){var f=this._textView.getText();if(d){g=g.toLowerCase();f=f.toLowerCase()}if(e){f=f.split("").reverse().join("");g=g.split("").reverse().join("");
a=f.length-a-1;a=f.indexOf(g,a);if(a!==-1)return{index:f.length-g.length-a,length:g.length}}else{a=f.indexOf(g,a);if(a!==-1)return{index:a,length:g.length}}return null},doFindRegExp:function(g,a,d,e){if(!g)return null;a=a||"";a+=(a.indexOf("g")===-1?"g":"")+(a.indexOf("m")===-1?"m":"");g=new RegExp(g,a);a=this._textView.getText();var f=null,i=null;if(e)for(;;)if((f=g.exec(a))&&f.index<=d)i={index:f.index,length:f[0].length};else return i;else return(f=g.exec(a.substring(d)))&&{index:f.index+d,length:f[0].length}},
parseRegExp:function(g){if(g=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(g))return{pattern:g[1],flags:g[2]};return null},installTextView:function(){function g(){var f=d.getModel(),i=d.getCaretOffset(),j=f.getLineAtOffset(i);f=f.getLineStart(j);i=i-f;for(f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return;this.reportStatus("Line "+(j+1)+" : Col "+i)}this._textView=this._textViewFactory();if(this._undoStackFactory)this._undoStack=this._undoStackFactory.createUndoStack(this);if(this._contentAssistFactory){this._contentAssist=
this._contentAssistFactory(this);this._keyModes.push(this._contentAssist)}var a=this,d=this._textView;this._keyBindingFactory&&this._keyBindingFactory(this,this._keyModes,this._undoStack,this._contentAssist);d.setKeyBinding(new orion.textview.KeyBinding(27),"Cancel Current Mode");d.setAction("Cancel Current Mode",dojo.hitch(this,function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].cancel();return false}));d.setAction("lineUp",dojo.hitch(this,
function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineUp();return false}));d.setAction("lineDown",dojo.hitch(this,function(){for(var f=0;f<this._keyModes.length;f++)if(this._keyModes[f].isActive())return this._keyModes[f].lineDown();return false}));d.addEventListener("ModelChanged",this,this.checkDirty);d.addEventListener("Selection",this,g);if(this._annotationFactory){var e=this._annotationFactory.createAnnotationRulers();this._annotationsRuler=
e.annotationRuler;this._annotationsRuler.onClick=function(f){if(f!==undefined)if(f!==-1){f=this.getAnnotation(f);f!==undefined&&a.onGotoLine(f.line,f.column)}};this._overviewRuler=e.overviewRuler;this._overviewRuler.onClick=function(f){f!==undefined&&a.moveSelection(d,d.getModel().getLineStart(f))};d.addRuler(this._annotationsRuler);d.addRuler(this._overviewRuler)}if(this._lineNumberRulerFactory){this._lineNumberRuler=this._lineNumberRulerFactory.createLineNumberRuler();d.addRuler(this._lineNumberRuler)}},
showSelection:function(g,a,d,e,f){if(typeof g==="number"){if(typeof a!=="number")a=g;this.moveSelection(this._textView,g,a)}else if(typeof d==="number"){g=this._textView.getModel().getLineStart(d-1);if(typeof e==="number")g+=e;if(typeof f!=="number")f=0;this.moveSelection(this._textView,g,g+f)}},onInputChange:function(g,a,d,e){if(e&&this._textView){this._undoStack.markClean();this.checkDirty()}else if(this._textView){if(a)this._textView.setText(a);else d!==null&&d!==undefined&&this._textView.setText(d);
this._undoStack.reset();this.checkDirty();this._textView.focus()}},onGotoLine:function(g,a,d){if(this._textView){var e=this._textView.getModel().getLineStart(g);if(typeof a==="string"){var f=this._textView.getModel().getLine(g).indexOf(a);if(f!==-1){d=f+a.length;a=f}else a=0}g=Math.min(this._textView.getModel().getLineEnd(g),a);if(d===undefined)d=g;this.moveSelection(this._textView,e+g,e+d)}},onDirtyChange:function(g){this._dirty=g}};return c}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editor",["dojo","orion/textview/keyBinding"],function(){return orion.editor});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.Ruler=function(){function c(g,a,d){this._location=g||"left";this._overview=a||"page";this._rulerStyle=d;this._view=null}c.prototype={setView:function(g){this._onModelChanged&&this._view&&this._view.removeEventListener("ModelChanged",this,this._onModelChanged);this._view=g;this._onModelChanged&&this._view&&this._view.addEventListener("ModelChanged",this,this._onModelChanged)},getLocation:function(){return this._location},getOverview:function(){return this._overview}};return c}();
orion.textview.LineNumberRuler=function(){function c(g,a,d,e){orion.textview.Ruler.call(this,g,"page",a);this._oddStyle=d||{style:{backgroundColor:"white"}};this._evenStyle=e||{style:{backgroundColor:"white"}};this._numOfDigits=0}c.prototype=new orion.textview.Ruler;c.prototype.getStyle=function(g){return g===undefined?this._rulerStyle:g&1?this._oddStyle:this._evenStyle};c.prototype.getHTML=function(g){return g===-1?this._view.getModel().getLineCount():g+1};c.prototype._onModelChanged=function(g){g=
g.start;var a=this._view.getModel(),d=a.getLineCount(),e=(d+"").length;if(this._numOfDigits!==e){this._numOfDigits=e;this._view.redrawLines(a.getLineAtOffset(g),d,this)}};return c}();
orion.textview.AnnotationRuler=function(){function c(g,a,d){orion.textview.Ruler.call(this,g,"page",a);this._defaultAnnotation=d;this._annotations=[]}c.prototype=new orion.textview.Ruler;c.prototype.clearAnnotations=function(){this._annotations=[];var g=this._view.getModel().getLineCount();this._view.redrawLines(0,g,this);this._overviewRuler&&this._view.redrawLines(0,g,this._overviewRuler)};c.prototype.getAnnotation=function(g){return this._annotations[g]};c.prototype.getAnnotations=function(){return this._annotations};
c.prototype.getStyle=function(g){switch(g){case undefined:return this._rulerStyle;case -1:return this._defaultAnnotation?this._defaultAnnotation.style:null;default:return this._annotations[g]&&this._annotations[g].style?this._annotations[g].style:null}};c.prototype.getHTML=function(g){return g===-1?this._defaultAnnotation?this._defaultAnnotation.html:"":this._annotations[g]&&this._annotations[g].html?this._annotations[g].html:""};c.prototype.setAnnotation=function(g,a){if(g!==undefined){this._annotations[g]=
a;this._view.redrawLines(g,g+1,this);this._overviewRuler&&this._view.redrawLines(g,g+1,this._overviewRuler)}};c.prototype._onModelChanged=function(g){var a=g.start,d=g.removedLineCount;if(g=g.addedLineCount-d){var e=this._view.getModel();a=e.getLineAtOffset(a);var f=[],i=this._annotations,j=false;for(var h in i){var l=h>>>0;if(a<l&&l<a+d)j=true;else{var o=l;if(l>a){o+=g;j=true}f[o]=i[l]}}this._annotations=f;if(j){d=e.getLineCount();this._view.redrawLines(a,d,this);this._overviewRuler&&this._view.redrawLines(0,
d,this._overviewRuler)}}};return c}();
orion.textview.OverviewRuler=function(){function c(g,a,d){orion.textview.Ruler.call(this,g,"document",a);if(this._annotationRuler=d)d._overviewRuler=this}c.prototype=new orion.textview.Ruler;c.prototype.getAnnotations=function(){var g=this._annotationRuler.getAnnotations(),a=[];for(var d in g){var e=d>>>0;g[e]!==undefined&&a.push(e)}return a};c.prototype.getStyle=function(g){var a;if(g===undefined){g=this._rulerStyle||{};a=g.style||(g.style={});a.lineHeight="1px";a.fontSize="1px";a.width="14px"}else{g=
g!==-1?this._annotationRuler.getAnnotation(g).overviewStyle||{}:{};a=g.style||(g.style={});a.cursor="pointer";a.width="8px";a.height="3px";a.left="2px"}return g};c.prototype.getHTML=function(){return"&nbsp;"};c.prototype.onClick=function(g){g!==undefined&&this._view.setTopIndex(g)};return c}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/rulers",[],function(){return orion.textview});orion=orion||{};orion.editor=orion.editor||{};
orion.editor.UndoFactory=function(){function c(){}c.prototype={createUndoStack:function(g){var a=new orion.textview.UndoStack(g.getTextView(),200);g.getTextView().setKeyBinding(new orion.textview.KeyBinding("z",true),"Undo");g.getTextView().setAction("Undo",function(){a.undo();return true});var d=navigator.platform.indexOf("Mac")!==-1;g.getTextView().setKeyBinding(d?new orion.textview.KeyBinding("z",true,true):new orion.textview.KeyBinding("y",true),"Redo");g.getTextView().setAction("Redo",function(){a.redo();
return true});return a}};return c}();orion.editor.LineNumberRulerFactory=function(){function c(){}c.prototype={createLineNumberRuler:function(){return new orion.textview.LineNumberRuler("left",{style:{backgroundColor:"#ffffff",textAlign:"right",borderLeft:"1px solid #ddd",borderRight:"1px solid #ddd"}},{style:{backgroundColor:"#ffffff"}},{style:{backgroundColor:"#ffffff"}})}};return c}();
orion.editor.AnnotationFactory=function(){function c(g){this.problemImageUrl=g}c.prototype={createAnnotationRulers:function(){var g={style:{backgroundColor:"#ffffff"}};this.annotationRuler=new orion.textview.AnnotationRuler("left",g,{html:"<img src='"+this.problemImageUrl+"'></img>"});this.overviewRuler=new orion.textview.OverviewRuler("right",g,this.annotationRuler);return{annotationRuler:this.annotationRuler,overviewRuler:this.overviewRuler}},showProblems:function(g){var a,d;g=g||[];g.length>0&&
g[g.length-1]===null&&g.pop();var e=this.annotationRuler;if(e){e.clearAnnotations();var f=-1;for(a in g)if(g[a]){d=g[a].reason.replace(/'/g,"&#39;").replace(/"/g,"&#34;");d={line:g[a].line-1,column:g[a].character,html:"<img src='"+this.problemImageUrl+"' title='"+d+"' alt='"+d+"'></img>",overviewStyle:{style:{backgroundColor:"lightcoral",border:"1px solid red"}}};if(f!==g[a].line){e.setAnnotation(g[a].line-1,d);f=g[a].line}}}}};return c}();
orion.editor.TextActions=function(){function c(g,a){this.editor=g;this.textView=g.getTextView();this.undoStack=a;this._incrementalFindActive=false;this._incrementalFindSuccess=true;this._incrementalFindIgnoreSelection=false;this._incrementalFindPrefix="";this.init()}c.prototype={init:function(){this._incrementalFindListener={onVerify:dojo.hitch(this,function(e){var f=this._incrementalFindPrefix,i=this.textView.getText(e.start,e.end);if((f=f.match(new RegExp("^"+dojo.regexp.escapeString(i),"i")))&&
f.length>0){f=this._incrementalFindPrefix+=e.text;this.editor.reportStatus("Incremental find: "+f);i=f.toLowerCase()===f;if(i=this.editor.doFind(f,this.textView.getSelection().start,i)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,i.index,i.index+i.length);this._incrementalFindIgnoreSelection=false}else{this.editor.reportStatus("Incremental find: "+f+" (not found)",true);this._incrementalFindSuccess=false}e.text=null}}),onSelection:dojo.hitch(this,
function(){this._incrementalFindIgnoreSelection||this.toggleIncrementalFind()})};var g="",a,d;this.textView.setKeyBinding(new orion.textview.KeyBinding("f",true),"Find...");this.textView.setAction("Find...",dojo.hitch(this,function(){setTimeout(dojo.hitch(this,function(){var e=this.textView.getSelection();g=e.end>e.start?this.textView.getText().substring(e.start,e.end):"";if(g=prompt("Enter search term or /regex/:",g)){e=g.toLowerCase()===g;var f=this.editor.parseRegExp(g);if(f){a=f.pattern;d=f.flags;
d+=e&&d.indexOf("i")===-1?"i":"";e=this.editor.doFindRegExp(a,d,this.textView.getCaretOffset())}else{d=a=null;e=this.editor.doFind(g,this.textView.getCaretOffset(),e)}e?this.editor.moveSelection(this.textView,e.index,e.index+e.length):this.editor.reportStatus("not found",true)}}),0);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true),"Find Next Occurrence");this.textView.setAction("Find Next Occurrence",dojo.hitch(this,function(){var e;if(this._incrementalFindActive){var f=
this._incrementalFindPrefix;e=f.toLowerCase()===f;e=this.editor.doFind(f,this.textView.getCaretOffset(),e)}else if(a)e=this.editor.doFindRegExp(a,d,this.textView.getCaretOffset());else{e=this.textView.getSelection();if(e.end>e.start)g=this.textView.getText().substring(e.start,e.end);e=this.editor.doFind(g,this.textView.getCaretOffset(),true)}if(e){this._incrementalFindIgnoreSelection=true;this.editor.moveSelection(this.textView,e.index,e.index+e.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("not found",
true);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("k",true,true),"Find Previous Occurrence");this.textView.setAction("Find Previous Occurrence",dojo.hitch(this,function(){var e=this.textView.getSelection(),f=e.end>e.start?e.end-e.start:0;if(this._incrementalFindActive){var i=this._incrementalFindPrefix;e=i.toLowerCase()===i;f=this.editor.doFind(i,this.textView.getCaretOffset()-f-1,e,true)}else if(a)f=this.editor.doFindRegExp(a,d,this.textView.getCaretOffset()-f-1,true);
else{if(f>0)g=this.textView.getText().substring(e.start,e.end);f=this.editor.doFind(g,this.textView.getCaretOffset()-f-1,true,true)}if(f){this._incrementalFindIgnoreSelection=true;this.editor.moveSelection(this.textView,f.index,f.index+f.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("not found",true);return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("j",true),"Incremental Find");this.textView.setAction("Incremental Find",dojo.hitch(this,function(){if(this._incrementalFindActive){var e=
this._incrementalFindPrefix;if(e.length!==0){var f=this.textView.getSelection().start+1;if(this._incrementalFindSuccess===false)f=0;var i=e.toLowerCase()===e;if(f=this.editor.doFind(e,f,i)){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,f.index,f.index+f.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+e)}else{this.editor.reportStatus("Incremental find: "+e+" (not found)",true);this._incrementalFindSuccess=
false}}}else{this.textView.setCaretOffset(this.textView.getCaretOffset());this.toggleIncrementalFind()}return true}));this.textView.setAction("deletePrevious",dojo.hitch(this,function(){if(this._incrementalFindActive){var e=this._incrementalFindPrefix;e=this._incrementalFindPrefix=e.substring(0,e.length-1);if(e.length===0){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.textView.setCaretOffset(this.textView.getSelection().start);this._incrementalFindIgnoreSelection=false;
this.toggleIncrementalFind();return true}this.editor.reportStatus("Incremental find: "+e);var f=this.textView.getText().lastIndexOf(e,this.textView.getCaretOffset()-e.length-1);if(f!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,f,f+e.length);this._incrementalFindIgnoreSelection=false}else this.editor.reportStatus("Incremental find: "+e+" (not found)",true);return true}else return false}));this.textView.setAction("tab",dojo.hitch(this,
function(){var e=this.textView.getSelection(),f=this.textView.getModel(),i=f.getLineAtOffset(e.start),j=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(i!==j){var h=[];h.push("");for(var l=i;l<=j;l++)h.push(f.getLine(l,true));this.startUndo();l=f.getLineStart(i);this.textView.setText(h.join("\t"),l,f.getLineEnd(j,true));this.textView.setSelection(l===e.start?e.start:e.start+1,e.end+(j-i+1));this.endUndo();return true}return false}));this.textView.setKeyBinding(new orion.textview.KeyBinding(9,false,
true),"Unindent Lines");this.textView.setAction("Unindent Lines",dojo.hitch(this,function(){for(var e=this.textView.getSelection(),f=this.textView.getModel(),i=f.getLineAtOffset(e.start),j=f.getLineAtOffset(e.end>e.start?e.end-1:e.end),h=[],l=i;l<=j;l++){var o=f.getLine(l,true);if(o.indexOf("\t")!==0)return false;h.push(o.substring(1))}this.startUndo();l=f.getLineStart(i);o=f.getLineStart(j);this.textView.setText(h.join(""),l,f.getLineEnd(j,true));this.textView.setSelection(l===e.start?e.start:e.start-
1,e.end-(j-i+1)+(e.end===o+1?1:0));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,false,false,true),"Move Lines Up");this.textView.setAction("Move Lines Up",dojo.hitch(this,function(){var e=this.textView.getSelection(),f=this.textView.getModel(),i=f.getLineAtOffset(e.start);if(i===0)return true;this.startUndo();var j=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);e=f.getLineCount()-1===j;var h=f.getLineStart(i);j=e?f.getCharCount():f.getLineStart(j+1);if(e){h=
f.getLineEnd(i-1);var l=f.getLineEnd(i-1,true),o=f.getText(h,l);h=h;f.setText(f.getText(l,j)+o,h,j)}l=f.getText(h,j);f.setText("",h,j);i=f.getLineStart(i-1);f.setText(l,i,i);f=i+l.length-(e?f.getLineDelimiter().length:0);this.textView.setSelection(i,f);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,false,false,true),"Move Lines Down");this.textView.setAction("Move Lines Down",dojo.hitch(this,function(){var e=this.textView.getSelection(),f=this.textView.getModel(),
i=f.getLineAtOffset(e.start),j=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);if(j===f.getLineCount()-1)return true;this.startUndo();e=j===f.getLineCount()-2;i=f.getLineStart(i);var h=f.getLineStart(j+1);if(e){var l=f.getLineStart(j+1)-f.getLineDelimiter().length,o=f.getLineStart(j+1);o=f.getText(l,o);f.setText(o+f.getText(i,l),i,h)}l=f.getText(i,h);j=(e?f.getCharCount():f.getLineStart(j+2))-(h-i);f.setText("",i,h);f.setText(l,j,j);this.textView.setSelection(j+(e?f.getLineDelimiter().length:0),j+
l.length);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(38,true,false,true),"Copy Lines Up");this.textView.setAction("Copy Lines Up",dojo.hitch(this,function(){this.startUndo();var e=this.textView.getSelection(),f=this.textView.getModel(),i=f.getLineDelimiter(),j=f.getLineAtOffset(e.start),h=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);j=f.getLineStart(j);h=(e=f.getLineCount()-1===h)?f.getCharCount():f.getLineStart(h+1);h=f.getText(j,h)+(e?i:"");f.setText(h,
j,j);this.textView.setSelection(j,j+h.length-(e?i.length:0));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(40,true,false,true),"Copy Lines Down");this.textView.setAction("Copy Lines Down",dojo.hitch(this,function(){this.startUndo();var e=this.textView.getSelection(),f=this.textView.getModel(),i=f.getLineDelimiter(),j=f.getLineAtOffset(e.start);e=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);var h=f.getLineStart(j);e=(j=f.getLineCount()-1===e)?f.getCharCount():
f.getLineStart(e+1);h=(j?i:"")+f.getText(h,e);f.setText(h,e,e);this.textView.setSelection(e+(j?i.length:0),e+h.length);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("d",true,false,false),"Delete Selected Lines");this.textView.setAction("Delete Selected Lines",dojo.hitch(this,function(){this.startUndo();var e=this.textView.getSelection(),f=this.textView.getModel(),i=f.getLineAtOffset(e.start);e=f.getLineAtOffset(e.end>e.start?e.end-1:e.end);i=f.getLineStart(i);
e=f.getLineCount()-1===e?f.getCharCount():f.getLineStart(e+1);f.setText("",i,e);this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding("l",true),"Goto Line...");this.textView.setAction("Goto Line...",dojo.hitch(this,function(){var e=this.textView.getModel().getLineAtOffset(this.textView.getCaretOffset());if(e=prompt("Go to line:",e+1)){e=parseInt(e,10);this.editor.onGotoLine(e-1,0)}return true}))},toggleIncrementalFind:function(){if(this._incrementalFindActive=!this._incrementalFindActive){this.editor.reportStatus("Incremental find: "+
this._incrementalFindPrefix);this.textView.addEventListener("Verify",this,this._incrementalFindListener.onVerify);this.textView.addEventListener("Selection",this,this._incrementalFindListener.onSelection)}else{this._incrementalFindPrefix="";this.editor.reportStatus("");this.textView.removeEventListener("Verify",this,this._incrementalFindListener.onVerify);this.textView.removeEventListener("Selection",this,this._incrementalFindListener.onSelection);this.textView.setCaretOffset(this.textView.getCaretOffset())}},
startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},cancel:function(){this.toggleIncrementalFind()},isActive:function(){return this._incrementalFindActive},lineUp:function(){var g;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;g=this.textView.getCaretOffset()-a.length-1;if(this._incrementalFindSuccess===false)g=this.textView.getModel().getCharCount()-1;g=this.textView.getText().lastIndexOf(a,
g);if(g!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,g,g+a.length);this._incrementalFindIgnoreSelection=false}else{this.editor.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},lineDown:function(){var g;if(this._incrementalFindActive){var a=this._incrementalFindPrefix;if(a.length===0)return;g=this.textView.getSelection().start+1;if(this._incrementalFindSuccess===
false)g=0;g=this.textView.getText().indexOf(a,g);if(g!==-1){this._incrementalFindIgnoreSelection=this._incrementalFindSuccess=true;this.editor.moveSelection(this.textView,g,g+a.length);this._incrementalFindIgnoreSelection=false;this.editor.reportStatus("Incremental find: "+a)}else{this.editor.reportStatus("Incremental find: "+a+" (not found)",true);this._incrementalFindSuccess=false}return true}return false},enter:function(){return false}};return c}();
orion.editor.SourceCodeActions=function(){function c(g,a,d){this.editor=g;this.textView=g.getTextView();this.undoStack=a;this.contentAssist=d;this.init()}c.prototype={startUndo:function(){this.undoStack&&this.undoStack.startCompoundChange()},endUndo:function(){this.undoStack&&this.undoStack.endCompoundChange()},init:function(){function g(a,d,e){var f=a.getLineAtOffset(d),i=a.getLineAtOffset(e),j,h,l,o,r,u;for(j=f;j>=0;j--){h=a.getLine(j);l=j===f?d-a.getLineStart(f):h.length;o=h.lastIndexOf("/*",l);
h=h.lastIndexOf("*/",l);if(h>o)break;else if(o!==-1){r=a.getLineStart(j)+o;break}}for(j=i;j<a.getLineCount();j++){h=a.getLine(j);l=j===i?e-a.getLineStart(i):0;o=h.indexOf("/*",l);h=h.indexOf("*/",l);if(o!==-1&&o<h)break;else if(h!==-1){u=a.getLineStart(j)+h;break}}return{commentStart:r,commentEnd:u}}this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true),"Toggle Line Comment");this.textView.setAction("Toggle Line Comment",dojo.hitch(this,function(){this.startUndo();for(var a=this.textView.getSelection(),
d=this.textView.getModel(),e=d.getLineAtOffset(a.start),f=d.getLineAtOffset(a.end>a.start?a.end-1:a.end),i=true,j,h=e;h<=f&&i;h++){j=this.textView.getModel().getLine(h);var l=j.indexOf("//");if(l===-1)i=false;else if(l!==0){for(i=0;i<l;i++){var o=j.charCodeAt(i);if(!(o===32||o===9))break}i=i===l}}h=[];l=d.getLineStart(e);if(i){o=d.getLineStart(f);for(i=e;i<=f;i++){var r=d.getLine(i,true),u=j.indexOf("//");h.push(r.substring(0,u)+r.substring(u+2))}this.textView.setText(h.join(""),l,d.getLineEnd(f,
true));this.textView.setSelection(l===a.start?a.start:a.start-2,a.end-2*(f-e+1)+(a.end===o+1?2:0))}else{h.push("");for(i=e;i<=f;i++)h.push(d.getLine(i,true));this.textView.setText(h.join("//"),l,d.getLineEnd(f,true));this.textView.setSelection(l===a.start?a.start:a.start+2,a.end+2*(f-e+1))}this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(191,true,true),"Add Block Comment");this.textView.setAction("Add Block Comment",dojo.hitch(this,function(){var a=this.textView.getSelection(),
d=this.textView.getModel(),e=new RegExp("/\\*|\\*/","g");d.getLineAtOffset(a.start);d.getLineAtOffset(a.end);var f=g(d,a.start,a.end);if(f.commentStart!==undefined&&f.commentEnd!==undefined)return true;f=d.getText(a.start,a.end);if(f.length===0)return true;var i=f.length;f=f.replace(e,"");e=f.length;this.startUndo();d.setText("/*"+f+"*/",a.start,a.end);this.textView.setSelection(a.start+2,a.end+2+(e-i));this.endUndo();return true}));this.textView.setKeyBinding(new orion.textview.KeyBinding(220,true,
true),"Remove Block Comment");this.textView.setAction("Remove Block Comment",dojo.hitch(this,function(){var a=this.textView.getSelection(),d=this.textView.getModel();d.getLineAtOffset(a.start);d.getLineAtOffset(a.end);var e=d.getText(a.start,a.end),f,i,j;for(j=0;j<e.length;j++)if(e.substring(j,j+2)==="/*"){f=a.start+j;break}for(;j<e.length;j++)if(e.substring(j,j+2)==="*/"){i=a.start+j;break}this.startUndo();if(f!==undefined&&i!==undefined){d.setText(d.getText(f+2,i),f,i+2);this.textView.setSelection(f,
i)}else{e=g(d,a.start,a.end);if(e.commentStart===undefined||e.commentEnd===undefined)return true;f=d.getText(e.commentStart+2,e.commentEnd);d.setText(f,e.commentStart,e.commentEnd+2);this.textView.setSelection(a.start-2,a.end-2)}this.endUndo();return true}));this.textView.setAction("enter",dojo.hitch(this,function(){if(this.contentAssist&&this.contentAssist.isActive())return this.contentAssist.enter();var a=this.textView.getSelection();if(a.start===a.end){var d=this.textView.getModel(),e=d.getLineAtOffset(a.start),
f=d.getLine(e),i=d.getLineStart(e);e=0;i=a.start-i;for(var j;e<i&&((j=f.charCodeAt(e))===32||j===9);)e++;if(e>0){var h=f.substring(0,e);for(e=i;e<f.length&&((j=f.charCodeAt(e++))===32||j===9);)a.end++;this.textView.setText(d.getLineDelimiter()+h,a.start,a.end);return true}}return false}))},cancel:function(){return false},isActive:function(){return false},lineUp:function(){return false},lineDown:function(){return false},enter:function(){return false}};return c}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/editor/editorFeatures",["dojo","orion/textview/undoStack","orion/textview/keyBinding","orion/textview/rulers"],function(){return orion.editor});
define("orion/breadcrumbs",["dojo"],function(c){function g(a){this._init(a)}g.prototype={_init:function(a){var d=a.container;if(typeof d==="string")d=c.byId(d);if(!d)throw"no parent container";this._container=d;c.removeClass(d,"currentLocation");this._id=a.id||"eclipse.breadcrumbs";this._resource=a.resource||null;this._firstSegmentName=a.firstSegmentName;this._makeHref=a.makeHref;this.path="";this.render()},getNavigatorRootSegment:function(){if(this._firstSegmentName){var a=document.createElement("a");
c.place(document.createTextNode(this._firstSegmentName),a,"only");a.href="/navigate/table.html#";return a}return null},render:function(){var a=this._container,d=c.byId(this._id);if(d)c.empty(d);else{d=document.createElement("span");d.id=this._id;a.appendChild(d)}var e;if(e=this.getNavigatorRootSegment()){c.addClass(e,"breadcrumb");d.appendChild(e);if(this._resource&&this._resource.Parents){e=document.createElement("span");c.place(document.createTextNode(" / "),e,"only");this.path+="/";c.addClass(e,
"breadcrumb");d.appendChild(e)}else{e.href="";c.removeClass(e,"breadcrumb");c.addClass(e,"currentLocation")}}if(this._resource&&this._resource.Parents){a=this._resource.Parents;for(var f=a.length;--f>=0;){e=document.createElement("a");c.addClass(e,"breadcrumb");c.place(document.createTextNode(a[f].Name),e,"only");this.path+=a[f].Name;if(this._makeHref)this._makeHref(e,a[f].ChildrenLocation);else e.href="/navigate/table.html#"+a[f].ChildrenLocation;d.appendChild(e);e=document.createElement("span");
c.place(document.createTextNode(" / "),e,"only");this.path+="/";c.addClass(e,"breadcrumb");d.appendChild(e)}if(this._resource){e=document.createElement("a");c.place(document.createTextNode(this._resource.Name),e,"only");c.addClass(e,"breadcrumb");c.addClass(e,"currentLocation");this.path+=this._resource.Name;d.appendChild(e)}}if(d.childNodes.length===0){e=document.createElement("a");c.place(document.createTextNode(document.title),e,"only");c.addClass(e,"breadcrumb");c.addClass(e,"currentLocation");
d.appendChild(e)}}};g.prototype.constructor=g;return{BreadCrumbs:g}});
define("orion/compare/gap-model",[],function(){var c=c||{};c.GapTextModel=function(){function g(a,d,e){this._model=a;this._myIndex=(this._isOriginal=d===undefined?true:d)?1:0;this._reverseIndex=1-this._myIndex;this._map=e;this._listeners=[];a.addListener(this);this._init()}navigator.platform.indexOf("Win");g.prototype={_init:function(){this._generateGapBlocks()},_generateGapBlocks:function(){this._gapBlocks=[];for(var a=this._gapNumber=0,d=0;d<this._map.length;d++){if(this._map[d][this._myIndex]<
this._map[d][this._reverseIndex]){var e=this._map[d][this._reverseIndex]-this._map[d][this._myIndex];this._gapNumber+=e;this._gapBlocks.push([a+this._map[d][this._myIndex],e])}a+=Math.max(this._map[d][this._reverseIndex],this._map[d][this._myIndex])}},lookUpRealIndex:function(a){for(var d=0,e=0;e<this._gapBlocks.length;e++){var f=this._gapBlocks[e][0],i=this._gapBlocks[e][0]+this._gapBlocks[e][1]-1;if(a<f)break;if(a>=f&&a<=i)return{lineIndex:-1,gapsBefore:d+a-f};d+=this._gapBlocks[e][1]}return{lineIndex:a-
d,gapsBefore:d}},getLineType:function(a){for(var d=0,e=0;e<this._map.length;e++){var f=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex]);if(a>=d&&a<d+f){if(this._map[e][2]===0)return"unchnaged";else if(this._map[e][2]<0)return"removed";else if(this._map[e][1]===0)return"added";else if(a<this._map[e][this._myIndex]+d)return"changed";return"changed_gap"}d+=Math.max(this._map[e][this._reverseIndex],this._map[e][this._myIndex])}return"unchnaged"},addListener:function(a){this._listeners.push(a)},
removeListener:function(a){for(var d=0;d<this._listeners.length;d++)if(this._listeners[d]===a){this._listeners.splice(d,1);return}},getCharCount:function(){var a=this._model.getCharCount();a+=this._gapNumber*this.getLineDelimiter().length;return a},getLine:function(a,d){var e=this.getLineCount();if(!(0<=a&&a<e))return null;a=this.lookUpRealIndex(a);if(a.lineIndex<0){if(d)return this.getLineDelimiter();return""}else return this._model.getLine(a.lineIndex,d)},getLineAtOffset:function(a){if(!(0<=a&&
a<=this.getCharCount()))return-1;for(var d=this.getLineCount(),e=0,f=0;e<d;){var i=this.lookUpRealIndex(e);f+=i.lineIndex<0?this.getLineDelimiter().length:this._model.getLine(i.lineIndex,true).length;e++;if(f>a)break}return e-1},getLineCount:function(){return this._model.getLineCount()+this._gapNumber},getLineDelimiter:function(){return this._model.getLineDelimiter()},getLineEnd:function(a,d){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;var f=this.lookUpRealIndex(a);e=f.gapsBefore*this.getLineDelimiter().length;
if(f.lineIndex<0){a=a-f.gapsBefore;if(a>0)e+=this._model.getLineEnd(a-1,true);if(d)e+=this.getLineDelimiter().length}else e+=this._model.getLineEnd(f.lineIndex,d);return e},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;var d=this.lookUpRealIndex(a),e=0,f=-1;if(d.lineIndex<0){e=d.gapsBefore;if(a-e>=0)f=a-e-1}else{e=d.gapsBefore;f=d.lineIndex}a=0;a+=this.getLineDelimiter().length*e;if(f>=0)a+=d.lineIndex<0?this._model.getLineEnd(f,true):this._model.getLineStart(f);return a},getText:function(a,
d){return this._model.getText(a,d)},onChanging:function(a,d,e,f,i,j){for(var h=0;h<this._listeners.length;h++){var l=this._listeners[h];l&&l.onChanging&&l.onChanging(a,d,e,f,i,j)}},onChanged:function(a,d,e,f,i){for(var j=0;j<this._listeners.length;j++){var h=this._listeners[j];h&&h.onChanged&&h.onChanged(a,d,e,f,i)}},setText:function(a,d,e){this._model.setText(a,d,e)}};return g}();return c});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextModel=function(){function c(a,d){this._listeners=[];this._lineDelimiter=d?d:g?"\r\n":"\n";this._lastLineIndex=-1;this._text=[""];this._lineOffsets=[0];this.setText(a)}var g=window.navigator.platform.indexOf("Win")!==-1;c.prototype={addListener:function(a){this._listeners.push(a)},removeListener:function(a){for(var d=0;d<this._listeners.length;d++)if(this._listeners[d]===a){this._listeners.splice(d,1);return}},getCharCount:function(){for(var a=0,d=0;d<this._text.length;d++)a+=this._text[d].length;
return a},getLine:function(a,d){var e=this.getLineCount();if(!(0<=a&&a<e))return null;var f=this._lineOffsets[a];if(a+1<e){a=this.getText(f,this._lineOffsets[a+1]);if(d)return a;d=a.length;for(var i;(i=a.charCodeAt(d-1))===10||i===13;)d--;return a.substring(0,d)}else return this.getText(f)},getLineAtOffset:function(a){if(!(0<=a&&a<=this.getCharCount()))return-1;var d=this.getLineCount(),e=this.getCharCount();if(a===e)return d-1;var f,i,j=this._lastLineIndex;if(0<=j&&j<d){f=this._lineOffsets[j];i=
j+1<d?this._lineOffsets[j+1]:e;if(f<=a&&a<i)return j}for(var h=d,l=-1;h-l>1;){j=Math.floor((h+l)/2);f=this._lineOffsets[j];i=j+1<d?this._lineOffsets[j+1]:e;if(a<=f)h=j;else if(a<i){h=j;break}else l=j}return this._lastLineIndex=h},getLineCount:function(){return this._lineOffsets.length},getLineDelimiter:function(){return this._lineDelimiter},getLineEnd:function(a,d){var e=this.getLineCount();if(!(0<=a&&a<e))return-1;if(a+1<e){e=this._lineOffsets[a+1];if(d)return e;a=this.getText(Math.max(this._lineOffsets[a],
e-2),e);d=a.length;for(var f;(f=a.charCodeAt(d-1))===10||f===13;)d--;return e-(a.length-d)}else return this.getCharCount()},getLineStart:function(a){if(!(0<=a&&a<this.getLineCount()))return-1;return this._lineOffsets[a]},getText:function(a,d){if(a===undefined)a=0;if(d===undefined)d=this.getCharCount();for(var e=0,f=0,i;f<this._text.length;){i=this._text[f].length;if(a<=e+i)break;e+=i;f++}for(var j=e,h=f;f<this._text.length;){i=this._text[f].length;if(d<=e+i)break;e+=i;f++}e=e;f=f;if(h===f)return this._text[h].substring(a-
j,d-e);a=this._text[h].substring(a-j);d=this._text[f].substring(0,d-e);return a+this._text.slice(h+1,f).join("")+d},onChanging:function(a,d,e,f,i,j){for(var h=0;h<this._listeners.length;h++){var l=this._listeners[h];l&&l.onChanging&&l.onChanging(a,d,e,f,i,j)}},onChanged:function(a,d,e,f,i){for(var j=0;j<this._listeners.length;j++){var h=this._listeners[j];h&&h.onChanged&&h.onChanged(a,d,e,f,i)}},setText:function(a,d,e){if(a===undefined)a="";if(d===undefined)d=0;if(e===undefined)e=this.getCharCount();
for(var f=this.getLineAtOffset(d),i=this.getLineAtOffset(e),j=d,h=e-d,l=i-f,o=a.length,r=0,u=this.getLineCount(),s=0,q=0,v=0,y=[];;){if(s!==-1&&s<=v)s=a.indexOf("\r",v);if(q!==-1&&q<=v)q=a.indexOf("\n",v);if(q===-1&&s===-1)break;v=s!==-1&&q!==-1?s+1===q?q+1:(s<q?s:q)+1:s!==-1?s+1:q+1;y.push(d+v);r++}this.onChanging(a,j,h,o,l,r);if(y.length===0){s=this.getLineStart(f);i=i+1<u?this.getLineStart(i+1):this.getCharCount();if(d!==s){a=this.getText(s,d)+a;d=s}if(e!==i){a+=this.getText(e,i);e=i}}i=o-h;for(s=
f+l+1;s<u;s++)this._lineOffsets[s]+=i;f=[f+1,l].concat(y);Array.prototype.splice.apply(this._lineOffsets,f);for(i=y=0;i<this._text.length;){s=this._text[i].length;if(d<=y+s)break;y+=s;i++}u=y;for(f=i;i<this._text.length;){s=this._text[i].length;if(e<=y+s)break;y+=s;i++}y=y;i=i;s=this._text[i];d=this._text[f].substring(0,d-u);e=s.substring(e-y);f=[f,i-f+1];d&&f.push(d);a&&f.push(a);e&&f.push(e);Array.prototype.splice.apply(this._text,f);if(this._text.length===0)this._text=[""];this.onChanged(j,h,o,
l,r)}};return c}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/textModel",[],function(){return orion.textview});orion=orion||{};orion.textview=orion.textview||{};
orion.textview.TextView=function(){function c(k,m,n,p){typeof k.addEventListener==="function"?k.addEventListener(m,n,p===true):k.attachEvent("on"+m,n)}function g(k,m,n,p){typeof k.removeEventListener==="function"?k.removeEventListener(m,n,p===true):k.detachEvent("on"+m,n)}function a(k){this._init(k)}var d=document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined,e=parseFloat(navigator.userAgent.split("Firefox/")[1]||navigator.userAgent.split("Minefield/")[1])||
undefined,f=navigator.userAgent.indexOf("Opera")!==-1,i=navigator.userAgent.indexOf("Chrome")!==-1,j=navigator.userAgent.indexOf("Safari")!==-1,h=navigator.userAgent.indexOf("WebKit")!==-1,l=navigator.userAgent.indexOf("iPad")!==-1,o=navigator.platform.indexOf("Mac")!==-1,r=navigator.platform.indexOf("Win")!==-1,u=navigator.platform.indexOf("Linux")!==-1,s=typeof window.document.documentElement.addEventListener==="function",q=(!d||d>=9)&&typeof window.document.createRange().getBoundingClientRect===
"function",v=r?"\r\n":"\n",y=function(){function k(m,n,p){this.start=m;this.end=n;this.caret=p}k.prototype={clone:function(){return new k(this.start,this.end,this.caret)},collapse:function(){if(this.caret)this.end=this.start;else this.start=this.end},extend:function(m){if(this.caret)this.start=m;else this.end=m;if(this.start>this.end){m=this.start;this.start=this.end;this.end=m;this.caret=!this.caret}},setCaret:function(m){this.end=this.start=m;this.caret=false},getCaret:function(){return this.caret?
this.start:this.end},toString:function(){return"start="+this.start+" end="+this.end+(this.caret?" caret is at start":" caret is at end")},isEmpty:function(){return this.start===this.end},equals:function(m){return this.caret===m.caret&&this.start===m.start&&this.end===m.end}};return k}(),x=function(){function k(){this._listeners={}}k.prototype={addEventListener:function(m,n,p,t){this._listeners[m]||(this._listeners[m]=[]);this._listeners[m].push({context:n,func:p,data:t})},sendEvent:function(m,n){if(m=
this._listeners[m])for(var p=0,t=m.length;p<t;p++){var w=m[p];w&&w.context&&w.func&&w.func.call(w.context,n,w.data)}},removeEventListener:function(m,n,p,t){if(m=this._listeners[m])for(var w=0,z=m.length;w<z;w++){var A=m[w];if(A.context===n&&A.func===p&&A.data===t){m.splice(w,1);break}}}};return k}();a.prototype={addEventListener:function(k,m,n,p){this._eventTable.addEventListener(k,m,n,p)},addRuler:function(k){var m=this._frameDocument,n=m.body,p=k.getLocation(),t=p==="left"?this._leftDiv:this._rightDiv;
if(!t){t=m.createElement("DIV");t.style.overflow="hidden";t.style.MozUserSelect="none";t.style.WebkitUserSelect="none";d&&t.attachEvent("onselectstart",function(){return false});t.style.position="absolute";t.style.top="0px";t.style.cursor="default";n.appendChild(t);if(p==="left"){this._leftDiv=t;t.className="viewLeftRuler"}else{this._rightDiv=t;t.className="viewRightRuler"}n=m.createElement("TABLE");t.appendChild(n);n.cellPadding="0px";n.cellSpacing="0px";n.border="0px";n.insertRow(0);var w=this;
c(t,"click",function(z){w._handleRulerEvent(z)});c(t,"dblclick",function(z){w._handleRulerEvent(z)})}m=m.createElement("DIV");m._ruler=k;m.rulerChanged=true;m.style.position="relative";t=t.firstChild.rows[0];t=t.insertCell(t.cells.length);t.vAlign="top";t.appendChild(m);k.setView(this);this._updatePage()},convert:function(k,m,n){var p=this._getScroll(),t=this._getViewPadding(),w=this._frame.getBoundingClientRect(),z=this._viewDiv.getBoundingClientRect();switch(m){case "document":if(k.x!==undefined)k.x+=
-p.x+z.left+t.left;if(k.y!==undefined)k.y+=-p.y+z.top+t.top;break;case "page":if(k.x!==undefined)k.x+=-w.left;if(k.y!==undefined)k.y+=-w.top;break}switch(n){case "document":if(k.x!==undefined)k.x+=p.x-z.left-t.left;if(k.y!==undefined)k.y+=p.y-z.top-t.top;break;case "page":if(k.x!==undefined)k.x+=w.left;if(k.y!==undefined)k.y+=w.top;break}},destroy:function(){this._setGrab(null);this._unhookEvents();var k=function(m){if(m){m=m.firstChild.rows[0].cells;for(var n=0;n<m.length;n++)m[n].firstChild._ruler.setView(null)}};
k(this._leftDiv);k(this._rightDiv);if(this._autoScrollTimerID){clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=null}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}k=this._parent;k.removeChild(this._frame);if(l){k.removeChild(this._touchDiv);this._textArea=this._selDiv3=this._selDiv2=this._selDiv1=this._touchDiv=null}this.onDestroy({});this._actions=this._keyBindings=this._overlayDiv=this._clientDiv=this._viewDiv=this._scrollDiv=this._frameWindow=this._frameDocument=
this._frame=this._eventTable=this._doubleClickSelection=this._selection=this._model=this._parentDocument=this._parent=null},focus:function(){this._updateDOMSelection();if(l)this._textArea.focus();else{f&&this._clientDiv.blur();this._clientDiv.focus()}this._updateDOMSelection()},getActions:function(k){for(var m=[],n=this._actions,p=0;p<n.length;p++)!k&&n[p].defaultHandler||m.push(n[p].name);return m},getBottomIndex:function(k){return this._getBottomIndex(k)},getBottomPixel:function(){return this._getScroll().y+
this._getClientHeight()},getCaretOffset:function(){return this._getSelection().getCaret()},getClientArea:function(){var k=this._getScroll();return{x:k.x,y:k.y,width:this._getClientWidth(),height:this._getClientHeight()}},getHorizontalPixel:function(){return this._getScroll().x},getKeyBindings:function(k){for(var m=[],n=this._keyBindings,p=0;p<n.length;p++)n[p].name===k&&m.push(n[p].keyBinding);return m},getLineHeight:function(){return this._getLineHeight()},getLinePixel:function(k){k=Math.min(Math.max(0,
k),this._model.getLineCount());return this._getLineHeight()*k},getLocationAtOffset:function(k){var m=this._model;k=Math.min(Math.max(0,k),m.getCharCount());m=m.getLineAtOffset(k);var n=this._getScroll(),p=this._viewDiv.getBoundingClientRect(),t=this._getViewPadding();k=this._getOffsetToX(k)+n.x-p.left-t.left;m=this.getLinePixel(m);return{x:k,y:m}},getModel:function(){return this._model},getOffsetAtLocation:function(k,m){var n=this._getScroll(),p=this._viewDiv.getBoundingClientRect(),t=this._getViewPadding();
m=this._getYToLine(m-n.y);k+=-n.x+p.left+t.left;return this._getXToOffset(m,k)},getSelection:function(){var k=this._getSelection();return{start:k.start,end:k.end}},getText:function(k,m){return this._model.getText(k,m)},getTopIndex:function(k){return this._getTopIndex(k)},getTopPixel:function(){return this._getScroll().y},invokeAction:function(k,m){for(var n=this._actions,p=0;p<n.length;p++){var t=n[p];if(t.name&&t.name===k){if(!m&&t.userHandler)if(t.userHandler())return;if(t.defaultHandler)return t.defaultHandler();
return false}}return false},onContextMenu:function(k){this._eventTable.sendEvent("ContextMenu",k)},onDestroy:function(k){this._eventTable.sendEvent("Destroy",k)},onLineStyle:function(k){this._eventTable.sendEvent("LineStyle",k)},onModelChanged:function(k){this._eventTable.sendEvent("ModelChanged",k)},onModelChanging:function(k){this._eventTable.sendEvent("ModelChanging",k)},onModify:function(k){this._eventTable.sendEvent("Modify",k)},onSelection:function(k){this._eventTable.sendEvent("Selection",
k)},onScroll:function(k){this._eventTable.sendEvent("Scroll",k)},onVerify:function(k){this._eventTable.sendEvent("Verify",k)},redrawLines:function(k,m,n){if(k===undefined)k=0;if(m===undefined)m=this._model.getLineCount();if(k!==m){var p=this._clientDiv;if(n)for(var t=(n.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0].cells,w=0;w<t.length;w++)if(t[w].firstChild._ruler===n){p=t[w].firstChild;break}if(n)p.rulerChanged=true;if(!n||n.getOverview()==="page")for(p=p.firstChild;p;){t=
p.lineIndex;if(k<=t&&t<m)p.lineChanged=true;p=p.nextSibling}if(!n)if(k<=this._maxLineIndex&&this._maxLineIndex<m){this._maxLineIndex=-1;this._maxLineWidth=0}this._queueUpdatePage()}},redrawRange:function(k,m){var n=this._model;if(k===undefined)k=0;if(m===undefined)m=n.getCharCount();if(k!==m){k=n.getLineAtOffset(k);m=n.getLineAtOffset(Math.max(0,m-1))+1;this.redrawLines(k,m)}},removeEventListener:function(k,m,n,p){this._eventTable.removeEventListener(k,m,n,p)},removeRuler:function(k){k.setView(null);
for(var m=(k.getLocation()==="left"?this._leftDiv:this._rightDiv).firstChild.rows[0],n=m.cells,p=0;p<n.length;p++)if(n[p].firstChild._ruler===k)break;if(p!==n.length){m.cells[p]._ruler=undefined;m.deleteCell(p);this._updatePage()}},setAction:function(k,m){if(k){for(var n=this._actions,p=0;p<n.length;p++){var t=n[p];if(t.name===k){t.userHandler=m;return}}n.push({name:k,userHandler:m})}},setKeyBinding:function(k,m){for(var n=this._keyBindings,p=0;p<n.length;p++){var t=n[p];if(t.keyBinding.equals(k)){if(m)t.name=
m;else if(t.predefined)t.name=null;else{k=t.name;n.splice(p,1);for(p=0;p<n.length&&k!==n[p].name;)p++;if(p===n.length){n=this._actions;for(p=0;p<n.length;p++)if(n[p].name===k)n[p].defaultHandler||n.splice(p,1)}}return}}m&&n.push({keyBinding:k,name:m})},setCaretOffset:function(k,m){var n=this._model.getCharCount();k=Math.max(0,Math.min(k,n));this._setSelection(new y(k,k,false),m===undefined||m)},setHorizontalPixel:function(k){k=Math.max(0,k);this._scrollView(k-this._getScroll().x,0)},setModel:function(k){if(k){this._model.removeListener(this._modelListener);
var m=this._model.getLineCount(),n=this._model.getCharCount(),p=k.getLineCount(),t=k.getCharCount(),w={text:k.getText(),start:0,removedCharCount:n,addedCharCount:t,removedLineCount:m,addedLineCount:p};this.onModelChanging(w);this.redrawRange();this._model=k;w={start:0,removedCharCount:n,addedCharCount:t,removedLineCount:m,addedLineCount:p};this.onModelChanged(w);this._model.addListener(this._modelListener);this.redrawRange()}},setSelection:function(k,m,n){var p=k>m;if(p){var t=k;k=m;m=t}t=this._model.getCharCount();
k=Math.max(0,Math.min(k,t));m=Math.max(0,Math.min(m,t));this._setSelection(new y(k,m,p),n===undefined||n)},setText:function(k,m,n){var p=m===undefined&&n===undefined;if(m===undefined)m=0;if(n===undefined)n=this._model.getCharCount();this._modifyContent({text:k,start:m,end:n,_code:true},!p);if(p){this._columnX=-1;this._setSelection(new y(0,0,false),true);if(e){k=this._hasFocus;m=this._clientDiv;k&&m.blur();m.contentEditable=false;m.contentEditable=true;k&&m.focus()}}},setTopIndex:function(k){var m=
this._model;if(m.getCharCount()!==0){m=m.getLineCount();var n=this._getLineHeight(),p=Math.max(1,Math.min(m,Math.floor(this._getClientHeight()/n)));if(k<0)k=0;else if(k>m-p)k=m-p;this._scrollView(0,k*n-this._getScroll().y)}},setTopPixel:function(k){var m=this._getLineHeight(),n=this._getClientHeight(),p=this._model.getLineCount();k=Math.min(Math.max(0,k),m*p-n);this._scrollView(0,k-this._getScroll().y)},showSelection:function(){return this._showCaret()},_handleBodyMouseDown:function(k){if(!k)k=window.event;
for(var m=f?this._clientDiv:this._overlayDiv||this._viewDiv,n=k.target?k.target:k.srcElement;n;){if(m===n)return;n=n.parentNode}k.preventDefault&&k.preventDefault();k.stopPropagation&&k.stopPropagation();if(!s){m.setCapture();setTimeout(function(){m.releaseCapture()},0)}},_handleBlur:function(){this._hasFocus=false;if(d<9)if(!this._getSelection().isEmpty()){var k=this._frameDocument,m=k.createElement("DIV");k=k.body;k.appendChild(m);k.removeChild(m)}if(e||d)if(this._selDiv1){m=d?"transparent":"#AFAFAF";
this._selDiv1.style.background=m;this._selDiv2.style.background=m;this._selDiv3.style.background=m}},_handleContextMenu:function(k){if(!k)k=window.event;var m=this._getScroll(),n=this._viewDiv.getBoundingClientRect(),p=this._getViewPadding();this.onContextMenu({x:k.clientX+m.x-n.left-p.left,y:k.clientY+m.y-n.top-p.top,screenX:k.screenX,screenY:k.screenY});k.preventDefault&&k.preventDefault();return false},_handleCopy:function(k){if(!this._ignoreCopy){if(!k)k=window.event;if(this._doCopy(k)){k.preventDefault&&
k.preventDefault();return false}}},_handleCut:function(k){if(!k)k=window.event;if(this._doCut(k)){k.preventDefault&&k.preventDefault();return false}},_handleDataModified:function(){this._startIME()},_handleDblclick:function(k){if(!k)k=window.event;this._lastMouseTime=k.timeStamp?k.timeStamp:(new Date).getTime();if(this._clickCount!==2){this._clickCount=2;this._handleMouse(k)}},_handleDragStart:function(k){if(!k)k=window.event;k.preventDefault&&k.preventDefault();return false},_handleDragOver:function(k){if(!k)k=
window.event;k.dataTransfer.dropEffect="none";k.preventDefault&&k.preventDefault();return false},_handleDrop:function(k){if(!k)k=window.event;k.preventDefault&&k.preventDefault();return false},_handleDocFocus:function(){this._clientDiv.focus()},_handleFocus:function(){this._hasFocus=true;d&&this._updateDOMSelection();if(e||d)if(this._selDiv1){var k=this._hightlightRGB;this._selDiv1.style.background=k;this._selDiv2.style.background=k;this._selDiv3.style.background=k}},_handleKeyDown:function(k){if(!k)k=
window.event;if(l){if(k.keyCode===8){this._doBackspace({});k.preventDefault()}}else{if(k.keyCode===229){if(this.readonly){k.preventDefault&&k.preventDefault();return false}this._startIME()}else this._commitIME();if((o||u)&&e<4||f){this._keyDownEvent=k;return true}if(this._doAction(k)){if(k.preventDefault)k.preventDefault();else{k.cancelBubble=true;k.returnValue=false;k.keyCode=0}return false}}},_handleKeyPress:function(k){if(!k)k=window.event;if(o&&h)if(63232<=k.keyCode&&k.keyCode<=63487||k.keyCode===
13||k.keyCode===8){k.preventDefault&&k.preventDefault();return false}if((o||u)&&e<4||f)if(this._doAction(this._keyDownEvent)){k.preventDefault&&k.preventDefault();return false}var m=o?k.metaKey:k.ctrlKey;if(k.charCode!==undefined)if(m)switch(k.charCode){case 99:case 118:case 120:return true}m=false;if(o){if(k.ctrlKey||k.metaKey)m=true}else if(e){if(k.ctrlKey||k.altKey)m=true}else if(k.ctrlKey^k.altKey)m=true;if(!m){m=f?k.which:k.charCode!==undefined?k.charCode:k.keyCode;if(m>31){this._doContent(String.fromCharCode(m));
k.preventDefault&&k.preventDefault();return false}}},_handleKeyUp:function(k){if(!k)k=window.event;k.keyCode===13&&this._commitIME()},_handleMouse:function(k){var m=this._frameWindow;if(d)m=this._clientDiv;if(this._overlayDiv){var n=this;setTimeout(function(){n.focus()},0)}if(this._clickCount===1){this._setGrab(m);this._setSelectionTo(k.clientX,k.clientY,k.shiftKey)}else{s&&this._setGrab(m);this._doubleClickSelection=null;this._setSelectionTo(k.clientX,k.clientY,k.shiftKey);this._doubleClickSelection=
this._getSelection()}},_handleMouseDown:function(k){if(!k)k=window.event;var m=k.which?k.button===0:k.button===1;this._commitIME();if(m){this._isMouseDown=true;m=Math.abs(this._lastMouseX-k.clientX);var n=Math.abs(this._lastMouseY-k.clientY),p=k.timeStamp?k.timeStamp:(new Date).getTime();if(p-this._lastMouseTime<=this._clickTime&&m<=this._clickDist&&n<=this._clickDist)this._clickCount++;else this._clickCount=1;this._lastMouseX=k.clientX;this._lastMouseY=k.clientY;this._lastMouseTime=p;this._handleMouse(k);
if(f){this._hasFocus||this.focus();k.preventDefault()}}},_handleMouseMove:function(k){if(!k)k=window.event;if(!s){if(k.button===0){this._setGrab(null);return true}if(!this._isMouseDown&&k.button===1&&(this._clickCount&1)!==0){this._clickCount=2;return this._handleMouse(k,this._clickCount)}}var m=k.clientX;k=k.clientY;var n=this._getViewPadding(),p=this._viewDiv.getBoundingClientRect(),t=this._getClientWidth(),w=this._getClientHeight(),z=p.left+n.left,A=p.top+n.top;t=p.left+n.left+t;n=p.top+n.top+
w;p=this._model;w=p.getLineAtOffset(this._getSelection().getCaret());if(k<A&&w!==0)this._doAutoScroll("up",m,k-A);else if(k>n&&w!==p.getLineCount()-1)this._doAutoScroll("down",m,k-n);else if(m<z)this._doAutoScroll("left",m-z,k);else if(m>t)this._doAutoScroll("right",m-t,k);else{this._endAutoScroll();this._setSelectionTo(m,k,true);d&&this._frameDocument.body.getBoundingClientRect()}},_handleMouseUp:function(k){if(!k)k=window.event;this._endAutoScroll();if(k.which?k.button===0:k.button===1){this._isMouseDown=
false;s&&this._setGrab(null)}},_handleMouseWheel:function(k){if(!k)k=window.event;var m=this._getLineHeight(),n=0,p=0;if(e){m=o?k.detail*3:Math.max(-256,Math.min(256,k.detail))*m;if(k.axis===k.HORIZONTAL_AXIS)n=m;else p=m}else if(o){p=n=40;if(i){if(k.wheelDeltaX%120!==0)n=1;if(k.wheelDeltaY%120!==0)p=1}n=-k.wheelDeltaX/n;if(-1<n&&n<0)n=-1;if(0<n&&n<1)n=1;p=-k.wheelDeltaY/p;if(-1<p&&p<0)p=-1;if(0<p&&p<1)p=1}else{n=-k.wheelDeltaX;p=-k.wheelDeltaY/120*8*m}if(j){for(m=k.target;m&&m.lineIndex===undefined;)m=
m.parentNode;this._mouseWheelLine=m}m=this._getScroll();this._scrollView(n,p);n=this._getScroll();if(j)this._mouseWheelLine=null;if(m.x!==n.x||m.y!==n.y){k.preventDefault&&k.preventDefault();return false}},_handlePaste:function(k){if(!this._ignorePaste){if(!k)k=window.event;if(this._doPaste(k)){if(d){var m=this;setTimeout(function(){m._updateDOMSelection()},0)}k.preventDefault&&k.preventDefault();return false}}},_handleResize:function(){var k=this._frameDocument.documentElement,m=k.clientWidth;k=
k.clientHeight;if(this._frameWidth!==m||this._frameHeight!==k){this._frameWidth=m;this._frameHeight=k;this._updatePage()}},_handleRulerEvent:function(k){if(!k)k=window.event;var m=k.target?k.target:k.srcElement,n=m.lineIndex;for(m=m;m&&!m._ruler;){if(n===undefined&&m.lineIndex!==undefined)n=m.lineIndex;m=m.parentNode}m=m?m._ruler:null;if(l&&n===undefined&&m&&m.getOverview()==="document"){var p=this._getClientHeight(),t=this._getLineHeight(),w=this._getViewPadding();p=p+w.top+w.bottom-34;w=this._model.getLineCount()*
t;this.setTopPixel(Math.floor((k.clientY-17-t)*w/p))}if(m)switch(k.type){case "click":m.onClick&&m.onClick(n,k);break;case "dblclick":m.onDblClick&&m.onDblClick(n,k);break}},_handleScroll:function(){this._doScroll(this._getScroll())},_handleSelectStart:function(k){if(!k)k=window.event;if(this._ignoreSelect){k&&k.preventDefault&&k.preventDefault();return false}},_handleInput:function(k){var m=this._textArea;this._doContent(m.value);m.selectionStart=m.selectionEnd=0;m.value="";k.preventDefault()},_handleTextInput:function(k){this._doContent(k.data);
k.preventDefault()},_touchConvert:function(k){var m=this._frame.getBoundingClientRect(),n=this._parentDocument.body;return{left:k.clientX-m.left-n.scrollLeft,top:k.clientY-m.top-n.scrollTop}},_handleTouchStart:function(k){var m=k.touches,n,p;this._touchMoved=false;this._touchStartScroll=undefined;if(m.length===1){n=m[0];var t=n.pageY;this._touchStartX=n.pageX;this._touchStartY=t;this._touchStartTime=k.timeStamp;this._touchStartScroll=this._getScroll();k=this._getSelection();p=this._touchConvert(m[0]);
this._touchGesture="none";if(!k.isEmpty())if(this._hitOffset(k.end,p.left,p.top))this._touchGesture="extendEnd";else if(this._hitOffset(k.start,p.left,p.top))this._touchGesture="extendStart";if(this._touchGesture==="none"){m=this._textArea;m.value="";m.style.left="-1000px";m.style.top="-1000px";m.style.width="3000px";m.style.height="3000px";var w=this;this._touchTimeout=setTimeout(function(){w._touchTimeout=null;w._clickCount=1;w._setSelectionTo(p.left,p.top,false)},200)}}else if(m.length===2){this._touchGesture=
"select";if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}p=this._touchConvert(m[0]);n=this._getXToOffset(this._getYToLine(p.top),p.left);p=this._touchConvert(m[1]);m=this._getXToOffset(this._getYToLine(p.top),p.left);k=this._getSelection();k.setCaret(n);k.extend(m);this._setSelection(k,true,true)}},_handleTouchMove:function(k){this._touchMoved=true;var m=k.touches,n;if(m.length===1){m=m[0];var p=m.pageX,t=m.pageY,w=this._touchStartX-p,z=this._touchStartY-t;n=this._touchConvert(m);
m=this._getSelection();if(this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null}if(this._touchGesture==="none")this._touchGesture=k.timeStamp-this._touchStartTime<200&&(Math.abs(w)>5||Math.abs(z)>5)?"scroll":"caret";if(this._touchGesture==="select")this._touchGesture=this._hitOffset(m.end,n.left,n.top)?"extendEnd":this._hitOffset(m.start,n.left,n.top)?"extendStart":"caret";switch(this._touchGesture){case "scroll":this._touchStartX=p;this._touchStartY=t;this._scrollView(w,z);
break;case "extendStart":case "extendEnd":this._clickCount=1;n=this._getXToOffset(this._getYToLine(n.top),n.left);m.setCaret(this._touchGesture==="extendStart"?m.end:m.start);m.extend(n);if(n>=m.end&&this._touchGesture==="extendStart")this._touchGesture="extendEnd";if(n<=m.start&&this._touchGesture==="extendEnd")this._touchGesture="extendStart";this._setSelection(m,true,true);break;case "caret":this._setSelectionTo(n.left,n.top,false);break}}else if(m.length===2){n=this._touchConvert(m[0]);p=this._getXToOffset(this._getYToLine(n.top),
n.left);n=this._touchConvert(m[1]);n=this._getXToOffset(this._getYToLine(n.top),n.left);m=this._getSelection();m.setCaret(p);m.extend(n);this._setSelection(m,true,true)}k.preventDefault()},_handleTouchEnd:function(k){if(!this._touchMoved)if(k.touches.length===0&&k.changedTouches.length===1&&this._touchTimeout){clearTimeout(this._touchTimeout);this._touchTimeout=null;var m=k.changedTouches[0];this._clickCount=1;m=this._touchConvert(m);this._setSelectionTo(m.left,m.top,false)}if(k.touches.length===
0){var n=this;setTimeout(function(){var p=n._getSelection(),t=n._model.getText(p.start,p.end),w=n._textArea;w.value=t;w.selectionStart=0;w.selectionEnd=t.length;if(!p.isEmpty()){t=n._touchDiv.getBoundingClientRect();p=n._getOffsetBounds(p.start);w.style.left=t.width/2+"px";w.style.top=(p.top>40?p.top-30:p.top+30)+"px"}},0)}k.preventDefault()},_doAction:function(k){for(var m=this._keyBindings,n=0;n<m.length;n++){var p=m[n];if(p.keyBinding.match(k)){if(p.name){k=this._actions;for(m=0;m<k.length;m++){n=
k[m];if(n.name===p.name){if(n.userHandler){if(!n.userHandler())if(n.defaultHandler)n.defaultHandler();else return false}else n.defaultHandler&&n.defaultHandler();break}}}return true}}return false},_doBackspace:function(k){var m=this._getSelection();if(m.isEmpty()){var n=this._model,p=m.getCaret(),t=n.getLineAtOffset(p);if(p===n.getLineStart(t))t>0&&m.extend(n.getLineEnd(t-1));else m.extend(this._getOffset(p,k.unit,-1))}this._modifyContent({text:"",start:m.start,end:m.end},true);return true},_doContent:function(k){var m=
this._getSelection();this._modifyContent({text:k,start:m.start,end:m.end,_ignoreDOMSelection:true},true)},_doCopy:function(k){var m=this._getSelection();if(!m.isEmpty())return this._setClipboardText(this._model.getText(m.start,m.end),k);return true},_doCursorNext:function(k){if(!k.select)if(this._clearSelection("next"))return true;var m=this._model,n=this._getSelection(),p=n.getCaret(),t=m.getLineAtOffset(p);if(p===m.getLineEnd(t))t+1<m.getLineCount()&&n.extend(m.getLineStart(t+1));else n.extend(this._getOffset(p,
k.unit,1));k.select||n.collapse();this._setSelection(n,true);return true},_doCursorPrevious:function(k){if(!k.select)if(this._clearSelection("previous"))return true;var m=this._model,n=this._getSelection(),p=n.getCaret(),t=m.getLineAtOffset(p);if(p===m.getLineStart(t))t>0&&n.extend(m.getLineEnd(t-1));else n.extend(this._getOffset(p,k.unit,-1));k.select||n.collapse();this._setSelection(n,true);return true},_doCut:function(k){var m=this._getSelection();if(!m.isEmpty()){m=this._model.getText(m.start,
m.end);this._doContent("");return this._setClipboardText(m,k)}return true},_doDelete:function(k){var m=this._getSelection();if(m.isEmpty()){var n=this._model,p=m.getCaret(),t=n.getLineAtOffset(p);if(p===n.getLineEnd(t))t+1<n.getLineCount()&&m.extend(n.getLineStart(t+1));else m.extend(this._getOffset(p,k.unit,1))}this._modifyContent({text:"",start:m.start,end:m.end},true);return true},_doEnd:function(k){var m=this._getSelection(),n=this._model;if(k.ctrl)m.extend(n.getCharCount());else{var p=n.getLineAtOffset(m.getCaret());
m.extend(n.getLineEnd(p))}k.select||m.collapse();this._setSelection(m,true);return true},_doEnter:function(){this._doContent(this._model.getLineDelimiter());return true},_doHome:function(k){var m=this._getSelection(),n=this._model;if(k.ctrl)m.extend(0);else{var p=n.getLineAtOffset(m.getCaret());m.extend(n.getLineStart(p))}k.select||m.collapse();this._setSelection(m,true);return true},_doLineDown:function(k){var m=this._model,n=this._getSelection(),p=n.getCaret(),t=m.getLineAtOffset(p);if(t+1<m.getLineCount()){m=
this._columnX;if(m===-1||k.select)m=this._getOffsetToX(p);n.extend(this._getXToOffset(t+1,m));k.select||n.collapse();this._setSelection(n,true,true);this._columnX=m}return true},_doLineUp:function(k){var m=this._model,n=this._getSelection(),p=n.getCaret();m=m.getLineAtOffset(p);if(m>0){var t=this._columnX;if(t===-1||k.select)t=this._getOffsetToX(p);n.extend(this._getXToOffset(m-1,t));k.select||n.collapse();this._setSelection(n,true,true);this._columnX=t}return true},_doPageDown:function(k){var m=
this._model,n=this._getSelection(),p=n.getCaret(),t=m.getLineAtOffset(p),w=m.getLineCount();if(t<w-1){m=this._getClientHeight();var z=this._getLineHeight(),A=Math.floor(m/z),C=Math.min(w-t-1,A);C=Math.max(1,C);A=this._columnX;if(A===-1||k.select)A=this._getOffsetToX(p);n.extend(this._getXToOffset(t+C,A));k.select||n.collapse();this._setSelection(n,false,false);k=w*z;n=this._getScroll().y;z=n+C*z;if(z+m>k)z=k-m;z>n?this._scrollView(0,z-n):this._updateDOMSelection();this._columnX=A}return true},_doPageUp:function(k){var m=
this._model,n=this._getSelection(),p=n.getCaret(),t=m.getLineAtOffset(p);if(t>0){var w=this._getClientHeight();m=this._getLineHeight();w=Math.floor(w/m);var z=Math.max(1,Math.min(t,w));w=this._columnX;if(w===-1||k.select)w=this._getOffsetToX(p);n.extend(this._getXToOffset(t-z,w));k.select||n.collapse();this._setSelection(n,false,false);k=this._getScroll().y;n=Math.max(0,k-z*m);n<k?this._scrollView(0,n-k):this._updateDOMSelection();this._columnX=w}return true},_doPaste:function(k){(k=this._getClipboardText(k))&&
this._doContent(k);return k!==null},_doScroll:function(k){var m=this._hScroll,n=this._vScroll;if(m!==k.x||n!==k.y){this._hScroll=k.x;this._vScroll=k.y;this._commitIME();this._updatePage();this.onScroll({oldValue:{x:m,y:n},newValue:k})}},_doSelectAll:function(){var k=this._model,m=this._getSelection();m.setCaret(0);m.extend(k.getCharCount());this._setSelection(m,false);return true},_doTab:function(){this._doContent("\t");return true},_applyStyle:function(k,m){if(k){if(k.styleClass)m.className=k.styleClass;
if(k=k.style)for(var n in k)if(k.hasOwnProperty(n))m.style[n]=k[n]}},_autoScroll:function(){var k=this._getSelection(),m,n=this._autoScrollX;if(this._autoScrollDir==="up"||this._autoScrollDir==="down"){var p=this._autoScrollY/this._getLineHeight();p=p<0?Math.floor(p):Math.ceil(p);m=this._model.getLineAtOffset(k.getCaret());m=Math.max(0,Math.min(this._model.getLineCount()-1,m+p))}else if(this._autoScrollDir==="left"||this._autoScrollDir==="right"){m=this._getYToLine(this._autoScrollY);n+=this._getOffsetToX(k.getCaret())}k.extend(this._getXToOffset(m,
n));this._setSelection(k,true)},_autoScrollTimer:function(){this._autoScroll();var k=this;this._autoScrollTimerID=setTimeout(function(){k._autoScrollTimer()},this._AUTO_SCROLL_RATE)},_calculateLineHeight:function(){var k=this._clientDiv,m=this._frameDocument,n=m.createElement("DIV");n.style.position="fixed";n.style.left="-1000px";var p=m.createElement("SPAN");p.appendChild(m.createTextNode(" "));n.appendChild(p);var t=m.createElement("SPAN");t.style.fontStyle="italic";t.appendChild(m.createTextNode(" "));
n.appendChild(t);var w=m.createElement("SPAN");w.style.fontWeight="bold";w.appendChild(m.createTextNode(" "));n.appendChild(w);var z=m.createElement("SPAN");z.style.fontWeight="bold";z.style.fontStyle="italic";z.appendChild(m.createTextNode(" "));n.appendChild(z);k.appendChild(n);m=p.getBoundingClientRect();t=t.getBoundingClientRect();p=w.getBoundingClientRect();var A=z.getBoundingClientRect();z=m.bottom-m.top;w=t.bottom-t.top;m=p.bottom-p.top;t=A.bottom-A.top;p=0;A=z;if(w>z){A=w;p=1}if(m>w){A=m;
p=2}if(t>m){A=t;p=3}this._largestFontStyle=p;k.removeChild(n);return A},_calculatePadding:function(){var k=this._frameDocument,m=this._clientDiv,n=this._getPadding(this._viewDiv),p=k.createElement("DIV");p.style.position="fixed";p.style.left="-1000px";p.style.paddingLeft=n.left+"px";p.style.paddingTop=n.top+"px";p.style.paddingRight=n.right+"px";p.style.paddingBottom=n.bottom+"px";p.style.width="100px";p.style.height="100px";n=k.createElement("DIV");n.style.width="100%";n.style.height="100%";p.appendChild(n);
m.appendChild(p);k=p.getBoundingClientRect();n=n.getBoundingClientRect();m.removeChild(p);return n={left:n.left-k.left,top:n.top-k.top,right:k.right-n.right,bottom:k.bottom-n.bottom}},_clearSelection:function(k){var m=this._getSelection();if(m.isEmpty())return false;if(k==="next")m.start=m.end;else m.end=m.start;this._setSelection(m,true);return true},_commitIME:function(){if(this._imeOffset!==-1){this._scrollDiv.focus();this._clientDiv.focus();var k=this._model,m=k.getLineAtOffset(this._imeOffset),
n=k.getLineStart(m),p=this._getDOMText(m);k=k.getLine(m);n=this._imeOffset-n;k=n+p.length-k.length;n!==k&&this._doContent(p.substring(n,k));this._imeOffset=-1}},_convertDelimiter:function(k,m,n){for(var p=0,t=0,w=0,z=k.length;w<z;){if(p!==-1&&p<=w)p=k.indexOf("\r",w);if(t!==-1&&t<=w)t=k.indexOf("\n",w);var A=w,C;if(t===-1&&p===-1){m(k.substring(w));break}if(p!==-1&&t!==-1)if(p+1===t){C=p;w=t+1}else{C=p<t?p:t;w=(p<t?p:t)+1}else if(p!==-1){C=p;w=p+1}else{C=t;w=t+1}m(k.substring(A,C));n()}},_createActions:function(){var k=
orion.textview.KeyBinding,m=this._keyBindings=[];m.push({name:"lineUp",keyBinding:new k(38),predefined:true});m.push({name:"lineDown",keyBinding:new k(40),predefined:true});m.push({name:"charPrevious",keyBinding:new k(37),predefined:true});m.push({name:"charNext",keyBinding:new k(39),predefined:true});m.push({name:"pageUp",keyBinding:new k(33),predefined:true});m.push({name:"pageDown",keyBinding:new k(34),predefined:true});if(o){m.push({name:"lineStart",keyBinding:new k(37,true),predefined:true});
m.push({name:"lineEnd",keyBinding:new k(39,true),predefined:true});m.push({name:"wordPrevious",keyBinding:new k(37,null,null,true),predefined:true});m.push({name:"wordNext",keyBinding:new k(39,null,null,true),predefined:true});m.push({name:"textStart",keyBinding:new k(36),predefined:true});m.push({name:"textEnd",keyBinding:new k(35),predefined:true});m.push({name:"textStart",keyBinding:new k(38,true),predefined:true});m.push({name:"textEnd",keyBinding:new k(40,true),predefined:true})}else{m.push({name:"lineStart",
keyBinding:new k(36),predefined:true});m.push({name:"lineEnd",keyBinding:new k(35),predefined:true});m.push({name:"wordPrevious",keyBinding:new k(37,true),predefined:true});m.push({name:"wordNext",keyBinding:new k(39,true),predefined:true});m.push({name:"textStart",keyBinding:new k(36,true),predefined:true});m.push({name:"textEnd",keyBinding:new k(35,true),predefined:true})}m.push({name:"selectLineUp",keyBinding:new k(38,null,true),predefined:true});m.push({name:"selectLineDown",keyBinding:new k(40,
null,true),predefined:true});m.push({name:"selectCharPrevious",keyBinding:new k(37,null,true),predefined:true});m.push({name:"selectCharNext",keyBinding:new k(39,null,true),predefined:true});m.push({name:"selectPageUp",keyBinding:new k(33,null,true),predefined:true});m.push({name:"selectPageDown",keyBinding:new k(34,null,true),predefined:true});if(o){m.push({name:"selectLineStart",keyBinding:new k(37,true,true),predefined:true});m.push({name:"selectLineEnd",keyBinding:new k(39,true,true),predefined:true});
m.push({name:"selectWordPrevious",keyBinding:new k(37,null,true,true),predefined:true});m.push({name:"selectWordNext",keyBinding:new k(39,null,true,true),predefined:true});m.push({name:"selectTextStart",keyBinding:new k(36,null,true),predefined:true});m.push({name:"selectTextEnd",keyBinding:new k(35,null,true),predefined:true});m.push({name:"selectTextStart",keyBinding:new k(38,true,true),predefined:true});m.push({name:"selectTextEnd",keyBinding:new k(40,true,true),predefined:true})}else{m.push({name:"selectLineStart",
keyBinding:new k(36,null,true),predefined:true});m.push({name:"selectLineEnd",keyBinding:new k(35,null,true),predefined:true});m.push({name:"selectWordPrevious",keyBinding:new k(37,true,true),predefined:true});m.push({name:"selectWordNext",keyBinding:new k(39,true,true),predefined:true});m.push({name:"selectTextStart",keyBinding:new k(36,true,true),predefined:true});m.push({name:"selectTextEnd",keyBinding:new k(35,true,true),predefined:true})}m.push({name:"deletePrevious",keyBinding:new k(8),predefined:true});
m.push({name:"deletePrevious",keyBinding:new k(8,null,true),predefined:true});m.push({name:"deleteNext",keyBinding:new k(46),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k(8,true),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k(8,true,true),predefined:true});m.push({name:"deleteWordNext",keyBinding:new k(46,true),predefined:true});m.push({name:"tab",keyBinding:new k(9),predefined:true});m.push({name:"enter",keyBinding:new k(13),predefined:true});m.push({name:"enter",
keyBinding:new k(13,null,true),predefined:true});m.push({name:"selectAll",keyBinding:new k("a",true),predefined:true});if(o){m.push({name:"deleteNext",keyBinding:new k(46,null,true),predefined:true});m.push({name:"deleteWordPrevious",keyBinding:new k(8,null,null,true),predefined:true});m.push({name:"deleteWordNext",keyBinding:new k(46,null,null,true),predefined:true})}if(!e){var n=o&&i;m.push({name:null,keyBinding:new k("u",!n,false,false,n),predefined:true});m.push({name:null,keyBinding:new k("i",
!n,false,false,n),predefined:true});m.push({name:null,keyBinding:new k("b",!n,false,false,n),predefined:true})}if(e){m.push({name:"copy",keyBinding:new k(45,true),predefined:true});m.push({name:"paste",keyBinding:new k(45,null,true),predefined:true});m.push({name:"cut",keyBinding:new k(46,null,true),predefined:true})}var p=this;this._actions=[{name:"lineUp",defaultHandler:function(){return p._doLineUp({select:false})}},{name:"lineDown",defaultHandler:function(){return p._doLineDown({select:false})}},
{name:"lineStart",defaultHandler:function(){return p._doHome({select:false,ctrl:false})}},{name:"lineEnd",defaultHandler:function(){return p._doEnd({select:false,ctrl:false})}},{name:"charPrevious",defaultHandler:function(){return p._doCursorPrevious({select:false,unit:"character"})}},{name:"charNext",defaultHandler:function(){return p._doCursorNext({select:false,unit:"character"})}},{name:"pageUp",defaultHandler:function(){return p._doPageUp({select:false})}},{name:"pageDown",defaultHandler:function(){return p._doPageDown({select:false})}},
{name:"wordPrevious",defaultHandler:function(){return p._doCursorPrevious({select:false,unit:"word"})}},{name:"wordNext",defaultHandler:function(){return p._doCursorNext({select:false,unit:"word"})}},{name:"textStart",defaultHandler:function(){return p._doHome({select:false,ctrl:true})}},{name:"textEnd",defaultHandler:function(){return p._doEnd({select:false,ctrl:true})}},{name:"selectLineUp",defaultHandler:function(){return p._doLineUp({select:true})}},{name:"selectLineDown",defaultHandler:function(){return p._doLineDown({select:true})}},
{name:"selectLineStart",defaultHandler:function(){return p._doHome({select:true,ctrl:false})}},{name:"selectLineEnd",defaultHandler:function(){return p._doEnd({select:true,ctrl:false})}},{name:"selectCharPrevious",defaultHandler:function(){return p._doCursorPrevious({select:true,unit:"character"})}},{name:"selectCharNext",defaultHandler:function(){return p._doCursorNext({select:true,unit:"character"})}},{name:"selectPageUp",defaultHandler:function(){return p._doPageUp({select:true})}},{name:"selectPageDown",
defaultHandler:function(){return p._doPageDown({select:true})}},{name:"selectWordPrevious",defaultHandler:function(){return p._doCursorPrevious({select:true,unit:"word"})}},{name:"selectWordNext",defaultHandler:function(){return p._doCursorNext({select:true,unit:"word"})}},{name:"selectTextStart",defaultHandler:function(){return p._doHome({select:true,ctrl:true})}},{name:"selectTextEnd",defaultHandler:function(){return p._doEnd({select:true,ctrl:true})}},{name:"deletePrevious",defaultHandler:function(){return p._doBackspace({unit:"character"})}},
{name:"deleteNext",defaultHandler:function(){return p._doDelete({unit:"character"})}},{name:"deleteWordPrevious",defaultHandler:function(){return p._doBackspace({unit:"word"})}},{name:"deleteWordNext",defaultHandler:function(){return p._doDelete({unit:"word"})}},{name:"tab",defaultHandler:function(){return p._doTab()}},{name:"enter",defaultHandler:function(){return p._doEnter()}},{name:"selectAll",defaultHandler:function(){return p._doSelectAll()}},{name:"copy",defaultHandler:function(){return p._doCopy()}},
{name:"cut",defaultHandler:function(){return p._doCut()}},{name:"paste",defaultHandler:function(){return p._doPaste()}}]},_createLine:function(k,m,n,p,t){var w=t.getLine(p),z=t.getLineStart(p),A={lineIndex:p,lineText:w,lineStart:z};this.onLineStyle(A);t=n.createElement("DIV");t.lineIndex=p;this._applyStyle(A.style,t);if(w.length!==0){var C=0;if((p=this._tabSize)&&p!==8)for(var F=w.indexOf("\t"),E=0;F!==-1;){this._createRange(t,n,A.ranges,C,F,w,z);var H=p-(F+E)%p,K="\u00a0";for(C=1;C<H;C++)K+=" ";
C=n.createElement("SPAN");C.appendChild(n.createTextNode(K));C.ignoreChars=H-1;E+=C.ignoreChars;if(A.ranges)for(H=0;H<A.ranges.length;H++){K=A.ranges[H];var L=K.start-z,P=K.end-z;if(L>F)break;if(L<=F&&F<P){this._applyStyle(K.style,C);break}}t.appendChild(C);C=F+1;F=w.indexOf("\t",C)}this._createRange(t,n,A.ranges,C,w.length,w,z)}w=n.createElement("SPAN");w.ignoreChars=1;if((this._largestFontStyle&1)!==0)w.style.fontStyle="italic";if((this._largestFontStyle&2)!==0)w.style.fontWeight="bold";w.appendChild(n.createTextNode(!this._fullSelection&&
(e||f||d>=9)?" ":h||e?"\u200c":"\ufeff"));t.appendChild(w);k.insertBefore(t,m);return t},_createRange:function(k,m,n,p,t,w,z){if(!(p>=t)){var A;if(n)for(var C=0;C<n.length;C++){var F=n[C];if(!(F.end<=z+p)){var E=Math.max(z+p,F.start)-z;if(E>=t)break;var H=Math.min(z+t,F.end)-z;if(E<H){E=Math.max(p,E);H=Math.min(t,H);if(p<E){A=m.createElement("SPAN");A.appendChild(m.createTextNode(w.substring(p,E)));k.appendChild(A)}A=m.createElement("SPAN");A.appendChild(m.createTextNode(w.substring(E,H)));this._applyStyle(F.style,
A);k.appendChild(A);p=H}}}if(p<t){A=m.createElement("SPAN");A.appendChild(m.createTextNode(w.substring(p,t)));k.appendChild(A)}}},_doAutoScroll:function(k,m,n){this._autoScrollDir=k;this._autoScrollX=m;this._autoScrollY=n;this._autoScrollTimerID||this._autoScrollTimer()},_endAutoScroll:function(){this._autoScrollTimerID&&clearTimeout(this._autoScrollTimerID);this._autoScrollTimerID=this._autoScrollDir=undefined},_getBoundsAtOffset:function(k){var m=this._model,n=this._frameDocument,p=this._clientDiv,
t=m.getLineAtOffset(k),w,z=this._getLineNode(t);z||(z=w=this._createLine(p,null,n,t,m));var A=null;if(k<m.getLineEnd(t)){m=m.getLineStart(t);for(t=z.firstChild;t;){var C=t.firstChild,F=C.length;if(t.ignoreChars)F-=t.ignoreChars;if(m+F>k){A=k-m;if(q){n=n.createRange();n.setStart(C,A);n.setEnd(C,A+1);A=n.getBoundingClientRect()}else if(d){n=n.body.createTextRange();n.moveToElementText(t);n.collapse();n.moveEnd("character",A+1);n.moveStart("character",A);A=n.getBoundingClientRect()}else{k=C.data;t.removeChild(C);
t.appendChild(n.createTextNode(k.substring(0,A)));var E=n.createElement("SPAN");E.appendChild(n.createTextNode(k.substring(A,A+1)));t.appendChild(E);t.appendChild(n.createTextNode(k.substring(A+1)));A=E.getBoundingClientRect();t.innerHTML="";t.appendChild(C);if(!w){n=this._getSelection();if(m<=n.start&&n.start<m+F||m<=n.end&&n.end<m+F)this._updateDOMSelection()}}if(d){n=window.screen.logicalXDPI;m=window.screen.deviceXDPI;A.left=A.left*n/m;A.right=A.right*n/m}break}m+=F;t=t.nextSibling}}if(!A){z=
this._getLineBoundingClientRect(z);A={left:z.right,right:z.right}}w&&p.removeChild(w);return A},_getBottomIndex:function(k){var m=this._bottomChild;if(k&&this._getClientHeight()>this._getLineHeight()){k=m.getBoundingClientRect();var n=this._clientDiv.getBoundingClientRect();if(k.bottom>n.bottom)m=this._getLinePrevious(m)||m}return m.lineIndex},_getFrameHeight:function(){return this._frameDocument.documentElement.clientHeight},_getFrameWidth:function(){return this._frameDocument.documentElement.clientWidth},
_getClientHeight:function(){var k=this._getViewPadding();return Math.max(0,this._viewDiv.clientHeight-k.top-k.bottom)},_getClientWidth:function(){var k=this._getViewPadding();return Math.max(0,this._viewDiv.clientWidth-k.left-k.right)},_getClipboardText:function(k){var m=this._model.getLineDelimiter(),n;if(this._frameWindow.clipboardData){n=[];k=this._frameWindow.clipboardData.getData("Text");this._convertDelimiter(k,function(K){n.push(K)},function(){n.push(m)});return n.join("")}if(e){var p=this._frameWindow,
t=this._frameDocument,w=t.createElement("PRE");w.style.position="fixed";w.style.left="-1000px";w.appendChild(t.createTextNode(" "));this._clientDiv.appendChild(w);var z=t.createRange();z.selectNodeContents(w);var A=p.getSelection();A.rangeCount>0&&A.removeAllRanges();A.addRange(z);var C=this,F=function(){C._updateDOMSelection();C._clientDiv.removeChild(w)},E=function(){var K=null;if(A.anchorNode.nodeType!==w.TEXT_NODE)K=A.anchorNode.childNodes[A.anchorOffset];var L=[],P=function(S){for(S=S.firstChild;S&&
S!==K;){if(S.nodeType===w.TEXT_NODE)L.push(S!==A.anchorNode?S.data:S.data.substring(0,A.anchorOffset));else S.tagName==="BR"?L.push(m):P(S);S=S.nextSibling}};P(w);F();return L.join("")};p=false;this._ignorePaste=true;try{p=t.execCommand("paste",false,null)}catch(H){}this._ignorePaste=false;if(!p)if(k){setTimeout(function(){var K=E();K&&C._doContent(K)},0);return null}else{F();return""}return E()}if(k&&k.clipboardData){n=[];k=k.clipboardData.getData("text/plain");this._convertDelimiter(k,function(K){n.push(K)},
function(){n.push(m)});return n.join("")}return""},_getDOMText:function(k){k=this._getLineNode(k).firstChild;for(var m="";k;){for(var n=k.firstChild;n;){if(k.ignoreChars)for(var p=0;p<n.length;p++){var t=n.data.substring(p,p+1);if(t!==" ")m+=t}else m+=n.data;n=n.nextSibling}k=k.nextSibling}return m},_getViewPadding:function(){return this._viewPadding},_getLineBoundingClientRect:function(k){var m=k.getBoundingClientRect();for(k=k.lastChild;k&&k.ignoreChars===k.firstChild.length;)k=k.previousSibling;
if(!k)return{left:m.left,top:m.top,right:m.left,bottom:m.bottom};k=k.getBoundingClientRect();return{left:m.left,top:m.top,right:k.right,bottom:m.bottom}},_getLineHeight:function(){return this._lineHeight},_getLineNode:function(k){for(var m=this._clientDiv.firstChild;m;){if(k===m.lineIndex)return m;m=m.nextSibling}},_getLineNext:function(k){for(k=k?k.nextSibling:this._clientDiv.firstChild;k&&k.lineIndex===-1;)k=k.nextSibling;return k},_getLinePrevious:function(k){for(k=k?k.previousSibling:this._clientDiv.lastChild;k&&
k.lineIndex===-1;)k=k.previousSibling;return k},_getOffset:function(k,m,n){if(m==="wordend")return this._getOffset_W3C(k,m,n);return d?this._getOffset_IE(k,m,n):this._getOffset_W3C(k,m,n)},_getOffset_W3C:function(k,m,n){function p(H){return 33<=H&&H<=47||58<=H&&H<=64||91<=H&&H<=94||H===96||123<=H&&H<=126}function t(H){return H===32||H===9}if(m==="word"||m==="wordend"){var w=this._model,z=w.getLineAtOffset(k),A=w.getLine(z),C=w.getLineStart(z);z=w.getLineEnd(z);w=A.length;k=k-C;var F,E;if(n>0){if(k===
w)return z;F=A.charCodeAt(k);E=p(F);n=!E&&!t(F);for(k++;k<w;){F=A.charCodeAt(k);z=p(F);if(m==="wordend"){if(!z&&E)break}else if(z&&!E)break;F=!z&&!t(F);if(m==="wordend"){if(!F&&n)break}else if(F&&!n)break;n=F;E=z;k++}}else{if(k===0)return C;k--;F=A.charCodeAt(k);E=p(F);for(n=!E&&!t(F);0<k;){F=A.charCodeAt(k-1);z=p(F);if(m==="wordend"){if(z&&!E)break}else if(!z&&E)break;F=!z&&!t(F);if(m==="wordend"){if(F&&!n)break}else if(!F&&n)break;n=F;E=z;k--}}return C+k}return k+n},_getOffset_IE:function(k,m,n){var p=
this._frameDocument,t=this._model,w=t.getLineAtOffset(k),z=this._clientDiv,A,C=this._getLineNode(w);C||(C=A=this._createLine(z,null,p,w,t));var F=0,E;E=t.getLineStart(w);if(k===t.getLineEnd(w)){p=p.body.createTextRange();p.moveToElementText(C.lastChild);E=p.text.length;p.moveEnd(m,n);F=k+p.text.length-E}else if(k===E&&n<0)F=E;else for(C=C.firstChild;C;){t=C.firstChild.length;if(C.ignoreChars)t-=C.ignoreChars;if(E+t>k){p=p.body.createTextRange();if(k===E&&n<0)p.moveToElementText(C.previousSibling);
else{p.moveToElementText(C);p.collapse();p.moveEnd("character",k-E)}E=p.text.length;p.moveEnd(m,n);F=k+p.text.length-E;break}E=t+E;C=C.nextSibling}A&&z.removeChild(A);return F},_getOffsetToX:function(k){return this._getBoundsAtOffset(k).left},_getPadding:function(k){var m,n,p,t;if(k.currentStyle){m=k.currentStyle.paddingLeft;n=k.currentStyle.paddingTop;p=k.currentStyle.paddingRight;t=k.currentStyle.paddingBottom}else if(this._frameWindow.getComputedStyle){k=this._frameWindow.getComputedStyle(k,null);
m=k.getPropertyValue("padding-left");n=k.getPropertyValue("padding-top");p=k.getPropertyValue("padding-right");t=k.getPropertyValue("padding-bottom")}return{left:parseInt(m,10),top:parseInt(n,10),right:parseInt(p,10),bottom:parseInt(t,10)}},_getScroll:function(){var k=this._viewDiv;return{x:k.scrollLeft,y:k.scrollTop}},_getSelection:function(){return this._selection.clone()},_getTopIndex:function(k){var m=this._topChild;if(k&&this._getClientHeight()>this._getLineHeight()){k=m.getBoundingClientRect();
var n=this._getViewPadding(),p=this._viewDiv.getBoundingClientRect();if(k.top<p.top+n.top)m=this._getLineNext(m)||m}return m.lineIndex},_getXToOffset:function(k,m){function n(R){var T,X,da,ga;if(!R._rectsCache){T=R.getClientRects();X=[T.length];for(da=0;da<T.length;da++){ga=T[da];X[da]={left:ga.left-E+L,top:ga.top,right:ga.right-E+L,bottom:ga.bottom}}R._rectsCache=X}T=R._rectsCache;X=[T.length];for(da=0;da<T.length;da++){ga=T[da];X[da]={left:ga.left-L,top:ga.top,right:ga.right-L,bottom:ga.bottom}}return X}
var p=this._model,t=p.getLineStart(k),w=p.getLineEnd(k);if(t===w)return t;var z=this._frameDocument,A=this._clientDiv,C,F=this._getLineNode(k);F||(F=C=this._createLine(A,null,z,k,p));k=this._getLineBoundingClientRect(F);if(m<k.left)m=k.left;if(m>k.right)m=k.right;var E=0,H;if(d<9){H=F.getClientRects();p=H[0].left;for(var K=1;K<H.length;K++)p=Math.min(H[K].left,p);E=p-k.left}var L=this._getScroll().x,P=d?window.screen.logicalXDPI:1,S=d?window.screen.deviceXDPI:1;k=t;p=F.firstChild;a:for(;p;){K=p.firstChild;
F=K.length;if(p.ignoreChars)F-=p.ignoreChars;H=n(p);for(var Y=0;Y<H.length;Y++){var Q=H[Y];if(Q.left<=m&&m<Q.right){if(d||q){z=q?z.createRange():z.body.createTextRange();Y=F;for(var ea=-1;Y-ea>1;){var B=Math.floor((Y+ea)/2);H=ea+1;Q=B===F-1&&p.ignoreChars?K.length:B+1;if(q){z.setStart(K,H);z.setEnd(K,Q)}else{z.moveToElementText(p);z.move("character",H);z.moveEnd("character",Q-H)}H=z.getClientRects();for(var D=false,I=0;I<H.length;I++){Q=H[I];var O=Q.right*P/S-E;if(Q.left*P/S-E<=m&&m<O){D=true;break}}if(D)Y=
B;else ea=B}k+=Y;H=Y;Q=Y===F-1&&p.ignoreChars?K.length:Y+1;if(q){z.setStart(K,H);z.setEnd(K,Q)}else{z.moveToElementText(p);z.move("character",H);z.moveEnd("character",Q-H)}Q=z.getClientRects()[0];m>Q.left*P/S-E+(Q.right-Q.left)*P/S/2&&k++}else{H=[];for(P=0;P<F;P++){H.push("<span>");P===F-1?H.push(K.data.substring(P)):H.push(K.data.substring(P,P+1));H.push("</span>")}p.innerHTML=H.join("");for(H=p.firstChild;H;){Q=H.getBoundingClientRect();if(Q.left<=m&&m<Q.right){m>Q.left+(Q.right-Q.left)/2&&k++;
break}k++;H=H.nextSibling}if(!C){p.innerHTML="";p.appendChild(K);m=this._getSelection();if(k<=m.start&&m.start<k+F||k<=m.end&&m.end<k+F)this._updateDOMSelection()}}break a}}k+=F;p=p.nextSibling}C&&A.removeChild(C);return Math.min(w,Math.max(t,k))},_getYToLine:function(k){var m=this._getViewPadding(),n=this._viewDiv.getBoundingClientRect();k-=n.top+m.top;m=this._getLineHeight();k=Math.floor((k+this._getScroll().y)/m);m=this._model.getLineCount();return Math.max(0,Math.min(m-1,k))},_getOffsetBounds:function(k){var m=
this._model.getLineAtOffset(k),n=this._getLineHeight(),p=this._getScroll(),t=this._getViewPadding(),w=this._viewDiv.getBoundingClientRect();k=this._getBoundsAtOffset(k);m=m*n-p.y+w.top+t.top;return{left:k.left,top:m,right:k.right,bottom:m+n}},_hitOffset:function(k,m,n){var p=this._getOffsetBounds(k);k=p.left;var t=p.right,w=p.top;p=p.bottom;k-=20;w-=20;t+=20;p+=20;return k<=m&&m<=t&&w<=n&&n<=p},_hookEvents:function(){var k=this;this._modelListener={onChanging:function(z,A,C,F,E,H){k._onModelChanging(z,
A,C,F,E,H)},onChanged:function(z,A,C,F,E){k._onModelChanged(z,A,C,F,E)}};this._model.addListener(this._modelListener);this._mouseMoveClosure=function(z){return k._handleMouseMove(z)};this._mouseUpClosure=function(z){return k._handleMouseUp(z)};var m=this._clientDiv,n=this._viewDiv,p=this._frameDocument.body,t=this._handlers=[],w=l?this._textArea:d||e?this._clientDiv:this._frameWindow;t.push({target:d<9?this._frame:this._frameWindow,type:"resize",handler:function(z){return k._handleResize(z)}});t.push({target:w,
type:"blur",handler:function(z){return k._handleBlur(z)}});t.push({target:w,type:"focus",handler:function(z){return k._handleFocus(z)}});t.push({target:n,type:"scroll",handler:function(z){return k._handleScroll(z)}});if(l){m=this._touchDiv;p=this._textArea;t.push({target:p,type:"keydown",handler:function(z){return k._handleKeyDown(z)}});t.push({target:p,type:"input",handler:function(z){return k._handleInput(z)}});t.push({target:p,type:"textInput",handler:function(z){return k._handleTextInput(z)}});
t.push({target:m,type:"touchstart",handler:function(z){return k._handleTouchStart(z)}});t.push({target:m,type:"touchmove",handler:function(z){return k._handleTouchMove(z)}});t.push({target:m,type:"touchend",handler:function(z){return k._handleTouchEnd(z)}})}else{n=this._overlayDiv||this._clientDiv;t.push({target:m,type:"keydown",handler:function(z){return k._handleKeyDown(z)}});t.push({target:m,type:"keypress",handler:function(z){return k._handleKeyPress(z)}});t.push({target:m,type:"keyup",handler:function(z){return k._handleKeyUp(z)}});
t.push({target:m,type:"selectstart",handler:function(z){return k._handleSelectStart(z)}});t.push({target:m,type:"contextmenu",handler:function(z){return k._handleContextMenu(z)}});t.push({target:m,type:"copy",handler:function(z){return k._handleCopy(z)}});t.push({target:m,type:"cut",handler:function(z){return k._handleCut(z)}});t.push({target:m,type:"paste",handler:function(z){return k._handlePaste(z)}});t.push({target:n,type:"mousedown",handler:function(z){return k._handleMouseDown(z)}});t.push({target:p,
type:"mousedown",handler:function(z){return k._handleBodyMouseDown(z)}});t.push({target:n,type:"dragstart",handler:function(z){return k._handleDragStart(z)}});t.push({target:n,type:"dragover",handler:function(z){return k._handleDragOver(z)}});t.push({target:n,type:"drop",handler:function(z){return k._handleDrop(z)}});d&&t.push({target:this._frameDocument,type:"activate",handler:function(z){return k._handleDocFocus(z)}});e&&t.push({target:this._frameDocument,type:"focus",handler:function(z){return k._handleDocFocus(z)}});
if(!d&&!f)t.push({target:this._viewDiv,type:e?"DOMMouseScroll":"mousewheel",handler:function(z){return k._handleMouseWheel(z)}});e&&!r&&t.push({target:this._clientDiv,type:"DOMCharacterDataModified",handler:function(z){return k._handleDataModified(z)}});this._overlayDiv&&t.push({target:this._overlayDiv,type:"contextmenu",handler:function(z){return k._handleContextMenu(z)}});s||t.push({target:this._clientDiv,type:"dblclick",handler:function(z){return k._handleDblclick(z)}})}for(m=0;m<t.length;m++){p=
t[m];c(p.target,p.type,p.handler,p.capture)}},_init:function(k){var m=k.parent;if(typeof m==="string")m=window.document.getElementById(m);if(!m)throw"no parent";this._parent=m;this._model=k.model?k.model:new orion.textview.TextModel;this.readonly=k.readonly===true;this._selection=new y(0,0,false);this._eventTable=new x;this._maxLineWidth=0;this._maxLineIndex=-1;this._ignoreSelect=true;this._columnX=-1;this._autoScrollTimerID=this._autoScrollY=this._autoScrollX=null;this._AUTO_SCROLL_RATE=50;this._mouseUpClosure=
this._moseMoveClosure=this._grabControl=null;this._clickCount=this._lastMouseTime=this._lastMouseY=this._lastMouseX=0;this._clickTime=250;this._clickDist=5;this._isMouseDown=false;this._doubleClickSelection=null;this._vScroll=this._hScroll=0;for(this._imeOffset=-1;m.hasChildNodes();)m.removeChild(m.lastChild);var n=m.document||m.ownerDocument;this._parentDocument=n;var p=n.createElement("IFRAME");this._frame=p;p.frameBorder="0px";p.style.width="100%";p.style.height="100%";p.scrolling="no";p.style.border=
"0px";m.appendChild(p);var t=[];t.push("<!DOCTYPE html>");t.push("<html>");t.push("<head>");d<9&&t.push("<meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7'/>");t.push("<style>");t.push(".viewContainer {font-family: monospace; font-size: 10pt;}");t.push(".view {padding: 1px 2px;}");t.push(".viewContent {}");t.push("</style>");if(k.stylesheet)for(var w=typeof k.stylesheet==="string"?[k.stylesheet]:k.stylesheet,z=0;z<w.length;z++)try{var A=new XMLHttpRequest;A.overrideMimeType&&A.overrideMimeType("text/css");
A.open("GET",w[z],false);A.send(null);t.push("<style>");t.push(A.responseText);t.push("</style>")}catch(C){t.push("<link rel='stylesheet' type='text/css' href='");t.push(w[z]);t.push("'></link>")}t.push("</head>");t.push("<body spellcheck='false'></body>");t.push("</html>");this._frameWindow=w=p.contentWindow;this._frameDocument=p=w.document;p.open();p.write(t.join(""));p.close();t=p.body;t.className="viewContainer";t.style.margin="0px";t.style.borderWidth="0px";t.style.padding="0px";if(l){this._touchDiv=
z=n.createElement("DIV");z.style.position="absolute";z.style.border="0px";z.style.padding="0px";z.style.margin="0px";z.style.zIndex="2";z.style.overflow="hidden";z.style.background="transparent";z.style.WebkitUserSelect="none";m.appendChild(z);this._textArea=m=n.createElement("TEXTAREA");m.style.position="absolute";m.style.whiteSpace="pre";m.style.left="-1000px";m.tabIndex=1;m.autocapitalize=false;m.autocorrect=false;m.className="viewContainer";m.style.background="transparent";m.style.color="transparent";
m.style.border="0px";m.style.padding="0px";m.style.margin="0px";m.style.borderRadius="0px";m.style.WebkitAppearance="none";m.style.WebkitTapHighlightColor="transparent";z.appendChild(m)}n=p.createElement("DIV");n.className="view";this._viewDiv=n;n.id="viewDiv";n.tabIndex=-1;n.style.overflow="auto";n.style.position="absolute";n.style.top="0px";n.style.borderWidth="0px";n.style.margin="0px";n.style.MozOutline="none";n.style.outline="none";t.appendChild(n);this._scrollDiv=m=p.createElement("DIV");m.id=
"scrollDiv";m.style.margin="0px";m.style.borderWidth="0px";m.style.padding="0px";n.appendChild(m);this._fullSelection=k.fullSelection===undefined||k.fullSelection;if(d<9)this._fullSelection=false;if(l||this._fullSelection&&!h){this._hightlightRGB="Highlight";this._selDiv1=n=p.createElement("DIV");n.id="selDiv1";n.style.position="fixed";n.style.borderWidth="0px";n.style.margin="0px";n.style.padding="0px";n.style.MozOutline="none";n.style.outline="none";n.style.background=this._hightlightRGB;n.style.width=
"0px";n.style.height="0px";m.appendChild(n);this._selDiv2=z=p.createElement("DIV");z.id="selDiv2";z.style.position="fixed";z.style.borderWidth="0px";z.style.margin="0px";z.style.padding="0px";z.style.MozOutline="none";z.style.outline="none";z.style.background=this._hightlightRGB;z.style.width="0px";z.style.height="0px";m.appendChild(z);this._selDiv3=A=p.createElement("DIV");A.id="selDiv3";A.style.position="fixed";A.style.borderWidth="0px";A.style.margin="0px";A.style.padding="0px";A.style.MozOutline=
"none";A.style.outline="none";A.style.background=this._hightlightRGB;A.style.width="0px";A.style.height="0px";m.appendChild(A);if(e&&o){w=w.getComputedStyle(A,null).getPropertyValue("background-color");switch(w){case "rgb(119, 141, 168)":w="rgb(199, 208, 218)";break;case "rgb(127, 127, 127)":w="rgb(198, 198, 198)";break;case "rgb(255, 193, 31)":w="rgb(250, 236, 115)";break;case "rgb(243, 70, 72)":w="rgb(255, 176, 139)";break;case "rgb(255, 138, 34)":w="rgb(255, 209, 129)";break;case "rgb(102, 197, 71)":w=
"rgb(194, 249, 144)";break;case "rgb(140, 78, 184)":w="rgb(232, 184, 255)";break;default:w="rgb(180, 213, 255)";break}this._hightlightRGB=w;n.style.background=w;z.style.background=w;A.style.background=w;p.styleSheets[0].insertRule("::-moz-selection {background: "+w+"; }",0)}}w=p.createElement("DIV");w.className="viewContent";this._clientDiv=w;w.id="clientDiv";w.style.whiteSpace="pre";w.style.position="fixed";w.style.borderWidth="0px";w.style.margin="0px";w.style.padding="0px";w.style.MozOutline="none";
w.style.outline="none";if(l)w.style.WebkitTapHighlightColor="transparent";m.appendChild(w);if(e){this._overlayDiv=p=p.createElement("DIV");p.id="overlayDiv";p.style.position=w.style.position;p.style.borderWidth=w.style.borderWidth;p.style.margin=w.style.margin;p.style.padding=w.style.padding;p.style.cursor="text";p.style.zIndex="1";m.appendChild(p)}if(!l)w.contentEditable="true";this._lineHeight=this._calculateLineHeight();this._viewPadding=this._calculatePadding();if(d)t.style.lineHeight=this._lineHeight+
"px";if(k.tabSize)if(f)w.style.OTabSize=k.tabSize+"";else if(e>=4)w.style.MozTabSize=k.tabSize+"";else if(k.tabSize!==8)this._tabSize=k.tabSize;this._createActions();this._hookEvents();this._updatePage()},_modifyContent:function(k,m){if(!(this.readonly&&!k._code)){this.onVerify(k);if(!(k.text===null||k.text===undefined)){var n=this._model;if(k._ignoreDOMSelection)this._ignoreDOMSelection=true;n.setText(k.text,k.start,k.end);if(k._ignoreDOMSelection)this._ignoreDOMSelection=false;if(m){m=this._getSelection();
m.setCaret(k.start+k.text.length);this._setSelection(m,true)}this.onModify({})}}},_onModelChanged:function(k,m,n,p,t){this.onModelChanged({start:k,removedCharCount:m,addedCharCount:n,removedLineCount:p,addedLineCount:t});var w=this._getSelection();if(w.end>k){if(w.end>k&&w.start<k+m)w.setCaret(k+n);else{w.start+=n-m;w.end+=n-m}this._setSelection(w,false,false)}k=this._model.getLineAtOffset(k);for(m=this._getLineNext();m;){n=m.lineIndex;if(k<=n&&n<=k+p)m.lineChanged=true;if(n>k+p)m.lineIndex=n+t-p;
m=this._getLineNext(m)}if(k<=this._maxLineIndex&&this._maxLineIndex<=k+p){this._maxLineIndex=-1;this._maxLineWidth=0}this._updatePage()},_onModelChanging:function(k,m,n,p,t,w){this.onModelChanging({text:k,start:m,removedCharCount:n,addedCharCount:p,removedLineCount:t,addedLineCount:w})},_queueUpdatePage:function(){if(!this._updateTimer){var k=this;this._updateTimer=setTimeout(function(){k._updateTimer=null;k._updatePage()},0)}},_resizeTouchDiv:function(){for(var k=this._viewDiv.getBoundingClientRect(),
m=this._frame.getBoundingClientRect(),n=this._frame;n;){if(n.style&&n.style.top)break;n=n.parentNode}var p=m.top;if(n)p-=n.getBoundingClientRect().top;else p+=this._parentDocument.body.scrollTop;for(n=this._frame;n;){if(n.style&&n.style.left)break;n=n.parentNode}m=m.left;if(n)m-=n.getBoundingClientRect().left;else m+=this._parentDocument.body.scrollLeft;n=this._touchDiv;n.style.left=m+k.left+"px";n.style.top=p+k.top+"px";n.style.width=k.width+"px";n.style.height=k.height+"px"},_scrollView:function(k,
m){this._ensureCaretVisible=false;var n=this._viewDiv;if(k)n.scrollLeft+=k;if(m)n.scrollTop+=m},_setClipboardText:function(k,m){var n;if(this._frameWindow.clipboardData){n=[];this._convertDelimiter(k,function(C){n.push(C)},function(){n.push(v)});return this._frameWindow.clipboardData.setData("Text",n.join(""))}if(i||e||!m){var p=this._frameWindow,t=this._frameDocument,w=t.createElement("PRE");w.style.position="fixed";w.style.left="-1000px";this._convertDelimiter(k,function(C){w.appendChild(t.createTextNode(C))},
function(){w.appendChild(t.createElement("BR"))});w.appendChild(t.createTextNode(" "));this._clientDiv.appendChild(w);k=t.createRange();k.setStart(w.firstChild,0);k.setEndBefore(w.lastChild);p=p.getSelection();p.rangeCount>0&&p.removeAllRanges();p.addRange(k);var z=this;p=function(){z._clientDiv.removeChild(w);z._updateDOMSelection()};k=false;this._ignoreCopy=true;try{k=t.execCommand("copy",false,null)}catch(A){}this._ignoreCopy=false;if(!k)if(m){setTimeout(p,0);return false}p();return true}if(m&&
m.clipboardData){n=[];this._convertDelimiter(k,function(C){n.push(C)},function(){n.push(v)});return m.clipboardData.setData("text/plain",n.join(""))}},_setDOMSelection:function(k,m,n,p){for(var t=this._frameWindow,w=this._frameDocument,z,A,C,F,E=0,H=k.firstChild,K,L,P=this._model.getLine(k.lineIndex).length;H;){K=H.firstChild;L=K.length;if(H.ignoreChars)L-=H.ignoreChars;if(E+L>m||E+L>=P){z=K;A=m-E;if(H.ignoreChars&&L>0&&A===L)A+=H.ignoreChars;break}E+=L;H=H.nextSibling}E=0;H=n.firstChild;for(var S=
this._model.getLine(n.lineIndex).length;H;){K=H.firstChild;L=K.length;if(H.ignoreChars)L-=H.ignoreChars;if(L+E>p||E+L>=S){C=K;F=p-E;if(H.ignoreChars&&L>0&&F===L)F+=H.ignoreChars;break}E+=L;H=H.nextSibling}this._setDOMFullSelection(k,m,P,n,p,S);if(!l)if(t.getSelection){w=w.createRange();w.setStart(z,A);w.setEnd(C,F);C=t.getSelection();this._ignoreSelect=false;C.rangeCount>0&&C.removeAllRanges();C.addRange(w);this._ignoreSelect=true}else if(w.selection){t=w.body;w=w.createElement("DIV");t.appendChild(w);
t.removeChild(w);w=t.createTextRange();w.moveToElementText(z.parentNode);w.moveStart("character",A);z=t.createTextRange();z.moveToElementText(C.parentNode);z.moveStart("character",F);w.setEndPoint("EndToStart",z);this._ignoreSelect=false;w.select();this._ignoreSelect=true}},_setDOMFullSelection:function(k,m,n,p,t,w){var z=this._model;if(this._selDiv1){var A,C;A=this._getLineBoundingClientRect(k);if(m===0)C=A.left;else if(m>=n)C=A.right;else{this._ignoreDOMSelection=true;C=this._getBoundsAtOffset(z.getLineStart(k.lineIndex)+
m).left;this._ignoreDOMSelection=false}if(n=this._textArea){n.selectionStart=n.selectionEnd=0;var F=this._frame.getBoundingClientRect(),E=this._touchDiv.getBoundingClientRect(),H=this._viewDiv.getBoundingClientRect();n.style.left=!(H.left<=C&&C<=H.left+H.width&&H.top<=A.top&&A.top<=H.top+H.height)||!(k===p&&m===t)?"-1000px":C-4+F.left-E.left+"px";n.style.top=A.top+F.top-E.top+"px";n.style.width="6px";n.style.height=A.bottom-A.top+"px"}n=this._selDiv1;n.style.width="0px";n.style.height="0px";n=this._selDiv2;
n.style.width="0px";n.style.height="0px";n=this._selDiv3;n.style.width="0px";n.style.height="0px";if(!(k===p&&m===t)){F=l?2:0;E=F+"px blue solid";H=this._getViewPadding();var K=this._clientDiv.getBoundingClientRect(),L=this._viewDiv.getBoundingClientRect();m=L.left+H.left;n=K.right;H=L.top+H.top;K=K.bottom;L=this._getLineBoundingClientRect(p);if(t===0)t=L.left;else if(t>=w)t=L.right;else{this._ignoreDOMSelection=true;t=this._getBoundsAtOffset(z.getLineStart(p.lineIndex)+t).left;this._ignoreDOMSelection=
false}w=this._selDiv1;C=Math.min(n,Math.max(m,C));z=Math.min(K,Math.max(H,A.top));var P=n;A=Math.min(K,Math.max(H,A.bottom));w.style.left=C+"px";w.style.top=z+"px";w.style.width=Math.max(0,P-C)+"px";w.style.height=Math.max(0,A-z)+(l?1:0)+"px";if(l){w.style.borderLeft=E;w.style.borderRight="0px"}if(k===p){P=Math.min(t,n);w.style.width=Math.max(0,P-C-F*2)+"px";if(l)w.style.borderRight=E}else{k=Math.min(K,Math.max(H,L.top));p=Math.min(n,Math.max(m,t));C=Math.min(K,Math.max(H,L.bottom));t=this._selDiv3;
t.style.left=m+"px";t.style.top=k+"px";t.style.width=Math.max(0,p-m-F)+"px";t.style.height=Math.max(0,C-k)+"px";if(l)t.style.borderRight=E;if(k-A>0){p=this._selDiv2;p.style.left=m+"px";p.style.top=A+"px";p.style.width=Math.max(0,n-m)+"px";p.style.height=Math.max(0,k-A)+(l?1:0)+"px"}}}}},_setGrab:function(k){if(k!==this._grabControl)if(k){c(k,"mousemove",this._mouseMoveClosure);c(k,"mouseup",this._mouseUpClosure);k.setCapture&&k.setCapture();this._grabControl=k}else{g(this._grabControl,"mousemove",
this._mouseMoveClosure);g(this._grabControl,"mouseup",this._mouseUpClosure);this._grabControl.releaseCapture&&this._grabControl.releaseCapture();this._grabControl=null}},_setSelection:function(k,m,n){if(k){this._columnX=-1;if(n===undefined)n=true;var p=this._selection;if(!p.equals(k)){this._selection=k;this.onSelection({oldValue:{start:p.start,end:p.end},newValue:{start:k.start,end:k.end}})}if(m)n=!this._showCaret();n&&this._updateDOMSelection()}},_setSelectionTo:function(k,m,n){var p=this._model,
t=this._getSelection();m=this._getYToLine(m);if(this._clickCount===1){p=this._getXToOffset(m,k);t.extend(p);n||t.collapse()}else{if((this._clickCount&1)===0){p=this._getXToOffset(m,k);if(this._doubleClickSelection)if(p>=this._doubleClickSelection.start){n=this._doubleClickSelection.start;p=this._getOffset(p,"wordend",+1)}else{n=this._getOffset(p,"word",-1);p=this._doubleClickSelection.end}else{n=this._getOffset(p,"word",-1);p=this._getOffset(n,"wordend",+1)}}else if(this._doubleClickSelection){k=
p.getLineAtOffset(this._doubleClickSelection.start);if(m>=k){n=p.getLineStart(k);p=p.getLineEnd(m)}else{n=p.getLineStart(m);p=p.getLineEnd(k)}}else{n=p.getLineStart(m);p=p.getLineEnd(m)}t.setCaret(n);t.extend(p)}this._setSelection(t,true,true)},_showCaret:function(){var k=this._model,m=this._getSelection(),n=this._getScroll(),p=m.getCaret(),t=m.start,w=m.end,z=k.getLineAtOffset(t),A=k.getLineAtOffset(w),C=Math.max(Math.max(t,k.getLineStart(A)),w-1),F=this._getViewPadding(),E=this._getClientWidth(),
H=F.left;F=F.left+E;var K=this._getBoundsAtOffset(p===t?t:C),L=K.left,P=K.right,S=E/4;if(!m.isEmpty()&&z===A){K=this._getBoundsAtOffset(p===w?t:C);if(E-S>(p===t?K.right-L:P-K.left)){if(L>K.left)L=K.left;if(P<K.right)P=K.right}}m=this._viewDiv.getBoundingClientRect();L-=m.left;P-=m.left;m=0;if(L<H)m=Math.min(L-H,-S);if(P>F)m=Math.min(this._scrollDiv.scrollWidth-n.x-E,Math.max(P-F,S));H=0;L=this._getTopIndex(true);P=this._getBottomIndex(true);k=k.getLineAtOffset(p);F=this._getClientHeight();if(!(L<=
k&&k<=P)){L=this._getLineHeight();z=(A-z)*L;H=k*L;H-=n.y;if(H+L>F){H-=F-L;if(p===t&&t!==w)H+=Math.min(F-L,z)}else if(p===w)H-=Math.min(F-L,z)}if(m!==0||H!==0){this._scrollView(m,H);if(F!==this._getClientHeight()||E!==this._getClientWidth())this._showCaret();else this._ensureCaretVisible=true;return true}return false},_startIME:function(){if(this._imeOffset===-1){var k=this._getSelection();k.isEmpty()||this._modifyContent({text:"",start:k.start,end:k.end},true);this._imeOffset=k.start}},_unhookEvents:function(){this._model.removeListener(this._modelListener);
this._mouseUpClosure=this._mouseMoveClosure=this._modelListener=null;for(var k=0;k<this._handlers.length;k++){var m=this._handlers[k];g(m.target,m.type,m.handler)}this._handlers=null},_updateDOMSelection:function(){if(!this._ignoreDOMSelection){var k=this._getSelection(),m=this._model,n=m.getLineAtOffset(k.start),p=m.getLineAtOffset(k.end),t=this._getLineNext();if(t){var w=this._getLinePrevious(),z;if(n<t.lineIndex){z=t;n=0}else if(n>w.lineIndex){z=w;n=0}else{z=this._getLineNode(n);n=k.start-m.getLineStart(n)}if(p<
t.lineIndex){t=t;k=0}else if(p>w.lineIndex){t=w;k=0}else{t=this._getLineNode(p);k=k.end-m.getLineStart(p)}this._setDOMSelection(z,n,t,k)}}},_updatePage:function(){function k(D){if(D){for(var I=L+z.top+z.bottom,O=D.firstChild.rows[0].cells,R=0;R<O.length;R++){var T=O[R].firstChild,X=C;if(T._ruler.getOverview()==="page")X+=P;T.style.top=-X+"px";T.style.height=I+X+"px"}D.style.height=I+"px"}}if(this._updateTimer){clearTimeout(this._updateTimer);this._updateTimer=null}var m=this._frameDocument,n=this._getFrameWidth(),
p=this._getFrameHeight();m.body.style.width=n+"px";m.body.style.height=p+"px";var t=this._viewDiv,w=this._clientDiv,z=this._getViewPadding();t.style.height=Math.max(0,p-z.top-z.bottom)+"px";var A=this._model,C=this._getLineHeight();p=this._getScroll().y;var F=Math.max(0,p)/C,E=Math.floor(F),H=Math.max(0,E-1);p=Math.round((F-H)*C);var K=A.getLineCount(),L=this._getClientHeight(),P=Math.round((F-E)*C);F=Math.floor((L+P)/C);F=Math.min(E+F,K-1);var S=Math.min(F+1,K-1);this._partialY=P;for(var Y,Q=w.firstChild;Q;){Y=
Q.lineIndex;var ea=Q.nextSibling;if(!(H<=Y&&Y<=S)||Q.lineChanged||Q.lineIndex===-1)if(this._mouseWheelLine===Q){Q.style.display="none";Q.lineIndex=-1}else w.removeChild(Q);Q=ea}Q=this._getLineNext();ea=m.createDocumentFragment();for(Y=H;Y<=S;Y++)if(!Q||Q.lineIndex>Y)this._createLine(ea,null,m,Y,A);else{if(ea.firstChild){w.insertBefore(ea,Q);ea=m.createDocumentFragment()}Q=this._getLineNext(Q)}ea.firstChild&&w.insertBefore(ea,Q);if(h)w.style.width=(524287).toString()+"px";for(Q=this._getLineNext();Q;){m=
Q.lineWidth;if(m===undefined){m=this._getLineBoundingClientRect(Q);m=Q.lineWidth=m.right-m.left}if(m>=this._maxLineWidth){this._maxLineWidth=m;this._maxLineIndex=Q.lineIndex}if(Q.lineIndex===E)this._topChild=Q;if(Q.lineIndex===F)this._bottomChild=Q;Q=this._getLineNext(Q)}this._updateRuler(this._leftDiv,E,F);this._updateRuler(this._rightDiv,E,F);m=this._leftDiv?this._leftDiv.scrollWidth:0;E=this._rightDiv?this._rightDiv.scrollWidth:0;t.style.left=m+"px";t.style.width=Math.max(0,n-m-E-z.left-z.right)+
"px";if(this._rightDiv)this._rightDiv.style.left=n-E+"px";E=this._scrollDiv;n=K*C;E.style.height=n+"px";t=this._getClientWidth();K=A=Math.max(this._maxLineWidth,t);if(!d||d>=9)A+=z.right;E.style.width=A+"px";E=this._getScroll();H=A=E.x;F=p;Q=A+t;S=p+L;if(H===0)H-=z.left;if(F===0)F-=z.top;if(Q===K)Q+=z.right;if(E.y+L===n)S+=z.bottom;w.style.clip="rect("+F+"px,"+Q+"px,"+S+"px,"+H+"px)";w.style.left=-A+m+z.left+"px";w.style.top=-p+z.top+"px";w.style.width=(h?K:t+A)+"px";w.style.height=L+p+"px";if(p=
this._overlayDiv){p.style.clip=w.style.clip;p.style.left=w.style.left;p.style.top=w.style.top;p.style.width=w.style.width;p.style.height=w.style.height}k(this._leftDiv);k(this._rightDiv);if(l){var B=this;setTimeout(function(){B._resizeTouchDiv()},0)}this._updateDOMSelection();w=this._ensureCaretVisible;this._ensureCaretVisible=false;if(L!==this._getClientHeight()){this._updatePage();w&&this._showCaret()}},_updateRuler:function(k,m,n){if(k){k=k.firstChild.rows[0].cells;for(var p=this._getLineHeight(),
t=this._frameDocument,w=this._getViewPadding(),z=0;z<k.length;z++){var A=k[z].firstChild,C=A._ruler;A.rulerChanged&&this._applyStyle(C.getStyle(),A);var F,E=A.firstChild;if(E){F=E;E=E.nextSibling}else{F=t.createElement("DIV");F.style.visibility="hidden";A.appendChild(F)}var H;if(A.rulerChanged)if(F){H=-1;this._applyStyle(C.getStyle(H),F);F.innerHTML=C.getHTML(H);F.lineIndex=H;F.style.height=p+w.top+"px"}var K;if(C.getOverview()==="page"){for(;E;){H=E.lineIndex;F=E.nextSibling;if(!(m<=H&&H<=n)||E.lineChanged)A.removeChild(E);
E=F}E=A.firstChild.nextSibling;K=document.createDocumentFragment();for(H=m;H<=n;H++)if(!E||E.lineIndex>H){F=t.createElement("DIV");this._applyStyle(C.getStyle(H),F);F.innerHTML=C.getHTML(H);F.lineIndex=H;F.style.height=p+"px";K.appendChild(F)}else{if(K.firstChild){A.insertBefore(K,E);K=document.createDocumentFragment()}if(E)E=E.nextSibling}K.firstChild&&A.insertBefore(K,E)}else{E=this._getClientHeight()+w.top+w.bottom-34;H=this._model.getLineCount();var L=E/H;if(A.rulerChanged){for(H=A.childNodes.length;H>
1;){A.removeChild(A.lastChild);H--}var P=C.getAnnotations();K=document.createDocumentFragment();for(var S=0;S<P.length;S++){H=P[S];F=t.createElement("DIV");this._applyStyle(C.getStyle(H),F);F.style.position="absolute";F.style.top=17+p+Math.floor(H*L)+"px";F.innerHTML=C.getHTML(H);F.lineIndex=H;K.appendChild(F)}A.appendChild(K)}else if(A._oldTrackHeight!==E)for(F=A.firstChild?A.firstChild.nextSibling:null;F;){F.style.top=17+p+Math.floor(F.lineIndex*L)+"px";F=F.nextSibling}A._oldTrackHeight=E}A.rulerChanged=
false}}}};return a}();typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("orion/textview/textView",["orion/textview/textModel","orion/textview/keyBinding"],function(){return orion.textview});var examples=examples||{};examples.textview=examples.textview||{};
examples.textview.TextStyler=function(){function c(q,v){this.commentStart="/*";this.commentEnd="*/";var y=[];switch(v){case "java":y=a;break;case "js":y=g;break;case "css":y=d;break}this.whitespacesVisible=false;this.highlightCaretLine=true;this._scanner=new u(y,this.whitespacesVisible);if(v==="css")this._scanner.isCSS=true;this._whitespaceScanner=new s;this.view=q;this.commentOffset=0;this.commentOffsets=[];this._matchingBracket=this._currentBracket=undefined;q.addEventListener("Selection",this,
this._onSelection);q.addEventListener("ModelChanged",this,this._onModelChanged);q.addEventListener("Destroy",this,this._onDestroy);q.addEventListener("LineStyle",this,this._onLineStyle);q.redrawLines()}var g=["break","continue","do","for","new","this","case","default","else","function","in","return","typeof","while","comment","delete","export","if","switch","var","with","abstract","implements","protected","public","interface","static","synchronized","false","throws","final","null","transient","package",
"true","goto","private","catch","enum","throw","class","extends","try","const","finally","debugger","super","undefined"],a=["abstract","boolean","break","byte","case","catch","char","class","continue","default","do","double","else","extends","false","final","finally","float","for","if","implements","import","instanceof","int","interface","long","native","new","null","package","private","protected","public","return","short","static","super","switch","synchronized","this","throw","throws","transient",
"true","try","void","volatile","while"],d=["color","text-align","text-indent","text-decoration","font","font-style","font-family","font-weight","font-size","font-variant","line-height","background","background-color","background-image","background-position","background-repeat","background-attachment","list-style","list-style-image","list-style-position","list-style-type","outline","outline-color","outline-style","outline-width","border","border-left","border-top","border-bottom","border-right","border-color",
"border-width","border-style","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","width","height","left","top","right","bottom","min-width","max-width","min-height","max-height",
"display","visibility","clip","cursor","overflow","overflow-x","overflow-y","position","z-index","vertical-align","horizontal-align","float","clear"],e={styleClass:"token_comment"},f={styleClass:"token_javadoc"},i={styleClass:"token_string"},j={styleClass:"token_keyword"},h={styleClass:"token_space"},l={styleClass:"token_tab"},o={styleClass:(document.selection&&window.ActiveXObject&&/MSIE/.test(navigator.userAgent)?document.documentMode:undefined)<9?"token_bracket":"token_bracket_outline"},r={styleClass:"line_caret"},
u=function(){function q(v,y){this.keywords=v;this.whitespacesVisible=y;this.setText("")}q.prototype={getOffset:function(){return this.offset},getStartOffset:function(){return this.startOffset},getData:function(){return this.text.substring(this.startOffset,this.offset)},getDataLength:function(){return this.offset-this.startOffset},_read:function(){if(this.offset<this.text.length)return this.text.charCodeAt(this.offset++);return-1},_unread:function(v){v!==-1&&this.offset--},nextToken:function(){for(this.startOffset=
this.offset;;){var v=this._read();switch(v){case -1:return null;case 47:v=this._read();if(v===47)for(;;){v=this._read();if(v===-1||v===10){this._unread(v);return 4}}this._unread(v);return 1;case 39:for(;;){v=this._read();switch(v){case 39:return 3;case -1:this._unread(v);return 3;case 92:this._read();break}}break;case 34:for(;;){v=this._read();switch(v){case 34:return 3;case -1:this._unread(v);return 3;case 92:this._read();break}}break;case 32:case 9:if(this.whitespacesVisible)return v===32?7:6;do v=
this._read();while(v===32||v===9);this._unread(v);return 5;default:var y=this.isCSS;if(97<=v&&v<=122||65<=v&&v<=90||v===95||48<=v&&v<=57||45===v&&y){var x=this.offset-1;do v=this._read();while(97<=v&&v<=122||65<=v&&v<=90||v===95||48<=v&&v<=57||45===v&&y);this._unread(v);v=this.text.substring(x,this.offset);for(y=0;y<this.keywords.length;y++)if(this.keywords[y]===v)return 2}return 1}}},setText:function(v){this.text=v;this.startOffset=this.offset=0}};return q}(),s=function(){function q(){u.call(this,
null,true)}q.prototype=new u(null);q.prototype.nextToken=function(){for(this.startOffset=this.offset;;){var v=this._read();switch(v){case -1:return null;case 32:return 7;case 9:return 6;default:do v=this._read();while(!(v===32||v===9||v===-1));this._unread(v);return 1}}};return q}();c.prototype={destroy:function(){var q=this.view;if(q){q.removeEventListener("Selection",this,this._onSelection);q.removeEventListener("ModelChanged",this,this._onModelChanged);q.removeEventListener("Destroy",this,this._onDestroy);
q.removeEventListener("LineStyle",this,this._onLineStyle);this.view=null}},setHighlightCaretLine:function(q){this.highlightCaretLine=q},setWhitespacesVisible:function(q){this.whitespacesVisible=q;this._scanner.whitespacesVisible=q},_binarySearch:function(q,v,y,x){for(;x-y>2;){var k=x+y>>1>>1<<1;if(q[k+1]>v)x=k;else y=k}return x},_computeComments:function(q){if(!(q<=this.commentOffset)){var v=this.view.getModel(),y=v.getCharCount();v=v.getText(this.commentOffset,q);this.commentOffsets.length>1&&this.commentOffsets[this.commentOffsets.length-
1]===y&&this.commentOffsets.length--;for(var x=0;x<v.length;){var k=(this.commentOffsets.length&1)===0,m=k?this.commentStart:this.commentEnd;x=v.indexOf(m,x);if(x!==-1)this.commentOffsets.push(this.commentOffset+(k?x:x+m.length));else break;x=x+m.length}(this.commentOffsets.length&1)===1&&this.commentOffsets.push(y);this.commentOffset=q}},_getCommentRanges:function(q,v){this._computeComments(v);var y=this.commentOffsets.length;q=this._binarySearch(this.commentOffsets,q,-1,y);if(q>=y)return[];if(this.commentOffsets[q]>
v)return[];y=Math.min(y-2,this._binarySearch(this.commentOffsets,v,q-1,y));if(this.commentOffsets[y]>v)y=Math.max(q,y-2);return this.commentOffsets.slice(q,y+2)},_getLineStyle:function(q){if(this.highlightCaretLine){var v=this.view,y=v.getModel();v=v.getSelection();if(v.start===v.end&&y.getLineAtOffset(v.start)===q)return r}return null},_getStyles:function(q,v){for(var y=v+q.length,x=this.view.getModel(),k=this._getCommentRanges(v,y),m=[],n=v,p=0;p<k.length;p+=2){var t=k[p];n<t&&this._parse(q.substring(n-
v,t-v),n,m);var w=e;if(k[p+1]-t>this.commentStart.length+this.commentEnd.length){var z=t+this.commentStart.length;if(x.getText(z,z+1)==="*")w=f}if(this.whitespacesVisible){n=Math.max(n,t);t=Math.min(y,k[p+1]);this._parseWhitespace(q.substring(n-v,t-v),n,m,w)}else m.push({start:k[p],end:k[p+1],style:w});n=k[p+1]}n<y&&this._parse(q.substring(n-v,y-v),n,m);return m},_parse:function(q,v,y){var x=this._scanner;for(x.setText(q);q=x.nextToken();){var k=x.getStartOffset()+v,m=null;if(k===this._matchingBracket)m=
o;else switch(q){case 2:m=j;break;case 3:if(this.whitespacesVisible){this._parseWhitespace(x.getData(),k,y,i);continue}else m=i;break;case 4:if(this.whitespacesVisible){this._parseWhitespace(x.getData(),k,y,e);continue}else m=e;break;case 6:if(this.whitespacesVisible)m=l;break;case 7:if(this.whitespacesVisible)m=h;break}y.push({start:k,end:x.getOffset()+v,style:m})}},_parseWhitespace:function(q,v,y,x){var k=this._whitespaceScanner;for(k.setText(q);q=k.nextToken();){var m=k.getStartOffset()+v,n=x;
switch(q){case 6:n=l;break;case 7:n=h;break}y.push({start:m,end:k.getOffset()+v,style:n})}},_findBrackets:function(q,v,y,x,k,m){for(var n=[],p=this._getCommentRanges(k,m),t=k,w=this._scanner,z,A=0;A<p.length;A+=2){z=p[A];if(t<z)for(w.setText(y.substring(t-k,z-k));w.nextToken();)if(w.getDataLength()===1){z=w.getData();z===q&&n.push(w.getStartOffset()+t-k+x);z===v&&n.push(-(w.getStartOffset()+t-k+x))}t=p[A+1]}if(t<m)for(w.setText(y.substring(t-k,m-k));w.nextToken();)if(w.getDataLength()===1){z=w.getData();
z===q&&n.push(w.getStartOffset()+t-k+x);z===v&&n.push(-(w.getStartOffset()+t-k+x))}return n},_onDestroy:function(){this.destroy()},_onLineStyle:function(q){q.style=this._getLineStyle(q.lineIndex);q.ranges=this._getStyles(q.lineText,q.lineStart)},_onSelection:function(q){var v=q.oldValue,y=q.newValue;q=this.view;var x=q.getModel(),k;if(this._matchingBracket!==undefined){k=x.getLineAtOffset(this._matchingBracket);q.redrawLines(k,k+1);this._matchingBracket=this._currentBracket=undefined}if(this.highlightCaretLine){var m=
x.getLineAtOffset(v.start);k=x.getLineAtOffset(y.start);var n=y.start===y.end;v=v.start===v.end;if(!(m===k&&v&&n)){v&&q.redrawLines(m,m+1);if((m!==k||!v)&&n)q.redrawLines(k,k+1)}}if(!(y.start!==y.end||y.start===0)){m=q.getCaretOffset();if(m!==0){n="{}()[]<>";v=x.getText(m-1,m);var p=n.indexOf(v,0);if(p!==-1){y=p&1?n.substring(p-1,p):n.substring(p+1,p+2);k=x.getLineAtOffset(m);n=x.getLine(k);var t=x.getLineStart(k),w=x.getLineEnd(k);n=this._findBrackets(v,y,n,t,t,w);for(w=0;w<n.length;w++){t=n[w]>=
0?1:-1;if(n[w]*t===m-1){m=1;this._currentBracket=n[w]*t;if(p&1){for(w--;w>=0;w--){t=n[w]>=0?1:-1;m+=t;if(m===0){this._matchingBracket=n[w]*t;q.redrawLines(k,k+1);return}}for(k-=1;k>=0;){n=x.getLine(k);t=x.getLineStart(k);w=x.getLineEnd(k);n=this._findBrackets(v,y,n,t,t,w);for(p=n.length-1;p>=0;p--){t=n[p]>=0?1:-1;m+=t;if(m===0){this._matchingBracket=n[p]*t;q.redrawLines(k,k+1);return}}k--}}else{for(w++;w<n.length;w++){t=n[w]>=0?1:-1;m+=t;if(m===0){this._matchingBracket=n[w]*t;q.redrawLines(k,k+1);
return}}k+=1;for(p=x.getLineCount();k<p;){n=x.getLine(k);t=x.getLineStart(k);w=x.getLineEnd(k);n=this._findBrackets(v,y,n,t,t,w);for(w=0;w<n.length;w++){t=n[w]>=0?1:-1;m+=t;if(m===0){this._matchingBracket=n[w]*t;q.redrawLines(k,k+1);return}}k++}}break}}}}}},_onModelChanged:function(q){var v=q.start,y=q.removedCharCount;q=q.addedCharCount;if(this._matchingBracket&&v<this._matchingBracket)this._matchingBracket+=q+y;if(this._currentBracket&&v<this._currentBracket)this._currentBracket+=q+y;if(!(v>=this.commentOffset)){var x=
this.view.getModel(),k=this.commentOffsets.length,m=Math.max(this.commentStart.length-1,this.commentEnd.length-1);if(k===0)this.commentOffset=Math.max(0,v-m);else{var n=x.getCharCount(),p=n-q+y,t=this._binarySearch(this.commentOffsets,v,-1,k),w=v+y,z=this._binarySearch(this.commentOffsets,w,t-1,k),A;if(t>0)A=this.commentOffsets[--t];else{A=Math.max(0,Math.min(this.commentOffsets[t],v)-m);--t}var C;k=n;if(z+1<this.commentOffsets.length){C=this.commentOffsets[++z];if(w>C-this.commentEnd.length)if(z+
2<this.commentOffsets.length){z+=2;C=this.commentOffsets[z];k=C+1;if(k>v)k+=q-y}else this.commentOffset=C=Math.min(p,w+m)}else{this.commentOffset=C=Math.min(p,w+m);if(z>0&&z===this.commentOffsets.length)z=this.commentOffsets.length-1}if(A>v)A+=q-y;if(C>v)C+=q-y;this.commentOffsets.length>1&&this.commentOffsets[this.commentOffsets.length-1]===p&&this.commentOffsets.length--;p=0;m=[];x=x.getText(A,C);if(this.commentOffset<C)this.commentOffset=C;for(;p<x.length;){w=(C=(t+1+m.length&1)===0)?this.commentStart:
this.commentEnd;p=x.indexOf(w,p);if(p!==-1)m.push(A+(C?p:p+w.length));else break;p=p+w.length}A=z-t!==m.length;if(!A)for(x=0;x<m.length;x++){p=this.commentOffsets[t+1+x];if(p>v)p+=q-y;if(p!==m[x]){A=true;break}}z=[t+1,z-t].concat(m);Array.prototype.splice.apply(this.commentOffsets,z);for(t=t+1+m.length;t<this.commentOffsets.length;t++)this.commentOffsets[t]+=q-y;(this.commentOffsets.length&1)===1&&this.commentOffsets.push(n);A&&this.view.redrawRange(v+q,k)}}}};return c}();
typeof window!=="undefined"&&typeof window.define!=="undefined"&&define("examples/textview/textStyler",[],function(){return examples.textview});
define("orion/compare/compare-container",["dojo","orion/compare/diff-parser","orion/compare/rulers","orion/compare/compare-model","orion/compare/compare-m-model","orion/editor/contentAssist","orion/editorCommands","orion/editor/editor","orion/editor/editorFeatures","orion/globalCommands","orion/breadcrumbs","orion/compare/gap-model","orion/commands","orion/textview/textModel","orion/textview/textView","examples/textview/textStyler"],function(c,g,a,d,e,f,i,j,h,l,o,r,u,s,q,v){var y={};y.CompareContainer=
function(){function x(){this._diffParser=new g.DiffParser;this._input=this._diff=null}x.prototype={_getLineDelim:function(){return"\n"},setDiffProvider:function(k){this._diffProvider=k},getFileDiff:function(k,m,n,p){var t=this;this._diffProvider.getDiffContent(k,function(w){t._diff=t._conflict?w.split("diff --git")[1]:w;p?t.setEditor(this._input,t._diff,p):t.getFileURI(k,m,n)},n)},getFileURI:function(k,m,n){var p=this;this._diffProvider.getDiffFileURI(k,function(t){p._oldFileURI=t.Git.Old;p._newFileURI=
t.Git.New;p.getFileContent(t.Git.Old,n);m&&m(t.Git.New,t.Git.Old)},n)},getFileContent:function(k,m){var n=this;n._registry.getService("orion.core.file").then(function(p){p.read(k).then(function(t){this._input=t;n.setEditor(t,n._diff)},function(t,w){if(t.status===404){this._input="";n.setEditor("",n._diff)}else m&&m(t,w)})})},parseMapper:function(k,m,n,p){var t=this._getLineDelim(k,m);this._diffParser.setLineDelim(t);k=this._diffParser.parse(k,m,n,p);m=this._diffParser.getDiffArray();return{delim:t,
mapper:k.mapper,output:k.outPutFile,diffArray:m}},resolveDiff:function(k,m,n,p){var t=k;k=k.split("?");if(k.length===2){t=k[0];k=k[1].split("=");if(k.length===2&&k[0]==="conflict"&&k[1]==="true")this._conflict=true}this._diffURI=t;this.getFileDiff(t,m,n,p)},resolveDiffonSave:function(){this.getFileDiff(this._diffURI,null,null,true)},_initDiffPosition:function(k){var m=k.getModel();if(m&&m.getAnnotations){m=m.getAnnotations();if(m.length>0){m=m[0][0];var n=k.getLineHeight(),p=k.getClientArea();n=Math.floor(p.height/
n/3);k.setTopIndex(m-n>0?m-n:0)}}}};return x}();y.SBSCompareContainer=function(){function x(k,m,n){this._textViewRight=this._textViewLeft=null;this._registry=k;this._leftEditorDivId=m;this._rightEditorDivId=n}x.prototype=new y.CompareContainer;x.prototype.setEditor=function(k,m){m=this.parseMapper(k,m);if(this._textViewLeft&&this._textViewRight)if(m.delim===this._textViewLeft.getModel().getLineDelimiter()){this._textViewLeft.getModel().init(m.mapper);this._textViewLeft.setText(m.output);this._textViewRight.getModel().init(m.mapper);
this._textViewRight.setText(k);this._initDiffPosition(this._textViewLeft);return}var n=new s.TextModel(m.output,m.delim);n=new d.CompareTextModel(n,{mapper:m.mapper,columnIndex:0},new r.GapLineFeeder(m.delim));k=new s.TextModel(k,m.delim);k={parent:this._rightEditorDivId,model:new d.CompareTextModel(k,{mapper:m.mapper,columnIndex:1},new r.GapLineFeeder(m.delim)),readonly:true,stylesheet:"/orion/compare/editor.css"};this._textViewRight=new q.TextView(k);this._textViewRight.addRuler(new a.LineNumberCompareRuler(0,
"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));this._textViewLeft=new q.TextView({parent:this._leftEditorDivId,model:n,readonly:true,stylesheet:"/orion/compare/editor.css"});this._textViewLeft.addRuler(new a.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));var p=this;this._textViewLeft.addEventListener("LineStyle",window,function(t){var w=t.lineIndex;w=p._editorLeft.getModel().getLineType(w);
if(w==="added")t.style={style:{backgroundColor:"#99EE99"}};else if(w==="changed")t.style={style:{backgroundColor:"#FFDD88"}};else if(w==="removed"||w==="changed_gap")t.style={style:{backgroundColor:"#DDDDDD"}}});this._textViewLeft.addEventListener("Scroll",window,function(){p._editorRight.setTopPixel(p._editorLeft.getTopPixel())});this._textViewLeft.redrawRange();this._textViewRight.addEventListener("LineStyle",window,function(t){var w=t.lineIndex;w=p._editorRight.getModel().getLineType(w);if(w===
"removed")t.style={style:{backgroundColor:"#EE9999"}};else if(w==="changed")t.style={style:{backgroundColor:"#FFDD88"}};else if(w==="added"||w==="changed_gap")t.style={style:{backgroundColor:"#DDDDDD"}}});this._textViewRight.addEventListener("Scroll",window,function(){p._editorLeft.setTopPixel(p._editorRight.getTopPixel())});this._textViewRight.addRuler(new y.CompareOverviewRuler("right",{styleClass:"ruler_overview"}));this._initDiffPosition(this._textViewLeft);this._textViewRight.redrawRange()};
return x}();y.CompareSyntaxHighlighter=function(){function x(){this.styler=null}x.prototype={highlight:function(k,m){if(this.styler){this.styler.destroy();this.styler=null}if(k){k=k.split(".");if(k.length>0)switch(k.pop().toLowerCase()){case "js":this.styler=new v.TextStyler(m,"js");break;case "java":this.styler=new v.TextStyler(m,"java");break;case "html":break;case "xml":break;case "css":this.styler=new v.TextStyler(m,"css");break}}}};return x}();y.DiffStyler=function(){function x(k,m){this._compareMatchRenderer=
k;this._textView=m}x.prototype={highlight:function(k){this._textView&&this._textView.removeEventListener("LineStyle",this,this._onLineStyle);if(k)this._textView=k;this._textView&&!this._textView.getModel().isMapperEmpty()&&this._textView.addEventListener("LineStyle",this,this._onLineStyle)},_onLineStyle:function(k){var m=this._textView,n=k.lineIndex,p=m.getModel().getLineType(n);n=p.type;var t=m.getModel().getAnnotationIndexByMapper(p.mapperIndex);p=(m=m.getModel().isMapperConflict(p.mapperIndex))?
"#EEB4B4":"#DDDDDD";var w="url('/images/diff-border.png')";if(t===this._compareMatchRenderer.getCurrentAnnotationIndex()){p=m?"#F08080":"#BBBBBB";w="url('/images/diff-border-sel.png')"}if(n==="top-only")k.style={style:{backgroundImage:w,backgroundRepeat:"repeat-x"}};else if(n!=="unchanged")k.style={style:{backgroundColor:p}}}};return x}();y.CompareMergeStyler=function(){function x(k){this._syntaxHighlither=new y.CompareSyntaxHighlighter;this._diffHighlither=new y.DiffStyler(k)}x.prototype={highlight:function(k,
m){this._syntaxHighlither.highlight(k,m);this._diffHighlither.highlight(m)}};return x}();y.CompareMergeContainer=function(){function x(k,m,n,p,t,w){this.setDiffProvider(m);this._uiFactory=w;this.readonly=k;this._registry=n;this._commandService=p;this._leftEditorDivId=this._uiFactory.getEditorParentDivId(true);this._fileClient=t;this._rightEditorDivId=this._uiFactory.getEditorParentDivId(false);this.initCommands();var z=this;this._inputManager={filePath:"",getInput:function(){return this.filePath},
setDirty:function(A){if(A)this._lastTitle&&this._lastTitle.charAt(0)!=="*"&&this.setTitle("*"+this._lastTitle);else this._lastTitle&&this._lastTitle.charAt(0)==="*"&&this.setTitle(this._lastTitle.substring(1))},setInput:function(A){t.read(A,true).then(c.hitch(this,function(C){this._fileMetadata=C;this.setTitle(C.Location)}),c.hitch(this,function(C){console.error("Error loading file metadata: "+C.message);this.setTitle(A)}));this.lastFilePath=A},setTitle:function(A){var C=A.lastIndexOf("/"),F=A;if(C!==
-1){F="Compare "+F.substring(C+1);if(A.charAt(0)==="*")F="*"+F}this._lastTitle=F;window.document.title=F;if(C=c.byId("location")){c.empty(C);new o.BreadCrumbs({container:"location",resource:this._fileMetadata});if(A.charAt(0)==="*")c.create("b",null,C,"last").innerHTML="*"}},afterSave:function(){z.resolveDiffonSave()}};this._compareMatchRenderer=new a.CompareMatchRenderer(document.getElementById(this._uiFactory.getDiffCanvasDivId()));this._highlighter=[];this._highlighter.push(new y.CompareMergeStyler(this._compareMatchRenderer));
this._highlighter.push(new y.CompareMergeStyler(this._compareMatchRenderer));this.initEditorContainers("\n","fetching...","fetching...",[])}x.prototype=new y.CompareContainer;x.prototype.initEditorContainers=function(k,m,n,p,t,w,z){this._editorLeft=this.createEditorContainer(m,k,p,0,this._leftEditorDivId,this._uiFactory.getStatusDivId(true),this.readonly,t,w);l.generateDomCommandsInBanner(this._commandService,this._editorLeft,"pageActions",true);this._textViewLeft=this._editorLeft.getTextView();this._editorRight=
this.createEditorContainer(n,k,p,1,this._rightEditorDivId,this._uiFactory.getStatusDivId(false),true,t,z);this._textViewRight=this._editorRight.getTextView();k=new a.CompareMergeOverviewRuler(this._compareMatchRenderer,"right",{styleClass:"ruler_overview"});this._textViewRight.addRuler(k);this._compareMatchRenderer.setOverviewRuler(k);var A=this;window.onbeforeunload=function(){if(A._editorLeft.isDirty())return"There are unsaved changes."}};x.prototype.initCommands=function(){var k=this,m=new u.Command({name:"Next Diff",
image:"/images/move_down.gif",id:"orion.compare.nextDiff",groupId:"orion.compareGroup",callback:function(){k.nextDiff()}}),n=new u.Command({name:"Previous Diff",image:"/images/move_up.gif",id:"orion.compare.prevDiff",groupId:"orion.compareGroup",callback:function(){k.prevDiff()}}),p=new u.Command({name:"Copy Current Change From Right to left",image:"/images/leftarrow.gif",id:"orion.compare.copyToLeft",groupId:"orion.compareGroup",callback:function(){k.copyToLeft()}});this._commandService.addCommand(n,
"dom");this._commandService.addCommand(m,"dom");this._commandService.addCommand(p,"dom");this._commandService.registerCommandContribution("orion.compare.prevDiff",3,"rightContainerCommands");this._commandService.registerCommandContribution("orion.compare.nextDiff",2,"rightContainerCommands");this.readonly||this._commandService.registerCommandContribution("orion.compare.copyToLeft",1,"rightContainerCommands");this._commandService.renderCommands("rightContainerCommands","dom",k,k,"image")};x.prototype.nextDiff=
function(){this._compareMatchRenderer.nextDiff()};x.prototype.prevDiff=function(){this._compareMatchRenderer.prevDiff()};x.prototype.copyToLeft=function(){this._compareMatchRenderer.copyToLeft()};x.prototype.createEditorContainer=function(k,m,n,p,t,w,z,A,C){var F=c.byId(t),E=this;k=new s.TextModel(k,m);var H=new e.CompareMergeModel(k,{mapper:n,columnIndex:p}),K="";n=z?new h.UndoFactory:new i.UndoCommandFactory(E._registry,E._commandService,"pageActions");n=new j.Editor({textViewFactory:function(){return new q.TextView({parent:F,
model:H,readonly:z,stylesheet:"/orion/compare/editor.css",tabSize:4})},undoStackFactory:n,contentAssistFactory:function(L){return new f.ContentAssist(L,"contentassist")},keyBindingFactory:function(L,P,S,Y){if(!z){(new i.EditorCommandFactory(E._registry,E._commandService,E._fileClient,E._inputManager,"pageActions")).generateEditorCommands(L);var Q=new h.TextActions(L,S);P.push(Q);L=new h.SourceCodeActions(L,S,Y);P.push(L)}},statusReporter:function(L,P){if(w){K=P?"ERROR: "+L:L;c.byId(w).innerHTML=""+
K}},domNode:F});n.installTextView();if(!z){inputManager=this._inputManager;c.connect(n,"onDirtyChange",inputManager,inputManager.setDirty)}k=n.getTextView();if(A&&C){A=C.split("?")[0];n.onInputChange(A);this._highlighter[p].highlight(A,n)}k.addRuler(new a.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"}));if(p===0){k.getModel().addListener(E._compareMatchRenderer);k.addEventListener("Scroll",window,function(){if(E._compareMatchRenderer){E._compareMatchRenderer.matchPositionFrom(true);
E._compareMatchRenderer.render()}})}else k.addEventListener("Scroll",window,function(){E._compareMatchRenderer&&E._compareMatchRenderer.render()});return n};x.prototype.setEditor=function(k,m,n){m=this.parseMapper(k,m,this._conflict,n);if(this._editorLeft)if(n){this._textViewLeft.getModel().init(m.mapper);this._textViewRight.getModel().init(m.mapper);this._textViewLeft.redrawRange();this._textViewRight.redrawRange()}else{this._inputManager.filePath=this._newFileURI;this._textViewLeft.getModel().init(m.mapper);
this._textViewRight.getModel().init(m.mapper);n=this._oldFileURI.split("?")[0];this._editorRight.onInputChange(n,null,k);this._highlighter[1].highlight(n,this._textViewRight);k=this._newFileURI.split("?")[0];this._editorLeft.onInputChange(k,null,m.output);this._highlighter[0].highlight(k,this._textViewLeft);this.readonly||this._inputManager.setInput(k,this._editorLeft)}else this.initEditorContainers(m.delim,m.output,k,m.mapper,true,this._newFileURI,this._oldFileURI);this._compareMatchRenderer.init(m.mapper,
this._textViewLeft,this._textViewRight);this._compareMatchRenderer.matchPositionFromAnnotation(-1)};return x}();y.InlineCompareContainer=function(){function x(k,m,n){this.setDiffProvider(k);this._registry=m;this._editorDivId=n;this.initEditorContainers("","\n",[],[])}x.prototype=new y.CompareContainer;x.prototype.addRulers=function(){if(this._textView&&!this._hasRuler){this._textView.addRuler(this._rulerOrigin);this._textView.addRuler(this._rulerNew);this._textView.addRuler(this._overview);this._hasRuler=
true}};x.prototype.removeRulers=function(){if(this._textView&&this._hasRuler){this._textView.removeRuler(this._rulerOrigin);this._textView.removeRuler(this._rulerNew);this._textView.removeRuler(this._overview);this._hasRuler=false}};x.prototype.destroyEditor=function(){if(this._textView){this._textView.getModel().init([],[]);this._textView.setText("");this.removeRulers()}};x.prototype.createEditorContainer=function(k,m,n,p,t,w){var z=c.byId(this._editorDivId);k=new s.TextModel(k,m);var A=new d.CompareTextModel(k,
{mapper:n,columnIndex:0},new d.DiffLineFeeder(p,m));m=new h.UndoFactory;m=new j.Editor({textViewFactory:function(){return new q.TextView({parent:z,model:A,readonly:true,stylesheet:"/orion/compare/editor.css",tabSize:4})},undoStackFactory:m,keyBindingFactory:function(){},statusReporter:function(){},domNode:z});m.installTextView();t&&w&&m.onInputChange(w.split("?")[0]);t=m.getTextView();this._rulerOrigin=new a.LineNumberCompareRuler(1,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},
{styleClass:"ruler_lines_even"});this._rulerNew=new a.LineNumberCompareRuler(0,"left",{styleClass:"ruler_lines"},{styleClass:"ruler_lines_odd"},{styleClass:"ruler_lines_even"});this._overview=new a.CompareOverviewRuler("right",{styleClass:"ruler_overview"});t.addEventListener("LineStyle",this,this._onLineStyle);return m};x.prototype.initEditorContainers=function(k,m,n,p,t){this._editor=this.createEditorContainer(m,k,n,p,t);this._textView=this._editor.getTextView()};x.prototype._onLineStyle=function(k){var m=
k.lineIndex;m=this._textView.getModel().getLineType(m);if(m==="added")k.style={style:{backgroundColor:"#99EE99"}};else if(m==="removed")k.style={style:{backgroundColor:"#EE9999"}}};x.prototype.setEditor=function(k,m){m=this.parseMapper(k,m,false,true);if(this._textView){this.addRulers();this._textView.getModel().init([],[]);this._textView.setText("");this._textView.getModel().init(m.mapper,m.diffArray);this._textView.setText(k)}else this.initEditorContainers(m.delim,k,m.mapper,m.diffArray,true,this._newFileURI);
this._initDiffPosition(this._textView)};return x}();return y});
define("orion/treetable",["dojo"],function(c){function g(a){this._init(a)}g.prototype={_init:function(a){var d=a.parent,e=this;if(typeof d==="string")d=c.byId(d);if(!d)throw"no parent";if(!a.model)throw"no tree model";if(!a.renderer)throw"no renderer";this._parent=d;this._treeModel=a.model;this._renderer=a.renderer;this._showRoot=a.showRoot===undefined?false:a.showRoot;this._indent=a.indent===undefined?16:a.indent;this._labelColumnIndex=a.labelColumnIndex===undefined?0:a.labelColumnIndex;this._id=
a.id===undefined?"treetable":a.id;this._root=this._treeModel.getRoot(function(f){if(this._showRoot){f._depth=0;this._generate([f],0)}else e._treeModel.getChildren(f,function(i){e._generate(i,0)})})},_generate:function(a,d){c.empty(this._parent);var e=document.createElement("table");e.id=this._id;this._renderer.initTable(e,this);var f=document.createElement("tbody");f.id=this._id+"tbody";this._generateChildren(a,d,f,"last");e.appendChild(f);this._parent.appendChild(e);this._rowsChanged()},_generateChildren:function(a,
d,e,f){for(var i in a){var j=document.createElement("tr");j.id=this._treeModel.getId(a[i]);j._depth=d;j._item=a[i];this._renderer.render(a[i],j);c.style(j.childNodes[this._labelColumnIndex],"paddingLeft",this._indent*d+"px");c.place(j,e,f);if(f==="after")e=j}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(a,d,e,f,i){var j=this._treeModel.getId(a);if(j===this._id){this._removeChildRows(j);
this._generateChildren(d,0,c.byId(j+"tbody"),"last");this._rowsChanged()}else{var h=c.byId(j);if(h){h._item=a;if(h&&(e||h._expanded)){h._expanded=true;this._removeChildRows(j);if(d){this._generateChildren(d,h._depth+1,h,"after");this._rowsChanged();if(f&&i)document.images[f].src=i}else{tree=this;d=this._treeModel.getChildren(h._item,function(l){tree._generateChildren(l,h._depth+1,h,"after");tree._rowsChanged()})}}}else console.log("could not find table row "+j)}},refreshAndExpand:function(a,d,e,f){this.refresh(a,
d,true,e,f)},getItem:function(a){if(typeof a==="string"){var d=c.byId(a);if(d)return d._item}if(a._item)return a._item;return a},toggle:function(a,d,e,f){var i=c.byId(a);if(i)if(i._expanded){this.collapse(a);if(d)document.images[d].src=f}else{this.expand(a);if(d)document.images[d].src=e}},isExpanded:function(a){if(a=c.byId(a))return a._expanded;return false},expand:function(a,d,e){a=typeof a==="string"?a:this._treeModel.getId(a);var f=c.byId(a);if(f)if(!f._expanded){f._expanded=true;var i=this;this._treeModel.getChildren(f._item,
function(j){i._generateChildren(j,f._depth+1,f,"after");i._rowsChanged();d&&d.apply(this,e)})}},_removeChildRows:function(a){c.byId(this._id);var d=a===this._id,e=false,f=-1,i=[];c.query(".treeTableRow").forEach(function(l){if(!e)if(d)if(l._depth>f)i.push(l);else e=true;else if(l.id===a){d=true;f=l._depth}});for(var j in i){var h=i[j];h.parentNode.removeChild(h)}},collapse:function(a){a=typeof a==="string"?a:this._treeModel.getId(a);var d=c.byId(a);if(d)if(d._expanded){d._expanded=false;this._removeChildRows(a);
this._rowsChanged()}}};g.prototype.constructor=g;return{TableTree:g}});
define("orion/explorer",["dojo","orion/treetable"],function(c,g){var a={};a.Explorer=function(){function d(e,f,i){this.registry=e;this.renderer=i;this.selection=f;this.myTree=null}d.prototype={changedItem:function(e,f){c.hitch(this.myTree,this.myTree.refreshAndExpand)(e,f)},updateCommands:function(e){this.myTree&&c.hitch(this.myTree._renderer,this.myTree._renderer.updateCommands(e))},makeNewItemPlaceHolder:function(e,f,i){e=this.getRow(e);if(i){e=e.childNodes[i];c.place("<br><span id='"+f+"placeHolderRow'></span>",
e,"last");if(i=c.byId(f+"placeHolderRow"))return{tempNode:i,refNode:i}}if(e){c.place("<tr id='"+f+"placeHolderRow'><td id='"+f+"placeHolderCol'></td>",e,"after");i=c.byId(f+"placeHolderRow");e=c.byId(f+"placeHolderCol");if(i&&e)return{tempNode:i,refNode:e}}return null},getRow:function(e){if(e=this.model.getId(e))return c.byId(e)},createTree:function(e,f){var i=e+"innerTree",j=c.byId(i);j&&c.destroy(j);if(f)f.rootId=i;this.model=f;this.myTree=new g.TableTree({id:i,model:f,showRoot:false,parent:e,labelColumnIndex:this.checkbox?
1:0,renderer:this.renderer});this.renderer._initializeUIState()},getRootPath:function(){if(this.model&&this.model.root)return this.model.root.Location;return null},_lastHash:null,checkbox:this.checkbox||true};return d}();a.ExplorerModel=function(){function d(e,f){this.rootPath=e;this.fetchItems=f}d.prototype={destroy:function(){},getRoot:function(e){this.fetchItems(this.rootPath).then(c.hitch(this,function(f){this.root=f;e(f)}))},getChildren:function(e,f){if(e.Children)f(e.Children);else e.ChildrenLocation?
this.fetchItems(e.ChildrenLocation).then(c.hitch(this,function(i){e.Children=i;f(i)})):f([])},getId:function(e){if(e===this.root)e=this.rootId;else{e=e.Location;e=e.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}return e}};return d}();a.ExplorerFlatModel=function(){function d(e,f){this.rootPath=e;this.fetchItems=f}d.prototype=new a.ExplorerModel;d.prototype.getChildren=function(e,f){e==this.root?f(e):f([])};return d}();a.ExplorerRenderer=function(){function d(e,f){this.explorer=f;this._init(e);this._expandImgSrc=
"/images/twistie_open.gif";this._collapseImgSrc="/images/twistie_closed.gif"}d.prototype={initTable:function(e,f){this.tableTree=f;c.empty(e);c.addClass(e,"treetable");this.renderTableHeader(e)},getActionsColumn:function(e,f){c.connect(f,"onmouseover",f,function(){var h=c.byId(this.id+"actionswrapper");c.style(h,"visibility","visible")});c.connect(f,"onmouseout",f,function(){var h=c.byId(this.id+"actionswrapper");c.style(h,"visibility","hidden")});var i=document.createElement("td");i.id=f.id+"actions";
var j=document.createElement("span");j.id=f.id+"actionswrapper";i.appendChild(j);c.style(j,"visibility","hidden");this.explorer.registry.getService("orion.page.command").then(function(h){h.renderCommands(j,"object",e,this.explorer,"image")});return i},initCheckboxColumn:function(){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(e,f){if(this._useCheckboxSelection){e=document.createElement("td");c.addClass(e,"secondaryColumn");var i=document.createElement("input");
c.style(i,"verticalAlign","middle");i.type="checkbox";i.id=f.id+"selectedState";c.addClass(i,"selectionCheckmark");i.itemId=f.id;e.appendChild(i);c.connect(i,"onclick",c.hitch(this,function(j){c.toggleClass(f,"checkedRow",!!j.target.checked);this._storeSelections();this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())}));return e}},_storeSelections:function(){var e=this.getSelectedIds(),f=this._getUIStatePreferencePath();if(f&&window.sessionStorage)window.sessionStorage[f+
"selection"]=JSON.stringify(e)},_restoreSelections:function(e){e=window.sessionStorage[e+"selection"];if(typeof e==="string")e=e.length>0?JSON.parse(e):null;var f;if(e)for(f=0;f<e.length;f++){var i=c.byId(e[f]);if(i){c.addClass(i,"checkedRow");if(i=c.byId(i.id+"selectedState"))i.checked=true}}e=this.getSelected();this.explorer.selection&&this.explorer.selection.setSelections(e)},_storeExpansions:function(e){window.sessionStorage[e+"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(e){var f=
false,i=window.sessionStorage[e+"expanded"];if(typeof i==="string")i=i.length>0?JSON.parse(i):null;var j;if(i)for(j=0;j<i.length;j++)if(c.byId(i[j])){this._expanded.push(i[j]);this.tableTree.expand(i[j],c.hitch(this,function(){this._restoreSelections(e)}));f=true}return!f},_getUIStatePreferencePath:function(){if(this.explorer){var e=this.explorer.getRootPath();if(this._cachePrefix&&e)return"/"+this._cachePrefix+"/"+e.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")+"/uiState"}return null},expandCollapseImageId:function(e){return e+
"__expand"},getExpandImage:function(e,f,i){var j=c.create("img",{style:"vertical-align: middle;",src:this._collapseImgSrc,name:this.expandCollapseImageId(e.id)},f,"last");c.create("img",{style:"vertical-align: middle; margin-right: 4px",src:i?i:"/images/folder.gif"},f,"last");j.onclick=c.hitch(this,function(){this.tableTree.toggle(e.id,this.expandCollapseImageId(e.id),this._expandImgSrc,this._collapseImgSrc);if(this.tableTree.isExpanded(e.id))this._expanded.push(e.id);else for(var h in this._expanded)if(this._expanded[h]===
e.id){this._expanded.splice(h,1);break}(h=this._getUIStatePreferencePath())&&window.sessionStorage&&this._storeExpansions(h)});return j},render:function(e,f){f.cellSpacing="8px";this.renderRow(e,f)},getSelected:function(){var e=[];c.query(".selectionCheckmark").forEach(c.hitch(this,function(f){f.checked&&e.push(this.tableTree.getItem(f.parentNode.parentNode))}));return e},getSelectedIds:function(){var e=[];c.query(".selectionCheckmark").forEach(c.hitch(this,function(f){f.checked&&e.push(f.parentNode.parentNode.id)}));
return e},rowsChanged:function(){c.query(".treeTableRow").forEach(function(e,f){if(f%2){c.addClass(e,"darkTreeTableRow");c.removeClass(e,"lightTreeTableRow")}else{c.addClass(e,"lightTreeTableRow");c.removeClass(e,"darkTreeTableRow")}});this.explorer.selection&&this.explorer.selection.setSelections(this.getSelected())},updateCommands:function(){var e=this.explorer.registry;c.query(".treeTableRow").forEach(function(f){var i=c.byId(f.id+"actionswrapper");c.empty(i);e.getService("orion.page.command").then(function(j){j.renderCommands(i,
"object",f._item,this.explorer,"image")})})},_init:function(e){if(e){this._useCheckboxSelection=e.checkbox===undefined?false:e.checkbox;this._colums=e.colums||[];this._cachePrefix=e.cachePrefix}},_initializeUIState:function(){this._expanded=[];var e=this._getUIStatePreferencePath();e&&window.sessionStorage&&this._restoreExpansions(e)&&this._restoreSelections(e)}};return d}();a.SelectionRenderer=function(){function d(e,f){this._init(e);this.explorer=f}d.prototype=new a.ExplorerRenderer;d.prototype.renderTableHeader=
function(e){var f=document.createElement("thead"),i=document.createElement("tr");c.addClass(f,"navTableHeading");this._useCheckboxSelection&&i.appendChild(this.initCheckboxColumn(e));for(var j=0,h=this.getCellHeaderElement(j);h;){c.addClass(h,"navColumn");i.appendChild(h);h=this.getCellHeaderElement(++j)}f.appendChild(i);e.appendChild(f)};d.prototype.renderRow=function(e,f){c.style(f,"verticalAlign","baseline");c.addClass(f,"treeTableRow");var i=this.getCheckboxColumn(e,f);i&&f.appendChild(i);i=0;
for(var j=this.getCellElement(i,e,f);j;){f.appendChild(j);c.addClass(j,"secondaryColumn");j=this.getCellElement(++i,e,f)}};d.prototype.getCellHeaderElement=function(){};d.prototype.getCellElement=function(){};return d}();return a});
define("orion/widgets/_OrionDialogMixin",["dojo","dijit"],function(c,g){c.declare("orion.widgets._OrionDialogMixin",null,{postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Information Needed";this.buttonCancel="Cancel"},postCreate:function(){this.inherited(arguments);c.connect(this,"onKeyPress",c.hitch(this,function(a){a.keyCode===c.keys.ENTER&&this._onSubmit()}))},onHide:function(){this.inherited(arguments);setTimeout(c.hitch(this,function(){if(c.isDescendant(g._curFocus,
this.domNode))g._curFocus=null;if(c.isDescendant(g._prevFocus,this.domNode))g._prevFocus=null;this.destroyRecursive()}),this.duration)}})});define("text!dijit/templates/TreeNode.html",function(){return'<div class="dijitTreeNode" role="presentation"\n\t><div dojoAttachPoint="rowNode" class="dijitTreeRow" role="presentation" dojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick"\n\t\t><img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" role="presentation"\n\t\t/><span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" role="presentation"\n\t\t></span\n\t\t><span dojoAttachPoint="contentNode"\n\t\t\tclass="dijitTreeContent" role="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" role="presentation"\n\t\t\t/><span dojoAttachPoint="labelNode" class="dijitTreeLabel" role="treeitem" tabindex="-1" aria-selected="false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t</span\n\t></div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer" role="presentation" style="display: none;"></div>\n</div>'});
define("text!dijit/templates/Tree.html",function(){return'<div class="dijitTree dijitTreeContainer" role="tree"\n\tdojoAttachEvent="onkeypress:_onKeyPress">\n\t<div class="dijitInline dijitTreeIndent" style="position: absolute; top: -9999px" dojoAttachPoint="indentDetector"></div>\n</div>'});
define("dijit/tree/TreeStoreModel",["dojo","dijit"],function(c,g){c.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(a){c.mixin(this,a);this.connects=[];a=this.store;if(!a.getFeatures()["dojo.data.api.Identity"])throw new Error("dijit.Tree: store must support dojo.data.Identity");if(a.getFeatures()["dojo.data.api.Notification"])this.connects=this.connects.concat([c.connect(a,
"onNew",this,"onNewItem"),c.connect(a,"onDelete",this,"onDeleteItem"),c.connect(a,"onSet",this,"onSetItem")])},destroy:function(){c.forEach(this.connects,c.disconnect)},getRoot:function(a,d){this.root?a(this.root):this.store.fetch({query:this.query,onComplete:c.hitch(this,function(e){if(e.length!=1)throw new Error(this.declaredClass+": query "+c.toJson(this.query)+" returned "+e.length+" items, but must return exactly one item");this.root=e[0];a(this.root)}),onError:d})},mayHaveChildren:function(a){return c.some(this.childrenAttrs,
function(d){return this.store.hasAttribute(a,d)},this)},getChildren:function(a,d,e){var f=this.store;if(f.isItemLoaded(a)){for(var i=[],j=0;j<this.childrenAttrs.length;j++){var h=f.getValues(a,this.childrenAttrs[j]);i=i.concat(h)}var l=0;this.deferItemLoadingUntilExpand||c.forEach(i,function(r){f.isItemLoaded(r)||l++});l==0?d(i):c.forEach(i,function(r,u){f.isItemLoaded(r)||f.loadItem({item:r,onItem:function(s){i[u]=s;--l==0&&d(i)},onError:e})})}else{var o=c.hitch(this,arguments.callee);f.loadItem({item:a,
onItem:function(r){o(r,d,e)},onError:e})}},isItem:function(a){return this.store.isItem(a)},fetchItemByIdentity:function(a){this.store.fetchItemByIdentity(a)},getIdentity:function(a){return this.store.getIdentity(a)},getLabel:function(a){return this.labelAttr?this.store.getValue(a,this.labelAttr):this.store.getLabel(a)},newItem:function(a,d,e){var f={parent:d,attribute:this.childrenAttrs[0]},i;if(this.newItemIdAttr&&a[this.newItemIdAttr])this.fetchItemByIdentity({identity:a[this.newItemIdAttr],scope:this,
onItem:function(j){if(j)this.pasteItem(j,null,d,true,e);else(i=this.store.newItem(a,f))&&e!=undefined&&this.pasteItem(i,d,d,false,e)}});else(i=this.store.newItem(a,f))&&e!=undefined&&this.pasteItem(i,d,d,false,e)},pasteItem:function(a,d,e,f,i){var j=this.store,h=this.childrenAttrs[0];d&&c.forEach(this.childrenAttrs,function(o){if(j.containsValue(d,o,a)){if(!f){var r=c.filter(j.getValues(d,o),function(u){return u!=a});j.setValues(d,o,r)}h=o}});if(e)if(typeof i=="number"){var l=j.getValues(e,h).slice();
l.splice(i,0,a);j.setValues(e,h,l)}else j.setValues(e,h,j.getValues(e,h).concat(a))},onChange:function(){},onChildrenChange:function(){},onDelete:function(){},onNewItem:function(a,d){d&&this.getChildren(d.item,c.hitch(this,function(e){this.onChildrenChange(d.item,e)}))},onDeleteItem:function(a){this.onDelete(a)},onSetItem:function(a,d){c.indexOf(this.childrenAttrs,d)!=-1?this.getChildren(a,c.hitch(this,function(e){this.onChildrenChange(a,e)})):this.onChange(a)}});return g.tree.TreeStoreModel});
define("dijit/tree/ForestStoreModel",["dojo","dijit","dijit/tree/TreeStoreModel"],function(c,g){c.declare("dijit.tree.ForestStoreModel",g.tree.TreeStoreModel,{rootId:"$root$",rootLabel:"ROOT",query:null,constructor:function(a){this.root={store:this,root:true,id:a.rootId,label:a.rootLabel,children:a.rootChildren}},mayHaveChildren:function(a){return a===this.root||this.inherited(arguments)},getChildren:function(a,d,e){if(a===this.root)this.root.children?d(this.root.children):this.store.fetch({query:this.query,
onComplete:c.hitch(this,function(f){this.root.children=f;d(f)}),onError:e});else this.inherited(arguments)},isItem:function(a){return a===this.root?true:this.inherited(arguments)},fetchItemByIdentity:function(a){if(a.identity==this.root.id){var d=a.scope?a.scope:c.global;a.onItem&&a.onItem.call(d,this.root)}else this.inherited(arguments)},getIdentity:function(a){return a===this.root?this.root.id:this.inherited(arguments)},getLabel:function(a){return a===this.root?this.root.label:this.inherited(arguments)},
newItem:function(a,d){if(d===this.root){this.onNewRootItem(a);return this.store.newItem(a)}else return this.inherited(arguments)},onNewRootItem:function(){},pasteItem:function(a,d,e,f,i){if(d===this.root)f||this.onLeaveRoot(a);g.tree.TreeStoreModel.prototype.pasteItem.call(this,a,d===this.root?null:d,e===this.root?null:e,f,i);e===this.root&&this.onAddToRoot(a)},onAddToRoot:function(a){console.log(this,": item ",a," added to root")},onLeaveRoot:function(a){console.log(this,": item ",a," removed from root")},
_requeryTop:function(){var a=this.root.children||[];this.store.fetch({query:this.query,onComplete:c.hitch(this,function(d){this.root.children=d;if(a.length!=d.length||c.some(a,function(e,f){return d[f]!=e}))this.onChildrenChange(this.root,d)})})},onNewItem:function(){this._requeryTop();this.inherited(arguments)},onDeleteItem:function(a){c.indexOf(this.root.children,a)!=-1&&this._requeryTop();this.inherited(arguments)},onSetItem:function(){this._requeryTop();this.inherited(arguments)}});return g.tree.ForestStoreModel});
define("dojo/dnd/Container",["dojo","dojo/dnd/common","dojo/parser"],function(c){c.declare("dojo.dnd.Container",null,{skipForm:false,constructor:function(g,a){this.node=c.byId(g);a||(a={});this.creator=a.creator||null;this.skipForm=a.skipForm;this.parent=a.dropParent&&c.byId(a.dropParent);this.map={};this.current=null;this.containerState="";c.addClass(this.node,"dojoDndContainer");a&&a._skipStartup||this.startup();this.events=[c.connect(this.node,"onmouseover",this,"onMouseOver"),c.connect(this.node,
"onmouseout",this,"onMouseOut"),c.connect(this.node,"ondragstart",this,"onSelectStart"),c.connect(this.node,"onselectstart",this,"onSelectStart")]},creator:function(){},getItem:function(g){return this.map[g]},setItem:function(g,a){this.map[g]=a},delItem:function(g){delete this.map[g]},forInItems:function(g,a){a=a||c.global;var d=this.map,e=c.dnd._empty;for(var f in d)f in e||g.call(a,d[f],f,this);return a},clearItems:function(){this.map={}},getAllNodes:function(){return c.query("> .dojoDndItem",this.parent)},
sync:function(){var g={};this.getAllNodes().forEach(function(a){if(a.id){var d=this.getItem(a.id);if(d){g[a.id]=d;return}}else a.id=c.dnd.getUniqueId();d=a.getAttribute("dndType");var e=a.getAttribute("dndData");g[a.id]={data:e||a.innerHTML,type:d?d.split(/\s*,\s*/):["text"]}},this);this.map=g;return this},insertNodes:function(g,a,d){if(this.parent.firstChild)if(a){if(!d)d=this.parent.firstChild}else{if(d)d=d.nextSibling}else d=null;if(d)for(a=0;a<g.length;++a){var e=this._normalizedCreator(g[a]);
this.setItem(e.node.id,{data:e.data,type:e.type});this.parent.insertBefore(e.node,d)}else for(a=0;a<g.length;++a){e=this._normalizedCreator(g[a]);this.setItem(e.node.id,{data:e.data,type:e.type});this.parent.appendChild(e.node)}return this},destroy:function(){c.forEach(this.events,c.disconnect);this.clearItems();this.node=this.parent=this.current=null},markupFactory:function(g,a){g._skipStartup=true;return new c.dnd.Container(a,g)},startup:function(){if(!this.parent){this.parent=this.node;if(this.parent.tagName.toLowerCase()==
"table"){var g=this.parent.getElementsByTagName("tbody");if(g&&g.length)this.parent=g[0]}}this.defaultCreator=c.dnd._defaultCreator(this.parent);this.sync()},onMouseOver:function(g){for(var a=g.relatedTarget;a;){if(a==this.node)break;try{a=a.parentNode}catch(d){a=null}}if(!a){this._changeState("Container","Over");this.onOverEvent()}a=this._getChildByEvent(g);if(this.current!=a){this.current&&this._removeItemClass(this.current,"Over");a&&this._addItemClass(a,"Over");this.current=a}},onMouseOut:function(g){for(g=
g.relatedTarget;g;){if(g==this.node)return;try{g=g.parentNode}catch(a){g=null}}if(this.current){this._removeItemClass(this.current,"Over");this.current=null}this._changeState("Container","");this.onOutEvent()},onSelectStart:function(g){if(!this.skipForm||!c.dnd.isFormElement(g))c.stopEvent(g)},onOverEvent:function(){},onOutEvent:function(){},_changeState:function(g,a){var d="dojoDnd"+g;g=g.toLowerCase()+"State";c.replaceClass(this.node,d+a,d+this[g]);this[g]=a},_addItemClass:function(g,a){c.addClass(g,
"dojoDndItem"+a)},_removeItemClass:function(g,a){c.removeClass(g,"dojoDndItem"+a)},_getChildByEvent:function(g){if(g=g.target)for(var a=g.parentNode;a;g=a,a=g.parentNode)if(a==this.parent&&c.hasClass(g,"dojoDndItem"))return g;return null},_normalizedCreator:function(g,a){g=(this.creator||this.defaultCreator).call(this,g,a);if(!c.isArray(g.type))g.type=["text"];if(!g.node.id)g.node.id=c.dnd.getUniqueId();c.addClass(g.node,"dojoDndItem");return g}});c.dnd._createNode=function(g){if(!g)return c.dnd._createSpan;
return function(a){return c.create(g,{innerHTML:a})}};c.dnd._createTrTd=function(g){var a=c.create("tr");c.create("td",{innerHTML:g},a);return a};c.dnd._createSpan=function(g){return c.create("span",{innerHTML:g})};c.dnd._defaultCreatorNodes={ul:"li",ol:"li",div:"div",p:"div"};c.dnd._defaultCreator=function(g){g=g.tagName.toLowerCase();var a=g=="tbody"||g=="thead"?c.dnd._createTrTd:c.dnd._createNode(c.dnd._defaultCreatorNodes[g]);return function(d,e){var f=d&&c.isObject(d),i;if(f&&d.tagName&&d.nodeType&&
d.getAttribute){i=d.getAttribute("dndData")||d.innerHTML;f=(f=d.getAttribute("dndType"))?f.split(/\s*,\s*/):["text"];d=d}else{i=f&&d.data?d.data:d;f=f&&d.type?d.type:["text"];d=(e=="avatar"?c.dnd._createSpan:a)(String(i))}if(!d.id)d.id=c.dnd.getUniqueId();return{node:d,data:i,type:f}}};return c.dnd.Container});
define("dijit/tree/_dndContainer",["dojo","dijit","dojo/dnd/common","dojo/dnd/Container"],function(c,g){c.getObject("tree",true,c);g.tree._compareNodes=function(a,d){if(a===d)return 0;if("sourceIndex"in document.documentElement)return a.sourceIndex-d.sourceIndex;else if("compareDocumentPosition"in document.documentElement)return a.compareDocumentPosition(d)&2?1:-1;else if(document.createRange){var e=doc.createRange();e.setStartBefore(a);a=doc.createRange();a.setStartBefore(d);return e.compareBoundaryPoints(e.END_TO_END,
a)}else throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser");};c.declare("dijit.tree._dndContainer",null,{constructor:function(a,d){this.tree=a;this.node=a.domNode;c.mixin(this,d);this.map={};this.current=null;this.containerState="";c.addClass(this.node,"dojoDndContainer");this.events=[c.connect(this.node,"onmouseenter",this,"onOverEvent"),c.connect(this.node,"onmouseleave",this,"onOutEvent"),c.connect(this.tree,"_onNodeMouseEnter",this,"onMouseOver"),
c.connect(this.tree,"_onNodeMouseLeave",this,"onMouseOut"),c.connect(this.node,"ondragstart",c,"stopEvent"),c.connect(this.node,"onselectstart",c,"stopEvent")]},getItem:function(a){return{data:this.selection[a],type:["treeNode"]}},destroy:function(){c.forEach(this.events,c.disconnect);this.node=this.parent=null},onMouseOver:function(a){this.current=a},onMouseOut:function(){this.current=null},_changeState:function(a,d){var e="dojoDnd"+a;a=a.toLowerCase()+"State";c.replaceClass(this.node,e+d,e+this[a]);
this[a]=d},_addItemClass:function(a,d){c.addClass(a,"dojoDndItem"+d)},_removeItemClass:function(a,d){c.removeClass(a,"dojoDndItem"+d)},onOverEvent:function(){this._changeState("Container","Over")},onOutEvent:function(){this._changeState("Container","")}});return g.tree._dndContainer});
define("dijit/tree/_dndSelector",["dojo","dijit","dojo/dnd/common","dijit/tree/_dndContainer"],function(c,g){c.declare("dijit.tree._dndSelector",g.tree._dndContainer,{constructor:function(){this.selection={};this.anchor=null;g.setWaiState(this.tree.domNode,"multiselect",!this.singular);this.events.push(c.connect(this.tree.domNode,"onmousedown",this,"onMouseDown"),c.connect(this.tree.domNode,"onmouseup",this,"onMouseUp"),c.connect(this.tree.domNode,"onmousemove",this,"onMouseMove"))},singular:false,
getSelectedTreeNodes:function(){var a=[],d=this.selection;for(var e in d)a.push(d[e]);return a},selectNone:function(){this.setSelection([]);return this},destroy:function(){this.inherited(arguments);this.selection=this.anchor=null},addTreeNode:function(a,d){this.setSelection(this.getSelectedTreeNodes().concat([a]));if(d)this.anchor=a;return a},removeTreeNode:function(a){this.setSelection(this._setDifference(this.getSelectedTreeNodes(),[a]));return a},isTreeNodeSelected:function(a){return a.id&&!!this.selection[a.id]},
setSelection:function(a){var d=this.getSelectedTreeNodes();c.forEach(this._setDifference(d,a),c.hitch(this,function(e){e.setSelected(false);this.anchor==e&&delete this.anchor;delete this.selection[e.id]}));c.forEach(this._setDifference(a,d),c.hitch(this,function(e){e.setSelected(true);this.selection[e.id]=e}));this._updateSelectionProperties()},_setDifference:function(a,d){c.forEach(d,function(e){e.__exclude__=true});a=c.filter(a,function(e){return!e.__exclude__});c.forEach(d,function(e){delete e.__exclude__});
return a},_updateSelectionProperties:function(){var a=this.getSelectedTreeNodes(),d=[],e=[];c.forEach(a,function(f){e.push(f);d.push(f.getTreePath())});a=c.map(e,function(f){return f.item});this.tree._set("paths",d);this.tree._set("path",d[0]||[]);this.tree._set("selectedNodes",e);this.tree._set("selectedNode",e[0]||null);this.tree._set("selectedItems",a);this.tree._set("selectedItem",a[0]||null)},onMouseDown:function(a){if(!(!this.current||this.tree.isExpandoNode(a.target,this.current)))if(a.button!=
c.mouseButtons.RIGHT){c.stopEvent(a);var d=this.current,e=c.isCopyKey(a),f=d.id;if(!this.singular&&!a.shiftKey&&this.selection[f])this._doDeselect=true;else{this._doDeselect=false;this.userSelect(d,e,a.shiftKey)}}},onMouseUp:function(a){if(this._doDeselect){this._doDeselect=false;this.userSelect(this.current,c.isCopyKey(a),a.shiftKey)}},onMouseMove:function(){this._doDeselect=false},userSelect:function(a,d,e){if(this.singular)if(this.anchor==a&&d)this.selectNone();else{this.setSelection([a]);this.anchor=
a}else if(e&&this.anchor){e=this.anchor;if(g.tree._compareNodes(this.anchor.rowNode,a.rowNode)<0){d=e;a=a}else{d=a;a=e}for(nodes=[];d!=a;){nodes.push(d);d=this.tree._getNextNode(d)}nodes.push(a);this.setSelection(nodes)}else if(this.selection[a.id]&&d)this.removeTreeNode(a);else if(d)this.addTreeNode(a,true);else{this.setSelection([a]);this.anchor=a}},forInSelectedItems:function(a,d){d=d||c.global;for(var e in this.selection)a.call(d,this.getItem(e),e,this)}});return g.tree._dndSelector});
define("dijit/Tree",["dojo","dijit","text!dijit/templates/TreeNode.html","text!dijit/templates/Tree.html","dojo/fx","dojo/DeferredList","dijit/_Widget","dijit/_Templated","dijit/_Container","dijit/_Contained","dijit/_CssStateMixin","dojo/cookie","dijit/tree/TreeStoreModel","dijit/tree/ForestStoreModel","dijit/tree/_dndSelector"],function(c,g){c.declare("dijit._TreeNode",[g._Widget,g._Templated,g._Container,g._Contained,g._CssStateMixin],{item:null,isTreeNode:true,label:"",isExpandable:null,isExpanded:false,
state:"UNCHECKED",templateString:c.cache("dijit","templates/TreeNode.html"),baseClass:"dijitTreeNode",cssStateNodes:{rowNode:"dijitTreeRow",labelNode:"dijitTreeLabel"},attributeMap:c.delegate(g._Widget.prototype.attributeMap,{label:{node:"labelNode",type:"innerText"},tooltip:{node:"rowNode",type:"attribute",attribute:"title"}}),buildRendering:function(){this.inherited(arguments);this._setExpando();this._updateItemClasses(this.item);this.isExpandable&&g.setWaiState(this.labelNode,"expanded",this.isExpanded);
this.setSelected(false)},_setIndentAttr:function(a){var d=Math.max(a,0)*this.tree._nodePixelIndent+"px";c.style(this.domNode,"backgroundPosition",d+" 0px");c.style(this.rowNode,this.isLeftToRight()?"paddingLeft":"paddingRight",d);c.forEach(this.getChildren(),function(e){e.set("indent",a+1)});this._set("indent",a)},markProcessing:function(){this.state="LOADING";this._setExpando(true)},unmarkProcessing:function(){this._setExpando(false)},_updateItemClasses:function(a){var d=this.tree,e=d.model;if(d._v10Compat&&
a===e.root)a=null;this._applyClassAndStyle(a,"icon","Icon");this._applyClassAndStyle(a,"label","Label");this._applyClassAndStyle(a,"row","Row")},_applyClassAndStyle:function(a,d,e){var f="_"+d+"Class";d=d+"Node";var i=this[f];this[f]=this.tree["get"+e+"Class"](a,this.isExpanded);c.replaceClass(this[d],this[f]||"",i||"");c.style(this[d],this.tree["get"+e+"Style"](a,this.isExpanded)||{})},_updateLayout:function(){var a=this.getParent();!a||a.rowNode.style.display=="none"?c.addClass(this.domNode,"dijitTreeIsRoot"):
c.toggleClass(this.domNode,"dijitTreeIsLast",!this.getNextSibling())},_setExpando:function(a){var d=["dijitTreeExpandoLoading","dijitTreeExpandoOpened","dijitTreeExpandoClosed","dijitTreeExpandoLeaf"],e=["*","-","+","*"];a=a?0:this.isExpandable?this.isExpanded?1:2:3;c.replaceClass(this.expandoNode,d[a],d);this.expandoNodeText.innerHTML=e[a]},expand:function(){if(this._expandDeferred)return this._expandDeferred;this._wipeOut&&this._wipeOut.stop();this.isExpanded=true;g.setWaiState(this.labelNode,"expanded",
"true");if(this.tree.showRoot||this!==this.tree.rootNode)g.setWaiRole(this.containerNode,"group");c.addClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);this==this.tree.rootNode&&g.setWaiState(this.tree.domNode,"expanded","true");var a,d=c.fx.wipeIn({node:this.containerNode,duration:g.defaultDuration,onEnd:function(){a.callback(true)}});a=this._expandDeferred=new c.Deferred(function(){d.stop()});d.play();return a},collapse:function(){if(this.isExpanded){if(this._expandDeferred){this._expandDeferred.cancel();
delete this._expandDeferred}this.isExpanded=false;g.setWaiState(this.labelNode,"expanded","false");this==this.tree.rootNode&&g.setWaiState(this.tree.domNode,"expanded","false");c.removeClass(this.contentNode,"dijitTreeContentExpanded");this._setExpando();this._updateItemClasses(this.item);if(!this._wipeOut)this._wipeOut=c.fx.wipeOut({node:this.containerNode,duration:g.defaultDuration});this._wipeOut.play()}},indent:0,setChildItems:function(a){var d=this.tree,e=d.model,f=[];c.forEach(this.getChildren(),
function(i){g._Container.prototype.removeChild.call(this,i)},this);this.state="LOADED";if(a&&a.length>0){this.isExpandable=true;c.forEach(a,function(i){var j=e.getIdentity(i),h=d._itemNodesMap[j],l;if(h)for(var o=0;o<h.length;o++)if(h[o]&&!h[o].getParent()){l=h[o];l.set("indent",this.indent+1);break}if(!l){l=this.tree._createTreeNode({item:i,tree:d,isExpandable:e.mayHaveChildren(i),label:d.getLabel(i),tooltip:d.getTooltip(i),dir:d.dir,lang:d.lang,indent:this.indent+1});if(h)h.push(l);else d._itemNodesMap[j]=
[l]}this.addChild(l);if(this.tree.autoExpand||this.tree._state(i))f.push(d._expandNode(l))},this);c.forEach(this.getChildren(),function(i){i._updateLayout()})}else this.isExpandable=false;this._setExpando&&this._setExpando(false);this._updateItemClasses(this.item);if(this==d.rootNode)if(a=this.tree.showRoot?this:this.getChildren()[0]){a.setFocusable(true);d.lastFocused=a}else d.domNode.setAttribute("tabIndex","0");return new c.DeferredList(f)},getTreePath:function(){for(var a=this,d=[];a&&a!==this.tree.rootNode;){d.unshift(a.item);
a=a.getParent()}d.unshift(this.tree.rootNode.item);return d},getIdentity:function(){return this.tree.model.getIdentity(this.item)},removeChild:function(){this.inherited(arguments);var a=this.getChildren();if(a.length==0){this.isExpandable=false;this.collapse()}c.forEach(a,function(d){d._updateLayout()})},makeExpandable:function(){this.isExpandable=true;this._setExpando(false)},_onLabelFocus:function(){this.tree._onNodeFocus(this)},setSelected:function(a){g.setWaiState(this.labelNode,"selected",a);
c.toggleClass(this.rowNode,"dijitTreeRowSelected",a)},setFocusable:function(a){this.labelNode.setAttribute("tabIndex",a?"0":"-1")},_onClick:function(a){this.tree._onClick(this,a)},_onDblClick:function(a){this.tree._onDblClick(this,a)},_onMouseEnter:function(a){this.tree._onNodeMouseEnter(this,a)},_onMouseLeave:function(a){this.tree._onNodeMouseLeave(this,a)}});c.declare("dijit.Tree",[g._Widget,g._Templated],{store:null,model:null,query:null,label:"",showRoot:true,childrenAttr:["children"],paths:[],
path:[],selectedItems:null,selectedItem:null,openOnClick:false,openOnDblClick:false,templateString:c.cache("dijit","templates/Tree.html"),persist:true,autoExpand:false,dndController:"dijit.tree._dndSelector",dndParams:["onDndDrop","itemCreator","onDndCancel","checkAcceptance","checkItemAcceptance","dragThreshold","betweenThreshold"],onDndDrop:null,itemCreator:null,onDndCancel:null,checkAcceptance:null,checkItemAcceptance:null,dragThreshold:5,betweenThreshold:0,_nodePixelIndent:19,_publish:function(a,
d){c.publish(this.id,[c.mixin({tree:this,event:a},d||{})])},postMixInProperties:function(){this.tree=this;if(this.autoExpand)this.persist=false;this._itemNodesMap={};if(!this.cookieName)this.cookieName=this.id+"SaveStateCookie";this._loadDeferred=new c.Deferred;this.inherited(arguments)},postCreate:function(){this._initState();this.model||this._store2model();this.connect(this.model,"onChange","_onItemChange");this.connect(this.model,"onChildrenChange","_onItemChildrenChange");this.connect(this.model,
"onDelete","_onItemDelete");this._load();this.inherited(arguments);if(this.dndController){if(c.isString(this.dndController))this.dndController=c.getObject(this.dndController);for(var a={},d=0;d<this.dndParams.length;d++)if(this[this.dndParams[d]])a[this.dndParams[d]]=this[this.dndParams[d]];this.dndController=new this.dndController(this,a)}},_store2model:function(){this._v10Compat=true;c.deprecated("Tree: from version 2.0, should specify a model object rather than a store/query");var a={id:this.id+
"_ForestStoreModel",store:this.store,query:this.query,childrenAttrs:this.childrenAttr};if(this.params.mayHaveChildren)a.mayHaveChildren=c.hitch(this,"mayHaveChildren");if(this.params.getItemChildren)a.getChildren=c.hitch(this,function(d,e,f){this.getItemChildren(this._v10Compat&&d===this.model.root?null:d,e,f)});this.model=new g.tree.ForestStoreModel(a);this.showRoot=Boolean(this.label)},onLoad:function(){},_load:function(){this.model.getRoot(c.hitch(this,function(a){var d=this.rootNode=this.tree._createTreeNode({item:a,
tree:this,isExpandable:true,label:this.label||this.getLabel(a),indent:this.showRoot?0:-1});if(!this.showRoot){d.rowNode.style.display="none";g.setWaiRole(this.domNode,"presentation");g.setWaiRole(d.labelNode,"presentation");g.setWaiRole(d.containerNode,"tree")}this.domNode.appendChild(d.domNode);a=this.model.getIdentity(a);if(this._itemNodesMap[a])this._itemNodesMap[a].push(d);else this._itemNodesMap[a]=[d];d._updateLayout();this._expandNode(d).addCallback(c.hitch(this,function(){this._loadDeferred.callback(true);
this.onLoad()}))}),function(a){console.error(this,": error loading root: ",a)})},getNodesByItem:function(a){if(!a)return[];return[].concat(this._itemNodesMap[c.isString(a)?a:this.model.getIdentity(a)])},_setSelectedItemAttr:function(a){this.set("selectedItems",[a])},_setSelectedItemsAttr:function(a){var d=this;this._loadDeferred.addCallback(c.hitch(this,function(){var e=c.map(a,function(i){return!i||c.isString(i)?i:d.model.getIdentity(i)}),f=[];c.forEach(e,function(i){f=f.concat(d._itemNodesMap[i]||
[])});this.set("selectedNodes",f)}))},_setPathAttr:function(a){return a.length?this.set("paths",[a]):this.set("paths",[])},_setPathsAttr:function(a){function d(i,j,h){var l=i.shift(),o=c.filter(j,function(r){return r.getIdentity()==l})[0];if(o)i.length?f._expandNode(o).addCallback(function(){d(i,o.getChildren(),h)}):h.callback(o);else h.errback("Could not expand path at "+l)}function e(i){f.set("selectedNodes",c.map(c.filter(i,function(j){return j[0]}),function(j){return j[1]}))}var f=this;return(new c.DeferredList(c.map(a,
function(i){var j=new c.Deferred;i=c.map(i,function(h){return c.isString(h)?h:f.model.getIdentity(h)});i.length?f._loadDeferred.addCallback(function(){d(i,[f.rootNode],j)}):j.errback("Empty path");return j}))).addCallback(e)},_setSelectedNodeAttr:function(a){this.set("selectedNodes",[a])},_setSelectedNodesAttr:function(a){this._loadDeferred.addCallback(c.hitch(this,function(){this.dndController.setSelection(a)}))},mayHaveChildren:function(){},getItemChildren:function(){},getLabel:function(a){return this.model.getLabel(a)},
getIconClass:function(a,d){return!a||this.model.mayHaveChildren(a)?d?"dijitFolderOpened":"dijitFolderClosed":"dijitLeaf"},getLabelClass:function(){},getRowClass:function(){},getIconStyle:function(){},getLabelStyle:function(){},getRowStyle:function(){},getTooltip:function(){return""},_onKeyPress:function(a){if(!a.altKey){var d=c.keys,e=g.getEnclosingWidget(a.target);if(e){var f=a.charOrCode;if(typeof f=="string"&&f!=" "){if(!a.altKey&&!a.ctrlKey&&!a.shiftKey&&!a.metaKey){this._onLetterKeyNav({node:e,
key:f.toLowerCase()});c.stopEvent(a)}}else{if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}var i=this._keyHandlerMap;if(!i){i={};i[d.ENTER]="_onEnterKey";i[d.SPACE]=i[" "]="_onEnterKey";i[this.isLeftToRight()?d.LEFT_ARROW:d.RIGHT_ARROW]="_onLeftArrow";i[this.isLeftToRight()?d.RIGHT_ARROW:d.LEFT_ARROW]="_onRightArrow";i[d.UP_ARROW]="_onUpArrow";i[d.DOWN_ARROW]="_onDownArrow";i[d.HOME]="_onHomeKey";i[d.END]="_onEndKey";this._keyHandlerMap=i}if(this._keyHandlerMap[f]){this[this._keyHandlerMap[f]]({node:e,
item:e.item,evt:a});c.stopEvent(a)}}}}},_onEnterKey:function(a){this._publish("execute",{item:a.item,node:a.node});this.dndController.userSelect(a.node,c.isCopyKey(a.evt),a.evt.shiftKey);this.onClick(a.item,a.node,a.evt)},_onDownArrow:function(a){(a=this._getNextNode(a.node))&&a.isTreeNode&&this.focusNode(a)},_onUpArrow:function(a){a=a.node;var d=a.getPreviousSibling();if(d)for(a=d;a.isExpandable&&a.isExpanded&&a.hasChildren();){a=a.getChildren();a=a[a.length-1]}else{d=a.getParent();!this.showRoot&&
d===this.rootNode||(a=d)}a&&a.isTreeNode&&this.focusNode(a)},_onRightArrow:function(a){a=a.node;if(a.isExpandable&&!a.isExpanded)this._expandNode(a);else if(a.hasChildren())(a=a.getChildren()[0])&&a.isTreeNode&&this.focusNode(a)},_onLeftArrow:function(a){a=a.node;if(a.isExpandable&&a.isExpanded)this._collapseNode(a);else(a=a.getParent())&&a.isTreeNode&&!(!this.showRoot&&a===this.rootNode)&&this.focusNode(a)},_onHomeKey:function(){var a=this._getRootOrFirstNode();a&&this.focusNode(a)},_onEndKey:function(){for(var a=
this.rootNode;a.isExpanded;){a=a.getChildren();a=a[a.length-1]}a&&a.isTreeNode&&this.focusNode(a)},multiCharSearchDuration:250,_onLetterKeyNav:function(a){var d=this._curSearch;if(d){d.pattern+=a.key;clearTimeout(d.timer)}else d=this._curSearch={pattern:a.key,startNode:a.node};var e=this;d.timer=setTimeout(function(){delete e._curSearch},this.multiCharSearchDuration);a=d.startNode;do(a=this._getNextNode(a))||(a=this._getRootOrFirstNode());while(a!==d.startNode&&a.label.toLowerCase().substr(0,d.pattern.length)!=
d.pattern);a&&a.isTreeNode&&a!==d.startNode&&this.focusNode(a)},isExpandoNode:function(a,d){return c.isDescendant(a,d.expandoNode)},_onClick:function(a,d){var e=this.isExpandoNode(d.target,a);if(this.openOnClick&&a.isExpandable||e)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:d});this.onClick(a.item,a,d);this.focusNode(a)}c.stopEvent(d)},_onDblClick:function(a,d){var e=d.target;e=e==a.expandoNode||e==a.expandoNodeText;if(this.openOnDblClick&&a.isExpandable||
e)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:d});this.onDblClick(a.item,a,d);this.focusNode(a)}c.stopEvent(d)},_onExpandoClick:function(a){a=a.node;this.focusNode(a);a.isExpanded?this._collapseNode(a):this._expandNode(a)},onClick:function(){},onDblClick:function(){},onOpen:function(){},onClose:function(){},_getNextNode:function(a){if(a.isExpandable&&a.isExpanded&&a.hasChildren())return a.getChildren()[0];else{for(;a&&a.isTreeNode;){var d=a.getNextSibling();
if(d)return d;a=a.getParent()}return null}},_getRootOrFirstNode:function(){return this.showRoot?this.rootNode:this.rootNode.getChildren()[0]},_collapseNode:function(a){a._expandNodeDeferred&&delete a._expandNodeDeferred;if(a.isExpandable)if(a.state!="LOADING"){a.collapse();this.onClose(a.item,a);if(a.item){this._state(a.item,false);this._saveState()}}},_expandNode:function(a,d){if(a._expandNodeDeferred&&!d)return a._expandNodeDeferred;d=this.model;var e=a.item,f=this;switch(a.state){case "UNCHECKED":a.markProcessing();
var i=a._expandNodeDeferred=new c.Deferred;d.getChildren(e,function(j){a.unmarkProcessing();j=a.setChildItems(j);var h=f._expandNode(a,true);j.addCallback(function(){h.addCallback(function(){i.callback()})})},function(j){console.error(f,": error loading root children: ",j)});break;default:i=a._expandNodeDeferred=a.expand();this.onOpen(a.item,a);if(e){this._state(e,true);this._saveState()}}return i},focusNode:function(a){g.focus(a.labelNode)},_onNodeFocus:function(a){if(a&&a!=this.lastFocused){this.lastFocused&&
!this.lastFocused._destroyed&&this.lastFocused.setFocusable(false);a.setFocusable(true);this.lastFocused=a}},_onNodeMouseEnter:function(){},_onNodeMouseLeave:function(){},_onItemChange:function(a){var d=this._itemNodesMap[this.model.getIdentity(a)];if(d){var e=this.getLabel(a),f=this.getTooltip(a);c.forEach(d,function(i){i.set({item:a,label:e,tooltip:f});i._updateItemClasses(a)})}},_onItemChildrenChange:function(a,d){(a=this._itemNodesMap[this.model.getIdentity(a)])&&c.forEach(a,function(e){e.setChildItems(d)})},
_onItemDelete:function(a){a=this.model.getIdentity(a);var d=this._itemNodesMap[a];if(d){c.forEach(d,function(e){this.dndController.removeTreeNode(e);var f=e.getParent();f&&f.removeChild(e);e.destroyRecursive()},this);delete this._itemNodesMap[a]}},_initState:function(){if(this.persist){var a=c.cookie(this.cookieName);this._openedItemIds={};a&&c.forEach(a.split(","),function(d){this._openedItemIds[d]=true},this)}},_state:function(a,d){if(!this.persist)return false;var e=this.model.getIdentity(a);if(arguments.length===
1)return this._openedItemIds[e];if(d)this._openedItemIds[e]=true;else delete this._openedItemIds[e]},_saveState:function(){if(this.persist){var a=[];for(var d in this._openedItemIds)a.push(d);c.cookie(this.cookieName,a.join(","),{expires:365})}},destroy:function(){if(this._curSearch){clearTimeout(this._curSearch.timer);delete this._curSearch}this.rootNode&&this.rootNode.destroyRecursive();this.dndController&&!c.isString(this.dndController)&&this.dndController.destroy();this.rootNode=null;this.inherited(arguments)},
destroyRecursive:function(){this.destroy()},resize:function(a){a&&c.marginBox(this.domNode,a);this._nodePixelIndent=c._getMarginSize(this.tree.indentDetector).w;if(this.tree.rootNode)this.tree.rootNode.set("indent",this.showRoot?0:-1)},_createTreeNode:function(a){return new g._TreeNode(a)}});return g.Tree});define("text!orion/widgets/templates/_ExplorerTreeNode.html",function(){return'<div class="dijitTreeNode" waiRole="presentation">\n\t<div dojoAttachPoint="rowNode" class="dijitTreeRow"\n\t\twaiRole="presentation"\n\t\tdojoAttachEvent="onmouseenter:_onMouseEnter, onmouseleave:_onMouseLeave, onclick:_onClick, ondblclick:_onDblClick">\n\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="expandoNode" class="dijitTreeExpando" waiRole="presentation" />\n\t\t<span dojoAttachPoint="expandoNodeText" class="dijitExpandoText" waiRole="presentation"></span>\n\t\t<span dojoAttachPoint="contentNode" class="dijitTreeContent" waiRole="presentation">\n\t\t\t<img src="${_blankGif}" alt="" dojoAttachPoint="iconNode" class="dijitIcon dijitTreeIcon" waiRole="presentation" />\n\t\t\t<!-- labelNode\'s innerText will be label string --\>\n\t\t\t<span dojoAttachPoint="labelNode" class="dijitTreeLabel" wairole="treeitem" tabindex="-1" waiState="selected-false" dojoAttachEvent="onfocus:_onLabelFocus"></span>\n\t\t\t<a href="" dojoAttachPoint="followLink"><img src="${_blankGif}" alt="" dojoAttachPoint="followNode" class="dijitIcon dijitTreeIcon follow" waiRole="link"></a>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitTreeContainer"\n\t\twaiRole="presentation" style="display: none;">\n\t</div>\n</div>'});
define("orion/widgets/ExplorerTree",["dojo","dijit","dijit/Tree","text!orion/widgets/templates/_ExplorerTreeNode.html"],function(c,g){c.declare("orion.widgets._ExplorerTreeNode",[g._TreeNode],{templateString:c.cache("orion","widgets/templates/_ExplorerTreeNode.html"),_updateItemClasses:function(a){this.inherited(arguments);this._applyClassAndStyle(a,"follow","Follow");typeof this.tree.updateFollowLink==="function"&&this.tree.updateFollowLink(a,this.followLink)}});c.declare("orion.widgets.ExplorerTree",
[g.Tree],{selectedNodes:{},postCreate:function(){c.connect(this,"onMouseDown",this._eatSelectionEvent);c.connect(this.domNode,"onselectstart",this._eatSelectionEvent);this.inherited(arguments)},getFollowClass:function(){},getFollowStyle:function(){},updateFollowLink:function(){},onFollowClick:function(){},getSelectedItems:function(){var a=[];this._forEachSelectedNode(function(d,e){a.push(e.item)});return a},_getSelectedNodes:function(){var a=[];this._forEachSelectedNode(function(d,e){a.push(e)});
return a},_forEachSelectedNode:function(a){var d=this.selectedNodes;for(var e in d)d.hasOwnProperty(e)&&a(e,d[e])},_createTreeNode:function(a){return new orion.widgets._ExplorerTreeNode(a)},_eatSelectionEvent:function(a){if(c.isCopyKey(a)||a.shiftKey)c.stopEvent(a)},_onClick:function(a,d){var e=d.target,f=e===a.expandoNode||e===a.expandoNodeText;e=e===a.followNode;if(c.isCopyKey(d)){this._toggleSelectNode(a);this.focusNode(a)}else if(d.shiftKey){if(this.selectedNode){this._selectRange(this.selectedNode,
a);this.focusNode(a)}}else{if(e)this.onFollowClick(a.item,a,d);else if(this.openOnClick&&a.isExpandable||f)a.isExpandable&&this._onExpandoClick({node:a});else{this._publish("execute",{item:a.item,node:a,evt:d});this.onClick(a.item,a,d);this.focusNode(a)}!f&&!e&&this._selectNode(a)}e||c.stopEvent(d)},_onItemDelete:function(a){var d=this._itemNodesMap[this.model.getIdentity(a)];if(d){var e=this;c.forEach(d,function(f){e._removeFromSelection(f)})}this.inherited(arguments)},_getVisibleAncestor:function(a){if(!a)return null;
for(var d=a.getParent();d&&!(d.isExpandable&&d.isExpanded);){a=d;d=d.getParent()}return a},_toggleSelectNode:function(a){if(this.selectedNodes[a.get("id")]){a.setSelected(false);this._removeFromSelection(a)}else{a.setSelected(true);this._addToSelection(a)}},_addToSelection:function(a){this.selectedNodes[a.get("id")]=a},_removeFromSelection:function(a){delete this.selectedNodes[a.get("id")]},_selectRange:function(a,d){function e(j,h){var l=[];j=j;do{l.push(j);j=f._getNextNode(j)}while(j&&j!==h);if(j===
h){l.push(h);return l}return null}a=this._getVisibleAncestor(a);d=this._getVisibleAncestor(d);if(a&&d)if(a===d)this._selectNode(a);else{var f=this,i=e(a,d);if(i)this._selectNodes(i.reverse(),true);else(i=e(d,a))?this._selectNodes(i,true):console.debug("Warning: couldn't select range from "+a.label+" to "+d.label)}},_selectNode:function(a){this._selectNodes(a?[a]:null)},_selectNodes:function(a){this._forEachSelectedNode(function(f,i){i._destroyed||i.setSelected(false)});this.selectedNodes={};if(a)for(var d=
0;d<a.length;d++){var e=a[d];e.setSelected(true);this._addToSelection(e);this.selectedNode=e}}})});define("text!orion/widgets/templates/DirectoryPrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseDirectoryExplorerTree" class="explorerTreeClass" id="${id}_browseDirectoryExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div> \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="directoryBrowserButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/widgets/DirectoryPrompterDialog",["dojo","dijit","orion/util","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/DirectoryPrompterDialog.html"],function(c,g,a){c.declare("orion.widgets.DirectoryPrompterDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/DirectoryPrompterDialog.html"),constructor:function(){this.inherited(arguments);
this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.buttonOk="OK"},postCreate:function(){this.inherited(arguments);this.loadFolderList("")},loadFolderList:function(d){d=a.makeRelative(d);this.treeRoot.Path=d;this.options.fileClient.loadWorkspace(d).then(c.hitch(this,function(e){for(var f in e)this.treeRoot[f]=e[f];a.processNavigatorParent(this.treeRoot,e.Children);this.createTree()}))},createTree:function(){var d=
new orion.widgets.DirectoryTreeModel(this.options.serviceRegistry,this.treeRoot,this.options.fileClient);this.treeWidget=new orion.widgets.ExplorerTree({id:"treeWidget",style:"width:100%; height:100%",model:d,showRoot:false,persist:true,openOnClick:false,getLabel:function(e){return e.Name},getIconClass:function(){return"folderItem"}});this.treeWidget.startup();c.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},execute:function(){var d=this.treeWidget.getSelectedItems();this.onHide();
this.options.func(d[0])}});orion.widgets.DirectoryTreeModel=function(){function d(e,f,i){this.registry=e;this.root=f;this.fileClient=i}d.prototype={destroy:function(){},getRoot:function(e){e(this.root)},mayHaveChildren:function(){return true},getChildren:function(e,f){if(e.children)f(e.children);else if(e.Directory!==undefined&&e.Directory===false)f([]);else e.Location?this.fileClient.fetchChildren(e.ChildrenLocation).then(c.hitch(this,function(i){for(var j=[],h=0;h<i.length;h++)i[h].Directory&&j.push(i[h]);
a.processNavigatorParent(e,j);f(j)})):f([])},getIdentity:function(e){return e.Name?e.Location:"ROOT"},getLabel:function(e){return e.Name},onChildrenChange:function(){}};return d}()});define("text!orion/git/widgets/templates/CloneGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t\t<span dojoAttachPoint="Basic">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<label dojoAttachPoint="gitUrlLabel" for="${id}_gitUrl" style="padding-right: 10">${gitUrlLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitUrl" id="${id}_gitUrl" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right;">\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLink" href="javascript:">Choose target location</a>\n\t\t\t\t\t\t<a dojoAttachPoint="advancedLinkHide" href="javascript:" style="display: none">Default target location</a>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<span dojoAttachPoint="Advanced" style="display: none;">\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isNewProject" type="radio" name="${id}_newExisting" checked value="new"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitNameLabel" for="${id}_gitName" style="padding-right: 10">${gitNameLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: right; float: right">\n\t\t\t\t\t\t<input dojoAttachPoint="gitName" id="${id}_gitName" style="display: inline-block; width: 100%;" value="">\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div style="display: block; padding: 5; min-width: 120px; clear: both; float: left;">\n\t\t\t\t\t\t<input dojoAttachPoint="isExistingProject" type="radio" name="${id}_newExisting" value="existing"/>\n\t\t\t\t\t\t<label dojoAttachPoint="gitPathLabel" for="${id}_gitPath" style="padding-right: 10">${gitPathLabelText}</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: block; padding: 5; width: 40em; text-align: left; float: right;">\n\t\t\t\t\t\t\t<input dojoAttachPoint="gitPath" id="${id}_gitPath" type="hidden" value="">\n\t\t\t\t\t\t\t<div style="width: 30em; float: left" float="left" dojoAttachPoint="shownGitPath"></div>\n\t\t\t\t\t\t\t<div style="width: 10em; float: right; text-align: right"><a dojoAttachPoint="changeGitPath" href="javascript:">Change...</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t\t<div style="display: block; padding: 5; clear: both; text-align: right">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/CloneGitRepositoryDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","orion/widgets/DirectoryPrompterDialog","text!orion/git/widgets/templates/CloneGitRepositoryDialog.html"],function(c,g){c.declare("orion.git.widgets.CloneGitRepositoryDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","git/widgets/templates/CloneGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);this.options=
arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title?this.options.title:"Clone Git Repository";this.gitUrlLabelText="Repository URL:";this.gitPathLabelText="Existing directory:";this.gitNameLabelText="New folder:";this.advancedShown=false},postCreate:function(){this.inherited(arguments);if(this.options.advancedOnly){this.Basic.style.display="none";this.Advanced.style.display="";this.gitName.focus()}c.connect(this.changeGitPath,"onclick",null,c.hitch(this,
this.openDirectoryPickerDialog));c.connect(this.isExistingProject,"onchange",null,c.hitch(this,this.showExistingFolder));c.connect(this.gitName,"onfocus",null,c.hitch(this,this.showNewProject));c.connect(this.advancedLink,"onclick",null,c.hitch(this,this.showAdvanced));c.connect(this.advancedLinkHide,"onclick",null,c.hitch(this,this.hideAdvanced))},execute:function(){this.options.func(this.options.advancedOnly?undefined:this.gitUrl.value,this.advancedShown&&this.isNewProject.checked?undefined:this.gitPath.value,
this.advancedShown&&!this.isNewProject.checked?undefined:this.gitName.value)},showAdvanced:function(){this.advancedShown=true;this.Advanced.style.display="";this.advancedLink.style.display="none";this.advancedLinkHide.style.display=""},hideAdvanced:function(){this.advancedShown=false;this.Advanced.style.display="none";this.advancedLink.style.display="";this.advancedLinkHide.style.display="none"},showExistingFolder:function(){this.isExistingProject.checked?this.openDirectoryPickerDialog():this.gitName.focus()},
showNewProject:function(){this.isNewProject.checked=true},openDirectoryPickerDialog:function(){this.isExistingProject.checked=true;var a=new orion.widgets.DirectoryPrompterDialog({title:"Choose a Folder",serviceRegistry:this.options.serviceRegistry,fileClient:this.options.fileClient,func:c.hitch(this,function(d){if(d&&d.Location){this.gitPath.value=d.Location;this.shownGitPath.innerHTML="<a href='/navigate/table.html#"+d.ChildrenLocation+"'>"+d.Name+"</a>";for(d=d;d.parent&&!d.parent.Projects;){this.shownGitPath.innerHTML=
"<a href='/navigate/table.html#"+d.parent.ChildrenLocation+"'>"+d.parent.Name+"</a>/"+this.shownGitPath.innerHTML;d=d.parent}}})});a.startup();a.show()}})});define("text!orion/git/widgets/templates/InitGitRepositoryDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitTargetLabel" for="${id}_gitTarget" style="padding-right: 10">${gitTargetLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitTarget" id="${id}_gitTarget" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t\t<br><i>This is to be replaced with directory picker dialog</i>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/InitGitRepositoryDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/InitGitRepositoryDialog.html"],function(c,g){c.declare("orion.git.widgets.InitGitRepositoryDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","git/widgets/templates/InitGitRepositoryDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Init Git Repository";this.gitTargetLabelText="Target:"},execute:function(){this.options.func(this.gitTarget.value)}})});define("text!orion/git/widgets/templates/AddRemoteDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteLabel" for="${id}_gitRemote" style="padding-right: 10">${gitRemoteLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemote" id="${id}_gitRemote" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="gitRemoteURILabel" for="${id}_gitRemoteURI" style="padding-right: 10">${gitRemoteURILabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left;">\n\t\t\t\t\t<input dojoAttachPoint="gitRemoteURI" id="${id}_gitRemoteURI" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="cloneItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/AddRemoteDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/AddRemoteDialog.html"],function(c,g){c.declare("orion.git.widgets.AddRemoteDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","git/widgets/templates/AddRemoteDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title="Add Remote";this.gitRemoteLabelText="Remote Name:";this.gitRemoteURILabelText="Remote URI:"},execute:function(){this.options.func(this.gitRemote.value,this.gitRemoteURI.value)}})});define("text!orion/git/widgets/templates/GitCredentialsDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: none; padding-top: 10px; padding-bottom: 10px;" dojoAttachPoint="gitCredentialsLabel">Provide credentials for: <b dojoAttachPoint="url"></b></div>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshUsernameRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitSshUsernameLabel" for="${id}_gitSshUsername" style="padding-right: 10">${gitSshUsernameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input dojoAttachPoint="gitSshUsername" id="${id}_gitSshUsername" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\t\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitSshPasswordRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitSshPasswordLabel" for="${id}_gitSshPassword" style="padding-right: 10">${gitSshPasswordLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitSshPassword" id="${id}_gitSshPassword" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPrivateKeyRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitPrivateKeyLabel" for="${id}_gitPrivateKey" style="padding-right: 10">${gitPrivateKeyLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<textarea dojoAttachPoint="gitPrivateKey" id="${id}_gitPrivateKey" style="display: inline-block; width: 98%;" value=""></textarea>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row" dojoAttachPoint="gitPassphraseRow">\n\t\t\t\t<div style="display: table-cell; padding: 5; vertical-align: top;">\n\t\t\t\t\t<label dojoAttachPoint="gitPassphraseLabel" for="${id}_gitPassphrase" style="padding-right: 10">${gitPassphraseLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 40em; text-align: left; vertical-align: top;">\n\t\t\t\t\t<input type="password" dojoAttachPoint="gitPassphrase" id="${id}_gitPassphrase" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="okButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">Ok\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/git/widgets/GitCredentialsDialog",["dojo","dijit","dijit/Dialog","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/GitCredentialsDialog.html"],function(c,g){c.declare("orion.git.widgets.GitCredentialsDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","git/widgets/templates/GitCredentialsDialog.html"),constructor:function(){this.inherited(arguments);this.options=arguments[0]||{}},postMixInProperties:function(){this.inherited(arguments);
this.title=this.options.title||"Git Credentials";this.gitUrlLabelText="Repository URL:";this.gitSshUsernameLabelText="Ssh username:";this.gitSshPasswordLabelText="Ssh password:";this.gitPrivateKeyLabelText="Private key:";this.gitPassphraseLabelText="Passphrase:";if(!this.options.username&&!this.options.password&&!this.options.privatekey&&!this.options.passphrase){this.options.username=true;this.options.password=true;this.options.privatekey=true;this.options.passphrase=true}if(this.options.serviceRegistry){var a=
this;this.options.serviceRegistry.getService("orion.net.ssh").then(function(d){a._sshService=d})}},postCreate:function(){this.inherited(arguments);var a=this;this.options.username||c.style(this.gitSshUsernameRow,"display","none");this.options.password||c.style(this.gitSshPasswordRow,"display","none");this.options.privatekey||c.style(this.gitPrivateKeyRow,"display","none");this.options.passphrase||c.style(this.gitPassphraseRow,"display","none");if(this.options.errordata&&this.options.errordata.Url){c.style(this.gitCredentialsLabel,
"display","block");this.url.innerHTML=this.options.errordata.Url}if(this.options.errordata&&this.options.errordata.User){this.gitSshUsername.value=this.options.errordata.User;setTimeout(function(){a.gitSshPassword.focus()},400)}},execute:function(){if(this._sshService){var a=this;this._sshService.getKnownHosts().then(function(d){a.options.func({gitSshUsername:a.gitSshUsername.value,gitSshPassword:a.gitSshPassword.value,gitPrivateKey:a.gitPrivateKey.value,gitPassphrase:a.gitPassphrase.value,knownHosts:d})})}else this.options.func({gitSshUsername:this.gitSshUsername.value,
gitSshPassword:this.gitSshPassword.value,gitPrivateKey:this.gitPrivateKey.value,gitPassphrase:this.gitPassphrase.value,knownHosts:this.gitSshKnownHosts.value})}})});define("text!dijit/form/templates/CheckBox.html",function(){return'<div class="dijit dijitReset dijitInline" role="presentation"\n\t><input\n\t \t${!nameAttrSetting} type="${type}" ${checkedAttrSetting}\n\t\tclass="dijitReset dijitCheckBoxInput"\n\t\tdojoAttachPoint="focusNode"\n\t \tdojoAttachEvent="onclick:_onClick"\n/></div>'});
define("dijit/form/ToggleButton",["dojo","dijit","dijit/form/Button"],function(c,g){return g.form.ToggleButton});
define("dijit/form/CheckBox",["dojo","dijit","text!dijit/form/templates/CheckBox.html","dijit/form/ToggleButton"],function(c,g){c.declare("dijit.form.CheckBox",g.form.ToggleButton,{templateString:c.cache("dijit.form","templates/CheckBox.html"),baseClass:"dijitCheckBox",type:"checkbox",value:"on",readOnly:false,attributeMap:c.delegate(g.form._FormWidget.prototype.attributeMap,{readOnly:"focusNode"}),_setReadOnlyAttr:function(a){this._set("readOnly",a);c.attr(this.focusNode,"readOnly",a);g.setWaiState(this.focusNode,
"readonly",a)},_setValueAttr:function(a,d){if(typeof a=="string"){this._set("value",a);c.attr(this.focusNode,"value",a);a=true}this._created&&this.set("checked",a,d)},_getValueAttr:function(){return this.checked?this.value:false},_setLabelAttr:undefined,postMixInProperties:function(){if(this.value=="")this.value="on";this.checkedAttrSetting=this.checked?"checked":"";this.inherited(arguments)},_fillContent:function(){},reset:function(){this._hasBeenBlurred=false;this.set("checked",this.params.checked||
false);this._set("value",this.params.value||"on");c.attr(this.focusNode,"value",this.value)},_onFocus:function(){this.id&&c.query("label[for='"+this.id+"']").addClass("dijitFocusedLabel");this.inherited(arguments)},_onBlur:function(){this.id&&c.query("label[for='"+this.id+"']").removeClass("dijitFocusedLabel");this.inherited(arguments)},_onClick:function(a){if(this.readOnly){c.stopEvent(a);return false}return this.inherited(arguments)}});c.declare("dijit.form.RadioButton",g.form.CheckBox,{type:"radio",
baseClass:"dijitRadio",_setCheckedAttr:function(a){this.inherited(arguments);if(this._created)if(a){var d=this;c.query("INPUT[type=radio]",this.focusNode.form||c.doc).forEach(function(e){if(e.name==d.name&&e!=d.focusNode&&e.form==d.focusNode.form)(e=g.getEnclosingWidget(e))&&e.checked&&e.set("checked",false)})}},_clicked:function(){this.checked||this.set("checked",true)}});return g.form.CheckBox});
define("dijit/form/Form",["dojo","dijit","dijit/_Widget","dijit/_Templated","dijit/form/_FormMixin","dijit/layout/_ContentPaneResizeMixin"],function(c,g){c.declare("dijit.form.Form",[g._Widget,g._Templated,g.form._FormMixin,g.layout._ContentPaneResizeMixin],{name:"",action:"",method:"",encType:"","accept-charset":"",accept:"",target:"",templateString:"<form dojoAttachPoint='containerNode' dojoAttachEvent='onreset:_onReset,onsubmit:_onSubmit' ${!nameAttrSetting}></form>",attributeMap:c.delegate(g._Widget.prototype.attributeMap,
{action:"",method:"",encType:"","accept-charset":"",accept:"",target:""}),postMixInProperties:function(){this.nameAttrSetting=this.name?"name='"+this.name+"'":"";this.inherited(arguments)},execute:function(){},onExecute:function(){},_setEncTypeAttr:function(a){this.encType=a;c.attr(this.domNode,"encType",a);if(c.isIE)this.domNode.encoding=a},postCreate:function(){if(c.isIE&&this.srcNodeRef&&this.srcNodeRef.attributes){var a=this.srcNodeRef.attributes.getNamedItem("encType");a&&!a.specified&&typeof a.value==
"string"&&this.set("encType",a.value)}this.inherited(arguments)},reset:function(a){var d={returnValue:true,preventDefault:function(){this.returnValue=false},stopPropagation:function(){},currentTarget:a?a.target:this.domNode,target:a?a.target:this.domNode};this.onReset(d)!==false&&d.returnValue&&this.inherited(arguments,[])},onReset:function(){return true},_onReset:function(a){this.reset(a);c.stopEvent(a);return false},_onSubmit:function(a){var d=g.form.Form.prototype;if(this.execute!=d.execute||this.onExecute!=
d.onExecute){c.deprecated("dijit.form.Form:execute()/onExecute() are deprecated. Use onSubmit() instead.","","2.0");this.onExecute();this.execute(this.getValues())}this.onSubmit(a)===false&&c.stopEvent(a)},onSubmit:function(){return this.isValid()},submit:function(){this.onSubmit()!==false&&this.containerNode.submit()}});return g.form.Form});
define("dojo/data/util/filter",["dojo"],function(c){c.getObject("data.util.filter",true,c);c.data.util.filter.patternToRegExp=function(g,a){for(var d="^",e=null,f=0;f<g.length;f++){e=g.charAt(f);switch(e){case "\\":d+=e;f++;d+=g.charAt(f);break;case "*":d+=".*";break;case "?":d+=".";break;case "$":case "^":case "/":case "+":case ".":case "|":case "(":case ")":case "{":case "}":case "[":case "]":d+="\\";default:d+=e}}d+="$";return a?new RegExp(d,"mi"):new RegExp(d,"m")};return c.data.util.filter});
define("dojo/data/util/sorter",["dojo"],function(c){c.getObject("data.util.sorter",true,c);c.data.util.sorter.basicComparator=function(g,a){var d=-1;if(g===null)g=undefined;if(a===null)a=undefined;if(g==a)d=0;else if(g>a||g==null)d=1;return d};c.data.util.sorter.createSortFunction=function(g,a){function d(r,u,s,q){return function(v,y){v=q.getValue(v,r);y=q.getValue(y,r);return u*s(v,y)}}for(var e=[],f,i=a.comparatorMap,j=c.data.util.sorter.basicComparator,h=0;h<g.length;h++){f=g[h];var l=f.attribute;
if(l){f=f.descending?-1:1;var o=j;if(i){if(typeof l!=="string"&&"toString"in l)l=l.toString();o=i[l]||j}e.push(d(l,f,o,a))}}return function(r,u){for(var s=0;s<e.length;){var q=e[s++](r,u);if(q!==0)return q}return 0}};return c.data.util.sorter});
define("dojo/data/util/simpleFetch",["dojo","dojo/data/util/sorter"],function(c){c.getObject("data.util.simpleFetch",true,c);c.data.util.simpleFetch.fetch=function(g){g=g||{};if(!g.store)g.store=this;var a=this,d=function(f,i){if(i.onError)i.onError.call(i.scope||c.global,f,i)},e=function(f,i){var j=i.abort||null,h=false,l=i.start?i.start:0,o=i.count&&i.count!==Infinity?l+i.count:f.length;i.abort=function(){h=true;j&&j.call(i)};var r=i.scope||c.global;if(!i.store)i.store=a;i.onBegin&&i.onBegin.call(r,
f.length,i);i.sort&&f.sort(c.data.util.sorter.createSortFunction(i.sort,a));if(i.onItem)for(var u=l;u<f.length&&u<o;++u){var s=f[u];h||i.onItem.call(r,s,i)}if(i.onComplete&&!h){u=null;i.onItem||(u=f.slice(l,o));i.onComplete.call(r,u,i)}};this._fetchItems(g,e,d);return g};return c.data.util.simpleFetch});
define("dojo/data/ItemFileReadStore",["dojo","dojo/data/util/filter","dojo/data/util/simpleFetch","dojo/date/stamp"],function(c){c.declare("dojo.data.ItemFileReadStore",null,{constructor:function(g){this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this.url=this._ccUrl=this._jsonFileUrl=g.url;this._jsonData=g.data;this.data=null;this._datatypeMap=g.typeMap||{};this._datatypeMap.Date||(this._datatypeMap.Date={type:Date,deserialize:function(a){return c.date.stamp.fromISOString(a)}});
this._features={"dojo.data.api.Read":true,"dojo.data.api.Identity":true};this._itemsByIdentity=null;this._storeRefPropName="_S";this._itemNumPropName="_0";this._rootItemPropName="_RI";this._reverseRefMap="_RRM";this._loadInProgress=false;this._queuedFetches=[];if(g.urlPreventCache!==undefined)this.urlPreventCache=g.urlPreventCache?true:false;if(g.hierarchical!==undefined)this.hierarchical=g.hierarchical?true:false;if(g.clearOnClose)this.clearOnClose=true;if("failOk"in g)this.failOk=g.failOk?true:
false},url:"",_ccUrl:"",data:null,typeMap:null,clearOnClose:false,urlPreventCache:false,failOk:false,hierarchical:true,_assertIsItem:function(g){if(!this.isItem(g))throw new Error("dojo.data.ItemFileReadStore: Invalid item argument.");},_assertIsAttribute:function(g){if(typeof g!=="string")throw new Error("dojo.data.ItemFileReadStore: Invalid attribute argument.");},getValue:function(g,a,d){g=this.getValues(g,a);return g.length>0?g[0]:d},getValues:function(g,a){this._assertIsItem(g);this._assertIsAttribute(a);
return(g[a]||[]).slice(0)},getAttributes:function(g){this._assertIsItem(g);var a=[];for(var d in g)d!==this._storeRefPropName&&d!==this._itemNumPropName&&d!==this._rootItemPropName&&d!==this._reverseRefMap&&a.push(d);return a},hasAttribute:function(g,a){this._assertIsItem(g);this._assertIsAttribute(a);return a in g},containsValue:function(g,a,d){var e=undefined;if(typeof d==="string")e=c.data.util.filter.patternToRegExp(d,false);return this._containsValue(g,a,d,e)},_containsValue:function(g,a,d,e){return c.some(this.getValues(g,
a),function(f){if(f!==null&&!c.isObject(f)&&e){if(f.toString().match(e))return true}else if(d===f)return true})},isItem:function(g){if(g&&g[this._storeRefPropName]===this)if(this._arrayOfAllItems[g[this._itemNumPropName]]===g)return true;return false},isItemLoaded:function(g){return this.isItem(g)},loadItem:function(g){this._assertIsItem(g.item)},getFeatures:function(){return this._features},getLabel:function(g){if(this._labelAttr&&this.isItem(g))return this.getValue(g,this._labelAttr)},getLabelAttributes:function(){if(this._labelAttr)return[this._labelAttr];
return null},_fetchItems:function(g,a,d){var e=this,f=function(l,o){var r=[],u,s;if(l.query){var q;u=l.queryOptions?l.queryOptions.ignoreCase:false;var v={};for(s in l.query){q=l.query[s];if(typeof q==="string")v[s]=c.data.util.filter.patternToRegExp(q,u);else if(q instanceof RegExp)v[s]=q}for(u=0;u<o.length;++u){var y=true,x=o[u];if(x===null)y=false;else for(s in l.query){q=l.query[s];e._containsValue(x,s,q,v[s])||(y=false)}y&&r.push(x)}}else for(u=0;u<o.length;++u){s=o[u];s!==null&&r.push(s)}a(r,
l)};if(this._loadFinished)f(g,this._getItemsArray(g.queryOptions));else{if(this._jsonFileUrl!==this._ccUrl){c.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:g,
filter:f});else{this._loadInProgress=true;var i=c.xhrGet({url:e._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});i.addCallback(function(l){try{e._getItemsFromLoadedData(l);e._loadFinished=true;e._loadInProgress=false;f(g,e._getItemsArray(g.queryOptions));e._handleQueuedFetches()}catch(o){e._loadFinished=true;e._loadInProgress=false;d(o,g)}});i.addErrback(function(l){e._loadInProgress=false;d(l,g)});var j=null;if(g.abort)j=g.abort;g.abort=function(){i&&
i.fired===-1&&i.cancel();j&&j.call(g)}}else if(this._jsonData)try{this._loadFinished=true;this._getItemsFromLoadedData(this._jsonData);this._jsonData=null;f(g,this._getItemsArray(g.queryOptions))}catch(h){d(h,g)}else d(new Error("dojo.data.ItemFileReadStore: No JSON source data was provided as either URL or a nested Javascript object."),g)}},_handleQueuedFetches:function(){if(this._queuedFetches.length>0){for(var g=0;g<this._queuedFetches.length;g++){var a=this._queuedFetches[g],d=a.args;(a=a.filter)?
a(d,this._getItemsArray(d.queryOptions)):this.fetchItemByIdentity(d)}this._queuedFetches=[]}},_getItemsArray:function(g){if(g&&g.deep)return this._arrayOfAllItems;return this._arrayOfTopLevelItems},close:function(){if(this.clearOnClose&&this._loadFinished&&!this._loadInProgress){if((this._jsonFileUrl==""||this._jsonFileUrl==null)&&(this.url==""||this.url==null)&&this.data==null)console.debug("dojo.data.ItemFileReadStore: WARNING!  Data reload  information has not been provided.  Please set 'url' or 'data' to the appropriate value before the next fetch");
this._arrayOfAllItems=[];this._arrayOfTopLevelItems=[];this._loadFinished=false;this._itemsByIdentity=null;this._loadInProgress=false;this._queuedFetches=[]}},_getItemsFromLoadedData:function(g){function a(v){return v!==null&&typeof v==="object"&&(!c.isArray(v)||e)&&!c.isFunction(v)&&(v.constructor==Object||c.isArray(v))&&typeof v._reference==="undefined"&&typeof v._type==="undefined"&&typeof v._value==="undefined"&&f.hierarchical}function d(v){f._arrayOfAllItems.push(v);for(var y in v){var x=v[y];
if(x)if(c.isArray(x))for(var k=0;k<x.length;++k){var m=x[k];a(m)&&d(m)}else a(x)&&d(x)}}var e=false,f=this;this._labelAttr=g.label;var i,j;this._arrayOfAllItems=[];this._arrayOfTopLevelItems=g.items;for(i=0;i<this._arrayOfTopLevelItems.length;++i){j=this._arrayOfTopLevelItems[i];if(c.isArray(j))e=true;d(j);j[this._rootItemPropName]=true}var h={},l;for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];for(l in j){if(l!==this._rootItemPropName){var o=j[l];if(o!==null)c.isArray(o)||
(j[l]=[o]);else j[l]=[null]}h[l]=l}}for(;h[this._storeRefPropName];)this._storeRefPropName+="_";for(;h[this._itemNumPropName];)this._itemNumPropName+="_";for(;h[this._reverseRefMap];)this._reverseRefMap+="_";if(h=g.identifier){this._itemsByIdentity={};this._features["dojo.data.api.Identity"]=h;for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];g=j[h];g=g[0];if(Object.hasOwnProperty.call(this._itemsByIdentity,g))if(this._jsonFileUrl)throw new Error("dojo.data.ItemFileReadStore:  The json data as specified by: ["+
this._jsonFileUrl+"] is malformed.  Items within the list have identifier: ["+h+"].  Value collided: ["+g+"]");else{if(this._jsonData)throw new Error("dojo.data.ItemFileReadStore:  The json data provided by the creation arguments is malformed.  Items within the list have identifier: ["+h+"].  Value collided: ["+g+"]");}else this._itemsByIdentity[g]=j}}else this._features["dojo.data.api.Identity"]=Number;for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];j[this._storeRefPropName]=
this;j[this._itemNumPropName]=i}for(i=0;i<this._arrayOfAllItems.length;++i){j=this._arrayOfAllItems[i];for(l in j){g=j[l];for(h=0;h<g.length;++h){o=g[h];if(o!==null&&typeof o=="object"){if("_type"in o&&"_value"in o){var r=o._type,u=this._datatypeMap[r];if(u)if(c.isFunction(u))g[h]=new u(o._value);else if(c.isFunction(u.deserialize))g[h]=u.deserialize(o._value);else throw new Error("dojo.data.ItemFileReadStore: Value provided in typeMap was neither a constructor, nor a an object with a deserialize function");
else throw new Error("dojo.data.ItemFileReadStore: in the typeMap constructor arg, no object class was specified for the datatype '"+r+"'");}if(o._reference){o=o._reference;if(c.isObject(o))for(r=0;r<this._arrayOfAllItems.length;++r){u=this._arrayOfAllItems[r];var s=true;for(var q in o)if(u[q]!=o[q])s=false;if(s)g[h]=u}else g[h]=this._getItemByIdentity(o);if(this.referenceIntegrity){o=g[h];this.isItem(o)&&this._addReferenceToMap(o,j,l)}}else this.isItem(o)&&this.referenceIntegrity&&this._addReferenceToMap(o,
j,l)}}}}},_addReferenceToMap:function(){},getIdentity:function(g){var a=this._features["dojo.data.api.Identity"];if(a===Number)return g[this._itemNumPropName];else if(g=g[a])return g[0];return null},fetchItemByIdentity:function(g){var a,d;if(this._loadFinished){a=this._getItemByIdentity(g.identity);if(g.onItem){d=g.scope?g.scope:c.global;g.onItem.call(d,a)}}else{var e=this;if(this._jsonFileUrl!==this._ccUrl){c.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null&&this._jsonData==null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl)if(this._loadInProgress)this._queuedFetches.push({args:g});else{this._loadInProgress=true;d=c.xhrGet({url:e._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk});d.addCallback(function(f){var i=g.scope?g.scope:c.global;try{e._getItemsFromLoadedData(f);
e._loadFinished=true;e._loadInProgress=false;a=e._getItemByIdentity(g.identity);g.onItem&&g.onItem.call(i,a);e._handleQueuedFetches()}catch(j){e._loadInProgress=false;g.onError&&g.onError.call(i,j)}});d.addErrback(function(f){e._loadInProgress=false;if(g.onError)g.onError.call(g.scope?g.scope:c.global,f)})}else if(this._jsonData){e._getItemsFromLoadedData(e._jsonData);e._jsonData=null;e._loadFinished=true;a=e._getItemByIdentity(g.identity);if(g.onItem){d=g.scope?g.scope:c.global;g.onItem.call(d,a)}}}},
_getItemByIdentity:function(g){var a=null;if(this._itemsByIdentity&&Object.hasOwnProperty.call(this._itemsByIdentity,g))a=this._itemsByIdentity[g];else if(Object.hasOwnProperty.call(this._arrayOfAllItems,g))a=this._arrayOfAllItems[g];if(a===undefined)a=null;return a},getIdentityAttributes:function(){var g=this._features["dojo.data.api.Identity"];return g===Number?null:[g]},_forceLoad:function(){var g=this;if(this._jsonFileUrl!==this._ccUrl){c.deprecated("dojo.data.ItemFileReadStore: ","To change the url, set the url property of the store, not _jsonFileUrl.  _jsonFileUrl support will be removed in 2.0");
this.url=this._ccUrl=this._jsonFileUrl}else if(this.url!==this._ccUrl)this._ccUrl=this._jsonFileUrl=this.url;if(this.data!=null){this._jsonData=this.data;this.data=null}if(this._jsonFileUrl){var a=c.xhrGet({url:this._jsonFileUrl,handleAs:"json-comment-optional",preventCache:this.urlPreventCache,failOk:this.failOk,sync:true});a.addCallback(function(d){try{if(g._loadInProgress!==true&&!g._loadFinished){g._getItemsFromLoadedData(d);g._loadFinished=true}else if(g._loadInProgress)throw new Error("dojo.data.ItemFileReadStore:  Unable to perform a synchronous load, an async load is in progress.");
}catch(e){console.log(e);throw e;}});a.addErrback(function(d){throw d;})}else if(this._jsonData){g._getItemsFromLoadedData(g._jsonData);g._jsonData=null;g._loadFinished=true}}});c.extend(c.data.ItemFileReadStore,c.data.util.simpleFetch);return c.data.ItemFileReadStore});define("text!orion/widgets/templates/NewItemDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t<div style="display: table">\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemNameLabel" for="${id}_itemName" style="padding-right: 10">${itemNameLabelText}</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; padding: 5; width: 30em; text-align: left;">\n\t\t\t\t\t<input dojoType="dijit.form.ValidationTextBox" dojoAttachPoint="itemName" id="${id}_itemName" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo">\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<label dojoAttachPoint="itemURLLabel" for="itemURL" style="padding-right: 10">Server Path:</label>\n\t\t\t\t</div>\n\t\t\t\t<div style="display: table-cell; width: 40em; text-align: left; padding:5;">\n\t\t\t\t\t<input dojoAttachPoint="itemURL" style="display: inline-block; width: 98%;" value="">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: none;" dojoAttachPoint="itemAdvancedInfo1">\n\t\t\t\t<div style="display: table-cell;"></div>\n\t\t\t\t<div style="display: table-cell;">\n\t\t\t\t\t<input dojoAttachPoint="createCheckbox" id="${id}_createCheckbox" dojoType="dijit.form.CheckBox" checked="checked" value="on" type="checkbox">\n\t\t\t\t\t<label dojoAttachPoint="createCheckboxLabel" for="${id}_createCheckbox">Create if doesn\'t exist</label>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div style="display: table-row">\n\t\t\t\t<div style="display: table-cell; padding: 5"></div>\n\t\t\t\t<div style="display: table-cell; padding: 5">\n\t\t\t\t\t<button dojoAttachPoint="newItemButton" dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">OK\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>'});
define("orion/widgets/NewItemDialog",["dojo","dijit","dijit/Dialog","dijit/form/CheckBox","dijit/form/CheckBox","dijit/form/Form","dijit/form/ValidationTextBox","dojo/data/ItemFileReadStore","orion/widgets/_OrionDialogMixin","text!orion/widgets/templates/NewItemDialog.html"],function(c,g){c.declare("orion.widgets.NewItemDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{widgetsInTemplate:true,templateString:c.cache("orion","widgets/templates/NewItemDialog.html"),constructor:function(a){this.options=
a||{};this.options.advanced=this.options.advanced||false},postMixInProperties:function(){this.inherited(arguments);this.itemNameLabelText=this.options.label||"Name:"},postCreate:function(){this.inherited(arguments);if(this.options.advanced){this.itemAdvancedInfo.style.display="table-row";this.itemAdvancedInfo1.style.display="table-row";c.connect(this.itemURL,"onkeyup",null,c.hitch(this,this.onURLChange))}else{this.itemAdvancedInfo.style.display="none";this.itemAdvancedInfo1.style.display="none"}},
execute:function(){var a,d;this.newItemButton.focus();if(this.options.advanced){a=this.itemURL.value.replace(/^\s+|\s+$/g,"");d=this.createCheckbox.get("disabled")?false:this.createCheckbox.get("checked")}this.options.func(this.itemName.value,a&&a!==""?a:undefined,d)},onURLChange:function(){var a=this.itemURL.value;if(a.match(/^file:\/\//))this.createCheckbox.set("disabled",false);else a.match(/^[a-zA-Z][a-zA-Z]+:\/\/.+/)?this.createCheckbox.set("disabled",true):this.createCheckbox.set("disabled",
false)}})});
define("orion/git/git-clones-explorer",["dojo","orion/explorer","orion/util"],function(c,g,a){var d={};d.GitClonesExplorer=function(){function e(f,i,j,h,l,o){this.parentId=h;this.registry=f;this.selection=i;this.toolbarId=l;this.selectionToolsId=o;this.cloneDetails=j;this.checkbox=false;this.renderer=new d.GitClonesRenderer({checkbox:false},this)}e.prototype=g.Explorer.prototype;e.prototype.getGitLocation=function(f){f=a.makeRelative(f);return f[0]==="/"?"/gitapi/clone"+f:"/gitapi/clone/"+f};e.prototype.setDefaultPath=
function(f){this.defaultPath=f};e.prototype.displayClonesList=function(f){var i=this;f=f||this.defaultPath;f=a.makeRelative(f);if(f!==this._lastHash){this._lastHash=f;c.hash(f,true);var j=this.getGitLocation(f);c.create("div",null,c.byId(this.parentId),"only").innerHTML="Loading <b>"+j+"</b>...";this.registry.getService("orion.git.provider").then(function(h){c.hitch(i,i.createTree(i.parentId,new d.GitClonesModel(h,j,h.getGitClone)))})}};e.prototype.redisplayClonesList=function(){if(this._lastHash){var f=
this,i=this.getGitLocation(this._lastHash);c.create("div",null,c.byId(this.parentId),"only").innerHTML="Loading <b>"+i+"</b>...";this.registry.getService("orion.git.provider").then(function(j){c.hitch(f,f.createTree(f.parentId,new d.GitClonesModel(j,i,j.getGitClone)))})}};e.prototype.loadCloneDetails=function(f){this.cloneDetails.loadCloneDetails(f.ConfigLocation)};return e}();d.GitClonesModel=function(){function e(f,i,j,h){this.gitClient=f;this.rootPath=i;this.fetchItems=j;this.root=h?h:null}e.prototype=
g.ExplorerModel.prototype;e.prototype.getRoot=function(f){this.root?f(this.root):this.fetchItems(this.rootPath).then(c.hitch(this,function(i){this.root=i;f(i)}))};e.prototype.mayHaveChildren=function(f){if(f.children||f.Children)return true;else if(f.BranchLocation&&f.RemoteLocation)return true;else if(f.GroupNode)return true;else if(f.Type==="Remote")return true;return false};e.prototype.getIdentity=function(f){if(f.Location){f=f.Location;f=f.replace(/[^\.\:\-\_0-9A-Za-z]/g,"")}else f="ROOT";return f};
e.prototype.getChildren=function(f,i){f.children=[];if(f.Children){for(var j=0;j<f.Children.length;j++){f.Children[j].parent=f;f.children[j]=f.Children[j]}i(f.Children)}else if(f.BranchLocation&&f.RemoteLocation){f.children=[{GroupNode:"true",Location:f.BranchLocation,Name:"Branch",parent:f},{GroupNode:"true",Location:f.RemoteLocation,Name:"Remote",parent:f}];i(f.children)}else if(f.GroupNode)this.gitClient.getGitBranch(f.Location).then(c.hitch(this,function(h){f.children=h.Children;for(var l=0;l<
h.Children.length;l++)h.Children[l].parent=f;i(h.Children)}));else f.Type==="Remote"&&this.gitClient.getGitBranch(f.Location).then(c.hitch(this,function(h){f.children=h.Children;for(var l=0;l<h.Children.length;l++)h.Children[l].parent=f;i(h.Children)}))};return e}();d.GitClonesRenderer=function(){function e(f,i){this._init(f);this.explorer=i}e.prototype=g.SelectionRenderer.prototype;e.prototype.getCellHeaderElement=function(f){switch(f){case 0:return c.create("th",{innerHTML:"<h2>Name</h2>"});case 1:return c.create("th",
{innerHTML:"<h2>Actions</h2>"})}};e.prototype.getCellElement=function(f,i,j){switch(f){case 0:var h,l;if(i.BranchLocation&&i.RemoteLocation){h=document.createElement("td");f=j.id+"__expand";f=c.create("div",null,h,"only");this.getExpandImage(j,f,"/git/images/repository.gif");l=c.create("a",{className:"navlinkonpage"},f,"last");c.connect(l,"onclick",l,c.hitch(this,function(){this.explorer.loadCloneDetails(i)}));c.connect(l,"onmouseover",l,function(){l.style.cursor="pointer"});c.connect(l,"onmouseout",
l,function(){l.style.cursor="default"});c.place(document.createTextNode(i.Name),l,"only")}else if(i.GroupNode){h=document.createElement("td");f=j.id+"__expand";f=c.create("div",null,h,"only");this.getExpandImage(j,f,i.Name==="Branch"?"/git/images/branches.gif":"/git/images/remotes.gif");l=c.create("a",{innerHTML:i.Name,className:"navlinkonpage"},f,"last");c.place(document.createTextNode(i.Name),l,"only")}else if(i.Type==="Branch"){h=document.createElement("td");f=c.create("div",{style:"margin-left: 10px"},
h,"only");l=c.create("a",{innerHTML:i.Name,className:"navlinkonpage"},f,"last");if(i.Current)l.style.fontWeight="bold";c.place(document.createTextNode(i.Name),l,"only");c.create("img",{src:"/git/images/branch.gif",style:"vertical-align: middle; margin-right: 4px"},l,"first")}else if(i.Type==="Remote"){h=document.createElement("td");f=j.id+"__expand";f=c.create("div",null,h,"only");this.getExpandImage(j,f,"/git/images/remote.gif");l=c.create("a",{innerHTML:i.Name,className:"navlinkonpage"},f,"last");
c.place(document.createTextNode(i.Name),l,"only")}else if(i.Type==="RemoteTrackingBranch"){h=document.createElement("td");f=c.create("div",{style:"margin-left: 10px"},h,"only");l=c.create("a",{innerHTML:i.Name,className:"navlinkonpage"},f,"last");c.place(document.createTextNode(i.Name),l,"only");c.create("img",{src:"/git/images/branch.gif",style:"vertical-align: middle; margin-right: 4px"},l,"first")}return h;case 1:return this.getActionsColumn(i,j)}};return e}();return d});
define("text!orion/git/widgets/templates/RemotePrompterDialog.html",function(){return'<div class="dijitDialog" tabindex="-1" waiRole="dialog" waiState="labelledby-${id}_title">\n\t<div dojoAttachPoint="titleBar" class="dijitDialogTitleBar">\n\t\t<span dojoAttachPoint="titleNode" class="dijitDialogTitle" id="${id}_title"></span>\n\t\t<span dojoAttachPoint="closeButtonNode" class="dijitDialogCloseIcon" dojoAttachEvent="onclick: onCancel" title="${buttonCancel}">\n\t\t\t<span dojoAttachPoint="closeText" class="closeText" title="${buttonCancel}">x</span>\n\t\t</span>\n\t</div>\n\t<div dojoAttachPoint="containerNode" class="dijitDialogPaneContent">\n\t\t<!-- Actual content here --\>\n\t\t\t<div style="display: table">\n\t\t\t\t<div style="display: table-row"> \n\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t\t<div dojoAttachPoint="treeContainerNode" id="${id}_treeContainerNode" dojoType="dijit.layout.BorderContainer" style="width:25em; height:25em; overflow:auto;" design="sidebar" gutters="true">\n\t\t\t\t\t\t\t<div dojoAttachPoint="treeContentPane" class="dijitDialogPaneContent" id="${id}_treeContentPane dojoType="dijit.layout.ContentPane" region="center" gutters="true">\n\t\t\t\t\t\t\t\t<div dojoAttachPoint="browseRemoteExplorerTree" class="explorerTreeClass" id="${id}_browseRemoteExplorerTree" style="margin-top: -3px;"></div> \n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px; vertical-align: bottom;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div style="display: table-row" dojoAttachPoint="newBranchSection">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t<label for="${id}_newBranch">${newBranchText}</label>\n\t\t\t\t\t<input dojoAttachPoint="newBranch" id="${id}_newBranch" value="" disabled=true/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t \n\t\t\t\t<div style="display: table-row">\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="display: table-cell; padding: 1px;">\n\t\t\t\t\t\n\t\t\t\t\t\t<button dojoAttachPoint="RemoteBrowserButton" disabled=true dojoType="dijit.form.Button" type="submit" value="OK" style="padding: 20 0 10 0; float: right; clear: both;">${buttonOk}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div> <!-- end table --\>\n\t</div> <!-- content pane --\>\n</div>'});
define("orion/git/widgets/RemotePrompterDialog",["dojo","dijit","orion/util","orion/git/git-clones-explorer","dijit/Dialog","dijit/form/Button","orion/widgets/ExplorerTree","orion/widgets/_OrionDialogMixin","text!orion/git/widgets/templates/RemotePrompterDialog.html"],function(c,g,a,d){c.declare("orion.git.widgets.RemotePrompterDialog",[g.Dialog,orion.widgets._OrionDialogMixin],{treeWidget:null,treeRoot:{},widgetsInTemplate:true,templateString:c.cache("orion","git/widgets/templates/RemotePrompterDialog.html"),
constructor:function(){this.inherited(arguments);this.options=arguments[0]||{};this.treeRoot=this.options.treeRoot},postMixInProperties:function(){this.inherited(arguments);this.title=this.options.title||"Choose a Folder";this.newBranchText="New Branch:";this.buttonOk="OK"},postCreate:function(){this.inherited(arguments);this.loadRemoteChildren(this.treeRoot);c.connect(this.newBranch,"onchange",c.hitch(this,this.validate));if(this.options.hideNewBranch)this.newBranchSection.style.display="none"},
loadRemoteChildren:function(e){this.treeRoot=e;this.createTree(new d.GitClonesModel(this.gitClient,null,this.gitClient.getGitClone,this.treeRoot))},createTree:function(e){var f=this.treeWidget=new orion.widgets.ExplorerTree({id:"treeWidget",style:"width:100%; height:100%",model:e,region:"center",showRoot:false,persist:true,openOnClick:false,getLabel:function(j){return j.Name},getIconClass:function(j){if(j.BranchLocation&&j.RemoteLocation)return"gitRepoItem";if(j.GroupNode)return j.Name==="Branch"?
"gitBranchesItem":"gitRemotesItem";if(j.Type==="Branch"||j.Type==="RemoteTrackingBranch")return"gitBranchItem";if(j.Type==="Remote")return"gitRemoteItem";return"gitDefaultItem"}}),i=this;this.treeWidget._inheritedSelectNode=this.treeWidget._selectNode;this.treeWidget._selectNode=function(j){f._inheritedSelectNode(j);i.newBranch.disabled=j.item&&j.item.Type==="Remote"?false:true;c.hitch(i,i.validate)()};this.treeWidget.startup();c.byId(this.treeContentPane.id).appendChild(this.treeWidget.domNode)},
validate:function(){var e=this.treeWidget.getSelectedItems();if(e.length==1)if(e[0].Type==="RemoteTrackingBranch"){this.RemoteBrowserButton.disabled=false;return}else if(e[0].Type==="Remote")if(this.newBranch.value!=""){this.RemoteBrowserButton.disabled=false;return}this.RemoteBrowserButton.disabled=true},execute:function(){var e=this.treeWidget.getSelectedItems();this.onHide();e[0].Type==="RemoteTrackingBranch"?this.options.func(e[0]):this.options.func(null,e[0],this.newBranch.value)}})});
define("orion/git/gitCommands",["dojo","orion/commands","orion/util","orion/git/widgets/CloneGitRepositoryDialog","orion/git/widgets/InitGitRepositoryDialog","orion/git/widgets/AddRemoteDialog","orion/git/widgets/GitCredentialsDialog","orion/widgets/NewItemDialog","orion/git/widgets/RemotePrompterDialog"],function(c,g,a){var d={};(function(){function e(i){serviceRegistry.getService("orion.page.message").then(function(j){if(!(i.status===401||i.status===403)){var h=[];h.Severity="Error";h.HTML=false;
try{var l=JSON.parse(i.responseText);h.Message=l.DetailedMessage?l.DetailedMessage:l.Message}catch(o){h.Message=i.message}j.setProgressResult(h)}})}var f=false;d.updateNavTools=function(i,j,h,l,o){var r=c.byId(h);if(r)c.empty(r);else throw"could not find toolbar "+h;i.getService("orion.page.command").then(c.hitch(j,function(u){u.renderCommands(r,"dom",o,j,"image",null,null,true);if(l){var s=c.create("span",{id:l},r,"last");u.renderCommands(s,"dom",null,j,"image",null,null,true)}}));if(!f){f=true;
i.getService("orion.page.selection").then(function(u){u.addEventListener("selectionChanged",function(s,q){var v=c.byId(l);if(v){c.empty(v);i.getService("orion.page.command").then(function(y){y.renderCommands(v,"dom",q,j,"image",null,null,true)})}})})}};d.getNewItemName=function(i,j,h,l,o,r,u){var s;if(h)i=c.byId(l);else if(j=j.makeNewItemPlaceHolder(i,l,u)){i=j.refNode;s=j.tempNode}else i=c.byId(l);if(i)a.getUserText(l+"EditBox",i,false,o,c.hitch(this,function(q){if(q){s&&s.parentNode.removeChild(s);
r(q)}}));else(l=window.prompt(o))&&r(l)};d.handleKnownHostsError=function(i,j,h,l){confirm("Would you like to add "+j.KeyType+" key for host "+j.Host+" to continue operation? Key fingerpt is "+j.HostFingerprint+".")&&i.getService("orion.net.ssh").then(function(o){o.addKnownHosts(j.Host+" "+j.KeyType+" "+j.HostKey).then(function(){o.getKnownHosts().then(function(r){h.knownHosts=r;l(h)})})})};d.handleSshAuthenticationError=function(i,j,h,l,o){i=new orion.git.widgets.GitCredentialsDialog({title:o,serviceRegistry:i,
func:l,errordata:h.errordata});i.startup();i.show()};d.getDefaultSshOptions=function(i){var j=new c.Deferred;i.getService("orion.net.ssh").then(function(h){h.getKnownHosts().then(function(l){j.callback({knownHosts:l,gitSshUsername:"",gitSshPassword:"",gitPrivateKey:"",gitPassphrase:""})})});return j};d.handleProgressServiceResponse=function(i,j,h,l,o,r){if(i.Running==false){if(i.Result&&i.Result.HttpCode==403){if(i.Result.ErrorData&&i.Result.ErrorData.HostKey){c.hitch(this,d.handleKnownHostsError)(h,
i.Result.ErrorData,j,o);return}}else if(i.Result&&i.Result.HttpCode==401){if(i.Result.ErrorData)j.errordata=i.Result.ErrorData;c.hitch(this,d.handleSshAuthenticationError)(h,i.Result.ErrorData,j,o,r);return}if(i.Result&&i.Result.HttpCode!=200)console.error("error "+i.Result.HttpCode+" while running opperation: "+i.Result.DetailedMessage);else l&&l(i)}};d.createFileCommands=function(i,j,h){var l=new g.Command({name:"Link Repository",image:"/images/link.gif",id:"eclipse.linkRepository",callback:function(o){var r=
new orion.widgets.NewItemDialog({title:"Link Repository",label:"Folder name:",func:function(u){i.getService("orion.core.file").then(function(s){s.loadWorkspace("").then(function(q){s.createProject(q.Location,u,o.ContentLocation,false).then(function(v){alert("Repository was linked to "+v.Name);s.read(v.ContentLocation,true).then(function(y){window.location.replace("/navigate/table.html#"+y.ChildrenLocation)})})})})},advanced:false});r.startup();r.show()},visibleWhen:function(o){if(o.ContentLocation)return true;
return false}});j.addCommand(l,"object");l=new g.Command({name:"Checkout",image:"/git/images/checkout.gif",id:"eclipse.checkoutBranch",callback:function(o){i.getService("orion.git.provider").then(function(r){o.Type==="Branch"?r.checkoutBranch(o.CloneLocation,o.Name).then(function(){c.hitch(h,h.changedItem)(o.parent)},e):r.addBranch(o.BranchLocation,null,o.Name).then(function(u){r.checkoutBranch(u.CloneLocation,u.Name).then(function(){c.hitch(h,h.changedItem)(o.parent.parent.parent)},e)},e)})},visibleWhen:function(o){return o.Type===
"Branch"||o.Type==="RemoteTrackingBranch"}});j.addCommand(l,"object");l=new g.Command({name:"Add Branch",image:"/images/add.gif",id:"eclipse.addBranch",callback:function(o,r,u){d.getNewItemName(o,h,false,u,"Branch name",function(s){!s&&s==""||i.getService("orion.git.provider").then(function(q){q.addBranch(o.Location,s).then(function(){c.hitch(h,h.changedItem)(o)},e)})})},visibleWhen:function(o){return o.GroupNode&&o.Name==="Branch"}});j.addCommand(l,"object");l=new g.Command({name:"Remove Branch",
image:"/images/delete.gif",id:"eclipse.removeBranch",callback:function(o){confirm("Are you sure you want to remove branch "+o.Name+"?")&&i.getService("orion.git.provider").then(function(r){r.removeBranch(o.Location).then(function(){c.hitch(h,h.changedItem)(o.parent)},e)})},visibleWhen:function(o){return o.Type==="Branch"&&!o.Current}});j.addCommand(l,"object");l=new g.Command({name:"Add Remote",image:"/images/add.gif",id:"eclipse.addRemote",callback:function(o){var r=new orion.git.widgets.AddRemoteDialog({func:function(u,
s){i.getService("orion.git.provider").then(function(q){q.addRemote(o.Location,u,s).then(function(){c.hitch(h,h.changedItem)(o)},e)})}});r.startup();r.show()},visibleWhen:function(o){return o.GroupNode&&o.Name==="Remote"}});j.addCommand(l,"object");l=new g.Command({name:"Remove Remote",image:"/images/delete.gif",id:"eclipse.removeRemote",callback:function(o){confirm("Are you sure you want to remove remote "+o.Name+"?")&&i.getService("orion.git.provider").then(function(r){r.removeRemote(o.Location).then(function(){c.hitch(h,
h.changedItem)(o.parent)},e)})},visibleWhen:function(o){return o.Type==="Remote"}});j.addCommand(l,"object");l=new g.Command({name:"Show Git Log",id:"eclipse.openGitLog",hrefCallback:function(o){if(o.Type==="RemoteTrackingBranch")return"/git/git-log.html#"+o.Location+"?page=1";return"/git/git-log.html#"+o.CommitLocation+"?page=1"},visibleWhen:function(o){return o.Type==="Branch"||o.Type==="RemoteTrackingBranch"}});j.addCommand(l,"object");l=new g.Command({name:"Show in Navigator",id:"eclipse.openCloneContent",
hrefCallback:function(o){return"/navigate/table.html#"+o.ContentLocation+"?depth=1"},visibleWhen:function(o){if(!o.ContentLocation)return false;return true}});j.addCommand(l,"object");l=new g.Command({name:"Compare With Each Other",image:"/git/images/open_compare.gif",id:"eclipse.compareGitCommits",hrefCallback:function(o){var r=new c.Deferred;i.getService("orion.git.provider").then(function(u){u.getDiff(o[0].DiffLocation,o[1].Name,function(s,q){r.callback("/compare/compare.html?readonly#"+q.xhr.getResponseHeader("Location"))})});
return r},visibleWhen:function(o){if(h.isDirectory)return false;if(c.isArray(o)&&o.length===2&&o[0].Type==="Commit"&&o[1].Type==="Commit")return true;return false}});j.addCommand(l,"dom");l=new g.Command({name:"Compare With Working Tree",image:"/git/images/open_compare.gif",id:"eclipse.compareWithWorkingTree",hrefCallback:function(o){return"/compare/compare.html#"+o.DiffLocation},visibleWhen:function(o){return o.Type==="Commit"&&!h.isDirectory}});j.addCommand(l,"object");l=new g.Command({name:"Open",
id:"eclipse.openGitCommit",hrefCallback:function(o){return"/edit/edit.html#"+o.ContentLocation},visibleWhen:function(o){return o.Type==="Commit"&&o.ContentLocation!=null&&!h.isDirectory}});j.addCommand(l,"object");l=new g.Command({name:"Fetch",image:"/git/images/fetch.gif",id:"eclipse.orion.git.fetch",callback:function(o){var r=o.Location;d.getDefaultSshOptions(i).then(function(u){var s=arguments.callee;i.getService("orion.git.provider").then(function(q){i.getService("orion.page.message").then(function(v){var y=
q.doFetch(r,null,u.gitSshUsername,u.gitSshPassword,u.knownHosts,u.gitPrivateKey,u.gitPassphrase);v.showWhile(y,"Fetching remote: "+r).then(function(x){d.handleProgressServiceResponse(x,u,i,function(){c.xhrGet({url:r,headers:{"Orion-Version":"1"},postData:c.toJson({GitSshUsername:u.gitSshUsername,GitSshPassword:u.gitSshPassword,GitSshPrivateKey:u.gitPrivateKey,GitSshPassphrase:u.gitPassphrase,GitSshKnownHost:u.knownHosts}),handleAs:"json",timeout:5E3,load:function(k){return k},error:function(k,m){console.error("HTTP status code: ",
m.xhr.status);return k}}).then(function(k){h.parentId==="explorer-tree"&&q.getLog(k.HeadLocation,k.Id,function(m){h.renderer.setIncomingCommits(m);h.loadCommitsList(k.CommitLocation+"?page=1",k,true)})},e)},s,"Fetch Git Repository")})})})})},visibleWhen:function(o){return o.Type==="RemoteTrackingBranch"||o.Type==="Remote"}});j.addCommand(l,"dom");j.addCommand(l,"object");l=new g.Command({name:"Merge",image:"/git/images/merge.gif",id:"eclipse.orion.git.merge",callback:function(o){i.getService("orion.git.provider").then(function(r){r.doMerge(o.HeadLocation,
o.Name).then(function(u){i.getService("orion.page.message").then(function(s){var q=[];if(u.jsonData&&(u.jsonData.Result=="FAST_FORWARD"||u.jsonData.Result=="ALREADY_UP_TO_DATE")){c.query(".treeTableRow").forEach(function(x){c.toggleClass(x,"incomingCommitsdRow",false)});q.Severity="Ok";q.HTML=false;q.Message=u.jsonData.Result}else if(u.jsonData){var v=o.HeadLocation.replace("commit/HEAD","status");q.Severity="Warning";q.HTML=true;q.Message="<span>"+u.jsonData.Result+'. Go to <a href="/git/git-status.html#'+
v+'">Git Status page</a>.<span>'}else if(u.error){q.Severity="Error";if(u.error.responseText&&JSON.parse(u.error.responseText)){var y=JSON.parse(u.error.responseText);q.Message=y.DetailedMessage?y.DetailedMessage:y.Message}else q.Message=u.error.message;q.HTML=true;q.Message="<span>"+q.Message+' Go to <a href="/git/git-status.html#'+v+'">Git Status page</a>.<span>'}s.setProgressResult(q)})},function(u){i.getService("orion.page.message").then(function(s){var q=[],v=o.HeadLocation.replace("commit/HEAD",
"status");q.Severity="Error";q.HTML=true;q.Message="<span>"+c.fromJson(u.ioArgs.xhr.responseText).DetailedMessage+'. Go to <a href="/git/git-status.html#'+v+'">Git Status page</a>.<span>';s.setProgressResult(q)})})})},visibleWhen:function(o){return o.Type==="RemoteTrackingBranch"||o.Type==="Branch"&&!o.Current}});j.addCommand(l,"dom");j.addCommand(l,"object");l=new g.Command({name:"Push All",image:"/git/images/push.gif",id:"eclipse.orion.git.push",callback:function(o){var r=c.hash();d.getDefaultSshOptions(i).then(function(u){var s=
arguments.callee;i.getService("orion.git.provider").then(function(q){i.getService("orion.page.message").then(function(v){var y=q.doPush(o.RemoteLocation,"HEAD",null,u.gitSshUsername,u.gitSshPassword,u.knownHosts,u.gitPrivateKey,u.gitPassphrase);v.showWhile(y,"Pushing remote: "+r).then(function(x){d.handleProgressServiceResponse(x,u,i,function(k){k.Result.Severity=="Ok"&&c.query(".treeTableRow").forEach(function(m){c.toggleClass(m,"outgoingCommitsdRow",false)})},s,"Push Git Repository")})})})})},visibleWhen:function(o){return o.toRef?
o.RepositoryPath===""&&o.toRef.Type==="Branch"&&o.toRef.Current&&o.toRef.RemoteLocation:o.Type==="Branch"&&o.Current&&o.RemoteLocation}});j.addCommand(l,"dom");j.addCommand(l,"object");l=new g.Command({name:"Switch to Remote",id:"eclipse.orion.git.switchToRemote",hrefCallback:function(o){return"/git/git-log.html#"+o.toRef.RemoteLocation+"?page=1"},visibleWhen:function(o){return o.toRef!=null&&o.toRef.Type==="Branch"&&o.toRef.Current&&o.toRef.RemoteLocation}});j.addCommand(l,"dom");l=new g.Command({name:"Switch to Current Local",
id:"eclipse.orion.git.switchToCurrentLocal",hrefCallback:function(o){var r=new c.Deferred,u=o.CloneLocation;if(u==null)u=JSON.parse(o.responseText).ErrorData.CloneLocation;c.xhrGet({url:u,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(s){c.xhrGet({url:s.Children[0].BranchLocation,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(q){c.forEach(q.Children,function(v){v.Current==true&&r.callback("/git/git-log.html#"+v.CommitLocation+"?page=1")})}})}});return r},
visibleWhen:function(o){if(o.Type==="RemoteTrackingBranch")return true;try{if(JSON.parse(o.responseText).ErrorData)return true}catch(r){}return false}});j.addCommand(l,"dom");l=new g.Command({name:"Push to...",image:"/git/images/push.gif",id:"eclipse.orion.git.pushto",callback:function(o){var r={};for(var u in o.parent.parent.children)if(o.parent.parent.children[u].Name==="Remote")r=o.parent.parent.children[u];i.getService("orion.git.provider").then(function(s){s=new orion.git.widgets.RemotePrompterDialog({title:"Choose Branch",
serviceRegistry:i,gitClient:s,treeRoot:r,func:c.hitch(this,function(q,v,y){console.info("Branch "+q+" remote "+v+" new branch "+y)})});s.startup();s.show()})},visibleWhen:function(){return false}});j.addCommand(l,"dom");j.addCommand(l,"object");l=new g.Command({name:"Reset Index",image:"/git/images/refresh.gif",id:"eclipse.orion.git.resetIndex",callback:function(o){confirm("The content of your active branch witll be replaced with "+o.Name+". Are you sure?")&&i.getService("orion.git.provider").then(function(r){r.resetIndex(o.IndexLocation,
o.Name).then(function(){i.getService("orion.page.message").then(function(u){var s=[];s.Severity="Info";s.HTML=false;s.Message="Ok";u.setProgressResult(s)})},function(u){i.getService("orion.page.message").then(function(s){var q=[];q.Severity="Error";q.HTML=false;q.Message=u.message;s.setProgressResult(q)})})})},visibleWhen:function(o){return o.Type==="RemoteTrackingBranch"}});j.addCommand(l,"object");l=new g.Command({name:"Tag",image:"/git/images/tag.gif",id:"eclipse.orion.git.addTag",callback:function(o,
r,u){var s=new c.Deferred;d.getNewItemName(o,h,false,u,"Tag name",function(q){if(!(!q||q==="")){i.getService("orion.git.provider").then(function(v){v.doAddTag(o.Location,q,function(y){y=y.Location.replace(/[^\.\:\-\_0-9A-Za-z]/g,"");y=c.byId(y);c.place(document.createTextNode(q),c.create("p",{style:"margin: 5px"},y.children[5],"last"),"only")})});return s}},4)},visibleWhen:function(o){return o.Type==="Commit"}});j.addCommand(l,"object")};d.createStatusCommands=function(i,j,h,l,o,r){o=new g.Command({name:"Fetch latest commits",
tooltip:"Fetch latest commits",image:"/git/images/fetch.gif",id:"eclipse.orion.git.fetch",callback:function(u){var s=u.Location;d.getDefaultSshOptions(i).then(function(q){var v=arguments.callee;i.getService("orion.git.provider").then(function(y){i.getService("orion.page.message").then(function(x){var k=y.doFetch(s,null,q.gitSshUsername,q.gitSshPassword,q.knownHosts,q.gitPrivateKey,q.gitPassphrase);x.showWhile(k,"Fetching remote: "+s).then(function(m){d.handleProgressServiceResponse(m,q,i,function(){c.xhrGet({url:s,
headers:{"Orion-Version":"1"},postData:c.toJson({GitSshUsername:q.gitSshUsername,GitSshPassword:q.gitSshPassword,GitSshPrivateKey:q.gitPrivateKey,GitSshPassphrase:q.gitPassphrase,GitSshKnownHost:q.knownHosts}),handleAs:"json",timeout:5E3,load:function(n){return n},error:function(n,p){console.error("HTTP status code: ",p.xhr.status)}}).then(function(n){y.getLog(n.HeadLocation,n.Id,function(p){r.renderer.setIncomingCommits(p);r.loadCommitsList(n.CommitLocation+"?page=1&pageSize=5",n,true)})})},v,"Fetch Git Repository")})})})})},
visibleWhen:function(u){return u.Type==="RemoteTrackingBranch"||u.Type==="Remote"}});j.addCommand(o,"object");j.registerCommandContribution("eclipse.orion.git.fetch",l+1);o=new g.Command({name:"Merge into local",image:"/git/images/merge.gif",id:"eclipse.orion.git.merge",callback:function(u){i.getService("orion.git.provider").then(function(s){s.doMerge(u.HeadLocation,u.Name).then(function(q){i.getService("orion.page.message").then(function(v){var y=[];if(q.jsonData&&(q.jsonData.Result=="FAST_FORWARD"||
q.jsonData.Result=="ALREADY_UP_TO_DATE")){c.query(".treeTableRow").forEach(function(m){c.toggleClass(m,"incomingCommitsdRow",false)});y.Severity="Ok";y.HTML=false;y.Message=q.jsonData.Result}else if(q.jsonData){var x=u.HeadLocation.replace("commit/HEAD","status");y.Severity="Warning";y.HTML=true;y.Message="<span>"+q.jsonData.Result+'. Go to <a href="/git/git-status.html#'+x+'">Git Status page</a>.<span>'}else if(q.error){y.Severity="Error";if(q.error.responseText&&JSON.parse(q.error.responseText)){var k=
JSON.parse(q.error.responseText);y.Message=k.DetailedMessage?k.DetailedMessage:k.Message}else y.Message=q.error.message;y.HTML=true;y.Message="<span>"+y.Message+' Go to <a href="/git/git-status.html#'+x+'">Git Status page</a>.<span>'}v.setProgressResult(y);h()})},function(q){i.getService("orion.page.message").then(function(v){var y=[],x=u.HeadLocation.replace("commit/HEAD","status");y.Severity="Error";y.HTML=true;y.Message="<span>"+c.fromJson(q.ioArgs.xhr.responseText).DetailedMessage+'. Go to <a href="/git/git-status.html#'+
x+'">Git Status page</a>.<span>';v.setProgressResult(y)})})})},visibleWhen:function(u){return u.Type==="RemoteTrackingBranch"||u.Type==="Branch"&&!u.Current}});j.addCommand(o,"object");j.registerCommandContribution("eclipse.orion.git.merge",l+2);o=new g.Command({name:"Push into remote",image:"/git/images/push.gif",id:"eclipse.orion.git.push",callback:function(u){var s=c.hash();d.getDefaultSshOptions(i).then(function(q){var v=arguments.callee;i.getService("orion.git.provider").then(function(y){i.getService("orion.page.message").then(function(x){var k=
y.doPush(u.RemoteLocation,"HEAD",null,q.gitSshUsername,q.gitSshPassword,q.knownHosts,q.gitPrivateKey,q.gitPassphrase);x.showWhile(k,"Pushing remote: "+s).then(function(m){d.handleProgressServiceResponse(m,q,i,function(n){if(n.Result.Severity=="Ok"){c.query(".treeTableRow").forEach(function(p){c.toggleClass(p,"outgoingCommitsdRow",false)});h()}},v,"Push Git Repository")})})})})},visibleWhen:function(u){return u.Type==="LocalBranch"}});j.addCommand(o,"object");j.registerCommandContribution("eclipse.orion.git.push",
l+3)};d.createGitClonesCommands=function(i,j,h,l,o,r){l=new g.Command({name:"Clone Repository",tooltip:"Clone Git Repository",id:"eclipse.cloneGitRepository",callback:function(){var u=new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:i,fileClient:r,func:function(s,q,v){d.getDefaultSshOptions(i).then(function(y){var x=arguments.callee;i.getService("orion.git.provider").then(function(k){i.getService("orion.page.message").then(function(m){var n=k.cloneGitRepository(v,s,q,h.defaultPath,
y.gitSshUsername,y.gitSshPassword,y.knownHosts,y.gitPrivateKey,y.gitPassphrase);m.showWhile(n,"Cloning repository: "+s).then(function(p){d.handleProgressServiceResponse(p,y,i,function(){h.redisplayClonesList&&c.hitch(h,h.redisplayClonesList)()},x,"Clone Git Repository")})})})})}});u.startup();u.show()},visibleWhen:function(){return true}});j.addCommand(l,"dom");l=new g.Command({name:"Init Repository",tooltip:"Init Git Repository in Workspace",id:"eclipse.initGitRepository",callback:function(){var u=
new orion.git.widgets.CloneGitRepositoryDialog({serviceRegistry:i,title:"Init Repository",fileClient:r,advancedOnly:true,func:function(s,q,v){d.getDefaultSshOptions(i).then(function(){i.getService("orion.git.provider").then(function(y){y.cloneGitRepository(v,s,q,h.defaultPath).then(function(){h.redisplayClonesList&&c.hitch(h,h.redisplayClonesList)()},e)})})}});u.startup();u.show()},visibleWhen:function(){return true}});j.addCommand(l,"dom");l=new g.Command({name:"Delete Clone",image:"/images/delete.gif",
id:"eclipse.git.deleteClone",visibleWhen:function(u){u=c.isArray(u)?u:[u];if(u.length===0)return false;for(var s=0;s<u.length;s++)if(!u[s].ContentLocation)return false;return true},callback:function(u){if(c.isArray(u)){if(confirm("Are you sure you want do delete "+u.length+" repositories?"))for(var s=0,q=0;q<u.length;q++)i.getService("orion.git.provider").then(function(v){v.removeGitRepository(u[q].Location).then(function(){s++;s>=u.length&&h.redisplayClonesList&&c.hitch(h,h.redisplayClonesList)()},
e)})}else confirm("Are you sure you want to delete "+u.Name+"?")&&i.getService("orion.git.provider").then(function(v){v.removeGitRepository(u.Location).then(function(){h.redisplayClonesList&&c.hitch(h,h.redisplayClonesList)()},e)})}});j.addCommand(l,"object");j.addCommand(l,"dom")}})();return d});
define("orion/git/git-commit-navigator",["dojo","orion/explorer","orion/util","orion/git/gitCommands"],function(c,g,a,d){var e={};e.GitCommitNavigator=function(){function f(i,j,h,l,o,r,u,s){this.registry=i;this.selection=j;this.checkbox=l!=null?l.checkbox:true;this.minimal=l!=null?l.minimal:false;this.parentId=o;this.pageTitleId=r;this.toolbarId=u;this.selectionToolsId=s;this.isDirectory=true;this.myTree=this.model=null;this.commitDetails=h;this.renderer=new e.GitCommitRenderer({checkbox:this.checkbox,
cachePrefix:"GitCommitsNavigator",minimal:this.minimal},this);this.commitDetails&&this.commitDetails.render(null)}f.prototype=new g.Explorer;f.prototype.loadCommitsList=function(i,j,h){i=a.makeRelative(i);if(!(i===this._lastHash&&!h)){this._lastHash=i;this._lastTreeRoot=j;var l=c.byId(this.parentId);(h=c.byId(l.id+"progress"))||(h=c.create("div",{id:l.id+"progress"},l,"only"));c.empty(h);if(j.status&&j.status!=200){l=j.message;try{var o=JSON.parse(j.responseText);if(o.Message)l=o.Message}catch(r){}j.status!=
404&&l!==""&&c.create("b",{innerHTML:"Error "+j.status+": "},h,"only");c.place(document.createTextNode(l),h,"last");this.toolbarId&&this.selectionToolsId&&d.updateNavTools(this.registry,this,this.toolbarId,this.selectionToolsId,j)}else{b=c.create("b");c.place(document.createTextNode("Loading "),h,"last");c.place(document.createTextNode(i),b,"last");c.place(b,h,"last");c.place(document.createTextNode("..."),h,"last");var u=this;this.toolbarId&&this.selectionToolsId&&d.updateNavTools(this.registry,
this,this.toolbarId,this.selectionToolsId,j);this.registry.getService("orion.git.provider").then(function(s){c.hitch(u,u.createTree(u.parentId,new g.ExplorerFlatModel(i,s.doGitLog)))})}}};f.prototype.loadCommitDetails=function(i){this.commitDetails&&this.commitDetails.loadCommitDetails(i)};return f}();e.GitCommitRenderer=function(){function f(i,j){this._init(i);this.options=i;this.explorer=j}f.prototype=g.SelectionRenderer.prototype;f.prototype.getCellHeaderElement=function(i){if(!this.options.minimal)switch(i){case 0:return c.create("th",
{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Message</h2>"});case 1:return c.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Author</h2>"});case 2:return c.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Date</h2>"});case 3:return c.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Actions</h2>"});case 4:return c.create("th",{style:"padding-left: 5px; padding-right: 5px",innerHTML:"<h2>Tags</h2>"})}};f.prototype.setIncomingCommits=
function(i){this.incomingCommits=i};f.prototype.setOutgoingCommits=function(i){this.outgoingCommits=i};f.prototype.getCellElement=function(i,j,h){var l=false;c.forEach(this.incomingCommits,function(q){if(j.Name===q.Name)l=true});var o=false;c.forEach(this.outgoingCommits,function(q){if(j.Name===q.Name)o=true});switch(i){case 0:var r,u;i=document.createElement("td");r=c.create("div",{style:"margin-left: 5px; margin-right: 5px; margin-top: 5px; margin-bottom: 5px; padding-left: 20px;"},i,"only");u=
c.create("a",{className:"navlinkonpage"},r,"last");if(this.explorer.commitDetails){c.connect(u,"onclick",u,c.hitch(this,function(){this.explorer.loadCommitDetails(j)}));c.connect(u,"onmouseover",u,function(){u.style.cursor="pointer"});c.connect(u,"onmouseout",u,function(){u.style.cursor="default"})}c.place(document.createTextNode(j.Message),u,"only");if(l)c.toggleClass(h,"incomingCommitsdRow",true);else o&&c.toggleClass(h,"outgoingCommitsdRow",true);return i;case 1:return c.create("td",{style:"padding-left: 5px; padding-right: 5px",
innerHTML:j.AuthorName+" ("+j.AuthorEmail+")"});case 2:return c.create("td",{style:"padding-left: 5px; padding-right: 5px",innerHTML:c.date.locale.format(new Date(j.Time),{formatLength:"short"})});case 3:if(this.options.minimal)break;h=this.getActionsColumn(j,h);c.style(h,"padding-left","5px");c.style(h,"padding-right","5px");return h;case 4:if(this.options.minimal)break;var s=document.createElement("td",{style:"padding-left: 5px; padding-right: 5px"});c.forEach(j.Children,function(q){c.place(document.createTextNode(q.Name),
c.create("p",{style:"margin: 5px"},s,"last"),"only")});return s}};return f}();return e});
define("orion/git/git-status-table",["dojo","orion/compare/diff-provider","orion/compare/compare-container","orion/commands","orion/git/git-commit-navigator","orion/git/gitCommands","dijit/layout/ContentPane"],function(c,g,a,d,e,f){var i=i||{};i.GitStatusModel=function(){function j(){this.selectedItem=this.selectedFileId=undefined;this.interestedUnstagedGroup=["Missing","Modified","Untracked","Conflicting"];this.interestedStagedGroup=["Added","Changed","Removed"];this.conflictPatterns=[["Both","Modified",
"Added","Changed","Missing"],["RemoteDelete","Untracked","Removed"],["LocalDelete","Modified","Added","Missing"]];this.conflictType="Conflicting"}j.prototype={destroy:function(){},interestedCategory:function(){},init:function(h){this.items=h},getModelType:function(h,l){return l},_markConflict:function(h){var l=this.getGroupData(h[1]);if(l)for(var o=0;o<l.length;o++)if(!l[o].Conflicting){for(var r=l[o].Location,u=[],s=2;s<h.length;s++){var q=this.getGroupData(h[s]);if(q)(q=this._findSameFile(r,q))&&
u.push(q)}if(u.length===h.length-2){l[o].Conflicting=h[0];for(r=0;r<u.length;r++)u[r].Conflicting="Hide"}}},_findSameFile:function(h,l){for(var o=0;o<l.length;o++)if(!l[o].Conflicting)if(h===l[o].Location)return l[o]},getGroupData:function(h){return this.items[h]},isConflict:function(h){return h===this.conflictType},isStaged:function(h){for(var l=0;l<this.interestedStagedGroup.length;l++)if(h===this.interestedStagedGroup[l])return true;return false}};return j}();i.statusTypeMap={Missing:["/git/images/removal.gif",
"Unstaged removal","/git/images/stage.gif","Stage"],Removed:["/git/images/removal.gif","Staged removal","/git/images/unstage.gif","Unstage"],Modified:["/git/images/modification.gif","Unstaged change","/git/images/stage.gif","Stage"],Changed:["/git/images/modification.gif","Staged change","/git/images/unstage.gif","Untage"],Untracked:["/git/images/addition.gif","Unstaged add","/git/images/stage.gif","Stage"],Added:["/git/images/addition.gif","Staged add","/git/images/unstage.gif","Unstage"],Conflicting:["/git/images/conflict-file.gif",
"Conflicting","/git/images/stage.gif","Resolve Conflict"]};i.GitStatusContentRenderer=function(){function j(h,l,o){this._registry=h;this._tableParentDivId=l;this._controller=o}j.prototype={initTable:function(){tableId=this._tableParentDivId+"_table";var h=c.byId(this._tableParentDivId);c.place(document.createTextNode(""),h,"only");var l=document.createElement("table");l.id=tableId;l.width="100%";h.appendChild(l);this._table=l},renderRow:function(h){var l=this,o=document.createElement("tr");o.id=h.name+
"_"+h.type+"_row";o._item=h;this._table.appendChild(o);var r=document.createElement("td"),u=document.createElement("img");u.src=i.statusTypeMap[h.type][0];r.appendChild(u);o.appendChild(r);r=document.createElement("td");r.width="100%";r.noWrap=true;o.appendChild(r);var s=document.createElement("span");s.id=h.name+"_"+h.type+"_nameSpan";c.place(document.createTextNode(h.name),s,"only");s.style.color="#0000FF";s.title="Click to compare";r.appendChild(s);if(s.id===l._controller._model.selectedFileId){l._controller._model.selectedItem=
h;c.toggleClass(s,"fileNameSelectedRow",true)}c.connect(s,"onmouseover",s,function(){s.style.cursor=l._controller.loading?"wait":"pointer";c.toggleClass(s,"fileNameCheckedRow",true)});c.connect(s,"onmouseout",s,function(){s.style.cursor=l._controller.loading?"wait":"default";c.toggleClass(s,"fileNameCheckedRow",false)});c.connect(s,"onclick",s,function(){if(h.name!==l._controller._model.selectedFileId){if(l._controller._model.selectedFileId!==undefined){var v=document.getElementById(l._controller._model.selectedFileId);
v&&c.toggleClass(v,"fileNameSelectedRow",false)}c.toggleClass(s,"fileNameSelectedRow",true);l._controller._model.selectedFileId=s.id;l._controller.loadDiffContent(h)}});r=c.create("td",{id:o.id+"actions",style:"padding-left: 5px"},o,"last");r.noWrap=true;var q=c.create("span",{id:o.id+"actionsWrapper"},r,"only");c.style(q,"visibility","hidden");this._registry.getService("orion.page.command").then(function(v){v.renderCommands(q,"object",{type:"fileItem",object:h},this,"image",null)});c.connect(o,"onmouseover",
o,function(){var v=c.byId(this.id+"actionsWrapper");c.style(v,"visibility","visible")});c.connect(o,"onmouseout",o,function(){var v=c.byId(this.id+"actionsWrapper");c.style(v,"visibility","hidden")});if(this._controller._model.isStaged(h.type))this._controller.hasStaged=true;else this._controller.hasUnstaged=true}};return j}();i.GitStatusTableRenderer=function(){function j(h,l,o,r){this._registry=h;this._parentId=l;this._header=o;this._type=r}j.prototype={render:function(h){var l=c.create("table",
{width:"100%"},this._parentId);l=c.create("tr",null,l);var o=c.create("td",{width:"50%",height:"100%"},l,"last");c.create("h2",{innerHTML:this._header},o,"last");l=c.create("td",{width:"50%",height:"100%",nowrap:true},l,"last");l=c.create("div",{style:"float: right;",align:"right"},l,"last");this._cmdSpan=c.create("span",null,l,"last");c.create("hr",null,this._parentId);this._statusContentId=this._parentId+"_"+this._type;c.create("div",{id:this._statusContentId},this._parentId,"last");h&&c.create("table",
{width:"100%",height:"10px"},this._parentId)},getStatusContentId:function(){return this._statusContentId},renderAction:function(){c.place(document.createTextNode(""),this._cmdSpan,"only");var h=this;this._registry.getService("orion.page.command").then(function(l){l.renderCommands(h._cmdSpan,"object",{type:h._type},this,"image",null)})}};return j}();i.GitCommitZoneRenderer=function(){function j(h,l){this._registry=h;this._parentId=l}j.prototype={render:function(h){var l=c.create("table",{width:"100%"},
this._parentId);l=c.create("tr",null,l);l=c.create("td",{nowrap:true},l,"last");c.create("h2",{innerHTML:"Commit message:"},l,"last");l=c.create("table",null,this._parentId);l=c.create("tr",null,l);var o=c.create("td",{nowrap:true},l,"last");c.create("textarea",{id:"commitMessage",COLS:40,ROWS:6},o,"last");l=c.create("td",{nowrap:true},l,"last");l=c.create("div",{style:"float: left;",align:"left"},l,"last");l=c.create("table",null,l);o=c.create("tr",null,l);o=c.create("td",{nowrap:true},o,"last");
c.create("button",{id:"commit",innerHTML:"Commit"},o,"last");c.create("tr",{width:"100%",height:"20px"},l);l=c.create("tr",null,l);l=c.create("td",{nowrap:true},l,"last");c.create("input",{id:"amend",type:"checkbox",value:"Amend"},l,"last");l.appendChild(document.createTextNode(" Amend"));h&&c.create("table",{width:"100%",height:"10px"},this._parentId)}};return j}();i.GitLogTableRenderer=function(){function j(h,l,o,r,u){this._controller=h;this._registry=l;this._parentId=o;this._header=r;this._type=
u;this._sectionId=this._parentId+"_"+this._type+"_section"}j.prototype={render:function(h){c.create("div",{id:this._sectionId},this._parentId);var l=c.create("table",null,this._sectionId);l=c.create("tr",null,l);var o=c.create("td",null,l,"last");c.create("h2",{id:this._type+"_header",innerHTML:this._header},o,"last");o=c.create("td",null,l,"last");this._cmdSpanAdditional=c.create("span",{style:"margin-left: 5px;"},o,"last");l=c.create("td",null,l,"last");this._cmdSpan=c.create("span",{style:"margin-left: 5px;"},
l,"last");c.create("hr",null,this._sectionId);this._logContentId=this._parentId+"_"+this._type+"_content";c.create("div",{id:this._logContentId,style:"margin-left: 5px; margin-right: 5px; width: 99%; overflow: false"},this._sectionId,"last");h&&c.create("table",{width:"100%",height:"10px"},this._sectionId)},getLogContentId:function(){return this._logContentId},getLogSectionId:function(){return this._sectionId},modifyHeader:function(h){c.place(document.createTextNode("Recent commits on "+h),this._type+
"_header","only")},renderAction:function(){c.place(document.createTextNode(""),this._cmdSpan,"only");var h=this;this._registry.getService("orion.page.command").then(function(l){l.renderCommands(h._cmdSpan,"object",{type:h._type,object:h._controller},this,"image",null,null,true)})},renderAdditionalAction:function(h){c.place(document.createTextNode(""),this._cmdSpanAdditional,"only");var l=this;this._registry.getService("orion.page.command").then(function(o){o.renderCommands(l._cmdSpanAdditional,"object",
h,this,"image",null,null)})}};return j}();i.InlineCompareRenderer=function(){function j(h,l){this._registry=h;this._parentId=l}j.prototype={render:function(){var h=c.create("table",{width:"100%"}),l=c.create("tr",null,h);l=c.create("td",{nowrap:true},l,"last");c.create("h2",{id:"fileNameInViewer",innerHTML:"Select a file on the left to compare..."},l,"last");l=new dijit.layout.ContentPane({region:"top",style:"width:100%;height:30px;overflow: hidden;"});l.attr("content",h);h=new dijit.layout.ContentPane({"class":"mainpane",
id:"inline-compare-viewer",splitter:false,region:"center",style:"width:100%;height:100%;overflow: hidden;"});c.addClass(h,"mainpane");var o=dijit.byId(this._parentId);o.addChild(l);o.addChild(h)}};return j}();i.GitStatusController=function(){function j(h,l,o){this._registry=l;this._statusService=o;this._model=new i.GitStatusModel;this._timerOn=false;this._renderLog=h.renderLog?true:false;this._generateCommands();this._unstagedTableRenderer=new i.GitStatusTableRenderer(l,"statusZone","Unstaged","unstagedItems");
this._unstagedTableRenderer.render(true);this._stagedTableRenderer=new i.GitStatusTableRenderer(l,"statusZone","Staged","stagedItems");this._stagedTableRenderer.render();this._commitZoneRenderer=new i.GitCommitZoneRenderer(l,"statusZone");this._commitZoneRenderer.render(true);if(this._renderLog){this._logTableRenderer=new i.GitLogTableRenderer(this,l,"logZone","Recent commits on","gitLog");this._logTableRenderer.render(true);this._remoteTableRenderer=new i.GitLogTableRenderer(this,l,"logZone","Recent commits on",
"gitRemote");this._remoteTableRenderer.render(true)}(new i.InlineCompareRenderer(l,"viewerZone")).render();this._unstagedContentRenderer=new i.GitStatusContentRenderer(l,this._unstagedTableRenderer.getStatusContentId(),this);this._stagedContentRenderer=new i.GitStatusContentRenderer(l,this._stagedTableRenderer.getStatusContentId(),this);this._inlineCompareContainer=new a.InlineCompareContainer(new g.DiffProvider(l),l,"inline-compare-viewer");var r=this;r._stagingConflict=false;document.getElementById("commit").onclick=
function(){r.commit()}}j.prototype={loadStatus:function(h){this._model.init(h);this._getCloneInfo()},_processStatus:function(){this.initViewer();this._model.selectedFileId=null;this._loadBlock(this._unstagedContentRenderer,this._model.interestedUnstagedGroup);this._loadBlock(this._stagedContentRenderer,this._model.interestedStagedGroup);if(this._renderLog&&this._initializing){this._renderLogs(false);this._renderLogs(true);var h=this;this._registry.getService("orion.page.command").then(function(u){f.createStatusCommands(h._registry,
u,function(){h.getGitStatus(h._url,true)},9,h._gitCommitNavigatorLog,h._gitCommitNavigatorRem)})}this._unstagedTableRenderer.renderAction();this._stagedTableRenderer.renderAction();if(this._renderLog){this._logTableRenderer.renderAction();this._remoteTableRenderer.renderAction()}this._renderGlobalActions();var l=document.getElementById("commitMessage");l.disabled=!this.hasStaged;var o=document.getElementById("commit"),r=document.getElementById("amend");o.disabled=!this.hasStaged;r.disabled=!this.hasStaged;
r.checked=false;l.value="";this.hasStaged?this.startTimer():this.stopTimer();if(this._stagingConflict){this._stagingConflict=false;this.hasStaged||this.commit("Resolved deletion conflicts on file "+this._stagingName,false)}this._statusService.setProgressMessage("")},_renderGlobalActions:function(){var h=c.byId("pageActions");c.place(document.createTextNode(""),h,"only");this._registry.getService("orion.page.command").then(function(l){l.renderCommands(h,"dom",{type:"global"},this,"image",null,null,
true)})},_processCloneInfo:function(){c.byId("logZone").style.display="block";this._curBranch=undefined;for(var h=0;h<this._branchInfo.Children.length;h++)if(this._branchInfo.Children[h].Current)this._curBranch=this._branchInfo.Children[h];this._curRemote=this._remoteInfo&&this._remoteInfo.Children&&this._remoteInfo.Children.length>0?this._remoteInfo.Children[0]:null;this._curClone=this._cloneInfo.Children[0];this._initTitleBar(true);var l=this,o=new d.Command({name:"Complete log",id:"orion.openGitLog",
hrefCallback:function(){return"/git/git-log.html#"+(l._curBranch?l._curBranch.CommitLocation:l._model.items.CommitLocation)+"?page=1"},visibleWhen:function(u){return u.type==="gitLog"}}),r=new d.Command({name:"Complete log",id:"orion.openGitRemote",hrefCallback:function(){return"/git/git-log.html#"+l._curBranch.RemoteLocation+"?page=1"},visibleWhen:function(u){return u.type==="gitRemote"&&l._curBranch}});this._registry.getService("orion.page.command").then(function(u){u.addCommand(o,"object");u.addCommand(r,
"object");u.registerCommandContribution("orion.openGitLog",8);u.registerCommandContribution("orion.openGitRemote",9)})},_initTitleBar:function(h){var l="";if(h)l=this._curClone.Name+" on "+(this._curBranch?this._curBranch.Name:"detached");document.title=l;c.place(document.createTextNode("Git Status"),"pageTitle","only");c.place(document.createTextNode(l),"location","only");if(h){this._logTableRenderer.modifyHeader(this._curBranch?this._curBranch.Name:"detached");if(this._curBranch&&this._curRemote)this._remoteTableRenderer.modifyHeader((this._curRemote?
this._curRemote.Name:"")+"/"+this._curBranch.Name)}},_getCloneInfo:function(){var h=this;if(h._initializing){var l=h._model.items.CloneLocation;h._registry.getService("orion.git.provider").then(function(o){o.getGitClone(l,function(r){h._cloneInfo=r;if(h._cloneInfo.Children.length===0){h._renderLog=false;h._initTitleBar();h._processStatus()}else h._registry.getService("orion.git.provider").then(function(u){u.getGitBranch(h._cloneInfo.Children[0].BranchLocation).then(function(s){h._branchInfo=s;u.getGitRemote(h._cloneInfo.Children[0].RemoteLocation).then(function(q){h._remoteInfo=
q;h._processCloneInfo();h._processStatus()})})})})})}else h._processStatus()},_renderLogs:function(h){var l=this;if(this._renderLog)if(h)if(!this._curRemote||!this._curBranch)c.empty(this._remoteTableRenderer.getLogSectionId());else{this._gitCommitNavigatorRem=new e.GitCommitNavigator(this._registry,null,null,{checkbox:false,minimal:true},this._remoteTableRenderer.getLogContentId());c.place(document.createTextNode(""),this._remoteTableRenderer.getLogContentId(),"only");var o=this._curBranch.RemoteLocation+
"?page=1&pageSize=5";c.xhrGet({url:o,headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(r){l._registry.getService("orion.git.provider").then(function(u){u.getLog(r.HeadLocation,r.Id,function(s){l._gitCommitNavigatorRem.renderer.setIncomingCommits(s);l._gitCommitNavigatorRem.loadCommitsList(r.CommitLocation+"?page=1&pageSize=5",r);l._remoteTableRenderer.renderAdditionalAction(l._gitCommitNavigatorRem._lastTreeRoot)})})},error:function(r,u){u.xhr.status==401||u.xhr.status==403?
mAuth.handleGetAuthenticationError(this,u):l._gitCommitNavigatorRem.loadCommitsList(o,r);console.error("HTTP status code: ",u.xhr.status)}})}else{this._gitCommitNavigatorLog=new e.GitCommitNavigator(this._registry,null,null,{checkbox:false,minimal:true},this._logTableRenderer.getLogContentId());c.place(document.createTextNode(""),this._logTableRenderer.getLogContentId(),"only");o=(l._curBranch?l._curBranch.CommitLocation:l._model.items.CommitLocation)+"?page=1&pageSize=5";c.xhrGet({url:o,headers:{"Orion-Version":"1"},
handleAs:"json",timeout:5E3,load:function(r){return r},error:function(r,u){console.error("HTTP status code: ",u.xhr.status)}}).then(function(r){if(r.RemoteLocation==null||!l._curBranch){l._gitCommitNavigatorLog.loadCommitsList((l._curBranch?l._curBranch.CommitLocation:l._model.items.CommitLocation)+"?page=1&pageSize=5",{Type:"LocalBranch",RemoteLocation:r.RemoteLocation});l._curRemote&&l._curBranch&&l._logTableRenderer.renderAdditionalAction(l._gitCommitNavigatorLog._lastTreeRoot)}else c.xhrGet({url:r.RemoteLocation,
headers:{"Orion-Version":"1"},handleAs:"json",timeout:5E3,load:function(u){l._registry.getService("orion.git.provider").then(function(s){s.getLog(u.CommitLocation,"HEAD",function(q){l._gitCommitNavigatorLog.renderer.setOutgoingCommits(q);l._gitCommitNavigatorLog.loadCommitsList(l._curBranch.CommitLocation+"?page=1&pageSize=5",{Type:"LocalBranch",RemoteLocation:r.RemoteLocation});l._curRemote&&l._logTableRenderer.renderAdditionalAction(l._gitCommitNavigatorLog._lastTreeRoot)})})},error:function(u,
s){console.error("HTTP status code: ",s.xhr.status);if(s.xhr.status==401||s.xhr.status==403)mAuth.handleGetAuthenticationError(this,s);else{l._gitCommitNavigatorLog.loadCommitsList(o,{Type:"LocalBranch",RemoteLocation:r.RemoteLocation});l._curRemote&&l._curBranch&&l._logTableRenderer.renderAdditionalAction(l._gitCommitNavigatorLog._lastTreeRoot)}}})})}},_generateCommands:function(){var h=this,l=new d.Command({name:"Side by side compare",tooltip:"Side by side compare",image:"/git/images/open_compare.gif",
id:"orion.sbsCompare",hrefCallback:function(y){return h.openCompareEditor(y.object)},visibleWhen:function(y){return y.type==="fileItem"}}),o=new d.Command({name:"checkout",tooltip:"checkout",image:"/git/images/checkout.gif",id:"orion.gitCheckout",callback:function(y){h._registry.getService("orion.page.dialog").then(function(x){x.confirm("Your changes to the file will be lost. Are you sure you want to checkout?",function(k){if(k){h._statusService.setProgressMessage("Checking out...");h.checkout(y.object)}})})},
visibleWhen:function(y){return y.type==="fileItem"&&!h._model.isStaged(y.object.type)}}),r=new d.Command({name:"stage",tooltip:"stage",image:"/git/images/stage.gif",id:"orion.gitStage",callback:function(y){h._statusService.setProgressMessage("Staging...");return h.stage(y.object.indexURI,y.object)},visibleWhen:function(y){return y.type==="fileItem"&&!h._model.isStaged(y.object.type)}}),u=new d.Command({name:"stageAll",tooltip:"Stage all",image:"/git/images/stage_all.gif",id:"orion.gitStageAll",callback:function(){h._statusService.setProgressMessage("Staging...");
return h.stageAll()},visibleWhen:function(y){return y.type==="unstagedItems"&&h.hasUnstaged}}),s=new d.Command({name:"unstage",tooltip:"Unstage",image:"/git/images/unstage.gif",id:"orion.gitUnstage",callback:function(y){h._statusService.setProgressMessage("Unstaging...");return h.unstage(y.object)},visibleWhen:function(){return false}}),q=new d.Command({name:"unstageAll",tooltip:"Unstage all",image:"/git/images/unstage_all.gif",id:"orion.gitUnstageAll",callback:function(){h._statusService.setProgressMessage("Unstaging...");
return h.unstageAll("MIXED")},visibleWhen:function(y){return y.type==="stagedItems"&&h.hasStaged}}),v=new d.Command({name:"Reset",tooltip:"Reset all changes",image:"/git/images/refresh.gif",id:"orion.gitResetChanges",callback:function(){h._registry.getService("orion.page.dialog").then(function(y){y.confirm("The content of the working directory will be reset to content on the index.\nAll unstaged and staged changes in the working directory will be discarded and cannot be recovered.\nAre you sure you want to continue?",
function(x){if(x){h._statusService.setProgressMessage("Resetting local changes...");return h.unstageAll("HARD")}})})},visibleWhen:function(){return h.hasStaged||h.hasUnstaged}});this._registry.getService("orion.page.command").then(function(y){y.addCommand(l,"object");y.addCommand(r,"object");y.addCommand(o,"object");y.addCommand(u,"object");y.addCommand(q,"object");y.addCommand(s,"object");y.addCommand(v,"dom");y.registerCommandContribution("orion.gitStage",1);y.registerCommandContribution("orion.gitCheckout",
2);y.registerCommandContribution("orion.gitUnstage",3);y.registerCommandContribution("orion.sbsCompare",4);y.registerCommandContribution("orion.gitStageAll",5);y.registerCommandContribution("orion.gitUnstageAll",6);y.registerCommandContribution("orion.gitResetChanges",7,"pageActions")})},startTimer:function(){if(!this.timerOn){this.timerOn=true;this.doTimer()}},stopTimer:function(){if(this.timerOn&&this._timerId){this.timerOn=false;clearTimeout(this._timerId)}},doTimer:function(){var h=document.getElementById("commitMessage");
document.getElementById("commit").disabled=h.value==="";this._timerId=setTimeout(c.hitch(this,function(){this.doTimer()}),150)},initViewer:function(){this._inlineCompareContainer.destroyEditor();this._model.selectedItem=null;this.hasUnstaged=this.hasStaged=false;c.place(document.createTextNode("Select a file on the left to compare..."),"fileNameInViewer","only");c.style("fileNameInViewer","color","#6d6d6d")},_createImgButton:function(h,l,o,r,u){var s=document.createElement("img");s.src=o;l.appendChild(s);
this.modifyImageButton(h,s,r,u)},_modifyImageButton:function(h,l,o,r,u,s){var q=this;if(u===undefined||!u){l.title=o;c.style(l,"opacity","0.4");c.connect(l,"onmouseover",l,function(){var v=false;if(s)v=s();l.style.cursor=q.loading?"wait":v?"default":"pointer";v?c.style(l,"opacity","0.4"):c.style(l,"opacity","1")});c.connect(l,"onmouseout",l,function(){l.style.cursor=q.loading?"wait":"default";c.style(l,"opacity","0.4")});l.onclick=function(v){var y=false;if(s)y=s();if(h&&!y)y||r(v)}}else{l.title=
"";l.style.cursor=q.loading?"wait":"default";c.style(l,"opacity","0.0");c.connect(l,"onmouseover",l,function(){l.style.cursor=q.loading?"wait":"default";c.style(l,"opacity","0")});c.connect(l,"onmouseout",l,function(){l.style.cursor=q.loading?"wait":"default";c.style(l,"opacity","0")});l.onclick=null}},_sortBlock:function(h){for(var l=[],o=0;o<h.length;o++){var r=h[o],u=this._model.getGroupData(r);if(u)for(var s=0;s<u.length;s++){var q=this._model.getModelType(u[s],r);q&&l.push({name:u[s].Name,type:q,
location:u[s].Location,path:u[s].Path,commitURI:u[s].Git.CommitLocation,indexURI:u[s].Git.IndexLocation,diffURI:u[s].Git.DiffLocation,conflicting:this._model.isConflict(q)})}}l.sort(function(v,y){v=v.name&&v.name.toLowerCase();y=y.name&&y.name.toLowerCase();if(v<y)return-1;if(v>y)return 1;return 0});return l},_loadBlock:function(h,l){h.initTable();l=this._sortBlock(l);for(var o=0;o<l.length;o++)h.renderRow(l[o])},loadDiffContent:function(h){this._statusService.setProgressMessage("Loading diff...");
var l=this,o=this._model.isStaged(h.type)?"index VS HEAD ) ":"local VS index ) ",r="Compare( "+i.statusTypeMap[h.type][1]+" : "+o;this._inlineCompareContainer.resolveDiff((this._model.isConflict(h.type)?h.diffURI:h.diffURI+"?conflict=true")+"?conflict=true",function(){c.place(document.createTextNode(r),"fileNameInViewer","only");c.style("fileNameInViewer","color","#6d6d6d");l._statusService.setProgressMessage("")},function(u,s){l.handleServerErrors(u,s)})},openCompareEditor:function(h){var l="",o=
"/compare/compare.html#";if(this._model.isConflict(h.type))l="?conflict=true";if(this._model.isStaged(h.type))o="/compare/compare.html?readonly#";return o+h.diffURI+l},handleServerErrors:function(h,l){var o=[];o.Severity="Error";o.HTML=false;o.Message=typeof h.message==="string"?h.message:l.xhr.statusText;this._statusService.setProgressResult(o)},getGitStatus:function(h,l){this._url=h;if(this._initializing=l?true:false){this._cloneInfo=undefined;this._statusService.setProgressMessage("Loading status...")}var o=
this;o._registry.getService("orion.git.provider").then(function(r){r.getGitStatus(h,function(u){o.loadStatus(u)},function(u,s){o.handleServerErrors(u,s)})})},stage:function(h,l){var o=this;if(l&&l.conflicting){o._stagingConflict=true;o._stagingName=l.name}else o._stagingConflict=false;o._registry.getService("orion.git.provider").then(function(r){r.stage(h,function(){o.getGitStatus(o._url)},function(u,s){o.handleServerErrors(u,s)})})},checkout:function(h){var l=this,o=this._model.items.CloneLocation;
l._registry.getService("orion.git.provider").then(function(r){r.checkoutPath(o,[h.name],function(){l.getGitStatus(l._url)},function(u,s){l.handleServerErrors(u,s)})})},stageAll:function(){this.stage(this._model.items.IndexLocation)},unstage:function(h){var l=this;l._registry.getService("orion.git.provider").then(function(o){o.unstage(l._model.items.IndexLocation,[h.path],function(){l.getGitStatus(l._url)},function(r,u){l.handleServerErrors(r,u)})})},unstageAll:function(h){var l=this;l._registry.getService("orion.git.provider").then(function(o){o.unstageAll(l._model.items.IndexLocation,
h,function(){l.getGitStatus(l._url)},function(r,u){l.handleServerErrors(r,u)})})},commitAll:function(h,l,o){var r=this;r._statusService.setProgressMessage("Committing...");r._registry.getService("orion.git.provider").then(function(u){u.commitAll(h,l,o,function(){r.getGitStatus(r._url,true)},function(s,q){r.handleServerErrors(s,q)})})},commit:function(h,l){if(!h){h=document.getElementById("commitMessage").value;if(h==="")return;l=document.getElementById("amend").checked}this.commitAll(this._curClone.HeadLocation,
h,l?c.toJson({Message:h,Amend:"true"}):c.toJson({Message:h}))}};return j}();return i});define("orion/dialogs",[],function(){function c(g){this._serviceRegistry=g;this._serviceRegistration=g.registerService("orion.page.dialog",this)}c.prototype={confirm:function(g,a){a(window.confirm(g))},openFiles:function(){}};c.prototype.constructor=c;return{DialogService:c}});
define("orion/ssh/sshTools",[],function(){var c=c||{};c.SshService=function(){function g(a){if(a){this._serviceRegistry=a;this._serviceRegistration=a.registerService("orion.net.ssh",this)}}g.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(a,d){d||(d="");var e=localStorage.getItem(d+this._KNOWN_HOSTS);if(e)e.indexOf(a)<0&&localStorage.setItem(d+this._KNOWN_HOSTS,e+"\n"+a);else localStorage.setItem(d+this._KNOWN_HOSTS,a)},clearKnownhosts:function(a){a||(a="");localStorage.removeItem(a+
this._KNOWN_HOSTS)},getKnownHosts:function(a){a||(a="");return localStorage.getItem(a+this._KNOWN_HOSTS)}};return g}();return c});
define("git-status",["dojo","orion/serviceregistry","orion/preferences","orion/pluginregistry","orion/status","orion/commands","orion/fileClient","orion/searchClient","orion/globalCommands","orion/git/gitClient","orion/git/git-status-table","orion/breadcrumbs","orion/dialogs","orion/ssh/sshTools","dojo/parser","dojo/hash","dijit/layout/BorderContainer","dijit/layout/ContentPane"],function(c,g,a,d,e,f,i,j,h,l,o,r,u,s){c.addOnLoad(function(){document.body.style.visibility="visible";c.parser.parse();
var q=new g.ServiceRegistry;new d.PluginRegistry(q);var v=new f.CommandService({serviceRegistry:q}),y=new a.PreferencesService(q,"/prefs/user"),x=new j.Searcher({serviceRegistry:q});new l.GitService(q);new s.SshService(q);new u.DialogService(q);for(var k=q.getServiceReferences("orion.core.file"),m=new e.StatusReportingService(q,"statusPane","notifications"),n,p=0;p<k.length;p++){for(var t={},w=k[p].getPropertyNames(),z=0;z<w.length;z++)t[w[z]]=k[p].getProperty(w[z]);if((new RegExp(t.pattern)).test(c.hash()))n=
k[p]}q.getService(n).then(function(A){new i.FileClient(A);h.generateBanner("toolbar",q,v,y,x);var C=new o.GitStatusController({renderLog:true},q,m,"unstagedZone","stagedZone");C.getGitStatus(c.hash(),true);c.subscribe("/dojo/hashchange",C,function(){C.getGitStatus(c.hash(),true)})})})});