From 4cf7a35cb761aff414d0300c707df7e0a3906d8d Mon Sep 17 00:00:00 2001 From: Pete Boysen Date: Wed, 24 Aug 2016 11:58:52 -0500 Subject: [PATCH] added border to toolbar --- sims/drawsim/drawsim-built-min.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sims/drawsim/drawsim-built-min.js b/sims/drawsim/drawsim-built-min.js index 312ca93..42f471d 100644 --- a/sims/drawsim/drawsim-built-min.js +++ b/sims/drawsim/drawsim-built-min.js @@ -1,2 +1,2 @@ -!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;oi;i++){var v=new Vector(x,45*i,"assets/left-arrow.png",drawsim);_this3.addChild(v),x+=30}return _this3.addChild(new PressureRegion(x,!0,drawsim)),x+=30,_this3.addChild(new PressureRegion(x,!1,drawsim)),x+=30,_this3}return _inherits(Pressures,_createjs$Container3),_createClass(Pressures,[{key:"getLength",value:function(){return 302}},{key:"getInst",value:function(){return"

Click location and select a vector or region to add. Click vector or region to delete.

"}}]),Pressures}(createjs.Container),Airmass=function(_createjs$Container4){function Airmass(x,name,drawsim){_classCallCheck(this,Airmass);var _this4=_possibleConstructorReturn(this,Object.getPrototypeOf(Airmass).call(this));_this4.x=x,_this4.y=2,_this4.name=name;var circle=new createjs.Shape;circle.graphics.beginFill("#FFF").beginStroke("#000").drawCircle(14,14,14).endStroke(),_this4.addChild(circle);var txt=new createjs.Text(name,"12px Arial","#000");txt.x=6,txt.y=10,_this4.addChild(txt);var select=new createjs.Shape;return select.graphics.beginFill("#CCC").drawCircle(14,14,14).endStroke(),_this4.addChild(select),select.alpha=0,_this4.addEventListener("mouseover",function(e){select.alpha=.5}),_this4.addEventListener("mouseout",function(e){select.alpha=0}),_this4.addEventListener("click",function(e){drawsim.toolbar.select(_this4)}),_this4}return _inherits(Airmass,_createjs$Container4),_createClass(Airmass,null,[{key:"showSymbol",value:function(stage,json){var airmass=new createjs.Container;airmass.x=json.pt.x,airmass.y=json.pt.y;var circle=new createjs.Shape;circle.graphics.beginFill("#FFF").beginStroke("#000").drawCircle(14,14,14).endStroke(),airmass.addChild(circle);var txt=new createjs.Text(json.name,"12px Arial","#000");txt.x=6,txt.y=10,airmass.addChild(txt),airmass.cursor="not-allowed",airmass.addEventListener("click",function(e){removeSymbol(json),airmass.stage.removeChild(airmass)}),stage.addChild(airmass)}},{key:"isSame",value:function(json1,json2){return json1.type!=json2.type?!1:json1.name!=json2.name?!1:json1.pt.x!=json2.pt.x?!1:json1.pt.y!=json2.pt.y?!1:!0}}]),_createClass(Airmass,[{key:"toJSON",value:function(x,y){return{type:"airmass",name:this.name,pt:{x:x,y:y}}}}]),Airmass}(createjs.Container),Airmasses=function(_createjs$Container5){function Airmasses(x,toolbar){_classCallCheck(this,Airmasses);var _this5=_possibleConstructorReturn(this,Object.getPrototypeOf(Airmasses).call(this)),masses=["cP","mP","cT","mT","cE","mE","cA","mA"];return masses.forEach(function(name){_this5.addChild(new Airmass(x,name,toolbar)),x+=30}),_this5}return _inherits(Airmasses,_createjs$Container5),_createClass(Airmasses,[{key:"getLength",value:function(){return 242}},{key:"getInst",value:function(){return"

Click location and select airmass to add. Click airmass to delete.

"}}]),Airmasses}(createjs.Container),IsoPath=function(){function IsoPath(back,drawsim){var _this6=this;_classCallCheck(this,IsoPath),createjs.Ticker.framerate=10,this.back=back,this.mouseDown=!1,drawsim.mainstage.addEventListener("stagemousedown",function(e){_this6.currentShape=new createjs.Shape,_this6.currentShape.graphics.beginStroke("#00F"),drawsim.mainstage.addChild(_this6.currentShape),_this6.oldX=_this6.oldMidX=e.stageX,_this6.oldY=_this6.oldMidY=e.stageY,_this6.mouseDown=!0,_this6.pts=[]}),drawsim.mainstage.addEventListener("stagemousemove",function(e){if(0!=_this6.mouseDown){_this6.pt=new createjs.Point(e.stageX,e.stageY),_this6.pts=_this6.pts.concat({x:e.stageX,y:e.stageY});var midPoint=new createjs.Point(_this6.oldX+_this6.pt.x>>1,_this6.oldY+_this6.pt.y>>1);_this6.currentShape.graphics.setStrokeStyle(4).moveTo(midPoint.x,midPoint.y),_this6.currentShape.graphics.curveTo(_this6.oldX,_this6.oldY,_this6.oldMidX,_this6.oldMidY),_this6.oldX=_this6.pt.x,_this6.oldY=_this6.pt.y,_this6.oldMidX=midPoint.x,_this6.oldMidY=midPoint.y}}),drawsim.mainstage.addEventListener("stagemouseup",function(e){if(_this6.mouseDown=!1,drawsim.mainstage.removeChild(_this6.currentShape),!(_this6.pts.length<3)){var value=prompt("Enter value:",1);if(value){var symbol={type:"isopath",value:value,pts:_this6.pts};IsoPath.showSymbol(drawsim.mainstage,symbol),addSymbol(symbol)}}})}return _createClass(IsoPath,null,[{key:"showSymbol",value:function(stage,json){var pts=json.pts,path=new createjs.Container,shape=new createjs.Shape;shape.graphics.beginStroke("#00F");var oldX=pts[0].x,oldY=pts[0].y,oldMidX=oldX,oldMidY=oldY;json.pts.forEach(function(pt){var midPoint=new createjs.Point(oldX+pt.x>>1,oldY+pt.y>>1);shape.graphics.setStrokeStyle(4).moveTo(midPoint.x,midPoint.y),shape.graphics.curveTo(oldX,oldY,oldMidX,oldMidY),oldX=pt.x,oldY=pt.y,oldMidX=midPoint.x,oldMidY=midPoint.y}),path.addChild(shape);var first=pts[0],last=pts[pts.length-1],label=IsoPath.getLabel(json.value,first.x-10,first.y+(first.y10){var _label=IsoPath.getLabel(json.value,last.x-10,last.y+(first.yClick and drag to draw line. Supply value when prompted. Click value to delete.

"}}]),IsoPath}(),Toolbar=function(_createjs$Container6){function Toolbar(tool,drawsim){_classCallCheck(this,Toolbar);var _this7=_possibleConstructorReturn(this,Object.getPrototypeOf(Toolbar).call(this));createjs.Ticker.framerate=20;var border=new createjs.Shape;_this7.addChild(border);var w=2;return _this7.addChild(tool),w+=tool.getLength(),_this7.cancel=new Vector(w,0,"assets/cross.png",drawsim),_this7.cancel.y=2,_this7.addChild(_this7.cancel),w+=30,_this7.x=0,_this7.y=-100,_this7.w=w,border.graphics.beginFill("#FFF").drawRoundRect(0,0,w,30,5,5,5,5).endStroke(),_this7}return _inherits(Toolbar,_createjs$Container6),_createClass(Toolbar,[{key:"select",value:function(obj){if(this.y=-100,obj!=this.cancel){var json=null;obj instanceof Vector&&(json=obj.toJSON(this.e.stageX,this.e.stageY),Vector.showSymbol(this.stage,json)),obj instanceof Airmass&&(json=obj.toJSON(this.e.stageX-14,this.e.stageY-14),Airmass.showSymbol(this.stage,json)),obj instanceof PressureRegion&&(json=obj.toJSON(this.e.stageX,this.e.stageY),PressureRegion.showSymbol(this.stage,json)),addSymbol(json),this.stage.setChildIndex(this,this.stage.getNumChildren()-1)}}},{key:"show",value:function(e){!e.relatedTarget&&this.y<0&&(this.x=e.stageX-this.w/2,this.y=e.stageY-30,this.e=e)}}]),Toolbar}(createjs.Container),DrawSim=function(){function DrawSim(){var _this8=this;_classCallCheck(this,DrawSim),this.mainstage=new createjs.Stage("maincanvas"),createjs.Touch.enable(this.mainstage);var back=new createjs.Bitmap(image);if(back.x=20,back.y=20,this.mainstage.addChild(back),back.onload=function(){var bnd=back.getBounds();this.mainstage.canvas.width=bnd.width+40,this.mainstage.canvas.height=bnd.height+40},this.showSymbols(),edit){this.mainstage.enableMouseOver();var inst=document.getElementById("instruct");switch(tool){case"pressure":var pressures=new Pressures(2,this);this.toolbar=new Toolbar(pressures,this),inst.innerHTML=pressures.getInst(),back.addEventListener("mousedown",function(e){return _this8.toolbar.show(e)}),this.mainstage.addChild(this.toolbar);break;case"airmass":var airmasses=new Airmasses(2,this);this.toolbar=new Toolbar(airmasses,this),inst.innerHTML=airmasses.getInst(),back.addEventListener("mousedown",function(e){return _this8.toolbar.show(e)}),this.mainstage.addChild(this.toolbar);break;case"isopath":this.isopath=new IsoPath(back,this),inst.innerHTML=this.isopath.getInst()}}var dl=document.getElementById("download");dl.addEventListener("click",function(e){var dt=_this8.mainstage.canvas.toDataURL("image/png");dt=dt.replace(/^data:image\/[^;]*/,"data:application/octet-stream"),dt=dt.replace(/^data:application\/octet-stream/,"data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=map.png"),dl.href=dt})}return _createClass(DrawSim,[{key:"showSymbols",value:function(){var _this9=this,symbols=getSymbols();symbols.forEach(function(json){switch(json.type){case"vector":Vector.showSymbol(_this9.mainstage,json);break;case"region":PressureRegion.showSymbol(_this9.mainstage,json);break;case"airmass":Airmass.showSymbol(_this9.mainstage,json);break;case"isopath":IsoPath.showSymbol(_this9.mainstage,json)}})}},{key:"run",value:function(){var _this10=this,tick=0;createjs.Ticker.addEventListener("tick",function(e){_this10.mainstage.update(),tick++})}}]),DrawSim}(),drawsim=new DrawSim;drawsim.run()},{"../utils":4,url:11}],2:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i=this.originY&&v<=this.originY+this.h:v>=this.originX&&v<=this.originY+this.w}}]),Axis}()},{}],3:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i=this.xaxis.min&&xv<=this.xaxis.max&&yv>=this.yaxis.min&&yv<=this.yaxis.max){var x=this.xaxis.getLoc(xv),y=this.yaxis.getLoc(yv);this.last&&(this.moveMarker(this.last.x,this.last.y),this.drawLine(this.last.x,this.last.y,x,y)),this.last=new createjs.Point(x,y),this.moveMarker(x,y)}}},{key:"endPlot",value:function(){this.last=null}}]),Graph}()},{"./axis":2}],4:[function(require,module,exports){"use strict";function getParams(){var params={};return location.search&&location.search.slice(1).split("&").forEach(function(part){var pair=part.split("=");pair[0]=decodeURIComponent(pair[0]),pair[1]=decodeURIComponent(pair[1]),params[pair[0]]="undefined"!==pair[1]?pair[1]:!0}),params}function getStore(){return store.enabled?store:void alert('Local storage is not supported by your browser. Please disable "Private Mode", or upgrade to a modern browser.')}Object.defineProperty(exports,"__esModule",{value:!0});var _graph=require("./graph");Object.defineProperty(exports,"Graph",{enumerable:!0,get:function(){return _graph.Graph}}),exports.getParams=getParams,exports.getStore=getStore;var store=(require("./json2"),require("./store"))},{"./graph":3,"./json2":5,"./store":6}],5:[function(require,module,exports){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj};"object"!==("undefined"==typeof JSON?"undefined":_typeof(JSON))&&(JSON={}),function(){function f(n){return 10>n?"0"+n:n}function this_value(){return this.valueOf()}function quote(string){return rx_escapable.lastIndex=0,rx_escapable.test(string)?'"'+string.replace(rx_escapable,function(a){var c=meta[a];return"string"==typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,partial,mind=gap,value=holder[key];switch(value&&"object"===("undefined"==typeof value?"undefined":_typeof(value))&&"function"==typeof value.toJSON&&(value=value.toJSON(key)),"function"==typeof rep&&(value=rep.call(holder,key,value)),"undefined"==typeof value?"undefined":_typeof(value)){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],"[object Array]"===Object.prototype.toString.apply(value)){for(length=value.length,i=0;length>i;i+=1)partial[i]=str(i,value)||"null";return v=0===partial.length?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]",gap=mind,v}if(rep&&"object"===("undefined"==typeof rep?"undefined":_typeof(rep)))for(length=rep.length,i=0;length>i;i+=1)"string"==typeof rep[i]&&(k=rep[i],v=str(k,value),v&&partial.push(quote(k)+(gap?": ":":")+v));else for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=str(k,value),v&&partial.push(quote(k)+(gap?": ":":")+v));return v=0===partial.length?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}",gap=mind,v}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(value,replacer,space){var i;if(gap="",indent="","number"==typeof space)for(i=0;space>i;i+=1)indent+=" ";else"string"==typeof space&&(indent=space);if(rep=replacer,replacer&&"function"!=typeof replacer&&("object"!==("undefined"==typeof replacer?"undefined":_typeof(replacer))||"number"!=typeof replacer.length))throw new Error("JSON.stringify");return str("",{"":value})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(holder,key){var k,v,value=holder[key];if(value&&"object"===("undefined"==typeof value?"undefined":_typeof(value)))for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},{}],6:[function(require,module,exports){(function(global){"use strict";module.exports=function(){function isLocalStorageNameSupported(){try{return localStorageName in win&&win[localStorageName]}catch(err){return!1}}var storage,store={},win="undefined"!=typeof window?window:global,doc=win.document,localStorageName="localStorage",scriptTag="script";if(store.disabled=!1,store.version="1.3.20",store.set=function(key,value){},store.get=function(key,defaultVal){},store.has=function(key){return void 0!==store.get(key)},store.remove=function(key){},store.clear=function(){},store.transact=function(key,defaultVal,transactionFn){null==transactionFn&&(transactionFn=defaultVal,defaultVal=null),null==defaultVal&&(defaultVal={});var val=store.get(key,defaultVal);transactionFn(val),store.set(key,val)},store.getAll=function(){var ret={};return store.forEach(function(key,val){ret[key]=val}),ret},store.forEach=function(){},store.serialize=function(value){return JSON.stringify(value)},store.deserialize=function(value){if("string"==typeof value)try{return JSON.parse(value)}catch(e){return value||void 0}},isLocalStorageNameSupported())storage=win[localStorageName],store.set=function(key,val){return void 0===val?store.remove(key):(storage.setItem(key,store.serialize(val)),val)},store.get=function(key,defaultVal){var val=store.deserialize(storage.getItem(key));return void 0===val?defaultVal:val},store.remove=function(key){storage.removeItem(key)},store.clear=function(){storage.clear()},store.forEach=function(callback){for(var i=0;idocument.w=window'),storageContainer.close(),storageOwner=storageContainer.w.frames[0].document,storage=storageOwner.createElement("div")}catch(e){storage=doc.createElement("div"),storageOwner=doc.body}var withIEStorage=function(storeFunction){return function(){var args=Array.prototype.slice.call(arguments,0);args.unshift(storage),storageOwner.appendChild(storage),storage.addBehavior("#default#userData"),storage.load(localStorageName);var result=storeFunction.apply(store,args);return storageOwner.removeChild(storage),result}},forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),ieKeyFix=function(key){return key.replace(/^d/,"___$&").replace(forbiddenCharsRegex,"___")};store.set=withIEStorage(function(storage,key,val){return key=ieKeyFix(key),void 0===val?store.remove(key):(storage.setAttribute(key,store.serialize(val)),storage.save(localStorageName),val)}),store.get=withIEStorage(function(storage,key,defaultVal){key=ieKeyFix(key);var val=store.deserialize(storage.getAttribute(key));return void 0===val?defaultVal:val}),store.remove=withIEStorage(function(storage,key){key=ieKeyFix(key),storage.removeAttribute(key),storage.save(localStorageName)}),store.clear=withIEStorage(function(storage){var attributes=storage.XMLDocument.documentElement.attributes;storage.load(localStorageName);for(var i=attributes.length-1;i>=0;i--)storage.removeAttribute(attributes[i].name);storage.save(localStorageName)}),store.forEach=withIEStorage(function(storage,callback){for(var attr,attributes=storage.XMLDocument.documentElement.attributes,i=0;attr=attributes[i];++i)callback(attr.name,store.deserialize(storage.getAttribute(attr.name)))})}try{var testKey="__storejs__";store.set(testKey,testKey),store.get(testKey)!=testKey&&(store.disabled=!0),store.remove(testKey)}catch(e){store.disabled=!0}return store.enabled=!store.disabled,store}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(require,module,exports){(function(global){!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,".");var labels=string.split("."),encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;length>counter;)value=string.charCodeAt(counter++),value>=55296&&56319>=value&&length>counter?(extra=string.charCodeAt(counter++),56320==(64512&extra)?output.push(((1023&value)<<10)+(1023&extra)+65536):(output.push(value),counter--)):output.push(value);return output}function ucs2encode(array){return map(array,function(value){ -var output="";return value>65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return 10>codePoint-48?codePoint-22:26>codePoint-65?codePoint-65:26>codePoint-97?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(26>digit)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),0>basic&&(basic=0),j=0;basic>j;++j)input.charCodeAt(j)>=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;inputLength>index;){for(oldi=i,w=1,k=base;index>=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=bias>=k?tMin:k>=bias+tMax?tMax:k-bias,!(t>digit);k+=base)baseMinusT=base-t,w>floor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;inputLength>j;++j)currentValue=input[j],128>currentValue&&output.push(stringFromCharCode(currentValue));for(handledCPCount=basicLength=output.length,basicLength&&output.push(delimiter);inputLength>handledCPCount;){for(m=maxInt,j=0;inputLength>j;++j)currentValue=input[j],currentValue>=n&&m>currentValue&&(m=currentValue);for(handledCPCountPlusOne=handledCPCount+1,m-n>floor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;inputLength>j;++j)if(currentValue=input[j],n>currentValue&&++delta>maxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=bias>=k?tMin:k>=bias+tMax?tMax:k-bias,!(t>q);k+=base)qMinusT=q-t,baseMinusT=base-t,output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0))),q=floor(qMinusT/baseMinusT);output.push(stringFromCharCode(digitToBasic(q,0))),bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength),delta=0,++handledCPCount}++delta,++n}return output.join("")}function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string})}function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string})}var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule="object"==typeof module&&module&&!module.nodeType&&module,freeGlobal="object"==typeof global&&global;(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)&&(root=freeGlobal);var punycode,key,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;if(punycode={version:"1.3.2",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return punycode});else if(freeExports&&freeModule)if(module.exports==freeExports)freeModule.exports=punycode;else for(key in punycode)punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);else root.punycode=punycode}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(require,module,exports){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;len>i;++i){var kstr,vstr,k,v,x=qs[i].replace(regexp,"%20"),idx=x.indexOf(eq);idx>=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},{}],9:[function(require,module,exports){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i",'"',"`"," ","\r","\n"," "],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=require("querystring");Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=-1!==queryIndex&&queryIndexhec)&&(hostEnd=hec)}var auth,atSign;atSign=-1===hostEnd?rest.lastIndexOf("@"):rest.lastIndexOf("@",hostEnd),-1!==atSign&&(auth=rest.slice(0,atSign),rest=rest.slice(atSign+1),this.auth=decodeURIComponent(auth)),hostEnd=-1;for(var i=0;ihec)&&(hostEnd=hec)}-1===hostEnd&&(hostEnd=rest.length),this.host=rest.slice(0,hostEnd),rest=rest.slice(hostEnd),this.parseHost(),this.hostname=this.hostname||"";var ipv6Hostname="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!ipv6Hostname)for(var hostparts=this.hostname.split(/\./),i=0,l=hostparts.length;l>i;i++){var part=hostparts[i];if(part&&!part.match(hostnamePartPattern)){for(var newpart="",j=0,k=part.length;k>j;j++)newpart+=part.charCodeAt(j)>127?"x":part[j];if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(hostnamePartStart);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;l>i;i++){var ae=autoEscape[i];if(-1!==rest.indexOf(ae)){var esc=encodeURIComponent(ae);esc===ae&&(esc=escape(ae)),rest=rest.split(ae).join(esc)}}var hash=rest.indexOf("#");-1!==hash&&(this.hash=rest.substr(hash),rest=rest.slice(0,hash));var qm=rest.indexOf("?");if(-1!==qm?(this.search=rest.substr(qm),this.query=rest.substr(qm+1),parseQueryString&&(this.query=querystring.parse(this.query)),rest=rest.slice(0,qm)):parseQueryString&&(this.search="",this.query={}),rest&&(this.pathname=rest),slashedProtocol[lowerProto]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var p=this.pathname||"",s=this.search||"";this.path=p+s}return this.href=this.format(),this},Url.prototype.format=function(){var auth=this.auth||"";auth&&(auth=encodeURIComponent(auth),auth=auth.replace(/%3A/i,":"),auth+="@");var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",host=!1,query="";this.host?host=auth+this.host:this.hostname&&(host=auth+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(host+=":"+this.port)),this.query&&util.isObject(this.query)&&Object.keys(this.query).length&&(query=querystring.stringify(this.query));var search=this.search||query&&"?"+query||"";return protocol&&":"!==protocol.substr(-1)&&(protocol+=":"),this.slashes||(!protocol||slashedProtocol[protocol])&&host!==!1?(host="//"+(host||""),pathname&&"/"!==pathname.charAt(0)&&(pathname="/"+pathname)):host||(host=""),hash&&"#"!==hash.charAt(0)&&(hash="#"+hash),search&&"?"!==search.charAt(0)&&(search="?"+search),pathname=pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match)}),search=search.replace("#","%23"),protocol+host+pathname+search+hash},Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,!1,!0)).format()},Url.prototype.resolveObject=function(relative){if(util.isString(relative)){var rel=new Url;rel.parse(relative,!1,!0),relative=rel}for(var result=new Url,tkeys=Object.keys(this),tk=0;tk0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},{"./util":12,punycode:7,querystring:10}],12:[function(require,module,exports){"use strict";module.exports={isString:function(arg){return"string"==typeof arg},isObject:function(arg){return"object"==typeof arg&&null!==arg},isNull:function(arg){return null===arg},isNullOrUndefined:function(arg){return null==arg}}},{}]},{},[1]); \ No newline at end of file +!function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}for(var i="function"==typeof require&&require,o=0;oi;i++){var v=new Vector(x,45*i,"assets/left-arrow.png",drawsim);_this3.addChild(v),x+=30}return _this3.addChild(new PressureRegion(x,!0,drawsim)),x+=30,_this3.addChild(new PressureRegion(x,!1,drawsim)),x+=30,_this3}return _inherits(Pressures,_createjs$Container3),_createClass(Pressures,[{key:"getLength",value:function(){return 302}},{key:"getInst",value:function(){return"

Click location and select a vector or region to add. Click vector or region to delete.

"}}]),Pressures}(createjs.Container),Airmass=function(_createjs$Container4){function Airmass(x,name,drawsim){_classCallCheck(this,Airmass);var _this4=_possibleConstructorReturn(this,Object.getPrototypeOf(Airmass).call(this));_this4.x=x,_this4.y=2,_this4.name=name;var circle=new createjs.Shape;circle.graphics.beginFill("#FFF").beginStroke("#000").drawCircle(14,14,14).endStroke(),_this4.addChild(circle);var txt=new createjs.Text(name,"12px Arial","#000");txt.x=6,txt.y=10,_this4.addChild(txt);var select=new createjs.Shape;return select.graphics.beginFill("#CCC").drawCircle(14,14,14).endStroke(),_this4.addChild(select),select.alpha=0,_this4.addEventListener("mouseover",function(e){select.alpha=.5}),_this4.addEventListener("mouseout",function(e){select.alpha=0}),_this4.addEventListener("click",function(e){drawsim.toolbar.select(_this4)}),_this4}return _inherits(Airmass,_createjs$Container4),_createClass(Airmass,null,[{key:"showSymbol",value:function(stage,json){var airmass=new createjs.Container;airmass.x=json.pt.x,airmass.y=json.pt.y;var circle=new createjs.Shape;circle.graphics.beginFill("#FFF").beginStroke("#000").drawCircle(14,14,14).endStroke(),airmass.addChild(circle);var txt=new createjs.Text(json.name,"12px Arial","#000");txt.x=6,txt.y=10,airmass.addChild(txt),airmass.cursor="not-allowed",airmass.addEventListener("click",function(e){removeSymbol(json),airmass.stage.removeChild(airmass)}),stage.addChild(airmass)}},{key:"isSame",value:function(json1,json2){return json1.type!=json2.type?!1:json1.name!=json2.name?!1:json1.pt.x!=json2.pt.x?!1:json1.pt.y!=json2.pt.y?!1:!0}}]),_createClass(Airmass,[{key:"toJSON",value:function(x,y){return{type:"airmass",name:this.name,pt:{x:x,y:y}}}}]),Airmass}(createjs.Container),Airmasses=function(_createjs$Container5){function Airmasses(x,toolbar){_classCallCheck(this,Airmasses);var _this5=_possibleConstructorReturn(this,Object.getPrototypeOf(Airmasses).call(this)),masses=["cP","mP","cT","mT","cE","mE","cA","mA"];return masses.forEach(function(name){_this5.addChild(new Airmass(x,name,toolbar)),x+=30}),_this5}return _inherits(Airmasses,_createjs$Container5),_createClass(Airmasses,[{key:"getLength",value:function(){return 242}},{key:"getInst",value:function(){return"

Click location and select airmass to add. Click airmass to delete.

"}}]),Airmasses}(createjs.Container),IsoPath=function(){function IsoPath(back,drawsim){var _this6=this;_classCallCheck(this,IsoPath),createjs.Ticker.framerate=10,this.back=back,this.mouseDown=!1,drawsim.mainstage.addEventListener("stagemousedown",function(e){_this6.currentShape=new createjs.Shape,_this6.currentShape.graphics.beginStroke("#00F"),drawsim.mainstage.addChild(_this6.currentShape),_this6.oldX=_this6.oldMidX=e.stageX,_this6.oldY=_this6.oldMidY=e.stageY,_this6.mouseDown=!0,_this6.pts=[]}),drawsim.mainstage.addEventListener("stagemousemove",function(e){if(0!=_this6.mouseDown){_this6.pt=new createjs.Point(e.stageX,e.stageY),_this6.pts=_this6.pts.concat({x:e.stageX,y:e.stageY});var midPoint=new createjs.Point(_this6.oldX+_this6.pt.x>>1,_this6.oldY+_this6.pt.y>>1);_this6.currentShape.graphics.setStrokeStyle(4).moveTo(midPoint.x,midPoint.y),_this6.currentShape.graphics.curveTo(_this6.oldX,_this6.oldY,_this6.oldMidX,_this6.oldMidY),_this6.oldX=_this6.pt.x,_this6.oldY=_this6.pt.y,_this6.oldMidX=midPoint.x,_this6.oldMidY=midPoint.y}}),drawsim.mainstage.addEventListener("stagemouseup",function(e){if(_this6.mouseDown=!1,drawsim.mainstage.removeChild(_this6.currentShape),!(_this6.pts.length<3)){var value=prompt("Enter value:",1);if(value){var symbol={type:"isopath",value:value,pts:_this6.pts};IsoPath.showSymbol(drawsim.mainstage,symbol),addSymbol(symbol)}}})}return _createClass(IsoPath,null,[{key:"showSymbol",value:function(stage,json){var pts=json.pts,path=new createjs.Container,shape=new createjs.Shape;shape.graphics.beginStroke("#00F");var oldX=pts[0].x,oldY=pts[0].y,oldMidX=oldX,oldMidY=oldY;json.pts.forEach(function(pt){var midPoint=new createjs.Point(oldX+pt.x>>1,oldY+pt.y>>1);shape.graphics.setStrokeStyle(4).moveTo(midPoint.x,midPoint.y),shape.graphics.curveTo(oldX,oldY,oldMidX,oldMidY),oldX=pt.x,oldY=pt.y,oldMidX=midPoint.x,oldMidY=midPoint.y}),path.addChild(shape);var first=pts[0],last=pts[pts.length-1],label=IsoPath.getLabel(json.value,first.x-10,first.y+(first.y10){var _label=IsoPath.getLabel(json.value,last.x-10,last.y+(first.yClick and drag to draw line. Supply value when prompted. Click value to delete.

"}}]),IsoPath}(),Toolbar=function(_createjs$Container6){function Toolbar(tool,drawsim){_classCallCheck(this,Toolbar);var _this7=_possibleConstructorReturn(this,Object.getPrototypeOf(Toolbar).call(this));createjs.Ticker.framerate=20;var border=new createjs.Shape;_this7.addChild(border);var w=2;return _this7.addChild(tool),w+=tool.getLength(),_this7.cancel=new Vector(w,0,"assets/cross.png",drawsim),_this7.cancel.y=2,_this7.addChild(_this7.cancel),w+=30,_this7.x=0,_this7.y=-100,_this7.w=w,border.graphics.beginFill("#FFF").beginStroke("#AAA").drawRoundRect(0,0,w,30,5,5,5,5).endStroke(),_this7}return _inherits(Toolbar,_createjs$Container6),_createClass(Toolbar,[{key:"select",value:function(obj){if(this.y=-100,obj!=this.cancel){var json=null;obj instanceof Vector&&(json=obj.toJSON(this.e.stageX,this.e.stageY),Vector.showSymbol(this.stage,json)),obj instanceof Airmass&&(json=obj.toJSON(this.e.stageX-14,this.e.stageY-14),Airmass.showSymbol(this.stage,json)),obj instanceof PressureRegion&&(json=obj.toJSON(this.e.stageX,this.e.stageY),PressureRegion.showSymbol(this.stage,json)),addSymbol(json),this.stage.setChildIndex(this,this.stage.getNumChildren()-1)}}},{key:"show",value:function(e){!e.relatedTarget&&this.y<0&&(this.x=e.stageX-this.w/2,this.y=e.stageY-30,this.e=e)}}]),Toolbar}(createjs.Container),DrawSim=function(){function DrawSim(){var _this8=this;_classCallCheck(this,DrawSim),this.mainstage=new createjs.Stage("maincanvas"),createjs.Touch.enable(this.mainstage);var back=new createjs.Bitmap(image);if(back.x=40,back.y=40,this.mainstage.addChild(back),back.onload=function(){var bnd=back.getBounds();this.mainstage.canvas.width=bnd.width+40,this.mainstage.canvas.height=bnd.height+40},this.showSymbols(),edit){this.mainstage.enableMouseOver();var inst=document.getElementById("instruct");switch(tool){case"pressure":var pressures=new Pressures(2,this);this.toolbar=new Toolbar(pressures,this),inst.innerHTML=pressures.getInst(),back.addEventListener("mousedown",function(e){return _this8.toolbar.show(e)}),this.mainstage.addChild(this.toolbar);break;case"airmass":var airmasses=new Airmasses(2,this);this.toolbar=new Toolbar(airmasses,this),inst.innerHTML=airmasses.getInst(),back.addEventListener("mousedown",function(e){return _this8.toolbar.show(e)}),this.mainstage.addChild(this.toolbar);break;case"isopath":this.isopath=new IsoPath(back,this),inst.innerHTML=this.isopath.getInst()}}var dl=document.getElementById("download");dl.addEventListener("click",function(e){var dt=_this8.mainstage.canvas.toDataURL("image/png");dt=dt.replace(/^data:image\/[^;]*/,"data:application/octet-stream"),dt=dt.replace(/^data:application\/octet-stream/,"data:application/octet-stream;headers=Content-Disposition%3A%20attachment%3B%20filename=map.png"),dl.href=dt})}return _createClass(DrawSim,[{key:"showSymbols",value:function(){var _this9=this,symbols=getSymbols();symbols.forEach(function(json){switch(json.type){case"vector":Vector.showSymbol(_this9.mainstage,json);break;case"region":PressureRegion.showSymbol(_this9.mainstage,json);break;case"airmass":Airmass.showSymbol(_this9.mainstage,json);break;case"isopath":IsoPath.showSymbol(_this9.mainstage,json)}})}},{key:"run",value:function(){var _this10=this,tick=0;createjs.Ticker.addEventListener("tick",function(e){_this10.mainstage.update(),tick++})}}]),DrawSim}(),drawsim=new DrawSim;drawsim.run()},{"../utils":4,url:11}],2:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i=this.originY&&v<=this.originY+this.h:v>=this.originX&&v<=this.originY+this.w}}]),Axis}()},{}],3:[function(require,module,exports){"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i=this.xaxis.min&&xv<=this.xaxis.max&&yv>=this.yaxis.min&&yv<=this.yaxis.max){var x=this.xaxis.getLoc(xv),y=this.yaxis.getLoc(yv);this.last&&(this.moveMarker(this.last.x,this.last.y),this.drawLine(this.last.x,this.last.y,x,y)),this.last=new createjs.Point(x,y),this.moveMarker(x,y)}}},{key:"endPlot",value:function(){this.last=null}}]),Graph}()},{"./axis":2}],4:[function(require,module,exports){"use strict";function getParams(){var params={};return location.search&&location.search.slice(1).split("&").forEach(function(part){var pair=part.split("=");pair[0]=decodeURIComponent(pair[0]),pair[1]=decodeURIComponent(pair[1]),params[pair[0]]="undefined"!==pair[1]?pair[1]:!0}),params}function getStore(){return store.enabled?store:void alert('Local storage is not supported by your browser. Please disable "Private Mode", or upgrade to a modern browser.')}Object.defineProperty(exports,"__esModule",{value:!0});var _graph=require("./graph");Object.defineProperty(exports,"Graph",{enumerable:!0,get:function(){return _graph.Graph}}),exports.getParams=getParams,exports.getStore=getStore;var store=(require("./json2"),require("./store"))},{"./graph":3,"./json2":5,"./store":6}],5:[function(require,module,exports){"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj};"object"!==("undefined"==typeof JSON?"undefined":_typeof(JSON))&&(JSON={}),function(){function f(n){return 10>n?"0"+n:n}function this_value(){return this.valueOf()}function quote(string){return rx_escapable.lastIndex=0,rx_escapable.test(string)?'"'+string.replace(rx_escapable,function(a){var c=meta[a];return"string"==typeof c?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,partial,mind=gap,value=holder[key];switch(value&&"object"===("undefined"==typeof value?"undefined":_typeof(value))&&"function"==typeof value.toJSON&&(value=value.toJSON(key)),"function"==typeof rep&&(value=rep.call(holder,key,value)),"undefined"==typeof value?"undefined":_typeof(value)){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value)return"null";if(gap+=indent,partial=[],"[object Array]"===Object.prototype.toString.apply(value)){for(length=value.length,i=0;length>i;i+=1)partial[i]=str(i,value)||"null";return v=0===partial.length?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]",gap=mind,v}if(rep&&"object"===("undefined"==typeof rep?"undefined":_typeof(rep)))for(length=rep.length,i=0;length>i;i+=1)"string"==typeof rep[i]&&(k=rep[i],v=str(k,value),v&&partial.push(quote(k)+(gap?": ":":")+v));else for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=str(k,value),v&&partial.push(quote(k)+(gap?": ":":")+v));return v=0===partial.length?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}",gap=mind,v}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(value,replacer,space){var i;if(gap="",indent="","number"==typeof space)for(i=0;space>i;i+=1)indent+=" ";else"string"==typeof space&&(indent=space);if(rep=replacer,replacer&&"function"!=typeof replacer&&("object"!==("undefined"==typeof replacer?"undefined":_typeof(replacer))||"number"!=typeof replacer.length))throw new Error("JSON.stringify");return str("",{"":value})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(holder,key){var k,v,value=holder[key];if(value&&"object"===("undefined"==typeof value?"undefined":_typeof(value)))for(k in value)Object.prototype.hasOwnProperty.call(value,k)&&(v=walk(value,k),void 0!==v?value[k]=v:delete value[k]);return reviver.call(holder,key,value)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},{}],6:[function(require,module,exports){(function(global){"use strict";module.exports=function(){function isLocalStorageNameSupported(){try{return localStorageName in win&&win[localStorageName]}catch(err){return!1}}var storage,store={},win="undefined"!=typeof window?window:global,doc=win.document,localStorageName="localStorage",scriptTag="script";if(store.disabled=!1,store.version="1.3.20",store.set=function(key,value){},store.get=function(key,defaultVal){},store.has=function(key){return void 0!==store.get(key)},store.remove=function(key){},store.clear=function(){},store.transact=function(key,defaultVal,transactionFn){null==transactionFn&&(transactionFn=defaultVal,defaultVal=null),null==defaultVal&&(defaultVal={});var val=store.get(key,defaultVal);transactionFn(val),store.set(key,val)},store.getAll=function(){var ret={};return store.forEach(function(key,val){ret[key]=val}),ret},store.forEach=function(){},store.serialize=function(value){return JSON.stringify(value)},store.deserialize=function(value){if("string"==typeof value)try{return JSON.parse(value)}catch(e){return value||void 0}},isLocalStorageNameSupported())storage=win[localStorageName],store.set=function(key,val){return void 0===val?store.remove(key):(storage.setItem(key,store.serialize(val)),val)},store.get=function(key,defaultVal){var val=store.deserialize(storage.getItem(key));return void 0===val?defaultVal:val},store.remove=function(key){storage.removeItem(key)},store.clear=function(){storage.clear()},store.forEach=function(callback){for(var i=0;idocument.w=window'),storageContainer.close(),storageOwner=storageContainer.w.frames[0].document,storage=storageOwner.createElement("div")}catch(e){storage=doc.createElement("div"),storageOwner=doc.body}var withIEStorage=function(storeFunction){return function(){var args=Array.prototype.slice.call(arguments,0);args.unshift(storage),storageOwner.appendChild(storage),storage.addBehavior("#default#userData"),storage.load(localStorageName);var result=storeFunction.apply(store,args);return storageOwner.removeChild(storage),result}},forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),ieKeyFix=function(key){return key.replace(/^d/,"___$&").replace(forbiddenCharsRegex,"___")};store.set=withIEStorage(function(storage,key,val){return key=ieKeyFix(key),void 0===val?store.remove(key):(storage.setAttribute(key,store.serialize(val)),storage.save(localStorageName),val)}),store.get=withIEStorage(function(storage,key,defaultVal){key=ieKeyFix(key);var val=store.deserialize(storage.getAttribute(key));return void 0===val?defaultVal:val}),store.remove=withIEStorage(function(storage,key){key=ieKeyFix(key),storage.removeAttribute(key),storage.save(localStorageName)}),store.clear=withIEStorage(function(storage){var attributes=storage.XMLDocument.documentElement.attributes;storage.load(localStorageName);for(var i=attributes.length-1;i>=0;i--)storage.removeAttribute(attributes[i].name);storage.save(localStorageName)}),store.forEach=withIEStorage(function(storage,callback){for(var attr,attributes=storage.XMLDocument.documentElement.attributes,i=0;attr=attributes[i];++i)callback(attr.name,store.deserialize(storage.getAttribute(attr.name)))})}try{var testKey="__storejs__";store.set(testKey,testKey),store.get(testKey)!=testKey&&(store.disabled=!0),store.remove(testKey)}catch(e){store.disabled=!0}return store.enabled=!store.disabled,store}()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(require,module,exports){(function(global){!function(root){function error(type){throw new RangeError(errors[type])}function map(array,fn){for(var length=array.length,result=[];length--;)result[length]=fn(array[length]);return result}function mapDomain(string,fn){var parts=string.split("@"),result="";parts.length>1&&(result=parts[0]+"@",string=parts[1]),string=string.replace(regexSeparators,".");var labels=string.split("."),encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){for(var value,extra,output=[],counter=0,length=string.length;length>counter;)value=string.charCodeAt(counter++),value>=55296&&56319>=value&&length>counter?(extra=string.charCodeAt(counter++),56320==(64512&extra)?output.push(((1023&value)<<10)+(1023&extra)+65536):(output.push(value), +counter--)):output.push(value);return output}function ucs2encode(array){return map(array,function(value){var output="";return value>65535&&(value-=65536,output+=stringFromCharCode(value>>>10&1023|55296),value=56320|1023&value),output+=stringFromCharCode(value)}).join("")}function basicToDigit(codePoint){return 10>codePoint-48?codePoint-22:26>codePoint-65?codePoint-65:26>codePoint-97?codePoint-97:base}function digitToBasic(digit,flag){return digit+22+75*(26>digit)-((0!=flag)<<5)}function adapt(delta,numPoints,firstTime){var k=0;for(delta=firstTime?floor(delta/damp):delta>>1,delta+=floor(delta/numPoints);delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+skew))}function decode(input){var out,basic,j,index,oldi,w,k,digit,t,baseMinusT,output=[],inputLength=input.length,i=0,n=initialN,bias=initialBias;for(basic=input.lastIndexOf(delimiter),0>basic&&(basic=0),j=0;basic>j;++j)input.charCodeAt(j)>=128&&error("not-basic"),output.push(input.charCodeAt(j));for(index=basic>0?basic+1:0;inputLength>index;){for(oldi=i,w=1,k=base;index>=inputLength&&error("invalid-input"),digit=basicToDigit(input.charCodeAt(index++)),(digit>=base||digit>floor((maxInt-i)/w))&&error("overflow"),i+=digit*w,t=bias>=k?tMin:k>=bias+tMax?tMax:k-bias,!(t>digit);k+=base)baseMinusT=base-t,w>floor(maxInt/baseMinusT)&&error("overflow"),w*=baseMinusT;out=output.length+1,bias=adapt(i-oldi,out,0==oldi),floor(i/out)>maxInt-n&&error("overflow"),n+=floor(i/out),i%=out,output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,inputLength,handledCPCountPlusOne,baseMinusT,qMinusT,output=[];for(input=ucs2decode(input),inputLength=input.length,n=initialN,delta=0,bias=initialBias,j=0;inputLength>j;++j)currentValue=input[j],128>currentValue&&output.push(stringFromCharCode(currentValue));for(handledCPCount=basicLength=output.length,basicLength&&output.push(delimiter);inputLength>handledCPCount;){for(m=maxInt,j=0;inputLength>j;++j)currentValue=input[j],currentValue>=n&&m>currentValue&&(m=currentValue);for(handledCPCountPlusOne=handledCPCount+1,m-n>floor((maxInt-delta)/handledCPCountPlusOne)&&error("overflow"),delta+=(m-n)*handledCPCountPlusOne,n=m,j=0;inputLength>j;++j)if(currentValue=input[j],n>currentValue&&++delta>maxInt&&error("overflow"),currentValue==n){for(q=delta,k=base;t=bias>=k?tMin:k>=bias+tMax?tMax:k-bias,!(t>q);k+=base)qMinusT=q-t,baseMinusT=base-t,output.push(stringFromCharCode(digitToBasic(t+qMinusT%baseMinusT,0))),q=floor(qMinusT/baseMinusT);output.push(stringFromCharCode(digitToBasic(q,0))),bias=adapt(delta,handledCPCountPlusOne,handledCPCount==basicLength),delta=0,++handledCPCount}++delta,++n}return output.join("")}function toUnicode(input){return mapDomain(input,function(string){return regexPunycode.test(string)?decode(string.slice(4).toLowerCase()):string})}function toASCII(input){return mapDomain(input,function(string){return regexNonASCII.test(string)?"xn--"+encode(string):string})}var freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule="object"==typeof module&&module&&!module.nodeType&&module,freeGlobal="object"==typeof global&&global;(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)&&(root=freeGlobal);var punycode,key,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\x20-\x7E]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=base-tMin,floor=Math.floor,stringFromCharCode=String.fromCharCode;if(punycode={version:"1.3.2",ucs2:{decode:ucs2decode,encode:ucs2encode},decode:decode,encode:encode,toASCII:toASCII,toUnicode:toUnicode},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return punycode});else if(freeExports&&freeModule)if(module.exports==freeExports)freeModule.exports=punycode;else for(key in punycode)punycode.hasOwnProperty(key)&&(freeExports[key]=punycode[key]);else root.punycode=punycode}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(require,module,exports){"use strict";function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}module.exports=function(qs,sep,eq,options){sep=sep||"&",eq=eq||"=";var obj={};if("string"!=typeof qs||0===qs.length)return obj;var regexp=/\+/g;qs=qs.split(sep);var maxKeys=1e3;options&&"number"==typeof options.maxKeys&&(maxKeys=options.maxKeys);var len=qs.length;maxKeys>0&&len>maxKeys&&(len=maxKeys);for(var i=0;len>i;++i){var kstr,vstr,k,v,x=qs[i].replace(regexp,"%20"),idx=x.indexOf(eq);idx>=0?(kstr=x.substr(0,idx),vstr=x.substr(idx+1)):(kstr=x,vstr=""),k=decodeURIComponent(kstr),v=decodeURIComponent(vstr),hasOwnProperty(obj,k)?isArray(obj[k])?obj[k].push(v):obj[k]=[obj[k],v]:obj[k]=v}return obj};var isArray=Array.isArray||function(xs){return"[object Array]"===Object.prototype.toString.call(xs)}},{}],9:[function(require,module,exports){"use strict";function map(xs,f){if(xs.map)return xs.map(f);for(var res=[],i=0;i",'"',"`"," ","\r","\n"," "],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},querystring=require("querystring");Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=-1!==queryIndex&&queryIndexhec)&&(hostEnd=hec)}var auth,atSign;atSign=-1===hostEnd?rest.lastIndexOf("@"):rest.lastIndexOf("@",hostEnd),-1!==atSign&&(auth=rest.slice(0,atSign),rest=rest.slice(atSign+1),this.auth=decodeURIComponent(auth)),hostEnd=-1;for(var i=0;ihec)&&(hostEnd=hec)}-1===hostEnd&&(hostEnd=rest.length),this.host=rest.slice(0,hostEnd),rest=rest.slice(hostEnd),this.parseHost(),this.hostname=this.hostname||"";var ipv6Hostname="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!ipv6Hostname)for(var hostparts=this.hostname.split(/\./),i=0,l=hostparts.length;l>i;i++){var part=hostparts[i];if(part&&!part.match(hostnamePartPattern)){for(var newpart="",j=0,k=part.length;k>j;j++)newpart+=part.charCodeAt(j)>127?"x":part[j];if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i),notHost=hostparts.slice(i+1),bit=part.match(hostnamePartStart);bit&&(validParts.push(bit[1]),notHost.unshift(bit[2])),notHost.length&&(rest="/"+notHost.join(".")+rest),this.hostname=validParts.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),ipv6Hostname||(this.hostname=punycode.toASCII(this.hostname));var p=this.port?":"+this.port:"",h=this.hostname||"";this.host=h+p,this.href+=this.host,ipv6Hostname&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==rest[0]&&(rest="/"+rest))}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;l>i;i++){var ae=autoEscape[i];if(-1!==rest.indexOf(ae)){var esc=encodeURIComponent(ae);esc===ae&&(esc=escape(ae)),rest=rest.split(ae).join(esc)}}var hash=rest.indexOf("#");-1!==hash&&(this.hash=rest.substr(hash),rest=rest.slice(0,hash));var qm=rest.indexOf("?");if(-1!==qm?(this.search=rest.substr(qm),this.query=rest.substr(qm+1),parseQueryString&&(this.query=querystring.parse(this.query)),rest=rest.slice(0,qm)):parseQueryString&&(this.search="",this.query={}),rest&&(this.pathname=rest),slashedProtocol[lowerProto]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var p=this.pathname||"",s=this.search||"";this.path=p+s}return this.href=this.format(),this},Url.prototype.format=function(){var auth=this.auth||"";auth&&(auth=encodeURIComponent(auth),auth=auth.replace(/%3A/i,":"),auth+="@");var protocol=this.protocol||"",pathname=this.pathname||"",hash=this.hash||"",host=!1,query="";this.host?host=auth+this.host:this.hostname&&(host=auth+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(host+=":"+this.port)),this.query&&util.isObject(this.query)&&Object.keys(this.query).length&&(query=querystring.stringify(this.query));var search=this.search||query&&"?"+query||"";return protocol&&":"!==protocol.substr(-1)&&(protocol+=":"),this.slashes||(!protocol||slashedProtocol[protocol])&&host!==!1?(host="//"+(host||""),pathname&&"/"!==pathname.charAt(0)&&(pathname="/"+pathname)):host||(host=""),hash&&"#"!==hash.charAt(0)&&(hash="#"+hash),search&&"?"!==search.charAt(0)&&(search="?"+search),pathname=pathname.replace(/[?#]/g,function(match){return encodeURIComponent(match)}),search=search.replace("#","%23"),protocol+host+pathname+search+hash},Url.prototype.resolve=function(relative){return this.resolveObject(urlParse(relative,!1,!0)).format()},Url.prototype.resolveObject=function(relative){if(util.isString(relative)){var rel=new Url;rel.parse(relative,!1,!0),relative=rel}for(var result=new Url,tkeys=Object.keys(this),tk=0;tk0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return result.search=relative.search,result.query=relative.query,util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.href=result.format(),result}if(!srcPath.length)return result.pathname=null,result.search?result.path="/"+result.search:result.path=null,result.href=result.format(),result;for(var last=srcPath.slice(-1)[0],hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&("."===last||".."===last)||""===last,up=0,i=srcPath.length;i>=0;i--)last=srcPath[i],"."===last?srcPath.splice(i,1):".."===last?(srcPath.splice(i,1),up++):up&&(srcPath.splice(i,1),up--);if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");!mustEndAbs||""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0)||srcPath.unshift(""),hasTrailingSlash&&"/"!==srcPath.join("/").substr(-1)&&srcPath.push("");var isAbsolute=""===srcPath[0]||srcPath[0]&&"/"===srcPath[0].charAt(0);if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):!1;authInHost&&(result.auth=authInHost.shift(),result.host=result.hostname=authInHost.shift())}return mustEndAbs=mustEndAbs||result.host&&srcPath.length,mustEndAbs&&!isAbsolute&&srcPath.unshift(""),srcPath.length?result.pathname=srcPath.join("/"):(result.pathname=null,result.path=null),util.isNull(result.pathname)&&util.isNull(result.search)||(result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"")),result.auth=relative.auth||result.auth,result.slashes=result.slashes||relative.slashes,result.href=result.format(),result},Url.prototype.parseHost=function(){var host=this.host,port=portPattern.exec(host);port&&(port=port[0],":"!==port&&(this.port=port.substr(1)),host=host.substr(0,host.length-port.length)),host&&(this.hostname=host)}},{"./util":12,punycode:7,querystring:10}],12:[function(require,module,exports){"use strict";module.exports={isString:function(arg){return"string"==typeof arg},isObject:function(arg){return"object"==typeof arg&&null!==arg},isNull:function(arg){return null===arg},isNullOrUndefined:function(arg){return null==arg}}},{}]},{},[1]); \ No newline at end of file