// Compiled by ClojureScript 1.9.562 {}
goog.provide('weathergen.ui');
goog.require('cljs.core');
goog.require('clojure.data');
goog.require('clojure.set');
goog.require('clojure.string');
goog.require('garden.core');
goog.require('javelin.core');
goog.require('hoplon.core');
goog.require('hoplon.svg');
goog.require('garden.selectors');
goog.require('goog.dom');
goog.require('goog.crypt.base64');
goog.require('goog.events');
goog.require('goog.events.MouseWheelHandler');
goog.require('goog.string');
goog.require('goog.string.format');
goog.require('goog.style');
goog.require('octet.core');
goog.require('weathergen.canvas');
goog.require('weathergen.coordinates');
goog.require('weathergen.database');
goog.require('weathergen.dtc');
goog.require('weathergen.encoding');
goog.require('weathergen.falcon.constants');
goog.require('weathergen.falcon.files.images');
goog.require('weathergen.falcon.files.mission');
goog.require('weathergen.falcon.install');
goog.require('weathergen.filesystem');
goog.require('weathergen.fmap');
goog.require('weathergen.help');
goog.require('weathergen.ipc');
goog.require('weathergen.math');
goog.require('weathergen.model');
goog.require('weathergen.progress');
goog.require('weathergen.settings');
goog.require('weathergen.time');
goog.require('weathergen.twx');
goog.require('weathergen.ui.buttons');
goog.require('weathergen.ui.common');
goog.require('weathergen.ui.grids');
goog.require('weathergen.ui.layers.flights');
goog.require('weathergen.ui.trees');
goog.require('weathergen.ui.tabs');
goog.require('weathergen.util');
goog.require('weathergen.wind');
goog.require('cljs.core.async');
goog.require('cljs.reader');
goog.require('taoensso.timbre');
weathergen.ui.revision = (7);
weathergen.ui.agents = (function (){var is_agent_QMARK_ = (function (agent){
return !((navigator.userAgent.indexOf(agent) < (0)));
});
var agent_props = new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"chrome","chrome",1718738387),"Chrome",new cljs.core.Keyword(null,"msie","msie",719469183),"MSIE",new cljs.core.Keyword(null,"trident","trident",1372708537),"Trident",new cljs.core.Keyword(null,"firefox","firefox",1283768880),"Firefox",new cljs.core.Keyword(null,"safari","safari",497115653),"Safari",new cljs.core.Keyword(null,"opera","opera",658572996),"op"], null);
return cljs.core.zipmap.call(null,cljs.core.keys.call(null,agent_props),cljs.core.map.call(null,is_agent_QMARK_,cljs.core.vals.call(null,agent_props)));
})();
weathergen.ui.safari_QMARK_ = (function (){var and__23326__auto__ = new cljs.core.Keyword(null,"safari","safari",497115653).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not.call(null,new cljs.core.Keyword(null,"chrome","chrome",1718738387).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents));
} else {
return and__23326__auto__;
}
})();
weathergen.ui.ie_QMARK_ = (function (){var or__23338__auto__ = new cljs.core.Keyword(null,"msie","msie",719469183).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return new cljs.core.Keyword(null,"trident","trident",1372708537).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
}
})();
weathergen.ui.electron = require("electron");
weathergen.ui.ipcRenderer = weathergen.ui.electron.ipcRenderer;
weathergen.ui.zlib = require("zlib");
var window_45831 = jQuery(window);
weathergen.ui.window_size = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_45831.width(),window_45831.height()], null));

window_45831.resize(((function (window_45831){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.window_size,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_45831.width(),window_45831.height()], null));
});})(window_45831))
);
weathergen.ui.default_weather_params = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"temp-uniformity","temp-uniformity",836756864),new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"evolution","evolution",944820557),new cljs.core.Keyword(null,"seed","seed",68613327),new cljs.core.Keyword(null,"feature-size","feature-size",-878734864),new cljs.core.Keyword(null,"cell-count","cell-count",-441457582),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),new cljs.core.Keyword(null,"turbulence","turbulence",-915506410),new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"wind-uniformity","wind-uniformity",827531801),new cljs.core.Keyword(null,"crossfade","crossfade",-118506406),new cljs.core.Keyword(null,"prevailing-wind","prevailing-wind",-190580386)],[0.7,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"min","min",444991522),(29),new cljs.core.Keyword(null,"max","max",61366548),(31)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"offset","offset",296498311),(1234),new cljs.core.Keyword(null,"current","current",-1088038603),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"max","max",61366548),null], null),(3600),(1234),(10),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(59),(59)], null),cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(5),new cljs.core.Keyword(null,"mean","mean",-1359234715),(10),new cljs.core.Keyword(null,"max","max",61366548),(30)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(20),new cljs.core.Keyword(null,"mean","mean",-1359234715),(22),new cljs.core.Keyword(null,"max","max",61366548),(24)], null)], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),(30),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"mean","mean",-1359234715),(7),new cljs.core.Keyword(null,"max","max",61366548),(20)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(18),new cljs.core.Keyword(null,"mean","mean",-1359234715),(21),new cljs.core.Keyword(null,"max","max",61366548),(23)], null)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),29.85,new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(10),new cljs.core.Keyword(null,"mean","mean",-1359234715),(15),new cljs.core.Keyword(null,"max","max",61366548),(30)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(15),new cljs.core.Keyword(null,"mean","mean",-1359234715),(18),new cljs.core.Keyword(null,"max","max",61366548),(21)], null)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),29.4,new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(15),new cljs.core.Keyword(null,"mean","mean",-1359234715),(25),new cljs.core.Keyword(null,"max","max",61366548),(60)], null),new cljs.core.Keyword(null,"temp","temp",1791541284),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"min","min",444991522),(12),new cljs.core.Keyword(null,"mean","mean",-1359234715),(14),new cljs.core.Keyword(null,"max","max",61366548),(16)], null)], null)], null),cljs.core.PersistentVector.EMPTY,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"size","size",1098693007),(1),new cljs.core.Keyword(null,"power","power",-937852079),(250)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(1000),(1000)], null),0.7,0.1,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(325)], null)]);
weathergen.ui.weather_params = javelin.core.cell.call(null,null);
weathergen.ui.default_cloud_params = new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170),(5),new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270),0.98,new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(30),new cljs.core.Keyword(null,"fair","fair",1684139423),(20),new cljs.core.Keyword(null,"poor","poor",1462482211),(10),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(5)], null),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(35000),new cljs.core.Keyword(null,"fair","fair",1684139423),(30000),new cljs.core.Keyword(null,"poor","poor",1462482211),(11300),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(6300)], null),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),(13300),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(0),new cljs.core.Keyword(null,"fair","fair",1684139423),(8000),new cljs.core.Keyword(null,"poor","poor",1462482211),(7500),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(2000)], null),new cljs.core.Keyword(null,"contrails","contrails",1430581743),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(34000),new cljs.core.Keyword(null,"fair","fair",1684139423),(28000),new cljs.core.Keyword(null,"poor","poor",1462482211),(25000),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(20000)], null)], null);
weathergen.ui.random_int = (function weathergen$ui$random_int(var_args){
var args45832 = [];
var len__24559__auto___45835 = arguments.length;
var i__24560__auto___45836 = (0);
while(true){
if((i__24560__auto___45836 < len__24559__auto___45835)){
args45832.push((arguments[i__24560__auto___45836]));

var G__45837 = (i__24560__auto___45836 + (1));
i__24560__auto___45836 = G__45837;
continue;
} else {
}
break;
}

var G__45834 = args45832.length;
switch (G__45834) {
case 2:
return weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args45832.length)].join('')));

}
});

weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$2 = (function (from,to){
return weathergen.ui.random_int.call(null,from,to,(1));
});

weathergen.ui.random_int.cljs$core$IFn$_invoke$arity$3 = (function (from,to,step){
var range = (to - from);
var steps = (cljs.core.long$.call(null,(range / step)) + (1));
return ((cljs.core.long$.call(null,(cljs.core.rand.call(null) * steps)) * step) + from);
});

weathergen.ui.random_int.cljs$lang$maxFixedArity = 3;

/**
 * Returns a plausible but random set of global weather paramaters.
 */
weathergen.ui.random_cloud_params = (function weathergen$ui$random_cloud_params(){
var stratus_base = (function (){var vec__45851 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),(function (){
return weathergen.ui.random_int.call(null,(1500),(40000),(500));
})));
var i = cljs.core.nth.call(null,vec__45851,(0),null);
var p = cljs.core.nth.call(null,vec__45851,(1),null);
var f = cljs.core.nth.call(null,vec__45851,(2),null);
var s = cljs.core.nth.call(null,vec__45851,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})();
var stratus_top = ((function (){var x__23676__auto__ = new cljs.core.Keyword(null,"poor","poor",1462482211).cljs$core$IFn$_invoke$arity$1(stratus_base);
var y__23677__auto__ = new cljs.core.Keyword(null,"inclement","inclement",-550669382).cljs$core$IFn$_invoke$arity$1(stratus_base);
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})() + weathergen.ui.random_int.call(null,(500),(10000),(500)));
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170),weathergen.ui.random_int.call(null,(5),(50)),new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270),(5.0 * cljs.core.rand.call(null)),new cljs.core.Keyword(null,"visibility","visibility",1338380893),(function (){var vec__45854 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),((function (stratus_base,stratus_top){
return (function (){
var r = weathergen.ui.random_int.call(null,(0),(30));
if((r < (2))){
return (weathergen.ui.random_int.call(null,(0),(20)) / 10.0);
} else {
return r;
}
});})(stratus_base,stratus_top))
));
var i = cljs.core.nth.call(null,vec__45854,(0),null);
var p = cljs.core.nth.call(null,vec__45854,(1),null);
var f = cljs.core.nth.call(null,vec__45854,(2),null);
var s = cljs.core.nth.call(null,vec__45854,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})(),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),stratus_base,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),stratus_top,new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),(function (){var vec__45857 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(3),((function (stratus_base,stratus_top){
return (function (){
return weathergen.ui.random_int.call(null,(1000),(22000),(1000));
});})(stratus_base,stratus_top))
));
var i = cljs.core.nth.call(null,vec__45857,(0),null);
var p = cljs.core.nth.call(null,vec__45857,(1),null);
var f = cljs.core.nth.call(null,vec__45857,(2),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),(0),new cljs.core.Keyword(null,"fair","fair",1684139423),(function (){var x__23683__auto__ = (new cljs.core.Keyword(null,"fair","fair",1684139423).cljs$core$IFn$_invoke$arity$1(stratus_base) - (1000));
var y__23684__auto__ = f;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})(),new cljs.core.Keyword(null,"poor","poor",1462482211),(function (){var x__23683__auto__ = (stratus_top - (1000));
var y__23684__auto__ = p;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})(),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(function (){var x__23683__auto__ = (stratus_top - (1000));
var y__23684__auto__ = i;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})()], null);
})(),new cljs.core.Keyword(null,"contrails","contrails",1430581743),(function (){var vec__45860 = cljs.core.sort.call(null,cljs.core.repeatedly.call(null,(4),((function (stratus_base,stratus_top){
return (function (){
return weathergen.ui.random_int.call(null,(20000),(40000),(1000));
});})(stratus_base,stratus_top))
));
var i = cljs.core.nth.call(null,vec__45860,(0),null);
var p = cljs.core.nth.call(null,vec__45860,(1),null);
var f = cljs.core.nth.call(null,vec__45860,(2),null);
var s = cljs.core.nth.call(null,vec__45860,(3),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),s,new cljs.core.Keyword(null,"fair","fair",1684139423),f,new cljs.core.Keyword(null,"poor","poor",1462482211),p,new cljs.core.Keyword(null,"inclement","inclement",-550669382),i], null);
})()], null);
});
weathergen.ui.cloud_params = javelin.core.cell.call(null,weathergen.ui.default_cloud_params);
weathergen.ui.movement_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"step","step",1288888124),(60),new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(135),new cljs.core.Keyword(null,"speed","speed",1257663751),(20)], null),new cljs.core.Keyword(null,"looping?","looping?",78344245),false], null));
weathergen.ui.map_size = javelin.core.formula.call(null,(function (window_size){
var vec__45863 = window_size;
var window_width = cljs.core.nth.call(null,vec__45863,(0),null);
var window_height = cljs.core.nth.call(null,vec__45863,(1),null);
var dim = (function (){var x__23676__auto__ = (250);
var y__23677__auto__ = (function (){var x__23683__auto__ = window_width;
var y__23684__auto__ = (window_height - (140));
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
})();
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})();
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dim,dim], null);
})).call(null,weathergen.ui.window_size);
weathergen.ui.display_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"opacity","opacity",397153780),0.33,new cljs.core.Keyword(null,"display","display",242065432),new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"mouse-mode","mouse-mode",-1901710690),new cljs.core.Keyword(null,"select","select",1147833503),new cljs.core.Keyword(null,"overlay","overlay",-139131598),null,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243),new cljs.core.Keyword(null,"inhg","inhg",-863180091),new cljs.core.Keyword(null,"flight-paths","flight-paths",159519268),null,new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),null,new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"to","to",192099007),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(10),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null),new cljs.core.Keyword(null,"step","step",1288888124),(15)], null)], null));
weathergen.ui.map_display = javelin.core.cell.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"flight-path-size","flight-path-size",-1809746301),new cljs.core.Keyword(null,"icon-size","icon-size",414161352),new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003),new cljs.core.Keyword(null,"brightness","brightness",1067055820),new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435),new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514),new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954),new cljs.core.Keyword(null,"text-size","text-size",-945618309),new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124)],[(0),(0),true,0.5,true,new cljs.core.Keyword(null,"all","all",892129742),true,(0),true]));
weathergen.ui.map_text_scale = javelin.core.formula.call(null,(function (G__45866,G__45867){
return G__45866.call(null,4.0,new cljs.core.Keyword(null,"text-size","text-size",-945618309).cljs$core$IFn$_invoke$arity$1(G__45867));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_icon_scale = javelin.core.formula.call(null,(function (G__45868,G__45869){
return G__45868.call(null,4.0,new cljs.core.Keyword(null,"icon-size","icon-size",414161352).cljs$core$IFn$_invoke$arity$1(G__45869));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_show_text_background_QMARK_ = javelin.core.formula.call(null,(function (G__45870){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__45870);
})).call(null,weathergen.ui.map_display);
weathergen.ui.selected_cell = javelin.core.cell.call(null,null);
weathergen.ui.hover_cell = javelin.core.cell.call(null,null);
weathergen.ui.mouse_location = javelin.core.cell.call(null,null);
weathergen.ui.mouse_raw_offset = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0)], null));
weathergen.ui.prevent_recomputation_QMARK_ = javelin.core.cell.call(null,false);
/**
 * Holds the time that's in the 'jump/set to time' boxes because we
 *   need to retain a temporary value while people are making up their
 *   minds.
 */
weathergen.ui.time_params = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),(1),new cljs.core.Keyword(null,"hour","hour",-555989214),(5),new cljs.core.Keyword(null,"minute","minute",-642875969),(0)], null)], null));
weathergen.ui.weather_data = javelin.core.cell.call(null,null);
weathergen.ui.weather_data_params = javelin.core.cell.call(null,null);
weathergen.ui.computing = javelin.core.cell.call(null,true);
weathergen.ui.messages = javelin.core.cell.call(null,cljs.core.PersistentVector.EMPTY);
weathergen.ui.mission = javelin.core.cell.call(null,null);
weathergen.ui.hide_empty_airbases_QMARK_ = javelin.core.cell.call(null,true);
weathergen.ui.hide_inoperable_airbases_QMARK_ = javelin.core.cell.call(null,false);
weathergen.ui.included_squadron_types = javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY);
weathergen.ui.checked_airbases = javelin.core.cell.call(null,cljs.core.PersistentHashSet.EMPTY);
weathergen.ui.highlighted_airbase = javelin.core.cell.call(null,null);
cljs.core.add_watch.call(null,weathergen.ui.mission,new cljs.core.Keyword(null,"reset-object-data-on-mission-change","reset-object-data-on-mission-change",1100510422),(function (_,___$1,___$2,___$3){
return javelin.core.dosync_STAR_.call(null,(function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);

return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
}));
}));
weathergen.ui.settings = javelin.core.cell.call(null,weathergen.settings.load_settings.call(null));
weathergen.ui.zoom_speed = javelin.core.formula.call(null,(function (G__45871){
var or__23338__auto__ = new cljs.core.Keyword(null,"zoom-speed","zoom-speed",1787688902).cljs$core$IFn$_invoke$arity$1(G__45871);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return 0.95;
}
})).call(null,weathergen.ui.settings);
weathergen.ui.map_zoom = javelin.core.cell.call(null,(1));
weathergen.ui.map_pan = javelin.core.cell.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0)], null));
weathergen.ui.zoom_min = (1);
weathergen.ui.zoom_max = (200);
weathergen.ui.map_viewbox = javelin.core.formula.call(null,(function (weather_params,map_zoom,map_pan){
var vec__45872 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(weather_params);
var nx = cljs.core.nth.call(null,vec__45872,(0),null);
var ny = cljs.core.nth.call(null,vec__45872,(1),null);
var map__45875 = map_pan;
var map__45875__$1 = ((((!((map__45875 == null)))?((((map__45875.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45875.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45875):map__45875);
var x = cljs.core.get.call(null,map__45875__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__45875__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(nx / map_zoom),new cljs.core.Keyword(null,"height","height",1025178622),(ny / map_zoom)], null);
})).call(null,weathergen.ui.weather_params,weathergen.ui.map_zoom,weathergen.ui.map_pan);
weathergen.ui.display_mode = javelin.core.cell.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166));
weathergen.ui.visible_sides = javelin.core.cell.call(null,null);
weathergen.ui.effective_visible_sides = javelin.core.formula.call(null,(function (mission,visible_sides,display_mode){
if(cljs.core.not.call(null,mission)){
return cljs.core.PersistentHashSet.EMPTY;
} else {
if(cljs.core.not.call(null,visible_sides)){
return cljs.core.set.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),display_mode)){
return cljs.core.set.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
} else {
return visible_sides;

}
}
}
})).call(null,weathergen.ui.mission,weathergen.ui.visible_sides,weathergen.ui.display_mode);
weathergen.ui.visible_teams = javelin.core.formula.call(null,(function (mission,effective_visible_sides){
return cljs.core.set.call(null,(cljs.core.truth_((function (){var and__23326__auto__ = mission;
if(cljs.core.truth_(and__23326__auto__)){
return effective_visible_sides;
} else {
return and__23326__auto__;
}
})())?cljs.core.map.call(null,weathergen.falcon.files.mission.team_number,cljs.core.filter.call(null,(function (p1__45877_SHARP_){
return effective_visible_sides.call(null,weathergen.falcon.files.mission.side.call(null,mission,p1__45877_SHARP_));
}),weathergen.falcon.files.mission.teams.call(null,mission))):weathergen.falcon.files.mission.teams.call(null,mission)));
})).call(null,weathergen.ui.mission,weathergen.ui.effective_visible_sides);
weathergen.ui.briefing_notes = javelin.core.cell.call(null,"");
/**
 * Parses the contents of the build.txt file into a map.
 */
weathergen.ui.parse_build_info = (function weathergen$ui$parse_build_info(build_info){
return cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.map.call(null,(function (line){
var vec__45881 = clojure.string.split.call(null,line,/=/);
var name = cljs.core.nth.call(null,vec__45881,(0),null);
var value = cljs.core.nth.call(null,vec__45881,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__23338__auto__ = name;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "";
}
})(),(function (){var or__23338__auto__ = value;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "";
}
})()], null);
}),cljs.core.remove.call(null,clojure.string.blank_QMARK_,clojure.string.split_lines.call(null,build_info))));
});
weathergen.ui.build_info = javelin.core.cell.call(null,(function (){var path = weathergen.filesystem.path_combine.call(null,weathergen.ui.electron.remote.app.getAppPath(),"build.txt");
if(cljs.core.truth_(weathergen.filesystem.exists_QMARK_.call(null,path))){
return weathergen.ui.parse_build_info.call(null,weathergen.filesystem.file_text.call(null,path));
} else {
return null;
}
})());
weathergen.ui.flight_paths_layer = weathergen.ui.layers.flights.create.call(null,weathergen.ui.mission,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"map-zoom","map-zoom",1543291337),weathergen.ui.map_zoom,new cljs.core.Keyword(null,"map-text-scale","map-text-scale",1420206123),weathergen.ui.map_text_scale,new cljs.core.Keyword(null,"map-show-text-background?","map-show-text-background?",409410295),weathergen.ui.map_show_text_background_QMARK_,new cljs.core.Keyword(null,"visible-teams","visible-teams",-110455752),weathergen.ui.visible_teams], null));
weathergen.ui.selected_cell_weather = javelin.core.formula.call(null,(function (G__45884,G__45886,G__45885){
return G__45884.call(null,G__45885,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__45886));
})).call(null,cljs.core.get,weathergen.ui.selected_cell,weathergen.ui.weather_data);
weathergen.ui.cell_count = javelin.core.formula.call(null,(function (G__45887){
return new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(G__45887);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.wind_stability_areas = javelin.core.formula.call(null,(function (G__45888){
return new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__45888);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.weather_overrides = javelin.core.formula.call(null,(function (G__45889){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__45889);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.forecast = javelin.core.formula.call(null,(function (selected_cell,weather_params,movement_params){
var timer_name__15521__auto__ = "computing forecast";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (cljs.core.truth_(selected_cell)?weathergen.model.forecast.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(selected_cell),(function (){var temp__5276__auto__ = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(weather_params));
if(cljs.core.truth_(temp__5276__auto__)){
var max_time = temp__5276__auto__;
return weathergen.model.jump_to_time.call(null,weather_params,movement_params,max_time);
} else {
return weather_params;
}
})(),movement_params,(60),(6)):null);
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})).call(null,weathergen.ui.selected_cell,weathergen.ui.weather_params,weathergen.ui.movement_params);
weathergen.ui.location_type = javelin.core.formula.call(null,(function (G__45891,G__45890){
if(cljs.core.truth_(G__45890.call(null,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__45891)))){
return new cljs.core.Keyword(null,"named","named",-422393479);
} else {
if(cljs.core.truth_(new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__45891))){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668);
} else {
return new cljs.core.Keyword(null,"none","none",1333468478);

}
}
})).call(null,weathergen.ui.selected_cell,cljs.core.not_empty);
weathergen.ui.pressure_unit = javelin.core.formula.call(null,(function (G__45892){
return new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(G__45892);
})).call(null,weathergen.ui.display_params);
weathergen.ui.all_squadrons = javelin.core.formula.call(null,(function (G__45895,G__45894,G__45893,G__45896){
return G__45893.call(null,cljs.core.PersistentHashSet.EMPTY,G__45894.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110),new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__45895.call(null,G__45896))));
})).call(null,weathergen.falcon.files.mission.order_of_battle,cljs.core.mapcat,cljs.core.into,weathergen.ui.mission);
weathergen.ui.all_squadron_types = javelin.core.formula.call(null,(function (G__45899,G__45898,G__45902,G__45901,G__45900){
return G__45898.call(null,cljs.core.PersistentHashSet.EMPTY,G__45899.call(null,(function (p1__45897_SHARP_){
return G__45900.call(null,G__45901,p1__45897_SHARP_);
}),G__45902));
})).call(null,cljs.core.map,cljs.core.into,weathergen.ui.all_squadrons,weathergen.ui.mission,weathergen.falcon.files.mission.squadron_type);
weathergen.ui.included_squadrons = javelin.core.formula.call(null,(function (G__45904,G__45909,G__45906,G__45908,G__45907,G__45905){
return G__45904.call(null,G__45905.call(null,(function (p1__45903_SHARP_){
return G__45906.call(null,G__45907.call(null,G__45908,p1__45903_SHARP_));
}),G__45909));
})).call(null,cljs.core.set,weathergen.ui.all_squadrons,weathergen.ui.included_squadron_types,weathergen.ui.mission,weathergen.falcon.files.mission.squadron_type,cljs.core.filter);
cljs.core.add_watch.call(null,weathergen.ui.all_squadron_types,new cljs.core.Keyword(null,"update-included-squadron-types","update-included-squadron-types",-1854825437),(function (_,___$1,___$2,n){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,n);
}));
/**
 * Return true if an airbase be shown in the list of airbases.
 */
weathergen.ui.list_airbase_QMARK_ = (function weathergen$ui$list_airbase_QMARK_(airbase,hide_empty_QMARK_,hide_inoperable_QMARK_,included_squadrons){
var is_empty_QMARK_ = (cljs.core.count.call(null,cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase))) === (0));
var is_inoperable_QMARK_ = (new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(airbase) === (0));
var hide_QMARK_ = (function (){var or__23338__auto__ = (function (){var and__23326__auto__ = is_empty_QMARK_;
if(and__23326__auto__){
return hide_empty_QMARK_;
} else {
return and__23326__auto__;
}
})();
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
var and__23326__auto__ = is_inoperable_QMARK_;
if(and__23326__auto__){
return hide_inoperable_QMARK_;
} else {
return and__23326__auto__;
}
}
})();
return cljs.core.not.call(null,hide_QMARK_);
});
weathergen.ui.all_airbases = javelin.core.formula.call(null,(function (G__45912,G__45911){
var G__45910 = G__45911;
var G__45910__$1 = (cljs.core.truth_((G__45910 == null))?null:G__45912.call(null,G__45910));
if(cljs.core.truth_((G__45910__$1 == null))){
return null;
} else {
return new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__45910__$1);
}
})).call(null,weathergen.falcon.files.mission.order_of_battle,weathergen.ui.mission);
weathergen.ui.listed_airbases = javelin.core.formula.call(null,(function (all_airbases,hide_empty_airbases_QMARK_,hide_inoperable_airbases_QMARK_,included_squadrons){
return cljs.core.set.call(null,cljs.core.filter.call(null,(function (p1__45913_SHARP_){
return weathergen.ui.list_airbase_QMARK_.call(null,p1__45913_SHARP_,hide_empty_airbases_QMARK_,hide_inoperable_airbases_QMARK_,included_squadrons);
}),all_airbases));
})).call(null,weathergen.ui.all_airbases,weathergen.ui.hide_empty_airbases_QMARK_,weathergen.ui.hide_inoperable_airbases_QMARK_,weathergen.ui.included_squadrons);
weathergen.ui.displayed_airbases = javelin.core.formula.call(null,(function (checked_airbases,listed_airbases){
return clojure.set.intersection.call(null,checked_airbases,listed_airbases);
})).call(null,weathergen.ui.checked_airbases,weathergen.ui.listed_airbases);
weathergen.ui.worker_count = (4);
weathergen.ui.workers = (function (){var all_cells = (function (){var iter__24200__auto__ = (function weathergen$ui$iter__45914(s__45915){
return (new cljs.core.LazySeq(null,(function (){
var s__45915__$1 = s__45915;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__45915__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__45915__$1,x,xs__5831__auto__,temp__5278__auto__){
return (function weathergen$ui$iter__45914_$_iter__45916(s__45917){
return (new cljs.core.LazySeq(null,((function (s__45915__$1,x,xs__5831__auto__,temp__5278__auto__){
return (function (){
var s__45917__$1 = s__45917;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__45917__$1);
if(temp__5278__auto____$1){
var s__45917__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__45917__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__45917__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__45919 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__45918 = (0);
while(true){
if((i__45918 < size__24199__auto__)){
var y = cljs.core._nth.call(null,c__24198__auto__,i__45918);
cljs.core.chunk_append.call(null,b__45919,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__45920 = (i__45918 + (1));
i__45918 = G__45920;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45919),weathergen$ui$iter__45914_$_iter__45916.call(null,cljs.core.chunk_rest.call(null,s__45917__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45919),null);
}
} else {
var y = cljs.core.first.call(null,s__45917__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$iter__45914_$_iter__45916.call(null,cljs.core.rest.call(null,s__45917__$2)));
}
} else {
return null;
}
break;
}
});})(s__45915__$1,x,xs__5831__auto__,temp__5278__auto__))
,null,null));
});})(s__45915__$1,x,xs__5831__auto__,temp__5278__auto__))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,cljs.core.range.call(null,(59))));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$iter__45914.call(null,cljs.core.rest.call(null,s__45915__$1)));
} else {
var G__45921 = cljs.core.rest.call(null,s__45915__$1);
s__45915__$1 = G__45921;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,cljs.core.range.call(null,(59)));
})();
return cljs.core.map.call(null,((function (all_cells){
return (function (n,cells){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"worker","worker",938239996),(new Worker("worker.js")),new cljs.core.Keyword(null,"n","n",562130025),n,new cljs.core.Keyword(null,"ch","ch",-554717905),cljs.core.async.chan.call(null),new cljs.core.Keyword(null,"cells","cells",-985166822),cells], null);
});})(all_cells))
,cljs.core.range.call(null,weathergen.ui.worker_count),cljs.core.partition_all.call(null,(((59) * (59)) / weathergen.ui.worker_count),all_cells));
})();
weathergen.ui.command_ch = cljs.core.async.chan.call(null,cljs.core.async.dropping_buffer.call(null,(1)));
var seq__45922_45958 = cljs.core.seq.call(null,weathergen.ui.workers);
var chunk__45923_45959 = null;
var count__45924_45960 = (0);
var i__45925_45961 = (0);
while(true){
if((i__45925_45961 < count__45924_45960)){
var map__45926_45962 = cljs.core._nth.call(null,chunk__45923_45959,i__45925_45961);
var map__45926_45963__$1 = ((((!((map__45926_45962 == null)))?((((map__45926_45962.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45926_45962.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45926_45962):map__45926_45962);
var worker_45964 = cljs.core.get.call(null,map__45926_45963__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_45965 = cljs.core.get.call(null,map__45926_45963__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_45964.onmessage = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function (e){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function (state_45933){
var state_val_45934 = (state_45933[(1)]);
if((state_val_45934 === (1))){
var inst_45928 = (e["data"]);
var inst_45929 = weathergen.encoding.decode.call(null,inst_45928);
var state_45933__$1 = state_45933;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_45933__$1,(2),ch_45965,inst_45929);
} else {
if((state_val_45934 === (2))){
var inst_45931 = (state_45933[(2)]);
var state_45933__$1 = state_45933;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_45933__$1,inst_45931);
} else {
return null;
}
}
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
;
return ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_45938 = [null,null,null,null,null,null,null];
(statearr_45938[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_45938[(1)] = (1));

return statearr_45938;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_45933){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_45933);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e45939){if((e45939 instanceof Object)){
var ex__40764__auto__ = e45939;
var statearr_45940_45966 = state_45933;
(statearr_45940_45966[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_45933);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e45939;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__45967 = state_45933;
state_45933 = G__45967;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_45933){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_45933);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
})();
var state__40876__auto__ = (function (){var statearr_45941 = f__40875__auto__.call(null);
(statearr_45941[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_45941;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
);

return c__40874__auto__;
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45926_45962,map__45926_45963__$1,worker_45964,ch_45965))
;

var G__45968 = seq__45922_45958;
var G__45969 = chunk__45923_45959;
var G__45970 = count__45924_45960;
var G__45971 = (i__45925_45961 + (1));
seq__45922_45958 = G__45968;
chunk__45923_45959 = G__45969;
count__45924_45960 = G__45970;
i__45925_45961 = G__45971;
continue;
} else {
var temp__5278__auto___45972 = cljs.core.seq.call(null,seq__45922_45958);
if(temp__5278__auto___45972){
var seq__45922_45973__$1 = temp__5278__auto___45972;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__45922_45973__$1)){
var c__24249__auto___45974 = cljs.core.chunk_first.call(null,seq__45922_45973__$1);
var G__45975 = cljs.core.chunk_rest.call(null,seq__45922_45973__$1);
var G__45976 = c__24249__auto___45974;
var G__45977 = cljs.core.count.call(null,c__24249__auto___45974);
var G__45978 = (0);
seq__45922_45958 = G__45975;
chunk__45923_45959 = G__45976;
count__45924_45960 = G__45977;
i__45925_45961 = G__45978;
continue;
} else {
var map__45942_45979 = cljs.core.first.call(null,seq__45922_45973__$1);
var map__45942_45980__$1 = ((((!((map__45942_45979 == null)))?((((map__45942_45979.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45942_45979.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45942_45979):map__45942_45979);
var worker_45981 = cljs.core.get.call(null,map__45942_45980__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_45982 = cljs.core.get.call(null,map__45942_45980__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_45981.onmessage = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function (e){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function (state_45949){
var state_val_45950 = (state_45949[(1)]);
if((state_val_45950 === (1))){
var inst_45944 = (e["data"]);
var inst_45945 = weathergen.encoding.decode.call(null,inst_45944);
var state_45949__$1 = state_45949;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_45949__$1,(2),ch_45982,inst_45945);
} else {
if((state_val_45950 === (2))){
var inst_45947 = (state_45949[(2)]);
var state_45949__$1 = state_45949;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_45949__$1,inst_45947);
} else {
return null;
}
}
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
;
return ((function (seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_45954 = [null,null,null,null,null,null,null];
(statearr_45954[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_45954[(1)] = (1));

return statearr_45954;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_45949){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_45949);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e45955){if((e45955 instanceof Object)){
var ex__40764__auto__ = e45955;
var statearr_45956_45983 = state_45949;
(statearr_45956_45983[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_45949);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e45955;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__45984 = state_45949;
state_45949 = G__45984;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_45949){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_45949);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,switch__40760__auto__,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
})();
var state__40876__auto__ = (function (){var statearr_45957 = f__40875__auto__.call(null);
(statearr_45957[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_45957;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,c__40874__auto__,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
);

return c__40874__auto__;
});})(seq__45922_45958,chunk__45923_45959,count__45924_45960,i__45925_45961,map__45942_45979,map__45942_45980__$1,worker_45981,ch_45982,seq__45922_45973__$1,temp__5278__auto___45972))
;

var G__45985 = cljs.core.next.call(null,seq__45922_45973__$1);
var G__45986 = null;
var G__45987 = (0);
var G__45988 = (0);
seq__45922_45958 = G__45985;
chunk__45923_45959 = G__45986;
count__45924_45960 = G__45987;
i__45925_45961 = G__45988;
continue;
}
} else {
}
}
break;
}
/**
 * Helper function to post a message to a worker. Needed because the
 *   go-loop rewrites code so much I can't get type hints to work inside
 *   it.
 */
weathergen.ui.post_message = (function weathergen$ui$post_message(worker,message){
return worker.postMessage(message);
});
var c__40874__auto___46231 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto___46231){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto___46231){
return (function (state_46153){
var state_val_46154 = (state_46153[(1)]);
if((state_val_46154 === (7))){
var inst_46005 = (state_46153[(7)]);
var inst_46011 = (state_46153[(8)]);
var inst_46003 = (state_46153[(9)]);
var inst_46011__$1 = cljs.core._nth.call(null,inst_46003,inst_46005);
var inst_46013 = (inst_46011__$1 == null);
var inst_46014 = cljs.core.not.call(null,inst_46013);
var state_46153__$1 = (function (){var statearr_46155 = state_46153;
(statearr_46155[(8)] = inst_46011__$1);

return statearr_46155;
})();
if(inst_46014){
var statearr_46156_46232 = state_46153__$1;
(statearr_46156_46232[(1)] = (10));

} else {
var statearr_46157_46233 = state_46153__$1;
(statearr_46157_46233[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (20))){
var state_46153__$1 = state_46153;
var statearr_46158_46234 = state_46153__$1;
(statearr_46158_46234[(2)] = null);

(statearr_46158_46234[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (27))){
var inst_46067 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46067)){
var statearr_46159_46235 = state_46153__$1;
(statearr_46159_46235[(1)] = (31));

} else {
var statearr_46160_46236 = state_46153__$1;
(statearr_46160_46236[(1)] = (32));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (1))){
var state_46153__$1 = state_46153;
var statearr_46161_46237 = state_46153__$1;
(statearr_46161_46237[(2)] = null);

(statearr_46161_46237[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (24))){
var inst_46081 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46162_46238 = state_46153__$1;
(statearr_46162_46238[(2)] = inst_46081);

(statearr_46162_46238[(1)] = (21));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (39))){
var inst_46105 = cljs.core.async.timeout.call(null,(500));
var state_46153__$1 = state_46153;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46153__$1,(42),inst_46105);
} else {
if((state_val_46154 === (46))){
var inst_46095 = (state_46153[(10)]);
var inst_46096 = (state_46153[(11)]);
var inst_46137 = (state_46153[(2)]);
var inst_46138 = cljs.core.nth.call(null,inst_46137,(0),null);
var inst_46139 = cljs.core.nth.call(null,inst_46137,(1),null);
var inst_46140 = cljs.core.disj.call(null,inst_46095,inst_46139);
var inst_46141 = cljs.core.merge.call(null,inst_46096,inst_46138);
var inst_46095__$1 = inst_46140;
var inst_46096__$1 = inst_46141;
var state_46153__$1 = (function (){var statearr_46163 = state_46153;
(statearr_46163[(10)] = inst_46095__$1);

(statearr_46163[(11)] = inst_46096__$1);

return statearr_46163;
})();
var statearr_46164_46239 = state_46153__$1;
(statearr_46164_46239[(2)] = null);

(statearr_46164_46239[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (4))){
var inst_45994 = (state_46153[(12)]);
var inst_45994__$1 = (state_46153[(2)]);
var inst_45995 = cljs.core.nth.call(null,inst_45994__$1,(0),null);
var inst_45996 = cljs.core.nth.call(null,inst_45994__$1,(1),null);
var inst_46001 = cljs.core.seq.call(null,weathergen.ui.workers);
var inst_46002 = inst_46001;
var inst_46003 = null;
var inst_46004 = (0);
var inst_46005 = (0);
var state_46153__$1 = (function (){var statearr_46165 = state_46153;
(statearr_46165[(7)] = inst_46005);

(statearr_46165[(13)] = inst_46002);

(statearr_46165[(12)] = inst_45994__$1);

(statearr_46165[(14)] = inst_45995);

(statearr_46165[(15)] = inst_45996);

(statearr_46165[(16)] = inst_46004);

(statearr_46165[(9)] = inst_46003);

return statearr_46165;
})();
var statearr_46166_46240 = state_46153__$1;
(statearr_46166_46240[(2)] = null);

(statearr_46166_46240[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (15))){
var inst_46024 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46167_46241 = state_46153__$1;
(statearr_46167_46241[(2)] = inst_46024);

(statearr_46167_46241[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (21))){
var inst_46084 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46168_46242 = state_46153__$1;
(statearr_46168_46242[(2)] = inst_46084);

(statearr_46168_46242[(1)] = (9));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (31))){
var inst_46051 = (state_46153[(17)]);
var inst_46069 = cljs.core.apply.call(null,cljs.core.hash_map,inst_46051);
var state_46153__$1 = state_46153;
var statearr_46169_46243 = state_46153__$1;
(statearr_46169_46243[(2)] = inst_46069);

(statearr_46169_46243[(1)] = (33));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (32))){
var inst_46051 = (state_46153[(17)]);
var state_46153__$1 = state_46153;
var statearr_46170_46244 = state_46153__$1;
(statearr_46170_46244[(2)] = inst_46051);

(statearr_46170_46244[(1)] = (33));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (40))){
var state_46153__$1 = state_46153;
var statearr_46171_46245 = state_46153__$1;
(statearr_46171_46245[(2)] = null);

(statearr_46171_46245[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (33))){
var inst_46041 = (state_46153[(18)]);
var inst_45996 = (state_46153[(15)]);
var inst_46072 = (state_46153[(2)]);
var inst_46073 = cljs.core.get.call(null,inst_46072,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_46074 = cljs.core.get.call(null,inst_46072,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_46075 = cljs.core.assoc.call(null,inst_45996,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_46073);
var inst_46076 = weathergen.encoding.encode.call(null,inst_46075);
var inst_46077 = weathergen.ui.post_message.call(null,inst_46074,inst_46076);
var inst_46078 = cljs.core.next.call(null,inst_46041);
var inst_46002 = inst_46078;
var inst_46003 = null;
var inst_46004 = (0);
var inst_46005 = (0);
var state_46153__$1 = (function (){var statearr_46172 = state_46153;
(statearr_46172[(7)] = inst_46005);

(statearr_46172[(13)] = inst_46002);

(statearr_46172[(19)] = inst_46077);

(statearr_46172[(16)] = inst_46004);

(statearr_46172[(9)] = inst_46003);

return statearr_46172;
})();
var statearr_46173_46246 = state_46153__$1;
(statearr_46173_46246[(2)] = null);

(statearr_46173_46246[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (13))){
var state_46153__$1 = state_46153;
var statearr_46174_46247 = state_46153__$1;
(statearr_46174_46247[(2)] = true);

(statearr_46174_46247[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (22))){
var inst_46041 = (state_46153[(18)]);
var inst_46045 = cljs.core.chunk_first.call(null,inst_46041);
var inst_46046 = cljs.core.chunk_rest.call(null,inst_46041);
var inst_46047 = cljs.core.count.call(null,inst_46045);
var inst_46002 = inst_46046;
var inst_46003 = inst_46045;
var inst_46004 = inst_46047;
var inst_46005 = (0);
var state_46153__$1 = (function (){var statearr_46175 = state_46153;
(statearr_46175[(7)] = inst_46005);

(statearr_46175[(13)] = inst_46002);

(statearr_46175[(16)] = inst_46004);

(statearr_46175[(9)] = inst_46003);

return statearr_46175;
})();
var statearr_46176_46248 = state_46153__$1;
(statearr_46176_46248[(2)] = null);

(statearr_46176_46248[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (36))){
var inst_46095 = (state_46153[(10)]);
var inst_45994 = (state_46153[(12)]);
var inst_45995 = (state_46153[(14)]);
var inst_46096 = (state_46153[(11)]);
var inst_46091 = (state_46153[(20)]);
var inst_45996 = (state_46153[(15)]);
var inst_46100 = (function (){var vec__45990 = inst_45994;
var command = inst_45995;
var params = inst_45996;
var timer_name__15521__auto__ = "Receive weather results";
var ignore__15522__auto__ = inst_46091;
var chs = inst_46095;
var data = inst_46096;
return ((function (vec__45990,command,params,timer_name__15521__auto__,ignore__15522__auto__,chs,data,inst_46095,inst_45994,inst_45995,inst_46096,inst_46091,inst_45996,state_val_46154,c__40874__auto___46231){
return (function (){
console.timeEnd("compute-weather");

cljs.core.reset_BANG_.call(null,weathergen.ui.weather_data,data);

return cljs.core.reset_BANG_.call(null,weathergen.ui.weather_data_params,params);
});
;})(vec__45990,command,params,timer_name__15521__auto__,ignore__15522__auto__,chs,data,inst_46095,inst_45994,inst_45995,inst_46096,inst_46091,inst_45996,state_val_46154,c__40874__auto___46231))
})();
var inst_46101 = javelin.core.dosync_STAR_.call(null,inst_46100);
var inst_46102 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_46103 = new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(inst_46102);
var state_46153__$1 = (function (){var statearr_46177 = state_46153;
(statearr_46177[(21)] = inst_46101);

return statearr_46177;
})();
if(cljs.core.truth_(inst_46103)){
var statearr_46178_46249 = state_46153__$1;
(statearr_46178_46249[(1)] = (39));

} else {
var statearr_46179_46250 = state_46153__$1;
(statearr_46179_46250[(1)] = (40));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (41))){
var inst_46130 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46180_46251 = state_46153__$1;
(statearr_46180_46251[(2)] = inst_46130);

(statearr_46180_46251[(1)] = (38));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (43))){
var inst_46118 = ((-60) * (6));
var inst_46119 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_46120 = new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(inst_46119);
var inst_46121 = (inst_46118 / inst_46120);
var inst_46122 = Math.floor(inst_46121);
var inst_46123 = weathergen.ui.move.call(null,inst_46122);
var state_46153__$1 = state_46153;
var statearr_46181_46252 = state_46153__$1;
(statearr_46181_46252[(2)] = inst_46123);

(statearr_46181_46252[(1)] = (45));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (29))){
var state_46153__$1 = state_46153;
var statearr_46182_46253 = state_46153__$1;
(statearr_46182_46253[(2)] = false);

(statearr_46182_46253[(1)] = (30));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (44))){
var inst_46125 = weathergen.ui.move.call(null,(1));
var state_46153__$1 = state_46153;
var statearr_46183_46254 = state_46153__$1;
(statearr_46183_46254[(2)] = inst_46125);

(statearr_46183_46254[(1)] = (45));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (6))){
var inst_46088 = (state_46153[(2)]);
var inst_46089 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,true);
var inst_46090 = console.time("compute-weather");
var inst_46091 = console.time("Receive weather results");
var inst_46092 = cljs.core.map.call(null,new cljs.core.Keyword(null,"ch","ch",-554717905),weathergen.ui.workers);
var inst_46093 = cljs.core.set.call(null,inst_46092);
var inst_46094 = cljs.core.PersistentHashMap.EMPTY;
var inst_46095 = inst_46093;
var inst_46096 = inst_46094;
var state_46153__$1 = (function (){var statearr_46184 = state_46153;
(statearr_46184[(10)] = inst_46095);

(statearr_46184[(22)] = inst_46090);

(statearr_46184[(11)] = inst_46096);

(statearr_46184[(23)] = inst_46089);

(statearr_46184[(24)] = inst_46088);

(statearr_46184[(20)] = inst_46091);

return statearr_46184;
})();
var statearr_46185_46255 = state_46153__$1;
(statearr_46185_46255[(2)] = null);

(statearr_46185_46255[(1)] = (34));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (28))){
var state_46153__$1 = state_46153;
var statearr_46186_46256 = state_46153__$1;
(statearr_46186_46256[(2)] = true);

(statearr_46186_46256[(1)] = (30));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (25))){
var inst_46051 = (state_46153[(17)]);
var inst_46056 = inst_46051.cljs$lang$protocol_mask$partition0$;
var inst_46057 = (inst_46056 & (64));
var inst_46058 = inst_46051.cljs$core$ISeq$;
var inst_46059 = (cljs.core.PROTOCOL_SENTINEL === inst_46058);
var inst_46060 = (inst_46057) || (inst_46059);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46060)){
var statearr_46187_46257 = state_46153__$1;
(statearr_46187_46257[(1)] = (28));

} else {
var statearr_46188_46258 = state_46153__$1;
(statearr_46188_46258[(1)] = (29));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (34))){
var inst_46095 = (state_46153[(10)]);
var inst_46098 = cljs.core.empty_QMARK_.call(null,inst_46095);
var state_46153__$1 = state_46153;
if(inst_46098){
var statearr_46189_46259 = state_46153__$1;
(statearr_46189_46259[(1)] = (36));

} else {
var statearr_46190_46260 = state_46153__$1;
(statearr_46190_46260[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (17))){
var inst_46011 = (state_46153[(8)]);
var state_46153__$1 = state_46153;
var statearr_46191_46261 = state_46153__$1;
(statearr_46191_46261[(2)] = inst_46011);

(statearr_46191_46261[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (3))){
var inst_46151 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46153__$1,inst_46151);
} else {
if((state_val_46154 === (12))){
var inst_46027 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46027)){
var statearr_46192_46262 = state_46153__$1;
(statearr_46192_46262[(1)] = (16));

} else {
var statearr_46193_46263 = state_46153__$1;
(statearr_46193_46263[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (2))){
var state_46153__$1 = state_46153;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46153__$1,(4),weathergen.ui.command_ch);
} else {
if((state_val_46154 === (23))){
var inst_46051 = (state_46153[(17)]);
var inst_46041 = (state_46153[(18)]);
var inst_46051__$1 = cljs.core.first.call(null,inst_46041);
var inst_46053 = (inst_46051__$1 == null);
var inst_46054 = cljs.core.not.call(null,inst_46053);
var state_46153__$1 = (function (){var statearr_46194 = state_46153;
(statearr_46194[(17)] = inst_46051__$1);

return statearr_46194;
})();
if(inst_46054){
var statearr_46195_46264 = state_46153__$1;
(statearr_46195_46264[(1)] = (25));

} else {
var statearr_46196_46265 = state_46153__$1;
(statearr_46196_46265[(1)] = (26));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (35))){
var inst_46146 = (state_46153[(2)]);
var inst_46147 = console.timeEnd("Receive weather results");
var inst_46148 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,false);
var state_46153__$1 = (function (){var statearr_46197 = state_46153;
(statearr_46197[(25)] = inst_46148);

(statearr_46197[(26)] = inst_46146);

(statearr_46197[(27)] = inst_46147);

return statearr_46197;
})();
var statearr_46198_46266 = state_46153__$1;
(statearr_46198_46266[(2)] = null);

(statearr_46198_46266[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (19))){
var inst_46041 = (state_46153[(18)]);
var inst_46043 = cljs.core.chunked_seq_QMARK_.call(null,inst_46041);
var state_46153__$1 = state_46153;
if(inst_46043){
var statearr_46199_46267 = state_46153__$1;
(statearr_46199_46267[(1)] = (22));

} else {
var statearr_46200_46268 = state_46153__$1;
(statearr_46200_46268[(1)] = (23));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (11))){
var state_46153__$1 = state_46153;
var statearr_46201_46269 = state_46153__$1;
(statearr_46201_46269[(2)] = false);

(statearr_46201_46269[(1)] = (12));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (9))){
var inst_46086 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46202_46270 = state_46153__$1;
(statearr_46202_46270[(2)] = inst_46086);

(statearr_46202_46270[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (5))){
var inst_46005 = (state_46153[(7)]);
var inst_46004 = (state_46153[(16)]);
var inst_46007 = (inst_46005 < inst_46004);
var inst_46008 = inst_46007;
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46008)){
var statearr_46203_46271 = state_46153__$1;
(statearr_46203_46271[(1)] = (7));

} else {
var statearr_46204_46272 = state_46153__$1;
(statearr_46204_46272[(1)] = (8));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (14))){
var state_46153__$1 = state_46153;
var statearr_46205_46273 = state_46153__$1;
(statearr_46205_46273[(2)] = false);

(statearr_46205_46273[(1)] = (15));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (45))){
var inst_46127 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46206_46274 = state_46153__$1;
(statearr_46206_46274[(2)] = inst_46127);

(statearr_46206_46274[(1)] = (41));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (26))){
var state_46153__$1 = state_46153;
var statearr_46207_46275 = state_46153__$1;
(statearr_46207_46275[(2)] = false);

(statearr_46207_46275[(1)] = (27));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (16))){
var inst_46011 = (state_46153[(8)]);
var inst_46029 = cljs.core.apply.call(null,cljs.core.hash_map,inst_46011);
var state_46153__$1 = state_46153;
var statearr_46208_46276 = state_46153__$1;
(statearr_46208_46276[(2)] = inst_46029);

(statearr_46208_46276[(1)] = (18));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (38))){
var inst_46144 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46209_46277 = state_46153__$1;
(statearr_46209_46277[(2)] = inst_46144);

(statearr_46209_46277[(1)] = (35));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (30))){
var inst_46064 = (state_46153[(2)]);
var state_46153__$1 = state_46153;
var statearr_46213_46278 = state_46153__$1;
(statearr_46213_46278[(2)] = inst_46064);

(statearr_46213_46278[(1)] = (27));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (10))){
var inst_46011 = (state_46153[(8)]);
var inst_46016 = inst_46011.cljs$lang$protocol_mask$partition0$;
var inst_46017 = (inst_46016 & (64));
var inst_46018 = inst_46011.cljs$core$ISeq$;
var inst_46019 = (cljs.core.PROTOCOL_SENTINEL === inst_46018);
var inst_46020 = (inst_46017) || (inst_46019);
var state_46153__$1 = state_46153;
if(cljs.core.truth_(inst_46020)){
var statearr_46214_46279 = state_46153__$1;
(statearr_46214_46279[(1)] = (13));

} else {
var statearr_46215_46280 = state_46153__$1;
(statearr_46215_46280[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (18))){
var inst_46005 = (state_46153[(7)]);
var inst_46002 = (state_46153[(13)]);
var inst_45996 = (state_46153[(15)]);
var inst_46004 = (state_46153[(16)]);
var inst_46003 = (state_46153[(9)]);
var inst_46032 = (state_46153[(2)]);
var inst_46033 = cljs.core.get.call(null,inst_46032,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_46034 = cljs.core.get.call(null,inst_46032,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_46035 = cljs.core.assoc.call(null,inst_45996,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_46033);
var inst_46036 = weathergen.encoding.encode.call(null,inst_46035);
var inst_46037 = weathergen.ui.post_message.call(null,inst_46034,inst_46036);
var inst_46038 = (inst_46005 + (1));
var tmp46210 = inst_46002;
var tmp46211 = inst_46004;
var tmp46212 = inst_46003;
var inst_46002__$1 = tmp46210;
var inst_46003__$1 = tmp46212;
var inst_46004__$1 = tmp46211;
var inst_46005__$1 = inst_46038;
var state_46153__$1 = (function (){var statearr_46216 = state_46153;
(statearr_46216[(28)] = inst_46037);

(statearr_46216[(7)] = inst_46005__$1);

(statearr_46216[(13)] = inst_46002__$1);

(statearr_46216[(16)] = inst_46004__$1);

(statearr_46216[(9)] = inst_46003__$1);

return statearr_46216;
})();
var statearr_46217_46281 = state_46153__$1;
(statearr_46217_46281[(2)] = null);

(statearr_46217_46281[(1)] = (5));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (42))){
var inst_46107 = (state_46153[(2)]);
var inst_46108 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_46109 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_46108);
var inst_46110 = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(inst_46109);
var inst_46111 = weathergen.time.campaign_time__GT_minutes.call(null,inst_46110);
var inst_46112 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_46113 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_46112);
var inst_46114 = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(inst_46113);
var inst_46115 = weathergen.time.campaign_time__GT_minutes.call(null,inst_46114);
var inst_46116 = cljs.core._EQ_.call(null,inst_46111,inst_46115);
var state_46153__$1 = (function (){var statearr_46218 = state_46153;
(statearr_46218[(29)] = inst_46107);

return statearr_46218;
})();
if(inst_46116){
var statearr_46219_46282 = state_46153__$1;
(statearr_46219_46282[(1)] = (43));

} else {
var statearr_46220_46283 = state_46153__$1;
(statearr_46220_46283[(1)] = (44));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46154 === (37))){
var inst_46095 = (state_46153[(10)]);
var inst_46135 = cljs.core.vec.call(null,inst_46095);
var state_46153__$1 = state_46153;
return cljs.core.async.ioc_alts_BANG_.call(null,state_46153__$1,(46),inst_46135);
} else {
if((state_val_46154 === (8))){
var inst_46002 = (state_46153[(13)]);
var inst_46041 = (state_46153[(18)]);
var inst_46041__$1 = cljs.core.seq.call(null,inst_46002);
var state_46153__$1 = (function (){var statearr_46221 = state_46153;
(statearr_46221[(18)] = inst_46041__$1);

return statearr_46221;
})();
if(inst_46041__$1){
var statearr_46222_46284 = state_46153__$1;
(statearr_46222_46284[(1)] = (19));

} else {
var statearr_46223_46285 = state_46153__$1;
(statearr_46223_46285[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__40874__auto___46231))
;
return ((function (switch__40760__auto__,c__40874__auto___46231){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_46227 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_46227[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_46227[(1)] = (1));

return statearr_46227;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_46153){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46153);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46228){if((e46228 instanceof Object)){
var ex__40764__auto__ = e46228;
var statearr_46229_46286 = state_46153;
(statearr_46229_46286[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46153);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46228;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46287 = state_46153;
state_46153 = G__46287;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_46153){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_46153);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto___46231))
})();
var state__40876__auto__ = (function (){var statearr_46230 = f__40875__auto__.call(null);
(statearr_46230[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto___46231);

return statearr_46230;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto___46231))
);

weathergen.ui.recompute = (function weathergen$ui$recompute(params){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__){
return (function (state_46309){
var state_val_46310 = (state_46309[(1)]);
if((state_val_46310 === (1))){
var inst_46303 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_46304 = [new cljs.core.Keyword(null,"compute-weather","compute-weather",-1681954694),params];
var inst_46305 = (new cljs.core.PersistentVector(null,2,(5),inst_46303,inst_46304,null));
var state_46309__$1 = state_46309;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46309__$1,(2),weathergen.ui.command_ch,inst_46305);
} else {
if((state_val_46310 === (2))){
var inst_46307 = (state_46309[(2)]);
var state_46309__$1 = state_46309;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46309__$1,inst_46307);
} else {
return null;
}
}
});})(c__40874__auto__))
;
return ((function (switch__40760__auto__,c__40874__auto__){
return (function() {
var weathergen$ui$recompute_$_state_machine__40761__auto__ = null;
var weathergen$ui$recompute_$_state_machine__40761__auto____0 = (function (){
var statearr_46314 = [null,null,null,null,null,null,null];
(statearr_46314[(0)] = weathergen$ui$recompute_$_state_machine__40761__auto__);

(statearr_46314[(1)] = (1));

return statearr_46314;
});
var weathergen$ui$recompute_$_state_machine__40761__auto____1 = (function (state_46309){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46309);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46315){if((e46315 instanceof Object)){
var ex__40764__auto__ = e46315;
var statearr_46316_46318 = state_46309;
(statearr_46316_46318[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46309);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46315;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46319 = state_46309;
state_46309 = G__46319;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$recompute_$_state_machine__40761__auto__ = function(state_46309){
switch(arguments.length){
case 0:
return weathergen$ui$recompute_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$recompute_$_state_machine__40761__auto____1.call(this,state_46309);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$recompute_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$recompute_$_state_machine__40761__auto____0;
weathergen$ui$recompute_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$recompute_$_state_machine__40761__auto____1;
return weathergen$ui$recompute_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__))
})();
var state__40876__auto__ = (function (){var statearr_46317 = f__40875__auto__.call(null);
(statearr_46317[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46317;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__))
);

return c__40874__auto__;
});
javelin.core.formula.call(null,(function (weather_params,prevent_recomputation_QMARK_){
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core.not.call(null,prevent_recomputation_QMARK_);
if(and__23326__auto__){
return weather_params;
} else {
return and__23326__auto__;
}
})())){
return weathergen.ui.recompute.call(null,weather_params);
} else {
return null;
}
})).call(null,weathergen.ui.weather_params,weathergen.ui.prevent_recomputation_QMARK_);
/**
 * Advances the weather by `steps` steps, unless that would move past
 *   the max time.
 */
weathergen.ui.move = (function weathergen$ui$move(steps){
return javelin.core.dosync_STAR_.call(null,(function (){
var minutes = (steps * new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)));
var current_time = weathergen.time.campaign_time__GT_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))));
var desired_time = (current_time + minutes);
var new_time = (function (){var temp__5276__auto__ = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if(cljs.core.truth_(temp__5276__auto__)){
var max_time = temp__5276__auto__;
var x__23683__auto__ = weathergen.time.campaign_time__GT_minutes.call(null,max_time);
var y__23684__auto__ = desired_time;
return ((x__23683__auto__ < y__23684__auto__) ? x__23683__auto__ : y__23684__auto__);
} else {
return desired_time;
}
})();
var actual_steps = ((new_time - current_time) / new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)));
var map__46322 = cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.step,cljs.core.deref.call(null,weathergen.ui.movement_params),actual_steps);
var map__46322__$1 = ((((!((map__46322 == null)))?((((map__46322.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46322.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46322):map__46322);
var time = cljs.core.get.call(null,map__46322__$1,new cljs.core.Keyword(null,"time","time",1385887882));
return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(time));
}));
});
weathergen.ui.jump_to_time_STAR_ = (function weathergen$ui$jump_to_time_STAR_(t){
return javelin.core.dosync_STAR_.call(null,(function (){
var map__46326 = cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.jump_to_time,cljs.core.deref.call(null,weathergen.ui.movement_params),t);
var map__46326__$1 = ((((!((map__46326 == null)))?((((map__46326.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46326.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46326):map__46326);
var time = cljs.core.get.call(null,map__46326__$1,new cljs.core.Keyword(null,"time","time",1385887882));
return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(time));
}));
});
/**
 * Adjust the time coordinate to match the displayed time.
 */
weathergen.ui.jump_to_time = (function weathergen$ui$jump_to_time(){
var desired = new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params));
var max_time = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166),cljs.core.deref.call(null,weathergen.ui.display_mode))) || (cljs.core.not.call(null,max_time)) || ((weathergen.time.campaign_time__GT_minutes.call(null,desired) <= weathergen.time.campaign_time__GT_minutes.call(null,max_time)))){
return weathergen.ui.jump_to_time_STAR_.call(null,new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params)));
} else {
return null;
}
});
/**
 * Adjust the time coordinate so that the current time is adjusted to
 *   match the displayed time without changing the location in weather
 *   space.
 */
weathergen.ui.set_time = (function weathergen$ui$set_time(){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.set_time,new cljs.core.Keyword(null,"displayed","displayed",-436192586).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.time_params)));
});
weathergen.ui.change_location = (function weathergen$ui$change_location(mission,airbase){
if(cljs.core.empty_QMARK_.call(null,airbase)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.selected_cell,null);
} else {
return cljs.core.reset_BANG_.call(null,weathergen.ui.selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),airbase,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),cljs.core.mapv.call(null,cljs.core.long$,cljs.core.juxt.call(null,new cljs.core.Keyword(null,"x","x",2099068185),new cljs.core.Keyword(null,"y","y",-1757859776)).call(null,weathergen.coordinates.fgrid__GT_weather.call(null,mission,new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(airbase),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(airbase))))], null));
}
});
/**
 * Compute the extensionless name of the mission file, or default to
 *   'vmt'.
 */
weathergen.ui.mission_name_base = (function weathergen$ui$mission_name_base(mission_name){
if(cljs.core.empty_QMARK_.call(null,mission_name)){
return "vmt";
} else {
var i = mission_name.lastIndexOf(".");
if((i < (0))){
return mission_name;
} else {
return cljs.core.subs.call(null,mission_name,(0),i);
}
}
});
weathergen.ui.safari_safe_binary = (function weathergen$ui$safari_safe_binary(blob){
if(cljs.core.truth_(weathergen.ui.safari_QMARK_)){
return (new Blob([blob],({"type": "application/octet-stream"})));
} else {
return blob;
}
});
/**
 * Returns the filename for an FMAP at time `t`.
 */
weathergen.ui.fmap_filename = (function weathergen$ui$fmap_filename(t){
return goog.string.format("%d%02d%02d.fmap",new cljs.core.Keyword(null,"day","day",-274800446).cljs$core$IFn$_invoke$arity$1(t),new cljs.core.Keyword(null,"hour","hour",-555989214).cljs$core$IFn$_invoke$arity$1(t),new cljs.core.Keyword(null,"minute","minute",-642875969).cljs$core$IFn$_invoke$arity$1(t));
});
weathergen.ui.twx_filename = (function weathergen$ui$twx_filename(mission_name){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,mission_name)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".twx")].join('');
});
/**
 * Prompts the user for a path and saves a file.
 * 
 *   `:title` - the title of the dialog that will be shown.
 *   `:data`  - a string, Blob, or Buffer of data to save.
 * 
 *   `:filters` - A seq of maps containing `:name` (string) and
 *   `:extension` - (vector of strings) to populate the dialog's filter
 *               dropdown with.
 *   `:filename` - The default filename - user can change this. Default
 *              directory is the campaign directory for the mission.
 */
weathergen.ui.save_data = (function weathergen$ui$save_data(p__46328){
var map__46331 = p__46328;
var map__46331__$1 = ((((!((map__46331 == null)))?((((map__46331.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46331.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46331):map__46331);
var data = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var title = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"title","title",636505583));
var filters = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"filters","filters",974726919));
var filename = cljs.core.get.call(null,map__46331__$1,new cljs.core.Keyword(null,"filename","filename",-1428840783));
var temp__5278__auto__ = weathergen.ui.electron.remote.dialog.showSaveDialog(cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),weathergen.filesystem.path_combine.call(null,weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),filename),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [filters], null)], null)));
if(cljs.core.truth_(temp__5278__auto__)){
var path = temp__5278__auto__;
if((data instanceof Blob)){
return weathergen.ui.common.save_blob_async.call(null,data,path);
} else {
return weathergen.filesystem.save_data.call(null,path,data);
}
} else {
return null;
}
});
weathergen.ui.save_fmap = (function weathergen$ui$save_fmap(weather_params,weather_data){
var t = cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null));
var vec__46342 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(weather_params);
var x_cells = cljs.core.nth.call(null,vec__46342,(0),null);
var y_cells = cljs.core.nth.call(null,vec__46342,(1),null);
var data = ((cljs.core._EQ_.call(null,weather_params,weathergen.ui.weather_data_params))?weather_data:weathergen.model.weather_grid.call(null,cljs.core.assoc.call(null,weather_params,new cljs.core.Keyword(null,"cells","cells",-985166822),(function (){var iter__24200__auto__ = ((function (t,vec__46342,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__46345(s__46346){
return (new cljs.core.LazySeq(null,((function (t,vec__46342,x_cells,y_cells){
return (function (){
var s__46346__$1 = s__46346;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46346__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__46345_$_iter__46347(s__46348){
return (new cljs.core.LazySeq(null,((function (s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells){
return (function (){
var s__46348__$1 = s__46348;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46348__$1);
if(temp__5278__auto____$1){
var s__46348__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46348__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__46348__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__46350 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__46349 = (0);
while(true){
if((i__46349 < size__24199__auto__)){
var y = cljs.core._nth.call(null,c__24198__auto__,i__46349);
cljs.core.chunk_append.call(null,b__46350,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__46351 = (i__46349 + (1));
i__46349 = G__46351;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46350),weathergen$ui$save_fmap_$_iter__46345_$_iter__46347.call(null,cljs.core.chunk_rest.call(null,s__46348__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46350),null);
}
} else {
var y = cljs.core.first.call(null,s__46348__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$save_fmap_$_iter__46345_$_iter__46347.call(null,cljs.core.rest.call(null,s__46348__$2)));
}
} else {
return null;
}
break;
}
});})(s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells))
,null,null));
});})(s__46346__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__46342,x_cells,y_cells))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,cljs.core.range.call(null,y_cells)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$save_fmap_$_iter__46345.call(null,cljs.core.rest.call(null,s__46346__$1)));
} else {
var G__46352 = cljs.core.rest.call(null,s__46346__$1);
s__46346__$1 = G__46352;
continue;
}
} else {
return null;
}
break;
}
});})(t,vec__46342,x_cells,y_cells))
,null,null));
});})(t,vec__46342,x_cells,y_cells))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,x_cells));
})())));
var blob = weathergen.fmap.get_blob.call(null,data,x_cells,y_cells);
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.safari_safe_binary.call(null,blob),new cljs.core.Keyword(null,"title","title",636505583),"Save FMAP",new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"FMAP Files",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["fmap"], null)], null),new cljs.core.Keyword(null,"filename","filename",-1428840783),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.fmap_filename.call(null,t))].join('')], null));
});
weathergen.ui.settings_blob = (function weathergen$ui$settings_blob(){
return (new Blob([cljs.core.pr_str.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision], null))],({"type": "text/plain"})));
});
weathergen.ui.settings_filename = (function weathergen$ui$settings_filename(mission_name){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,mission_name)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".vmtw")].join('');
});
weathergen.ui.save_weather_settings = (function weathergen$ui$save_weather_settings(_){
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),cljs.core.pr_str.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision], null)),new cljs.core.Keyword(null,"title","title",636505583),"Save weather settings",new cljs.core.Keyword(null,"filename","filename",-1428840783),weathergen.ui.settings_filename.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission))),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Weather Settings",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtw"], null)], null)], null)], null));
});
/**
 * Returns a JS blob containing TWX file data.
 */
weathergen.ui.twx_blob = (function weathergen$ui$twx_blob(cloud_params,direction){
return (new Blob([weathergen.twx.get_twx.call(null,cloud_params,direction)]));
});
/**
 * Initiates a download of a TWX file.
 */
weathergen.ui.save_twx = (function weathergen$ui$save_twx(cloud_params,direction,mission_name){
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.safari_safe_binary.call(null,weathergen.ui.twx_blob.call(null,cloud_params,direction)),new cljs.core.Keyword(null,"title","title",636505583),"Save TWX",new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"TWX Files",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["twx"], null)], null)], null),new cljs.core.Keyword(null,"filename","filename",-1428840783),weathergen.ui.twx_filename.call(null,mission_name)], null));
});
weathergen.ui.load_weather_settings = (function weathergen$ui$load_weather_settings(_){
var vec__46356 = weathergen.ui.electron.remote.dialog.showOpenDialog(cljs.core.clj__GT_js.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"title","title",636505583),"Select a VMT or Weathergen Weather File",new cljs.core.Keyword(null,"properties","properties",685819552),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["openFile"], null),new cljs.core.Keyword(null,"defaultPath","defaultPath",-582313676),weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Weather Settings",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtw"], null)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"WeatherGen Settings",new cljs.core.Keyword(null,"extensions","extensions",-1103629196),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["edn"], null)], null)], null)], null)));
var path = cljs.core.nth.call(null,vec__46356,(0),null);
if(cljs.core.truth_(path)){
var data = weathergen.model.upgrade.call(null,cljs.reader.read_string.call(null,weathergen.filesystem.file_text.call(null,path)),weathergen.ui.revision);
var t = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
return javelin.core.dosync_STAR_.call(null,((function (data,t,vec__46356,path){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in.call(null,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null),t));

cljs.core.reset_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc.call(null,new cljs.core.Keyword(null,"display-params","display-params",573405707).cljs$core$IFn$_invoke$arity$1(data),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),null,new cljs.core.Keyword(null,"from","from",1815293044),t,new cljs.core.Keyword(null,"to","to",192099007),weathergen.time.add_minutes.call(null,t,((6) * (60))),new cljs.core.Keyword(null,"step","step",1288888124),new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(data))], null)));

cljs.core.reset_BANG_.call(null,weathergen.ui.movement_params,new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(data));

cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983).cljs$core$IFn$_invoke$arity$1(data));

return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc,new cljs.core.Keyword(null,"displayed","displayed",-436192586),t);
});})(data,t,vec__46356,path))
);
} else {
return null;
}
});
hoplon.core.do_watch.call(null,weathergen.ui.mission,(function (_,mission){
if(cljs.core.truth_(mission)){
var current = weathergen.falcon.files.mission.mission_time.call(null,mission);
cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.update,new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),((function (current){
return (function (ms){
return cljs.core.assoc.call(null,ms,new cljs.core.Keyword(null,"from","from",1815293044),current,new cljs.core.Keyword(null,"to","to",192099007),weathergen.time.add_minutes.call(null,current,((60) * (6))));
});})(current))
);

cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,weathergen.model.jump_to_time,cljs.core.deref.call(null,weathergen.ui.movement_params),current);

return cljs.core.swap_BANG_.call(null,weathergen.ui.time_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed","displayed",-436192586)], null),current);
} else {
return null;
}
}));
/**
 * Loads a mission (.cam/.tac) mission file.
 */
weathergen.ui.load_mission = (function weathergen$ui$load_mission(installs,path){
var timer_name__15521__auto__ = "load-mission";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var mission_data = (function (){var timer_name__15521__auto____$1 = "read-mission";
var ignore__15522__auto____$1 = console.time(timer_name__15521__auto____$1);
var result__15523__auto__ = weathergen.falcon.files.mission.read_mission.call(null,installs,path);
console.timeEnd(timer_name__15521__auto____$1);

return result__15523__auto__;
})();
return weathergen.progress.with_step.call(null,"Preparing views",((function (mission_data,timer_name__15521__auto__,ignore__15522__auto__){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (mission_data,timer_name__15521__auto__,ignore__15522__auto__){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.mission,mission_data);

var current = weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission));
return cljs.core.reset_BANG_.call(null,weathergen.ui.visible_sides,cljs.core.PersistentHashSet.createAsIfByAssoc([(function (){var G__46362 = weathergen.falcon.files.mission.side.call(null,mission_data,weathergen.falcon.files.mission.last_player_team.call(null,mission_data));
return G__46362;
})()]));
});})(mission_data,timer_name__15521__auto__,ignore__15522__auto__))
);
});})(mission_data,timer_name__15521__auto__,ignore__15522__auto__))
);
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
/**
 * Compresses a buffer, returing a new buffer with the compressed
 *   data.
 */
weathergen.ui.compress = (function weathergen$ui$compress(buf){
return weathergen.ui.zlib.gzipSync(buf);
});
/**
 * Decompresses a buffer, returning a new buffer with the expanded
 *   data.
 */
weathergen.ui.decompress = (function weathergen$ui$decompress(buf){
return weathergen.ui.zlib.gunzipSync(buf);
});
weathergen.ui.StringDecoder = (require("string_decoder")["StringDecoder"]);
/**
 * Converts a buffer to a string.
 */
weathergen.ui.buf__GT_string = (function weathergen$ui$buf__GT_string(buf){
return (new weathergen.ui.StringDecoder()).write(buf);
});
/**
 * Converts a buffer to a string.
 */
weathergen.ui.string__GT_buf = (function weathergen$ui$string__GT_buf(s){
return Buffer.from(s);
});
/**
 * Loads a briefing (.vmtb) file given a path to a briefing and a map
 *   from installation names to their directories.
 */
weathergen.ui.load_briefing = (function weathergen$ui$load_briefing(installations,path){
return weathergen.progress.with_step.call(null,"Reading briefing file",(function (){
var map__46367 = weathergen.encoding.decode.call(null,weathergen.ui.decompress.call(null,weathergen.filesystem.file_buffer.call(null,path)));
var map__46367__$1 = ((((!((map__46367 == null)))?((((map__46367.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46367.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46367):map__46367);
var vmtb = map__46367__$1;
var revision = cljs.core.get.call(null,map__46367__$1,new cljs.core.Keyword(null,"revision","revision",-1350113114));
var install_id = cljs.core.get.call(null,map__46367__$1,new cljs.core.Keyword(null,"install-id","install-id",-1310868737));
var briefing = cljs.core.get.call(null,map__46367__$1,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,951,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
return new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, ["load-briefing",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"revision","revision",-1350113114),revision,new cljs.core.Keyword(null,"briefing?","briefing?",-568550789),!((briefing == null))], null);
});})(map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
,null)),null,-1245787886);

var mission_data = weathergen.progress.with_step.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("Loading briefing from "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(path)].join(''),((function (map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
return weathergen.falcon.files.mission.briefing__GT_mission.call(null,installations,briefing);
});})(map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
);
var unedit = ((function (mission_data,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (m){
return cljs.core.assoc.call(null,m,new cljs.core.Keyword(null,"editing?","editing?",1646440800),false);
});})(mission_data,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
;
return weathergen.progress.with_step.call(null,"Preparing views",((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.display_mode,new cljs.core.Keyword(null,"briefing","briefing",-176308969));

cljs.core.reset_BANG_.call(null,weathergen.ui.mission,mission_data);

cljs.core.reset_BANG_.call(null,weathergen.ui.visible_sides,new cljs.core.Keyword(null,"visible-sides","visible-sides",391079481).cljs$core$IFn$_invoke$arity$1(vmtb));

cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc_in.call(null,cljs.core.update.call(null,cljs.core.update.call(null,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)),new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (p1__46363_SHARP_){
return cljs.core.map.call(null,unedit,p1__46363_SHARP_);
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing){
return (function (p1__46364_SHARP_){
return cljs.core.map.call(null,unedit,p1__46364_SHARP_);
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"max","max",61366548)], null),weathergen.falcon.files.mission.mission_time.call(null,mission_data)));

cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

cljs.core.reset_BANG_.call(null,weathergen.ui.movement_params,new cljs.core.Keyword(null,"movement-params","movement-params",293385966).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

cljs.core.reset_BANG_.call(null,weathergen.ui.display_params,new cljs.core.Keyword(null,"display-params","display-params",573405707).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"weather","weather",1320452344).cljs$core$IFn$_invoke$arity$1(vmtb)));

return cljs.core.reset_BANG_.call(null,weathergen.ui.briefing_notes,(function (){var or__23338__auto__ = new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117).cljs$core$IFn$_invoke$arity$1(vmtb);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "";
}
})());
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
);
});})(mission_data,unedit,map__46367,map__46367__$1,vmtb,revision,install_id,briefing))
);
}));
});
/**
 * Prompts the user for a path and saves a briefing file to it.
 */
weathergen.ui.save_briefing = (function weathergen$ui$save_briefing(install_id,visible_sides){
return weathergen.ui.save_data.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"data","data",-232669377),weathergen.ui.compress.call(null,weathergen.encoding.encode.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"revision","revision",-1350113114),weathergen.ui.revision,new cljs.core.Keyword(null,"briefing","briefing",-176308969),weathergen.falcon.files.mission.mission__GT_briefing.call(null,cljs.core.deref.call(null,weathergen.ui.mission),install_id),new cljs.core.Keyword(null,"weather","weather",1320452344),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),cljs.core.deref.call(null,weathergen.ui.weather_params),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"movement-params","movement-params",293385966),cljs.core.deref.call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"display-params","display-params",573405707),cljs.core.deref.call(null,weathergen.ui.display_params)], null),new cljs.core.Keyword(null,"visible-sides","visible-sides",391079481),visible_sides,new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117),cljs.core.deref.call(null,weathergen.ui.briefing_notes)], null))),new cljs.core.Keyword(null,"title","title",636505583),"Save a briefing file",new cljs.core.Keyword(null,"filename","filename",-1428840783),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.mission_name_base.call(null,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".vmtb")].join(''),new cljs.core.Keyword(null,"filters","filters",974726919),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"name","name",1843675177),"VMT Briefing",new cljs.core.Keyword(null,"extension","extension",1453374065),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["vmtb"], null)], null)], null)], null));
});
weathergen.ui.weather_worker = (function (){var worker = (new Worker("worker.js"));
var command_ch = cljs.core.async.chan.call(null);
var result_ch = cljs.core.async.chan.call(null);
var output_ch = cljs.core.async.chan.call(null);
worker.onmessage = ((function (worker,command_ch,result_ch,output_ch){
return (function (e){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_46374){
var state_val_46375 = (state_46374[(1)]);
if((state_val_46375 === (1))){
var inst_46369 = e.data;
var inst_46370 = weathergen.encoding.decode.call(null,inst_46369);
var state_46374__$1 = state_46374;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46374__$1,(2),result_ch,inst_46370);
} else {
if((state_val_46375 === (2))){
var inst_46372 = (state_46374[(2)]);
var state_46374__$1 = state_46374;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46374__$1,inst_46372);
} else {
return null;
}
}
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_46379 = [null,null,null,null,null,null,null];
(statearr_46379[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_46379[(1)] = (1));

return statearr_46379;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_46374){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46374);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46380){if((e46380 instanceof Object)){
var ex__40764__auto__ = e46380;
var statearr_46381_46409 = state_46374;
(statearr_46381_46409[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46374);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46380;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46410 = state_46374;
state_46374 = G__46410;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_46374){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_46374);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__40876__auto__ = (function (){var statearr_46382 = f__40875__auto__.call(null);
(statearr_46382[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46382;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
);

return c__40874__auto__;
});})(worker,command_ch,result_ch,output_ch))
;

return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"command-ch","command-ch",508874766),command_ch,new cljs.core.Keyword(null,"worker","worker",938239996),worker,new cljs.core.Keyword(null,"output-ch","output-ch",1069791231),output_ch,new cljs.core.Keyword(null,"loop","loop",-395552849),(function (){var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_46396){
var state_val_46397 = (state_46396[(1)]);
if((state_val_46397 === (1))){
var state_46396__$1 = state_46396;
var statearr_46398_46411 = state_46396__$1;
(statearr_46398_46411[(2)] = null);

(statearr_46398_46411[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46397 === (2))){
var state_46396__$1 = state_46396;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46396__$1,(4),command_ch);
} else {
if((state_val_46397 === (3))){
var inst_46394 = (state_46396[(2)]);
var state_46396__$1 = state_46396;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46396__$1,inst_46394);
} else {
if((state_val_46397 === (4))){
var inst_46385 = (state_46396[(2)]);
var inst_46386 = weathergen.encoding.encode.call(null,inst_46385);
var inst_46387 = worker.postMessage(inst_46386);
var state_46396__$1 = (function (){var statearr_46399 = state_46396;
(statearr_46399[(7)] = inst_46387);

return statearr_46399;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46396__$1,(6),result_ch);
} else {
if((state_val_46397 === (5))){
var inst_46391 = (state_46396[(2)]);
var state_46396__$1 = (function (){var statearr_46400 = state_46396;
(statearr_46400[(8)] = inst_46391);

return statearr_46400;
})();
var statearr_46401_46412 = state_46396__$1;
(statearr_46401_46412[(2)] = null);

(statearr_46401_46412[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46397 === (6))){
var inst_46389 = (state_46396[(2)]);
var state_46396__$1 = state_46396;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46396__$1,(5),output_ch,inst_46389);
} else {
return null;
}
}
}
}
}
}
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__40761__auto__ = null;
var weathergen$ui$state_machine__40761__auto____0 = (function (){
var statearr_46405 = [null,null,null,null,null,null,null,null,null];
(statearr_46405[(0)] = weathergen$ui$state_machine__40761__auto__);

(statearr_46405[(1)] = (1));

return statearr_46405;
});
var weathergen$ui$state_machine__40761__auto____1 = (function (state_46396){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46396);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46406){if((e46406 instanceof Object)){
var ex__40764__auto__ = e46406;
var statearr_46407_46413 = state_46396;
(statearr_46407_46413[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46396);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46406;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46414 = state_46396;
state_46396 = G__46414;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$state_machine__40761__auto__ = function(state_46396){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__40761__auto____1.call(this,state_46396);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__40761__auto____0;
weathergen$ui$state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__40761__auto____1;
return weathergen$ui$state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__40876__auto__ = (function (){var statearr_46408 = f__40875__auto__.call(null);
(statearr_46408[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46408;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__,worker,command_ch,result_ch,output_ch))
);

return c__40874__auto__;
})()], null);
})();
weathergen.ui.save_weather_files = (function weathergen$ui$save_weather_files(p__46415){
var map__46512 = p__46415;
var map__46512__$1 = ((((!((map__46512 == null)))?((((map__46512.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46512.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46512):map__46512);
var ny = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var progress = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"progress","progress",244323547));
var weather_params = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365));
var step = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"step","step",1288888124));
var to = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"to","to",192099007));
var mission_name = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582));
var cloud_params = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983));
var save_file = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"save-file","save-file",-250442926));
var nx = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var from = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"from","from",1815293044));
var campaign_dir = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883));
var weather_direction = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873));
var cancel = cljs.core.get.call(null,map__46512__$1,new cljs.core.Keyword(null,"cancel","cancel",-1964088360));
var cells = (function (){var iter__24200__auto__ = ((function (map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function weathergen$ui$save_weather_files_$_iter__46514(s__46515){
return (new cljs.core.LazySeq(null,((function (map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__46515__$1 = s__46515;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46515__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__46515__$1,x,xs__5831__auto__,temp__5278__auto__,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function weathergen$ui$save_weather_files_$_iter__46514_$_iter__46516(s__46517){
return (new cljs.core.LazySeq(null,((function (s__46515__$1,x,xs__5831__auto__,temp__5278__auto__,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__46517__$1 = s__46517;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46517__$1);
if(temp__5278__auto____$1){
var s__46517__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46517__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__46517__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__46519 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__46518 = (0);
while(true){
if((i__46518 < size__24199__auto__)){
var y = cljs.core._nth.call(null,c__24198__auto__,i__46518);
cljs.core.chunk_append.call(null,b__46519,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__46608 = (i__46518 + (1));
i__46518 = G__46608;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46519),weathergen$ui$save_weather_files_$_iter__46514_$_iter__46516.call(null,cljs.core.chunk_rest.call(null,s__46517__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46519),null);
}
} else {
var y = cljs.core.first.call(null,s__46517__$2);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null),weathergen$ui$save_weather_files_$_iter__46514_$_iter__46516.call(null,cljs.core.rest.call(null,s__46517__$2)));
}
} else {
return null;
}
break;
}
});})(s__46515__$1,x,xs__5831__auto__,temp__5278__auto__,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(s__46515__$1,x,xs__5831__auto__,temp__5278__auto__,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,cljs.core.range.call(null,ny)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$save_weather_files_$_iter__46514.call(null,cljs.core.rest.call(null,s__46515__$1)));
} else {
var G__46609 = cljs.core.rest.call(null,s__46515__$1);
s__46515__$1 = G__46609;
continue;
}
} else {
return null;
}
break;
}
});})(map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,nx));
})();
var start = weathergen.time.campaign_time__GT_minutes.call(null,from);
var end = weathergen.time.campaign_time__GT_minutes.call(null,to);
var steps = (cljs.core.long$.call(null,((end - start) / step)) + (1));
var updates_dir = weathergen.filesystem.path_combine.call(null,campaign_dir,"WeatherMapsUpdates");
var save_blob = ((function (cells,start,end,steps,updates_dir,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (blob,path){
cljs.core.reset_BANG_.call(null,save_file,path);

return weathergen.ui.common.save_blob_async.call(null,blob,weathergen.filesystem.path_combine.call(null,campaign_dir,path));
});})(cells,start,end,steps,updates_dir,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (state_46578){
var state_val_46579 = (state_46578[(1)]);
if((state_val_46579 === (7))){
var inst_46549 = (state_46578[(2)]);
var inst_46550 = new cljs.core.Keyword(null,"output-ch","output-ch",1069791231).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var state_46578__$1 = (function (){var statearr_46580 = state_46578;
(statearr_46580[(7)] = inst_46549);

return statearr_46580;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46578__$1,(8),inst_46550);
} else {
if((state_val_46579 === (1))){
var inst_46520 = start;
var inst_46521 = false;
var state_46578__$1 = (function (){var statearr_46581 = state_46578;
(statearr_46581[(8)] = inst_46521);

(statearr_46581[(9)] = inst_46520);

return statearr_46581;
})();
var statearr_46582_46610 = state_46578__$1;
(statearr_46582_46610[(2)] = null);

(statearr_46582_46610[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (4))){
var inst_46533 = weathergen.ui.twx_blob.call(null,cloud_params,weather_direction);
var inst_46534 = weathergen.ui.twx_filename.call(null,mission_name);
var inst_46535 = save_blob.call(null,inst_46533,inst_46534);
var inst_46536 = weathergen.ui.settings_blob.call(null);
var inst_46537 = weathergen.ui.settings_filename.call(null,mission_name);
var inst_46538 = save_blob.call(null,inst_46536,inst_46537);
var inst_46539 = cljs.core.reset_BANG_.call(null,progress,null);
var state_46578__$1 = (function (){var statearr_46583 = state_46578;
(statearr_46583[(10)] = inst_46538);

(statearr_46583[(11)] = inst_46535);

return statearr_46583;
})();
var statearr_46584_46611 = state_46578__$1;
(statearr_46584_46611[(2)] = inst_46539);

(statearr_46584_46611[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (13))){
var inst_46520 = (state_46578[(9)]);
var inst_46569 = (inst_46520 + step);
var inst_46520__$1 = inst_46569;
var inst_46521 = true;
var state_46578__$1 = (function (){var statearr_46585 = state_46578;
(statearr_46585[(8)] = inst_46521);

(statearr_46585[(9)] = inst_46520__$1);

return statearr_46585;
})();
var statearr_46586_46612 = state_46578__$1;
(statearr_46586_46612[(2)] = null);

(statearr_46586_46612[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (6))){
var inst_46574 = (state_46578[(2)]);
var state_46578__$1 = state_46578;
var statearr_46587_46613 = state_46578__$1;
(statearr_46587_46613[(2)] = inst_46574);

(statearr_46587_46613[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (3))){
var inst_46576 = (state_46578[(2)]);
var state_46578__$1 = state_46578;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46578__$1,inst_46576);
} else {
if((state_val_46579 === (12))){
var inst_46567 = cljs.core.reset_BANG_.call(null,progress,null);
var state_46578__$1 = state_46578;
var statearr_46588_46614 = state_46578__$1;
(statearr_46588_46614[(2)] = inst_46567);

(statearr_46588_46614[(1)] = (14));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (2))){
var inst_46521 = (state_46578[(8)]);
var inst_46520 = (state_46578[(9)]);
var inst_46523 = (inst_46520 - start);
var inst_46524 = (end - start);
var inst_46525 = (inst_46523 / inst_46524);
var inst_46526 = ((inst_46525 < (1)) ? inst_46525 : (1));
var inst_46527 = (function (){var t = inst_46520;
var first_done_QMARK_ = inst_46521;
var p = inst_46526;
return ((function (t,first_done_QMARK_,p,inst_46521,inst_46520,inst_46523,inst_46524,inst_46525,inst_46526,state_val_46579,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["progress",p], null);
});
;})(t,first_done_QMARK_,p,inst_46521,inst_46520,inst_46523,inst_46524,inst_46525,inst_46526,state_val_46579,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var inst_46528 = (new cljs.core.Delay(inst_46527,null));
var inst_46529 = taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,1034,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),inst_46528,null,739149087);
var inst_46530 = cljs.core.reset_BANG_.call(null,progress,inst_46526);
var inst_46531 = (end < inst_46520);
var state_46578__$1 = (function (){var statearr_46589 = state_46578;
(statearr_46589[(12)] = inst_46530);

(statearr_46589[(13)] = inst_46529);

return statearr_46589;
})();
if(cljs.core.truth_(inst_46531)){
var statearr_46590_46615 = state_46578__$1;
(statearr_46590_46615[(1)] = (4));

} else {
var statearr_46591_46616 = state_46578__$1;
(statearr_46591_46616[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (11))){
var inst_46553 = (state_46578[(14)]);
var inst_46520 = (state_46578[(9)]);
var inst_46560 = (state_46578[(2)]);
var inst_46561 = weathergen.time.minutes__GT_campaign_time.call(null,inst_46520);
var inst_46562 = weathergen.ui.fmap_filename.call(null,inst_46561);
var inst_46563 = weathergen.filesystem.path_combine.call(null,"WeatherMapsUpdates",inst_46562);
var inst_46564 = save_blob.call(null,inst_46553,inst_46563);
var inst_46565 = cljs.core.deref.call(null,cancel);
var state_46578__$1 = (function (){var statearr_46592 = state_46578;
(statearr_46592[(15)] = inst_46560);

(statearr_46592[(16)] = inst_46564);

return statearr_46592;
})();
if(cljs.core.truth_(inst_46565)){
var statearr_46593_46617 = state_46578__$1;
(statearr_46593_46617[(1)] = (12));

} else {
var statearr_46594_46618 = state_46578__$1;
(statearr_46594_46618[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (9))){
var state_46578__$1 = state_46578;
var statearr_46595_46619 = state_46578__$1;
(statearr_46595_46619[(2)] = null);

(statearr_46595_46619[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (5))){
var inst_46520 = (state_46578[(9)]);
var inst_46541 = new cljs.core.Keyword(null,"command-ch","command-ch",508874766).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var inst_46542 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_46543 = [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)];
var inst_46544 = (new cljs.core.PersistentVector(null,2,(5),inst_46542,inst_46543,null));
var inst_46545 = weathergen.time.minutes__GT_campaign_time.call(null,inst_46520);
var inst_46546 = cljs.core.assoc_in.call(null,weather_params,inst_46544,inst_46545);
var inst_46547 = cljs.core.assoc.call(null,inst_46546,new cljs.core.Keyword(null,"cells","cells",-985166822),cells);
var state_46578__$1 = state_46578;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_46578__$1,(7),inst_46541,inst_46547);
} else {
if((state_val_46579 === (14))){
var inst_46572 = (state_46578[(2)]);
var state_46578__$1 = state_46578;
var statearr_46596_46620 = state_46578__$1;
(statearr_46596_46620[(2)] = inst_46572);

(statearr_46596_46620[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (10))){
var inst_46553 = (state_46578[(14)]);
var inst_46556 = weathergen.ui.mission_name_base.call(null,mission_name);
var inst_46557 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(inst_46556),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".fmap")].join('');
var inst_46558 = save_blob.call(null,inst_46553,inst_46557);
var state_46578__$1 = state_46578;
var statearr_46597_46621 = state_46578__$1;
(statearr_46597_46621[(2)] = inst_46558);

(statearr_46597_46621[(1)] = (11));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46579 === (8))){
var inst_46521 = (state_46578[(8)]);
var inst_46552 = (state_46578[(2)]);
var inst_46553 = weathergen.fmap.get_blob.call(null,inst_46552,nx,ny);
var state_46578__$1 = (function (){var statearr_46598 = state_46578;
(statearr_46598[(14)] = inst_46553);

return statearr_46598;
})();
if(cljs.core.truth_(inst_46521)){
var statearr_46599_46622 = state_46578__$1;
(statearr_46599_46622[(1)] = (9));

} else {
var statearr_46600_46623 = state_46578__$1;
(statearr_46600_46623[(1)] = (10));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return ((function (switch__40760__auto__,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function() {
var weathergen$ui$save_weather_files_$_state_machine__40761__auto__ = null;
var weathergen$ui$save_weather_files_$_state_machine__40761__auto____0 = (function (){
var statearr_46604 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_46604[(0)] = weathergen$ui$save_weather_files_$_state_machine__40761__auto__);

(statearr_46604[(1)] = (1));

return statearr_46604;
});
var weathergen$ui$save_weather_files_$_state_machine__40761__auto____1 = (function (state_46578){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46578);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46605){if((e46605 instanceof Object)){
var ex__40764__auto__ = e46605;
var statearr_46606_46624 = state_46578;
(statearr_46606_46624[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46578);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46605;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46625 = state_46578;
state_46578 = G__46625;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$save_weather_files_$_state_machine__40761__auto__ = function(state_46578){
switch(arguments.length){
case 0:
return weathergen$ui$save_weather_files_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$save_weather_files_$_state_machine__40761__auto____1.call(this,state_46578);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$save_weather_files_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$save_weather_files_$_state_machine__40761__auto____0;
weathergen$ui$save_weather_files_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$save_weather_files_$_state_machine__40761__auto____1;
return weathergen$ui$save_weather_files_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var state__40876__auto__ = (function (){var statearr_46607 = f__40875__auto__.call(null);
(statearr_46607[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46607;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__,cells,start,end,steps,updates_dir,save_blob,map__46512,map__46512__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
);

return c__40874__auto__;
});
weathergen.ui.remove_nth = (function weathergen$ui$remove_nth(coll,n){
return cljs.core.vec.call(null,cljs.core.concat.call(null,cljs.core.take.call(null,n,coll),cljs.core.drop.call(null,(n + (1)),coll)));
});
weathergen.ui.invert_map = (function weathergen$ui$invert_map(m){
return cljs.core.zipmap.call(null,cljs.core.vals.call(null,m),cljs.core.keys.call(null,m));
});
weathergen.ui.map_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Israel",new cljs.core.Keyword(null,"israel","israel",893888780),"Balkans",new cljs.core.Keyword(null,"balkans","balkans",-514308101),"Korea",new cljs.core.Keyword(null,"korea","korea",-1788137114),"Kuriles",new cljs.core.Keyword(null,"kuriles","kuriles",1501726930)], null);
weathergen.ui.map_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.map_name__GT_key);
weathergen.ui.display_name__GT_key = new cljs.core.PersistentArrayMap(null, 3, ["Weather Type",new cljs.core.Keyword(null,"type","type",1174270348),"Pressure",new cljs.core.Keyword(null,"pressure","pressure",505343747),"Temperature",new cljs.core.Keyword(null,"temperature","temperature",899018429)], null);
weathergen.ui.display_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.display_name__GT_key);
weathergen.ui.overlay_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Wind",new cljs.core.Keyword(null,"wind","wind",-527553074),"Pressure",new cljs.core.Keyword(null,"pressure","pressure",505343747),"Temperature",new cljs.core.Keyword(null,"temperature","temperature",899018429),"Weather Type",new cljs.core.Keyword(null,"type","type",1174270348)], null);
weathergen.ui.overlay_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.overlay_name__GT_key);
weathergen.ui.type_name__GT_key = new cljs.core.PersistentArrayMap(null, 4, ["Sunny",new cljs.core.Keyword(null,"sunny","sunny",1448267778),"Fair",new cljs.core.Keyword(null,"fair","fair",1684139423),"Poor",new cljs.core.Keyword(null,"poor","poor",1462482211),"Inclement",new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null);
weathergen.ui.type_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.type_name__GT_key);
weathergen.ui.pressure_unit_name__GT_key = new cljs.core.PersistentArrayMap(null, 2, ["InHg",new cljs.core.Keyword(null,"inhg","inhg",-863180091),"Millibar",new cljs.core.Keyword(null,"mbar","mbar",-1396360988)], null);
weathergen.ui.pressure_unit_key__GT_name = weathergen.ui.invert_map.call(null,weathergen.ui.pressure_unit_name__GT_key);
weathergen.ui.mbar_per_inhg = 33.8637526;
weathergen.ui.mbar__GT_inhg = (function weathergen$ui$mbar__GT_inhg(mbar){
return (mbar / weathergen.ui.mbar_per_inhg);
});
weathergen.ui.inhg__GT_mbar = (function weathergen$ui$inhg__GT_mbar(inhg){
return (inhg * weathergen.ui.mbar_per_inhg);
});
/**
 * Returns a string describing a weather type.
 */
weathergen.ui.format_type = (function weathergen$ui$format_type(type){
var pred__46629 = cljs.core._EQ_;
var expr__46630 = type;
if(cljs.core.truth_(pred__46629.call(null,new cljs.core.Keyword(null,"sunny","sunny",1448267778),expr__46630))){
return "Sunny";
} else {
if(cljs.core.truth_(pred__46629.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),expr__46630))){
return "Fair";
} else {
if(cljs.core.truth_(pred__46629.call(null,new cljs.core.Keyword(null,"poor","poor",1462482211),expr__46630))){
return "Poor";
} else {
if(cljs.core.truth_(pred__46629.call(null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),expr__46630))){
return "Incl.";
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__46630)].join('')));
}
}
}
}
});
/**
 * Format a pressure in inches Mercury as appropriate for the unit.
 */
weathergen.ui.format_pressure = (function weathergen$ui$format_pressure(inhg,unit){
if(cljs.core.not.call(null,inhg)){
return "";
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"inhg","inhg",-863180091),unit)){
return inhg.toFixed((2));
} else {
return (function (){var G__46633 = weathergen.ui.inhg__GT_mbar.call(null,inhg);
return G__46633;
})().toFixed((0));
}
}
});
/**
 * Format a temperature string
 */
weathergen.ui.format_temperature = (function weathergen$ui$format_temperature(temp){
if(cljs.core.not.call(null,temp)){
return "";
} else {
return temp.toFixed((0));
}
});
/**
 * Format a wind string.
 */
weathergen.ui.format_wind = (function weathergen$ui$format_wind(wind){
if(cljs.core.not.call(null,wind)){
return "";
} else {
var map__46637 = wind;
var map__46637__$1 = ((((!((map__46637 == null)))?((((map__46637.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46637.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46637):map__46637);
var speed = cljs.core.get.call(null,map__46637__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__46637__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%03d",heading)),cljs.core.str.cljs$core$IFn$_invoke$arity$1("@"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%02d",(function (){var G__46639 = speed;
return G__46639;
})().toFixed((0)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("kts")].join('');
}
});
/**
 * Format a visibility so that only numbers below 1 get decimal places.
 */
weathergen.ui.format_visibility = (function weathergen$ui$format_visibility(vis){
if(cljs.core.not.call(null,vis)){
return "";
} else {
if((vis < (2))){
return vis.toFixed((1));
} else {
return vis.toFixed((0));
}
}
});
weathergen.ui.format_coords = (function weathergen$ui$format_coords(x,y){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1(", "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join('');
});
weathergen.ui.cloud_descriptions = (function weathergen$ui$cloud_descriptions(cloud_params,type){
if(cljs.core._EQ_.call(null,type,new cljs.core.Keyword(null,"sunny","sunny",1448267778))){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["SKC"], null);
} else {
var stratus_base = cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),type], null));
var cumulus_base = cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),type], null));
var cumulus_density = new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170).cljs$core$IFn$_invoke$arity$1(cloud_params);
var density_str = ((((25) < cumulus_density))?"SCT":"FEW");
var cumulus_level = goog.string.format("%03d",cljs.core.long$.call(null,(cumulus_base / (100))));
var stratus_level = goog.string.format("%03d",cljs.core.long$.call(null,(stratus_base / (100))));
var G__46641 = cljs.core.PersistentVector.EMPTY;
var G__46641__$1 = ((((cumulus_base > (0))) && ((cumulus_base < stratus_base)))?cljs.core.conj.call(null,G__46641,[cljs.core.str.cljs$core$IFn$_invoke$arity$1(density_str),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cumulus_level),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" ")].join('')):G__46641);
if(cljs.core.not_EQ_.call(null,type,new cljs.core.Keyword(null,"fair","fair",1684139423))){
return cljs.core.conj.call(null,G__46641__$1,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("OVC"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(stratus_level)].join(''));
} else {
return G__46641__$1;
}
}
});
weathergen.ui.contrail_description = (function weathergen$ui$contrail_description(cloud_params,type){
return goog.string.format("COTRA%03d",cljs.core.long$.call(null,(cljs.core.get.call(null,new cljs.core.Keyword(null,"contrails","contrails",1430581743).cljs$core$IFn$_invoke$arity$1(cloud_params),type) / (100))));
});
/**
 * Returns a string describing the clouds for the given weather type.
 */
weathergen.ui.format_cloud = (function weathergen$ui$format_cloud(cloud_params,type){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.reduce.call(null,cljs.core.str,cljs.core.interpose.call(null," ",weathergen.ui.cloud_descriptions.call(null,cloud_params,type)))),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.contrail_description.call(null,cloud_params,type))].join('');
});
/**
 * Returns a string describing precipitation.
 */
weathergen.ui.format_precipitation = (function weathergen$ui$format_precipitation(temperature,type){
if(cljs.core._EQ_.call(null,type,new cljs.core.Keyword(null,"inclement","inclement",-550669382))){
if((temperature > (0))){
return "Rain";
} else {
return "Snow";
}
} else {
return "None";
}
});
/**
 * Returns bullseye (a map of `:heading` and `:distance`) given
 *   weatherspace coordinates (a map of `:x` and `:y`).
 */
weathergen.ui.bullseye = (function weathergen$ui$bullseye(mission,p__46642){
var map__46647 = p__46642;
var map__46647__$1 = ((((!((map__46647 == null)))?((((map__46647.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46647.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46647):map__46647);
var x = cljs.core.get.call(null,map__46647__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46647__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var map__46649 = new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966).cljs$core$IFn$_invoke$arity$1(mission);
var map__46649__$1 = ((((!((map__46649 == null)))?((((map__46649.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46649.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46649):map__46649);
var bullseye_x = cljs.core.get.call(null,map__46649__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var bullseye_y = cljs.core.get.call(null,map__46649__$1,new cljs.core.Keyword(null,"bullseye-y","bullseye-y",904460818));
return goog.string.format("%f %f (%d %d)",x,y,bullseye_x,bullseye_y);
});
/**
 * Returns a bullseye string given bullseye coordinates.
 */
weathergen.ui.format_bullseye = (function weathergen$ui$format_bullseye(bullseye){
if(cljs.core.not.call(null,bullseye)){
return "";
} else {
var map__46653 = bullseye;
var map__46653__$1 = ((((!((map__46653 == null)))?((((map__46653.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46653.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46653):map__46653);
var heading = cljs.core.get.call(null,map__46653__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var distance = cljs.core.get.call(null,map__46653__$1,new cljs.core.Keyword(null,"distance","distance",-1671893894));
return goog.string.format("%03d %d",(function (){var h = cljs.core.long$.call(null,cljs.core.mod.call(null,heading,(360)));
if((h === (0))){
return (360);
} else {
return h;
}
})(),cljs.core.long$.call(null,distance));
}
});
/**
 * Given a mouse event, determined where on the map it occurred, in weatherspace.
 *   Returns coordinates as an [x y] pair, where x and y can be
 *   fractional.
 */
weathergen.ui.mouse_weather_coords = (function weathergen$ui$mouse_weather_coords(var_args){
var args46655 = [];
var len__24559__auto___46667 = arguments.length;
var i__24560__auto___46668 = (0);
while(true){
if((i__24560__auto___46668 < len__24559__auto___46667)){
args46655.push((arguments[i__24560__auto___46668]));

var G__46669 = (i__24560__auto___46668 + (1));
i__24560__auto___46668 = G__46669;
continue;
} else {
}
break;
}

var G__46657 = args46655.length;
switch (G__46657) {
case 1:
return weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$1((arguments[(0)]));

break;
case 3:
return weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args46655.length)].join('')));

}
});

weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$1 = (function (e){
return weathergen.ui.mouse_weather_coords.call(null,e,cljs.core.deref.call(null,weathergen.ui.map_zoom),cljs.core.deref.call(null,weathergen.ui.map_pan));
});

weathergen.ui.mouse_weather_coords.cljs$core$IFn$_invoke$arity$3 = (function (e,zoom,pan){
try{var browser_zoom = window.devicePixelRatio;
var ox = ((e["offsetX"]) * browser_zoom);
var oy = ((e["offsetY"]) * browser_zoom);
var vec__46659 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__46659,(0),null);
var ny = cljs.core.nth.call(null,vec__46659,(1),null);
var map__46662 = pan;
var map__46662__$1 = ((((!((map__46662 == null)))?((((map__46662.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46662.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46662):map__46662);
var x = cljs.core.get.call(null,map__46662__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46662__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__46663 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__46663,(0),null);
var height = cljs.core.nth.call(null,vec__46663,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(((((ox * nx) / width) / zoom) / browser_zoom) + x),(((((oy * ny) / height) / zoom) / browser_zoom) + y)], null);
}catch (e46658){var err = e46658;
return taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"weathergen.ui",null,1274,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (err){
return (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [err,"mouse-weather-coords error",new cljs.core.Keyword(null,"e","e",1381269198),e], null);
});})(err))
,null)),null,1694715050);
}});

weathergen.ui.mouse_weather_coords.cljs$lang$maxFixedArity = 3;

/**
 * Perform `f` asynchronously every `interval` milliseconds until it
 *   returns a logical true value.
 */
weathergen.ui.retry = (function weathergen$ui$retry(interval,f){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__){
return (function (state_46713){
var state_val_46714 = (state_46713[(1)]);
if((state_val_46714 === (1))){
var state_46713__$1 = state_46713;
var statearr_46715_46729 = state_46713__$1;
(statearr_46715_46729[(2)] = null);

(statearr_46715_46729[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46714 === (2))){
var inst_46701 = f.call(null);
var state_46713__$1 = state_46713;
if(cljs.core.truth_(inst_46701)){
var statearr_46716_46730 = state_46713__$1;
(statearr_46716_46730[(1)] = (4));

} else {
var statearr_46717_46731 = state_46713__$1;
(statearr_46717_46731[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46714 === (3))){
var inst_46711 = (state_46713[(2)]);
var state_46713__$1 = state_46713;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46713__$1,inst_46711);
} else {
if((state_val_46714 === (4))){
var state_46713__$1 = state_46713;
var statearr_46718_46732 = state_46713__$1;
(statearr_46718_46732[(2)] = null);

(statearr_46718_46732[(1)] = (6));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46714 === (5))){
var inst_46704 = cljs.core.async.timeout.call(null,interval);
var state_46713__$1 = state_46713;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46713__$1,(7),inst_46704);
} else {
if((state_val_46714 === (6))){
var inst_46709 = (state_46713[(2)]);
var state_46713__$1 = state_46713;
var statearr_46719_46733 = state_46713__$1;
(statearr_46719_46733[(2)] = inst_46709);

(statearr_46719_46733[(1)] = (3));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_46714 === (7))){
var inst_46706 = (state_46713[(2)]);
var state_46713__$1 = (function (){var statearr_46720 = state_46713;
(statearr_46720[(7)] = inst_46706);

return statearr_46720;
})();
var statearr_46721_46734 = state_46713__$1;
(statearr_46721_46734[(2)] = null);

(statearr_46721_46734[(1)] = (2));


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__40874__auto__))
;
return ((function (switch__40760__auto__,c__40874__auto__){
return (function() {
var weathergen$ui$retry_$_state_machine__40761__auto__ = null;
var weathergen$ui$retry_$_state_machine__40761__auto____0 = (function (){
var statearr_46725 = [null,null,null,null,null,null,null,null];
(statearr_46725[(0)] = weathergen$ui$retry_$_state_machine__40761__auto__);

(statearr_46725[(1)] = (1));

return statearr_46725;
});
var weathergen$ui$retry_$_state_machine__40761__auto____1 = (function (state_46713){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46713);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46726){if((e46726 instanceof Object)){
var ex__40764__auto__ = e46726;
var statearr_46727_46735 = state_46713;
(statearr_46727_46735[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46713);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46726;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46736 = state_46713;
state_46713 = G__46736;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$retry_$_state_machine__40761__auto__ = function(state_46713){
switch(arguments.length){
case 0:
return weathergen$ui$retry_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$retry_$_state_machine__40761__auto____1.call(this,state_46713);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$retry_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$retry_$_state_machine__40761__auto____0;
weathergen$ui$retry_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$retry_$_state_machine__40761__auto____1;
return weathergen$ui$retry_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__))
})();
var state__40876__auto__ = (function (){var statearr_46728 = f__40875__auto__.call(null);
(statearr_46728[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46728;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__))
);

return c__40874__auto__;
});
/**
 * Perform `f` asynchronously `interval` milliseconds from now.
 */
weathergen.ui.later = (function weathergen$ui$later(interval,f){
var c__40874__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__40874__auto__){
return (function (){
var f__40875__auto__ = (function (){var switch__40760__auto__ = ((function (c__40874__auto__){
return (function (state_46757){
var state_val_46758 = (state_46757[(1)]);
if((state_val_46758 === (1))){
var inst_46752 = cljs.core.async.timeout.call(null,interval);
var state_46757__$1 = state_46757;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_46757__$1,(2),inst_46752);
} else {
if((state_val_46758 === (2))){
var inst_46754 = (state_46757[(2)]);
var inst_46755 = f.call(null);
var state_46757__$1 = (function (){var statearr_46759 = state_46757;
(statearr_46759[(7)] = inst_46754);

return statearr_46759;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_46757__$1,inst_46755);
} else {
return null;
}
}
});})(c__40874__auto__))
;
return ((function (switch__40760__auto__,c__40874__auto__){
return (function() {
var weathergen$ui$later_$_state_machine__40761__auto__ = null;
var weathergen$ui$later_$_state_machine__40761__auto____0 = (function (){
var statearr_46763 = [null,null,null,null,null,null,null,null];
(statearr_46763[(0)] = weathergen$ui$later_$_state_machine__40761__auto__);

(statearr_46763[(1)] = (1));

return statearr_46763;
});
var weathergen$ui$later_$_state_machine__40761__auto____1 = (function (state_46757){
while(true){
var ret_value__40762__auto__ = (function (){try{while(true){
var result__40763__auto__ = switch__40760__auto__.call(null,state_46757);
if(cljs.core.keyword_identical_QMARK_.call(null,result__40763__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__40763__auto__;
}
break;
}
}catch (e46764){if((e46764 instanceof Object)){
var ex__40764__auto__ = e46764;
var statearr_46765_46767 = state_46757;
(statearr_46765_46767[(5)] = ex__40764__auto__);


cljs.core.async.impl.ioc_helpers.process_exception.call(null,state_46757);

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
throw e46764;

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__40762__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__46768 = state_46757;
state_46757 = G__46768;
continue;
} else {
return ret_value__40762__auto__;
}
break;
}
});
weathergen$ui$later_$_state_machine__40761__auto__ = function(state_46757){
switch(arguments.length){
case 0:
return weathergen$ui$later_$_state_machine__40761__auto____0.call(this);
case 1:
return weathergen$ui$later_$_state_machine__40761__auto____1.call(this,state_46757);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$later_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$later_$_state_machine__40761__auto____0;
weathergen$ui$later_$_state_machine__40761__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$later_$_state_machine__40761__auto____1;
return weathergen$ui$later_$_state_machine__40761__auto__;
})()
;})(switch__40760__auto__,c__40874__auto__))
})();
var state__40876__auto__ = (function (){var statearr_46766 = f__40875__auto__.call(null);
(statearr_46766[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__40874__auto__);

return statearr_46766;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__40876__auto__);
});})(c__40874__auto__))
);

return c__40874__auto__;
});
weathergen.ui.resize_handle_size = 0.75;
weathergen.ui.triangle_style = (function weathergen$ui$triangle_style(){
return new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"width","width",-384071477),(0),new cljs.core.Keyword(null,"height","height",1025178622),(0),new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null);
});
/**
 * Creates a three-layer border with :inner and :outer colors.
 * @param {...*} var_args
 */
weathergen.ui.triple_border = (function() { 
var weathergen$ui$triple_border__delegate = function (args__29774__auto__){
var vec__46783 = hoplon.core.parse_args.call(null,args__29774__auto__);
var attrs = cljs.core.nth.call(null,vec__46783,(0),null);
var contents = cljs.core.nth.call(null,vec__46783,(1),null);
var map__46786 = attrs;
var map__46786__$1 = ((((!((map__46786 == null)))?((((map__46786.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46786.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46786):map__46786);
var inner = cljs.core.get.call(null,map__46786__$1,new cljs.core.Keyword(null,"inner","inner",-1383171215));
var outer = cljs.core.get.call(null,map__46786__$1,new cljs.core.Keyword(null,"outer","outer",-375185956));
var css = cljs.core.get.call(null,map__46786__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"inner","inner",-1383171215),new cljs.core.Keyword(null,"outer","outer",-375185956),new cljs.core.Keyword(null,"css","css",1135045163));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__46786,map__46786__$1,inner,outer,css,attrs__$1,vec__46783,attrs,contents){
return (function (G__46789,G__46790,G__46788){
return G__46788.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"1px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__46789,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__46790);
});})(map__46786,map__46786__$1,inner,outer,css,attrs__$1,vec__46783,attrs,contents))
).call(null,outer,css,cljs.core.merge),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__46786,map__46786__$1,inner,outer,css,attrs__$1,vec__46783,attrs,contents){
return (function (G__46793,G__46791,G__46792){
return G__46791.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"2px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__46792,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__46793);
});})(map__46786,map__46786__$1,inner,outer,css,attrs__$1,vec__46783,attrs,contents))
).call(null,css,cljs.core.merge,inner),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (map__46786,map__46786__$1,inner,outer,css,attrs__$1,vec__46783,attrs,contents){
return (function (G__46795,G__46796,G__46794){
return G__46794.call(null,new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"border-width","border-width",-1512605390),"1px",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),G__46795,new cljs.core.Keyword(null,"margin","margin",-995903681),(0)], null),G__46796);
});})(map__46786,map__46786__$1,inner,outer,css,attrs__$1,vec__46783,attrs,contents))
).call(null,outer,css,cljs.core.merge),contents)));
};
var weathergen$ui$triple_border = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__46797__i = 0, G__46797__a = new Array(arguments.length -  0);
while (G__46797__i < G__46797__a.length) {G__46797__a[G__46797__i] = arguments[G__46797__i + 0]; ++G__46797__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__46797__a,0,null);
} 
return weathergen$ui$triple_border__delegate.call(this,args__29774__auto__);};
weathergen$ui$triple_border.cljs$lang$maxFixedArity = 0;
weathergen$ui$triple_border.cljs$lang$applyTo = (function (arglist__46798){
var args__29774__auto__ = cljs.core.seq(arglist__46798);
return weathergen$ui$triple_border__delegate(args__29774__auto__);
});
weathergen$ui$triple_border.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$triple_border__delegate;
return weathergen$ui$triple_border;
})()
;
/**
 * Renders a bordered box with a title bar.
 * @param {...*} var_args
 */
weathergen.ui.control_subsection = (function() { 
var weathergen$ui$control_subsection__delegate = function (args__29774__auto__){
var vec__46804 = hoplon.core.parse_args.call(null,args__29774__auto__);
var attributes = cljs.core.nth.call(null,vec__46804,(0),null);
var children = cljs.core.nth.call(null,vec__46804,(1),null);
var map__46807 = attributes;
var map__46807__$1 = ((((!((map__46807 == null)))?((((map__46807.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46807.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46807):map__46807);
var title = cljs.core.get.call(null,map__46807__$1,new cljs.core.Keyword(null,"title","title",636505583));
return hoplon.core.div.call(null,cljs.core.dissoc.call(null,attributes,new cljs.core.Keyword(null,"title","title",636505583)),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px #444",new cljs.core.Keyword(null,"margin","margin",-995903681),"3px",new cljs.core.Keyword(null,"padding-bottom","padding-bottom",-1899795591),"2px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"background","background",-863952629),weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"header-background","header-background",1686840154)),new cljs.core.Keyword(null,"margin","margin",-995903681),"3px",new cljs.core.Keyword(null,"padding","padding",1660304693),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),(0),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"90%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),title),children);
};
var weathergen$ui$control_subsection = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__46809__i = 0, G__46809__a = new Array(arguments.length -  0);
while (G__46809__i < G__46809__a.length) {G__46809__a[G__46809__i] = arguments[G__46809__i + 0]; ++G__46809__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__46809__a,0,null);
} 
return weathergen$ui$control_subsection__delegate.call(this,args__29774__auto__);};
weathergen$ui$control_subsection.cljs$lang$maxFixedArity = 0;
weathergen$ui$control_subsection.cljs$lang$applyTo = (function (arglist__46810){
var args__29774__auto__ = cljs.core.seq(arglist__46810);
return weathergen$ui$control_subsection__delegate(args__29774__auto__);
});
weathergen$ui$control_subsection.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$control_subsection__delegate;
return weathergen$ui$control_subsection;
})()
;
weathergen.ui.forecast_section = (function weathergen$ui$forecast_section(p__46813){
var map__46895 = p__46813;
var map__46895__$1 = ((((!((map__46895 == null)))?((((map__46895.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46895.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46895):map__46895);
var opts = map__46895__$1;
var limit_time_QMARK_ = cljs.core.get.call(null,map__46895__$1,new cljs.core.Keyword(null,"limit-time?","limit-time?",-602984376));
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Forecast"),new cljs.core.Keyword(null,"id","id",-1388402092),"forecast-section",hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"forecast",hoplon.core.div.call(null,hoplon.core.label.call(null,new cljs.core.Keyword(null,"for","for",-1323786319),"locations","Forecast for:"),(function (){var airbases = javelin.core.formula.call(null,((function (map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (G__46897,G__46900,G__46898,G__46899){
return G__46897.call(null,((function (map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (p1__46811_SHARP_){
return G__46898.call(null,G__46899,p1__46811_SHARP_);
});})(map__46895,map__46895__$1,opts,limit_time_QMARK_))
,G__46900.call(null,G__46899));
});})(map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.sort_by,weathergen.falcon.files.mission.oob_air,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission);
var vec__46903 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (p__46906){
var map__46907 = p__46906;
var map__46907__$1 = ((((!((map__46907 == null)))?((((map__46907.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46907.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46907):map__46907);
var coordinates = cljs.core.get.call(null,map__46907__$1,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668));
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [coordinates], null);
});})(airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.selected_cell));
var coordinates = cljs.core.nth.call(null,vec__46903,(0),null);
var vec__46915 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (p__46918){
var vec__46919 = p__46918;
var x = cljs.core.nth.call(null,vec__46919,(0),null);
var y = cljs.core.nth.call(null,vec__46919,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,coordinates));
var x = cljs.core.nth.call(null,vec__46915,(0),null);
var y = cljs.core.nth.call(null,vec__46915,(1),null);
return hoplon.core.select.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"locations",new cljs.core.Keyword(null,"change","change",-1163046502),((function (vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (p1__46812_SHARP_){
return weathergen.ui.change_location.call(null,cljs.core.deref.call(null,weathergen.ui.mission),cljs.core.nth.call(null,cljs.core.deref.call(null,airbases),weathergen.util.str__GT_long.call(null,cljs.core.deref.call(null,p1__46812_SHARP_))));
});})(vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
,hoplon.core.option.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (G__46923,G__46922){
return G__46922.call(null,new cljs.core.Keyword(null,"named","named",-422393479),G__46923);
});})(vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.location_type,cljs.core.not_EQ_),new cljs.core.Keyword(null,"value","value",305978217),"",javelin.core.formula.call(null,((function (vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (location_type,x__$1,y__$1){
var pred__46924 = cljs.core._EQ_;
var expr__46925 = location_type;
if(cljs.core.truth_(pred__46924.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),expr__46925))){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Location "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.format_coords.call(null,x__$1,y__$1))].join('');
} else {
if(cljs.core.truth_(pred__46924.call(null,new cljs.core.Keyword(null,"named","named",-422393479),expr__46925))){
return "";
} else {
if(cljs.core.truth_(pred__46924.call(null,new cljs.core.Keyword(null,"none","none",1333468478),expr__46925))){
return "None selected";
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__46925)].join('')));
}
}
}
});})(vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.location_type,x,y)),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (G__46927,G__46929,G__46928){
return G__46927.call(null,G__46928,G__46929);
});})(vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.map_indexed,airbases,cljs.core.vector),((function (vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (item__29818__auto__){
var vec__46930 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,item__29818__auto__));
var indexed = cljs.core.nth.call(null,vec__46930,(0),null);
var vec__46939 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46930,indexed,vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (p__46942){
var vec__46943 = p__46942;
var index = cljs.core.nth.call(null,vec__46943,(0),null);
var ab = cljs.core.nth.call(null,vec__46943,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [ab,index], null);
});})(vec__46930,indexed,vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,indexed));
var ab = cljs.core.nth.call(null,vec__46939,(0),null);
var index = cljs.core.nth.call(null,vec__46939,(1),null);
return hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),index,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.formula.call(null,((function (vec__46939,ab,index,vec__46930,indexed,vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (G__46947,G__46946,G__46948){
return G__46946.call(null,G__46947,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__46948));
});})(vec__46939,ab,index,vec__46930,indexed,vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,ab,cljs.core._EQ_,weathergen.ui.selected_cell),javelin.core.formula.call(null,((function (vec__46939,ab,index,vec__46930,indexed,vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (G__46951,G__46949,G__46950){
return G__46949.call(null,G__46950,G__46951);
});})(vec__46939,ab,index,vec__46930,indexed,vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,ab,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission));
});})(vec__46915,x,y,vec__46903,coordinates,airbases,map__46895,map__46895__$1,opts,limit_time_QMARK_))
));
})(),javelin.core.formula.call(null,((function (map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (pressure_unit,forecast,cloud_params){
var td1 = ((function (map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function() { 
var G__46976__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.td,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"3px",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px"], null),args);
};
var G__46976 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__46977__i = 0, G__46977__a = new Array(arguments.length -  0);
while (G__46977__i < G__46977__a.length) {G__46977__a[G__46977__i] = arguments[G__46977__i + 0]; ++G__46977__i;}
  args = new cljs.core.IndexedSeq(G__46977__a,0,null);
} 
return G__46976__delegate.call(this,args);};
G__46976.cljs$lang$maxFixedArity = 0;
G__46976.cljs$lang$applyTo = (function (arglist__46978){
var args = cljs.core.seq(arglist__46978);
return G__46976__delegate(args);
});
G__46976.cljs$core$IFn$_invoke$arity$variadic = G__46976__delegate;
return G__46976;
})()
;})(map__46895,map__46895__$1,opts,limit_time_QMARK_))
;
var td2 = ((function (td1,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function() { 
var G__46979__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.td,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"3px",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),args);
};
var G__46979 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__46980__i = 0, G__46980__a = new Array(arguments.length -  0);
while (G__46980__i < G__46980__a.length) {G__46980__a[G__46980__i] = arguments[G__46980__i + 0]; ++G__46980__i;}
  args = new cljs.core.IndexedSeq(G__46980__a,0,null);
} 
return G__46979__delegate.call(this,args);};
G__46979.cljs$lang$maxFixedArity = 0;
G__46979.cljs$lang$applyTo = (function (arglist__46981){
var args = cljs.core.seq(arglist__46981);
return G__46979__delegate(args);
});
G__46979.cljs$core$IFn$_invoke$arity$variadic = G__46979__delegate;
return G__46979;
})()
;})(td1,map__46895,map__46895__$1,opts,limit_time_QMARK_))
;
return hoplon.core.table.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"info-grid",hoplon.core.thead.call(null,hoplon.core.tr.call(null,td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"time","time",1385887882)], null),"Weather Time")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"type","type",1174270348)], null),"Type")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Press")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null),"Temp")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),"Wind")),td2.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null),"Vis")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"precipitation","precipitation",485418199)], null),"Precip")),td1.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"forecast","forecast",-1289862359),new cljs.core.Keyword(null,"cloud","cloud",-1976521303)], null),"Cloud")))),hoplon.core.tbody.call(null,((cljs.core.not.call(null,forecast))?hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(8),"No location is selected. Choose a location from the list, or click on the weather map to select one.")):(function (){var iter__24200__auto__ = ((function (td1,td2,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function weathergen$ui$forecast_section_$_iter__46952(s__46953){
return (new cljs.core.LazySeq(null,((function (td1,td2,map__46895,map__46895__$1,opts,limit_time_QMARK_){
return (function (){
var s__46953__$1 = s__46953;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46953__$1);
if(temp__5278__auto__){
var s__46953__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46953__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__46953__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__46955 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__46954 = (0);
while(true){
if((i__46954 < size__24199__auto__)){
var vec__46966 = cljs.core._nth.call(null,c__24198__auto__,i__46954);
var time = cljs.core.nth.call(null,vec__46966,(0),null);
var weather = cljs.core.nth.call(null,vec__46966,(1),null);
var map__46969 = weather;
var map__46969__$1 = ((((!((map__46969 == null)))?((((map__46969.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46969.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46969):map__46969);
var pressure = cljs.core.get.call(null,map__46969__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__46969__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__46969__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__46969__$1,new cljs.core.Keyword(null,"type","type",1174270348));
cljs.core.chunk_append.call(null,b__46955,hoplon.core.tr.call(null,td1.call(null,weathergen.ui.common.format_time.call(null,time)),td1.call(null,weathergen.ui.format_type.call(null,type)),td1.call(null,weathergen.ui.format_pressure.call(null,pressure,pressure_unit)),td2.call(null,weathergen.ui.format_temperature.call(null,temperature)),td1.call(null,weathergen.ui.format_wind.call(null,wind)),td2.call(null,weathergen.ui.format_visibility.call(null,cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),type], null)))),td1.call(null,weathergen.ui.format_precipitation.call(null,temperature,type)),td1.call(null,weathergen.ui.format_cloud.call(null,cloud_params,type))));

var G__46982 = (i__46954 + (1));
i__46954 = G__46982;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46955),weathergen$ui$forecast_section_$_iter__46952.call(null,cljs.core.chunk_rest.call(null,s__46953__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46955),null);
}
} else {
var vec__46971 = cljs.core.first.call(null,s__46953__$2);
var time = cljs.core.nth.call(null,vec__46971,(0),null);
var weather = cljs.core.nth.call(null,vec__46971,(1),null);
var map__46974 = weather;
var map__46974__$1 = ((((!((map__46974 == null)))?((((map__46974.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46974.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46974):map__46974);
var pressure = cljs.core.get.call(null,map__46974__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__46974__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__46974__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__46974__$1,new cljs.core.Keyword(null,"type","type",1174270348));
return cljs.core.cons.call(null,hoplon.core.tr.call(null,td1.call(null,weathergen.ui.common.format_time.call(null,time)),td1.call(null,weathergen.ui.format_type.call(null,type)),td1.call(null,weathergen.ui.format_pressure.call(null,pressure,pressure_unit)),td2.call(null,weathergen.ui.format_temperature.call(null,temperature)),td1.call(null,weathergen.ui.format_wind.call(null,wind)),td2.call(null,weathergen.ui.format_visibility.call(null,cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),type], null)))),td1.call(null,weathergen.ui.format_precipitation.call(null,temperature,type)),td1.call(null,weathergen.ui.format_cloud.call(null,cloud_params,type))),weathergen$ui$forecast_section_$_iter__46952.call(null,cljs.core.rest.call(null,s__46953__$2)));
}
} else {
return null;
}
break;
}
});})(td1,td2,map__46895,map__46895__$1,opts,limit_time_QMARK_))
,null,null));
});})(td1,td2,map__46895,map__46895__$1,opts,limit_time_QMARK_))
;
return iter__24200__auto__.call(null,forecast);
})())));
});})(map__46895,map__46895__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.pressure_unit,weathergen.ui.forecast,weathergen.ui.cloud_params))));
});
weathergen.ui.weather_color = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),0.25], null),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(0),(1)], null),new cljs.core.Keyword(null,"inclement","inclement",-550669382),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(0),(0),(1)], null)], null);
weathergen.ui.pressure_map = new cljs.core.PersistentArrayMap(null, 7, [28.5,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),28.9,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(192),(0),(0),(1)], null),29.3,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(0),(1)], null),29.5,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),29.9,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(128),(255),(1)], null),30.2,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),(1)], null),31.0,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),(1)], null)], null);
weathergen.ui.gradient_color = (function weathergen$ui$gradient_color(color_map,val){
var vec__47002 = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p__47011){
var vec__47012 = p__47011;
var vec__47015 = cljs.core.nth.call(null,vec__47012,(0),null);
var low = cljs.core.nth.call(null,vec__47015,(0),null);
var l = cljs.core.nth.call(null,vec__47015,(1),null);
var vec__47018 = cljs.core.nth.call(null,vec__47012,(1),null);
var high = cljs.core.nth.call(null,vec__47018,(0),null);
var h = cljs.core.nth.call(null,vec__47018,(1),null);
return ((low <= val)) && ((val <= high));
}),cljs.core.partition.call(null,(2),(1),cljs.core.into.call(null,cljs.core.sorted_map.call(null),color_map))));
var vec__47005 = cljs.core.nth.call(null,vec__47002,(0),null);
var low = cljs.core.nth.call(null,vec__47005,(0),null);
var l = cljs.core.nth.call(null,vec__47005,(1),null);
var vec__47008 = cljs.core.nth.call(null,vec__47002,(1),null);
var high = cljs.core.nth.call(null,vec__47008,(0),null);
var h = cljs.core.nth.call(null,vec__47008,(1),null);
return weathergen.math.vector_interpolate.call(null,l,h,val,low,high);
});
weathergen.ui.pressure_color = (function weathergen$ui$pressure_color(pressure){
var vec__47024 = weathergen.ui.gradient_color.call(null,weathergen.ui.pressure_map,pressure);
var r = cljs.core.nth.call(null,vec__47024,(0),null);
var g = cljs.core.nth.call(null,vec__47024,(1),null);
var b = cljs.core.nth.call(null,vec__47024,(2),null);
var a = cljs.core.nth.call(null,vec__47024,(3),null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.long$.call(null,r),cljs.core.long$.call(null,g),cljs.core.long$.call(null,b),a], null);
});
weathergen.ui.temp_map = new cljs.core.PersistentArrayMap(null, 3, [(0),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(255),(1)], null),(20),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(255),(0),(1)], null),(40),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(0),(0),(1)], null)], null);
weathergen.ui.temperature_color = (function weathergen$ui$temperature_color(temp){
var vec__47030 = weathergen.ui.gradient_color.call(null,weathergen.ui.temp_map,temp);
var r = cljs.core.nth.call(null,vec__47030,(0),null);
var g = cljs.core.nth.call(null,vec__47030,(1),null);
var b = cljs.core.nth.call(null,vec__47030,(2),null);
var a = cljs.core.nth.call(null,vec__47030,(3),null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.long$.call(null,r),cljs.core.long$.call(null,g),cljs.core.long$.call(null,b),a], null);
});
weathergen.ui.transparent = new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(0),(1)], null);
weathergen.ui.fill_color = (function weathergen$ui$fill_color(display,w){
var pred__47036 = cljs.core._EQ_;
var expr__47037 = display;
if(cljs.core.truth_(pred__47036.call(null,new cljs.core.Keyword(null,"type","type",1174270348),expr__47037))){
return weathergen.ui.weather_color.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(w));
} else {
if(cljs.core.truth_(pred__47036.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),expr__47037))){
return weathergen.ui.pressure_color.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(w));
} else {
if(cljs.core.truth_(pred__47036.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429),expr__47037))){
return weathergen.ui.temperature_color.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(w));
} else {
return weathergen.ui.transparent;
}
}
}
});
/**
 * Return a pressure in inches Mercury given a value and a unit
 */
weathergen.ui.convert_pressure = (function weathergen$ui$convert_pressure(val,unit){
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"inhg","inhg",-863180091),unit)){
return val;
} else {
return weathergen.ui.mbar__GT_inhg.call(null,val);
}
});
weathergen.ui.max_wind_vector_speed = (150);
weathergen.ui.wind_vector_id = (function weathergen$ui$wind_vector_id(speed){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("wind-vector-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.math.clamp.call(null,(5),weathergen.ui.max_wind_vector_speed,weathergen.math.nearest.call(null,speed,(5))))].join('');
});
weathergen.ui.update_wind_layer = (function weathergen$ui$update_wind_layer(weather_data,display_params){
var timer_name__15521__auto__ = "update-wind-layer";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var seq__47061 = cljs.core.seq.call(null,weather_data);
var chunk__47063 = null;
var count__47064 = (0);
var i__47065 = (0);
while(true){
if((i__47065 < count__47064)){
var vec__47067 = cljs.core._nth.call(null,chunk__47063,i__47065);
var vec__47070 = cljs.core.nth.call(null,vec__47067,(0),null);
var x = cljs.core.nth.call(null,vec__47070,(0),null);
var y = cljs.core.nth.call(null,vec__47070,(1),null);
var weather = cljs.core.nth.call(null,vec__47067,(1),null);
var map__47073_47083 = new cljs.core.Keyword(null,"wind","wind",-527553074).cljs$core$IFn$_invoke$arity$1(weather);
var map__47073_47084__$1 = ((((!((map__47073_47083 == null)))?((((map__47073_47083.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47073_47083.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47073_47083):map__47073_47083);
var speed_47085 = cljs.core.get.call(null,map__47073_47084__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_47086 = cljs.core.get.call(null,map__47073_47084__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_47087 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47087.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_47086));

cell_47087.setAttributeNS("http://www.w3.org/1999/xlink","href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("#"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.wind_vector_id.call(null,speed_47085))].join(''));

var G__47088 = seq__47061;
var G__47089 = chunk__47063;
var G__47090 = count__47064;
var G__47091 = (i__47065 + (1));
seq__47061 = G__47088;
chunk__47063 = G__47089;
count__47064 = G__47090;
i__47065 = G__47091;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__47061);
if(temp__5278__auto__){
var seq__47061__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47061__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__47061__$1);
var G__47092 = cljs.core.chunk_rest.call(null,seq__47061__$1);
var G__47093 = c__24249__auto__;
var G__47094 = cljs.core.count.call(null,c__24249__auto__);
var G__47095 = (0);
seq__47061 = G__47092;
chunk__47063 = G__47093;
count__47064 = G__47094;
i__47065 = G__47095;
continue;
} else {
var vec__47075 = cljs.core.first.call(null,seq__47061__$1);
var vec__47078 = cljs.core.nth.call(null,vec__47075,(0),null);
var x = cljs.core.nth.call(null,vec__47078,(0),null);
var y = cljs.core.nth.call(null,vec__47078,(1),null);
var weather = cljs.core.nth.call(null,vec__47075,(1),null);
var map__47081_47096 = new cljs.core.Keyword(null,"wind","wind",-527553074).cljs$core$IFn$_invoke$arity$1(weather);
var map__47081_47097__$1 = ((((!((map__47081_47096 == null)))?((((map__47081_47096.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47081_47096.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47081_47096):map__47081_47096);
var speed_47098 = cljs.core.get.call(null,map__47081_47097__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_47099 = cljs.core.get.call(null,map__47081_47097__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_47100 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47100.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_47099));

cell_47100.setAttributeNS("http://www.w3.org/1999/xlink","href",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("#"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.wind_vector_id.call(null,speed_47098))].join(''));

var G__47101 = cljs.core.next.call(null,seq__47061__$1);
var G__47102 = null;
var G__47103 = (0);
var G__47104 = (0);
seq__47061 = G__47101;
chunk__47063 = G__47102;
count__47064 = G__47103;
i__47065 = G__47104;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
if(typeof weathergen.ui.overlay_text !== 'undefined'){
} else {
weathergen.ui.overlay_text = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","overlay-text"),((function (method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function (weather,display_params){
return new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
});})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"default","default",-1987822328),(function (_,___$1){
return "";
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"pressure","pressure",505343747),(function (weather,display_params){
return weathergen.ui.format_pressure.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(weather),new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(display_params));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"temperature","temperature",899018429),(function (weather,_){
return (function (){var G__47105 = new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(weather);
return G__47105;
})().toFixed((1));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"type","type",1174270348),(function (weather,_){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),"S",new cljs.core.Keyword(null,"fair","fair",1684139423),"F",new cljs.core.Keyword(null,"poor","poor",1462482211),"P",new cljs.core.Keyword(null,"inclement","inclement",-550669382),"I"], null).call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(weather));
}));
cljs.core._add_method.call(null,weathergen.ui.overlay_text,new cljs.core.Keyword(null,"coords","coords",-599429112),(function (weather,overlay){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(weather)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(weather))].join('');
}));
weathergen.ui.update_text_layer = (function weathergen$ui$update_text_layer(weather_data,display_params){
var timer_name__15521__auto__ = "update-text-layer";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var seq__47124 = cljs.core.seq.call(null,weather_data);
var chunk__47126 = null;
var count__47127 = (0);
var i__47128 = (0);
while(true){
if((i__47128 < count__47127)){
var vec__47130 = cljs.core._nth.call(null,chunk__47126,i__47128);
var vec__47133 = cljs.core.nth.call(null,vec__47130,(0),null);
var x = cljs.core.nth.call(null,vec__47133,(0),null);
var y = cljs.core.nth.call(null,vec__47133,(1),null);
var weather = cljs.core.nth.call(null,vec__47130,(1),null);
var text_47142 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_47143 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47143.innerHTML = text_47142;

var G__47144 = seq__47124;
var G__47145 = chunk__47126;
var G__47146 = count__47127;
var G__47147 = (i__47128 + (1));
seq__47124 = G__47144;
chunk__47126 = G__47145;
count__47127 = G__47146;
i__47128 = G__47147;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__47124);
if(temp__5278__auto__){
var seq__47124__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47124__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__47124__$1);
var G__47148 = cljs.core.chunk_rest.call(null,seq__47124__$1);
var G__47149 = c__24249__auto__;
var G__47150 = cljs.core.count.call(null,c__24249__auto__);
var G__47151 = (0);
seq__47124 = G__47148;
chunk__47126 = G__47149;
count__47127 = G__47150;
i__47128 = G__47151;
continue;
} else {
var vec__47136 = cljs.core.first.call(null,seq__47124__$1);
var vec__47139 = cljs.core.nth.call(null,vec__47136,(0),null);
var x = cljs.core.nth.call(null,vec__47139,(0),null);
var y = cljs.core.nth.call(null,vec__47139,(1),null);
var weather = cljs.core.nth.call(null,vec__47136,(1),null);
var text_47152 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_47153 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
cell_47153.innerHTML = text_47152;

var G__47154 = cljs.core.next.call(null,seq__47124__$1);
var G__47155 = null;
var G__47156 = (0);
var G__47157 = (0);
seq__47124 = G__47154;
chunk__47126 = G__47155;
count__47127 = G__47156;
i__47128 = G__47157;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_overlay = (function weathergen$ui$update_overlay(weather_data,display_params){
var timer_name__15521__auto__ = "update-overlay";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var pred__47161 = cljs.core.contains_QMARK_;
var expr__47162 = new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
if(cljs.core.truth_(pred__47161.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"wind","wind",-527553074),null], null), null),expr__47162))){
return weathergen.ui.update_wind_layer.call(null,weather_data,display_params);
} else {
if(cljs.core.truth_(pred__47161.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),null,new cljs.core.Keyword(null,"type","type",1174270348),null,new cljs.core.Keyword(null,"temperature","temperature",899018429),null], null), null),expr__47162))){
return weathergen.ui.update_text_layer.call(null,weather_data,display_params);
} else {
return null;
}
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_primary_layer = (function weathergen$ui$update_primary_layer(weather_data,display_params){
var timer_name__15521__auto__ = "update-primary-layer";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var seq__47188 = cljs.core.seq.call(null,weather_data);
var chunk__47190 = null;
var count__47191 = (0);
var i__47192 = (0);
while(true){
if((i__47192 < count__47191)){
var vec__47194 = cljs.core._nth.call(null,chunk__47190,i__47192);
var vec__47197 = cljs.core.nth.call(null,vec__47194,(0),null);
var x = cljs.core.nth.call(null,vec__47197,(0),null);
var y = cljs.core.nth.call(null,vec__47197,(1),null);
var weather = cljs.core.nth.call(null,vec__47194,(1),null);
var vec__47200_47212 = weathergen.ui.fill_color.call(null,new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params),weather);
var r_47213 = cljs.core.nth.call(null,vec__47200_47212,(0),null);
var g_47214 = cljs.core.nth.call(null,vec__47200_47212,(1),null);
var b_47215 = cljs.core.nth.call(null,vec__47200_47212,(2),null);
var a_47216 = cljs.core.nth.call(null,vec__47200_47212,(3),null);
var cell_47217 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
if(cljs.core.truth_(cell_47217)){
cell_47217.setAttribute("fill",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgba("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_47213),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_47214),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_47215),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_47216),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join(''));
} else {
}

var G__47218 = seq__47188;
var G__47219 = chunk__47190;
var G__47220 = count__47191;
var G__47221 = (i__47192 + (1));
seq__47188 = G__47218;
chunk__47190 = G__47219;
count__47191 = G__47220;
i__47192 = G__47221;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__47188);
if(temp__5278__auto__){
var seq__47188__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47188__$1)){
var c__24249__auto__ = cljs.core.chunk_first.call(null,seq__47188__$1);
var G__47222 = cljs.core.chunk_rest.call(null,seq__47188__$1);
var G__47223 = c__24249__auto__;
var G__47224 = cljs.core.count.call(null,c__24249__auto__);
var G__47225 = (0);
seq__47188 = G__47222;
chunk__47190 = G__47223;
count__47191 = G__47224;
i__47192 = G__47225;
continue;
} else {
var vec__47203 = cljs.core.first.call(null,seq__47188__$1);
var vec__47206 = cljs.core.nth.call(null,vec__47203,(0),null);
var x = cljs.core.nth.call(null,vec__47206,(0),null);
var y = cljs.core.nth.call(null,vec__47206,(1),null);
var weather = cljs.core.nth.call(null,vec__47203,(1),null);
var vec__47209_47226 = weathergen.ui.fill_color.call(null,new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(display_params),weather);
var r_47227 = cljs.core.nth.call(null,vec__47209_47226,(0),null);
var g_47228 = cljs.core.nth.call(null,vec__47209_47226,(1),null);
var b_47229 = cljs.core.nth.call(null,vec__47209_47226,(2),null);
var a_47230 = cljs.core.nth.call(null,vec__47209_47226,(3),null);
var cell_47231 = goog.dom.getElement([cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y)].join(''));
if(cljs.core.truth_(cell_47231)){
cell_47231.setAttribute("fill",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgba("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_47227),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_47228),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_47229),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_47230),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join(''));
} else {
}

var G__47232 = cljs.core.next.call(null,seq__47188__$1);
var G__47233 = null;
var G__47234 = (0);
var G__47235 = (0);
seq__47188 = G__47232;
chunk__47190 = G__47233;
count__47191 = G__47234;
i__47192 = G__47235;
continue;
}
} else {
return null;
}
}
break;
}
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_grid_data = (function weathergen$ui$update_grid_data(weather_data,display_params){
var timer_name__15521__auto__ = "update-grid-data";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){
weathergen.ui.update_primary_layer.call(null,weather_data,display_params);

return weathergen.ui.update_overlay.call(null,weather_data,display_params);
})()
;
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.update_grid = (function weathergen$ui$update_grid(weather_data,display_params){
var timer_name__15521__auto__ = "update-grid";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = weathergen.ui.update_grid_data.call(null,weather_data,display_params);
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});
weathergen.ui.wind_vector_defs = (function weathergen$ui$wind_vector_defs(){
return hoplon.svg.defs.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$wind_vector_defs_$_iter__47240(s__47241){
return (new cljs.core.LazySeq(null,(function (){
var s__47241__$1 = s__47241;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47241__$1);
if(temp__5278__auto__){
var s__47241__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47241__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__47241__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__47243 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__47242 = (0);
while(true){
if((i__47242 < size__24199__auto__)){
var speed = cljs.core._nth.call(null,c__24198__auto__,i__47242);
cljs.core.chunk_append.call(null,b__47243,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.wind_vector_id.call(null,speed),weathergen.wind.barb.call(null,speed)));

var G__47244 = (i__47242 + (1));
i__47242 = G__47244;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47243),weathergen$ui$wind_vector_defs_$_iter__47240.call(null,cljs.core.chunk_rest.call(null,s__47241__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47243),null);
}
} else {
var speed = cljs.core.first.call(null,s__47241__$2);
return cljs.core.cons.call(null,hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),weathergen.ui.wind_vector_id.call(null,speed),weathergen.wind.barb.call(null,speed)),weathergen$ui$wind_vector_defs_$_iter__47240.call(null,cljs.core.rest.call(null,s__47241__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,cljs.core.range.call(null,(5),(weathergen.ui.max_wind_vector_speed + (1)),(5)));
})());
});
weathergen.ui.bullseye_info_box = (function weathergen$ui$bullseye_info_box(){
var watched = javelin.core.formula.call(null,(function (mouse_location,map_zoom){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [mouse_location,map_zoom], null);
})).call(null,weathergen.ui.mouse_location,weathergen.ui.map_zoom);
var x = javelin.core.cell.call(null,(0));
var y = javelin.core.cell.call(null,(0));
var w = javelin.core.cell.call(null,(0));
var h = javelin.core.cell.call(null,(0));
var t = hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"3.5%",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Source Code Pro",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(100),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),"black",hoplon.svg.tspan.call(null,javelin.core.formula.call(null,((function (x,y,w,h,watched){
return (function (G__47264,G__47265,G__47263,G__47266){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__47262 = G__47263;
var G__47262__$1 = (cljs.core.truth_((G__47262 == null))?null:G__47264.call(null,G__47265,G__47262));
if(cljs.core.truth_((G__47262__$1 == null))){
return null;
} else {
return G__47266.call(null,G__47262__$1);
}
})())].join('');
});})(x,y,w,h,watched))
).call(null,weathergen.coordinates.weather__GT_bullseye,weathergen.ui.mission,weathergen.ui.mouse_location,weathergen.ui.format_bullseye)));
var update_bbox__15569__auto__ = ((function (x,y,w,h,t,watched){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (x,y,w,h,t,watched){
return (function (){
var bb__15570__auto__ = t.getBBox();
if(cljs.core.truth_(bb__15570__auto__.x)){
cljs.core.reset_BANG_.call(null,x,bb__15570__auto__.x);

cljs.core.reset_BANG_.call(null,y,bb__15570__auto__.y);

cljs.core.reset_BANG_.call(null,w,bb__15570__auto__.width);

return cljs.core.reset_BANG_.call(null,h,bb__15570__auto__.height);
} else {
return null;
}
});})(x,y,w,h,t,watched))
);
});})(x,y,w,h,t,watched))
;
hoplon.core.when_dom.call(null,t,update_bbox__15569__auto__);

var temp__5278__auto___47279 = watched;
if(cljs.core.truth_(temp__5278__auto___47279)){
var w__15571__auto___47280 = temp__5278__auto___47279;
cljs.core.add_watch.call(null,w__15571__auto___47280,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15571__auto___47280,temp__5278__auto___47279,x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15571__auto___47280,temp__5278__auto___47279,x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (){
return update_bbox__15569__auto__.call(null);
});})(w__15571__auto___47280,temp__5278__auto___47279,x,y,w,h,t,update_bbox__15569__auto__,watched))
,(0));
});})(w__15571__auto___47280,temp__5278__auto___47279,x,y,w,h,t,update_bbox__15569__auto__,watched))
);
} else {
}

return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"bullseye-info-box",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47267){
return cljs.core.not.call(null,(G__47267 == null));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,weathergen.ui.mouse_location),new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (mouse_location,map_zoom,map_size){
var map__47268 = mouse_location;
var map__47268__$1 = ((((!((map__47268 == null)))?((((map__47268.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47268.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47268):map__47268);
var x__$1 = cljs.core.get.call(null,map__47268__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__47268__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__47269 = map_size;
var width = cljs.core.nth.call(null,vec__47269,(0),null);
var height = cljs.core.nth.call(null,vec__47269,(1),null);
return weathergen.ui.common.svg_translate.call(null,(x__$1 + ((1000.0 / width) / map_zoom)),(y__$1 + ((1250.0 / height) / map_zoom)));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,weathergen.ui.mouse_location,weathergen.ui.map_zoom,weathergen.ui.map_size),hoplon.svg.g.call(null,new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47273,G__47275,G__47274){
return G__47273.call(null,(G__47274 / G__47275));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_zoom,weathergen.ui.map_text_scale),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47276){
return (G__47276 * -0.05);
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,w),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47277){
return (- (0.8 * G__47277));
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,h),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (G__47278){
return (G__47278 * 1.1);
});})(x,y,w,h,t,update_bbox__15569__auto__,watched))
).call(null,w),new cljs.core.Keyword(null,"height","height",1025178622),h,new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"opacity","opacity",397153780),0.8),t));
});
weathergen.ui.info_overlay = (function weathergen$ui$info_overlay(hover_cell,weather_data,pressure_unit,nx,ny,cloud_params){
var map__47316 = hover_cell;
var map__47316__$1 = ((((!((map__47316 == null)))?((((map__47316.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47316.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47316):map__47316);
var x = cljs.core.get.call(null,map__47316__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47316__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.not.call(null,(function (){var and__23326__auto__ = x;
if(cljs.core.truth_(and__23326__auto__)){
var and__23326__auto____$1 = y;
if(cljs.core.truth_(and__23326__auto____$1)){
return ((((0) <= x)) && ((x <= (nx - (1))))) && ((((0) <= y)) && ((y <= (ny - (1)))));
} else {
return and__23326__auto____$1;
}
} else {
return and__23326__auto__;
}
})())){
return cljs.core.PersistentVector.EMPTY;
} else {
var width = (13);
var height = (8);
var map__47318 = cljs.core.get.call(null,weather_data,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));
var map__47318__$1 = ((((!((map__47318 == null)))?((((map__47318.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47318.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47318):map__47318);
var pressure = cljs.core.get.call(null,map__47318__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__47318__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__47318__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__47318__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var map__47319 = wind;
var map__47319__$1 = ((((!((map__47319 == null)))?((((map__47319.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47319.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47319):map__47319);
var speed = cljs.core.get.call(null,map__47319__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__47319__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"fill","fill",883462889),"black",new cljs.core.Keyword(null,"opacity","opacity",397153780),"0.5",new cljs.core.Keyword(null,"pointer-events","pointer-events",-1053858853),"none"], null),new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(1)),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"info-overlay",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (width,height,map__47318,map__47318__$1,pressure,temperature,wind,type,map__47319,map__47319__$1,speed,heading,map__47316,map__47316__$1,x,y){
return (function (G__47322){
return cljs.core.not.call(null,(G__47322 == null));
});})(width,height,map__47318,map__47318__$1,pressure,temperature,wind,type,map__47319,map__47319__$1,speed,heading,map__47316,map__47316__$1,x,y))
).call(null,hover_cell),new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_translate.call(null,(((x < (nx - width)))?(x + (1)):(x - width)),(((y < (nx - height)))?(y + (1)):(y - height)))], null),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"opacity","opacity",397153780),"0.85",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1px"], null),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"6%"], null),(function (){var cloud_descriptions = weathergen.ui.cloud_descriptions.call(null,cloud_params,type);
var iter__24200__auto__ = ((function (cloud_descriptions,width,height,map__47318,map__47318__$1,pressure,temperature,wind,type,map__47319,map__47319__$1,speed,heading,map__47316,map__47316__$1,x,y){
return (function weathergen$ui$info_overlay_$_iter__47323(s__47324){
return (new cljs.core.LazySeq(null,((function (cloud_descriptions,width,height,map__47318,map__47318__$1,pressure,temperature,wind,type,map__47319,map__47319__$1,speed,heading,map__47316,map__47316__$1,x,y){
return (function (){
var s__47324__$1 = s__47324;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47324__$1);
if(temp__5278__auto__){
var s__47324__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47324__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__47324__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__47326 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__47325 = (0);
while(true){
if((i__47325 < size__24199__auto__)){
var vec__47339 = cljs.core._nth.call(null,c__24198__auto__,i__47325);
var line = cljs.core.nth.call(null,vec__47339,(0),null);
var vec__47342 = cljs.core.nth.call(null,vec__47339,(1),null);
var label = cljs.core.nth.call(null,vec__47342,(0),null);
var value = cljs.core.nth.call(null,vec__47342,(1),null);
cljs.core.chunk_append.call(null,b__47326,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),0.2,new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(label),cljs.core.str.cljs$core$IFn$_invoke$arity$1(":")].join('')),hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(4),new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),value)], null));

var G__47351 = (i__47325 + (1));
i__47325 = G__47351;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47326),weathergen$ui$info_overlay_$_iter__47323.call(null,cljs.core.chunk_rest.call(null,s__47324__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47326),null);
}
} else {
var vec__47345 = cljs.core.first.call(null,s__47324__$2);
var line = cljs.core.nth.call(null,vec__47345,(0),null);
var vec__47348 = cljs.core.nth.call(null,vec__47345,(1),null);
var label = cljs.core.nth.call(null,vec__47348,(0),null);
var value = cljs.core.nth.call(null,vec__47348,(1),null);
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),0.2,new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(label),cljs.core.str.cljs$core$IFn$_invoke$arity$1(":")].join('')),hoplon.svg.text.call(null,new cljs.core.Keyword(null,"x","x",2099068185),(4),new cljs.core.Keyword(null,"y","y",-1757859776),(line + 1.2),value)], null),weathergen$ui$info_overlay_$_iter__47323.call(null,cljs.core.rest.call(null,s__47324__$2)));
}
} else {
return null;
}
break;
}
});})(cloud_descriptions,width,height,map__47318,map__47318__$1,pressure,temperature,wind,type,map__47319,map__47319__$1,speed,heading,map__47316,map__47316__$1,x,y))
,null,null));
});})(cloud_descriptions,width,height,map__47318,map__47318__$1,pressure,temperature,wind,type,map__47319,map__47319__$1,speed,heading,map__47316,map__47316__$1,x,y))
;
return iter__24200__auto__.call(null,cljs.core.map_indexed.call(null,cljs.core.vector,new cljs.core.PersistentVector(null, 7, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Location",weathergen.ui.format_coords.call(null,x,y)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure",weathergen.ui.format_pressure.call(null,pressure,pressure_unit)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Temp",weathergen.ui.format_temperature.call(null,temperature)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Wind",weathergen.ui.format_wind.call(null,wind)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Vis",weathergen.ui.format_visibility.call(null,cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),type], null)))], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Precip",weathergen.ui.format_precipitation.call(null,temperature,type)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Cloud",weathergen.ui.format_cloud.call(null,cloud_params,type)], null)], null)));
})()))], null);
}
});
/**
 * Returns a `bounds` with its west edge adjusted by `dx` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_west = (function weathergen$ui$adjust_west(bounds,starting_bounds,dx){
return cljs.core.assoc.call(null,cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"x","x",2099068185),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx)),new cljs.core.Keyword(null,"width","width",-384071477),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(starting_bounds) - dx));
});
/**
 * Returns a `bounds` with its east edge adjusted by `dx` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_east = (function weathergen$ui$adjust_east(bounds,starting_bounds,dx){
return cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"width","width",-384071477),(new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx));
});
/**
 * Returns a `bounds` with its north edge adjusted by `dy` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_north = (function weathergen$ui$adjust_north(bounds,starting_bounds,dy){
return cljs.core.assoc.call(null,cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"y","y",-1757859776),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy)),new cljs.core.Keyword(null,"height","height",1025178622),(new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(starting_bounds) - dy));
});
/**
 * Returns a `bounds` with its south edge adjusted by `dy` units from
 *   `starting-bounds`.
 */
weathergen.ui.adjust_south = (function weathergen$ui$adjust_south(bounds,starting_bounds,dy){
return cljs.core.assoc.call(null,bounds,new cljs.core.Keyword(null,"height","height",1025178622),(new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy));
});
/**
 * Given `proposed` bounds, limit it to falling completely within
 *   an `nx` by `ny` rectangle. Otherwise return nil.
 */
weathergen.ui.restrict = (function weathergen$ui$restrict(nx,ny,proposed){
var map__47354 = proposed;
var map__47354__$1 = ((((!((map__47354 == null)))?((((map__47354.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47354.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47354):map__47354);
var x = cljs.core.get.call(null,map__47354__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47354__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__47354__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__47354__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var right = (x + width);
var bottom = (y + height);
if((((0) <= x)) && (((0) <= y)) && ((right <= nx)) && ((bottom <= ny)) && ((width > (0))) && ((height > (0)))){
return proposed;
} else {
return null;
}
});
weathergen.ui.wind_stability_overlay = (function weathergen$ui$wind_stability_overlay(weather_params,register_drag_handler){
var indexed = javelin.core.formula.call(null,(function (G__47751,G__47749,G__47750){
return G__47749.call(null,G__47750,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__47751));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__47746 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weather_params));
var nx = cljs.core.nth.call(null,vec__47746,(0),null);
var ny = cljs.core.nth.call(null,vec__47746,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__47746,nx,ny){
return (function (indexed__$1){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"wind-stability-overlay",(function (){var iter__24200__auto__ = ((function (indexed,vec__47746,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47752(s__47753){
return (new cljs.core.LazySeq(null,((function (indexed,vec__47746,nx,ny){
return (function (){
var s__47753__$1 = s__47753;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47753__$1);
if(temp__5278__auto__){
var s__47753__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47753__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__47753__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__47755 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__47754 = (0);
while(true){
if((i__47754 < size__24199__auto__)){
var vec__47946 = cljs.core._nth.call(null,c__24198__auto__,i__47754);
var index = cljs.core.nth.call(null,vec__47946,(0),null);
var area = cljs.core.nth.call(null,vec__47946,(1),null);
cljs.core.chunk_append.call(null,b__47755,(function (){var map__47949 = area;
var map__47949__$1 = ((((!((map__47949 == null)))?((((map__47949.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47949.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47949):map__47949);
var bounds = cljs.core.get.call(null,map__47949__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var editing_QMARK_ = cljs.core.get.call(null,map__47949__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__47950 = bounds;
var map__47950__$1 = ((((!((map__47950 == null)))?((((map__47950.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47950.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47950):map__47950);
var x = cljs.core.get.call(null,map__47950__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47950__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__47950__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__47950__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var mousedown = ((function (i__47754,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (i__47754,starting_bounds,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (p__47953,final_QMARK_){
var vec__47954 = p__47953;
var dx = cljs.core.nth.call(null,vec__47954,(0),null);
var dy = cljs.core.nth.call(null,vec__47954,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (i__47754,dx__$1,dy__$1,vec__47954,dx,dy,starting_bounds,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (i__47754,dx__$1,dy__$1,vec__47954,dx,dy,starting_bounds,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (bounds__$1){
return cljs.core.assoc.call(null,bounds__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy__$1)));
});})(i__47754,dx__$1,dy__$1,vec__47954,dx,dy,starting_bounds,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__47754,dx__$1,dy__$1,vec__47954,dx,dy,starting_bounds,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);
});
;})(i__47754,starting_bounds,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
})());
});})(i__47754,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
;
return (new cljs.core.PersistentVector(null,4,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),mousedown,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"border-width","border-width",-1512605390),(0)], null),new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"white",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"stroke-dashoffset","stroke-dashoffset",-782320340),0.6,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),((cljs.core.not.call(null,editing_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var iter__24200__auto__ = ((function (i__47754,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__47957(s__47958){
return (new cljs.core.LazySeq(null,((function (i__47754,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
var s__47958__$1 = s__47958;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__47958__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var vec__48002 = cljs.core.first.call(null,xs__5831__auto__);
var dx = cljs.core.nth.call(null,vec__48002,(0),null);
var dir_h = cljs.core.nth.call(null,vec__48002,(1),null);
var iterys__24196__auto__ = ((function (s__47958__$1,i__47754,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__47957_$_iter__47959(s__47960){
return (new cljs.core.LazySeq(null,((function (s__47958__$1,i__47754,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
var s__47960__$1 = s__47960;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__47960__$1);
if(temp__5278__auto____$2){
var s__47960__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47960__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__47960__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__47962 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__47961 = (0);
while(true){
if((i__47961 < size__24199__auto____$1)){
var vec__48023 = cljs.core._nth.call(null,c__24198__auto____$1,i__47961);
var dy = cljs.core.nth.call(null,vec__48023,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48023,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
cljs.core.chunk_append.call(null,b__47962,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__47961,s__47960__$1,s__47958__$1,i__47754,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (i__47961,s__47960__$1,s__47958__$1,i__47754,starting_bounds,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (p__48026,final_QMARK_){
var vec__48027 = p__48026;
var dx__$1 = cljs.core.nth.call(null,vec__48027,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48027,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (i__47961,s__47960__$1,s__47958__$1,i__47754,vec__48027,dx__$1,dy__$1,starting_bounds,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (i__47961,s__47960__$1,s__47958__$1,i__47754,vec__48027,dx__$1,dy__$1,starting_bounds,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48031 = bounds__$1;
var G__48031__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48031,starting_bounds,dx__$2):G__48031);
var G__48031__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48031__$1,starting_bounds,dx__$2):G__48031__$1);
var G__48031__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48031__$2,starting_bounds,dy__$2):G__48031__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48031__$3,starting_bounds,dy__$2);
} else {
return G__48031__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(i__47961,s__47960__$1,s__47958__$1,i__47754,vec__48027,dx__$1,dy__$1,starting_bounds,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__47961,s__47960__$1,s__47958__$1,i__47754,vec__48027,dx__$1,dy__$1,starting_bounds,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);
});
;})(i__47961,s__47960__$1,s__47958__$1,i__47754,starting_bounds,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
})());
});})(i__47961,s__47960__$1,s__47958__$1,i__47754,vec__48023,dy,dir_v,c__24198__auto____$1,size__24199__auto____$1,b__47962,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
));

var G__48136 = (i__47961 + (1));
i__47961 = G__48136;
continue;
} else {
var G__48137 = (i__47961 + (1));
i__47961 = G__48137;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47962),weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__47957_$_iter__47959.call(null,cljs.core.chunk_rest.call(null,s__47960__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47962),null);
}
} else {
var vec__48032 = cljs.core.first.call(null,s__47960__$2);
var dy = cljs.core.nth.call(null,vec__48032,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48032,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
return cljs.core.cons.call(null,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__47960__$1,s__47958__$1,i__47754,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (s__47960__$1,s__47958__$1,i__47754,starting_bounds,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (p__48035,final_QMARK_){
var vec__48036 = p__48035;
var dx__$1 = cljs.core.nth.call(null,vec__48036,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48036,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (s__47960__$1,s__47958__$1,i__47754,vec__48036,dx__$1,dy__$1,starting_bounds,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (s__47960__$1,s__47958__$1,i__47754,vec__48036,dx__$1,dy__$1,starting_bounds,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48040 = bounds__$1;
var G__48040__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48040,starting_bounds,dx__$2):G__48040);
var G__48040__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48040__$1,starting_bounds,dx__$2):G__48040__$1);
var G__48040__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48040__$2,starting_bounds,dy__$2):G__48040__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48040__$3,starting_bounds,dy__$2);
} else {
return G__48040__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(s__47960__$1,s__47958__$1,i__47754,vec__48036,dx__$1,dy__$1,starting_bounds,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__47960__$1,s__47958__$1,i__47754,vec__48036,dx__$1,dy__$1,starting_bounds,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);
});
;})(s__47960__$1,s__47958__$1,i__47754,starting_bounds,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
})());
});})(s__47960__$1,s__47958__$1,i__47754,vec__48032,dy,dir_v,s__47960__$2,temp__5278__auto____$2,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
),weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__47957_$_iter__47959.call(null,cljs.core.rest.call(null,s__47960__$2)));
} else {
var G__48138 = cljs.core.rest.call(null,s__47960__$2);
s__47960__$1 = G__48138;
continue;
}
}
} else {
return null;
}
break;
}
});})(s__47958__$1,i__47754,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
,null,null));
});})(s__47958__$1,i__47754,vec__48002,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"n"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(height / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [height,"s"], null)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__47957.call(null,cljs.core.rest.call(null,s__47958__$1)));
} else {
var G__48139 = cljs.core.rest.call(null,s__47958__$1);
s__47958__$1 = G__48139;
continue;
}
} else {
return null;
}
break;
}
});})(i__47754,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
,null,null));
});})(i__47754,map__47949,map__47949__$1,bounds,editing_QMARK_,map__47950,map__47950__$1,x,y,width,height,mousedown,vec__47946,index,area,c__24198__auto__,size__24199__auto__,b__47755,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"w"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(width / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [width,"e"], null)], null));
})())],null));
})());

var G__48140 = (i__47754 + (1));
i__47754 = G__48140;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47755),weathergen$ui$wind_stability_overlay_$_iter__47752.call(null,cljs.core.chunk_rest.call(null,s__47753__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47755),null);
}
} else {
var vec__48041 = cljs.core.first.call(null,s__47753__$2);
var index = cljs.core.nth.call(null,vec__48041,(0),null);
var area = cljs.core.nth.call(null,vec__48041,(1),null);
return cljs.core.cons.call(null,(function (){var map__48044 = area;
var map__48044__$1 = ((((!((map__48044 == null)))?((((map__48044.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48044.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48044):map__48044);
var bounds = cljs.core.get.call(null,map__48044__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var editing_QMARK_ = cljs.core.get.call(null,map__48044__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__48045 = bounds;
var map__48045__$1 = ((((!((map__48045 == null)))?((((map__48045.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48045.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48045):map__48045);
var x = cljs.core.get.call(null,map__48045__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48045__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__48045__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__48045__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var mousedown = ((function (map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (starting_bounds,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (p__48048,final_QMARK_){
var vec__48049 = p__48048;
var dx = cljs.core.nth.call(null,vec__48049,(0),null);
var dy = cljs.core.nth.call(null,vec__48049,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (dx__$1,dy__$1,vec__48049,dx,dy,starting_bounds,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (dx__$1,dy__$1,vec__48049,dx,dy,starting_bounds,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (bounds__$1){
return cljs.core.assoc.call(null,bounds__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - new cljs.core.Keyword(null,"width","width",-384071477).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - new cljs.core.Keyword(null,"height","height",1025178622).cljs$core$IFn$_invoke$arity$1(bounds__$1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting_bounds) + dy__$1)));
});})(dx__$1,dy__$1,vec__48049,dx,dy,starting_bounds,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(dx__$1,dy__$1,vec__48049,dx,dy,starting_bounds,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);
});
;})(starting_bounds,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
})());
});})(map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
;
return (new cljs.core.PersistentVector(null,4,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),mousedown,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"border-width","border-width",-1512605390),(0)], null),new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"white",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.2,new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.6 0.6",new cljs.core.Keyword(null,"stroke-dashoffset","stroke-dashoffset",-782320340),0.6,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height),((cljs.core.not.call(null,editing_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var iter__24200__auto__ = ((function (map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__48052(s__48053){
return (new cljs.core.LazySeq(null,((function (map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
var s__48053__$1 = s__48053;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48053__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var vec__48097 = cljs.core.first.call(null,xs__5831__auto__);
var dx = cljs.core.nth.call(null,vec__48097,(0),null);
var dir_h = cljs.core.nth.call(null,vec__48097,(1),null);
var iterys__24196__auto__ = ((function (s__48053__$1,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__48052_$_iter__48054(s__48055){
return (new cljs.core.LazySeq(null,((function (s__48053__$1,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
var s__48055__$1 = s__48055;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__48055__$1);
if(temp__5278__auto____$2){
var s__48055__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48055__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48055__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48057 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48056 = (0);
while(true){
if((i__48056 < size__24199__auto__)){
var vec__48118 = cljs.core._nth.call(null,c__24198__auto__,i__48056);
var dy = cljs.core.nth.call(null,vec__48118,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48118,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
cljs.core.chunk_append.call(null,b__48057,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48056,s__48055__$1,s__48053__$1,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (i__48056,s__48055__$1,s__48053__$1,starting_bounds,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (p__48121,final_QMARK_){
var vec__48122 = p__48121;
var dx__$1 = cljs.core.nth.call(null,vec__48122,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48122,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (i__48056,s__48055__$1,s__48053__$1,vec__48122,dx__$1,dy__$1,starting_bounds,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (i__48056,s__48055__$1,s__48053__$1,vec__48122,dx__$1,dy__$1,starting_bounds,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48126 = bounds__$1;
var G__48126__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48126,starting_bounds,dx__$2):G__48126);
var G__48126__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48126__$1,starting_bounds,dx__$2):G__48126__$1);
var G__48126__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48126__$2,starting_bounds,dy__$2):G__48126__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48126__$3,starting_bounds,dy__$2);
} else {
return G__48126__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(i__48056,s__48055__$1,s__48053__$1,vec__48122,dx__$1,dy__$1,starting_bounds,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48056,s__48055__$1,s__48053__$1,vec__48122,dx__$1,dy__$1,starting_bounds,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);
});
;})(i__48056,s__48055__$1,s__48053__$1,starting_bounds,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
})());
});})(i__48056,s__48055__$1,s__48053__$1,vec__48118,dy,dir_v,c__24198__auto__,size__24199__auto__,b__48057,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
));

var G__48141 = (i__48056 + (1));
i__48056 = G__48141;
continue;
} else {
var G__48142 = (i__48056 + (1));
i__48056 = G__48142;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48057),weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__48052_$_iter__48054.call(null,cljs.core.chunk_rest.call(null,s__48055__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48057),null);
}
} else {
var vec__48127 = cljs.core.first.call(null,s__48055__$2);
var dy = cljs.core.nth.call(null,vec__48127,(0),null);
var dir_v = cljs.core.nth.call(null,vec__48127,(1),null);
if(cljs.core.not_EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [null,null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dir_h,dir_v], null))){
return cljs.core.cons.call(null,hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_v),cljs.core.str.cljs$core$IFn$_invoke$arity$1(dir_h),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(dx + (x - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"y","y",-1757859776),(dy + (y - (weathergen.ui.resize_handle_size / (2)))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__48055__$1,s__48053__$1,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting_bounds = bounds;
return ((function (s__48055__$1,s__48053__$1,starting_bounds,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (p__48130,final_QMARK_){
var vec__48131 = p__48130;
var dx__$1 = cljs.core.nth.call(null,vec__48131,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__48131,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (s__48055__$1,s__48053__$1,vec__48131,dx__$1,dy__$1,starting_bounds,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),index,new cljs.core.Keyword(null,"bounds","bounds",1691609455)], null),((function (s__48055__$1,s__48053__$1,vec__48131,dx__$1,dy__$1,starting_bounds,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny){
return (function (bounds__$1){
var dx__$2 = cljs.core.long$.call(null,dx__$1);
var dy__$2 = cljs.core.long$.call(null,dy__$1);
var or__23338__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__48135 = bounds__$1;
var G__48135__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__48135,starting_bounds,dx__$2):G__48135);
var G__48135__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__48135__$1,starting_bounds,dx__$2):G__48135__$1);
var G__48135__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__48135__$2,starting_bounds,dy__$2):G__48135__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__48135__$3,starting_bounds,dy__$2);
} else {
return G__48135__$3;
}
})());
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return bounds__$1;
}
});})(s__48055__$1,s__48053__$1,vec__48131,dx__$1,dy__$1,starting_bounds,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__48055__$1,s__48053__$1,vec__48131,dx__$1,dy__$1,starting_bounds,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
);
});
;})(s__48055__$1,s__48053__$1,starting_bounds,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
})());
});})(s__48055__$1,s__48053__$1,vec__48127,dy,dir_v,s__48055__$2,temp__5278__auto____$2,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
),weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__48052_$_iter__48054.call(null,cljs.core.rest.call(null,s__48055__$2)));
} else {
var G__48143 = cljs.core.rest.call(null,s__48055__$2);
s__48055__$1 = G__48143;
continue;
}
}
} else {
return null;
}
break;
}
});})(s__48053__$1,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
,null,null));
});})(s__48053__$1,vec__48097,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"n"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(height / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [height,"s"], null)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$wind_stability_overlay_$_iter__47752_$_iter__48052.call(null,cljs.core.rest.call(null,s__48053__$1)));
} else {
var G__48144 = cljs.core.rest.call(null,s__48053__$1);
s__48053__$1 = G__48144;
continue;
}
} else {
return null;
}
break;
}
});})(map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
,null,null));
});})(map__48044,map__48044__$1,bounds,editing_QMARK_,map__48045,map__48045__$1,x,y,width,height,mousedown,vec__48041,index,area,s__47753__$2,temp__5278__auto__,indexed,vec__47746,nx,ny))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),"w"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(width / (2)),null], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [width,"e"], null)], null));
})())],null));
})(),weathergen$ui$wind_stability_overlay_$_iter__47752.call(null,cljs.core.rest.call(null,s__47753__$2)));
}
} else {
return null;
}
break;
}
});})(indexed,vec__47746,nx,ny))
,null,null));
});})(indexed,vec__47746,nx,ny))
;
return iter__24200__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__47746,nx,ny))
).call(null,indexed);
});
weathergen.ui.weather_overrides_overlay = (function weathergen$ui$weather_overrides_overlay(weather_params,register_drag_handler){
var indexed = javelin.core.formula.call(null,(function (G__48297,G__48295,G__48296){
return G__48295.call(null,G__48296,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__48297));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__48292 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weather_params));
var nx = cljs.core.nth.call(null,vec__48292,(0),null);
var ny = cljs.core.nth.call(null,vec__48292,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__48292,nx,ny){
return (function (indexed__$1){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"weather-overrides-overlay",(function (){var iter__24200__auto__ = ((function (indexed,vec__48292,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__48298(s__48299){
return (new cljs.core.LazySeq(null,((function (indexed,vec__48292,nx,ny){
return (function (){
var s__48299__$1 = s__48299;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48299__$1);
if(temp__5278__auto__){
var s__48299__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48299__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48299__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48301 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48300 = (0);
while(true){
if((i__48300 < size__24199__auto__)){
var vec__48370 = cljs.core._nth.call(null,c__24198__auto__,i__48300);
var index = cljs.core.nth.call(null,vec__48370,(0),null);
var override = cljs.core.nth.call(null,vec__48370,(1),null);
var map__48373 = override;
var map__48373__$1 = ((((!((map__48373 == null)))?((((map__48373.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48373.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48373):map__48373);
var location = cljs.core.get.call(null,map__48373__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__48373__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__48373__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__48373__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__48373__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__48374 = location;
var map__48374__$1 = ((((!((map__48374 == null)))?((((map__48374.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48374.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48374):map__48374);
var x = cljs.core.get.call(null,map__48374__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48374__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__23338__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return editing_QMARK_;
}
})())){
cljs.core.chunk_append.call(null,b__48301,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.2 0.1"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(radius - 0.5),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting = location;
return ((function (i__48300,s__48299__$1,starting,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48377,final_QMARK_){
var vec__48378 = p__48377;
var dx = cljs.core.nth.call(null,vec__48378,(0),null);
var dy = cljs.core.nth.call(null,vec__48378,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (i__48300,s__48299__$1,dx__$1,dy__$1,vec__48378,dx,dy,starting,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"location","location",1815599388)], null),((function (i__48300,s__48299__$1,dx__$1,dy__$1,vec__48378,dx,dy,starting,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (location__$1){
return cljs.core.assoc.call(null,location__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - (1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - (1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting) + dy__$1)));
});})(i__48300,s__48299__$1,dx__$1,dy__$1,vec__48378,dx,dy,starting,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48300,s__48299__$1,dx__$1,dy__$1,vec__48378,dx,dy,starting,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});
;})(i__48300,s__48299__$1,starting,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
})());
});})(i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.1 0.2"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(falloff - 0.5)),(function (){var circle_edit = ((function (i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (rad,mutate){
var iter__24200__auto__ = ((function (i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__48298_$_iter__48381(s__48382){
return (new cljs.core.LazySeq(null,((function (i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
var s__48382__$1 = s__48382;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48382__$1);
if(temp__5278__auto____$1){
var s__48382__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48382__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__48382__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__48384 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__48383 = (0);
while(true){
if((i__48383 < size__24199__auto____$1)){
var theta = cljs.core._nth.call(null,c__24198__auto____$1,i__48383);
cljs.core.chunk_append.call(null,b__48384,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48383,i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48384,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__48383,i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48384,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48393,final_QMARK_){
var vec__48394 = p__48393;
var dx = cljs.core.nth.call(null,vec__48394,(0),null);
var dy = cljs.core.nth.call(null,vec__48394,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__48383,i__48300,s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48394,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48384,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48383,i__48300,s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48394,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48384,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48383,i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48384,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48383,i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto____$1,size__24199__auto____$1,b__48384,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
})());

var G__48438 = (i__48383 + (1));
i__48383 = G__48438;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48384),weathergen$ui$weather_overrides_overlay_$_iter__48298_$_iter__48381.call(null,cljs.core.chunk_rest.call(null,s__48382__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48384),null);
}
} else {
var theta = cljs.core.first.call(null,s__48382__$2);
return cljs.core.cons.call(null,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48397,final_QMARK_){
var vec__48398 = p__48397;
var dx = cljs.core.nth.call(null,vec__48398,(0),null);
var dy = cljs.core.nth.call(null,vec__48398,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__48300,s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48398,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48300,s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48398,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48300,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48382__$2,temp__5278__auto____$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__48298_$_iter__48381.call(null,cljs.core.rest.call(null,s__48382__$2)));
}
} else {
return null;
}
break;
}
});})(i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
,null,null));
});})(i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(i__48300,s__48299__$1,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
;
if(cljs.core.not.call(null,editing_QMARK_)){
return cljs.core.PersistentVector.EMPTY;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [circle_edit.call(null,falloff,((function (i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (r){
return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index], null),((function (i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48401){
var map__48402 = p__48401;
var map__48402__$1 = ((((!((map__48402 == null)))?((((map__48402.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48402.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48402):map__48402);
var override__$1 = map__48402__$1;
var falloff__$1 = cljs.core.get.call(null,map__48402__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__48402__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
return cljs.core.assoc.call(null,override__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456),weathergen.math.clamp.call(null,(0),radius__$1,cljs.core.long$.call(null,r)));
});})(i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
),circle_edit.call(null,radius,((function (i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (r){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),(function (){var x__23676__auto__ = (1);
var y__23677__auto__ = cljs.core.long$.call(null,r);
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})());

return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),((function (i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p1__48145_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__48145_SHARP_);
});})(i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48300,s__48299__$1,circle_edit,map__48373,map__48373__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48374,map__48374__$1,x,y,vec__48370,index,override,c__24198__auto__,size__24199__auto__,b__48301,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
)], null);
}
})()], null));

var G__48439 = (i__48300 + (1));
i__48300 = G__48439;
continue;
} else {
var G__48440 = (i__48300 + (1));
i__48300 = G__48440;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48301),weathergen$ui$weather_overrides_overlay_$_iter__48298.call(null,cljs.core.chunk_rest.call(null,s__48299__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48301),null);
}
} else {
var vec__48404 = cljs.core.first.call(null,s__48299__$2);
var index = cljs.core.nth.call(null,vec__48404,(0),null);
var override = cljs.core.nth.call(null,vec__48404,(1),null);
var map__48407 = override;
var map__48407__$1 = ((((!((map__48407 == null)))?((((map__48407.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48407.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48407):map__48407);
var location = cljs.core.get.call(null,map__48407__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__48407__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__48407__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__48407__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__48407__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__48408 = location;
var map__48408__$1 = ((((!((map__48408 == null)))?((((map__48408.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48408.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48408):map__48408);
var x = cljs.core.get.call(null,map__48408__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48408__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__23338__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return editing_QMARK_;
}
})())){
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"fill","fill",883462889),(cljs.core.truth_(editing_QMARK_)?weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"edit","edit",-1641834166)):"none"),new cljs.core.Keyword(null,"cursor","cursor",1011937484),(cljs.core.truth_(editing_QMARK_)?"move":null),new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.2 0.1"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(radius - 0.5),new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,(function (){var starting = location;
return ((function (s__48299__$1,starting,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48411,final_QMARK_){
var vec__48412 = p__48411;
var dx = cljs.core.nth.call(null,vec__48412,(0),null);
var dy = cljs.core.nth.call(null,vec__48412,(1),null);
var dx__$1 = cljs.core.long$.call(null,dx);
var dy__$1 = cljs.core.long$.call(null,dy);
return javelin.core.dosync_STAR_.call(null,((function (s__48299__$1,dx__$1,dy__$1,vec__48412,dx,dy,starting,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"location","location",1815599388)], null),((function (s__48299__$1,dx__$1,dy__$1,vec__48412,dx,dy,starting,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (location__$1){
return cljs.core.assoc.call(null,location__$1,new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - (1)),(new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(starting) + dx__$1)),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - (1)),(new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(starting) + dy__$1)));
});})(s__48299__$1,dx__$1,dy__$1,vec__48412,dx,dy,starting,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__48299__$1,dx__$1,dy__$1,vec__48412,dx,dy,starting,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});
;})(s__48299__$1,starting,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
})());
});})(s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.2",new cljs.core.Keyword(null,"stroke","stroke",1741823555),"fuchsia",new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"0.1 0.2"], null),new cljs.core.Keyword(null,"cx","cx",1272694324),(x + 0.5),new cljs.core.Keyword(null,"cy","cy",755331060),(y + 0.5),new cljs.core.Keyword(null,"r","r",-471384190),(falloff - 0.5)),(function (){var circle_edit = ((function (s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (rad,mutate){
var iter__24200__auto__ = ((function (s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__48298_$_iter__48415(s__48416){
return (new cljs.core.LazySeq(null,((function (s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
var s__48416__$1 = s__48416;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48416__$1);
if(temp__5278__auto____$1){
var s__48416__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48416__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48416__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48418 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48417 = (0);
while(true){
if((i__48417 < size__24199__auto__)){
var theta = cljs.core._nth.call(null,c__24198__auto__,i__48417);
cljs.core.chunk_append.call(null,b__48418,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (i__48417,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48418,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (i__48417,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48418,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48427,final_QMARK_){
var vec__48428 = p__48427;
var dx = cljs.core.nth.call(null,vec__48428,(0),null);
var dy = cljs.core.nth.call(null,vec__48428,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (i__48417,s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48428,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48418,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(i__48417,s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48428,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48418,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48417,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48418,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(i__48417,s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24198__auto__,size__24199__auto__,b__48418,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
})());

var G__48441 = (i__48417 + (1));
i__48417 = G__48441;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48418),weathergen$ui$weather_overrides_overlay_$_iter__48298_$_iter__48415.call(null,cljs.core.chunk_rest.call(null,s__48416__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48418),null);
}
} else {
var theta = cljs.core.first.call(null,s__48416__$2);
return cljs.core.cons.call(null,(function (){var alpha = weathergen.math.deg__GT_rad.call(null,theta);
var r = (rad - 0.5);
var sin_a = Math.sin(alpha);
var cos_a = Math.cos(alpha);
var x_offset = (r * sin_a);
var y_offset = (r * cos_a);
var lx = (((0.1 < sin_a))?"e":(((sin_a < -0.1))?"w":""
));
var ly = (((0.1 < cos_a))?"s":(((cos_a < -0.1))?"n":""
));
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),"0.1",new cljs.core.Keyword(null,"fill","fill",883462889),"white",new cljs.core.Keyword(null,"cursor","cursor",1011937484),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(ly),cljs.core.str.cljs$core$IFn$_invoke$arity$1(lx),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-resize")].join('')], null),new cljs.core.Keyword(null,"x","x",2099068185),(((x + x_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"y","y",-1757859776),(((y + y_offset) + 0.5) - (weathergen.ui.resize_handle_size / (2))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.resize_handle_size,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (e){
cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,true);

return register_drag_handler.call(null,((function (s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48431,final_QMARK_){
var vec__48432 = p__48431;
var dx = cljs.core.nth.call(null,vec__48432,(0),null);
var dy = cljs.core.nth.call(null,vec__48432,(1),null);
var dx_SINGLEQUOTE_ = (x_offset + dx);
var dy_SINGLEQUOTE_ = (y_offset + dy);
var r_SINGLEQUOTE_ = (0.5 + Math.sqrt(((dx_SINGLEQUOTE_ * dx_SINGLEQUOTE_) + (dy_SINGLEQUOTE_ * dy_SINGLEQUOTE_))));
return javelin.core.dosync_STAR_.call(null,((function (s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48432,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (){
mutate.call(null,r_SINGLEQUOTE_);

if(cljs.core.truth_(final_QMARK_)){
return cljs.core.reset_BANG_.call(null,weathergen.ui.prevent_recomputation_QMARK_,false);
} else {
return null;
}
});})(s__48299__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__48432,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(s__48299__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__48416__$2,temp__5278__auto____$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__48298_$_iter__48415.call(null,cljs.core.rest.call(null,s__48416__$2)));
}
} else {
return null;
}
break;
}
});})(s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
,null,null));
});})(s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(s__48299__$1,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
;
if(cljs.core.not.call(null,editing_QMARK_)){
return cljs.core.PersistentVector.EMPTY;
} else {
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [circle_edit.call(null,falloff,((function (s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (r){
return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index], null),((function (s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p__48435){
var map__48436 = p__48435;
var map__48436__$1 = ((((!((map__48436 == null)))?((((map__48436.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48436.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48436):map__48436);
var override__$1 = map__48436__$1;
var falloff__$1 = cljs.core.get.call(null,map__48436__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__48436__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
return cljs.core.assoc.call(null,override__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456),weathergen.math.clamp.call(null,(0),radius__$1,cljs.core.long$.call(null,r)));
});})(s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
),circle_edit.call(null,radius,((function (s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (r){
cljs.core.swap_BANG_.call(null,weather_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),(function (){var x__23676__auto__ = (1);
var y__23677__auto__ = cljs.core.long$.call(null,r);
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})());

return cljs.core.swap_BANG_.call(null,weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),index,new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),((function (s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny){
return (function (p1__48145_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__48145_SHARP_);
});})(s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
);
});})(s__48299__$1,circle_edit,map__48407,map__48407__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__48408,map__48408__$1,x,y,vec__48404,index,override,s__48299__$2,temp__5278__auto__,indexed,vec__48292,nx,ny))
)], null);
}
})()], null),weathergen$ui$weather_overrides_overlay_$_iter__48298.call(null,cljs.core.rest.call(null,s__48299__$2)));
} else {
var G__48442 = cljs.core.rest.call(null,s__48299__$2);
s__48299__$1 = G__48442;
continue;
}
}
} else {
return null;
}
break;
}
});})(indexed,vec__48292,nx,ny))
,null,null));
});})(indexed,vec__48292,nx,ny))
;
return iter__24200__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__48292,nx,ny))
).call(null,indexed);
});
weathergen.ui.flight_path__GT_path = (function weathergen$ui$flight_path__GT_path(size,path){
var G__48463 = path;
var vec__48464 = G__48463;
var seq__48465 = cljs.core.seq.call(null,vec__48464);
var first__48466 = cljs.core.first.call(null,seq__48465);
var seq__48465__$1 = cljs.core.next.call(null,seq__48465);
var point = first__48466;
var more = seq__48465__$1;
var landed_QMARK_ = false;
var s = null;
var G__48463__$1 = G__48463;
var landed_QMARK___$1 = landed_QMARK_;
var s__$1 = s;
while(true){
var vec__48467 = G__48463__$1;
var seq__48468 = cljs.core.seq.call(null,vec__48467);
var first__48469 = cljs.core.first.call(null,seq__48468);
var seq__48468__$1 = cljs.core.next.call(null,seq__48468);
var point__$1 = first__48469;
var more__$1 = seq__48468__$1;
var landed_QMARK___$2 = landed_QMARK___$1;
var s__$2 = s__$1;
var temp__5276__auto__ = point__$1;
if(cljs.core.truth_(temp__5276__auto__)){
var map__48470 = temp__5276__auto__;
var map__48470__$1 = ((((!((map__48470 == null)))?((((map__48470.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48470.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48470):map__48470);
var coordinates = cljs.core.get.call(null,map__48470__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var action = cljs.core.get.call(null,map__48470__$1,new cljs.core.Keyword("weathergen.dtc","action","weathergen.dtc/action",1537999145));
var map__48472 = coordinates;
var map__48472__$1 = ((((!((map__48472 == null)))?((((map__48472.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48472.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48472):map__48472);
var x = cljs.core.get.call(null,map__48472__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__48472__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__48473 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var gx = cljs.core.nth.call(null,vec__48473,(0),null);
var gy = cljs.core.nth.call(null,vec__48473,(1),null);
if(landed_QMARK___$2){
return s__$2;
} else {
var G__48477 = more__$1;
var G__48478 = (landed_QMARK___$2) || (cljs.core._EQ_.call(null,action,new cljs.core.Keyword(null,"land","land",-1402569867)));
var G__48479 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(s__$2),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?" ":null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?"L":"M")),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%f,%f",gx,gy))].join('');
G__48463__$1 = G__48477;
landed_QMARK___$1 = G__48478;
s__$1 = G__48479;
continue;
}
} else {
return s__$2;
}
break;
}
});
weathergen.ui.line__GT_path = (function weathergen$ui$line__GT_path(size,line){
var G__48500 = line;
var vec__48501 = G__48500;
var seq__48502 = cljs.core.seq.call(null,vec__48501);
var first__48503 = cljs.core.first.call(null,seq__48502);
var seq__48502__$1 = cljs.core.next.call(null,seq__48502);
var point = first__48503;
var more = seq__48502__$1;
var s = null;
var G__48500__$1 = G__48500;
var s__$1 = s;
while(true){
var vec__48504 = G__48500__$1;
var seq__48505 = cljs.core.seq.call(null,vec__48504);
var first__48506 = cljs.core.first.call(null,seq__48505);
var seq__48505__$1 = cljs.core.next.call(null,seq__48505);
var point__$1 = first__48506;
var more__$1 = seq__48505__$1;
var s__$2 = s__$1;
var temp__5276__auto__ = point__$1;
if(cljs.core.truth_(temp__5276__auto__)){
var map__48507 = temp__5276__auto__;
var map__48507__$1 = ((((!((map__48507 == null)))?((((map__48507.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48507.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48507):map__48507);
var coordinates = cljs.core.get.call(null,map__48507__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var map__48509 = coordinates;
var map__48509__$1 = ((((!((map__48509 == null)))?((((map__48509.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48509.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48509):map__48509);
var x = cljs.core.get.call(null,map__48509__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__48509__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__48510 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var wx = cljs.core.nth.call(null,vec__48510,(0),null);
var wy = cljs.core.nth.call(null,vec__48510,(1),null);
var G__48514 = more__$1;
var G__48515 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(s__$2),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?" ":null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_(s__$2)?"L":"M")),cljs.core.str.cljs$core$IFn$_invoke$arity$1(goog.string.format("%f,%f",wx,wy))].join('');
G__48500__$1 = G__48514;
s__$1 = G__48515;
continue;
} else {
return s__$2;
}
break;
}
});
weathergen.ui.airbase_info_id = (function weathergen$ui$airbase_info_id(airbase){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("airbase-info-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(airbase))].join('');
});
/**
 * Returns the color a status bar should be given the status of an
 *   airbase.
 */
weathergen.ui.airbase_status_color = (function weathergen$ui$airbase_status_color(status){
if(((75) < status)){
return "green";
} else {
if(((25) < status)){
return "orange";
} else {
return "red";

}
}
});
/**
 * Renders the airbase portion of the info overlay.
 */
weathergen.ui.airbase_info_overlay = (function weathergen$ui$airbase_info_overlay(mission,airbase){
var icon_scale = 0.05;
var coords = javelin.core.formula.call(null,((function (icon_scale){
return (function (mission__$1,airbase__$1){
return weathergen.coordinates.fgrid__GT_weather.call(null,mission__$1,new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(airbase__$1),new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(icon_scale))
).call(null,mission,airbase);
var x = javelin.core.formula.call(null,((function (icon_scale,coords){
return (function (coords__$1){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(coords__$1);
});})(icon_scale,coords))
).call(null,coords);
var y = javelin.core.formula.call(null,((function (icon_scale,coords,x){
return (function (coords__$1){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(coords__$1);
});})(icon_scale,coords,x))
).call(null,coords);
var label = javelin.core.formula.call(null,((function (icon_scale,coords,x,y){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(icon_scale,coords,x,y))
).call(null,airbase);
var camp_id = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label){
return (function (airbase__$1){
return new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(icon_scale,coords,x,y,label))
).call(null,airbase);
var visible_QMARK_ = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id){
return (function (displayed_airbases,airbase__$1){
return displayed_airbases.call(null,airbase__$1);
});})(icon_scale,coords,x,y,label,camp_id))
).call(null,weathergen.ui.displayed_airbases,airbase);
var highlighted_QMARK_ = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_){
return (function (highlighted_airbase,airbase__$1){
return cljs.core._EQ_.call(null,highlighted_airbase,airbase__$1);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_))
).call(null,weathergen.ui.highlighted_airbase,airbase);
var font_size = "3.5%";
var color = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size){
return (function (mission__$1,airbase__$1){
return weathergen.ui.common.team_color.call(null,weathergen.falcon.files.mission.side.call(null,mission__$1,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase__$1)),new cljs.core.Keyword(null,"light-text","light-text",-274885440));
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size))
).call(null,mission,airbase);
var text_stroke_width = 0.03;
var contrasting_color = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width){
return (function (color__$1){
return weathergen.ui.common.contrasting.call(null,color__$1);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width))
).call(null,color);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase-info-overlay",(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48612,G__48611){
return G__48611.call(null,G__48612);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.airbase_info_id),new cljs.core.Keyword(null,"airbase","airbase",-369690299),label,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (x__$1,y__$1,map_zoom){
if(cljs.core.truth_((function (){var and__23326__auto__ = x__$1;
if(cljs.core.truth_(and__23326__auto__)){
return y__$1;
} else {
return and__23326__auto__;
}
})())){
return weathergen.ui.common.svg_xform_combine.call(null,weathergen.ui.common.svg_translate.call(null,x__$1,y__$1),weathergen.ui.common.svg_scale.call(null,(1.0 / map_zoom)));
} else {
return null;
}
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,x,y,weathergen.ui.map_zoom),(function (){var label_style = javelin.core.formula.call(null,((function (icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48613){
return new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514).cljs$core$IFn$_invoke$arity$1(G__48613);
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.map_display);
var label_spacing = 0.2;
var line_height = 0.75;
var status = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48614){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(G__48614);
});})(label_style,label_spacing,line_height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase);
var dims = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1){
var image = new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(airbase__$1);
var map__48615 = image;
var map__48615__$1 = ((((!((map__48615 == null)))?((((map__48615.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48615.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48615):map__48615);
var image_data = cljs.core.get.call(null,map__48615__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__48616 = image_data;
var map__48616__$1 = ((((!((map__48616 == null)))?((((map__48616.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48616.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48616):map__48616);
var size = cljs.core.get.call(null,map__48616__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var center = cljs.core.get.call(null,map__48616__$1,new cljs.core.Keyword(null,"center","center",-748944368));
var vec__48617 = size;
var w = cljs.core.nth.call(null,vec__48617,(0),null);
var h = cljs.core.nth.call(null,vec__48617,(1),null);
var vec__48620 = center;
var cx = cljs.core.nth.call(null,vec__48620,(0),null);
var cy = cljs.core.nth.call(null,vec__48620,(1),null);
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"x","x",2099068185),((cx - w) * icon_scale),new cljs.core.Keyword(null,"y","y",-1757859776),((- (h - cy)) * icon_scale),new cljs.core.Keyword(null,"w","w",354169001),(w * icon_scale),new cljs.core.Keyword(null,"h","h",1109658740),(h * icon_scale),new cljs.core.Keyword(null,"d","d",1972142424),(cy * icon_scale)], null);
});})(label_style,label_spacing,line_height,status,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase);
var show_airbase_status_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null));
var show_airbase_squadrons_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null));
var width = 1.0;
var height = 0.2;
var x__$1 = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48626,G__48625){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48625) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48625) - G__48626) / (2)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,width,dims);
var y__$1 = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48628,G__48627){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48627) - ((2) * G__48628));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,height,dims);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase-and-highlighter",(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"highlights",hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"moving highlight",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.collapse_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"r","r",-471384190),(60),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"yellow",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),(2),new cljs.core.Keyword(null,"stroke-dasharray","stroke-dasharray",-942933855),"5, 5",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_scale.call(null,(0))),hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"static highlight",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.delayed_fade_out_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"r","r",-471384190),2.5,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none",new cljs.core.Keyword(null,"fill","fill",883462889),"yellow",new cljs.core.Keyword(null,"opacity","opacity",397153780),(0)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29828__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,highlighted_QMARK_);
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"icon-and-info",new cljs.core.Keyword("svg","class","svg/class",-2030780416),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (highlighted_QMARK___$1){
if(cljs.core.truth_(highlighted_QMARK___$1)){
return weathergen.ui.common.pulse_class;
} else {
return null;
}
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,highlighted_QMARK_),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"status",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48629,G__48630){
return G__48629.call(null,G__48630);
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_icon_scale),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"width","width",-384071477),width,new cljs.core.Keyword(null,"height","height",1025178622),height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),"white"),hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),x__$1,new cljs.core.Keyword(null,"y","y",-1757859776),y__$1,new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48631,G__48632){
return ((G__48631 * G__48632) / (100));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,width,status),new cljs.core.Keyword(null,"height","height",1025178622),height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48633,G__48634){
return G__48633.call(null,G__48634);
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.airbase_status_color,status)));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29828__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,show_airbase_status_QMARK_);
})(),(function (){var text_y_offset = javelin.core.formula.call(null,((function (label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48635,G__48636,G__48637){
return (G__48635 + (G__48636 * (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48637) + new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48637))));
});})(label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,label_spacing,weathergen.ui.map_icon_scale,dims);
var bbox_trigger = javelin.core.formula.call(null,((function (text_y_offset,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48638,G__48639,G__48640){
return cljs.core.PersistentHashSet.createAsIfByAssoc([G__48640,G__48639,G__48638]);
});})(text_y_offset,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.included_squadrons,text_y_offset,label_style);
var G__48641 = javelin.core.cell.call(null,(0));
var ty = javelin.core.cell.call(null,(0));
var tw = javelin.core.cell.call(null,(0));
var th = javelin.core.cell.call(null,(0));
var t = hoplon.svg.text.call(null,new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"3.5%",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"Source Code Pro",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),(100),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48643,G__48642){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48642) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48642) - G__48643) / (2)));
});})(G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw,dims),new cljs.core.Keyword(null,"y","y",-1757859776),line_height,new cljs.core.Keyword(null,"stroke","stroke",1741823555),color,new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),0.03,new cljs.core.Keyword(null,"fill","fill",883462889),color,hoplon.svg.tspan.call(null,label),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1,included_squadrons,label_style__$1){
if(cljs.core._EQ_.call(null,label_style__$1,new cljs.core.Keyword(null,"all","all",892129742))){
return cljs.core.map_indexed.call(null,cljs.core.vector,cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1)));
} else {
return null;
}
});})(G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.included_squadrons,label_style),((function (G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (item__29818__auto__){
var vec__48644 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,item__29818__auto__));
var indexed = cljs.core.nth.call(null,vec__48644,(0),null);
var vec__48653 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__48656){
var vec__48657 = p__48656;
var i = cljs.core.nth.call(null,vec__48657,(0),null);
var squadron = cljs.core.nth.call(null,vec__48657,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,squadron], null);
});})(vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,indexed));
var i = cljs.core.nth.call(null,vec__48653,(0),null);
var squadron = cljs.core.nth.call(null,vec__48653,(1),null);
return hoplon.svg.tspan.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (vec__48653,i,squadron,vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48660,G__48661){
return ((G__48660 + (2)) * G__48661);
});})(vec__48653,i,squadron,vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,i,line_height),new cljs.core.Keyword(null,"text-anchor","text-anchor",585613696),"start",new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (vec__48653,i,squadron,vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48662){
return (- (G__48662 / (2)));
});})(vec__48653,i,squadron,vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw),new cljs.core.Keyword(null,"dx","dx",-381796732),"0.75em",javelin.core.formula.call(null,((function (vec__48653,i,squadron,vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48663,G__48664){
return G__48663.call(null,"%d %s",new cljs.core.Keyword(null,"quantity","quantity",-1929050694).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__48664)),new cljs.core.Keyword(null,"airframe","airframe",643222926).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__48664)));
});})(vec__48653,i,squadron,vec__48644,indexed,G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,goog.string.format,squadron));
});})(G__48641,ty,tw,th,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
));
var update_bbox__15569__auto__ = ((function (G__48641,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (G__48641,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
var bb__15570__auto__ = t.getBBox();
if(cljs.core.truth_(bb__15570__auto__.x)){
cljs.core.reset_BANG_.call(null,G__48641,bb__15570__auto__.x);

cljs.core.reset_BANG_.call(null,ty,bb__15570__auto__.y);

cljs.core.reset_BANG_.call(null,tw,bb__15570__auto__.width);

return cljs.core.reset_BANG_.call(null,th,bb__15570__auto__.height);
} else {
return null;
}
});})(G__48641,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
});})(G__48641,ty,tw,th,t,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
hoplon.core.when_dom.call(null,t,update_bbox__15569__auto__);

var temp__5278__auto___48706 = bbox_trigger;
if(cljs.core.truth_(temp__5278__auto___48706)){
var w__15571__auto___48707 = temp__5278__auto___48706;
cljs.core.add_watch.call(null,w__15571__auto___48707,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15571__auto___48707,temp__5278__auto___48706,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15571__auto___48707,temp__5278__auto___48706,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return update_bbox__15569__auto__.call(null);
});})(w__15571__auto___48707,temp__5278__auto___48706,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,(0));
});})(w__15571__auto___48707,temp__5278__auto___48706,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
} else {
}

return hoplon.svg.g.call(null,(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"label",new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48665,G__48666){
return G__48665.call(null,(0),G__48666);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_translate,text_y_offset),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48667,G__48668){
return G__48667.call(null,G__48668);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_text_scale),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
var padding = 0.1;
var tx = javelin.core.formula.call(null,((function (padding,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (dims__$1,tw__$1){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(dims__$1) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(dims__$1) - tw__$1) / (2)));
});})(padding,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims,tw);
var rx = javelin.core.formula.call(null,((function (padding,tx,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (tx__$1){
return (tx__$1 - padding);
});})(padding,tx,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tx);
var ry = javelin.core.formula.call(null,((function (padding,tx,rx,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (ty__$1){
return (ty__$1 - padding);
});})(padding,tx,rx,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,ty);
var rw = javelin.core.formula.call(null,((function (padding,tx,rx,ry,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (tw__$1){
return ((tw__$1 + padding) + padding);
});})(padding,tx,rx,ry,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,tw);
var rh = javelin.core.formula.call(null,((function (padding,tx,rx,ry,rw,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (th__$1){
return ((th__$1 + padding) + padding);
});})(padding,tx,rx,ry,rw,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,th);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"background",hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"x","x",2099068185),rx,new cljs.core.Keyword(null,"y","y",-1757859776),ry,new cljs.core.Keyword(null,"width","width",-384071477),rw,new cljs.core.Keyword(null,"height","height",1025178622),rh,new cljs.core.Keyword(null,"opacity","opacity",397153780),0.4,new cljs.core.Keyword(null,"fill","fill",883462889),contrasting_color,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"none"));
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29828__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,weathergen.ui.map_show_text_background_QMARK_);
})(),t));
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29828__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48669,G__48670){
return G__48669.call(null,G__48670,new cljs.core.Keyword(null,"nothing","nothing",-1022703296));
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,cljs.core.not_EQ_,label_style));
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"transform","transform",1381301764),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48671,G__48672){
return G__48671.call(null,G__48672);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,weathergen.ui.common.svg_scale,weathergen.ui.map_icon_scale),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"squadron icons",new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_translate.call(null,0.5,(0)),(function (){var squadron_icon_scale = 0.6;
var squadrons = javelin.core.formula.call(null,((function (squadron_icon_scale,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (airbase__$1,included_squadrons){
return cljs.core.first.call(null,cljs.core.reduce.call(null,((function (squadron_icon_scale,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__48673,squadron){
var vec__48674 = p__48673;
var squadrons = cljs.core.nth.call(null,vec__48674,(0),null);
var cum_width = cljs.core.nth.call(null,vec__48674,(1),null);
var width__$1 = cljs.core.first.call(null,new cljs.core.Keyword(null,"size","size",1098693007).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"image-data","image-data",-377483758).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron))));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.conj.call(null,squadrons,cljs.core.assoc.call(null,squadron,new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585),cum_width)),((cum_width + ((width__$1 * icon_scale) * squadron_icon_scale)) + 0.1)], null);
});})(squadron_icon_scale,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [cljs.core.PersistentVector.EMPTY,(0)], null),cljs.core.filter.call(null,included_squadrons,new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1))));
});})(squadron_icon_scale,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.included_squadrons);
return hoplon.core.loop_tpl_STAR_.call(null,squadrons,((function (squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (item__29818__auto__){
var vec__48677 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (squadron){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron], null);
});})(squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,item__29818__auto__));
var squadron = cljs.core.nth.call(null,vec__48677,(0),null);
var info = javelin.core.formula.call(null,((function (vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (squadron__$1){
var image = new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1);
var map__48680 = image;
var map__48680__$1 = ((((!((map__48680 == null)))?((((map__48680.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48680.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48680):map__48680);
var image_data = cljs.core.get.call(null,map__48680__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__48681 = image_data;
var map__48681__$1 = ((((!((map__48681 == null)))?((((map__48681.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48681.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48681):map__48681);
var size = cljs.core.get.call(null,map__48681__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var vec__48682 = size;
var w = cljs.core.nth.call(null,vec__48682,(0),null);
var h = cljs.core.nth.call(null,vec__48682,(1),null);
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"w","w",354169001),((icon_scale * squadron_icon_scale) * w),new cljs.core.Keyword(null,"h","h",1109658740),((icon_scale * squadron_icon_scale) * h),new cljs.core.Keyword(null,"src","src",-1651076051),weathergen.ui.common.get_image.call(null,mission,image)], null);
});})(vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,squadron);
return hoplon.svg.image.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),javelin.core.formula.call(null,((function (info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48687,G__48689,G__48688){
return G__48687.call(null,"ab/y: %f, ab/h: %f, sq/h: %f",new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48688),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48688),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48689));
});})(info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,goog.string.format,info,dims),new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48690){
return new cljs.core.Keyword(null,"src","src",-1651076051).cljs$core$IFn$_invoke$arity$1(G__48690);
});})(info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48692,G__48691){
return (new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585).cljs$core$IFn$_invoke$arity$1(G__48691) + (new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48692) / (2)));
});})(info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims,squadron),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48694,G__48693){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48693) + (new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48693) - new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48694)));
});})(info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info,dims),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48695){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48695);
});})(info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48696){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48696);
});})(info,vec__48677,squadron,squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,info));
});})(squadron_icon_scale,squadrons,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
);
})());
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29828__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,show_airbase_squadrons_QMARK_);
})(),hoplon.svg.g.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"airbase icon",hoplon.svg.image.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48699,G__48697,G__48698){
return G__48697.call(null,G__48698,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(G__48699));
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,airbase,weathergen.ui.common.get_image,mission),new cljs.core.Keyword(null,"x","x",2099068185),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48700){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48700);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48701){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48701);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48702){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__48702);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48703){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__48703);
});})(G__48641,ty,tw,th,t,update_bbox__15569__auto__,text_y_offset,bbox_trigger,label_style,label_spacing,line_height,status,dims,show_airbase_status_QMARK_,show_airbase_squadrons_QMARK_,width,height,x__$1,y__$1,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,dims)))));
})()));
})());
});})(icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (){
return null;
});})(con__29828__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__48704,G__48705){
var or__23338__auto__ = G__48704;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return G__48705;
}
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
).call(null,visible_QMARK_,highlighted_QMARK_));
})());
});
weathergen.ui.airbases_info_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"section","section",-300141526),"airbase-info",(new cljs.core.PersistentVector(null,2,(5),cljs.core.PersistentVector.EMPTY_NODE,[hoplon.core.loop_tpl_STAR_.call(null,weathergen.ui.all_airbases,(function (item__29818__auto__){
var vec__48708 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,(function (airbase){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbase], null);
})).call(null,item__29818__auto__));
var airbase = cljs.core.nth.call(null,vec__48708,(0),null);
return weathergen.ui.airbase_info_overlay.call(null,weathergen.ui.mission,airbase);
})),hoplon.svg.use.call(null,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,(function (G__48711,G__48712){
return G__48711.call(null,G__48712);
})).call(null,weathergen.ui.airbase_info_id,weathergen.ui.highlighted_airbase))],null)));
/**
 * Return true if the specified coordinates fall within the wind
 *   stability area.
 */
weathergen.ui.within_area_QMARK_ = (function weathergen$ui$within_area_QMARK_(area,cell){
var map__48719 = area;
var map__48719__$1 = ((((!((map__48719 == null)))?((((map__48719.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48719.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48719):map__48719);
var bounds = cljs.core.get.call(null,map__48719__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var map__48720 = bounds;
var map__48720__$1 = ((((!((map__48720 == null)))?((((map__48720.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48720.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48720):map__48720);
var x = cljs.core.get.call(null,map__48720__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48720__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__48720__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__48720__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var left = x;
var top = y;
var right = (x + width);
var bottom = (y + height);
var map__48721 = cell;
var map__48721__$1 = ((((!((map__48721 == null)))?((((map__48721.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48721.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48721):map__48721);
var x__$1 = cljs.core.get.call(null,map__48721__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__48721__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return (((left <= x__$1)) && ((x__$1 <= right))) && (((top <= y__$1)) && ((y__$1 <= bottom)));
});
/**
 * Returns true if the specified coordinates fall within the weather
 *   override.
 */
weathergen.ui.within_override_QMARK_ = (function weathergen$ui$within_override_QMARK_(override,cell){
var map__48731 = override;
var map__48731__$1 = ((((!((map__48731 == null)))?((((map__48731.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48731.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48731):map__48731);
var location = cljs.core.get.call(null,map__48731__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__48731__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var map__48732 = location;
var map__48732__$1 = ((((!((map__48732 == null)))?((((map__48732.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48732.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48732):map__48732);
var x = cljs.core.get.call(null,map__48732__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48732__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var cx = x;
var cy = y;
var map__48733 = cell;
var map__48733__$1 = ((((!((map__48733 == null)))?((((map__48733.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48733.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48733):map__48733);
var x__$1 = cljs.core.get.call(null,map__48733__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__48733__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var dx = (cx - x__$1);
var dy = (cy - y__$1);
return (((dx * dx) + (dy * dy)) < (radius * radius));
});
/**
 * Renders the UI for display of bullseye.
 */
weathergen.ui.bullseye_overlay = (function weathergen$ui$bullseye_overlay(mission){
var con__29828__auto__ = (new cljs.core.Delay((function (){
var stroke_width = 0.025;
var bw = javelin.core.formula.call(null,((function (stroke_width){
return (function (mission__$1){
var map__48783 = mission__$1;
var map__48783__$1 = ((((!((map__48783 == null)))?((((map__48783.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48783.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48783):map__48783);
var campaign_info = cljs.core.get.call(null,map__48783__$1,new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966));
var map__48784 = campaign_info;
var map__48784__$1 = ((((!((map__48784 == null)))?((((map__48784.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48784.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48784):map__48784);
var bx = cljs.core.get.call(null,map__48784__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var by = cljs.core.get.call(null,map__48784__$1,new cljs.core.Keyword(null,"bullseye-y","bullseye-y",904460818));
return weathergen.coordinates.fgrid__GT_weather.call(null,mission__$1,bx,by);
});})(stroke_width))
).call(null,mission);
var bx = javelin.core.formula.call(null,((function (stroke_width,bw){
return (function (G__48787){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__48787);
});})(stroke_width,bw))
).call(null,bw);
var by = javelin.core.formula.call(null,((function (stroke_width,bw,bx){
return (function (G__48788){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__48788);
});})(stroke_width,bw,bx))
).call(null,bw);
return hoplon.svg.g.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"debug","debug",-1608172596),"bullseye"], null),new cljs.core.Keyword("svg","transform","svg/transform",1381351328),javelin.core.formula.call(null,((function (stroke_width,bw,bx,by){
return (function (G__48789,G__48790,G__48791){
return G__48789.call(null,G__48790,G__48791);
});})(stroke_width,bw,bx,by))
).call(null,weathergen.ui.common.svg_translate,bx,by),(function (){var iter__24200__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__48792(s__48793){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__48793__$1 = s__48793;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48793__$1);
if(temp__5278__auto__){
var s__48793__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48793__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48793__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48795 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48794 = (0);
while(true){
if((i__48794 < size__24199__auto__)){
var r = cljs.core._nth.call(null,c__24198__auto__,i__48794);
cljs.core.chunk_append.call(null,b__48795,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),javelin.core.formula.call(null,((function (i__48794,r,c__24198__auto__,size__24199__auto__,b__48795,s__48793__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48804,G__48802,G__48803){
return G__48802.call(null,G__48803,G__48804);
});})(i__48794,r,c__24198__auto__,size__24199__auto__,b__48795,s__48793__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)));

var G__48829 = (i__48794 + (1));
i__48794 = G__48829;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48795),weathergen$ui$bullseye_overlay_$_iter__48792.call(null,cljs.core.chunk_rest.call(null,s__48793__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48795),null);
}
} else {
var r = cljs.core.first.call(null,s__48793__$2);
return cljs.core.cons.call(null,hoplon.svg.circle.call(null,new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"fill","fill",883462889),"none",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"cx","cx",1272694324),(0),new cljs.core.Keyword(null,"cy","cy",755331060),(0),new cljs.core.Keyword(null,"r","r",-471384190),javelin.core.formula.call(null,((function (r,s__48793__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48807,G__48805,G__48806){
return G__48805.call(null,G__48806,G__48807);
});})(r,s__48793__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__48792.call(null,cljs.core.rest.call(null,s__48793__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(30),(200),(30)));
})(),(function (){var iter__24200__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__48808(s__48809){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__48809__$1 = s__48809;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48809__$1);
if(temp__5278__auto__){
var s__48809__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48809__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__48809__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__48811 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__48810 = (0);
while(true){
if((i__48810 < size__24199__auto__)){
var theta = cljs.core._nth.call(null,c__24198__auto__,i__48810);
cljs.core.chunk_append.call(null,b__48811,hoplon.svg.line.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_rotate.call(null,theta)], null),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),javelin.core.formula.call(null,((function (i__48810,theta,c__24198__auto__,size__24199__auto__,b__48811,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48820,G__48821){
return G__48820.call(null,G__48821,(-200));
});})(i__48810,theta,c__24198__auto__,size__24199__auto__,b__48811,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),javelin.core.formula.call(null,((function (i__48810,theta,c__24198__auto__,size__24199__auto__,b__48811,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48822,G__48823){
return G__48822.call(null,G__48823,(200));
});})(i__48810,theta,c__24198__auto__,size__24199__auto__,b__48811,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)));

var G__48830 = (i__48810 + (1));
i__48810 = G__48830;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48811),weathergen$ui$bullseye_overlay_$_iter__48808.call(null,cljs.core.chunk_rest.call(null,s__48809__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48811),null);
}
} else {
var theta = cljs.core.first.call(null,s__48809__$2);
return cljs.core.cons.call(null,hoplon.svg.line.call(null,new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"transform","transform",1381301764),weathergen.ui.common.svg_rotate.call(null,theta)], null),new cljs.core.Keyword(null,"stroke","stroke",1741823555),"black",new cljs.core.Keyword(null,"stroke-width","stroke-width",716836435),stroke_width,new cljs.core.Keyword(null,"x1","x1",-1863922247),(0),new cljs.core.Keyword(null,"y1","y1",589123466),javelin.core.formula.call(null,((function (theta,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48824,G__48825){
return G__48824.call(null,G__48825,(-200));
});})(theta,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission),new cljs.core.Keyword(null,"x2","x2",-1362513475),(0),new cljs.core.Keyword(null,"y2","y2",-718691301),javelin.core.formula.call(null,((function (theta,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__48826,G__48827){
return G__48826.call(null,G__48827,(200));
});})(theta,s__48809__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__48808.call(null,cljs.core.rest.call(null,s__48809__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,(0),(180),(30)));
})());
}),null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__){
return (function (){
return null;
});})(con__29828__auto__))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__){
return (function (G__48828){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__48828);
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__))
).call(null,weathergen.ui.map_display));
});
/**
 * Given a map pan as an x/y map, return a new map that doesn't permit showing areas outside the map.
 */
weathergen.ui.limit_pan = (function weathergen$ui$limit_pan(p__48831,zoom,p__48832){
var vec__48838 = p__48831;
var nx = cljs.core.nth.call(null,vec__48838,(0),null);
var ny = cljs.core.nth.call(null,vec__48838,(1),null);
var map__48841 = p__48832;
var map__48841__$1 = ((((!((map__48841 == null)))?((((map__48841.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48841.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48841):map__48841);
var x = cljs.core.get.call(null,map__48841__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__48841__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = (nx / zoom);
var height = (ny / zoom);
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),weathergen.math.clamp.call(null,(0),(nx - width),x),new cljs.core.Keyword(null,"y","y",-1757859776),weathergen.math.clamp.call(null,(0),(ny - height),y)], null);
});
/**
 * Converts an x/y offset in pixels to an x/y offset in weatherspace units.
 */
weathergen.ui.pixels__GT_weather = (function weathergen$ui$pixels__GT_weather(p__48843){
var vec__48853 = p__48843;
var dx = cljs.core.nth.call(null,vec__48853,(0),null);
var dy = cljs.core.nth.call(null,vec__48853,(1),null);
var zoom = cljs.core.deref.call(null,weathergen.ui.map_zoom);
var vec__48856 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__48856,(0),null);
var ny = cljs.core.nth.call(null,vec__48856,(1),null);
var vec__48859 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__48859,(0),null);
var height = cljs.core.nth.call(null,vec__48859,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(((dx * nx) / width) / zoom),(((dy * ny) / height) / zoom)], null);
});
/**
 * Changes the map zoom by a factor of `amount`, centered on `[cx cy]`
 *   coordinates in weather space, which has dimensions `[nx ny]`.
 */
weathergen.ui.zoom_map_BANG_ = (function weathergen$ui$zoom_map_BANG_(p__48862,amount){
var vec__48871 = p__48862;
var cx = cljs.core.nth.call(null,vec__48871,(0),null);
var cy = cljs.core.nth.call(null,vec__48871,(1),null);
var vec__48874 = new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params));
var nx = cljs.core.nth.call(null,vec__48874,(0),null);
var ny = cljs.core.nth.call(null,vec__48874,(1),null);
var map__48877 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__48877__$1 = ((((!((map__48877 == null)))?((((map__48877.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48877.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48877):map__48877);
var px0 = cljs.core.get.call(null,map__48877__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__48877__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var z_SINGLEQUOTE_ = weathergen.math.clamp.call(null,weathergen.ui.zoom_min,weathergen.ui.zoom_max,(amount * cljs.core.deref.call(null,weathergen.ui.map_zoom)));
var dz = (z_SINGLEQUOTE_ / cljs.core.deref.call(null,weathergen.ui.map_zoom));
var px1 = (cx - ((cx - px0) / dz));
var py1 = (cy - ((cy - py0) / dz));
var px = ((px1 - px0) + px0);
var py = ((py1 - py0) + py0);
return javelin.core.dosync_STAR_.call(null,((function (vec__48874,nx,ny,map__48877,map__48877__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__48871,cx,cy){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.map_zoom,z_SINGLEQUOTE_);

return cljs.core.reset_BANG_.call(null,weathergen.ui.map_pan,weathergen.ui.limit_pan.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [nx,ny], null),z_SINGLEQUOTE_,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),px,new cljs.core.Keyword(null,"y","y",-1757859776),py], null)));
});})(vec__48874,nx,ny,map__48877,map__48877__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__48871,cx,cy))
);
});
/**
 * @param {...*} var_args
 */
weathergen.ui.grid = (function() { 
var weathergen$ui$grid__delegate = function (args__29774__auto__){
var vec__48986 = hoplon.core.parse_args.call(null,args__29774__auto__);
var map__48989 = cljs.core.nth.call(null,vec__48986,(0),null);
var map__48989__$1 = ((((!((map__48989 == null)))?((((map__48989.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48989.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48989):map__48989);
var attrs = map__48989__$1;
var display_params = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"display-params","display-params",573405707));
var selected_cell = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443));
var weather_data = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401));
var wind_stability_areas = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204));
var weather_overrides = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710));
var pressure_unit = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243));
var computing = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"computing","computing",-1002386157));
var nx = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var ny = cljs.core.get.call(null,map__48989__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var drag_handler = cljs.core.atom.call(null,null);
var drag_start = cljs.core.atom.call(null,null);
var register_drag_handler = ((function (drag_handler,drag_start,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (h){
return cljs.core.swap_BANG_.call(null,drag_handler,((function (drag_handler,drag_start,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__48879_SHARP_){
var or__23338__auto__ = p1__48879_SHARP_;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return h;
}
});})(drag_handler,drag_start,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
var doc_move = ((function (drag_handler,drag_start,register_drag_handler,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
var temp__5276__auto__ = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5276__auto__)){
var h = temp__5276__auto__;
var x = (e["offsetX"]);
var y = (e["offsetY"]);
var vec__48991 = cljs.core.deref.call(null,drag_start);
var sx = cljs.core.nth.call(null,vec__48991,(0),null);
var sy = cljs.core.nth.call(null,vec__48991,(1),null);
var dx = (x - sx);
var dy = (y - sy);
h.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx,dy], null)),false);

return e.preventDefault();
} else {
return null;
}
});})(drag_handler,drag_start,register_drag_handler,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
var doc_up = ((function (drag_handler,drag_start,register_drag_handler,doc_move,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function weathergen$ui$grid_$_doc_up(e){
var temp__5278__auto___49091 = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5278__auto___49091)){
var h_49092 = temp__5278__auto___49091;
var x_49093 = (e["offsetX"]);
var y_49094 = (e["offsetY"]);
var vec__48997_49095 = cljs.core.deref.call(null,drag_start);
var sx_49096 = cljs.core.nth.call(null,vec__48997_49095,(0),null);
var sy_49097 = cljs.core.nth.call(null,vec__48997_49095,(1),null);
var dx_49098 = (x_49093 - sx_49096);
var dy_49099 = (y_49094 - sy_49097);
h_49092.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx_49098,dy_49099], null)),true);
} else {
}

cljs.core.reset_BANG_.call(null,drag_start,null);

return cljs.core.reset_BANG_.call(null,drag_handler,null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
var _ = document.addEventListener("mousemove",doc_move);
var ___$1 = document.addEventListener("mouseup",doc_up);
var brightness_layer = hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"brightness-layer",new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),nx,new cljs.core.Keyword(null,"height","height",1025178622),ny,new cljs.core.Keyword(null,"fill","fill",883462889),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_display){
var brightness = new cljs.core.Keyword(null,"brightness","brightness",1067055820).cljs$core$IFn$_invoke$arity$1(map_display);
return cljs.core.apply.call(null,goog.string.format,"rgba(%d,%d,%d,%f)",(((0.5 <= brightness))?new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(255),(255),(255),((brightness - 0.5) / 0.5)], null):new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [(0),(0),(0),((brightness - 0.5) / -0.5)], null)));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_display));
var primary_layer = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"primary-layer",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49000){
return cljs.core.not.call(null,(new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(G__49000) == null));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49001){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"opacity","opacity",397153780),new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__49001)], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var wind_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"wind-overlay",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49002,G__49003){
return G__49002.call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__49003),new cljs.core.Keyword(null,"wind","wind",-527553074));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core._EQ_,display_params));
var text_overlay = hoplon.svg.g.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"text-overlay",new cljs.core.Keyword(null,"attr","attr",-604132353),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49006,G__49005){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("text-overlay "),cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__49004 = G__49005;
var G__49004__$1 = (cljs.core.truth_((G__49004 == null))?null:new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__49004));
if(cljs.core.truth_((G__49004__$1 == null))){
return null;
} else {
return G__49006.call(null,G__49004__$1);
}
})())].join('')], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.name,display_params),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49007){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"pressure","pressure",505343747),null,new cljs.core.Keyword(null,"type","type",1174270348),null,new cljs.core.Keyword(null,"temperature","temperature",899018429),null], null), null).call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__49007));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params));
var selected_cell_overlay = (function (){var coords = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49008){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__49008);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,selected_cell);
var vec__49015 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__49018){
var vec__49019 = p__49018;
var x = cljs.core.nth.call(null,vec__49019,(0),null);
var y = cljs.core.nth.call(null,vec__49019,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,coords));
var x = cljs.core.nth.call(null,vec__49015,(0),null);
var y = cljs.core.nth.call(null,vec__49015,(1),null);
var con__29828__auto__ = (new cljs.core.Delay(((function (vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return hoplon.svg.rect.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"selected-cell-overlay",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,null);
});})(vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y,new cljs.core.Keyword(null,"width","width",-384071477),(1),new cljs.core.Keyword(null,"height","height",1025178622),(1));
});})(vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return null;
});})(con__29828__auto__,vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (x__$1,y__$1){
var and__23326__auto__ = x__$1;
if(cljs.core.truth_(and__23326__auto__)){
return y__$1;
} else {
return and__23326__auto__;
}
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,vec__49015,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,x,y));
})();
var wind_stability_areas__$1 = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_params){
return new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(weather_params);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.weather_params);
var weather_overrides__$1 = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_params){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(weather_params);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.weather_params);
var effective_hover_cell = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (hover_cell,wind_stability_areas__$2,weather_overrides__$2){
if(cljs.core.truth_((function (){var or__23338__auto__ = cljs.core.some.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (area){
var and__23326__auto__ = weathergen.ui.within_area_QMARK_.call(null,area,hover_cell);
if(cljs.core.truth_(and__23326__auto__)){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(area);
} else {
return and__23326__auto__;
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,wind_stability_areas__$2);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.some.call(null,((function (or__23338__auto__,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (override){
var and__23326__auto__ = weathergen.ui.within_override_QMARK_.call(null,override,hover_cell);
if(cljs.core.truth_(and__23326__auto__)){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(override);
} else {
return and__23326__auto__;
}
});})(or__23338__auto__,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,weather_overrides__$2);
}
})())){
return null;
} else {
return hover_cell;
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.hover_cell,wind_stability_areas__$1,weather_overrides__$1);
var elem = hoplon.svg.svg.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"grid",(function (){var dims = javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_size){
return cljs.core.map.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__48880_SHARP_){
return (p1__48880_SHARP_ - (7));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,map_size);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_size);
return cljs.core.assoc.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"display-params","display-params",573405707),new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443),new cljs.core.Keyword(null,"weather-data","weather-data",-664219401),new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710)),new cljs.core.Keyword(null,"viewBox","viewBox",-469489477),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_viewbox){
var map__49022 = map_viewbox;
var map__49022__$1 = ((((!((map__49022 == null)))?((((map__49022.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49022.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49022):map__49022);
var x = cljs.core.get.call(null,map__49022__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__49022__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__49022__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__49022__$1,new cljs.core.Keyword(null,"height","height",1025178622));
return goog.string.format("%f %f %f %f",x,y,width,height);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.map_viewbox),new cljs.core.Keyword(null,"width","width",-384071477),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49024,G__49025){
return G__49024.call(null,G__49025);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.first,dims),new cljs.core.Keyword(null,"height","height",1025178622),javelin.core.formula.call(null,((function (dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49026,G__49027){
return G__49026.call(null,G__49027);
});})(dims,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,cljs.core.second,dims),new cljs.core.Keyword(null,"attr","attr",-604132353),new cljs.core.PersistentArrayMap(null, 2, ["xmlns:xlink","http://www.w3.org/1999/xlink","xmlns","http://www.w3.org/2000/svg"], null));
})(),new cljs.core.Keyword(null,"mousemove","mousemove",-1077794734),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
return javelin.core.dosync_STAR_.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
cljs.core.reset_BANG_.call(null,weathergen.ui.mouse_raw_offset,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(e["offsetX"]),(e["offsetY"])], null));

return cljs.core.reset_BANG_.call(null,weathergen.ui.mouse_location,(function (){var vec__49028 = weathergen.ui.mouse_weather_coords.call(null,e);
var x = cljs.core.nth.call(null,vec__49028,(0),null);
var y = cljs.core.nth.call(null,vec__49028,(1),null);
if(((((0) <= x)) && ((x <= nx))) && ((((0) <= y)) && ((y <= ny)))){
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),x,new cljs.core.Keyword(null,"y","y",-1757859776),y], null);
} else {
return null;
}
})());
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (___$2){
return javelin.core.dosync_STAR_.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.hover_cell,null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"mousedown","mousedown",1391242074),((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
console.log(e);

cljs.core.reset_BANG_.call(null,drag_start,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(e["offsetX"]),(e["offsetY"])], null));

if(cljs.core.truth_(cljs.core.deref.call(null,drag_handler))){
return null;
} else {
var map__49031 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__49031__$1 = ((((!((map__49031 == null)))?((((map__49031.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49031.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49031):map__49031);
var px0 = cljs.core.get.call(null,map__49031__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__49031__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return register_drag_handler.call(null,((function (map__49031,map__49031__$1,px0,py0,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__49033,final_QMARK_){
var vec__49034 = p__49033;
var dx = cljs.core.nth.call(null,vec__49034,(0),null);
var dy = cljs.core.nth.call(null,vec__49034,(1),null);
var browser_zoom = window.devicePixelRatio;
return cljs.core.reset_BANG_.call(null,weathergen.ui.map_pan,weathergen.ui.limit_pan.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)),cljs.core.deref.call(null,weathergen.ui.map_zoom),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(px0 - dx),new cljs.core.Keyword(null,"y","y",-1757859776),(py0 - dy)], null)));
});})(map__49031,map__49031__$1,px0,py0,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,new cljs.core.Keyword(null,"dragstart","dragstart",955864218),cljs.core.constantly.call(null,false),weathergen.ui.wind_vector_defs.call(null),hoplon.svg.image.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"map-image",new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),javelin.core.formula.call(null,((function (drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__49038,G__49037){
if(cljs.core.not.call(null,G__49037)){
return "images/kto.jpg";
} else {
return G__49038.call(null,G__49037,new cljs.core.Keyword(null,"map-image","map-image",-5560498).cljs$core$IFn$_invoke$arity$1(G__49037));
}
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weathergen.ui.common.get_image,weathergen.ui.mission),new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),nx,new cljs.core.Keyword(null,"height","height",1025178622),ny),brightness_layer,primary_layer,weathergen.ui.bullseye_overlay.call(null,weathergen.ui.mission),wind_overlay,text_overlay,weathergen.ui.wind_stability_overlay.call(null,weathergen.ui.weather_params,register_drag_handler),weathergen.ui.weather_overrides_overlay.call(null,weathergen.ui.weather_params,register_drag_handler),selected_cell_overlay,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer),weathergen.ui.airbases_info_overlay,weathergen.ui.bullseye_info_box.call(null));
goog.events.listen((new goog.events.MouseWheelHandler(elem)),goog.events.MouseWheelHandler.EventType.MOUSEWHEEL,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (e){
e.preventDefault();

var amount = Math.pow(cljs.core.deref.call(null,weathergen.ui.zoom_speed),(e["deltaY"]));
return weathergen.ui.zoom_map_BANG_.call(null,weathergen.ui.mouse_weather_coords.call(null,e),amount);
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);

hoplon.core.add_initfn_BANG_.call(null,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
var timer_name__15521__auto___49100 = "Initial create";
var ignore__15522__auto___49101 = console.time(timer_name__15521__auto___49100);
var result__15523__auto___49102 = (function (){
var frag_49103 = document.createDocumentFragment();
var seq__49039_49104 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__49044_49105 = null;
var count__49045_49106 = (0);
var i__49046_49107 = (0);
while(true){
if((i__49046_49107 < count__49045_49106)){
var x_49108 = cljs.core._nth.call(null,chunk__49044_49105,i__49046_49107);
var seq__49047_49109 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49048_49110 = null;
var count__49049_49111 = (0);
var i__49050_49112 = (0);
while(true){
if((i__49050_49112 < count__49049_49111)){
var y_49113 = cljs.core._nth.call(null,chunk__49048_49110,i__49050_49112);
var r_49114 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49051_49115 = r_49114;
G__49051_49115.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49108),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49113)].join(''));

G__49051_49115.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49108)].join(''));

G__49051_49115.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49113)].join(''));

G__49051_49115.setAttribute("width","1");

G__49051_49115.setAttribute("height","1");

G__49051_49115.setAttribute("fill","none");

G__49051_49115.onclick = ((function (seq__49047_49109,chunk__49048_49110,count__49049_49111,i__49050_49112,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49051_49115,r_49114,y_49113,x_49108,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49108,y_49113], null)], null));
});})(seq__49047_49109,chunk__49048_49110,count__49049_49111,i__49050_49112,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49051_49115,r_49114,y_49113,x_49108,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49103,r_49114);

var G__49116 = seq__49047_49109;
var G__49117 = chunk__49048_49110;
var G__49118 = count__49049_49111;
var G__49119 = (i__49050_49112 + (1));
seq__49047_49109 = G__49116;
chunk__49048_49110 = G__49117;
count__49049_49111 = G__49118;
i__49050_49112 = G__49119;
continue;
} else {
var temp__5278__auto___49120 = cljs.core.seq.call(null,seq__49047_49109);
if(temp__5278__auto___49120){
var seq__49047_49121__$1 = temp__5278__auto___49120;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49047_49121__$1)){
var c__24249__auto___49122 = cljs.core.chunk_first.call(null,seq__49047_49121__$1);
var G__49123 = cljs.core.chunk_rest.call(null,seq__49047_49121__$1);
var G__49124 = c__24249__auto___49122;
var G__49125 = cljs.core.count.call(null,c__24249__auto___49122);
var G__49126 = (0);
seq__49047_49109 = G__49123;
chunk__49048_49110 = G__49124;
count__49049_49111 = G__49125;
i__49050_49112 = G__49126;
continue;
} else {
var y_49127 = cljs.core.first.call(null,seq__49047_49121__$1);
var r_49128 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49052_49129 = r_49128;
G__49052_49129.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49108),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49127)].join(''));

G__49052_49129.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49108)].join(''));

G__49052_49129.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49127)].join(''));

G__49052_49129.setAttribute("width","1");

G__49052_49129.setAttribute("height","1");

G__49052_49129.setAttribute("fill","none");

G__49052_49129.onclick = ((function (seq__49047_49109,chunk__49048_49110,count__49049_49111,i__49050_49112,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49052_49129,r_49128,y_49127,seq__49047_49121__$1,temp__5278__auto___49120,x_49108,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49108,y_49127], null)], null));
});})(seq__49047_49109,chunk__49048_49110,count__49049_49111,i__49050_49112,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49052_49129,r_49128,y_49127,seq__49047_49121__$1,temp__5278__auto___49120,x_49108,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49103,r_49128);

var G__49130 = cljs.core.next.call(null,seq__49047_49121__$1);
var G__49131 = null;
var G__49132 = (0);
var G__49133 = (0);
seq__49047_49109 = G__49130;
chunk__49048_49110 = G__49131;
count__49049_49111 = G__49132;
i__49050_49112 = G__49133;
continue;
}
} else {
}
}
break;
}

var G__49134 = seq__49039_49104;
var G__49135 = chunk__49044_49105;
var G__49136 = count__49045_49106;
var G__49137 = (i__49046_49107 + (1));
seq__49039_49104 = G__49134;
chunk__49044_49105 = G__49135;
count__49045_49106 = G__49136;
i__49046_49107 = G__49137;
continue;
} else {
var temp__5278__auto___49138 = cljs.core.seq.call(null,seq__49039_49104);
if(temp__5278__auto___49138){
var seq__49039_49139__$1 = temp__5278__auto___49138;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49039_49139__$1)){
var c__24249__auto___49140 = cljs.core.chunk_first.call(null,seq__49039_49139__$1);
var G__49141 = cljs.core.chunk_rest.call(null,seq__49039_49139__$1);
var G__49142 = c__24249__auto___49140;
var G__49143 = cljs.core.count.call(null,c__24249__auto___49140);
var G__49144 = (0);
seq__49039_49104 = G__49141;
chunk__49044_49105 = G__49142;
count__49045_49106 = G__49143;
i__49046_49107 = G__49144;
continue;
} else {
var x_49145 = cljs.core.first.call(null,seq__49039_49139__$1);
var seq__49040_49146 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49041_49147 = null;
var count__49042_49148 = (0);
var i__49043_49149 = (0);
while(true){
if((i__49043_49149 < count__49042_49148)){
var y_49150 = cljs.core._nth.call(null,chunk__49041_49147,i__49043_49149);
var r_49151 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49053_49152 = r_49151;
G__49053_49152.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49145),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49150)].join(''));

G__49053_49152.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49145)].join(''));

G__49053_49152.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49150)].join(''));

G__49053_49152.setAttribute("width","1");

G__49053_49152.setAttribute("height","1");

G__49053_49152.setAttribute("fill","none");

G__49053_49152.onclick = ((function (seq__49040_49146,chunk__49041_49147,count__49042_49148,i__49043_49149,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49053_49152,r_49151,y_49150,x_49145,seq__49039_49139__$1,temp__5278__auto___49138,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49145,y_49150], null)], null));
});})(seq__49040_49146,chunk__49041_49147,count__49042_49148,i__49043_49149,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49053_49152,r_49151,y_49150,x_49145,seq__49039_49139__$1,temp__5278__auto___49138,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49103,r_49151);

var G__49153 = seq__49040_49146;
var G__49154 = chunk__49041_49147;
var G__49155 = count__49042_49148;
var G__49156 = (i__49043_49149 + (1));
seq__49040_49146 = G__49153;
chunk__49041_49147 = G__49154;
count__49042_49148 = G__49155;
i__49043_49149 = G__49156;
continue;
} else {
var temp__5278__auto___49157__$1 = cljs.core.seq.call(null,seq__49040_49146);
if(temp__5278__auto___49157__$1){
var seq__49040_49158__$1 = temp__5278__auto___49157__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49040_49158__$1)){
var c__24249__auto___49159 = cljs.core.chunk_first.call(null,seq__49040_49158__$1);
var G__49160 = cljs.core.chunk_rest.call(null,seq__49040_49158__$1);
var G__49161 = c__24249__auto___49159;
var G__49162 = cljs.core.count.call(null,c__24249__auto___49159);
var G__49163 = (0);
seq__49040_49146 = G__49160;
chunk__49041_49147 = G__49161;
count__49042_49148 = G__49162;
i__49043_49149 = G__49163;
continue;
} else {
var y_49164 = cljs.core.first.call(null,seq__49040_49158__$1);
var r_49165 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__49054_49166 = r_49165;
G__49054_49166.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49145),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49164)].join(''));

G__49054_49166.setAttribute("x",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49145)].join(''));

G__49054_49166.setAttribute("y",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49164)].join(''));

G__49054_49166.setAttribute("width","1");

G__49054_49166.setAttribute("height","1");

G__49054_49166.setAttribute("fill","none");

G__49054_49166.onclick = ((function (seq__49040_49146,chunk__49041_49147,count__49042_49148,i__49043_49149,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49054_49166,r_49165,y_49164,seq__49040_49158__$1,temp__5278__auto___49157__$1,x_49145,seq__49039_49139__$1,temp__5278__auto___49138,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return cljs.core.reset_BANG_.call(null,selected_cell,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"location","location",1815599388),null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x_49145,y_49164], null)], null));
});})(seq__49040_49146,chunk__49041_49147,count__49042_49148,i__49043_49149,seq__49039_49104,chunk__49044_49105,count__49045_49106,i__49046_49107,G__49054_49166,r_49165,y_49164,seq__49040_49158__$1,temp__5278__auto___49157__$1,x_49145,seq__49039_49139__$1,temp__5278__auto___49138,frag_49103,timer_name__15521__auto___49100,ignore__15522__auto___49101,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_49103,r_49165);

var G__49167 = cljs.core.next.call(null,seq__49040_49158__$1);
var G__49168 = null;
var G__49169 = (0);
var G__49170 = (0);
seq__49040_49146 = G__49167;
chunk__49041_49147 = G__49168;
count__49042_49148 = G__49169;
i__49043_49149 = G__49170;
continue;
}
} else {
}
}
break;
}

var G__49171 = cljs.core.next.call(null,seq__49039_49139__$1);
var G__49172 = null;
var G__49173 = (0);
var G__49174 = (0);
seq__49039_49104 = G__49171;
chunk__49044_49105 = G__49172;
count__49045_49106 = G__49173;
i__49046_49107 = G__49174;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(primary_layer,frag_49103);

var frag_49175 = document.createDocumentFragment();
var seq__49055_49176 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__49060_49177 = null;
var count__49061_49178 = (0);
var i__49062_49179 = (0);
while(true){
if((i__49062_49179 < count__49061_49178)){
var x_49180 = cljs.core._nth.call(null,chunk__49060_49177,i__49062_49179);
var seq__49063_49181 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49064_49182 = null;
var count__49065_49183 = (0);
var i__49066_49184 = (0);
while(true){
if((i__49066_49184 < count__49065_49183)){
var y_49185 = cljs.core._nth.call(null,chunk__49064_49182,i__49066_49184);
var g_49186 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49187 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49067_49188 = g_49186;
G__49067_49188.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49180 + 0.5),(y_49185 + 0.5)));


var G__49068_49189 = r_49187;
G__49068_49189.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49180),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49185)].join(''));


goog.dom.appendChild(g_49186,r_49187);

goog.dom.appendChild(frag_49175,g_49186);

var G__49190 = seq__49063_49181;
var G__49191 = chunk__49064_49182;
var G__49192 = count__49065_49183;
var G__49193 = (i__49066_49184 + (1));
seq__49063_49181 = G__49190;
chunk__49064_49182 = G__49191;
count__49065_49183 = G__49192;
i__49066_49184 = G__49193;
continue;
} else {
var temp__5278__auto___49194 = cljs.core.seq.call(null,seq__49063_49181);
if(temp__5278__auto___49194){
var seq__49063_49195__$1 = temp__5278__auto___49194;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49063_49195__$1)){
var c__24249__auto___49196 = cljs.core.chunk_first.call(null,seq__49063_49195__$1);
var G__49197 = cljs.core.chunk_rest.call(null,seq__49063_49195__$1);
var G__49198 = c__24249__auto___49196;
var G__49199 = cljs.core.count.call(null,c__24249__auto___49196);
var G__49200 = (0);
seq__49063_49181 = G__49197;
chunk__49064_49182 = G__49198;
count__49065_49183 = G__49199;
i__49066_49184 = G__49200;
continue;
} else {
var y_49201 = cljs.core.first.call(null,seq__49063_49195__$1);
var g_49202 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49203 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49069_49204 = g_49202;
G__49069_49204.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49180 + 0.5),(y_49201 + 0.5)));


var G__49070_49205 = r_49203;
G__49070_49205.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49180),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49201)].join(''));


goog.dom.appendChild(g_49202,r_49203);

goog.dom.appendChild(frag_49175,g_49202);

var G__49206 = cljs.core.next.call(null,seq__49063_49195__$1);
var G__49207 = null;
var G__49208 = (0);
var G__49209 = (0);
seq__49063_49181 = G__49206;
chunk__49064_49182 = G__49207;
count__49065_49183 = G__49208;
i__49066_49184 = G__49209;
continue;
}
} else {
}
}
break;
}

var G__49210 = seq__49055_49176;
var G__49211 = chunk__49060_49177;
var G__49212 = count__49061_49178;
var G__49213 = (i__49062_49179 + (1));
seq__49055_49176 = G__49210;
chunk__49060_49177 = G__49211;
count__49061_49178 = G__49212;
i__49062_49179 = G__49213;
continue;
} else {
var temp__5278__auto___49214 = cljs.core.seq.call(null,seq__49055_49176);
if(temp__5278__auto___49214){
var seq__49055_49215__$1 = temp__5278__auto___49214;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49055_49215__$1)){
var c__24249__auto___49216 = cljs.core.chunk_first.call(null,seq__49055_49215__$1);
var G__49217 = cljs.core.chunk_rest.call(null,seq__49055_49215__$1);
var G__49218 = c__24249__auto___49216;
var G__49219 = cljs.core.count.call(null,c__24249__auto___49216);
var G__49220 = (0);
seq__49055_49176 = G__49217;
chunk__49060_49177 = G__49218;
count__49061_49178 = G__49219;
i__49062_49179 = G__49220;
continue;
} else {
var x_49221 = cljs.core.first.call(null,seq__49055_49215__$1);
var seq__49056_49222 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49057_49223 = null;
var count__49058_49224 = (0);
var i__49059_49225 = (0);
while(true){
if((i__49059_49225 < count__49058_49224)){
var y_49226 = cljs.core._nth.call(null,chunk__49057_49223,i__49059_49225);
var g_49227 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49228 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49071_49229 = g_49227;
G__49071_49229.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49221 + 0.5),(y_49226 + 0.5)));


var G__49072_49230 = r_49228;
G__49072_49230.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49221),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49226)].join(''));


goog.dom.appendChild(g_49227,r_49228);

goog.dom.appendChild(frag_49175,g_49227);

var G__49231 = seq__49056_49222;
var G__49232 = chunk__49057_49223;
var G__49233 = count__49058_49224;
var G__49234 = (i__49059_49225 + (1));
seq__49056_49222 = G__49231;
chunk__49057_49223 = G__49232;
count__49058_49224 = G__49233;
i__49059_49225 = G__49234;
continue;
} else {
var temp__5278__auto___49235__$1 = cljs.core.seq.call(null,seq__49056_49222);
if(temp__5278__auto___49235__$1){
var seq__49056_49236__$1 = temp__5278__auto___49235__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49056_49236__$1)){
var c__24249__auto___49237 = cljs.core.chunk_first.call(null,seq__49056_49236__$1);
var G__49238 = cljs.core.chunk_rest.call(null,seq__49056_49236__$1);
var G__49239 = c__24249__auto___49237;
var G__49240 = cljs.core.count.call(null,c__24249__auto___49237);
var G__49241 = (0);
seq__49056_49222 = G__49238;
chunk__49057_49223 = G__49239;
count__49058_49224 = G__49240;
i__49059_49225 = G__49241;
continue;
} else {
var y_49242 = cljs.core.first.call(null,seq__49056_49236__$1);
var g_49243 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_49244 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__49073_49245 = g_49243;
G__49073_49245.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_49221 + 0.5),(y_49242 + 0.5)));


var G__49074_49246 = r_49244;
G__49074_49246.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49221),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49242)].join(''));


goog.dom.appendChild(g_49243,r_49244);

goog.dom.appendChild(frag_49175,g_49243);

var G__49247 = cljs.core.next.call(null,seq__49056_49236__$1);
var G__49248 = null;
var G__49249 = (0);
var G__49250 = (0);
seq__49056_49222 = G__49247;
chunk__49057_49223 = G__49248;
count__49058_49224 = G__49249;
i__49059_49225 = G__49250;
continue;
}
} else {
}
}
break;
}

var G__49251 = cljs.core.next.call(null,seq__49055_49215__$1);
var G__49252 = null;
var G__49253 = (0);
var G__49254 = (0);
seq__49055_49176 = G__49251;
chunk__49060_49177 = G__49252;
count__49061_49178 = G__49253;
i__49062_49179 = G__49254;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(wind_overlay,frag_49175);

var frag = document.createDocumentFragment();
var scale = 0.03;
var seq__49075_49255 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__49080_49256 = null;
var count__49081_49257 = (0);
var i__49082_49258 = (0);
while(true){
if((i__49082_49258 < count__49081_49257)){
var x_49259 = cljs.core._nth.call(null,chunk__49080_49256,i__49082_49258);
var seq__49083_49260 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49084_49261 = null;
var count__49085_49262 = (0);
var i__49086_49263 = (0);
while(true){
if((i__49086_49263 < count__49085_49262)){
var y_49264 = cljs.core._nth.call(null,chunk__49084_49261,i__49086_49263);
var t_49265 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49087_49266 = t_49265;
G__49087_49266.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49259 + 0.5) / scale),((y_49264 + 0.9) / scale)))].join(''));

G__49087_49266.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49259),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49264)].join(''));

G__49087_49266.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49265);

var G__49267 = seq__49083_49260;
var G__49268 = chunk__49084_49261;
var G__49269 = count__49085_49262;
var G__49270 = (i__49086_49263 + (1));
seq__49083_49260 = G__49267;
chunk__49084_49261 = G__49268;
count__49085_49262 = G__49269;
i__49086_49263 = G__49270;
continue;
} else {
var temp__5278__auto___49271 = cljs.core.seq.call(null,seq__49083_49260);
if(temp__5278__auto___49271){
var seq__49083_49272__$1 = temp__5278__auto___49271;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49083_49272__$1)){
var c__24249__auto___49273 = cljs.core.chunk_first.call(null,seq__49083_49272__$1);
var G__49274 = cljs.core.chunk_rest.call(null,seq__49083_49272__$1);
var G__49275 = c__24249__auto___49273;
var G__49276 = cljs.core.count.call(null,c__24249__auto___49273);
var G__49277 = (0);
seq__49083_49260 = G__49274;
chunk__49084_49261 = G__49275;
count__49085_49262 = G__49276;
i__49086_49263 = G__49277;
continue;
} else {
var y_49278 = cljs.core.first.call(null,seq__49083_49272__$1);
var t_49279 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49088_49280 = t_49279;
G__49088_49280.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49259 + 0.5) / scale),((y_49278 + 0.9) / scale)))].join(''));

G__49088_49280.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49259),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49278)].join(''));

G__49088_49280.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49279);

var G__49281 = cljs.core.next.call(null,seq__49083_49272__$1);
var G__49282 = null;
var G__49283 = (0);
var G__49284 = (0);
seq__49083_49260 = G__49281;
chunk__49084_49261 = G__49282;
count__49085_49262 = G__49283;
i__49086_49263 = G__49284;
continue;
}
} else {
}
}
break;
}

var G__49285 = seq__49075_49255;
var G__49286 = chunk__49080_49256;
var G__49287 = count__49081_49257;
var G__49288 = (i__49082_49258 + (1));
seq__49075_49255 = G__49285;
chunk__49080_49256 = G__49286;
count__49081_49257 = G__49287;
i__49082_49258 = G__49288;
continue;
} else {
var temp__5278__auto___49289 = cljs.core.seq.call(null,seq__49075_49255);
if(temp__5278__auto___49289){
var seq__49075_49290__$1 = temp__5278__auto___49289;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49075_49290__$1)){
var c__24249__auto___49291 = cljs.core.chunk_first.call(null,seq__49075_49290__$1);
var G__49292 = cljs.core.chunk_rest.call(null,seq__49075_49290__$1);
var G__49293 = c__24249__auto___49291;
var G__49294 = cljs.core.count.call(null,c__24249__auto___49291);
var G__49295 = (0);
seq__49075_49255 = G__49292;
chunk__49080_49256 = G__49293;
count__49081_49257 = G__49294;
i__49082_49258 = G__49295;
continue;
} else {
var x_49296 = cljs.core.first.call(null,seq__49075_49290__$1);
var seq__49076_49297 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__49077_49298 = null;
var count__49078_49299 = (0);
var i__49079_49300 = (0);
while(true){
if((i__49079_49300 < count__49078_49299)){
var y_49301 = cljs.core._nth.call(null,chunk__49077_49298,i__49079_49300);
var t_49302 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49089_49303 = t_49302;
G__49089_49303.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49296 + 0.5) / scale),((y_49301 + 0.9) / scale)))].join(''));

G__49089_49303.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49296),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49301)].join(''));

G__49089_49303.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49302);

var G__49304 = seq__49076_49297;
var G__49305 = chunk__49077_49298;
var G__49306 = count__49078_49299;
var G__49307 = (i__49079_49300 + (1));
seq__49076_49297 = G__49304;
chunk__49077_49298 = G__49305;
count__49078_49299 = G__49306;
i__49079_49300 = G__49307;
continue;
} else {
var temp__5278__auto___49308__$1 = cljs.core.seq.call(null,seq__49076_49297);
if(temp__5278__auto___49308__$1){
var seq__49076_49309__$1 = temp__5278__auto___49308__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__49076_49309__$1)){
var c__24249__auto___49310 = cljs.core.chunk_first.call(null,seq__49076_49309__$1);
var G__49311 = cljs.core.chunk_rest.call(null,seq__49076_49309__$1);
var G__49312 = c__24249__auto___49310;
var G__49313 = cljs.core.count.call(null,c__24249__auto___49310);
var G__49314 = (0);
seq__49076_49297 = G__49311;
chunk__49077_49298 = G__49312;
count__49078_49299 = G__49313;
i__49079_49300 = G__49314;
continue;
} else {
var y_49315 = cljs.core.first.call(null,seq__49076_49309__$1);
var t_49316 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__49090_49317 = t_49316;
G__49090_49317.setAttribute("transform",[cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_scale.call(null,scale)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.svg_translate.call(null,((x_49296 + 0.5) / scale),((y_49315 + 0.9) / scale)))].join(''));

G__49090_49317.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-text-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_49296),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_49315)].join(''));

G__49090_49317.setAttribute("text-anchor","middle");


goog.dom.appendChild(frag,t_49316);

var G__49318 = cljs.core.next.call(null,seq__49076_49309__$1);
var G__49319 = null;
var G__49320 = (0);
var G__49321 = (0);
seq__49076_49297 = G__49318;
chunk__49077_49298 = G__49319;
count__49078_49299 = G__49320;
i__49079_49300 = G__49321;
continue;
}
} else {
}
}
break;
}

var G__49322 = cljs.core.next.call(null,seq__49075_49290__$1);
var G__49323 = null;
var G__49324 = (0);
var G__49325 = (0);
seq__49075_49255 = G__49322;
chunk__49080_49256 = G__49323;
count__49081_49257 = G__49324;
i__49082_49258 = G__49325;
continue;
}
} else {
}
}
break;
}

return goog.dom.appendChild(text_overlay,frag);
})()
;
console.timeEnd(timer_name__15521__auto___49100);


var display_params_STAR_ = javelin.core.formula.call(null,((function (elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (display_params__$1){
return cljs.core.dissoc.call(null,display_params__$1,new cljs.core.Keyword(null,"opacity","opacity",397153780),new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"flight-paths","flight-paths",159519268),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541));
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,display_params);
return javelin.core.formula.call(null,((function (display_params_STAR_,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (weather_data__$1,display_params_STAR___$1){
return weathergen.ui.update_grid.call(null,weather_data__$1,display_params_STAR___$1);
});})(display_params_STAR_,elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,weather_data,display_params_STAR_);
});})(elem,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,selected_cell_overlay,wind_stability_areas__$1,weather_overrides__$1,effective_hover_cell,vec__48986,map__48989,map__48989__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);

return elem;
};
var weathergen$ui$grid = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__49326__i = 0, G__49326__a = new Array(arguments.length -  0);
while (G__49326__i < G__49326__a.length) {G__49326__a[G__49326__i] = arguments[G__49326__i + 0]; ++G__49326__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__49326__a,0,null);
} 
return weathergen$ui$grid__delegate.call(this,args__29774__auto__);};
weathergen$ui$grid.cljs$lang$maxFixedArity = 0;
weathergen$ui$grid.cljs$lang$applyTo = (function (arglist__49327){
var args__29774__auto__ = cljs.core.seq(arglist__49327);
return weathergen$ui$grid__delegate(args__29774__auto__);
});
weathergen$ui$grid.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$grid__delegate;
return weathergen$ui$grid;
})()
;
weathergen.ui.ESCAPE_KEY = (27);
weathergen.ui.ENTER_KEY = (13);
weathergen.ui.two_column = (function weathergen$ui$two_column(left,right){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"two-column",hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"left-column",left),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"right-column",right));
});
/**
 * Parses an int from a string, returning the int, or nil if it cannot
 *   be parsed as an int.
 */
weathergen.ui.parse_int = (function weathergen$ui$parse_int(s){
var n = (new Number(s)).valueOf();
var l = cljs.core.long$.call(null,n);
if(cljs.core.int_QMARK_.call(null,n)){
return l;
} else {
return null;
}
});
weathergen.ui.conform_nonnegative_integer = (function weathergen$ui$conform_nonnegative_integer(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__23326__auto__ = parsed;
if(cljs.core.truth_(and__23326__auto__)){
return !((parsed < (0)));
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be whole number, greather than or equal to zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
weathergen.ui.conform_positive_integer = (function weathergen$ui$conform_positive_integer(s){
return javelin.core.formula.call(null,(function (s__$1){
var parsed = weathergen.ui.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__23326__auto__ = parsed;
if(cljs.core.truth_(and__23326__auto__)){
return (parsed > (0));
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:"Must be an integer greater than zero."),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
})).call(null,s);
});
/**
 * Returns a conformer that will ensure a value parses to an int
 *   between `from` and `to`, inclusive.
 */
weathergen.ui.int_conformer = (function weathergen$ui$int_conformer(from,to){
var message = goog.string.format("Must be an integer between %d and %d.",from,to);
return ((function (message){
return (function (s){
return javelin.core.formula.call(null,((function (message){
return (function (s__$1){
var parsed = weathergen.ui.parse_int.call(null,s__$1);
var valid_QMARK_ = (function (){var and__23326__auto__ = parsed;
if(cljs.core.truth_(and__23326__auto__)){
return ((from <= parsed)) && ((parsed <= to));
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),(cljs.core.truth_(valid_QMARK_)?null:message),new cljs.core.Keyword(null,"value","value",305978217),parsed], null);
});})(message))
).call(null,s);
});
;})(message))
});
/**
 * Returns a conformer that will ensure a value parses to a floating
 *   point number between `from` and `to`, inclusive.
 */
weathergen.ui.float_conformer = (function weathergen$ui$float_conformer(from,to){
var message = goog.string.format("Must be a number between %f and %f.",from,to);
return ((function (message){
return (function (s){
return javelin.core.formula.call(null,((function (message){
return (function (s__$1){
var n = (new Number(s__$1)).valueOf();
var valid_QMARK_ = ((from <= n)) && ((n <= to));
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),valid_QMARK_,new cljs.core.Keyword(null,"message","message",-406056002),((valid_QMARK_)?null:message),new cljs.core.Keyword(null,"value","value",305978217),(cljs.core.truth_(isNaN(n))?null:n)], null);
});})(message))
).call(null,s);
});
;})(message))
});
/**
 * Given two conformers, returns a conformer that will validate only
 *   if both of them do. Checks c1 first.
 */
weathergen.ui.compose_conformers = (function weathergen$ui$compose_conformers(c1,c2){
return (function (s){
var p1 = c1.call(null,s);
var p2 = c2.call(null,s);
return javelin.core.formula.call(null,((function (p1,p2){
return (function (p1__$1,p2__$1){
if(cljs.core.truth_(new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(p1__$1))){
return p2__$1;
} else {
return p1__$1;
}
});})(p1,p2))
).call(null,p1,p2);
});
});
/**
 * Renders a control that will provide feedback as to whether the
 *   contents are valid.
 * 
 *   :conform : A function of one argument, a cell containing the current
 *   value of the control. Returns a call whose value is a map with keys
 *   `:valid?`, `:value`, and `:message`, expressing whether the value is
 *   valid, and if not, why not.
 *   :fmt : A function that turns the validated value into a displayable
 *   string
 *   :source: A cell containing the source data for the input control.
 *   :update: A function that will be called with the new, valid value.
 *   Defaults to setting the source cell.
 *   :width: Width in pixels of the input area.
 *   :placeholder: Placeholder when input is empty.
 *   :css: Styling applied to container div.
 *   :align: Specifies text alignment of the input box
 * @param {...*} var_args
 */
weathergen.ui.validating_edit = (function() { 
var weathergen$ui$validating_edit__delegate = function (args__29774__auto__){
var vec__49342 = hoplon.core.parse_args.call(null,args__29774__auto__);
var attrs = cljs.core.nth.call(null,vec__49342,(0),null);
var _ = cljs.core.nth.call(null,vec__49342,(1),null);
var map__49345 = attrs;
var map__49345__$1 = ((((!((map__49345 == null)))?((((map__49345.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49345.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49345):map__49345);
var align = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"align","align",1964212802));
var fmt = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"fmt","fmt",332300772));
var placeholder = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083));
var css = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var width = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var update = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var conform = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"conform","conform",1846236460));
var source = cljs.core.get.call(null,map__49345__$1,new cljs.core.Keyword(null,"source","source",-433931539));
var attrs__$1 = cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"conform","conform",1846236460),new cljs.core.Keyword(null,"fmt","fmt",332300772),new cljs.core.Keyword(null,"source","source",-433931539),new cljs.core.Keyword(null,"update","update",1045576396),new cljs.core.Keyword(null,"width","width",-384071477),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.Keyword(null,"align","align",1964212802));
var interim = javelin.core.cell.call(null,null);
var fmt__$1 = (function (){var or__23338__auto__ = fmt;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.str;
}
})();
var value = javelin.core.formula.call(null,((function (interim,fmt__$1,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (interim__$1,source__$1){
if(cljs.core.truth_(interim__$1)){
return interim__$1;
} else {
return fmt__$1.call(null,source__$1);
}
});})(interim,fmt__$1,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,interim,source);
var parsed = conform.call(null,value);
var update__$1 = (function (){var or__23338__auto__ = update;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return ((function (or__23338__auto__,interim,fmt__$1,value,parsed,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (p1__49328_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.constantly.call(null,p1__49328_SHARP_));
});
;})(or__23338__auto__,interim,fmt__$1,value,parsed,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
}
})();
var state = javelin.core.cell.call(null,new cljs.core.Keyword(null,"set","set",304602554));
var focused_QMARK_ = javelin.core.cell.call(null,false);
var align__$1 = javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (G__49347){
return G__49347;
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,align);
var valid_QMARK_ = javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (parsed__$1){
return cljs.core.empty_QMARK_.call(null,new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(parsed__$1));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,parsed);
return hoplon.core.div.call(null,attrs__$1,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"overflow","overflow",2058931880),"show",new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(function (){var or__23338__auto__ = width;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return (125);
}
})()),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3))], null),css),(function (){var i = hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),placeholder,new cljs.core.Keyword(null,"input","input",556931961),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (p1__49329_SHARP_){
cljs.core.reset_BANG_.call(null,interim,cljs.core.deref.call(null,p1__49329_SHARP_));

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"editing","editing",1365491601));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
,new cljs.core.Keyword(null,"change","change",-1163046502),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
var p = cljs.core.deref.call(null,parsed);
var temp__5278__auto__ = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p);
if(cljs.core.truth_(temp__5278__auto__)){
var v = temp__5278__auto__;
return javelin.core.dosync_STAR_.call(null,((function (v,temp__5278__auto__,p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
update__$1.call(null,v);

cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
});})(v,temp__5278__auto__,p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
,new cljs.core.Keyword(null,"keyup","keyup",-794526927),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (e){
if(cljs.core._EQ_.call(null,weathergen.ui.ESCAPE_KEY,e.keyCode)){
return javelin.core.dosync_STAR_.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
,new cljs.core.Keyword(null,"focus","focus",234677911),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
return cljs.core.reset_BANG_.call(null,focused_QMARK_,true);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
,new cljs.core.Keyword(null,"blur","blur",-453500461),((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
var p = cljs.core.deref.call(null,parsed);
return javelin.core.dosync_STAR_.call(null,((function (p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
cljs.core.reset_BANG_.call(null,focused_QMARK_,false);

var temp__5278__auto__ = new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(p);
if(cljs.core.truth_(temp__5278__auto__)){
var v = temp__5278__auto__;
update__$1.call(null,v);

cljs.core.reset_BANG_.call(null,interim,null);

return cljs.core.reset_BANG_.call(null,state,new cljs.core.Keyword(null,"set","set",304602554));
} else {
return null;
}
});})(p,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (state__$1,valid_QMARK___$1,align__$2){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"font-style","font-style",-773672352),((cljs.core._EQ_.call(null,state__$1,new cljs.core.Keyword(null,"editing","editing",1365491601)))?"italic":""),new cljs.core.Keyword(null,"color","color",1011675173),(cljs.core.truth_(valid_QMARK___$1)?"":weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"invalid","invalid",412869516))),new cljs.core.Keyword(null,"background","background",-863952629),(cljs.core.truth_(valid_QMARK___$1)?"":weathergen.ui.common.colors.call(null,new cljs.core.Keyword(null,"invalid-background","invalid-background",-917496690))),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,((function (){var or__23338__auto__ = width;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return (125);
}
})() - (cljs.core.truth_(valid_QMARK___$1)?(0):(20)))),new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),(cljs.core.truth_(valid_QMARK___$1)?null:weathergen.ui.common.px.call(null,(20))),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),(cljs.core.truth_(valid_QMARK___$1)?null:weathergen.ui.common.px.call(null,(-20))),new cljs.core.Keyword(null,"text-align","text-align",1786091845),(cljs.core.truth_(align__$2)?align__$2:null)], null);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,state,valid_QMARK_,align__$1),new cljs.core.Keyword(null,"value","value",305978217),value);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/error.png",new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (G__49348){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__49348);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,parsed),new cljs.core.Keyword(null,"click","click",1912301393),((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (){
return (function (){var G__49349 = i;
return G__49349;
})().focus();
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (valid_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"right","right",-452581833),(0),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(14)),new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"opacity","opacity",397153780),(cljs.core.truth_(valid_QMARK___$1)?"0":"1")], null);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,valid_QMARK_))], null);
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (G__49352,G__49351,G__49350){
var and__23326__auto__ = G__49350.call(null,G__49351);
if(cljs.core.truth_(and__23326__auto__)){
return G__49352;
} else {
return and__23326__auto__;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,focused_QMARK_,valid_QMARK_,cljs.core.not),new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"min-width","min-width",1926193728),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),new cljs.core.Keyword(null,"top","top",-1856271961),new cljs.core.Keyword(null,"background","background",-863952629),new cljs.core.Keyword(null,"max-width","max-width",-1939924051),new cljs.core.Keyword(null,"z-index","z-index",1892827090),new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),new cljs.core.Keyword(null,"position","position",-2011731912),new cljs.core.Keyword(null,"border","border",1444987323)],[weathergen.ui.common.pct.call(null,(100)),weathergen.ui.common.pct.call(null,(75)),weathergen.ui.common.px.call(null,(24)),"rgba(221,221,221,0.95)",weathergen.ui.common.px.call(null,(500)),(1),weathergen.ui.common.px.call(null,(2)),"absolute","1px solid #888"]),javelin.core.formula.call(null,((function (interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_){
return (function (G__49353){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__49353);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__49345,map__49345__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__49342,attrs,_))
).call(null,parsed)));
};
var weathergen$ui$validating_edit = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__49354__i = 0, G__49354__a = new Array(arguments.length -  0);
while (G__49354__i < G__49354__a.length) {G__49354__a[G__49354__i] = arguments[G__49354__i + 0]; ++G__49354__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__49354__a,0,null);
} 
return weathergen$ui$validating_edit__delegate.call(this,args__29774__auto__);};
weathergen$ui$validating_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$validating_edit.cljs$lang$applyTo = (function (arglist__49355){
var args__29774__auto__ = cljs.core.seq(arglist__49355);
return weathergen$ui$validating_edit__delegate(args__29774__auto__);
});
weathergen$ui$validating_edit.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$validating_edit__delegate;
return weathergen$ui$validating_edit;
})()
;
/**
 * @param {...*} var_args
 */
weathergen.ui.time_edit = (function() { 
var weathergen$ui$time_edit__delegate = function (args__29774__auto__){
var vec__49364 = hoplon.core.parse_args.call(null,args__29774__auto__);
var map__49367 = cljs.core.nth.call(null,vec__49364,(0),null);
var map__49367__$1 = ((((!((map__49367 == null)))?((((map__49367.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49367.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49367):map__49367);
var attrs = map__49367__$1;
var source = cljs.core.get.call(null,map__49367__$1,new cljs.core.Keyword(null,"source","source",-433931539));
var update = cljs.core.get.call(null,map__49367__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var _ = cljs.core.nth.call(null,vec__49364,(1),null);
return weathergen.ui.validating_edit.call(null,attrs,new cljs.core.Keyword(null,"width","width",-384071477),(65),new cljs.core.Keyword(null,"fmt","fmt",332300772),weathergen.ui.common.format_time,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"dd/hhmm",new cljs.core.Keyword(null,"conform","conform",1846236460),((function (vec__49364,map__49367,map__49367__$1,attrs,source,update,_){
return (function (val){
return javelin.core.formula.call(null,((function (vec__49364,map__49367,map__49367__$1,attrs,source,update,_){
return (function (val__$1){
var vec__49369 = cljs.core.re_matches.call(null,/(\d+)\/(\d\d):(\d\d)/,val__$1);
var all = cljs.core.nth.call(null,vec__49369,(0),null);
var dd = cljs.core.nth.call(null,vec__49369,(1),null);
var hh = cljs.core.nth.call(null,vec__49369,(2),null);
var mm = cljs.core.nth.call(null,vec__49369,(3),null);
var day = cljs.core.long$.call(null,(new Number(dd)));
var hour = cljs.core.long$.call(null,(new Number(hh)));
var min = cljs.core.long$.call(null,(new Number(mm)));
var valid_QMARK_ = (function (){var and__23326__auto__ = dd;
if(cljs.core.truth_(and__23326__auto__)){
var and__23326__auto____$1 = hh;
if(cljs.core.truth_(and__23326__auto____$1)){
var and__23326__auto____$2 = mm;
if(cljs.core.truth_(and__23326__auto____$2)){
return (cljs.core.int_QMARK_.call(null,day)) && (cljs.core.int_QMARK_.call(null,hour)) && (cljs.core.int_QMARK_.call(null,min)) && ((((0) <= hour)) && ((hour <= (23)))) && ((((0) <= min)) && ((min <= (59))));
} else {
return and__23326__auto____$2;
}
} else {
return and__23326__auto____$1;
}
} else {
return and__23326__auto__;
}
})();
var val__$2 = new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),day,new cljs.core.Keyword(null,"hour","hour",-555989214),hour,new cljs.core.Keyword(null,"minute","minute",-642875969),min], null);
var over_max_QMARK_ = (function (){var and__23326__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
var and__23326__auto____$1 = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)));
if(cljs.core.truth_(and__23326__auto____$1)){
return (weathergen.time.campaign_time__GT_minutes.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)))) < weathergen.time.campaign_time__GT_minutes.call(null,val__$2));
} else {
return and__23326__auto____$1;
}
} else {
return and__23326__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),(function (){var and__23326__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not.call(null,over_max_QMARK_);
} else {
return and__23326__auto__;
}
})(),new cljs.core.Keyword(null,"message","message",-406056002),((cljs.core.not.call(null,valid_QMARK_))?"Time must be in the format 'dd/hh:mm'":(cljs.core.truth_(over_max_QMARK_)?[cljs.core.str.cljs$core$IFn$_invoke$arity$1("Time cannot be set later than "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.ui.common.format_time.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params)))))].join(''):null)),new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"day","day",-274800446),day,new cljs.core.Keyword(null,"hour","hour",-555989214),hour,new cljs.core.Keyword(null,"minute","minute",-642875969),min], null)], null);
});})(vec__49364,map__49367,map__49367__$1,attrs,source,update,_))
).call(null,val);
});})(vec__49364,map__49367,map__49367__$1,attrs,source,update,_))
);
};
var weathergen$ui$time_edit = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__49372__i = 0, G__49372__a = new Array(arguments.length -  0);
while (G__49372__i < G__49372__a.length) {G__49372__a[G__49372__i] = arguments[G__49372__i + 0]; ++G__49372__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__49372__a,0,null);
} 
return weathergen$ui$time_edit__delegate.call(this,args__29774__auto__);};
weathergen$ui$time_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_edit.cljs$lang$applyTo = (function (arglist__49373){
var args__29774__auto__ = cljs.core.seq(arglist__49373);
return weathergen$ui$time_edit__delegate(args__29774__auto__);
});
weathergen$ui$time_edit.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$time_edit__delegate;
return weathergen$ui$time_edit;
})()
;
weathergen.ui.edit_field = (function weathergen$ui$edit_field(var_args){
var args49376 = [];
var len__24559__auto___49384 = arguments.length;
var i__24560__auto___49385 = (0);
while(true){
if((i__24560__auto___49385 < len__24559__auto___49384)){
args49376.push((arguments[i__24560__auto___49385]));

var G__49386 = (i__24560__auto___49385 + (1));
i__24560__auto___49385 = G__49386;
continue;
} else {
}
break;
}

var G__49378 = args49376.length;
switch (G__49378) {
case 2:
return weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)]));

break;
case 3:
return weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)]));

break;
default:
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("Invalid arity: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(args49376.length)].join('')));

}
});

weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$2 = (function (c,path){
return weathergen.ui.edit_field.call(null,c,path,cljs.core.PersistentArrayMap.EMPTY);
});

weathergen.ui.edit_field.cljs$core$IFn$_invoke$arity$3 = (function (c,path,opts){
var map__49379 = opts;
var map__49379__$1 = ((((!((map__49379 == null)))?((((map__49379.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49379.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49379):map__49379);
var change_fn = cljs.core.get.call(null,map__49379__$1,new cljs.core.Keyword(null,"change-fn","change-fn",1566440825));
var input_attrs = cljs.core.get.call(null,map__49379__$1,new cljs.core.Keyword(null,"input-attrs","input-attrs",-38113667),cljs.core.PersistentArrayMap.EMPTY);
return hoplon.core.input.call(null,input_attrs,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (map__49379,map__49379__$1,change_fn,input_attrs){
return (function (G__49383,G__49382,G__49381){
return G__49381.call(null,G__49382,G__49383);
});})(map__49379,map__49379__$1,change_fn,input_attrs))
).call(null,path,c,cljs.core.get_in),new cljs.core.Keyword(null,"change","change",-1163046502),(cljs.core.truth_(change_fn)?((function (map__49379,map__49379__$1,change_fn,input_attrs){
return (function (p1__49374_SHARP_){
return change_fn.call(null,Number(cljs.core.deref.call(null,p1__49374_SHARP_)));
});})(map__49379,map__49379__$1,change_fn,input_attrs))
:((function (map__49379,map__49379__$1,change_fn,input_attrs){
return (function (p1__49375_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,Number(cljs.core.deref.call(null,p1__49375_SHARP_)));
});})(map__49379,map__49379__$1,change_fn,input_attrs))
));
});

weathergen.ui.edit_field.cljs$lang$maxFixedArity = 3;

/**
 * Renders an input that will edit a pressure value, in whatever units
 *   the cell `unit-c` indicates
 */
weathergen.ui.pressure_edit_field = (function weathergen$ui$pressure_edit_field(c,path,unit_c){
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,(function (c__$1,unit_c__$1){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,c__$1,path),unit_c__$1);
})).call(null,c,unit_c),new cljs.core.Keyword(null,"change","change",-1163046502),(function (p1__49388_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,weathergen.ui.convert_pressure.call(null,Number(cljs.core.deref.call(null,p1__49388_SHARP_)),cljs.core.deref.call(null,unit_c)));
}));
});
/**
 * Defines a time-edit box with against `path` into map cell `source`.
 * @param {...*} var_args
 */
weathergen.ui.time_entry = (function() { 
var weathergen$ui$time_entry__delegate = function (args__29774__auto__){
var vec__49395 = hoplon.core.parse_args.call(null,args__29774__auto__);
var attrs = cljs.core.nth.call(null,vec__49395,(0),null);
var _ = cljs.core.nth.call(null,vec__49395,(1),null);
var map__49398 = attrs;
var map__49398__$1 = ((((!((map__49398 == null)))?((((map__49398.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49398.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49398):map__49398);
var path = cljs.core.get.call(null,map__49398__$1,new cljs.core.Keyword(null,"path","path",-188191168));
var source = cljs.core.get.call(null,map__49398__$1,new cljs.core.Keyword(null,"source","source",-433931539));
return weathergen.ui.time_edit.call(null,cljs.core.assoc.call(null,cljs.core.assoc.call(null,cljs.core.dissoc.call(null,attrs,new cljs.core.Keyword(null,"path","path",-188191168)),new cljs.core.Keyword(null,"source","source",-433931539),javelin.core.formula.call(null,((function (map__49398,map__49398__$1,path,source,vec__49395,attrs,_){
return (function (source__$1){
return cljs.core.get_in.call(null,source__$1,path);
});})(map__49398,map__49398__$1,path,source,vec__49395,attrs,_))
).call(null,source)),new cljs.core.Keyword(null,"update","update",1045576396),((function (map__49398,map__49398__$1,path,source,vec__49395,attrs,_){
return (function (p1__49389_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.assoc_in,path,p1__49389_SHARP_);
});})(map__49398,map__49398__$1,path,source,vec__49395,attrs,_))
));
};
var weathergen$ui$time_entry = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__49400__i = 0, G__49400__a = new Array(arguments.length -  0);
while (G__49400__i < G__49400__a.length) {G__49400__a[G__49400__i] = arguments[G__49400__i + 0]; ++G__49400__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__49400__a,0,null);
} 
return weathergen$ui$time_entry__delegate.call(this,args__29774__auto__);};
weathergen$ui$time_entry.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_entry.cljs$lang$applyTo = (function (arglist__49401){
var args__29774__auto__ = cljs.core.seq(arglist__49401);
return weathergen$ui$time_entry__delegate(args__29774__auto__);
});
weathergen$ui$time_entry.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$time_entry__delegate;
return weathergen$ui$time_entry;
})()
;
/**
 * Returns UI for the 'button bar' that goes across the top of the
 *   map.
 */
weathergen.ui.button_bar = (function weathergen$ui$button_bar(){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-bar",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,(function (map_size){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,cljs.core.first.call(null,map_size)),new cljs.core.Keyword(null,"margin","margin",-995903681),"0 0 3px 0"], null);
})).call(null,weathergen.ui.map_size),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"legend","legend",-1027192245)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(5))], null),hoplon.core.span.call(null,"Map Legend")),(function (){var button_size = (18);
var map_center = ((function (button_size){
return (function (){
var map__49404 = cljs.core.deref.call(null,weathergen.ui.map_viewbox);
var map__49404__$1 = ((((!((map__49404 == null)))?((((map__49404.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49404.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49404):map__49404);
var x = cljs.core.get.call(null,map__49404__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__49404__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__49404__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__49404__$1,new cljs.core.Keyword(null,"height","height",1025178622));
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [(x + (width / (2))),(y + (height / (2)))], null);
});})(button_size))
;
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(10))], null),weathergen.ui.common.inl.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (button_size,map_center){
return (function (){
return weathergen.ui.zoom_map_BANG_.call(null,map_center.call(null),1.1);
});})(button_size,map_center))
,hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom"], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"src","src",-1651076051),"images/zoomin.svg",new cljs.core.Keyword(null,"title","title",636505583),"Zoom Map In")),weathergen.ui.common.inl.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (button_size,map_center){
return (function (){
return weathergen.ui.zoom_map_BANG_.call(null,map_center.call(null),(1.0 / 1.1));
});})(button_size,map_center))
,hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom"], null),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,button_size),new cljs.core.Keyword(null,"src","src",-1651076051),"images/zoomout.svg",new cljs.core.Keyword(null,"title","title",636505583),"Zoom Map Out")))));
})(),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(27)),new cljs.core.Keyword(null,"bottom","bottom",-1550509018),(0)], null),hoplon.core.span.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"mission-time","mission-time",-1235574900)], null),"Mission Time:")," ",javelin.core.formula.call(null,(function (mission){
var t = weathergen.falcon.files.mission.mission_time.call(null,mission);
if(cljs.core.truth_(t)){
return weathergen.ui.common.format_time.call(null,t);
} else {
return "--/----";
}
})).call(null,weathergen.ui.mission)),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.px.call(null,(7))], null),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map","map",1371690461),new cljs.core.Keyword(null,"weather-time","weather-time",-248525118)], null),"Weather Time:")," ",javelin.core.formula.call(null,(function (weather_data_params){
var t = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(weather_data_params));
if(cljs.core.truth_(t)){
return weathergen.ui.common.format_time.call(null,t);
} else {
return "--/----";
}
})).call(null,weathergen.ui.weather_data_params))),javelin.core.formula.call(null,(function (computing){
if(cljs.core.not.call(null,computing)){
return cljs.core.PersistentVector.EMPTY;
} else {
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/spinner.gif",new cljs.core.Keyword(null,"width","width",-384071477),"24px",new cljs.core.Keyword(null,"height","height",1025178622),"24px",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"bottom",new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),"3px",new cljs.core.Keyword(null,"bottom","bottom",-1550509018),"0"], null));
}
})).call(null,weathergen.ui.computing));
});
/**
 * Lays out controls for a control section. `controls` is a sequence
 *   of [label selector opts] tuples, where `opts` is a map with
 *   keys :extra, :type, :help-base, :help-paths, :cell, or :ui.
 */
weathergen.ui.control_layout = (function weathergen$ui$control_layout(controls){
var field = (function() { 
var G__49454__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__49454 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49455__i = 0, G__49455__a = new Array(arguments.length -  0);
while (G__49455__i < G__49455__a.length) {G__49455__a[G__49455__i] = arguments[G__49455__i + 0]; ++G__49455__i;}
  kids = new cljs.core.IndexedSeq(G__49455__a,0,null);
} 
return G__49454__delegate.call(this,kids);};
G__49454.cljs$lang$maxFixedArity = 0;
G__49454.cljs$lang$applyTo = (function (arglist__49456){
var kids = cljs.core.seq(arglist__49456);
return G__49454__delegate(kids);
});
G__49454.cljs$core$IFn$_invoke$arity$variadic = G__49454__delegate;
return G__49454;
})()
;
var field_help = ((function (field){
return (function() { 
var G__49457__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-help",kids);
};
var G__49457 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49458__i = 0, G__49458__a = new Array(arguments.length -  0);
while (G__49458__i < G__49458__a.length) {G__49458__a[G__49458__i] = arguments[G__49458__i + 0]; ++G__49458__i;}
  kids = new cljs.core.IndexedSeq(G__49458__a,0,null);
} 
return G__49457__delegate.call(this,kids);};
G__49457.cljs$lang$maxFixedArity = 0;
G__49457.cljs$lang$applyTo = (function (arglist__49459){
var kids = cljs.core.seq(arglist__49459);
return G__49457__delegate(kids);
});
G__49457.cljs$core$IFn$_invoke$arity$variadic = G__49457__delegate;
return G__49457;
})()
;})(field))
;
var field_input = ((function (field,field_help){
return (function() { 
var G__49460__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-input",kids);
};
var G__49460 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49461__i = 0, G__49461__a = new Array(arguments.length -  0);
while (G__49461__i < G__49461__a.length) {G__49461__a[G__49461__i] = arguments[G__49461__i + 0]; ++G__49461__i;}
  kids = new cljs.core.IndexedSeq(G__49461__a,0,null);
} 
return G__49460__delegate.call(this,kids);};
G__49460.cljs$lang$maxFixedArity = 0;
G__49460.cljs$lang$applyTo = (function (arglist__49462){
var kids = cljs.core.seq(arglist__49462);
return G__49460__delegate(kids);
});
G__49460.cljs$core$IFn$_invoke$arity$variadic = G__49460__delegate;
return G__49460;
})()
;})(field,field_help))
;
var field_label = ((function (field,field_help,field_input){
return (function() { 
var G__49463__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-label",kids);
};
var G__49463 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49464__i = 0, G__49464__a = new Array(arguments.length -  0);
while (G__49464__i < G__49464__a.length) {G__49464__a[G__49464__i] = arguments[G__49464__i + 0]; ++G__49464__i;}
  kids = new cljs.core.IndexedSeq(G__49464__a,0,null);
} 
return G__49463__delegate.call(this,kids);};
G__49463.cljs$lang$maxFixedArity = 0;
G__49463.cljs$lang$applyTo = (function (arglist__49465){
var kids = cljs.core.seq(arglist__49465);
return G__49463__delegate(kids);
});
G__49463.cljs$core$IFn$_invoke$arity$variadic = G__49463__delegate;
return G__49463;
})()
;})(field,field_help,field_input))
;
var iter__24200__auto__ = ((function (field,field_help,field_input,field_label){
return (function weathergen$ui$control_layout_$_iter__49430(s__49431){
return (new cljs.core.LazySeq(null,((function (field,field_help,field_input,field_label){
return (function (){
var s__49431__$1 = s__49431;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49431__$1);
if(temp__5278__auto__){
var s__49431__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49431__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49431__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49433 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49432 = (0);
while(true){
if((i__49432 < size__24199__auto__)){
var vec__49444 = cljs.core._nth.call(null,c__24198__auto__,i__49432);
var label = cljs.core.nth.call(null,vec__49444,(0),null);
var selector = cljs.core.nth.call(null,vec__49444,(1),null);
var map__49447 = cljs.core.nth.call(null,vec__49444,(2),null);
var map__49447__$1 = ((((!((map__49447 == null)))?((((map__49447.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49447.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49447):map__49447);
var opts = map__49447__$1;
var extra = cljs.core.get.call(null,map__49447__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__49447__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__49447__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__49447__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__49447__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__49447__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__23338__auto__ = cell;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
cljs.core.chunk_append.call(null,b__49433,field.call(null,field_label.call(null,weathergen.help.with_help.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__23338__auto__ = help_base;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__23338__auto__ = help_path;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__23338__auto__ = ui;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),type)){
return weathergen.ui.pressure_edit_field.call(null,cell__$1,selector,weathergen.ui.pressure_unit);
} else {
return weathergen.ui.edit_field.call(null,cell__$1,selector);
}
}
})(),(function (){var or__23338__auto__ = extra;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())));

var G__49466 = (i__49432 + (1));
i__49432 = G__49466;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49433),weathergen$ui$control_layout_$_iter__49430.call(null,cljs.core.chunk_rest.call(null,s__49431__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49433),null);
}
} else {
var vec__49449 = cljs.core.first.call(null,s__49431__$2);
var label = cljs.core.nth.call(null,vec__49449,(0),null);
var selector = cljs.core.nth.call(null,vec__49449,(1),null);
var map__49452 = cljs.core.nth.call(null,vec__49449,(2),null);
var map__49452__$1 = ((((!((map__49452 == null)))?((((map__49452.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49452.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49452):map__49452);
var opts = map__49452__$1;
var extra = cljs.core.get.call(null,map__49452__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__49452__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__49452__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__49452__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__49452__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__49452__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__23338__auto__ = cell;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
return cljs.core.cons.call(null,field.call(null,field_label.call(null,weathergen.help.with_help.call(null,cljs.core.into.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [(function (){var or__23338__auto__ = help_base;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__23338__auto__ = help_path;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__23338__auto__ = ui;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
if(cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),type)){
return weathergen.ui.pressure_edit_field.call(null,cell__$1,selector,weathergen.ui.pressure_unit);
} else {
return weathergen.ui.edit_field.call(null,cell__$1,selector);
}
}
})(),(function (){var or__23338__auto__ = extra;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())),weathergen$ui$control_layout_$_iter__49430.call(null,cljs.core.rest.call(null,s__49431__$2)));
}
} else {
return null;
}
break;
}
});})(field,field_help,field_input,field_label))
,null,null));
});})(field,field_help,field_input,field_label))
;
return iter__24200__auto__.call(null,controls);
});
weathergen.ui.weather_display_controls = (function weathergen$ui$weather_display_controls(p__49468){
var map__49473 = p__49468;
var map__49473__$1 = ((((!((map__49473 == null)))?((((map__49473.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49473.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49473):map__49473);
var prevent_map_change_QMARK_ = cljs.core.get.call(null,map__49473__$1,new cljs.core.Keyword(null,"prevent-map-change?","prevent-map-change?",1926330460));
var title = cljs.core.get.call(null,map__49473__$1,new cljs.core.Keyword(null,"title","title",636505583));
var field = ((function (map__49473,map__49473__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49477__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__49477 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49478__i = 0, G__49478__a = new Array(arguments.length -  0);
while (G__49478__i < G__49478__a.length) {G__49478__a[G__49478__i] = arguments[G__49478__i + 0]; ++G__49478__i;}
  kids = new cljs.core.IndexedSeq(G__49478__a,0,null);
} 
return G__49477__delegate.call(this,kids);};
G__49477.cljs$lang$maxFixedArity = 0;
G__49477.cljs$lang$applyTo = (function (arglist__49479){
var kids = cljs.core.seq(arglist__49479);
return G__49477__delegate(kids);
});
G__49477.cljs$core$IFn$_invoke$arity$variadic = G__49477__delegate;
return G__49477;
})()
;})(map__49473,map__49473__$1,prevent_map_change_QMARK_,title))
;
var field_help = ((function (field,map__49473,map__49473__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49480__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-help",kids);
};
var G__49480 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49481__i = 0, G__49481__a = new Array(arguments.length -  0);
while (G__49481__i < G__49481__a.length) {G__49481__a[G__49481__i] = arguments[G__49481__i + 0]; ++G__49481__i;}
  kids = new cljs.core.IndexedSeq(G__49481__a,0,null);
} 
return G__49480__delegate.call(this,kids);};
G__49480.cljs$lang$maxFixedArity = 0;
G__49480.cljs$lang$applyTo = (function (arglist__49482){
var kids = cljs.core.seq(arglist__49482);
return G__49480__delegate(kids);
});
G__49480.cljs$core$IFn$_invoke$arity$variadic = G__49480__delegate;
return G__49480;
})()
;})(field,map__49473,map__49473__$1,prevent_map_change_QMARK_,title))
;
var field_input = ((function (field,field_help,map__49473,map__49473__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49483__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-input",kids);
};
var G__49483 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__49484__i = 0, G__49484__a = new Array(arguments.length -  0);
while (G__49484__i < G__49484__a.length) {G__49484__a[G__49484__i] = arguments[G__49484__i + 0]; ++G__49484__i;}
  kids = new cljs.core.IndexedSeq(G__49484__a,0,null);
} 
return G__49483__delegate.call(this,kids);};
G__49483.cljs$lang$maxFixedArity = 0;
G__49483.cljs$lang$applyTo = (function (arglist__49485){
var kids = cljs.core.seq(arglist__49485);
return G__49483__delegate(kids);
});
G__49483.cljs$core$IFn$_invoke$arity$variadic = G__49483__delegate;
return G__49483;
})()
;})(field,field_help,map__49473,map__49473__$1,prevent_map_change_QMARK_,title))
;
var field_label = ((function (field,field_help,field_input,map__49473,map__49473__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__49486__delegate = function (help_path,kids){
return weathergen.help.with_help.call(null,help_path,cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field-elem field-label",kids));
};
var G__49486 = function (help_path,var_args){
var kids = null;
if (arguments.length > 1) {
var G__49487__i = 0, G__49487__a = new Array(arguments.length -  1);
while (G__49487__i < G__49487__a.length) {G__49487__a[G__49487__i] = arguments[G__49487__i + 1]; ++G__49487__i;}
  kids = new cljs.core.IndexedSeq(G__49487__a,0,null);
} 
return G__49486__delegate.call(this,help_path,kids);};
G__49486.cljs$lang$maxFixedArity = 1;
G__49486.cljs$lang$applyTo = (function (arglist__49488){
var help_path = cljs.core.first(arglist__49488);
var kids = cljs.core.rest(arglist__49488);
return G__49486__delegate(help_path,kids);
});
G__49486.cljs$core$IFn$_invoke$arity$variadic = G__49486__delegate;
return G__49486;
})()
;})(field,field_help,field_input,map__49473,map__49473__$1,prevent_map_change_QMARK_,title))
;
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),(function (){var or__23338__auto__ = title;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "Display Options";
}
})(),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-display-controls-section",weathergen.ui.control_layout.call(null,(function (){var opts = new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.display_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221)], null);
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Display",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"display","display",242065432)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"display","display",242065432)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1718410804),"None"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Weather Type",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"type","type",1174270348)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Pressure",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Temperature",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Overlay",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"overlay","overlay",-139131598)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"overlay","overlay",-139131598)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"label","label",1718410804),"None"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Wind",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Pressure",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Temperature",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"temperature","temperature",899018429)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Weather Type",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"type","type",1174270348)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Pressure",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243)], null)),new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"InHg",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"inhg","inhg",-863180091)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Millibar",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"mbar","mbar",-1396360988)], null)], null))], null))], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Opacity:",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"opacity","opacity",397153780)], null),cljs.core.merge.call(null,opts,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.input.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (opts,field,field_help,field_input,field_label,map__49473,map__49473__$1,prevent_map_change_QMARK_,title){
return (function (G__49475,G__49476){
return G__49475.call(null,(new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__49476) * (100)));
});})(opts,field,field_help,field_input,field_label,map__49473,map__49473__$1,prevent_map_change_QMARK_,title))
).call(null,cljs.core.long$,weathergen.ui.display_params),new cljs.core.Keyword(null,"input","input",556931961),((function (opts,field,field_help,field_input,field_label,map__49473,map__49473__$1,prevent_map_change_QMARK_,title){
return (function (p1__49467_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc,new cljs.core.Keyword(null,"opacity","opacity",397153780),(cljs.core.deref.call(null,p1__49467_SHARP_) / 100.0));
});})(opts,field,field_help,field_input,field_label,map__49473,map__49473__$1,prevent_map_change_QMARK_,title))
], null))], null))], null)], null);
})()));
});
weathergen.ui.weather_parameters = (function weathergen$ui$weather_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Weather parameters",new cljs.core.Keyword(null,"id","id",-1388402092),"weather-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49491,G__49492){
return G__49491.call(null,G__49492,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.ui.control_layout.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Seed",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seed","seed",68613327)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"seed","seed",68613327)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),"75px"], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.assoc,new cljs.core.Keyword(null,"seed","seed",68613327),(cljs.core.rand_int.call(null,(5000)) + (100)));
}),"Random"))], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min pressure",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max pressure",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Prevailing wind",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"prevailing-wind","prevailing-wind",-190580386),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Weather heading",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.movement_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"movement-params","movement-params",293385966)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Weather speed",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"direction","direction",-633359395),new cljs.core.Keyword(null,"speed","speed",1257663751)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"cell","cell",764245084),weathergen.ui.movement_params,new cljs.core.Keyword(null,"help-base","help-base",-1618186240),new cljs.core.Keyword(null,"movement-params","movement-params",293385966)], null)], null)], null)));
});
weathergen.ui.wind_stability_parameters = (function weathergen$ui$wind_stability_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204)], null),"Wind stability regions"),new cljs.core.Keyword(null,"id","id",-1388402092),"wind-stability-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49512,G__49513){
return G__49512.call(null,G__49513,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var indexed_wind_stability_areas = javelin.core.formula.call(null,(function (G__49516,G__49514,G__49515){
return G__49514.call(null,G__49515,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__49516));
})).call(null,weathergen.ui.weather_params,cljs.core.map_indexed,cljs.core.vector);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"wind-stability-boxes",hoplon.core.loop_tpl_STAR_.call(null,indexed_wind_stability_areas,((function (indexed_wind_stability_areas){
return (function (item__29802__auto__){
var vec__49523 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_wind_stability_areas){
return (function (p__49526){
var vec__49527 = p__49526;
var index = cljs.core.nth.call(null,vec__49527,(0),null);
var area = cljs.core.nth.call(null,vec__49527,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [index,area], null);
});})(indexed_wind_stability_areas))
).call(null,item__29802__auto__));
var index = cljs.core.nth.call(null,vec__49523,(0),null);
var area = cljs.core.nth.call(null,vec__49523,(1),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"wind-stability-params",hoplon.core.table.call(null,hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,"NW corner"),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"x","x",2099068185)], null))),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"y","y",-1757859776)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,"Width/height"),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"width","width",-384071477)], null))),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.Keyword(null,"height","height",1025178622)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,"Wind spd/hdg"),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"speed","speed",1257663751)], null))),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"heading","heading",-1312171873)], null)))))),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"title","title",636505583),"Remove",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49523,index,area,indexed_wind_stability_areas){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),((function (vec__49523,index,area,indexed_wind_stability_areas){
return (function (areas){
return weathergen.ui.remove_nth.call(null,areas,cljs.core.deref.call(null,index));
});})(vec__49523,index,area,indexed_wind_stability_areas))
);
});})(vec__49523,index,area,indexed_wind_stability_areas))
),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49523,index,area,indexed_wind_stability_areas){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null),cljs.core.not);
});})(vec__49523,index,area,indexed_wind_stability_areas))
,new cljs.core.Keyword(null,"title","title",636505583),"Edit",new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"height","height",1025178622),"16px",new cljs.core.Keyword(null,"latched?","latched?",2124907793),javelin.core.formula.call(null,((function (vec__49523,index,area,indexed_wind_stability_areas){
return (function (G__49530){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__49530);
});})(vec__49523,index,area,indexed_wind_stability_areas))
).call(null,area)),hoplon.core.hr.call(null));
});})(indexed_wind_stability_areas))
));
})(),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),(function (areas){
return cljs.core.conj.call(null,areas,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"bounds","bounds",1691609455),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"x","x",2099068185),(0),new cljs.core.Keyword(null,"y","y",-1757859776),(0),new cljs.core.Keyword(null,"width","width",-384071477),(10),new cljs.core.Keyword(null,"height","height",1025178622),(10)], null),new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"heading","heading",-1312171873),(45),new cljs.core.Keyword(null,"speed","speed",1257663751),(5)], null),new cljs.core.Keyword(null,"index","index",-1531685915),cljs.core.count.call(null,areas)], null));
}));
}),"Add New"));
});
weathergen.ui.weather_override_parameters = (function weathergen$ui$weather_override_parameters(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Weather override regions"),new cljs.core.Keyword(null,"id","id",-1388402092),"weather-override-params-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49577,G__49578){
return G__49577.call(null,G__49578,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var indexed_weather_overrides = javelin.core.formula.call(null,(function (weather_params){
return cljs.core.map_indexed.call(null,cljs.core.vector,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(weather_params));
})).call(null,weathergen.ui.weather_params);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-override-boxes",hoplon.core.loop_tpl_STAR_.call(null,indexed_weather_overrides,((function (indexed_weather_overrides){
return (function (item__29802__auto__){
var vec__49585 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_weather_overrides){
return (function (p__49588){
var vec__49589 = p__49588;
var index = cljs.core.nth.call(null,vec__49589,(0),null);
var override = cljs.core.nth.call(null,vec__49589,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [override,index], null);
});})(indexed_weather_overrides))
).call(null,item__29802__auto__));
var override = cljs.core.nth.call(null,vec__49585,(0),null);
var index = cljs.core.nth.call(null,vec__49585,(1),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"weather-overrides",hoplon.core.table.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"weather-override-params",(function (){var checkbox = ((function (vec__49585,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_checkbox(l,k,p__49592){
var map__49597 = p__49592;
var map__49597__$1 = ((((!((map__49597 == null)))?((((map__49597.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__49597.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__49597):map__49597);
var change = cljs.core.get.call(null,map__49597__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var row_attrs = cljs.core.get.call(null,map__49597__$1,new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863));
return hoplon.core.tr.call(null,(function (){var or__23338__auto__ = row_attrs;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})(),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),hoplon.core.input.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"width","width",-384071477),"25px"], null),new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (map__49597,map__49597__$1,change,row_attrs,vec__49585,override,index,indexed_weather_overrides){
return (function (G__49600,G__49599){
return G__49599.call(null,G__49600);
});})(map__49597,map__49597__$1,change,row_attrs,vec__49585,override,index,indexed_weather_overrides))
).call(null,override,k),new cljs.core.Keyword(null,"change","change",-1163046502),(function (){var or__23338__auto__ = change;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return ((function (or__23338__auto__,map__49597,map__49597__$1,change,row_attrs,vec__49585,override,index,indexed_weather_overrides){
return (function (___$1){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null),cljs.core.not);
});
;})(or__23338__auto__,map__49597,map__49597__$1,change,row_attrs,vec__49585,override,index,indexed_weather_overrides))
}
})()),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),hoplon.core.label.call(null,l))));
});})(vec__49585,override,index,indexed_weather_overrides))
;
return hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"center","center",-748944368)], null),"Center X/Y")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"x","x",2099068185)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"input-attrs","input-attrs",-38113667),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null)], null)], null)),weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"location","location",1815599388),new cljs.core.Keyword(null,"y","y",-1757859776)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"radius","radius",-2073122258)], null),"Radius")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"radius","radius",-2073122258)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null),"Falloff")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"falloff","falloff",-1639069456)], null)))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Pressure")),hoplon.core.td.call(null,weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit))),hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"override-label",weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),new cljs.core.Keyword(null,"strength","strength",-415606478)], null),"Strength")),hoplon.core.td.call(null,weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"strength","strength",-415606478)], null)))),checkbox.call(null,"Show outline?",new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348),cljs.core.PersistentArrayMap.EMPTY),checkbox.call(null,"Fade in/out?",new cljs.core.Keyword(null,"animate?","animate?",-1559039739),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"change","change",-1163046502),((function (checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (___$1){
return javelin.core.dosync_STAR_.call(null,((function (checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (){
cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"animate?","animate?",-1559039739)], null),cljs.core.not);

return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,((function (checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (weather_params){
if(cljs.core.truth_(cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"animate?","animate?",-1559039739)], null)))){
return weather_params;
} else {
return cljs.core.assoc_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640)], null),false);
}
});})(checkbox,vec__49585,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__49585,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__49585,override,index,indexed_weather_overrides))
], null)),(function (){var iter__24200__auto__ = ((function (checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_iter__49601(s__49602){
return (new cljs.core.LazySeq(null,((function (checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (){
var s__49602__$1 = s__49602;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49602__$1);
if(temp__5278__auto__){
var s__49602__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49602__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49602__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49604 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49603 = (0);
while(true){
if((i__49603 < size__24199__auto__)){
var vec__49613 = cljs.core._nth.call(null,c__24198__auto__,i__49603);
var label = cljs.core.nth.call(null,vec__49613,(0),null);
var k = cljs.core.nth.call(null,vec__49613,(1),null);
cljs.core.chunk_append.call(null,b__49604,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (i__49603,vec__49613,label,k,c__24198__auto__,size__24199__auto__,b__49604,s__49602__$2,temp__5278__auto__,checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (G__49616){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__49616);
});})(i__49603,vec__49613,label,k,c__24198__auto__,size__24199__auto__,b__49604,s__49602__$2,temp__5278__auto__,checkbox,vec__49585,override,index,indexed_weather_overrides))
).call(null,override),hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),label)),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null)))));

var G__49623 = (i__49603 + (1));
i__49603 = G__49623;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49604),weathergen$ui$weather_override_parameters_$_iter__49601.call(null,cljs.core.chunk_rest.call(null,s__49602__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49604),null);
}
} else {
var vec__49617 = cljs.core.first.call(null,s__49602__$2);
var label = cljs.core.nth.call(null,vec__49617,(0),null);
var k = cljs.core.nth.call(null,vec__49617,(1),null);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__49617,label,k,s__49602__$2,temp__5278__auto__,checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (G__49620){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__49620);
});})(vec__49617,label,k,s__49602__$2,temp__5278__auto__,checkbox,vec__49585,override,index,indexed_weather_overrides))
).call(null,override),hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),k], null),label)),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),k], null)))),weathergen$ui$weather_override_parameters_$_iter__49601.call(null,cljs.core.rest.call(null,s__49602__$2)));
}
} else {
return null;
}
break;
}
});})(checkbox,vec__49585,override,index,indexed_weather_overrides))
,null,null));
});})(checkbox,vec__49585,override,index,indexed_weather_overrides))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Begin",new cljs.core.Keyword(null,"begin","begin",-319034319)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Peak",new cljs.core.Keyword(null,"peak","peak",389096055)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Taper",new cljs.core.Keyword(null,"taper","taper",1772067478)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["End",new cljs.core.Keyword(null,"end","end",-268185958)], null)], null));
})(),checkbox.call(null,"Exclude from forecast?",new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (checkbox,vec__49585,override,index,indexed_weather_overrides){
return (function (G__49621){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__49621);
});})(checkbox,vec__49585,override,index,indexed_weather_overrides))
).call(null,override)], null)], null)));
})()),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"images/trash.png",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"title","title",636505583),"Remove",new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49585,override,index,indexed_weather_overrides){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (vec__49585,override,index,indexed_weather_overrides){
return (function (overrides){
return weathergen.ui.remove_nth.call(null,overrides,cljs.core.deref.call(null,index));
});})(vec__49585,override,index,indexed_weather_overrides))
);
});})(vec__49585,override,index,indexed_weather_overrides))
),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__49585,override,index,indexed_weather_overrides){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,cljs.core.update_in,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),cljs.core.deref.call(null,index),new cljs.core.Keyword(null,"editing?","editing?",1646440800)], null),cljs.core.not);
});})(vec__49585,override,index,indexed_weather_overrides))
,new cljs.core.Keyword(null,"title","title",636505583),"Edit",new cljs.core.Keyword(null,"src","src",-1651076051),"images/move.svg",new cljs.core.Keyword(null,"width","width",-384071477),"16px",new cljs.core.Keyword(null,"height","height",1025178622),"16px",new cljs.core.Keyword(null,"latched","latched",657080362),javelin.core.formula.call(null,((function (vec__49585,override,index,indexed_weather_overrides){
return (function (G__49622){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__49622);
});})(vec__49585,override,index,indexed_weather_overrides))
).call(null,override)));
});})(indexed_weather_overrides))
));
})(),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.weather_params,(function (wp){
return cljs.core.update.call(null,wp,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),(function (overrides){
return cljs.core.conj.call(null,overrides,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348),new cljs.core.Keyword(null,"radius","radius",-2073122258),new cljs.core.Keyword(null,"falloff","falloff",-1639069456),new cljs.core.Keyword(null,"begin","begin",-319034319),new cljs.core.Keyword(null,"strength","strength",-415606478),new cljs.core.Keyword(null,"taper","taper",1772067478),new cljs.core.Keyword(null,"peak","peak",389096055),new cljs.core.Keyword(null,"exclude-from-forecast?","exclude-from-forecast?",1182671640),new cljs.core.Keyword(null,"end","end",-268185958),new cljs.core.Keyword(null,"location","location",1815599388)],[new cljs.core.Keyword(null,"min","min",444991522).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"pressure","pressure",505343747).cljs$core$IFn$_invoke$arity$1(wp)),true,(8),(2),new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(1),weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(180)),weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(60)),false,weathergen.time.add_minutes.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(wp)),(240)),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"x","x",2099068185),(30),new cljs.core.Keyword(null,"y","y",-1757859776),(30)], null)]));
}));
}));
}),"Add New"));
});
weathergen.ui.weather_type_configuration = (function weathergen$ui$weather_type_configuration(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Weather type configuration",new cljs.core.Keyword(null,"id","id",-1388402092),"weather-type-configuration-section",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49679,G__49680){
return G__49679.call(null,G__49680,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),hoplon.core.table.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"category-params",hoplon.core.thead.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,""),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(2),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),"Pressure")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(3),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"wind","wind",-527553074)], null),"Wind")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"colspan","colspan",-1512420934),(3),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-type-config","weather-type-config",-2069342501),new cljs.core.Keyword(null,"temp","temp",1791541284)], null),"Temperature"))),hoplon.core.tr.call(null,cljs.core.map.call(null,(function (p1__49624_SHARP_){
return cljs.core.apply.call(null,hoplon.core.td,p1__49624_SHARP_);
}),new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [""], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["From"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["To"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Mean"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Min"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Mean"], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Max"], null)], null)))),hoplon.core.tbody.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$weather_type_configuration_$_iter__49681(s__49682){
return (new cljs.core.LazySeq(null,(function (){
var s__49682__$1 = s__49682;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49682__$1);
if(temp__5278__auto__){
var s__49682__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49682__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49682__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49684 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49683 = (0);
while(true){
if((i__49683 < size__24199__auto__)){
var category = cljs.core._nth.call(null,c__24198__auto__,i__49683);
cljs.core.chunk_append.call(null,b__49684,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, ["background-color",(function (){var vec__49709 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49709,(0),null);
var g = cljs.core.nth.call(null,vec__49709,(1),null);
var b = cljs.core.nth.call(null,vec__49709,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var pred__49712 = cljs.core.contains_QMARK_;
var expr__49713 = category;
if(cljs.core.truth_(pred__49712.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null], null), null),expr__49713))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null)),pressure_unit);
});})(i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit))], null);
} else {
if(cljs.core.truth_(pred__49712.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null),expr__49713))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),category))?new cljs.core.Keyword(null,"poor","poor",1462482211):new cljs.core.Keyword(null,"inclement","inclement",-550669382)),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
if(cljs.core.truth_(pred__49712.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null),expr__49713))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null)),pressure_unit);
});})(i__49683,pred__49712,expr__49713,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__49713)].join('')));
}
}
}
})(),(function (){var iter__24200__auto__ = ((function (i__49683,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49715(s__49716){
return (new cljs.core.LazySeq(null,((function (i__49683,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function (){
var s__49716__$1 = s__49716;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49716__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var param = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__49716__$1,i__49683,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49715_$_iter__49717(s__49718){
return (new cljs.core.LazySeq(null,((function (s__49716__$1,i__49683,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__){
return (function (){
var s__49718__$1 = s__49718;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__49718__$1);
if(temp__5278__auto____$2){
var s__49718__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49718__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__49718__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__49720 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__49719 = (0);
while(true){
if((i__49719 < size__24199__auto____$1)){
var metric = cljs.core._nth.call(null,c__24198__auto____$1,i__49719);
cljs.core.chunk_append.call(null,b__49720,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))));

var G__49733 = (i__49719 + (1));
i__49719 = G__49733;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49720),weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49715_$_iter__49717.call(null,cljs.core.chunk_rest.call(null,s__49718__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49720),null);
}
} else {
var metric = cljs.core.first.call(null,s__49718__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))),weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49715_$_iter__49717.call(null,cljs.core.rest.call(null,s__49718__$2)));
}
} else {
return null;
}
break;
}
});})(s__49716__$1,i__49683,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
,null,null));
});})(s__49716__$1,i__49683,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"min","min",444991522),new cljs.core.Keyword(null,"mean","mean",-1359234715),new cljs.core.Keyword(null,"max","max",61366548)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49715.call(null,cljs.core.rest.call(null,s__49716__$1)));
} else {
var G__49734 = cljs.core.rest.call(null,s__49716__$1);
s__49716__$1 = G__49734;
continue;
}
} else {
return null;
}
break;
}
});})(i__49683,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
,null,null));
});})(i__49683,category,c__24198__auto__,size__24199__auto__,b__49684,s__49682__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"temp","temp",1791541284)], null));
})()));

var G__49735 = (i__49683 + (1));
i__49683 = G__49735;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49684),weathergen$ui$weather_type_configuration_$_iter__49681.call(null,cljs.core.chunk_rest.call(null,s__49682__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49684),null);
}
} else {
var category = cljs.core.first.call(null,s__49682__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, ["background-color",(function (){var vec__49721 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49721,(0),null);
var g = cljs.core.nth.call(null,vec__49721,(1),null);
var b = cljs.core.nth.call(null,vec__49721,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var pred__49724 = cljs.core.contains_QMARK_;
var expr__49725 = category;
if(cljs.core.truth_(pred__49724.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null], null), null),expr__49725))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"max","max",61366548)], null)),pressure_unit);
});})(pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit))], null);
} else {
if(cljs.core.truth_(pred__49724.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null),expr__49725))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),category))?new cljs.core.Keyword(null,"poor","poor",1462482211):new cljs.core.Keyword(null,"inclement","inclement",-550669382)),new cljs.core.Keyword(null,"pressure","pressure",505343747)], null)),pressure_unit);
});})(pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
if(cljs.core.truth_(pred__49724.call(null,new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null),expr__49725))){
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"derived",javelin.core.formula.call(null,((function (pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__){
return (function (weather_params,pressure_unit){
return weathergen.ui.format_pressure.call(null,cljs.core.get_in.call(null,weather_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pressure","pressure",505343747),new cljs.core.Keyword(null,"min","min",444991522)], null)),pressure_unit);
});})(pred__49724,expr__49725,category,s__49682__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit)),hoplon.core.td.call(null,hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.pressure_edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,new cljs.core.Keyword(null,"pressure","pressure",505343747)], null),weathergen.ui.pressure_unit)))], null);
} else {
throw (new Error([cljs.core.str.cljs$core$IFn$_invoke$arity$1("No matching clause: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(expr__49725)].join('')));
}
}
}
})(),(function (){var iter__24200__auto__ = ((function (category,s__49682__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49727(s__49728){
return (new cljs.core.LazySeq(null,((function (category,s__49682__$2,temp__5278__auto__){
return (function (){
var s__49728__$1 = s__49728;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49728__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var param = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24196__auto__ = ((function (s__49728__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49682__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49727_$_iter__49729(s__49730){
return (new cljs.core.LazySeq(null,((function (s__49728__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49682__$2,temp__5278__auto__){
return (function (){
var s__49730__$1 = s__49730;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__49730__$1);
if(temp__5278__auto____$2){
var s__49730__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49730__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49730__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49732 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49731 = (0);
while(true){
if((i__49731 < size__24199__auto__)){
var metric = cljs.core._nth.call(null,c__24198__auto__,i__49731);
cljs.core.chunk_append.call(null,b__49732,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))));

var G__49736 = (i__49731 + (1));
i__49731 = G__49736;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49732),weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49727_$_iter__49729.call(null,cljs.core.chunk_rest.call(null,s__49730__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49732),null);
}
} else {
var metric = cljs.core.first.call(null,s__49730__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,param)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,metric))].join(''),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"edit-field",weathergen.ui.edit_field.call(null,weathergen.ui.weather_params,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"categories","categories",178386610),category,param,metric], null)))),weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49727_$_iter__49729.call(null,cljs.core.rest.call(null,s__49730__$2)));
}
} else {
return null;
}
break;
}
});})(s__49728__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49682__$2,temp__5278__auto__))
,null,null));
});})(s__49728__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__49682__$2,temp__5278__auto__))
;
var fs__24197__auto__ = cljs.core.seq.call(null,iterys__24196__auto__.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"min","min",444991522),new cljs.core.Keyword(null,"mean","mean",-1359234715),new cljs.core.Keyword(null,"max","max",61366548)], null)));
if(fs__24197__auto__){
return cljs.core.concat.call(null,fs__24197__auto__,weathergen$ui$weather_type_configuration_$_iter__49681_$_iter__49727.call(null,cljs.core.rest.call(null,s__49728__$1)));
} else {
var G__49737 = cljs.core.rest.call(null,s__49728__$1);
s__49728__$1 = G__49737;
continue;
}
} else {
return null;
}
break;
}
});})(category,s__49682__$2,temp__5278__auto__))
,null,null));
});})(category,s__49682__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind","wind",-527553074),new cljs.core.Keyword(null,"temp","temp",1791541284)], null));
})()),weathergen$ui$weather_type_configuration_$_iter__49681.call(null,cljs.core.rest.call(null,s__49682__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})())));
});
if(typeof weathergen.ui.cloud_param_conformer !== 'undefined'){
} else {
weathergen.ui.cloud_param_conformer = (function (){var method_table__24369__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24370__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24371__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24372__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24373__auto__ = cljs.core.get.call(null,cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"hierarchy","hierarchy",-1053470341),cljs.core.get_global_hierarchy.call(null));
return (new cljs.core.MultiFn(cljs.core.symbol.call(null,"weathergen.ui","cloud-param-conformer"),((function (method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__){
return (function (params,column,category){
return column;
});})(method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__,hierarchy__24373__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24373__auto__,method_table__24369__auto__,prefer_table__24370__auto__,method_cache__24371__auto__,cached_hierarchy__24372__auto__));
})();
}
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"default","default",-1987822328),(function (params,column,category){
return weathergen.ui.int_conformer.call(null,(0),(99999));
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"visibility","visibility",1338380893),(function (params,column,category){
return weathergen.ui.float_conformer.call(null,(0),(30));
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),(function (params,column,category){
return (function (val_c){
var conformer = weathergen.ui.int_conformer.call(null,(0),(99999));
var conformed = conformer.call(null,val_c);
return javelin.core.formula.call(null,((function (conformer,conformed){
return (function (params__$1,conformed__$1){
var stratus_top = new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(params__$1);
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(cljs.core.truth_((function (){var and__23326__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null).call(null,category);
if(cljs.core.truth_(and__23326__auto__)){
return (stratus_top < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1));
} else {
return and__23326__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Stratus base must be below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(conformer,conformed))
).call(null,params,conformed);
});
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),(function (params,column,category){
return (function (val_c){
var ic = weathergen.ui.int_conformer.call(null,(0),(99999));
var conformed = ic.call(null,val_c);
return javelin.core.formula.call(null,((function (ic,conformed){
return (function (params__$1,conformed__$1){
var stratus_base = (function (){var x__23676__auto__ = cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"poor","poor",1462482211)], null));
var y__23677__auto__ = cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
return ((x__23676__auto__ > y__23677__auto__) ? x__23676__auto__ : y__23677__auto__);
})();
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(cljs.core.truth_((function (){var and__23326__auto__ = new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"poor","poor",1462482211),null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),null], null), null).call(null,category);
if(cljs.core.truth_(and__23326__auto__)){
return (new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1) < stratus_base);
} else {
return and__23326__auto__;
}
})())){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Stratus base must be below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(ic,conformed))
).call(null,params,conformed);
});
}));
cljs.core._add_method.call(null,weathergen.ui.cloud_param_conformer,new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),(function (params,column,category){
return (function (val_c){
var ic = weathergen.ui.int_conformer.call(null,(0),(99999));
var conformed = ic.call(null,val_c);
return javelin.core.formula.call(null,((function (ic,conformed){
return (function (params__$1,conformed__$1){
var stratus_top = (cljs.core.truth_(new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category))?cljs.core.get_in.call(null,params__$1,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null)):new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(params__$1));
if(cljs.core.not.call(null,new cljs.core.Keyword(null,"valid?","valid?",-212412379).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return conformed__$1;
} else {
if(((stratus_top - (1000)) < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1))){
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),false,new cljs.core.Keyword(null,"message","message",-406056002),"Cumulus base must be at least 1000 feet below stratus top.",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1)], null);
} else {
return conformed__$1;

}
}
});})(ic,conformed))
).call(null,params,conformed);
});
}));
weathergen.ui.cloud_controls = (function weathergen$ui$cloud_controls(opts){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Clouds and contrails"),new cljs.core.Keyword(null,"id","id",-1388402092),cljs.core.gensym.call(null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49861,G__49862){
return G__49861.call(null,G__49862,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"buttons","buttons",-1953831197)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.cloud_params,weathergen.ui.random_cloud_params.call(null));
}),"Randomize"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return weathergen.ui.save_twx.call(null,cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)));
}),"Save .TWX")),hoplon.core.table.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"cumulus-coverage","cumulus-coverage",255977312)], null),"Cumulus coverage")),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),"5%"),(function (){var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-density","cumulus-density",-212067170)], null));
return hoplon.core.td.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"disabled","disabled",-1529784218),javelin.core.formula.call(null,((function (l){
return (function (G__49863,G__49864){
return G__49863.call(null,G__49864,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(l))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"value","value",305978217),l,new cljs.core.Keyword(null,"min","min",444991522),(5),new cljs.core.Keyword(null,"max","max",61366548),(50),new cljs.core.Keyword(null,"change","change",-1163046502),((function (l){
return (function (p1__49738_SHARP_){
return cljs.core.reset_BANG_.call(null,l,cljs.core.long$.call(null,cljs.core.deref.call(null,p1__49738_SHARP_)));
});})(l))
));
})(),hoplon.core.td.call(null,"50%")),hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270)], null),"Cumulus qty/size")),hoplon.core.td.call(null,hoplon.core.div.call(null,"Fewer/",hoplon.core.br.call(null),"Larger")),(function (){var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-size","cumulus-size",-954219270)], null));
return hoplon.core.td.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"disabled","disabled",-1529784218),javelin.core.formula.call(null,((function (l){
return (function (G__49865,G__49866){
return G__49865.call(null,G__49866,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(l))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (l){
return (function (G__49867,G__49868){
return G__49867.call(null,(G__49868 * (20)));
});})(l))
).call(null,cljs.core.long$,l),new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),(100),new cljs.core.Keyword(null,"change","change",-1163046502),((function (l){
return (function (p1__49739_SHARP_){
return cljs.core.reset_BANG_.call(null,l,(cljs.core.long$.call(null,cljs.core.deref.call(null,p1__49739_SHARP_)) / 20.0));
});})(l))
));
})(),hoplon.core.td.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),hoplon.core.div.call(null,"More/",hoplon.core.br.call(null),"Smaller")))),hoplon.core.table.call(null,hoplon.core.thead.call(null,(function (){var header = (function (path,words){
return hoplon.core.td.call(null,cljs.core.map.call(null,(function (p1__49740_SHARP_){
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,path,p1__49740_SHARP_));
}),words));
});
return hoplon.core.tr.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.td.call(null),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"visibility","visibility",1338380893)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Visibility"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Stratus","Base"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Stratus","Top"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Cumulus","Base"], null)),header.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"clouds","clouds",-632461223),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Contrails"], null)));
})()),hoplon.core.tbody.call(null,(function (){var iter__24200__auto__ = (function weathergen$ui$cloud_controls_$_iter__49869(s__49870){
return (new cljs.core.LazySeq(null,(function (){
var s__49870__$1 = s__49870;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__49870__$1);
if(temp__5278__auto__){
var s__49870__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49870__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49870__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49872 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49871 = (0);
while(true){
if((i__49871 < size__24199__auto__)){
var category = cljs.core._nth.call(null,c__24198__auto__,i__49871);
cljs.core.chunk_append.call(null,b__49872,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__49927 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49927,(0),null);
var g = cljs.core.nth.call(null,vec__49927,(1),null);
var b = cljs.core.nth.call(null,vec__49927,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__24200__auto__ = ((function (i__49871,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function weathergen$ui$cloud_controls_$_iter__49869_$_iter__49930(s__49931){
return (new cljs.core.LazySeq(null,((function (i__49871,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (){
var s__49931__$1 = s__49931;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49931__$1);
if(temp__5278__auto____$1){
var s__49931__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49931__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__49931__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__49933 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__49932 = (0);
while(true){
if((i__49932 < size__24199__auto____$1)){
var column = cljs.core._nth.call(null,c__24198__auto____$1,i__49932);
cljs.core.chunk_append.call(null,b__49933,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49932,i__49871,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(i__49932,i__49871,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49932,i__49871,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(i__49932,i__49871,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (i__49932,i__49871,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (i__49932,i__49871,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(i__49932,i__49871,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,l));
});})(i__49932,i__49871,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (i__49932,i__49871,con__29828__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49944 = cljs.core._EQ_;
var expr__49945 = column;
if(cljs.core.truth_(pred__49944.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49945))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(i__49932,i__49871,con__29828__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
,null));
var tpl__29830__auto__ = ((function (i__49932,i__49871,con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__49932,i__49871,con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (i__49932,i__49871,con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (G__49947,G__49948){
return G__49947.call(null,G__49948,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__49932,i__49871,con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,c__24198__auto____$1,size__24199__auto____$1,b__49933,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()));

var G__49981 = (i__49932 + (1));
i__49932 = G__49981;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49933),weathergen$ui$cloud_controls_$_iter__49869_$_iter__49930.call(null,cljs.core.chunk_rest.call(null,s__49931__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49933),null);
}
} else {
var column = cljs.core.first.call(null,s__49931__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49871,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(i__49871,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49871,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(i__49871,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (i__49871,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (i__49871,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(i__49871,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,l));
});})(i__49871,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (i__49871,con__29828__auto__,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49949 = cljs.core._EQ_;
var expr__49950 = column;
if(cljs.core.truth_(pred__49949.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49950))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(i__49871,con__29828__auto__,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
,null));
var tpl__29830__auto__ = ((function (i__49871,con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__49871,con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (i__49871,con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__){
return (function (G__49952,G__49953){
return G__49952.call(null,G__49953,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__49871,con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,s__49931__$2,temp__5278__auto____$1,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()),weathergen$ui$cloud_controls_$_iter__49869_$_iter__49930.call(null,cljs.core.rest.call(null,s__49931__$2)));
}
} else {
return null;
}
break;
}
});})(i__49871,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
,null,null));
});})(i__49871,category,c__24198__auto__,size__24199__auto__,b__49872,s__49870__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null));
})()));

var G__49982 = (i__49871 + (1));
i__49871 = G__49982;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49872),weathergen$ui$cloud_controls_$_iter__49869.call(null,cljs.core.chunk_rest.call(null,s__49870__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49872),null);
}
} else {
var category = cljs.core.first.call(null,s__49870__$2);
return cljs.core.cons.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),[cljs.core.str.cljs$core$IFn$_invoke$arity$1("weather-type "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,category))].join(''),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background-color","background-color",570434026),(function (){var vec__49954 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__49954,(0),null);
var g = cljs.core.nth.call(null,vec__49954,(1),null);
var b = cljs.core.nth.call(null,vec__49954,(2),null);
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgb("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})()], null),weathergen.ui.type_key__GT_name.call(null,category)),(function (){var iter__24200__auto__ = ((function (category,s__49870__$2,temp__5278__auto__){
return (function weathergen$ui$cloud_controls_$_iter__49869_$_iter__49957(s__49958){
return (new cljs.core.LazySeq(null,((function (category,s__49870__$2,temp__5278__auto__){
return (function (){
var s__49958__$1 = s__49958;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__49958__$1);
if(temp__5278__auto____$1){
var s__49958__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__49958__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__49958__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__49960 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__49959 = (0);
while(true){
if((i__49959 < size__24199__auto__)){
var column = cljs.core._nth.call(null,c__24198__auto__,i__49959);
cljs.core.chunk_append.call(null,b__49960,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49959,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(i__49959,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__49959,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(i__49959,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (i__49959,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (i__49959,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(i__49959,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,l));
});})(i__49959,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (i__49959,con__29828__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49971 = cljs.core._EQ_;
var expr__49972 = column;
if(cljs.core.truth_(pred__49971.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49972))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(i__49959,con__29828__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
,null));
var tpl__29830__auto__ = ((function (i__49959,con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__49959,con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (i__49959,con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (G__49974,G__49975){
return G__49974.call(null,G__49975,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__49959,con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,c__24198__auto__,size__24199__auto__,b__49960,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()));

var G__49983 = (i__49959 + (1));
i__49959 = G__49983;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49960),weathergen$ui$cloud_controls_$_iter__49869_$_iter__49957.call(null,cljs.core.chunk_rest.call(null,s__49958__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__49960),null);
}
} else {
var column = cljs.core.first.call(null,s__49958__$2);
return cljs.core.cons.call(null,hoplon.core.td.call(null,(function (){var path = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null);
var literal_style = new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"3px",new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),"2px",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"93%",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null);
if(cljs.core.truth_((function (){var and__23326__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23326__auto__){
return new cljs.core.PersistentHashSet(null, new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),null,new cljs.core.Keyword(null,"fair","fair",1684139423),null], null), null).call(null,category);
} else {
return and__23326__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return cljs.core.get_in.call(null,cloud_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),category], null));
});})(path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"sunny","sunny",1448267778)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [column,category], null))){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,"0");
} else {
if(cljs.core._EQ_.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null),path)){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (cloud_params){
return new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574).cljs$core$IFn$_invoke$arity$1(cloud_params);
});})(path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,weathergen.ui.cloud_params));
} else {
var l = weathergen.ui.common.path_lens.call(null,weathergen.ui.cloud_params,((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)))?new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574)], null):path));
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"right"], null),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.assoc.call(null,literal_style,new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.common.px.call(null,(35)):weathergen.ui.common.px.call(null,(55)))),javelin.core.formula.call(null,((function (l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (l__$1){
if(cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893))){
return weathergen.ui.format_visibility.call(null,l__$1);
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(l__$1)].join('');
}
});})(l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,l));
});})(l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (){
return weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"source","source",-433931539),l,new cljs.core.Keyword(null,"fmt","fmt",332300772),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?weathergen.ui.format_visibility:cljs.core.str),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.cloud_param_conformer.call(null,weathergen.ui.cloud_params,column,category),new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),(function (){var pred__49976 = cljs.core._EQ_;
var expr__49977 = column;
if(cljs.core.truth_(pred__49976.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__49977))){
return "vis (nm)";
} else {
return "altitude";
}
})(),new cljs.core.Keyword(null,"align","align",1964212802),"right",new cljs.core.Keyword(null,"width","width",-384071477),((cljs.core._EQ_.call(null,column,new cljs.core.Keyword(null,"visibility","visibility",1338380893)))?(35):(55)));
});})(con__29828__auto__,l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__){
return (function (G__49979,G__49980){
return G__49979.call(null,G__49980,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,l,path,literal_style,column,s__49958__$2,temp__5278__auto____$1,category,s__49870__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()),weathergen$ui$cloud_controls_$_iter__49869_$_iter__49957.call(null,cljs.core.rest.call(null,s__49958__$2)));
}
} else {
return null;
}
break;
}
});})(category,s__49870__$2,temp__5278__auto__))
,null,null));
});})(category,s__49870__$2,temp__5278__auto__))
;
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"visibility","visibility",1338380893),new cljs.core.Keyword(null,"stratus-base","stratus-base",-1631962478),new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),new cljs.core.Keyword(null,"cumulus-base","cumulus-base",-578210868),new cljs.core.Keyword(null,"contrails","contrails",1430581743)], null));
})()),weathergen$ui$cloud_controls_$_iter__49869.call(null,cljs.core.rest.call(null,s__49870__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"sunny","sunny",1448267778),new cljs.core.Keyword(null,"fair","fair",1684139423),new cljs.core.Keyword(null,"poor","poor",1462482211),new cljs.core.Keyword(null,"inclement","inclement",-550669382)], null));
})())));
});
weathergen.ui.advanced_controls = (function weathergen$ui$advanced_controls(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"advanced-params-section",new cljs.core.Keyword(null,"title","title",636505583),"Advanced configuration",new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__49986,G__49987){
return G__49986.call(null,G__49987,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),weathergen.ui.control_layout.call(null,new cljs.core.PersistentVector(null, 9, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["X Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),(0)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"help-path","help-path",840478713),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"x","x",2099068185)], null)], null)], null),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Y Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),(1)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"help-path","help-path",840478713),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"origin","origin",1037372088),new cljs.core.Keyword(null,"y","y",-1757859776)], null)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["T Offset",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"offset","offset",296498311)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Evolution",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"evolution","evolution",944820557)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Wind uniformity",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"wind-uniformity","wind-uniformity",827531801)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Temp uniformity",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"temp-uniformity","temp-uniformity",836756864)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Warp strength",new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"turbulence","turbulence",-915506410),new cljs.core.Keyword(null,"power","power",-937852079)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Crossfade",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"crossfade","crossfade",-118506406)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Zoom",new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"feature-size","feature-size",-878734864)], null)], null)], null)));
});
weathergen.ui.step_controls = (function weathergen$ui$step_controls(_){
var mission_time = javelin.core.formula.call(null,(function (G__50003,G__50004){
return G__50003.call(null,G__50004);
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission);
var max_time = javelin.core.formula.call(null,((function (mission_time){
return (function (G__50006,G__50005){
return G__50005.call(null,new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(G__50006)));
});})(mission_time))
).call(null,weathergen.ui.weather_params,weathergen.time.campaign_time__GT_minutes);
var weather_time = javelin.core.formula.call(null,((function (mission_time,max_time){
return (function (G__50008,G__50007){
return G__50007.call(null,new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(G__50008)));
});})(mission_time,max_time))
).call(null,weathergen.ui.weather_params,weathergen.time.campaign_time__GT_minutes);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"time-location-params",new cljs.core.Keyword(null,"title","title",636505583),"Time controls",hoplon.core.table.call(null,hoplon.core.tbody.call(null,hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"falcon-time","falcon-time",34959931)], null),"Falcon time: ")),hoplon.core.td.call(null,javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__50010,G__50009){
return G__50009.call(null,G__50010);
});})(mission_time,max_time,weather_time))
).call(null,mission_time,weathergen.ui.common.format_time)),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.jump_to_time_STAR_.call(null,cljs.core.deref.call(null,mission_time));
});})(mission_time,max_time,weather_time))
,"Jump to"))),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (mission_time,max_time,weather_time){
return (function (){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"browse-time","browse-time",832671504)], null),"Time")),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.weather_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)], null))));
});})(mission_time,max_time,weather_time))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,mission_time,max_time,weather_time){
return (function (){
return hoplon.core.tr.call(null,hoplon.core.td.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed-time","displayed-time",141846012)], null),"Time")),hoplon.core.td.call(null,weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.time_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"displayed","displayed",-436192586)], null))),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.jump_to_time,"Jump to"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (con__29828__auto__,mission_time,max_time,weather_time){
return (function (G__50011,G__50012){
return G__50011.call(null,G__50012,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(con__29828__auto__,mission_time,max_time,weather_time))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.set_time,"Set to")));
});})(con__29828__auto__,mission_time,max_time,weather_time))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,mission_time,max_time,weather_time){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,mission_time,max_time,weather_time))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,mission_time,max_time,weather_time){
return (function (G__50013,G__50014){
return G__50013.call(null,G__50014,new cljs.core.Keyword(null,"browse","browse",2070502601));
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,mission_time,max_time,weather_time))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})(),hoplon.core.tr.call(null,cljs.core.map.call(null,hoplon.core.td,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"step","step",1288888124)], null),"Step interval"),weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(50),new cljs.core.Keyword(null,"source","source",-433931539),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__50015){
return new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(G__50015);
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.conform_positive_integer,new cljs.core.Keyword(null,"update","update",1045576396),((function (mission_time,max_time,weather_time){
return (function (p1__49988_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.assoc,new cljs.core.Keyword(null,"step","step",1288888124),p1__49988_SHARP_);
});})(mission_time,max_time,weather_time))
,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"e.g. 60",new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str)], null))))),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Step back in time",new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.move.call(null,(-1));
});})(mission_time,max_time,weather_time))
,"<< Step Back"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (G__50016){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(G__50016))){
return "Stop weather animation";
} else {
return "Animate weather";
}
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.update,new cljs.core.Keyword(null,"looping?","looping?",78344245),cljs.core.not)))){
return weathergen.ui.recompute.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params));
} else {
return null;
}
});})(mission_time,max_time,weather_time))
,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (movement_params){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(movement_params))){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"border","border",1444987323),"5px solid black",new cljs.core.Keyword(null,"transform","transform",1381301764),"",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"2px"], null);
} else {
return new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border-left","border-left",-1150760178),"5px solid transparent",new cljs.core.Keyword(null,"border-right","border-right",-668932860),"5px solid transparent",new cljs.core.Keyword(null,"border-top","border-top",-158897573),"7px solid black",new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"transform","transform",1381301764),"rotate(-90deg)"], null);
}
});})(mission_time,max_time,weather_time))
).call(null,weathergen.ui.movement_params),"")),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (mission_time,max_time,weather_time){
return (function (max_time__$1,weather_time__$1,display_mode){
return (cljs.core._EQ_.call(null,display_mode,new cljs.core.Keyword(null,"edit","edit",-1641834166))) || ((weather_time__$1 < max_time__$1));
});})(mission_time,max_time,weather_time))
).call(null,max_time,weather_time,weathergen.ui.display_mode),new cljs.core.Keyword(null,"title","title",636505583),"Step forward in time",new cljs.core.Keyword(null,"click","click",1912301393),((function (mission_time,max_time,weather_time){
return (function (){
return weathergen.ui.move.call(null,(1));
});})(mission_time,max_time,weather_time))
,"Step Forward >>"));
});
weathergen.ui.serialization_controls = (function weathergen$ui$serialization_controls(_){
var inline = (function() { 
var G__50032__delegate = function (css,contents){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"css","css",1135045163),cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),css),contents);
};
var G__50032 = function (css,var_args){
var contents = null;
if (arguments.length > 1) {
var G__50033__i = 0, G__50033__a = new Array(arguments.length -  1);
while (G__50033__i < G__50033__a.length) {G__50033__a[G__50033__i] = arguments[G__50033__i + 1]; ++G__50033__i;}
  contents = new cljs.core.IndexedSeq(G__50033__a,0,null);
} 
return G__50032__delegate.call(this,css,contents);};
G__50032.cljs$lang$maxFixedArity = 1;
G__50032.cljs$lang$applyTo = (function (arglist__50034){
var css = cljs.core.first(arglist__50034);
var contents = cljs.core.rest(arglist__50034);
return G__50032__delegate(css,contents);
});
G__50032.cljs$core$IFn$_invoke$arity$variadic = G__50032__delegate;
return G__50032;
})()
;
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (inline){
return (function (G__50025,G__50026){
return G__50025.call(null,G__50026,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(inline))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode),new cljs.core.Keyword(null,"id","id",-1388402092),"load-save-controls",new cljs.core.Keyword(null,"title","title",636505583),"Load/save",((cljs.core.not.call(null,weathergen.ui.safari_QMARK_))?cljs.core.PersistentVector.EMPTY:(function (){var p_STAR_ = ((function (inline){
return (function() { 
var G__50035__delegate = function (rest__50017_SHARP_){
return hoplon.core.p.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null),rest__50017_SHARP_);
};
var G__50035 = function (var_args){
var rest__50017_SHARP_ = null;
if (arguments.length > 0) {
var G__50036__i = 0, G__50036__a = new Array(arguments.length -  0);
while (G__50036__i < G__50036__a.length) {G__50036__a[G__50036__i] = arguments[G__50036__i + 0]; ++G__50036__i;}
  rest__50017_SHARP_ = new cljs.core.IndexedSeq(G__50036__a,0,null);
} 
return G__50035__delegate.call(this,rest__50017_SHARP_);};
G__50035.cljs$lang$maxFixedArity = 0;
G__50035.cljs$lang$applyTo = (function (arglist__50037){
var rest__50017_SHARP_ = cljs.core.seq(arglist__50037);
return G__50035__delegate(rest__50017_SHARP_);
});
G__50035.cljs$core$IFn$_invoke$arity$variadic = G__50035__delegate;
return G__50035;
})()
;})(inline))
;
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"80%"], null),p_STAR_.call(null,"Due to a bug in Safari, settings files will open in a new\n        tab Use the browser's File->Save As to save the file. Be sure\n        to select 'Page Source' for the format. "),p_STAR_.call(null,"Due to the same bug, all other files will download with\n        name 'Unknown'. For these, once downloaded rename it with the\n        appropriate extension: .fmap for FMAPs, .twx for TWX files,\n        and .zip for weather packages."),p_STAR_.call(null,"Better still, don't use Safari. This application works\n        best in Chrome, but has also been tested in Firefox and\n        Internet Explorer."));
})()),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"save-single-files","save-single-files",-947469927)], null),"Load/Save individual files"),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (inline){
return (function (){
return weathergen.ui.save_fmap.call(null,cljs.core.deref.call(null,weathergen.ui.weather_params),cljs.core.deref.call(null,weathergen.ui.weather_data));
});})(inline))
,"Save Current as FMAP")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (inline){
return (function (){
return weathergen.ui.save_twx.call(null,cljs.core.deref.call(null,weathergen.ui.cloud_params),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)));
});})(inline))
,"Save .TWX")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.save_weather_settings,"Save Weather Settings")),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"button-container",weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),weathergen.ui.load_weather_settings,"Load Weather Settings")))),weathergen.ui.control_subsection.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (inline){
return (function (G__50027){
return cljs.core.not.call(null,(G__50027 == null));
});})(inline))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),"Save mission weather files"),(function (){var row = ((function (inline){
return (function() { 
var G__50038__delegate = function (label,help_path,edit,more){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),"row",new cljs.core.Keyword(null,"margin","margin",-995903681),"0 2px 3px 2px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap",new cljs.core.Keyword(null,"width","width",-384071477),"50px",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"3px"], null),weathergen.help.with_help.call(null,help_path,label)),edit,more);
};
var G__50038 = function (label,help_path,edit,var_args){
var more = null;
if (arguments.length > 3) {
var G__50039__i = 0, G__50039__a = new Array(arguments.length -  3);
while (G__50039__i < G__50039__a.length) {G__50039__a[G__50039__i] = arguments[G__50039__i + 3]; ++G__50039__i;}
  more = new cljs.core.IndexedSeq(G__50039__a,0,null);
} 
return G__50038__delegate.call(this,label,help_path,edit,more);};
G__50038.cljs$lang$maxFixedArity = 3;
G__50038.cljs$lang$applyTo = (function (arglist__50040){
var label = cljs.core.first(arglist__50040);
arglist__50040 = cljs.core.next(arglist__50040);
var help_path = cljs.core.first(arglist__50040);
arglist__50040 = cljs.core.next(arglist__50040);
var edit = cljs.core.first(arglist__50040);
var more = cljs.core.rest(arglist__50040);
return G__50038__delegate(label,help_path,edit,more);
});
G__50038.cljs$core$IFn$_invoke$arity$variadic = G__50038__delegate;
return G__50038;
})()
;})(inline))
;
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, [row.call(null,"Mission:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"mission-name","mission-name",1479736582)], null),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (row,inline){
return (function (G__50028){
var or__23338__auto__ = new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__50028);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "No Mission Loaded";
}
});})(row,inline))
).call(null,weathergen.ui.mission))),row.call(null,"From:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null),weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.display_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"14px"], null),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (row,inline){
return (function (G__50029){
return cljs.core.not.call(null,(G__50029 == null));
});})(row,inline))
).call(null,weathergen.ui.mission),new cljs.core.Keyword(null,"click","click",1912301393),((function (row,inline){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.display_params,cljs.core.assoc_in,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null),weathergen.falcon.files.mission.mission_time.call(null,cljs.core.deref.call(null,weathergen.ui.mission)));
});})(row,inline))
,"Set to mission time")),row.call(null,"To:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null),weathergen.ui.time_entry.call(null,new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.display_params,new cljs.core.Keyword(null,"path","path",-188191168),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null))),row.call(null,"Step:",new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null),weathergen.ui.validating_edit.call(null,new cljs.core.Keyword(null,"width","width",-384071477),(32),new cljs.core.Keyword(null,"source","source",-433931539),weathergen.ui.common.path_lens.call(null,weathergen.ui.display_params,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null)),new cljs.core.Keyword(null,"conform","conform",1846236460),weathergen.ui.conform_positive_integer,new cljs.core.Keyword(null,"fmt","fmt",332300772),cljs.core.str,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"60")),(function (){var progress = javelin.core.cell.call(null,null);
var cancelling_QMARK_ = javelin.core.cell.call(null,false);
var save_file = javelin.core.cell.call(null,null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (progress__$1,cancelling_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"width","width",-384071477),"115px",new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center",new cljs.core.Keyword(null,"background","background",-863952629),(((cljs.core.not.call(null,cancelling_QMARK___$1)) && (!((progress__$1 == null))))?(function (){var pct = cljs.core.long$.call(null,((100) * progress__$1));
return goog.string.format("linear-gradient(to right, lightblue, lightblue %f%%, white %f%%)",pct,pct);
})():null)], null);
});})(progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,cancelling_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
if(cljs.core.truth_(cljs.core.deref.call(null,progress))){
return javelin.core.dosync_STAR_.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return cljs.core.reset_BANG_.call(null,cancelling_QMARK_,true);
});})(progress,cancelling_QMARK_,save_file,row,inline))
);
} else {
cljs.core.reset_BANG_.call(null,cancelling_QMARK_,false);

cljs.core.reset_BANG_.call(null,save_file,null);

return weathergen.ui.save_weather_files.call(null,cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"mission-name","mission-name",1479736582),new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983),new cljs.core.Keyword(null,"nx","nx",-1996436366),new cljs.core.Keyword(null,"save-file","save-file",-250442926),new cljs.core.Keyword(null,"from","from",1815293044),new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883),new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873),new cljs.core.Keyword(null,"cancel","cancel",-1964088360),new cljs.core.Keyword(null,"ny","ny",1701791641),new cljs.core.Keyword(null,"progress","progress",244323547),new cljs.core.Keyword(null,"weather-params","weather-params",-259271365),new cljs.core.Keyword(null,"step","step",1288888124),new cljs.core.Keyword(null,"to","to",192099007)],[new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission)),cljs.core.deref.call(null,weathergen.ui.cloud_params),cljs.core.first.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),save_file,cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"from","from",1815293044)], null)),weathergen.falcon.files.mission.campaign_dir.call(null,cljs.core.deref.call(null,weathergen.ui.mission)),new cljs.core.Keyword(null,"direction","direction",-633359395).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.movement_params)),cancelling_QMARK_,cljs.core.second.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),progress,cljs.core.deref.call(null,weathergen.ui.weather_params),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"step","step",1288888124)], null)),cljs.core.get_in.call(null,cljs.core.deref.call(null,weathergen.ui.display_params),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"multi-save","multi-save",-1814543541),new cljs.core.Keyword(null,"to","to",192099007)], null))]));
}
});})(progress,cancelling_QMARK_,save_file,row,inline))
,javelin.core.formula.call(null,((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (progress__$1,cancelling_QMARK___$1){
if(cljs.core.truth_((function (){var and__23326__auto__ = progress__$1;
if(cljs.core.truth_(and__23326__auto__)){
return cancelling_QMARK___$1;
} else {
return and__23326__auto__;
}
})())){
return "Cancelling...";
} else {
if(cljs.core.truth_(progress__$1)){
return "Cancel";
} else {
return "Save Weather Files";

}
}
});})(progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,cancelling_QMARK_)),(function (){var con__29828__auto__ = (new cljs.core.Delay(((function (progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"5px"], null),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),"Saving"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%"], null),save_file));
});})(progress,cancelling_QMARK_,save_file,row,inline))
,null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return null;
});})(con__29828__auto__,progress,cancelling_QMARK_,save_file,row,inline))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__,progress,cancelling_QMARK_,save_file,row,inline))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (G__50030,G__50031){
var and__23326__auto__ = G__50030;
if(cljs.core.truth_(and__23326__auto__)){
return G__50031;
} else {
return and__23326__auto__;
}
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__,progress,cancelling_QMARK_,save_file,row,inline))
).call(null,progress,save_file));
})()], null);
})()], null);
})()));
});
weathergen.ui.debug_info = (function weathergen$ui$debug_info(){
return null;
});
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"viewBox","viewBox",-469489477),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttribute("viewBox");
} else {
return elem.setAttribute("viewBox",value);
}
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"xlink-href","xlink-href",244956585),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttributeNS("http://www.w3.org/1999/xlink","href");
} else {
return elem.setAttributeNS("http://www.w3.org/1999/xlink","href",value);
}
}));
cljs.core._add_method.call(null,hoplon.core.do_BANG_,new cljs.core.Keyword(null,"preserveAspectRatio","preserveAspectRatio",1832131817),(function (elem,_,value){
if(cljs.core._EQ_.call(null,false,value)){
return elem.removeAttribute("preserveAspectRatio");
} else {
return elem.setAttribute("preserveAspectRatio",value);
}
}));
weathergen.ui.test_section = (function weathergen$ui$test_section(p__50041){
var map__50048 = p__50041;
var map__50048__$1 = ((((!((map__50048 == null)))?((((map__50048.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50048.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50048):map__50048);
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Test",weathergen.ui.tabs.tabs.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.cell.call(null,new cljs.core.Keyword(null,"one","one",935007904)),new cljs.core.Keyword(null,"tabs","tabs",-779855354),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Version",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"one","one",935007904),new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (map__50048,map__50048__$1){
return (function (G__50050,G__50051){
return G__50050.call(null,G__50051,"VERSION");
});})(map__50048,map__50048__$1))
).call(null,cljs.core.get,weathergen.ui.build_info))], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"App Path",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"two","two",627606869),new cljs.core.Keyword(null,"ui","ui",-469653645),hoplon.core.div.call(null,weathergen.ui.electron.remote.app.getAppPath())], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Three",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"three","three",-1651831795),new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var choice = javelin.core.cell.call(null,new cljs.core.Keyword(null,"a","a",-2123407586));
return hoplon.core.div.call(null,weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),choice,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.Keyword(null,"label","label",1718410804),"a"], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"b","b",1482224470),new cljs.core.Keyword(null,"label","label",1718410804),"b"], null)], null))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (choice,map__50048,map__50048__$1){
return (function (G__50053,G__50052){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("value: "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(G__50052.call(null,G__50053))].join('');
});})(choice,map__50048,map__50048__$1))
).call(null,choice,cljs.core.pr_str)));
})()], null)], null)));
});
/**
 * @param {...*} var_args
 */
weathergen.ui.select2 = (function() { 
var weathergen$ui$select2__delegate = function (args__29774__auto__){
var vec__50061 = hoplon.core.parse_args.call(null,args__29774__auto__);
var attrs = cljs.core.nth.call(null,vec__50061,(0),null);
var kids = cljs.core.nth.call(null,vec__50061,(1),null);
var elem = hoplon.core.select.call(null,attrs,kids);
hoplon.core.when_dom.call(null,elem,((function (elem,vec__50061,attrs,kids){
return (function (){
return (function (){var G__50064 = jQuery(elem);
return G__50064;
})().select2();
});})(elem,vec__50061,attrs,kids))
);

return elem;
};
var weathergen$ui$select2 = function (var_args){
var args__29774__auto__ = null;
if (arguments.length > 0) {
var G__50065__i = 0, G__50065__a = new Array(arguments.length -  0);
while (G__50065__i < G__50065__a.length) {G__50065__a[G__50065__i] = arguments[G__50065__i + 0]; ++G__50065__i;}
  args__29774__auto__ = new cljs.core.IndexedSeq(G__50065__a,0,null);
} 
return weathergen$ui$select2__delegate.call(this,args__29774__auto__);};
weathergen$ui$select2.cljs$lang$maxFixedArity = 0;
weathergen$ui$select2.cljs$lang$applyTo = (function (arglist__50066){
var args__29774__auto__ = cljs.core.seq(arglist__50066);
return weathergen$ui$select2__delegate(args__29774__auto__);
});
weathergen$ui$select2.cljs$core$IFn$_invoke$arity$variadic = weathergen$ui$select2__delegate;
return weathergen$ui$select2;
})()
;
/**
 * Given mission and airbase cells, return a formula cell with the
 *   squadron for that airbase in the canonical order.
 */
weathergen.ui.airbase_squadrons = (function weathergen$ui$airbase_squadrons(mission,airbase){
return javelin.core.formula.call(null,(function (mission__$1,airbase__$1){
return cljs.core.sort_by.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadron-type","weathergen.falcon.files.mission/squadron-type",1124226793),new cljs.core.Keyword(null,"name","name",1843675177)),new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1));
})).call(null,mission,airbase);
});
/**
 * Returns a control section that affects how airbases display on the
 *   map.
 */
weathergen.ui.airbase_display_controls = (function weathergen$ui$airbase_display_controls(title){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"overview","overview",-435037267)], null),title),(function (){var map_airbase_label_style = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514)], null));
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"airbase-labels","airbase-labels",580409100)], null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),weathergen.ui.common.px.call(null,(0),(5))], null),hoplon.core.label.call(null,"Airbase labels:")),weathergen.ui.common.dropdown.call(null,new cljs.core.Keyword(null,"value","value",305978217),map_airbase_label_style,new cljs.core.Keyword(null,"choices","choices",1385611597),new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Airbase name only",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"name-only","name-only",-124386571)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"Airbase name and squadrons",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"all","all",892129742)], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"label","label",1718410804),"No label",new cljs.core.Keyword(null,"value","value",305978217),new cljs.core.Keyword(null,"nothing","nothing",-1022703296)], null)], null)));
})(),(function (){var map_airbase_show_status_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null));
return hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),map_airbase_show_status_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (map_airbase_show_status_QMARK_){
return (function (){
return cljs.core.swap_BANG_.call(null,map_airbase_show_status_QMARK_,cljs.core.not);
});})(map_airbase_show_status_QMARK_))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"show-airbase-status?","show-airbase-status?",-2059784435)], null),hoplon.core.label.call(null,"Show airbase status?")));
})(),(function (){var map_airbase_show_squadrons_QMARK_ = weathergen.ui.common.path_lens.call(null,weathergen.ui.map_display,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null));
return hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),map_airbase_show_squadrons_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (map_airbase_show_squadrons_QMARK_){
return (function (){
return cljs.core.swap_BANG_.call(null,map_airbase_show_squadrons_QMARK_,cljs.core.not);
});})(map_airbase_show_squadrons_QMARK_))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"display-options","display-options",1066052168),new cljs.core.Keyword(null,"show-airbase-squadrons?","show-airbase-squadrons?",1245487954)], null),hoplon.core.label.call(null,"Show airbase squadrons?")));
})());
});
weathergen.ui.air_forces_section = (function weathergen$ui$air_forces_section(_){
var expand_state = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384),(1)], null));
var row = ((function (expand_state){
return (function() { 
var G__50167__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"row",args);
};
var G__50167 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__50168__i = 0, G__50168__a = new Array(arguments.length -  0);
while (G__50168__i < G__50168__a.length) {G__50168__a[G__50168__i] = arguments[G__50168__i + 0]; ++G__50168__i;}
  args = new cljs.core.IndexedSeq(G__50168__a,0,null);
} 
return G__50167__delegate.call(this,args);};
G__50167.cljs$lang$maxFixedArity = 0;
G__50167.cljs$lang$applyTo = (function (arglist__50169){
var args = cljs.core.seq(arglist__50169);
return G__50167__delegate(args);
});
G__50167.cljs$core$IFn$_invoke$arity$variadic = G__50167__delegate;
return G__50167;
})()
;})(expand_state))
;
var G__50120 = (new cljs.core.Delay(((function (expand_state,row){
return (function (){
return "No mission loaded";
});})(expand_state,row))
,null));
var G__50121 = (new cljs.core.Delay(((function (G__50120,expand_state,row){
return (function (){
return "No airbases present in the mission.";
});})(G__50120,expand_state,row))
,null));
var G__50122 = (new cljs.core.Delay(((function (G__50120,G__50121,expand_state,row){
return (function (){
return weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"div.row","div.row",133678515),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"button","button",1456579943),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px"], null)], null)], null),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbase-filtering","airbase-filtering",-1721186951)], null),"Airbase Filtering"),row.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.hide_empty_airbases_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_empty_airbases_QMARK_,cljs.core.not);
});})(G__50120,G__50121,expand_state,row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"hide-no-squadron-airbases","hide-no-squadron-airbases",-1359048131)], null),hoplon.core.label.call(null,"Hide airbases with no squadrons"))),row.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.hide_inoperable_airbases_QMARK_,new cljs.core.Keyword(null,"change","change",-1163046502),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_inoperable_airbases_QMARK_,cljs.core.not);
});})(G__50120,G__50121,expand_state,row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"hide-zero-status-airbases","hide-zero-status-airbases",1840033965)], null),hoplon.core.label.call(null,"Hide airbases at 0% status")))),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"squadron-types","squadron-types",1890788688)], null),"Squadron Types"),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.deref.call(null,weathergen.ui.all_squadron_types));
});})(G__50120,G__50121,expand_state,row))
,"Check all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.PersistentHashSet.EMPTY);
});})(G__50120,G__50121,expand_state,row))
,"Uncheck all"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"squadron-type-buttons","squadron-type-buttons",-151353966)], null))),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap",new cljs.core.Keyword(null,"max-width","max-width",-1939924051),weathergen.ui.common.px.call(null,(275))], null),hoplon.core.loop_tpl_STAR_.call(null,javelin.core.formula.call(null,((function (G__50120,G__50121,expand_state,row){
return (function (G__50123,G__50124){
return G__50123.call(null,G__50124);
});})(G__50120,G__50121,expand_state,row))
).call(null,cljs.core.sort,weathergen.ui.all_squadron_types),((function (G__50120,G__50121,expand_state,row){
return (function (item__29818__auto__){
var vec__50125 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__50120,G__50121,expand_state,row){
return (function (squadron_type){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron_type], null);
});})(G__50120,G__50121,expand_state,row))
).call(null,item__29818__auto__));
var squadron_type = cljs.core.nth.call(null,vec__50125,(0),null);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(75)),new cljs.core.Keyword(null,"white-space","white-space",-707351930),"nowrap"], null),(function (){var val = javelin.core.formula.call(null,((function (vec__50125,squadron_type,G__50120,G__50121,expand_state,row){
return (function (G__50128,G__50130,G__50129){
return G__50128.call(null,G__50129,G__50130);
});})(vec__50125,squadron_type,G__50120,G__50121,expand_state,row))
).call(null,cljs.core.contains_QMARK_,squadron_type,weathergen.ui.included_squadron_types);
return hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),val,new cljs.core.Keyword(null,"change","change",-1163046502),((function (val,vec__50125,squadron_type,G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.included_squadron_types,(cljs.core.truth_(cljs.core.deref.call(null,val))?cljs.core.disj:cljs.core.conj),cljs.core.deref.call(null,squadron_type));
});})(val,vec__50125,squadron_type,G__50120,G__50121,expand_state,row))
);
})(),hoplon.core.label.call(null,squadron_type));
});})(G__50120,G__50121,expand_state,row))
))),weathergen.ui.airbase_display_controls.call(null,"Display Options"),weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbases-and-squadrons","airbases-and-squadrons",396705313)], null),"Airbases and Squadrons"),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.Keyword(null,"all-expanded","all-expanded",1437674225));
});})(G__50120,G__50121,expand_state,row))
,"Expand all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.Keyword(null,"all-collapsed","all-collapsed",437702622));
});})(G__50120,G__50121,expand_state,row))
,"Collapse all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,expand_state,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"expand-through-level","expand-through-level",-1840001384),(1)], null));
});})(G__50120,G__50121,expand_state,row))
,"Collapse to airbases"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"tree-collapse-buttons","tree-collapse-buttons",-1065929796)], null))),row.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.deref.call(null,weathergen.ui.listed_airbases));
});})(G__50120,G__50121,expand_state,row))
,"Show all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
});})(G__50120,G__50121,expand_state,row))
,"Hide all"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"airbase-selection-buttons","airbase-selection-buttons",-991641834)], null))),row.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"scroll",new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%",new cljs.core.Keyword(null,"background","background",-863952629),"white",new cljs.core.Keyword(null,"border","border",1444987323),"inset 1px lightgray"], null),(function (){var by_side = javelin.core.formula.call(null,((function (G__50120,G__50121,expand_state,row){
return (function (mission,all_airbases){
return cljs.core.group_by.call(null,((function (G__50120,G__50121,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.side.call(null,mission,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase));
});})(G__50120,G__50121,expand_state,row))
,all_airbases);
});})(G__50120,G__50121,expand_state,row))
).call(null,weathergen.ui.mission,weathergen.ui.all_airbases);
var sorted = javelin.core.formula.call(null,((function (by_side,G__50120,G__50121,expand_state,row){
return (function (mission,by_side__$1){
var timer_name__15521__auto__ = "Updating air forces tree";
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = (function (){var iter__24200__auto__ = ((function (timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50120,G__50121,expand_state,row){
return (function weathergen$ui$air_forces_section_$_iter__50131(s__50132){
return (new cljs.core.LazySeq(null,((function (timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50120,G__50121,expand_state,row){
return (function (){
var s__50132__$1 = s__50132;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50132__$1);
if(temp__5278__auto__){
var s__50132__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50132__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50132__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50134 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50133 = (0);
while(true){
if((i__50133 < size__24199__auto__)){
var side = cljs.core._nth.call(null,c__24198__auto__,i__50133);
var airbases = cljs.core.get.call(null,by_side__$1,side);
if((cljs.core.count.call(null,airbases) > (0))){
cljs.core.chunk_append.call(null,b__50134,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null));

var G__50170 = (i__50133 + (1));
i__50133 = G__50170;
continue;
} else {
var G__50171 = (i__50133 + (1));
i__50133 = G__50171;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50134),weathergen$ui$air_forces_section_$_iter__50131.call(null,cljs.core.chunk_rest.call(null,s__50132__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50134),null);
}
} else {
var side = cljs.core.first.call(null,s__50132__$2);
var airbases = cljs.core.get.call(null,by_side__$1,side);
if((cljs.core.count.call(null,airbases) > (0))){
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null),weathergen$ui$air_forces_section_$_iter__50131.call(null,cljs.core.rest.call(null,s__50132__$2)));
} else {
var G__50172 = cljs.core.rest.call(null,s__50132__$2);
s__50132__$1 = G__50172;
continue;
}
}
} else {
return null;
}
break;
}
});})(timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50120,G__50121,expand_state,row))
,null,null));
});})(timer_name__15521__auto__,ignore__15522__auto__,by_side,G__50120,G__50121,expand_state,row))
;
return iter__24200__auto__.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});})(by_side,G__50120,G__50121,expand_state,row))
).call(null,weathergen.ui.mission,by_side);
return weathergen.ui.trees.tree.call(null,expand_state,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (expanded_QMARK_,item){
var vec__50141 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (p__50144){
var vec__50145 = p__50144;
var side = cljs.core.nth.call(null,vec__50145,(0),null);
var airbases = cljs.core.nth.call(null,vec__50145,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbases,side], null);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,item));
var airbases = cljs.core.nth.call(null,vec__50141,(0),null);
var side = cljs.core.nth.call(null,vec__50141,(1),null);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (vec__50141,airbases,side,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (G__50148,G__50149){
return G__50148.call(null,"air-forces-side-%d",G__50149);
});})(vec__50141,airbases,side,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,goog.string.format,side),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__50141,airbases,side,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (side__$1){
return new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"4px",new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,side__$1,new cljs.core.Keyword(null,"dark-text","dark-text",814777253))], null);
});})(vec__50141,airbases,side,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,side),javelin.core.formula.call(null,((function (vec__50141,airbases,side,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (mission,side__$1){
return weathergen.ui.common.side_label.call(null,new cljs.core.Keyword(null,"mission","mission",1740288522),mission,new cljs.core.Keyword(null,"side","side",389652279),side__$1);
});})(vec__50141,airbases,side,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,weathergen.ui.mission,side));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (item){
return javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (item__$1,mission){
var vec__50150 = item__$1;
var side = cljs.core.nth.call(null,vec__50150,(0),null);
var airbases = cljs.core.nth.call(null,vec__50150,(1),null);
return cljs.core.sort_by.call(null,((function (vec__50150,side,airbases,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.objective_name.call(null,mission,airbase);
});})(vec__50150,side,airbases,by_side,sorted,G__50120,G__50121,expand_state,row))
,airbases);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,item,weathergen.ui.mission);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase__$1,listed_airbases){
return listed_airbases.call(null,airbase__$1);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase,weathergen.ui.listed_airbases)], null);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase){
return javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase__$1){
return cljs.core.sort_by.call(null,cljs.core.juxt.call(null,new cljs.core.Keyword("weathergen.falcon.files.mission","squadron-type","weathergen.falcon.files.mission/squadron-type",1124226793),new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975)),new cljs.core.Keyword("weathergen.falcon.files.mission","squadrons","weathergen.falcon.files.mission/squadrons",47769110).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (expanded_QMARK_,airbase){
var ab_name = javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","name","weathergen.falcon.files.mission/name",1235339975).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase);
var status = javelin.core.formula.call(null,((function (ab_name,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase__$1){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(airbase__$1);
});})(ab_name,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (G__50154,G__50153){
return G__50153.call(null,"air-forces-airbase-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__50154));
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase,goog.string.format),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (expanded_QMARK___$1){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"4px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,expanded_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (){
cljs.core.swap_BANG_.call(null,weathergen.ui.checked_airbases,weathergen.util.toggle_set_membership,cljs.core.deref.call(null,airbase));

return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,cljs.core.deref.call(null,weathergen.ui.checked_airbases).call(null,cljs.core.deref.call(null,airbase)));
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
,new cljs.core.Keyword(null,"mouseenter","mouseenter",-1792413560),((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,cljs.core.deref.call(null,airbase));
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"7px"], null),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase__$1,checked_airbases){
return checked_airbases.call(null,airbase__$1);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase,weathergen.ui.checked_airbases)),(function (){var width = (25);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(3)),new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (width,ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (mission,airbase__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(airbase__$1));
});})(width,ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,weathergen.ui.mission,airbase),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"max-width","max-width",-1939924051),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"max-height","max-height",-612563804),weathergen.ui.common.px.call(null,width),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null)));
})(),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (status__$1){
return new cljs.core.PersistentArrayMap(null, 7, [new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.px.call(null,(25)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(8)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),weathergen.ui.common.px.call(null,(5)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px black",new cljs.core.Keyword(null,"background","background",-863952629),(function (){var color = weathergen.ui.airbase_status_color.call(null,status__$1);
return goog.string.format("linear-gradient(to right, %s, %s %f%%, white %f%%)",color,color,status__$1,status__$1);
})()], null);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,status)),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (airbase__$1,highlighted_airbase){
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"color","color",1011675173),weathergen.ui.common.team_color.call(null,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(airbase__$1),new cljs.core.Keyword(null,"dark-text","dark-text",814777253)),new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"10px",new cljs.core.Keyword(null,"background","background",-863952629),((cljs.core._EQ_.call(null,airbase__$1,highlighted_airbase))?"lightgoldenrodyellow":null)], null);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,airbase,weathergen.ui.highlighted_airbase),ab_name),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"5px"], null),hoplon.core.loop_tpl_STAR_.call(null,weathergen.ui.airbase_squadrons.call(null,weathergen.ui.mission,airbase),((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (item__29818__auto__){
var vec__50155 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (squadron){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron], null);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,item__29818__auto__));
var squadron = cljs.core.nth.call(null,vec__50155,(0),null);
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__50155,squadron,ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(vec__50155,squadron,ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons),new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (vec__50155,squadron,ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (mission,squadron__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1));
});})(vec__50155,squadron,ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,weathergen.ui.mission,squadron),new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"height","height",1025178622),"20px",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"3px",new cljs.core.Keyword(null,"vertical-align","vertical-align",651007333),"middle"], null));
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
)),hoplon.core.div.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),expanded_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),"22px",new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic",new cljs.core.Keyword(null,"color","color",1011675173),"gray"], null),javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (status__$1){
return goog.string.format("Status: %d%%",status__$1);
});})(ab_name,status,by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,status)));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (squadron){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons)], null);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (expanded_QMARK_,squadron){
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (G__50158,G__50159){
return G__50158.call(null,"air-forces-squadron-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__50159));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,goog.string.format,squadron),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"width","width",-384071477),"35px",new cljs.core.Keyword(null,"text-align","text-align",1786091845),"center"], null),hoplon.core.img.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (mission,squadron__$1){
return weathergen.ui.common.get_image.call(null,mission,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(squadron__$1));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,weathergen.ui.mission,squadron))),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"padding","padding",1660304693),"2px 4px 0 5px",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-right","margin-right",809689658),"7px"], null),javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (G__50160){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"quantity","quantity",-1929050694).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__50160)))].join('');
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,squadron)),weathergen.ui.common.inl.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (G__50161){
return new cljs.core.Keyword(null,"airframe","airframe",643222926).cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword("weathergen.falcon.files.mission","aircraft","weathergen.falcon.files.mission/aircraft",774567258).cljs$core$IFn$_invoke$arity$1(G__50161));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,squadron))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__50120,G__50121,expand_state,row){
return (function (G__50162){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__50162);
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
).call(null,squadron))));
});})(by_side,sorted,G__50120,G__50121,expand_state,row))
], null)], null),sorted);
})())));
});})(G__50120,G__50121,expand_state,row))
,null));
var tpl__29846__auto__ = ((function (G__50120,G__50121,G__50122,expand_state,row){
return (function (G__50117,G__50118,G__50119){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(G__50117)?G__50120:(cljs.core.truth_(G__50118)?G__50121:(cljs.core.truth_(G__50119)?G__50122:null)));
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(G__50120,G__50121,G__50122,expand_state,row))
;
return javelin.core.formula.call(null,tpl__29846__auto__).call(null,javelin.core.formula.call(null,((function (G__50120,G__50121,G__50122,tpl__29846__auto__,expand_state,row){
return (function (G__50164,G__50163){
return G__50163.call(null,G__50164);
});})(G__50120,G__50121,G__50122,tpl__29846__auto__,expand_state,row))
).call(null,weathergen.ui.mission,cljs.core.not),javelin.core.formula.call(null,((function (G__50120,G__50121,G__50122,tpl__29846__auto__,expand_state,row){
return (function (G__50166,G__50165){
return (G__50165.call(null,G__50166) === (0));
});})(G__50120,G__50121,G__50122,tpl__29846__auto__,expand_state,row))
).call(null,weathergen.ui.all_airbases,cljs.core.count),new cljs.core.Keyword(null,"else","else",-1508377146));
});
weathergen.ui.order_of_battle_section = (function weathergen$ui$order_of_battle_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Order of Battle",(function (){var con__29828__auto__ = (new cljs.core.Delay((function (){
return "No mission loaded";
}),null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__){
return (function (){
var side_type_units = javelin.core.formula.call(null,((function (con__29828__auto__){
return (function (G__50224,G__50223,G__50221,G__50225,G__50222){
return G__50221.call(null,((function (con__29828__auto__){
return (function (m,side,units){
return G__50222.call(null,m,side,G__50223.call(null,new cljs.core.Keyword(null,"type","type",1174270348),units));
});})(con__29828__auto__))
,cljs.core.PersistentArrayMap.EMPTY,G__50223.call(null,((function (con__29828__auto__){
return (function (p1__50173_SHARP_){
return G__50224.call(null,G__50225,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(p1__50173_SHARP_));
});})(con__29828__auto__))
,new cljs.core.Keyword(null,"units","units",-533089095).cljs$core$IFn$_invoke$arity$1(G__50225)));
});})(con__29828__auto__))
).call(null,weathergen.falcon.files.mission.side,cljs.core.group_by,cljs.core.reduce_kv,weathergen.ui.mission,cljs.core.assoc);
var search_text = javelin.core.cell.call(null,"");
return hoplon.core.div.call(null,hoplon.core.span.call(null,"Search:"),hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text",new cljs.core.Keyword(null,"value","value",305978217),search_text,new cljs.core.Keyword(null,"change","change",-1163046502),((function (side_type_units,search_text,con__29828__auto__){
return (function (p1__50174_SHARP_){
return cljs.core.reset_BANG_.call(null,search_text,cljs.core.deref.call(null,p1__50174_SHARP_));
});})(side_type_units,search_text,con__29828__auto__))
),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,side_type_units,((function (side_type_units,search_text,con__29828__auto__){
return (function (item__29818__auto__){
var vec__50232 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (side_type_units,search_text,con__29828__auto__){
return (function (p__50235){
var vec__50236 = p__50235;
var side = cljs.core.nth.call(null,vec__50236,(0),null);
var type_units = cljs.core.nth.call(null,vec__50236,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [type_units,side], null);
});})(side_type_units,search_text,con__29828__auto__))
).call(null,item__29818__auto__));
var type_units = cljs.core.nth.call(null,vec__50232,(0),null);
var side = cljs.core.nth.call(null,vec__50232,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (G__50240,G__50241,G__50242,G__50239){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),G__50239.call(null,G__50240,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"team","team",1355747699),new cljs.core.Keyword(null,"dark-text","dark-text",814777253),G__50241.call(null,G__50242)], null))], null);
});})(vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
).call(null,weathergen.ui.common.colors,weathergen.falcon.files.mission.team_color,side,cljs.core.get_in),javelin.core.formula.call(null,((function (vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (G__50243,G__50244,G__50245){
return G__50243.call(null,G__50244,G__50245);
});})(vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
).call(null,weathergen.falcon.files.mission.team_name,weathergen.ui.mission,side)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,type_units,((function (vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (item__29818__auto____$1){
var vec__50252 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (p__50255){
var vec__50256 = p__50255;
var type = cljs.core.nth.call(null,vec__50256,(0),null);
var units = cljs.core.nth.call(null,vec__50256,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [units,type], null);
});})(vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
).call(null,item__29818__auto____$1));
var units = cljs.core.nth.call(null,vec__50252,(0),null);
var type = cljs.core.nth.call(null,vec__50252,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (G__50259,G__50260){
return G__50259.call(null,G__50260);
});})(vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
).call(null,cljs.core.name,type)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,units,((function (vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (item__29818__auto____$2){
var vec__50261 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (unit){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [unit], null);
});})(vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
).call(null,item__29818__auto____$2));
var unit = cljs.core.nth.call(null,vec__50261,(0),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__50261,unit,vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__){
return (function (G__50264){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__50264);
});})(vec__50261,unit,vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
).call(null,unit)));
});})(vec__50252,units,type,vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
)));
});})(vec__50232,type_units,side,side_type_units,search_text,con__29828__auto__))
)));
});})(side_type_units,search_text,con__29828__auto__))
)));
});})(con__29828__auto__))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__){
return (function (G__50266,G__50265){
return G__50265.call(null,G__50266);
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__))
).call(null,weathergen.ui.mission,cljs.core.not));
})());
});
/**
 * Returns UI for the mission info section.
 */
weathergen.ui.mission_info_section = (function weathergen$ui$mission_info_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),"Mission Info",hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null),(function (){var con__29828__auto__ = (new cljs.core.Delay((function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"text-decoration","text-decoration",1836813207),"underline",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%"], null),"Loaded mission"),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Theater: "),javelin.core.formula.call(null,(function (G__50274,G__50273){
return G__50273.call(null,G__50274);
})).call(null,weathergen.ui.mission,weathergen.falcon.files.mission.theaterdef_name)),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Mission: "),javelin.core.formula.call(null,(function (G__50275){
return new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__50275);
})).call(null,weathergen.ui.mission)),hoplon.core.div.call(null,hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold"], null),"Falcon Time: "),javelin.core.formula.call(null,(function (G__50277,G__50278,G__50276){
return G__50276.call(null,G__50277.call(null,G__50278));
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission,weathergen.ui.common.format_time)));
}),null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%",new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic"], null),"No mission loaded.");
});})(con__29828__auto__))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,weathergen.ui.mission);
})()));
});
/**
 * Returns UI for the save briefing section.
 */
weathergen.ui.save_briefing_section = (function weathergen$ui$save_briefing_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing","save-briefing",-1540800301)], null),"Save Mission Briefing"),new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__50310,G__50311){
return G__50310.call(null,G__50311,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),(function (){var only_install = javelin.core.formula.call(null,(function (mission){
if(cljs.core._EQ_.call(null,cljs.core.count.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)),(1))){
return cljs.core.first.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission));
} else {
return null;
}
})).call(null,weathergen.ui.mission);
var selected_install = javelin.core.cell.call(null,null);
var install_to_save = javelin.core.formula.call(null,((function (only_install,selected_install){
return (function (only_install__$1,selected_install__$1){
var or__23338__auto__ = only_install__$1;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return selected_install__$1;
}
});})(only_install,selected_install))
).call(null,only_install,selected_install);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null),hoplon.core.div.call(null,(function (){var G__50315 = (new cljs.core.Delay(((function (only_install,selected_install,install_to_save){
return (function (){
return hoplon.core.div.call(null,hoplon.core.span.call(null,"Briefing will be saved for installation: "),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"120%"], null),javelin.core.formula.call(null,((function (only_install,selected_install,install_to_save){
return (function (G__50319,G__50318,G__50320){
return G__50318.call(null,G__50319.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__50320)));
});})(only_install,selected_install,install_to_save))
).call(null,cljs.core.first,cljs.core.key,weathergen.ui.mission)));
});})(only_install,selected_install,install_to_save))
,null));
var G__50316 = (new cljs.core.Delay(((function (G__50315,only_install,selected_install,install_to_save){
return (function (){
return "Cannot find a matching installation of Falcon BMS for this mission.";
});})(G__50315,only_install,selected_install,install_to_save))
,null));
var G__50317 = (new cljs.core.Delay(((function (G__50315,G__50316,only_install,selected_install,install_to_save){
return (function (){
return hoplon.core.div.call(null,hoplon.core.div.call(null,hoplon.core.span.call(null,"Multiple installed copies of Falcon BMS point at the mission directory, "),hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"110%"], null),javelin.core.formula.call(null,((function (G__50315,G__50316,only_install,selected_install,install_to_save){
return (function (mission){
return cljs.core.val.call(null,cljs.core.first.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission)));
});})(G__50315,G__50316,only_install,selected_install,install_to_save))
).call(null,weathergen.ui.mission)),hoplon.core.span.call(null,". Select which installation this mission is for. (If unsure, choose 'Falcon BMS 4.33 U1'.)")),weathergen.ui.common.radio_group.call(null,new cljs.core.Keyword(null,"value","value",305978217),selected_install,new cljs.core.Keyword(null,"choices","choices",1385611597),javelin.core.formula.call(null,((function (G__50315,G__50316,only_install,selected_install,install_to_save){
return (function (mission){
var iter__24200__auto__ = ((function (G__50315,G__50316,only_install,selected_install,install_to_save){
return (function weathergen$ui$save_briefing_section_$_iter__50321(s__50322){
return (new cljs.core.LazySeq(null,((function (G__50315,G__50316,only_install,selected_install,install_to_save){
return (function (){
var s__50322__$1 = s__50322;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50322__$1);
if(temp__5278__auto__){
var s__50322__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50322__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50322__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50324 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50323 = (0);
while(true){
if((i__50323 < size__24199__auto__)){
var vec__50331 = cljs.core._nth.call(null,c__24198__auto__,i__50323);
var install_name = cljs.core.nth.call(null,vec__50331,(0),null);
var install_path = cljs.core.nth.call(null,vec__50331,(1),null);
cljs.core.chunk_append.call(null,b__50324,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),install_name,new cljs.core.Keyword(null,"label","label",1718410804),weathergen.ui.common.inl.call(null,install_name)], null));

var G__50341 = (i__50323 + (1));
i__50323 = G__50341;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50324),weathergen$ui$save_briefing_section_$_iter__50321.call(null,cljs.core.chunk_rest.call(null,s__50322__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50324),null);
}
} else {
var vec__50334 = cljs.core.first.call(null,s__50322__$2);
var install_name = cljs.core.nth.call(null,vec__50334,(0),null);
var install_path = cljs.core.nth.call(null,vec__50334,(1),null);
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"value","value",305978217),install_name,new cljs.core.Keyword(null,"label","label",1718410804),weathergen.ui.common.inl.call(null,install_name)], null),weathergen$ui$save_briefing_section_$_iter__50321.call(null,cljs.core.rest.call(null,s__50322__$2)));
}
} else {
return null;
}
break;
}
});})(G__50315,G__50316,only_install,selected_install,install_to_save))
,null,null));
});})(G__50315,G__50316,only_install,selected_install,install_to_save))
;
return iter__24200__auto__.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(mission));
});})(G__50315,G__50316,only_install,selected_install,install_to_save))
).call(null,weathergen.ui.mission)));
});})(G__50315,G__50316,only_install,selected_install,install_to_save))
,null));
var tpl__29846__auto__ = ((function (G__50315,G__50316,G__50317,only_install,selected_install,install_to_save){
return (function (G__50312,G__50313,G__50314){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(G__50312)?G__50315:(cljs.core.truth_(G__50313)?G__50316:(cljs.core.truth_(G__50314)?G__50317:null)));
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(G__50315,G__50316,G__50317,only_install,selected_install,install_to_save))
;
return javelin.core.formula.call(null,tpl__29846__auto__).call(null,only_install,javelin.core.formula.call(null,((function (G__50315,G__50316,G__50317,tpl__29846__auto__,only_install,selected_install,install_to_save){
return (function (G__50338,G__50337){
return (G__50337.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__50338)) === (0));
});})(G__50315,G__50316,G__50317,tpl__29846__auto__,only_install,selected_install,install_to_save))
).call(null,weathergen.ui.mission,cljs.core.count),new cljs.core.Keyword(null,"else","else",-1508377146));
})()),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"border","border",1444987323),"1px solid black",new cljs.core.Keyword(null,"margin-top","margin-top",392161226),"10px",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"10px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"5px",new cljs.core.Keyword(null,"padding","padding",1660304693),"2px"], null),"Visibility"),weathergen.ui.common.side_selector.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"0 0 5px 5px"], null),new cljs.core.Keyword(null,"mission","mission",1740288522),weathergen.ui.mission,new cljs.core.Keyword(null,"selected-sides","selected-sides",-922979619),weathergen.ui.visible_sides)),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"disabled?","disabled?",-1523234181),javelin.core.formula.call(null,((function (only_install,selected_install,install_to_save){
return (function (G__50340,G__50339){
return G__50339.call(null,G__50340);
});})(only_install,selected_install,install_to_save))
).call(null,install_to_save,cljs.core.not),new cljs.core.Keyword(null,"click","click",1912301393),((function (only_install,selected_install,install_to_save){
return (function (){
return weathergen.ui.save_briefing.call(null,cljs.core.deref.call(null,install_to_save),cljs.core.deref.call(null,weathergen.ui.visible_sides));
});})(only_install,selected_install,install_to_save))
,"Save Briefing (.vmtb)"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"save-briefing","save-briefing",-1540800301)], null)));
})());
});
/**
 * Returns UI for the briefing notes section
 */
weathergen.ui.briefing_notes_section = (function weathergen$ui$briefing_notes_section(_){
return weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),javelin.core.formula.call(null,(function (display_mode){
return weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"briefing-notes","briefing-notes",-1524193117),display_mode], null),"Briefing Notes");
})).call(null,weathergen.ui.display_mode),hoplon.core.div.call(null,(function (){var con__29828__auto__ = (new cljs.core.Delay((function (){
return hoplon.core.textarea.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110)),new cljs.core.Keyword(null,"width","width",-384071477),weathergen.ui.common.pct.call(null,(100))], null),new cljs.core.Keyword(null,"rows","rows",850049680),(10),new cljs.core.Keyword(null,"value","value",305978217),weathergen.ui.briefing_notes,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083),"Enter briefing notes here",new cljs.core.Keyword(null,"change","change",-1163046502),(function (p1__50342_SHARP_){
return cljs.core.reset_BANG_.call(null,weathergen.ui.briefing_notes,cljs.core.deref.call(null,p1__50342_SHARP_));
}));
}),null));
var alt__29829__auto__ = (new cljs.core.Delay(((function (con__29828__auto__){
return (function (){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 8, [new cljs.core.Keyword(null,"font-family","font-family",-667419874),"monospace",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(110)),new cljs.core.Keyword(null,"white-space","white-space",-707351930),"pre-wrap",new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(10)),new cljs.core.Keyword(null,"background","background",-863952629),"white",new cljs.core.Keyword(null,"border-width","border-width",-1512605390),weathergen.ui.common.px.call(null,(1)),new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"lightgray",new cljs.core.Keyword(null,"border-style","border-style",-485574304),"solid"], null),javelin.core.formula.call(null,((function (con__29828__auto__){
return (function (briefing_notes){
if(clojure.string.blank_QMARK_.call(null,briefing_notes)){
return hoplon.core.span.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"font-style","font-style",-773672352),"italic",new cljs.core.Keyword(null,"color","color",1011675173),"darkgrey"], null),"No briefing notes were included.");
} else {
return briefing_notes;
}
});})(con__29828__auto__))
).call(null,weathergen.ui.briefing_notes));
});})(con__29828__auto__))
,null));
var tpl__29830__auto__ = ((function (con__29828__auto__,alt__29829__auto__){
return (function (p__29831__auto__){
return cljs.core.deref.call(null,(function (){var or__23338__auto__ = (cljs.core.truth_(p__29831__auto__)?con__29828__auto__:alt__29829__auto__);
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29828__auto__,alt__29829__auto__))
;
return javelin.core.formula.call(null,tpl__29830__auto__).call(null,javelin.core.formula.call(null,((function (con__29828__auto__,alt__29829__auto__,tpl__29830__auto__){
return (function (G__50345,G__50346){
return G__50345.call(null,G__50346,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(con__29828__auto__,alt__29829__auto__,tpl__29830__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})()));
});
/**
 * Controls for how the map is displayed.
 */
weathergen.ui.map_controls_section = (function weathergen$ui$map_controls_section(_){
return hoplon.core.div.call(null,weathergen.ui.common.control_section.call(null,new cljs.core.Keyword(null,"title","title",636505583),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"general","general",380803686)], null),"General Display Options"),(function (){var slider_row = (function (p__50360){
var map__50361 = p__50360;
var map__50361__$1 = ((((!((map__50361 == null)))?((((map__50361.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50361.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50361):map__50361);
var label = cljs.core.get.call(null,map__50361__$1,new cljs.core.Keyword(null,"label","label",1718410804));
var key = cljs.core.get.call(null,map__50361__$1,new cljs.core.Keyword(null,"key","key",-1516042587));
var init = cljs.core.get.call(null,map__50361__$1,new cljs.core.Keyword(null,"init","init",-1875481434));
var min = cljs.core.get.call(null,map__50361__$1,new cljs.core.Keyword(null,"min","min",444991522));
var max = cljs.core.get.call(null,map__50361__$1,new cljs.core.Keyword(null,"max","max",61366548));
return hoplon.core.tr.call(null,weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),key], null),hoplon.core.td.call(null,label)),(function (){var id = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null))].join('');
return hoplon.core.td.call(null,hoplon.core.datalist.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),id,(function (){var iter__24200__auto__ = ((function (id,map__50361,map__50361__$1,label,key,init,min,max){
return (function weathergen$ui$map_controls_section_$_iter__50363(s__50364){
return (new cljs.core.LazySeq(null,((function (id,map__50361,map__50361__$1,label,key,init,min,max){
return (function (){
var s__50364__$1 = s__50364;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50364__$1);
if(temp__5278__auto__){
var s__50364__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50364__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50364__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50366 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50365 = (0);
while(true){
if((i__50365 < size__24199__auto__)){
var val = cljs.core._nth.call(null,c__24198__auto__,i__50365);
cljs.core.chunk_append.call(null,b__50366,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val));

var G__50372 = (i__50365 + (1));
i__50365 = G__50372;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50366),weathergen$ui$map_controls_section_$_iter__50363.call(null,cljs.core.chunk_rest.call(null,s__50364__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50366),null);
}
} else {
var val = cljs.core.first.call(null,s__50364__$2);
return cljs.core.cons.call(null,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val),weathergen$ui$map_controls_section_$_iter__50363.call(null,cljs.core.rest.call(null,s__50364__$2)));
}
} else {
return null;
}
break;
}
});})(id,map__50361,map__50361__$1,label,key,init,min,max))
,null,null));
});})(id,map__50361,map__50361__$1,label,key,init,min,max))
;
return iter__24200__auto__.call(null,cljs.core.range.call(null,((100) * min),((100) * (max + (1))),((max - min) * (25))));
})()),hoplon.core.input.call(null,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"type","type",1174270348),"range",new cljs.core.Keyword(null,"list","list",765357683),id,new cljs.core.Keyword(null,"min","min",444991522),cljs.core.long$.call(null,(min * (100))),new cljs.core.Keyword(null,"max","max",61366548),cljs.core.long$.call(null,(max * (100))),new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (id,map__50361,map__50361__$1,label,key,init,min,max){
return (function (G__50367,G__50369,G__50368){
return (G__50367.call(null,G__50368,G__50369) * (100));
});})(id,map__50361,map__50361__$1,label,key,init,min,max))
).call(null,cljs.core.get,key,weathergen.ui.map_display),new cljs.core.Keyword(null,"input","input",556931961),((function (id,map__50361,map__50361__$1,label,key,init,min,max){
return (function (p1__50347_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.assoc,key,(cljs.core.deref.call(null,p1__50347_SHARP_) / 100.0));
});})(id,map__50361,map__50361__$1,label,key,init,min,max))
], null)));
})(),hoplon.core.td.call(null,weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (map__50361,map__50361__$1,label,key,init,min,max){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.assoc,key,init);
});})(map__50361,map__50361__$1,label,key,init,min,max))
,"Reset"),weathergen.help.help_icon.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),cljs.core.keyword.call(null,[cljs.core.str.cljs$core$IFn$_invoke$arity$1("reset-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.name.call(null,key))].join(''))], null))));
});
return hoplon.core.div.call(null,hoplon.core.table.call(null,slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Brightness:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"brightness","brightness",1067055820),new cljs.core.Keyword(null,"init","init",-1875481434),0.5,new cljs.core.Keyword(null,"min","min",444991522),(0),new cljs.core.Keyword(null,"max","max",61366548),1.0], null)),slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Text size:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"text-size","text-size",-945618309),new cljs.core.Keyword(null,"init","init",-1875481434),(0),new cljs.core.Keyword(null,"min","min",444991522),-1.0,new cljs.core.Keyword(null,"max","max",61366548),1.0], null)),slider_row.call(null,new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"label","label",1718410804),"Icon size:",new cljs.core.Keyword(null,"key","key",-1516042587),new cljs.core.Keyword(null,"icon-size","icon-size",414161352),new cljs.core.Keyword(null,"init","init",-1875481434),(0),new cljs.core.Keyword(null,"min","min",444991522),-1.0,new cljs.core.Keyword(null,"max","max",61366548),1.0], null))),hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (slider_row){
return (function (G__50370){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__50370);
});})(slider_row))
).call(null,weathergen.ui.map_display),new cljs.core.Keyword(null,"change","change",-1163046502),((function (slider_row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.update,new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124),cljs.core.not);
});})(slider_row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124)], null),hoplon.core.label.call(null,"Display text with contrasting background"))),hoplon.core.div.call(null,hoplon.core.input.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"checkbox",new cljs.core.Keyword(null,"value","value",305978217),javelin.core.formula.call(null,((function (slider_row){
return (function (G__50371){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__50371);
});})(slider_row))
).call(null,weathergen.ui.map_display),new cljs.core.Keyword(null,"change","change",-1163046502),((function (slider_row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.update,new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003),cljs.core.not);
});})(slider_row))
),weathergen.help.with_help.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003)], null),hoplon.core.label.call(null,"Show bullseye"))));
})()),weathergen.ui.airbase_display_controls.call(null,"Airbase Display Options"),(function (){var flight_path_display_controls = new cljs.core.Keyword(null,"map-display-controls-fn","map-display-controls-fn",1472969543).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
return flight_path_display_controls.call(null,"Flight Path Display Options");
})());
});
weathergen.ui.head = (function weathergen$ui$head(){
return hoplon.core.head.call(null,hoplon.core.title.call(null,javelin.core.formula.call(null,(function (mission,display_mode){
if(cljs.core.not.call(null,mission)){
return "Virtual Mission Tools";
} else {
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1(weathergen.falcon.files.mission.theaterdef_name.call(null,mission)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(" - "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(mission)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"briefing","briefing",-176308969),display_mode))?".vmtb":null))].join('');
}
})).call(null,weathergen.ui.mission,weathergen.ui.display_mode)),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"lib/jquery-minicolors/jquery.minicolors.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"title","title",636505583),"main",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.script.call(null,new cljs.core.Keyword(null,"src","src",-1651076051),"lib/jquery-minicolors/jquery.minicolors.min.js",new cljs.core.Keyword(null,"type","type",1174270348),"text/javascript"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"select2.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"style.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"title","title",636505583),"main",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/open-sans-condensed/open-sans-condensed.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/share-tech-mono/share-tech-mono.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.link.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"fonts/source-code-pro/source-code-pro.css",new cljs.core.Keyword(null,"rel","rel",1378823488),"stylesheet",new cljs.core.Keyword(null,"type","type",1174270348),"text/css"),hoplon.core.style.call(null,new cljs.core.Keyword(null,"type","type",1174270348),"text/css",garden.core.css.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"fieldset","fieldset",-1949770816),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),"10px"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.selectors.input.call(null,garden.selectors.attr_EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348),new cljs.core.Keyword(null,"range","range",1639692286))),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding","padding",1660304693),"5px"], null)], null),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,".info-grid",".info-grid",1372988462),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"border-collapse","border-collapse",919100239),"collapse",new cljs.core.Keyword(null,"border","border",1444987323),"solid 1px"], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"thead","thead",-291875296),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"background","background",-863952629),"lightgray",new cljs.core.Keyword(null,"border-bottom","border-bottom",2110948415),"1px solid black"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"tr","tr",-1424774646),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [garden.selectors._AMPERSAND_.call(null,garden.selectors.nth_child.call(null,new cljs.core.Keyword(null,"even","even",-275845692))),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"background","background",-863952629),"#F2F0E0"], null)], null)], null)], null))));
});
weathergen.ui.message_display = (function weathergen$ui$message_display(){
return javelin.core.formula.call(null,(function (messages){
var iter__24200__auto__ = (function weathergen$ui$message_display_$_iter__50377(s__50378){
return (new cljs.core.LazySeq(null,(function (){
var s__50378__$1 = s__50378;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50378__$1);
if(temp__5278__auto__){
var s__50378__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50378__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50378__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50380 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50379 = (0);
while(true){
if((i__50379 < size__24199__auto__)){
var message = cljs.core._nth.call(null,c__24198__auto__,i__50379);
cljs.core.chunk_append.call(null,b__50380,(function (){var visible_QMARK_ = javelin.core.cell.call(null,true);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border","border",1444987323),"double",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"background","background",-863952629),"#945594",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"5px"], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"150%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),"-8px",new cljs.core.Keyword(null,"right","right",-452581833),"5px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (i__50379,visible_QMARK_,message,c__24198__auto__,size__24199__auto__,b__50380,s__50378__$2,temp__5278__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(i__50379,visible_QMARK_,message,c__24198__auto__,size__24199__auto__,b__50380,s__50378__$2,temp__5278__auto__))
,"\u00D7"));
})());

var G__50381 = (i__50379 + (1));
i__50379 = G__50381;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50380),weathergen$ui$message_display_$_iter__50377.call(null,cljs.core.chunk_rest.call(null,s__50378__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50380),null);
}
} else {
var message = cljs.core.first.call(null,s__50378__$2);
return cljs.core.cons.call(null,(function (){var visible_QMARK_ = javelin.core.cell.call(null,true);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"fade-toggle","fade-toggle",-1468421852),visible_QMARK_,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"border","border",1444987323),"double",new cljs.core.Keyword(null,"border-color","border-color",-2059162761),"black",new cljs.core.Keyword(null,"background","background",-863952629),"#945594",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"position","position",-2011731912),"relative",new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),"3px"], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"padding-right","padding-right",-1250249681),"5px"], null),message),hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"font-size","font-size",-1847940346),"150%",new cljs.core.Keyword(null,"font-weight","font-weight",2085804583),"bold",new cljs.core.Keyword(null,"top","top",-1856271961),"-8px",new cljs.core.Keyword(null,"right","right",-452581833),"5px",new cljs.core.Keyword(null,"cursor","cursor",1011937484),"pointer"], null),new cljs.core.Keyword(null,"click","click",1912301393),((function (visible_QMARK_,message,s__50378__$2,temp__5278__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(visible_QMARK_,message,s__50378__$2,temp__5278__auto__))
,"\u00D7"));
})(),weathergen$ui$message_display_$_iter__50377.call(null,cljs.core.rest.call(null,s__50378__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24200__auto__.call(null,messages);
})).call(null,weathergen.ui.messages);
});
/**
 * Returns UI that renders the titlebar.
 */
weathergen.ui.titlebar = (function weathergen$ui$titlebar(){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"titlebar",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 5, [new cljs.core.Keyword(null,"background","background",-863952629),"black",new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"padding","padding",1660304693),weathergen.ui.common.px.call(null,(4),(13)),new cljs.core.Keyword(null,"margin-bottom","margin-bottom",388334941),weathergen.ui.common.px.call(null,(2)),new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(64))], null),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"titlebar-contents",weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"left-words",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin-top","margin-top",392161226),weathergen.ui.common.px.call(null,(14))], null),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"title",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"padding-top","padding-top",1929675955),weathergen.ui.common.px.call(null,(16)),new cljs.core.Keyword(null,"font-size","font-size",-1847940346),weathergen.ui.common.pct.call(null,(200))], null),"Virtual Mission Tools"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"version",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(10))], null),javelin.core.formula.call(null,(function (build_info){
var map__50384 = build_info;
var map__50384__$1 = ((((!((map__50384 == null)))?((((map__50384.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50384.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50384):map__50384);
var VERSION = cljs.core.get.call(null,map__50384__$1,"VERSION");
var CHANNEL = cljs.core.get.call(null,map__50384__$1,"CHANNEL");
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1("("),cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var or__23338__auto__ = VERSION;
if(cljs.core.truth_(or__23338__auto__)){
return or__23338__auto__;
} else {
return "dev-build";
}
})()),cljs.core.str.cljs$core$IFn$_invoke$arity$1((cljs.core.truth_((function (){var and__23326__auto__ = CHANNEL;
if(cljs.core.truth_(and__23326__auto__)){
return cljs.core.not_EQ_.call(null,CHANNEL,"stable");
} else {
return and__23326__auto__;
}
})())?[cljs.core.str.cljs$core$IFn$_invoke$arity$1("@"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(CHANNEL)].join(''):null)),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join('');
})).call(null,weathergen.ui.build_info)),hoplon.core.span.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"byline",new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(5))], null),"by",weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block"], null),new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"padding-left","padding-left",-1180879053),weathergen.ui.common.px.call(null,(5))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:link","a:link",-504615780),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:visited","a:visited",-737262631),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:hover","a:hover",-1474674872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"lightblue"], null)], null)], null),hoplon.core.a.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"http://firstfighterwing.com/VFW/member.php?893-Tyrant",new cljs.core.Keyword(null,"target","target",253001721),"_blank","Tyrant")))),weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"right-words",weathergen.ui.common.styled.call(null,new cljs.core.Keyword(null,"debug","debug",-1608172596),"helpstring",new cljs.core.Keyword(null,"garden","garden",-1966516149),new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span","span",1394872991),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(100)),new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(45))], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a","a",-2123407586),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"color","color",1011675173),"white",new cljs.core.Keyword(null,"margin-left","margin-left",2015598377),weathergen.ui.common.ems.call(null,0.2)], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:visited","a:visited",-737262631),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"white"], null)], null),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"a:hover","a:hover",-1474674872),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),"lightblue"], null)], null)], null),hoplon.core.span.call(null,"Help? Bug? Feature request? Click",hoplon.core.a.call(null,new cljs.core.Keyword(null,"href","href",-793805698),"help.html",new cljs.core.Keyword(null,"target","target",253001721),"_blank","here"),".")),hoplon.core.a.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"position","position",-2011731912),"absolute",new cljs.core.Keyword(null,"right","right",-452581833),weathergen.ui.common.px.call(null,(20)),new cljs.core.Keyword(null,"top","top",-1856271961),weathergen.ui.common.px.call(null,(12))], null),new cljs.core.Keyword(null,"href","href",-793805698),"http://firstfighterwing.com",new cljs.core.Keyword(null,"target","target",253001721),"_blank",hoplon.core.img.call(null,new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"display","display",242065432),"inline-block",new cljs.core.Keyword(null,"height","height",1025178622),weathergen.ui.common.px.call(null,(64))], null),new cljs.core.Keyword(null,"src","src",-1651076051),"images/1stVFW_Insignia-64.png")))));
});
weathergen.ui.section_ctor = cljs.core.PersistentHashMap.fromArrays([new cljs.core.Keyword(null,"mission-info-section","mission-info-section",1401749344),new cljs.core.Keyword(null,"weather-override-parameters","weather-override-parameters",491414981),new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),new cljs.core.Keyword(null,"forecast-section","forecast-section",-1278731643),new cljs.core.Keyword(null,"air-forces-section","air-forces-section",-222064121),new cljs.core.Keyword(null,"briefing-notes-section","briefing-notes-section",1870993417),new cljs.core.Keyword(null,"advanced-controls","advanced-controls",-278238996),new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),new cljs.core.Keyword(null,"cloud-controls","cloud-controls",817145581),new cljs.core.Keyword(null,"wind-stability-parameters","wind-stability-parameters",1572956177),new cljs.core.Keyword(null,"weather-parameters","weather-parameters",-1852076459),new cljs.core.Keyword(null,"save-briefing-section","save-briefing-section",143974425),new cljs.core.Keyword(null,"oob-section","oob-section",1786899258),new cljs.core.Keyword(null,"map-controls-section","map-controls-section",684229466),new cljs.core.Keyword(null,"test-section","test-section",-945916038),new cljs.core.Keyword(null,"weather-type-configuration","weather-type-configuration",-358032997),new cljs.core.Keyword(null,"step-controls","step-controls",-854420677),new cljs.core.Keyword(null,"flights-section","flights-section",1247077532)],[weathergen.ui.mission_info_section,weathergen.ui.weather_override_parameters,weathergen.ui.weather_display_controls,weathergen.ui.forecast_section,weathergen.ui.air_forces_section,weathergen.ui.briefing_notes_section,weathergen.ui.advanced_controls,weathergen.ui.serialization_controls,weathergen.ui.cloud_controls,weathergen.ui.wind_stability_parameters,weathergen.ui.weather_parameters,weathergen.ui.save_briefing_section,weathergen.ui.order_of_battle_section,weathergen.ui.map_controls_section,weathergen.ui.test_section,weathergen.ui.weather_type_configuration,weathergen.ui.step_controls,(function (opts){
var ctor = new cljs.core.Keyword(null,"controls-fn","controls-fn",-807620277).cljs$core$IFn$_invoke$arity$1(weathergen.ui.flight_paths_layer);
var scroll_container = new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120).cljs$core$IFn$_invoke$arity$1(opts);
return ctor.call(null,scroll_container);
})]);
/**
 * Emits an app page. `section-infos` is a seq of maps, one for each
 *   tab, with keys `:title`, `:id`, and `:sections`. The sections are a
 *   seq of keys into `section-ctor` and the parameters for that
 *   section.
 */
weathergen.ui.weather_page = (function weathergen$ui$weather_page(section_infos){
return hoplon.core.html.call(null,weathergen.ui.head.call(null),hoplon.core.body.call(null,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"css","css",1135045163),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"margin","margin",-995903681),"8px"], null)], null),hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"app",weathergen.ui.titlebar.call(null),weathergen.ui.message_display.call(null),(function (){var right_width = (575);
var portrait_QMARK_ = javelin.core.formula.call(null,((function (right_width){
return (function (map_size,window_size){
var vec__50472 = map_size;
var grid_width = cljs.core.nth.call(null,vec__50472,(0),null);
var grid_height = cljs.core.nth.call(null,vec__50472,(1),null);
var vec__50475 = window_size;
var window_width = cljs.core.nth.call(null,vec__50475,(0),null);
var window_height = cljs.core.nth.call(null,vec__50475,(1),null);
return (window_width < ((grid_width + right_width) + (-10)));
});})(right_width))
).call(null,weathergen.ui.map_size,weathergen.ui.window_size);
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_width,portrait_QMARK_){
return (function (portrait_QMARK___$1,p__50478){
var vec__50479 = p__50478;
var window_width = cljs.core.nth.call(null,vec__50479,(0),null);
var window_height = cljs.core.nth.call(null,vec__50479,(1),null);
return new cljs.core.PersistentArrayMap(null, 4, [new cljs.core.Keyword(null,"display","display",242065432),"flex",new cljs.core.Keyword(null,"flex-direction","flex-direction",364609438),(cljs.core.truth_(portrait_QMARK___$1)?"column":"row"),new cljs.core.Keyword(null,"overflow","overflow",2058931880),(cljs.core.truth_(portrait_QMARK___$1)?"show":"hidden"),new cljs.core.Keyword(null,"height","height",1025178622),(cljs.core.truth_(portrait_QMARK___$1)?"100%":[cljs.core.str.cljs$core$IFn$_invoke$arity$1((window_height - (90))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("px")].join(''))], null);
});})(right_width,portrait_QMARK_))
).call(null,portrait_QMARK_,weathergen.ui.window_size),hoplon.core.div.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"left-column",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_width,portrait_QMARK_){
return (function (portrait_QMARK___$1){
if(cljs.core.truth_(portrait_QMARK___$1)){
return cljs.core.PersistentArrayMap.EMPTY;
} else {
return new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"height","height",1025178622),"auto"], null);
}
});})(right_width,portrait_QMARK_))
).call(null,portrait_QMARK_),weathergen.ui.button_bar.call(null),weathergen.ui.grid.call(null,new cljs.core.Keyword(null,"display-params","display-params",573405707),weathergen.ui.display_params,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401),weathergen.ui.weather_data,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443),weathergen.ui.selected_cell,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204),weathergen.ui.wind_stability_areas,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),weathergen.ui.weather_overrides,new cljs.core.Keyword(null,"computing","computing",-1002386157),weathergen.ui.computing,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243),weathergen.ui.pressure_unit,new cljs.core.Keyword(null,"nx","nx",-1996436366),cljs.core.first.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))),new cljs.core.Keyword(null,"ny","ny",1701791641),cljs.core.second.call(null,new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.weather_params))))),(function (){var right_column = hoplon.core.div.call(null);
return right_column.call(null,new cljs.core.Keyword(null,"class","class",-2030961996),"right-column",new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (right_column,right_width,portrait_QMARK_){
return (function (portrait_QMARK___$1){
return cljs.core.merge.call(null,new cljs.core.PersistentArrayMap(null, 6, [new cljs.core.Keyword(null,"display","display",242065432),"block",new cljs.core.Keyword(null,"align-content","align-content",-990200349),"flex-start",new cljs.core.Keyword(null,"flex-wrap","flex-wrap",455413707),"wrap",new cljs.core.Keyword(null,"flex-grow","flex-grow",1865160747),(1),new cljs.core.Keyword(null,"min-width","min-width",1926193728),[cljs.core.str.cljs$core$IFn$_invoke$arity$1((right_width - (20))),cljs.core.str.cljs$core$IFn$_invoke$arity$1("px")].join(''),new cljs.core.Keyword(null,"width","width",-384071477),(0)], null),(cljs.core.truth_(portrait_QMARK___$1)?null:new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"overflow","overflow",2058931880),"auto",new cljs.core.Keyword(null,"height","height",1025178622),"auto"], null)));
});})(right_column,right_width,portrait_QMARK_))
).call(null,portrait_QMARK_),weathergen.ui.tabs.tabs.call(null,new cljs.core.Keyword(null,"selected","selected",574897764),javelin.core.cell.call(null,new cljs.core.Keyword(null,"id","id",-1388402092).cljs$core$IFn$_invoke$arity$1(cljs.core.first.call(null,section_infos))),new cljs.core.Keyword(null,"tabs","tabs",-779855354),(function (){var iter__24200__auto__ = ((function (right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__50482(s__50483){
return (new cljs.core.LazySeq(null,((function (right_column,right_width,portrait_QMARK_){
return (function (){
var s__50483__$1 = s__50483;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__50483__$1);
if(temp__5278__auto__){
var s__50483__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50483__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50483__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50485 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50484 = (0);
while(true){
if((i__50484 < size__24199__auto__)){
var map__50522 = cljs.core._nth.call(null,c__24198__auto__,i__50484);
var map__50522__$1 = ((((!((map__50522 == null)))?((((map__50522.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50522.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50522):map__50522);
var title = cljs.core.get.call(null,map__50522__$1,new cljs.core.Keyword(null,"title","title",636505583));
var id = cljs.core.get.call(null,map__50522__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var sections = cljs.core.get.call(null,map__50522__$1,new cljs.core.Keyword(null,"sections","sections",-886710106));
cljs.core.chunk_append.call(null,b__50485,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var iter__24200__auto__ = ((function (i__50484,map__50522,map__50522__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50485,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__50482_$_iter__50524(s__50525){
return (new cljs.core.LazySeq(null,((function (i__50484,map__50522,map__50522__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50485,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function (){
var s__50525__$1 = s__50525;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__50525__$1);
if(temp__5278__auto____$1){
var s__50525__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50525__$2)){
var c__24198__auto____$1 = cljs.core.chunk_first.call(null,s__50525__$2);
var size__24199__auto____$1 = cljs.core.count.call(null,c__24198__auto____$1);
var b__50527 = cljs.core.chunk_buffer.call(null,size__24199__auto____$1);
if((function (){var i__50526 = (0);
while(true){
if((i__50526 < size__24199__auto____$1)){
var vec__50534 = cljs.core._nth.call(null,c__24198__auto____$1,i__50526);
var section = cljs.core.nth.call(null,vec__50534,(0),null);
var opts = cljs.core.nth.call(null,vec__50534,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__50527,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})());

var G__50558 = (i__50526 + (1));
i__50526 = G__50558;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50527),weathergen$ui$weather_page_$_iter__50482_$_iter__50524.call(null,cljs.core.chunk_rest.call(null,s__50525__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50527),null);
}
} else {
var vec__50537 = cljs.core.first.call(null,s__50525__$2);
var section = cljs.core.nth.call(null,vec__50537,(0),null);
var opts = cljs.core.nth.call(null,vec__50537,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
return cljs.core.cons.call(null,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})(),weathergen$ui$weather_page_$_iter__50482_$_iter__50524.call(null,cljs.core.rest.call(null,s__50525__$2)));
}
} else {
return null;
}
break;
}
});})(i__50484,map__50522,map__50522__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50485,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
,null,null));
});})(i__50484,map__50522,map__50522__$1,title,id,sections,c__24198__auto__,size__24199__auto__,b__50485,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
;
return iter__24200__auto__.call(null,cljs.core.partition.call(null,(2),sections));
})()], null));

var G__50559 = (i__50484 + (1));
i__50484 = G__50559;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50485),weathergen$ui$weather_page_$_iter__50482.call(null,cljs.core.chunk_rest.call(null,s__50483__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50485),null);
}
} else {
var map__50540 = cljs.core.first.call(null,s__50483__$2);
var map__50540__$1 = ((((!((map__50540 == null)))?((((map__50540.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__50540.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__50540):map__50540);
var title = cljs.core.get.call(null,map__50540__$1,new cljs.core.Keyword(null,"title","title",636505583));
var id = cljs.core.get.call(null,map__50540__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var sections = cljs.core.get.call(null,map__50540__$1,new cljs.core.Keyword(null,"sections","sections",-886710106));
return cljs.core.cons.call(null,new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),title,new cljs.core.Keyword(null,"id","id",-1388402092),id,new cljs.core.Keyword(null,"ui","ui",-469653645),(function (){var iter__24200__auto__ = ((function (map__50540,map__50540__$1,title,id,sections,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__50482_$_iter__50542(s__50543){
return (new cljs.core.LazySeq(null,((function (map__50540,map__50540__$1,title,id,sections,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function (){
var s__50543__$1 = s__50543;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__50543__$1);
if(temp__5278__auto____$1){
var s__50543__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__50543__$2)){
var c__24198__auto__ = cljs.core.chunk_first.call(null,s__50543__$2);
var size__24199__auto__ = cljs.core.count.call(null,c__24198__auto__);
var b__50545 = cljs.core.chunk_buffer.call(null,size__24199__auto__);
if((function (){var i__50544 = (0);
while(true){
if((i__50544 < size__24199__auto__)){
var vec__50552 = cljs.core._nth.call(null,c__24198__auto__,i__50544);
var section = cljs.core.nth.call(null,vec__50552,(0),null);
var opts = cljs.core.nth.call(null,vec__50552,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__50545,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})());

var G__50560 = (i__50544 + (1));
i__50544 = G__50560;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50545),weathergen$ui$weather_page_$_iter__50482_$_iter__50542.call(null,cljs.core.chunk_rest.call(null,s__50543__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__50545),null);
}
} else {
var vec__50555 = cljs.core.first.call(null,s__50543__$2);
var section = cljs.core.nth.call(null,vec__50555,(0),null);
var opts = cljs.core.nth.call(null,vec__50555,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
return cljs.core.cons.call(null,(function (){var timer_name__15521__auto__ = [cljs.core.str.cljs$core$IFn$_invoke$arity$1("Rendering "),cljs.core.str.cljs$core$IFn$_invoke$arity$1(section)].join('');
var ignore__15522__auto__ = console.time(timer_name__15521__auto__);
var result__15523__auto__ = ctor.call(null,cljs.core.assoc.call(null,opts,new cljs.core.Keyword("weathergen.ui","scroll-container","weathergen.ui/scroll-container",236222120),right_column));
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
})(),weathergen$ui$weather_page_$_iter__50482_$_iter__50542.call(null,cljs.core.rest.call(null,s__50543__$2)));
}
} else {
return null;
}
break;
}
});})(map__50540,map__50540__$1,title,id,sections,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
,null,null));
});})(map__50540,map__50540__$1,title,id,sections,s__50483__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
;
return iter__24200__auto__.call(null,cljs.core.partition.call(null,(2),sections));
})()], null),weathergen$ui$weather_page_$_iter__50482.call(null,cljs.core.rest.call(null,s__50483__$2)));
}
} else {
return null;
}
break;
}
});})(right_column,right_width,portrait_QMARK_))
,null,null));
});})(right_column,right_width,portrait_QMARK_))
;
return iter__24200__auto__.call(null,section_infos);
})()));
})());
})()),weathergen.ui.debug_info.call(null)));
});
