define(["module"],function(e){"use strict";var u,i,s,a,f,t=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,o=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,l=typeof location!=="undefined"&&location.href,c=l&&location.protocol&&location.protocol.replace(/\:/,""),p=l&&location.hostname,d=l&&(location.port||undefined),m={},v=e.config&&e.config()||{};function g(e,n){return e===undefined||e===""?n:e}function h(e,n,r,t){if(n===t){return true}else if(e===r){if(e==="http"){return g(n,"80")===g(t,"80")}else if(e==="https"){return g(n,"443")===g(t,"443")}}return false}u={version:"2.0.16",strip:function(e){if(e){e=e.replace(r,"");var n=e.match(o);if(n){e=n[1]}}else{e=""}return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:v.createXhr||function(){var e,n,r;if(typeof XMLHttpRequest!=="undefined"){return new XMLHttpRequest}else if(typeof ActiveXObject!=="undefined"){for(n=0;n<3;n+=1){r=t[n];try{e=new ActiveXObject(r)}catch(e){}if(e){t=[r];break}}}return e},parseName:function(e){var n,r,t,i=false,o=e.lastIndexOf("."),s=e.indexOf("./")===0||e.indexOf("../")===0;if(o!==-1&&(!s||o>1)){n=e.substring(0,o);r=e.substring(o+1)}else{n=e}t=r||n;o=t.indexOf("!");if(o!==-1){i=t.substring(o+1)==="strip";t=t.substring(0,o);if(r){r=t}else{n=t}}return{moduleName:n,ext:r,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,t){var i,o,s,a=u.xdRegExp.exec(e);if(!a){return true}i=a[2];o=a[3];o=o.split(":");s=o[1];o=o[0];return(!i||i===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!s&&!o||h(i,s,n,t))},finishLoad:function(e,n,r,t){r=n?u.strip(r):r;if(v.isBuild){m[e]=r}t(r)},load:function(n,e,r,t){if(t&&t.isBuild&&!t.inlineText){r();return}v.isBuild=t&&t.isBuild;var i=u.parseName(n),o=i.moduleName+(i.ext?"."+i.ext:""),s=e.toUrl(o),a=v.useXhr||u.useXhr;if(s.indexOf("empty:")===0){r();return}if(!l||a(s,c,p,d)){u.get(s,function(e){u.finishLoad(n,i.strip,e,r)},function(e){if(r.error){r.error(e)}})}else{e([o],function(e){u.finishLoad(i.moduleName+"."+i.ext,i.strip,e,r)},function(e){if(r.error){r.error(e)}})}},write:function(e,n,r,t){if(m.hasOwnProperty(n)){var i=u.jsEscape(m[n]);r.asModule(e+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(r,e,n,t,i){var o=u.parseName(e),s=o.ext?"."+o.ext:"",a=o.moduleName+s,f=n.toUrl(o.moduleName+s)+".js";u.load(a,n,function(e){var n=function(e){return t(f,e)};n.asModule=function(e,n){return t.asModule(e,f,n)};u.write(r,a,n,i)},i)}};if(v.env==="node"||!v.env&&typeof process!=="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]){i=require.nodeRequire("fs");u.get=function(e,n,r){try{var t=i.readFileSync(e,"utf8");if(t[0]==="\ufeff"){t=t.substring(1)}n(t)}catch(e){if(r){r(e)}}}}else if(v.env==="xhr"||!v.env&&u.createXhr()){u.get=function(t,i,o,e){var s=u.createXhr(),n;s.open("GET",t,true);if(e){for(n in e){if(e.hasOwnProperty(n)){s.setRequestHeader(n.toLowerCase(),e[n])}}}if(v.onXhr){v.onXhr(s,t)}s.onreadystatechange=function(e){var n,r;if(s.readyState===4){n=s.status||0;if(n>399&&n<600){r=new Error(t+" HTTP status: "+n);r.xhr=s;if(o){o(r)}}else{i(s.responseText)}if(v.onXhrComplete){v.onXhrComplete(s,t)}}};s.send(null)}}else if(v.env==="rhino"||!v.env&&typeof Packages!=="undefined"&&typeof java!=="undefined"){u.get=function(e,n){var r,t,i="utf-8",o=new java.io.File(e),s=java.lang.System.getProperty("line.separator"),a=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(o),i)),f="";try{r=new java.lang.StringBuffer;t=a.readLine();if(t&&t.length()&&t.charAt(0)===65279){t=t.substring(1)}if(t!==null){r.append(t)}while((t=a.readLine())!==null){r.append(s);r.append(t)}f=String(r.toString())}finally{a.close()}n(f)}}else if(v.env==="xpconnect"||!v.env&&typeof Components!=="undefined"&&Components.classes&&Components.interfaces){s=Components.classes;a=Components.interfaces;Components.utils["import"]("resource://gre/modules/FileUtils.jsm");f="@mozilla.org/windows-registry-key;1"in s;u.get=function(e,n){var r,t,i,o={};if(f){e=e.replace(/\//g,"\\")}i=new FileUtils.File(e);try{r=s["@mozilla.org/network/file-input-stream;1"].createInstance(a.nsIFileInputStream);r.init(i,1,0,false);t=s["@mozilla.org/intl/converter-input-stream;1"].createInstance(a.nsIConverterInputStream);t.init(r,"utf-8",r.available(),a.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);t.readString(r.available(),o);t.close();r.close();n(o.value)}catch(e){throw new Error((i&&i.path||"")+": "+e)}}}return u});