// 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__23136__auto__ = new cljs.core.Keyword(null,"safari","safari",497115653).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(and__23136__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__23136__auto__;
}
})();
weathergen.ui.ie_QMARK_ = (function (){var or__23148__auto__ = new cljs.core.Keyword(null,"msie","msie",719469183).cljs$core$IFn$_invoke$arity$1(weathergen.ui.agents);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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_44004 = jQuery(window);
weathergen.ui.window_size = javelin.core.cell.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [window_44004.width(),window_44004.height()], null));

window_44004.resize(((function (window_44004){
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_44004.width(),window_44004.height()], null));
});})(window_44004))
);
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 args44005 = [];
var len__24369__auto___44008 = arguments.length;
var i__24370__auto___44009 = (0);
while(true){
if((i__24370__auto___44009 < len__24369__auto___44008)){
args44005.push((arguments[i__24370__auto___44009]));

var G__44010 = (i__24370__auto___44009 + (1));
i__24370__auto___44009 = G__44010;
continue;
} else {
}
break;
}

var G__44007 = args44005.length;
switch (G__44007) {
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(args44005.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__44024 = 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__44024,(0),null);
var p = cljs.core.nth.call(null,vec__44024,(1),null);
var f = cljs.core.nth.call(null,vec__44024,(2),null);
var s = cljs.core.nth.call(null,vec__44024,(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__23486__auto__ = new cljs.core.Keyword(null,"poor","poor",1462482211).cljs$core$IFn$_invoke$arity$1(stratus_base);
var y__23487__auto__ = new cljs.core.Keyword(null,"inclement","inclement",-550669382).cljs$core$IFn$_invoke$arity$1(stratus_base);
return ((x__23486__auto__ > y__23487__auto__) ? x__23486__auto__ : y__23487__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__44027 = 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__44027,(0),null);
var p = cljs.core.nth.call(null,vec__44027,(1),null);
var f = cljs.core.nth.call(null,vec__44027,(2),null);
var s = cljs.core.nth.call(null,vec__44027,(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__44030 = 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__44030,(0),null);
var p = cljs.core.nth.call(null,vec__44030,(1),null);
var f = cljs.core.nth.call(null,vec__44030,(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__23493__auto__ = (new cljs.core.Keyword(null,"fair","fair",1684139423).cljs$core$IFn$_invoke$arity$1(stratus_base) - (1000));
var y__23494__auto__ = f;
return ((x__23493__auto__ < y__23494__auto__) ? x__23493__auto__ : y__23494__auto__);
})(),new cljs.core.Keyword(null,"poor","poor",1462482211),(function (){var x__23493__auto__ = (stratus_top - (1000));
var y__23494__auto__ = p;
return ((x__23493__auto__ < y__23494__auto__) ? x__23493__auto__ : y__23494__auto__);
})(),new cljs.core.Keyword(null,"inclement","inclement",-550669382),(function (){var x__23493__auto__ = (stratus_top - (1000));
var y__23494__auto__ = i;
return ((x__23493__auto__ < y__23494__auto__) ? x__23493__auto__ : y__23494__auto__);
})()], null);
})(),new cljs.core.Keyword(null,"contrails","contrails",1430581743),(function (){var vec__44033 = 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__44033,(0),null);
var p = cljs.core.nth.call(null,vec__44033,(1),null);
var f = cljs.core.nth.call(null,vec__44033,(2),null);
var s = cljs.core.nth.call(null,vec__44033,(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__44036 = window_size;
var window_width = cljs.core.nth.call(null,vec__44036,(0),null);
var window_height = cljs.core.nth.call(null,vec__44036,(1),null);
var dim = (function (){var x__23486__auto__ = (250);
var y__23487__auto__ = (function (){var x__23493__auto__ = window_width;
var y__23494__auto__ = (window_height - (140));
return ((x__23493__auto__ < y__23494__auto__) ? x__23493__auto__ : y__23494__auto__);
})();
return ((x__23486__auto__ > y__23487__auto__) ? x__23486__auto__ : y__23487__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__44039,G__44040){
return G__44039.call(null,4.0,new cljs.core.Keyword(null,"text-size","text-size",-945618309).cljs$core$IFn$_invoke$arity$1(G__44040));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_icon_scale = javelin.core.formula.call(null,(function (G__44041,G__44042){
return G__44041.call(null,4.0,new cljs.core.Keyword(null,"icon-size","icon-size",414161352).cljs$core$IFn$_invoke$arity$1(G__44042));
})).call(null,Math.pow,weathergen.ui.map_display);
weathergen.ui.map_show_text_background_QMARK_ = javelin.core.formula.call(null,(function (G__44043){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__44043);
})).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__44044){
var or__23148__auto__ = new cljs.core.Keyword(null,"zoom-speed","zoom-speed",1787688902).cljs$core$IFn$_invoke$arity$1(G__44044);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__44045 = 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__44045,(0),null);
var ny = cljs.core.nth.call(null,vec__44045,(1),null);
var map__44048 = map_pan;
var map__44048__$1 = ((((!((map__44048 == null)))?((((map__44048.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44048.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44048):map__44048);
var x = cljs.core.get.call(null,map__44048__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__44048__$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__23136__auto__ = mission;
if(cljs.core.truth_(and__23136__auto__)){
return effective_visible_sides;
} else {
return and__23136__auto__;
}
})())?cljs.core.map.call(null,weathergen.falcon.files.mission.team_number,cljs.core.filter.call(null,(function (p1__44050_SHARP_){
return effective_visible_sides.call(null,weathergen.falcon.files.mission.side.call(null,mission,p1__44050_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.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__44051,G__44053,G__44052){
return G__44051.call(null,G__44052,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__44053));
})).call(null,cljs.core.get,weathergen.ui.selected_cell,weathergen.ui.weather_data);
weathergen.ui.cell_count = javelin.core.formula.call(null,(function (G__44054){
return new cljs.core.Keyword(null,"cell-count","cell-count",-441457582).cljs$core$IFn$_invoke$arity$1(G__44054);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.wind_stability_areas = javelin.core.formula.call(null,(function (G__44055){
return new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__44055);
})).call(null,weathergen.ui.weather_params);
weathergen.ui.weather_overrides = javelin.core.formula.call(null,(function (G__44056){
return new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__44056);
})).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__44058,G__44057){
if(cljs.core.truth_(G__44057.call(null,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__44058)))){
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__44058))){
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__44059){
return new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243).cljs$core$IFn$_invoke$arity$1(G__44059);
})).call(null,weathergen.ui.display_params);
weathergen.ui.all_squadrons = javelin.core.formula.call(null,(function (G__44062,G__44061,G__44060,G__44063){
return G__44060.call(null,cljs.core.PersistentHashSet.EMPTY,G__44061.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__44062.call(null,G__44063))));
})).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__44066,G__44065,G__44069,G__44068,G__44067){
return G__44065.call(null,cljs.core.PersistentHashSet.EMPTY,G__44066.call(null,(function (p1__44064_SHARP_){
return G__44067.call(null,G__44068,p1__44064_SHARP_);
}),G__44069));
})).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__44071,G__44076,G__44073,G__44075,G__44074,G__44072){
return G__44071.call(null,G__44072.call(null,(function (p1__44070_SHARP_){
return G__44073.call(null,G__44074.call(null,G__44075,p1__44070_SHARP_));
}),G__44076));
})).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__23148__auto__ = (function (){var and__23136__auto__ = is_empty_QMARK_;
if(and__23136__auto__){
return hide_empty_QMARK_;
} else {
return and__23136__auto__;
}
})();
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
var and__23136__auto__ = is_inoperable_QMARK_;
if(and__23136__auto__){
return hide_inoperable_QMARK_;
} else {
return and__23136__auto__;
}
}
})();
return cljs.core.not.call(null,hide_QMARK_);
});
weathergen.ui.all_airbases = javelin.core.formula.call(null,(function (G__44079,G__44078){
var G__44077 = G__44078;
var G__44077__$1 = (cljs.core.truth_((G__44077 == null))?null:G__44079.call(null,G__44077));
if(cljs.core.truth_((G__44077__$1 == null))){
return null;
} else {
return new cljs.core.Keyword(null,"air","air",-104121788).cljs$core$IFn$_invoke$arity$1(G__44077__$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__44080_SHARP_){
return weathergen.ui.list_airbase_QMARK_.call(null,p1__44080_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__24010__auto__ = (function weathergen$ui$iter__44081(s__44082){
return (new cljs.core.LazySeq(null,(function (){
var s__44082__$1 = s__44082;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__44082__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24006__auto__ = ((function (s__44082__$1,x,xs__5831__auto__,temp__5278__auto__){
return (function weathergen$ui$iter__44081_$_iter__44083(s__44084){
return (new cljs.core.LazySeq(null,((function (s__44082__$1,x,xs__5831__auto__,temp__5278__auto__){
return (function (){
var s__44084__$1 = s__44084;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__44084__$1);
if(temp__5278__auto____$1){
var s__44084__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__44084__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__44084__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__44086 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__44085 = (0);
while(true){
if((i__44085 < size__24009__auto__)){
var y = cljs.core._nth.call(null,c__24008__auto__,i__44085);
cljs.core.chunk_append.call(null,b__44086,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__44087 = (i__44085 + (1));
i__44085 = G__44087;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44086),weathergen$ui$iter__44081_$_iter__44083.call(null,cljs.core.chunk_rest.call(null,s__44084__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44086),null);
}
} else {
var y = cljs.core.first.call(null,s__44084__$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__44081_$_iter__44083.call(null,cljs.core.rest.call(null,s__44084__$2)));
}
} else {
return null;
}
break;
}
});})(s__44082__$1,x,xs__5831__auto__,temp__5278__auto__))
,null,null));
});})(s__44082__$1,x,xs__5831__auto__,temp__5278__auto__))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__auto__.call(null,cljs.core.range.call(null,(59))));
if(fs__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$iter__44081.call(null,cljs.core.rest.call(null,s__44082__$1)));
} else {
var G__44088 = cljs.core.rest.call(null,s__44082__$1);
s__44082__$1 = G__44088;
continue;
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24010__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__44089_44125 = cljs.core.seq.call(null,weathergen.ui.workers);
var chunk__44090_44126 = null;
var count__44091_44127 = (0);
var i__44092_44128 = (0);
while(true){
if((i__44092_44128 < count__44091_44127)){
var map__44093_44129 = cljs.core._nth.call(null,chunk__44090_44126,i__44092_44128);
var map__44093_44130__$1 = ((((!((map__44093_44129 == null)))?((((map__44093_44129.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44093_44129.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44093_44129):map__44093_44129);
var worker_44131 = cljs.core.get.call(null,map__44093_44130__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_44132 = cljs.core.get.call(null,map__44093_44130__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_44131.onmessage = ((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132){
return (function (e){
var c__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132){
return (function (state_44100){
var state_val_44101 = (state_44100[(1)]);
if((state_val_44101 === (1))){
var inst_44095 = (e["data"]);
var inst_44096 = weathergen.encoding.decode.call(null,inst_44095);
var state_44100__$1 = state_44100;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_44100__$1,(2),ch_44132,inst_44096);
} else {
if((state_val_44101 === (2))){
var inst_44098 = (state_44100[(2)]);
var state_44100__$1 = state_44100;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44100__$1,inst_44098);
} else {
return null;
}
}
});})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132))
;
return ((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,switch__38933__auto__,c__39047__auto__,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132){
return (function() {
var weathergen$ui$state_machine__38934__auto__ = null;
var weathergen$ui$state_machine__38934__auto____0 = (function (){
var statearr_44105 = [null,null,null,null,null,null,null];
(statearr_44105[(0)] = weathergen$ui$state_machine__38934__auto__);

(statearr_44105[(1)] = (1));

return statearr_44105;
});
var weathergen$ui$state_machine__38934__auto____1 = (function (state_44100){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44100);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44106){if((e44106 instanceof Object)){
var ex__38937__auto__ = e44106;
var statearr_44107_44133 = state_44100;
(statearr_44107_44133[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44134 = state_44100;
state_44100 = G__44134;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$state_machine__38934__auto__ = function(state_44100){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38934__auto____1.call(this,state_44100);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38934__auto____0;
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38934__auto____1;
return weathergen$ui$state_machine__38934__auto__;
})()
;})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,switch__38933__auto__,c__39047__auto__,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132))
})();
var state__39049__auto__ = (function (){var statearr_44108 = f__39048__auto__.call(null);
(statearr_44108[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44108;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132))
);

return c__39047__auto__;
});})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,map__44093_44129,map__44093_44130__$1,worker_44131,ch_44132))
;

var G__44135 = seq__44089_44125;
var G__44136 = chunk__44090_44126;
var G__44137 = count__44091_44127;
var G__44138 = (i__44092_44128 + (1));
seq__44089_44125 = G__44135;
chunk__44090_44126 = G__44136;
count__44091_44127 = G__44137;
i__44092_44128 = G__44138;
continue;
} else {
var temp__5278__auto___44139 = cljs.core.seq.call(null,seq__44089_44125);
if(temp__5278__auto___44139){
var seq__44089_44140__$1 = temp__5278__auto___44139;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__44089_44140__$1)){
var c__24059__auto___44141 = cljs.core.chunk_first.call(null,seq__44089_44140__$1);
var G__44142 = cljs.core.chunk_rest.call(null,seq__44089_44140__$1);
var G__44143 = c__24059__auto___44141;
var G__44144 = cljs.core.count.call(null,c__24059__auto___44141);
var G__44145 = (0);
seq__44089_44125 = G__44142;
chunk__44090_44126 = G__44143;
count__44091_44127 = G__44144;
i__44092_44128 = G__44145;
continue;
} else {
var map__44109_44146 = cljs.core.first.call(null,seq__44089_44140__$1);
var map__44109_44147__$1 = ((((!((map__44109_44146 == null)))?((((map__44109_44146.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44109_44146.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44109_44146):map__44109_44146);
var worker_44148 = cljs.core.get.call(null,map__44109_44147__$1,new cljs.core.Keyword(null,"worker","worker",938239996));
var ch_44149 = cljs.core.get.call(null,map__44109_44147__$1,new cljs.core.Keyword(null,"ch","ch",-554717905));
worker_44148.onmessage = ((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139){
return (function (e){
var c__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139){
return (function (state_44116){
var state_val_44117 = (state_44116[(1)]);
if((state_val_44117 === (1))){
var inst_44111 = (e["data"]);
var inst_44112 = weathergen.encoding.decode.call(null,inst_44111);
var state_44116__$1 = state_44116;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_44116__$1,(2),ch_44149,inst_44112);
} else {
if((state_val_44117 === (2))){
var inst_44114 = (state_44116[(2)]);
var state_44116__$1 = state_44116;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44116__$1,inst_44114);
} else {
return null;
}
}
});})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139))
;
return ((function (seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,switch__38933__auto__,c__39047__auto__,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139){
return (function() {
var weathergen$ui$state_machine__38934__auto__ = null;
var weathergen$ui$state_machine__38934__auto____0 = (function (){
var statearr_44121 = [null,null,null,null,null,null,null];
(statearr_44121[(0)] = weathergen$ui$state_machine__38934__auto__);

(statearr_44121[(1)] = (1));

return statearr_44121;
});
var weathergen$ui$state_machine__38934__auto____1 = (function (state_44116){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44116);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44122){if((e44122 instanceof Object)){
var ex__38937__auto__ = e44122;
var statearr_44123_44150 = state_44116;
(statearr_44123_44150[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44151 = state_44116;
state_44116 = G__44151;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$state_machine__38934__auto__ = function(state_44116){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38934__auto____1.call(this,state_44116);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38934__auto____0;
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38934__auto____1;
return weathergen$ui$state_machine__38934__auto__;
})()
;})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,switch__38933__auto__,c__39047__auto__,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139))
})();
var state__39049__auto__ = (function (){var statearr_44124 = f__39048__auto__.call(null);
(statearr_44124[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44124;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,c__39047__auto__,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139))
);

return c__39047__auto__;
});})(seq__44089_44125,chunk__44090_44126,count__44091_44127,i__44092_44128,map__44109_44146,map__44109_44147__$1,worker_44148,ch_44149,seq__44089_44140__$1,temp__5278__auto___44139))
;

var G__44152 = cljs.core.next.call(null,seq__44089_44140__$1);
var G__44153 = null;
var G__44154 = (0);
var G__44155 = (0);
seq__44089_44125 = G__44152;
chunk__44090_44126 = G__44153;
count__44091_44127 = G__44154;
i__44092_44128 = G__44155;
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__39047__auto___44398 = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto___44398){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto___44398){
return (function (state_44320){
var state_val_44321 = (state_44320[(1)]);
if((state_val_44321 === (7))){
var inst_44172 = (state_44320[(7)]);
var inst_44178 = (state_44320[(8)]);
var inst_44170 = (state_44320[(9)]);
var inst_44178__$1 = cljs.core._nth.call(null,inst_44170,inst_44172);
var inst_44180 = (inst_44178__$1 == null);
var inst_44181 = cljs.core.not.call(null,inst_44180);
var state_44320__$1 = (function (){var statearr_44322 = state_44320;
(statearr_44322[(8)] = inst_44178__$1);

return statearr_44322;
})();
if(inst_44181){
var statearr_44323_44399 = state_44320__$1;
(statearr_44323_44399[(1)] = (10));

} else {
var statearr_44324_44400 = state_44320__$1;
(statearr_44324_44400[(1)] = (11));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (20))){
var state_44320__$1 = state_44320;
var statearr_44325_44401 = state_44320__$1;
(statearr_44325_44401[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (27))){
var inst_44234 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
if(cljs.core.truth_(inst_44234)){
var statearr_44326_44402 = state_44320__$1;
(statearr_44326_44402[(1)] = (31));

} else {
var statearr_44327_44403 = state_44320__$1;
(statearr_44327_44403[(1)] = (32));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (1))){
var state_44320__$1 = state_44320;
var statearr_44328_44404 = state_44320__$1;
(statearr_44328_44404[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (24))){
var inst_44248 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44329_44405 = state_44320__$1;
(statearr_44329_44405[(2)] = inst_44248);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (39))){
var inst_44272 = cljs.core.async.timeout.call(null,(500));
var state_44320__$1 = state_44320;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44320__$1,(42),inst_44272);
} else {
if((state_val_44321 === (46))){
var inst_44263 = (state_44320[(10)]);
var inst_44262 = (state_44320[(11)]);
var inst_44304 = (state_44320[(2)]);
var inst_44305 = cljs.core.nth.call(null,inst_44304,(0),null);
var inst_44306 = cljs.core.nth.call(null,inst_44304,(1),null);
var inst_44307 = cljs.core.disj.call(null,inst_44262,inst_44306);
var inst_44308 = cljs.core.merge.call(null,inst_44263,inst_44305);
var inst_44262__$1 = inst_44307;
var inst_44263__$1 = inst_44308;
var state_44320__$1 = (function (){var statearr_44330 = state_44320;
(statearr_44330[(10)] = inst_44263__$1);

(statearr_44330[(11)] = inst_44262__$1);

return statearr_44330;
})();
var statearr_44331_44406 = state_44320__$1;
(statearr_44331_44406[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (4))){
var inst_44161 = (state_44320[(12)]);
var inst_44161__$1 = (state_44320[(2)]);
var inst_44162 = cljs.core.nth.call(null,inst_44161__$1,(0),null);
var inst_44163 = cljs.core.nth.call(null,inst_44161__$1,(1),null);
var inst_44168 = cljs.core.seq.call(null,weathergen.ui.workers);
var inst_44169 = inst_44168;
var inst_44170 = null;
var inst_44171 = (0);
var inst_44172 = (0);
var state_44320__$1 = (function (){var statearr_44332 = state_44320;
(statearr_44332[(13)] = inst_44169);

(statearr_44332[(7)] = inst_44172);

(statearr_44332[(12)] = inst_44161__$1);

(statearr_44332[(14)] = inst_44163);

(statearr_44332[(9)] = inst_44170);

(statearr_44332[(15)] = inst_44162);

(statearr_44332[(16)] = inst_44171);

return statearr_44332;
})();
var statearr_44333_44407 = state_44320__$1;
(statearr_44333_44407[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (15))){
var inst_44191 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44334_44408 = state_44320__$1;
(statearr_44334_44408[(2)] = inst_44191);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (21))){
var inst_44251 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44335_44409 = state_44320__$1;
(statearr_44335_44409[(2)] = inst_44251);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (31))){
var inst_44218 = (state_44320[(17)]);
var inst_44236 = cljs.core.apply.call(null,cljs.core.hash_map,inst_44218);
var state_44320__$1 = state_44320;
var statearr_44336_44410 = state_44320__$1;
(statearr_44336_44410[(2)] = inst_44236);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (32))){
var inst_44218 = (state_44320[(17)]);
var state_44320__$1 = state_44320;
var statearr_44337_44411 = state_44320__$1;
(statearr_44337_44411[(2)] = inst_44218);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (40))){
var state_44320__$1 = state_44320;
var statearr_44338_44412 = state_44320__$1;
(statearr_44338_44412[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (33))){
var inst_44208 = (state_44320[(18)]);
var inst_44163 = (state_44320[(14)]);
var inst_44239 = (state_44320[(2)]);
var inst_44240 = cljs.core.get.call(null,inst_44239,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_44241 = cljs.core.get.call(null,inst_44239,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_44242 = cljs.core.assoc.call(null,inst_44163,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_44240);
var inst_44243 = weathergen.encoding.encode.call(null,inst_44242);
var inst_44244 = weathergen.ui.post_message.call(null,inst_44241,inst_44243);
var inst_44245 = cljs.core.next.call(null,inst_44208);
var inst_44169 = inst_44245;
var inst_44170 = null;
var inst_44171 = (0);
var inst_44172 = (0);
var state_44320__$1 = (function (){var statearr_44339 = state_44320;
(statearr_44339[(19)] = inst_44244);

(statearr_44339[(13)] = inst_44169);

(statearr_44339[(7)] = inst_44172);

(statearr_44339[(9)] = inst_44170);

(statearr_44339[(16)] = inst_44171);

return statearr_44339;
})();
var statearr_44340_44413 = state_44320__$1;
(statearr_44340_44413[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (13))){
var state_44320__$1 = state_44320;
var statearr_44341_44414 = state_44320__$1;
(statearr_44341_44414[(2)] = true);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (22))){
var inst_44208 = (state_44320[(18)]);
var inst_44212 = cljs.core.chunk_first.call(null,inst_44208);
var inst_44213 = cljs.core.chunk_rest.call(null,inst_44208);
var inst_44214 = cljs.core.count.call(null,inst_44212);
var inst_44169 = inst_44213;
var inst_44170 = inst_44212;
var inst_44171 = inst_44214;
var inst_44172 = (0);
var state_44320__$1 = (function (){var statearr_44342 = state_44320;
(statearr_44342[(13)] = inst_44169);

(statearr_44342[(7)] = inst_44172);

(statearr_44342[(9)] = inst_44170);

(statearr_44342[(16)] = inst_44171);

return statearr_44342;
})();
var statearr_44343_44415 = state_44320__$1;
(statearr_44343_44415[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (36))){
var inst_44263 = (state_44320[(10)]);
var inst_44161 = (state_44320[(12)]);
var inst_44163 = (state_44320[(14)]);
var inst_44262 = (state_44320[(11)]);
var inst_44162 = (state_44320[(15)]);
var inst_44258 = (state_44320[(20)]);
var inst_44267 = (function (){var vec__44157 = inst_44161;
var command = inst_44162;
var params = inst_44163;
var timer_name__15521__auto__ = "Receive weather results";
var ignore__15522__auto__ = inst_44258;
var chs = inst_44262;
var data = inst_44263;
return ((function (vec__44157,command,params,timer_name__15521__auto__,ignore__15522__auto__,chs,data,inst_44263,inst_44161,inst_44163,inst_44262,inst_44162,inst_44258,state_val_44321,c__39047__auto___44398){
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__44157,command,params,timer_name__15521__auto__,ignore__15522__auto__,chs,data,inst_44263,inst_44161,inst_44163,inst_44262,inst_44162,inst_44258,state_val_44321,c__39047__auto___44398))
})();
var inst_44268 = javelin.core.dosync_STAR_.call(null,inst_44267);
var inst_44269 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_44270 = new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(inst_44269);
var state_44320__$1 = (function (){var statearr_44344 = state_44320;
(statearr_44344[(21)] = inst_44268);

return statearr_44344;
})();
if(cljs.core.truth_(inst_44270)){
var statearr_44345_44416 = state_44320__$1;
(statearr_44345_44416[(1)] = (39));

} else {
var statearr_44346_44417 = state_44320__$1;
(statearr_44346_44417[(1)] = (40));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (41))){
var inst_44297 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44347_44418 = state_44320__$1;
(statearr_44347_44418[(2)] = inst_44297);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (43))){
var inst_44285 = ((-60) * (6));
var inst_44286 = cljs.core.deref.call(null,weathergen.ui.movement_params);
var inst_44287 = new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(inst_44286);
var inst_44288 = (inst_44285 / inst_44287);
var inst_44289 = Math.floor(inst_44288);
var inst_44290 = weathergen.ui.move.call(null,inst_44289);
var state_44320__$1 = state_44320;
var statearr_44348_44419 = state_44320__$1;
(statearr_44348_44419[(2)] = inst_44290);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (29))){
var state_44320__$1 = state_44320;
var statearr_44349_44420 = state_44320__$1;
(statearr_44349_44420[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (44))){
var inst_44292 = weathergen.ui.move.call(null,(1));
var state_44320__$1 = state_44320;
var statearr_44350_44421 = state_44320__$1;
(statearr_44350_44421[(2)] = inst_44292);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (6))){
var inst_44255 = (state_44320[(2)]);
var inst_44256 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,true);
var inst_44257 = console.time("compute-weather");
var inst_44258 = console.time("Receive weather results");
var inst_44259 = cljs.core.map.call(null,new cljs.core.Keyword(null,"ch","ch",-554717905),weathergen.ui.workers);
var inst_44260 = cljs.core.set.call(null,inst_44259);
var inst_44261 = cljs.core.PersistentHashMap.EMPTY;
var inst_44262 = inst_44260;
var inst_44263 = inst_44261;
var state_44320__$1 = (function (){var statearr_44351 = state_44320;
(statearr_44351[(10)] = inst_44263);

(statearr_44351[(22)] = inst_44257);

(statearr_44351[(23)] = inst_44255);

(statearr_44351[(11)] = inst_44262);

(statearr_44351[(24)] = inst_44256);

(statearr_44351[(20)] = inst_44258);

return statearr_44351;
})();
var statearr_44352_44422 = state_44320__$1;
(statearr_44352_44422[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (28))){
var state_44320__$1 = state_44320;
var statearr_44353_44423 = state_44320__$1;
(statearr_44353_44423[(2)] = true);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (25))){
var inst_44218 = (state_44320[(17)]);
var inst_44223 = inst_44218.cljs$lang$protocol_mask$partition0$;
var inst_44224 = (inst_44223 & (64));
var inst_44225 = inst_44218.cljs$core$ISeq$;
var inst_44226 = (cljs.core.PROTOCOL_SENTINEL === inst_44225);
var inst_44227 = (inst_44224) || (inst_44226);
var state_44320__$1 = state_44320;
if(cljs.core.truth_(inst_44227)){
var statearr_44354_44424 = state_44320__$1;
(statearr_44354_44424[(1)] = (28));

} else {
var statearr_44355_44425 = state_44320__$1;
(statearr_44355_44425[(1)] = (29));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (34))){
var inst_44262 = (state_44320[(11)]);
var inst_44265 = cljs.core.empty_QMARK_.call(null,inst_44262);
var state_44320__$1 = state_44320;
if(inst_44265){
var statearr_44356_44426 = state_44320__$1;
(statearr_44356_44426[(1)] = (36));

} else {
var statearr_44357_44427 = state_44320__$1;
(statearr_44357_44427[(1)] = (37));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (17))){
var inst_44178 = (state_44320[(8)]);
var state_44320__$1 = state_44320;
var statearr_44358_44428 = state_44320__$1;
(statearr_44358_44428[(2)] = inst_44178);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (3))){
var inst_44318 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44320__$1,inst_44318);
} else {
if((state_val_44321 === (12))){
var inst_44194 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
if(cljs.core.truth_(inst_44194)){
var statearr_44359_44429 = state_44320__$1;
(statearr_44359_44429[(1)] = (16));

} else {
var statearr_44360_44430 = state_44320__$1;
(statearr_44360_44430[(1)] = (17));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (2))){
var state_44320__$1 = state_44320;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44320__$1,(4),weathergen.ui.command_ch);
} else {
if((state_val_44321 === (23))){
var inst_44208 = (state_44320[(18)]);
var inst_44218 = (state_44320[(17)]);
var inst_44218__$1 = cljs.core.first.call(null,inst_44208);
var inst_44220 = (inst_44218__$1 == null);
var inst_44221 = cljs.core.not.call(null,inst_44220);
var state_44320__$1 = (function (){var statearr_44361 = state_44320;
(statearr_44361[(17)] = inst_44218__$1);

return statearr_44361;
})();
if(inst_44221){
var statearr_44362_44431 = state_44320__$1;
(statearr_44362_44431[(1)] = (25));

} else {
var statearr_44363_44432 = state_44320__$1;
(statearr_44363_44432[(1)] = (26));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (35))){
var inst_44313 = (state_44320[(2)]);
var inst_44314 = console.timeEnd("Receive weather results");
var inst_44315 = cljs.core.reset_BANG_.call(null,weathergen.ui.computing,false);
var state_44320__$1 = (function (){var statearr_44364 = state_44320;
(statearr_44364[(25)] = inst_44315);

(statearr_44364[(26)] = inst_44313);

(statearr_44364[(27)] = inst_44314);

return statearr_44364;
})();
var statearr_44365_44433 = state_44320__$1;
(statearr_44365_44433[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (19))){
var inst_44208 = (state_44320[(18)]);
var inst_44210 = cljs.core.chunked_seq_QMARK_.call(null,inst_44208);
var state_44320__$1 = state_44320;
if(inst_44210){
var statearr_44366_44434 = state_44320__$1;
(statearr_44366_44434[(1)] = (22));

} else {
var statearr_44367_44435 = state_44320__$1;
(statearr_44367_44435[(1)] = (23));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (11))){
var state_44320__$1 = state_44320;
var statearr_44368_44436 = state_44320__$1;
(statearr_44368_44436[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (9))){
var inst_44253 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44369_44437 = state_44320__$1;
(statearr_44369_44437[(2)] = inst_44253);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (5))){
var inst_44172 = (state_44320[(7)]);
var inst_44171 = (state_44320[(16)]);
var inst_44174 = (inst_44172 < inst_44171);
var inst_44175 = inst_44174;
var state_44320__$1 = state_44320;
if(cljs.core.truth_(inst_44175)){
var statearr_44370_44438 = state_44320__$1;
(statearr_44370_44438[(1)] = (7));

} else {
var statearr_44371_44439 = state_44320__$1;
(statearr_44371_44439[(1)] = (8));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (14))){
var state_44320__$1 = state_44320;
var statearr_44372_44440 = state_44320__$1;
(statearr_44372_44440[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (45))){
var inst_44294 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44373_44441 = state_44320__$1;
(statearr_44373_44441[(2)] = inst_44294);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (26))){
var state_44320__$1 = state_44320;
var statearr_44374_44442 = state_44320__$1;
(statearr_44374_44442[(2)] = false);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (16))){
var inst_44178 = (state_44320[(8)]);
var inst_44196 = cljs.core.apply.call(null,cljs.core.hash_map,inst_44178);
var state_44320__$1 = state_44320;
var statearr_44375_44443 = state_44320__$1;
(statearr_44375_44443[(2)] = inst_44196);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (38))){
var inst_44311 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44376_44444 = state_44320__$1;
(statearr_44376_44444[(2)] = inst_44311);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (30))){
var inst_44231 = (state_44320[(2)]);
var state_44320__$1 = state_44320;
var statearr_44380_44445 = state_44320__$1;
(statearr_44380_44445[(2)] = inst_44231);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (10))){
var inst_44178 = (state_44320[(8)]);
var inst_44183 = inst_44178.cljs$lang$protocol_mask$partition0$;
var inst_44184 = (inst_44183 & (64));
var inst_44185 = inst_44178.cljs$core$ISeq$;
var inst_44186 = (cljs.core.PROTOCOL_SENTINEL === inst_44185);
var inst_44187 = (inst_44184) || (inst_44186);
var state_44320__$1 = state_44320;
if(cljs.core.truth_(inst_44187)){
var statearr_44381_44446 = state_44320__$1;
(statearr_44381_44446[(1)] = (13));

} else {
var statearr_44382_44447 = state_44320__$1;
(statearr_44382_44447[(1)] = (14));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (18))){
var inst_44169 = (state_44320[(13)]);
var inst_44172 = (state_44320[(7)]);
var inst_44163 = (state_44320[(14)]);
var inst_44170 = (state_44320[(9)]);
var inst_44171 = (state_44320[(16)]);
var inst_44199 = (state_44320[(2)]);
var inst_44200 = cljs.core.get.call(null,inst_44199,new cljs.core.Keyword(null,"cells","cells",-985166822));
var inst_44201 = cljs.core.get.call(null,inst_44199,new cljs.core.Keyword(null,"worker","worker",938239996));
var inst_44202 = cljs.core.assoc.call(null,inst_44163,new cljs.core.Keyword(null,"cells","cells",-985166822),inst_44200);
var inst_44203 = weathergen.encoding.encode.call(null,inst_44202);
var inst_44204 = weathergen.ui.post_message.call(null,inst_44201,inst_44203);
var inst_44205 = (inst_44172 + (1));
var tmp44377 = inst_44169;
var tmp44378 = inst_44170;
var tmp44379 = inst_44171;
var inst_44169__$1 = tmp44377;
var inst_44170__$1 = tmp44378;
var inst_44171__$1 = tmp44379;
var inst_44172__$1 = inst_44205;
var state_44320__$1 = (function (){var statearr_44383 = state_44320;
(statearr_44383[(13)] = inst_44169__$1);

(statearr_44383[(7)] = inst_44172__$1);

(statearr_44383[(28)] = inst_44204);

(statearr_44383[(9)] = inst_44170__$1);

(statearr_44383[(16)] = inst_44171__$1);

return statearr_44383;
})();
var statearr_44384_44448 = state_44320__$1;
(statearr_44384_44448[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (42))){
var inst_44274 = (state_44320[(2)]);
var inst_44275 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_44276 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_44275);
var inst_44277 = new cljs.core.Keyword(null,"current","current",-1088038603).cljs$core$IFn$_invoke$arity$1(inst_44276);
var inst_44278 = weathergen.time.campaign_time__GT_minutes.call(null,inst_44277);
var inst_44279 = cljs.core.deref.call(null,weathergen.ui.weather_data_params);
var inst_44280 = new cljs.core.Keyword(null,"time","time",1385887882).cljs$core$IFn$_invoke$arity$1(inst_44279);
var inst_44281 = new cljs.core.Keyword(null,"max","max",61366548).cljs$core$IFn$_invoke$arity$1(inst_44280);
var inst_44282 = weathergen.time.campaign_time__GT_minutes.call(null,inst_44281);
var inst_44283 = cljs.core._EQ_.call(null,inst_44278,inst_44282);
var state_44320__$1 = (function (){var statearr_44385 = state_44320;
(statearr_44385[(29)] = inst_44274);

return statearr_44385;
})();
if(inst_44283){
var statearr_44386_44449 = state_44320__$1;
(statearr_44386_44449[(1)] = (43));

} else {
var statearr_44387_44450 = state_44320__$1;
(statearr_44387_44450[(1)] = (44));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44321 === (37))){
var inst_44262 = (state_44320[(11)]);
var inst_44302 = cljs.core.vec.call(null,inst_44262);
var state_44320__$1 = state_44320;
return cljs.core.async.ioc_alts_BANG_.call(null,state_44320__$1,(46),inst_44302);
} else {
if((state_val_44321 === (8))){
var inst_44169 = (state_44320[(13)]);
var inst_44208 = (state_44320[(18)]);
var inst_44208__$1 = cljs.core.seq.call(null,inst_44169);
var state_44320__$1 = (function (){var statearr_44388 = state_44320;
(statearr_44388[(18)] = inst_44208__$1);

return statearr_44388;
})();
if(inst_44208__$1){
var statearr_44389_44451 = state_44320__$1;
(statearr_44389_44451[(1)] = (19));

} else {
var statearr_44390_44452 = state_44320__$1;
(statearr_44390_44452[(1)] = (20));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__39047__auto___44398))
;
return ((function (switch__38933__auto__,c__39047__auto___44398){
return (function() {
var weathergen$ui$state_machine__38934__auto__ = null;
var weathergen$ui$state_machine__38934__auto____0 = (function (){
var statearr_44394 = [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_44394[(0)] = weathergen$ui$state_machine__38934__auto__);

(statearr_44394[(1)] = (1));

return statearr_44394;
});
var weathergen$ui$state_machine__38934__auto____1 = (function (state_44320){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44320);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44395){if((e44395 instanceof Object)){
var ex__38937__auto__ = e44395;
var statearr_44396_44453 = state_44320;
(statearr_44396_44453[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44454 = state_44320;
state_44320 = G__44454;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$state_machine__38934__auto__ = function(state_44320){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38934__auto____1.call(this,state_44320);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38934__auto____0;
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38934__auto____1;
return weathergen$ui$state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto___44398))
})();
var state__39049__auto__ = (function (){var statearr_44397 = f__39048__auto__.call(null);
(statearr_44397[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto___44398);

return statearr_44397;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto___44398))
);

weathergen.ui.recompute = (function weathergen$ui$recompute(params){
var c__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto__){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto__){
return (function (state_44476){
var state_val_44477 = (state_44476[(1)]);
if((state_val_44477 === (1))){
var inst_44470 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_44471 = [new cljs.core.Keyword(null,"compute-weather","compute-weather",-1681954694),params];
var inst_44472 = (new cljs.core.PersistentVector(null,2,(5),inst_44470,inst_44471,null));
var state_44476__$1 = state_44476;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_44476__$1,(2),weathergen.ui.command_ch,inst_44472);
} else {
if((state_val_44477 === (2))){
var inst_44474 = (state_44476[(2)]);
var state_44476__$1 = state_44476;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44476__$1,inst_44474);
} else {
return null;
}
}
});})(c__39047__auto__))
;
return ((function (switch__38933__auto__,c__39047__auto__){
return (function() {
var weathergen$ui$recompute_$_state_machine__38934__auto__ = null;
var weathergen$ui$recompute_$_state_machine__38934__auto____0 = (function (){
var statearr_44481 = [null,null,null,null,null,null,null];
(statearr_44481[(0)] = weathergen$ui$recompute_$_state_machine__38934__auto__);

(statearr_44481[(1)] = (1));

return statearr_44481;
});
var weathergen$ui$recompute_$_state_machine__38934__auto____1 = (function (state_44476){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44476);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44482){if((e44482 instanceof Object)){
var ex__38937__auto__ = e44482;
var statearr_44483_44485 = state_44476;
(statearr_44483_44485[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44486 = state_44476;
state_44476 = G__44486;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$recompute_$_state_machine__38934__auto__ = function(state_44476){
switch(arguments.length){
case 0:
return weathergen$ui$recompute_$_state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$recompute_$_state_machine__38934__auto____1.call(this,state_44476);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$recompute_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$recompute_$_state_machine__38934__auto____0;
weathergen$ui$recompute_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$recompute_$_state_machine__38934__auto____1;
return weathergen$ui$recompute_$_state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto__))
})();
var state__39049__auto__ = (function (){var statearr_44484 = f__39048__auto__.call(null);
(statearr_44484[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44484;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto__))
);

return c__39047__auto__;
});
javelin.core.formula.call(null,(function (weather_params,prevent_recomputation_QMARK_){
if(cljs.core.truth_((function (){var and__23136__auto__ = cljs.core.not.call(null,prevent_recomputation_QMARK_);
if(and__23136__auto__){
return weather_params;
} else {
return and__23136__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__23493__auto__ = weathergen.time.campaign_time__GT_minutes.call(null,max_time);
var y__23494__auto__ = desired_time;
return ((x__23493__auto__ < y__23494__auto__) ? x__23493__auto__ : y__23494__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__44489 = 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__44489__$1 = ((((!((map__44489 == null)))?((((map__44489.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44489.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44489):map__44489);
var time = cljs.core.get.call(null,map__44489__$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__44493 = 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__44493__$1 = ((((!((map__44493 == null)))?((((map__44493.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44493.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44493):map__44493);
var time = cljs.core.get.call(null,map__44493__$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__44495){
var map__44498 = p__44495;
var map__44498__$1 = ((((!((map__44498 == null)))?((((map__44498.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44498.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44498):map__44498);
var data = cljs.core.get.call(null,map__44498__$1,new cljs.core.Keyword(null,"data","data",-232669377));
var title = cljs.core.get.call(null,map__44498__$1,new cljs.core.Keyword(null,"title","title",636505583));
var filters = cljs.core.get.call(null,map__44498__$1,new cljs.core.Keyword(null,"filters","filters",974726919));
var filename = cljs.core.get.call(null,map__44498__$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__44509 = 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__44509,(0),null);
var y_cells = cljs.core.nth.call(null,vec__44509,(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__24010__auto__ = ((function (t,vec__44509,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__44512(s__44513){
return (new cljs.core.LazySeq(null,((function (t,vec__44509,x_cells,y_cells){
return (function (){
var s__44513__$1 = s__44513;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__44513__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24006__auto__ = ((function (s__44513__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__44509,x_cells,y_cells){
return (function weathergen$ui$save_fmap_$_iter__44512_$_iter__44514(s__44515){
return (new cljs.core.LazySeq(null,((function (s__44513__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__44509,x_cells,y_cells){
return (function (){
var s__44515__$1 = s__44515;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__44515__$1);
if(temp__5278__auto____$1){
var s__44515__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__44515__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__44515__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__44517 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__44516 = (0);
while(true){
if((i__44516 < size__24009__auto__)){
var y = cljs.core._nth.call(null,c__24008__auto__,i__44516);
cljs.core.chunk_append.call(null,b__44517,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__44518 = (i__44516 + (1));
i__44516 = G__44518;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44517),weathergen$ui$save_fmap_$_iter__44512_$_iter__44514.call(null,cljs.core.chunk_rest.call(null,s__44515__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44517),null);
}
} else {
var y = cljs.core.first.call(null,s__44515__$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__44512_$_iter__44514.call(null,cljs.core.rest.call(null,s__44515__$2)));
}
} else {
return null;
}
break;
}
});})(s__44513__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__44509,x_cells,y_cells))
,null,null));
});})(s__44513__$1,x,xs__5831__auto__,temp__5278__auto__,t,vec__44509,x_cells,y_cells))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__auto__.call(null,cljs.core.range.call(null,y_cells)));
if(fs__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$save_fmap_$_iter__44512.call(null,cljs.core.rest.call(null,s__44513__$1)));
} else {
var G__44519 = cljs.core.rest.call(null,s__44513__$1);
s__44513__$1 = G__44519;
continue;
}
} else {
return null;
}
break;
}
});})(t,vec__44509,x_cells,y_cells))
,null,null));
});})(t,vec__44509,x_cells,y_cells))
;
return iter__24010__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__44523 = 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__44523,(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__44523,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__44523,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 javelin.core.dosync_STAR_.call(null,((function (mission_data,timer_name__15521__auto__,ignore__15522__auto__){
return (function (){
weathergen.progress.report.call(null,"Preparing views");

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__44529 = weathergen.falcon.files.mission.side.call(null,mission_data,weathergen.falcon.files.mission.last_player_team.call(null,mission_data));
return G__44529;
})()]));
});})(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){
weathergen.progress.report.call(null,"Reading briefing file");

var map__44534 = weathergen.encoding.decode.call(null,weathergen.ui.decompress.call(null,weathergen.filesystem.file_buffer.call(null,path)));
var map__44534__$1 = ((((!((map__44534 == null)))?((((map__44534.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44534.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44534):map__44534);
var vmtb = map__44534__$1;
var revision = cljs.core.get.call(null,map__44534__$1,new cljs.core.Keyword(null,"revision","revision",-1350113114));
var install_id = cljs.core.get.call(null,map__44534__$1,new cljs.core.Keyword(null,"install-id","install-id",-1310868737));
var briefing = cljs.core.get.call(null,map__44534__$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,922,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (map__44534,map__44534__$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__44534,map__44534__$1,vmtb,revision,install_id,briefing))
,null)),null,365294146);

weathergen.progress.report.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(''));

var mission_data = weathergen.falcon.files.mission.briefing__GT_mission.call(null,installations,briefing);
var unedit = ((function (mission_data,map__44534,map__44534__$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__44534,map__44534__$1,vmtb,revision,install_id,briefing))
;
weathergen.progress.report.call(null,"Preparing views");

return javelin.core.dosync_STAR_.call(null,((function (mission_data,unedit,map__44534,map__44534__$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__44534,map__44534__$1,vmtb,revision,install_id,briefing){
return (function (p1__44530_SHARP_){
return cljs.core.map.call(null,unedit,p1__44530_SHARP_);
});})(mission_data,unedit,map__44534,map__44534__$1,vmtb,revision,install_id,briefing))
),new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710),((function (mission_data,unedit,map__44534,map__44534__$1,vmtb,revision,install_id,briefing){
return (function (p1__44531_SHARP_){
return cljs.core.map.call(null,unedit,p1__44531_SHARP_);
});})(mission_data,unedit,map__44534,map__44534__$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)));

return 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)));
});})(mission_data,unedit,map__44534,map__44534__$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, 4, [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], 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__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_44541){
var state_val_44542 = (state_44541[(1)]);
if((state_val_44542 === (1))){
var inst_44536 = e.data;
var inst_44537 = weathergen.encoding.decode.call(null,inst_44536);
var state_44541__$1 = state_44541;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_44541__$1,(2),result_ch,inst_44537);
} else {
if((state_val_44542 === (2))){
var inst_44539 = (state_44541[(2)]);
var state_44541__$1 = state_44541;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44541__$1,inst_44539);
} else {
return null;
}
}
});})(c__39047__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__38933__auto__,c__39047__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__38934__auto__ = null;
var weathergen$ui$state_machine__38934__auto____0 = (function (){
var statearr_44546 = [null,null,null,null,null,null,null];
(statearr_44546[(0)] = weathergen$ui$state_machine__38934__auto__);

(statearr_44546[(1)] = (1));

return statearr_44546;
});
var weathergen$ui$state_machine__38934__auto____1 = (function (state_44541){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44541);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44547){if((e44547 instanceof Object)){
var ex__38937__auto__ = e44547;
var statearr_44548_44576 = state_44541;
(statearr_44548_44576[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44577 = state_44541;
state_44541 = G__44577;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$state_machine__38934__auto__ = function(state_44541){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38934__auto____1.call(this,state_44541);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38934__auto____0;
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38934__auto____1;
return weathergen$ui$state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__39049__auto__ = (function (){var statearr_44549 = f__39048__auto__.call(null);
(statearr_44549[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44549;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto__,worker,command_ch,result_ch,output_ch))
);

return c__39047__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__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto__,worker,command_ch,result_ch,output_ch){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto__,worker,command_ch,result_ch,output_ch){
return (function (state_44563){
var state_val_44564 = (state_44563[(1)]);
if((state_val_44564 === (1))){
var state_44563__$1 = state_44563;
var statearr_44565_44578 = state_44563__$1;
(statearr_44565_44578[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44564 === (2))){
var state_44563__$1 = state_44563;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44563__$1,(4),command_ch);
} else {
if((state_val_44564 === (3))){
var inst_44561 = (state_44563[(2)]);
var state_44563__$1 = state_44563;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44563__$1,inst_44561);
} else {
if((state_val_44564 === (4))){
var inst_44552 = (state_44563[(2)]);
var inst_44553 = weathergen.encoding.encode.call(null,inst_44552);
var inst_44554 = worker.postMessage(inst_44553);
var state_44563__$1 = (function (){var statearr_44566 = state_44563;
(statearr_44566[(7)] = inst_44554);

return statearr_44566;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44563__$1,(6),result_ch);
} else {
if((state_val_44564 === (5))){
var inst_44558 = (state_44563[(2)]);
var state_44563__$1 = (function (){var statearr_44567 = state_44563;
(statearr_44567[(8)] = inst_44558);

return statearr_44567;
})();
var statearr_44568_44579 = state_44563__$1;
(statearr_44568_44579[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44564 === (6))){
var inst_44556 = (state_44563[(2)]);
var state_44563__$1 = state_44563;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_44563__$1,(5),output_ch,inst_44556);
} else {
return null;
}
}
}
}
}
}
});})(c__39047__auto__,worker,command_ch,result_ch,output_ch))
;
return ((function (switch__38933__auto__,c__39047__auto__,worker,command_ch,result_ch,output_ch){
return (function() {
var weathergen$ui$state_machine__38934__auto__ = null;
var weathergen$ui$state_machine__38934__auto____0 = (function (){
var statearr_44572 = [null,null,null,null,null,null,null,null,null];
(statearr_44572[(0)] = weathergen$ui$state_machine__38934__auto__);

(statearr_44572[(1)] = (1));

return statearr_44572;
});
var weathergen$ui$state_machine__38934__auto____1 = (function (state_44563){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44563);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44573){if((e44573 instanceof Object)){
var ex__38937__auto__ = e44573;
var statearr_44574_44580 = state_44563;
(statearr_44574_44580[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44581 = state_44563;
state_44563 = G__44581;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$state_machine__38934__auto__ = function(state_44563){
switch(arguments.length){
case 0:
return weathergen$ui$state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$state_machine__38934__auto____1.call(this,state_44563);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$state_machine__38934__auto____0;
weathergen$ui$state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$state_machine__38934__auto____1;
return weathergen$ui$state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto__,worker,command_ch,result_ch,output_ch))
})();
var state__39049__auto__ = (function (){var statearr_44575 = f__39048__auto__.call(null);
(statearr_44575[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44575;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto__,worker,command_ch,result_ch,output_ch))
);

return c__39047__auto__;
})()], null);
})();
weathergen.ui.save_weather_files = (function weathergen$ui$save_weather_files(p__44582){
var map__44679 = p__44582;
var map__44679__$1 = ((((!((map__44679 == null)))?((((map__44679.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44679.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44679):map__44679);
var ny = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"ny","ny",1701791641));
var progress = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"progress","progress",244323547));
var weather_params = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"weather-params","weather-params",-259271365));
var step = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"step","step",1288888124));
var to = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"to","to",192099007));
var mission_name = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"mission-name","mission-name",1479736582));
var cloud_params = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"cloud-params","cloud-params",-540447983));
var save_file = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"save-file","save-file",-250442926));
var nx = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var from = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"from","from",1815293044));
var campaign_dir = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"campaign-dir","campaign-dir",-1278307883));
var weather_direction = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"weather-direction","weather-direction",-1789808873));
var cancel = cljs.core.get.call(null,map__44679__$1,new cljs.core.Keyword(null,"cancel","cancel",-1964088360));
var cells = (function (){var iter__24010__auto__ = ((function (map__44679,map__44679__$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__44681(s__44682){
return (new cljs.core.LazySeq(null,((function (map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__44682__$1 = s__44682;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__44682__$1);
if(temp__5278__auto__){
var xs__5831__auto__ = temp__5278__auto__;
var x = cljs.core.first.call(null,xs__5831__auto__);
var iterys__24006__auto__ = ((function (s__44682__$1,x,xs__5831__auto__,temp__5278__auto__,map__44679,map__44679__$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__44681_$_iter__44683(s__44684){
return (new cljs.core.LazySeq(null,((function (s__44682__$1,x,xs__5831__auto__,temp__5278__auto__,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var s__44684__$1 = s__44684;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__44684__$1);
if(temp__5278__auto____$1){
var s__44684__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__44684__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__44684__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__44686 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__44685 = (0);
while(true){
if((i__44685 < size__24009__auto__)){
var y = cljs.core._nth.call(null,c__24008__auto__,i__44685);
cljs.core.chunk_append.call(null,b__44686,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));

var G__44775 = (i__44685 + (1));
i__44685 = G__44775;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44686),weathergen$ui$save_weather_files_$_iter__44681_$_iter__44683.call(null,cljs.core.chunk_rest.call(null,s__44684__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__44686),null);
}
} else {
var y = cljs.core.first.call(null,s__44684__$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__44681_$_iter__44683.call(null,cljs.core.rest.call(null,s__44684__$2)));
}
} else {
return null;
}
break;
}
});})(s__44682__$1,x,xs__5831__auto__,temp__5278__auto__,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(s__44682__$1,x,xs__5831__auto__,temp__5278__auto__,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__auto__.call(null,cljs.core.range.call(null,ny)));
if(fs__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$save_weather_files_$_iter__44681.call(null,cljs.core.rest.call(null,s__44682__$1)));
} else {
var G__44776 = cljs.core.rest.call(null,s__44682__$1);
s__44682__$1 = G__44776;
continue;
}
} else {
return null;
}
break;
}
});})(map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
,null,null));
});})(map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return iter__24010__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__44679,map__44679__$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__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
var c__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel){
return (function (state_44745){
var state_val_44746 = (state_44745[(1)]);
if((state_val_44746 === (7))){
var inst_44716 = (state_44745[(2)]);
var inst_44717 = new cljs.core.Keyword(null,"output-ch","output-ch",1069791231).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var state_44745__$1 = (function (){var statearr_44747 = state_44745;
(statearr_44747[(7)] = inst_44716);

return statearr_44747;
})();
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44745__$1,(8),inst_44717);
} else {
if((state_val_44746 === (1))){
var inst_44687 = start;
var inst_44688 = false;
var state_44745__$1 = (function (){var statearr_44748 = state_44745;
(statearr_44748[(8)] = inst_44688);

(statearr_44748[(9)] = inst_44687);

return statearr_44748;
})();
var statearr_44749_44777 = state_44745__$1;
(statearr_44749_44777[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (4))){
var inst_44700 = weathergen.ui.twx_blob.call(null,cloud_params,weather_direction);
var inst_44701 = weathergen.ui.twx_filename.call(null,mission_name);
var inst_44702 = save_blob.call(null,inst_44700,inst_44701);
var inst_44703 = weathergen.ui.settings_blob.call(null);
var inst_44704 = weathergen.ui.settings_filename.call(null,mission_name);
var inst_44705 = save_blob.call(null,inst_44703,inst_44704);
var inst_44706 = cljs.core.reset_BANG_.call(null,progress,null);
var state_44745__$1 = (function (){var statearr_44750 = state_44745;
(statearr_44750[(10)] = inst_44702);

(statearr_44750[(11)] = inst_44705);

return statearr_44750;
})();
var statearr_44751_44778 = state_44745__$1;
(statearr_44751_44778[(2)] = inst_44706);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (13))){
var inst_44687 = (state_44745[(9)]);
var inst_44736 = (inst_44687 + step);
var inst_44687__$1 = inst_44736;
var inst_44688 = true;
var state_44745__$1 = (function (){var statearr_44752 = state_44745;
(statearr_44752[(8)] = inst_44688);

(statearr_44752[(9)] = inst_44687__$1);

return statearr_44752;
})();
var statearr_44753_44779 = state_44745__$1;
(statearr_44753_44779[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (6))){
var inst_44741 = (state_44745[(2)]);
var state_44745__$1 = state_44745;
var statearr_44754_44780 = state_44745__$1;
(statearr_44754_44780[(2)] = inst_44741);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (3))){
var inst_44743 = (state_44745[(2)]);
var state_44745__$1 = state_44745;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44745__$1,inst_44743);
} else {
if((state_val_44746 === (12))){
var inst_44734 = cljs.core.reset_BANG_.call(null,progress,null);
var state_44745__$1 = state_44745;
var statearr_44755_44781 = state_44745__$1;
(statearr_44755_44781[(2)] = inst_44734);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (2))){
var inst_44688 = (state_44745[(8)]);
var inst_44687 = (state_44745[(9)]);
var inst_44690 = (inst_44687 - start);
var inst_44691 = (end - start);
var inst_44692 = (inst_44690 / inst_44691);
var inst_44693 = ((inst_44692 < (1)) ? inst_44692 : (1));
var inst_44694 = (function (){var t = inst_44687;
var first_done_QMARK_ = inst_44688;
var p = inst_44693;
return ((function (t,first_done_QMARK_,p,inst_44688,inst_44687,inst_44690,inst_44691,inst_44692,inst_44693,state_val_44746,c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$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_44688,inst_44687,inst_44690,inst_44691,inst_44692,inst_44693,state_val_44746,c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var inst_44695 = (new cljs.core.Delay(inst_44694,null));
var inst_44696 = taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"weathergen.ui",null,1001,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),inst_44695,null,644289503);
var inst_44697 = cljs.core.reset_BANG_.call(null,progress,inst_44693);
var inst_44698 = (end < inst_44687);
var state_44745__$1 = (function (){var statearr_44756 = state_44745;
(statearr_44756[(12)] = inst_44696);

(statearr_44756[(13)] = inst_44697);

return statearr_44756;
})();
if(cljs.core.truth_(inst_44698)){
var statearr_44757_44782 = state_44745__$1;
(statearr_44757_44782[(1)] = (4));

} else {
var statearr_44758_44783 = state_44745__$1;
(statearr_44758_44783[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (11))){
var inst_44720 = (state_44745[(14)]);
var inst_44687 = (state_44745[(9)]);
var inst_44727 = (state_44745[(2)]);
var inst_44728 = weathergen.time.minutes__GT_campaign_time.call(null,inst_44687);
var inst_44729 = weathergen.ui.fmap_filename.call(null,inst_44728);
var inst_44730 = weathergen.filesystem.path_combine.call(null,"WeatherMapsUpdates",inst_44729);
var inst_44731 = save_blob.call(null,inst_44720,inst_44730);
var inst_44732 = cljs.core.deref.call(null,cancel);
var state_44745__$1 = (function (){var statearr_44759 = state_44745;
(statearr_44759[(15)] = inst_44727);

(statearr_44759[(16)] = inst_44731);

return statearr_44759;
})();
if(cljs.core.truth_(inst_44732)){
var statearr_44760_44784 = state_44745__$1;
(statearr_44760_44784[(1)] = (12));

} else {
var statearr_44761_44785 = state_44745__$1;
(statearr_44761_44785[(1)] = (13));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (9))){
var state_44745__$1 = state_44745;
var statearr_44762_44786 = state_44745__$1;
(statearr_44762_44786[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (5))){
var inst_44687 = (state_44745[(9)]);
var inst_44708 = new cljs.core.Keyword(null,"command-ch","command-ch",508874766).cljs$core$IFn$_invoke$arity$1(weathergen.ui.weather_worker);
var inst_44709 = cljs.core.PersistentVector.EMPTY_NODE;
var inst_44710 = [new cljs.core.Keyword(null,"time","time",1385887882),new cljs.core.Keyword(null,"current","current",-1088038603)];
var inst_44711 = (new cljs.core.PersistentVector(null,2,(5),inst_44709,inst_44710,null));
var inst_44712 = weathergen.time.minutes__GT_campaign_time.call(null,inst_44687);
var inst_44713 = cljs.core.assoc_in.call(null,weather_params,inst_44711,inst_44712);
var inst_44714 = cljs.core.assoc.call(null,inst_44713,new cljs.core.Keyword(null,"cells","cells",-985166822),cells);
var state_44745__$1 = state_44745;
return cljs.core.async.impl.ioc_helpers.put_BANG_.call(null,state_44745__$1,(7),inst_44708,inst_44714);
} else {
if((state_val_44746 === (14))){
var inst_44739 = (state_44745[(2)]);
var state_44745__$1 = state_44745;
var statearr_44763_44787 = state_44745__$1;
(statearr_44763_44787[(2)] = inst_44739);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (10))){
var inst_44720 = (state_44745[(14)]);
var inst_44723 = weathergen.ui.mission_name_base.call(null,mission_name);
var inst_44724 = [cljs.core.str.cljs$core$IFn$_invoke$arity$1(inst_44723),cljs.core.str.cljs$core$IFn$_invoke$arity$1(".fmap")].join('');
var inst_44725 = save_blob.call(null,inst_44720,inst_44724);
var state_44745__$1 = state_44745;
var statearr_44764_44788 = state_44745__$1;
(statearr_44764_44788[(2)] = inst_44725);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44746 === (8))){
var inst_44688 = (state_44745[(8)]);
var inst_44719 = (state_44745[(2)]);
var inst_44720 = weathergen.fmap.get_blob.call(null,inst_44719,nx,ny);
var state_44745__$1 = (function (){var statearr_44765 = state_44745;
(statearr_44765[(14)] = inst_44720);

return statearr_44765;
})();
if(cljs.core.truth_(inst_44688)){
var statearr_44766_44789 = state_44745__$1;
(statearr_44766_44789[(1)] = (9));

} else {
var statearr_44767_44790 = state_44745__$1;
(statearr_44767_44790[(1)] = (10));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});})(c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
;
return ((function (switch__38933__auto__,c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$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__38934__auto__ = null;
var weathergen$ui$save_weather_files_$_state_machine__38934__auto____0 = (function (){
var statearr_44771 = [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];
(statearr_44771[(0)] = weathergen$ui$save_weather_files_$_state_machine__38934__auto__);

(statearr_44771[(1)] = (1));

return statearr_44771;
});
var weathergen$ui$save_weather_files_$_state_machine__38934__auto____1 = (function (state_44745){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44745);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44772){if((e44772 instanceof Object)){
var ex__38937__auto__ = e44772;
var statearr_44773_44791 = state_44745;
(statearr_44773_44791[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44792 = state_44745;
state_44745 = G__44792;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$save_weather_files_$_state_machine__38934__auto__ = function(state_44745){
switch(arguments.length){
case 0:
return weathergen$ui$save_weather_files_$_state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$save_weather_files_$_state_machine__38934__auto____1.call(this,state_44745);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$save_weather_files_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$save_weather_files_$_state_machine__38934__auto____0;
weathergen$ui$save_weather_files_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$save_weather_files_$_state_machine__38934__auto____1;
return weathergen$ui$save_weather_files_$_state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
})();
var state__39049__auto__ = (function (){var statearr_44774 = f__39048__auto__.call(null);
(statearr_44774[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44774;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto__,cells,start,end,steps,updates_dir,save_blob,map__44679,map__44679__$1,ny,progress,weather_params,step,to,mission_name,cloud_params,save_file,nx,from,campaign_dir,weather_direction,cancel))
);

return c__39047__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__44796 = cljs.core._EQ_;
var expr__44797 = type;
if(cljs.core.truth_(pred__44796.call(null,new cljs.core.Keyword(null,"sunny","sunny",1448267778),expr__44797))){
return "Sunny";
} else {
if(cljs.core.truth_(pred__44796.call(null,new cljs.core.Keyword(null,"fair","fair",1684139423),expr__44797))){
return "Fair";
} else {
if(cljs.core.truth_(pred__44796.call(null,new cljs.core.Keyword(null,"poor","poor",1462482211),expr__44797))){
return "Poor";
} else {
if(cljs.core.truth_(pred__44796.call(null,new cljs.core.Keyword(null,"inclement","inclement",-550669382),expr__44797))){
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__44797)].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__44800 = weathergen.ui.inhg__GT_mbar.call(null,inhg);
return G__44800;
})().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__44804 = wind;
var map__44804__$1 = ((((!((map__44804 == null)))?((((map__44804.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44804.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44804):map__44804);
var speed = cljs.core.get.call(null,map__44804__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__44804__$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__44806 = speed;
return G__44806;
})().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__44808 = cljs.core.PersistentVector.EMPTY;
var G__44808__$1 = ((((cumulus_base > (0))) && ((cumulus_base < stratus_base)))?cljs.core.conj.call(null,G__44808,[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__44808);
if(cljs.core.not_EQ_.call(null,type,new cljs.core.Keyword(null,"fair","fair",1684139423))){
return cljs.core.conj.call(null,G__44808__$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__44808__$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__44809){
var map__44814 = p__44809;
var map__44814__$1 = ((((!((map__44814 == null)))?((((map__44814.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44814.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44814):map__44814);
var x = cljs.core.get.call(null,map__44814__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__44814__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var map__44816 = new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966).cljs$core$IFn$_invoke$arity$1(mission);
var map__44816__$1 = ((((!((map__44816 == null)))?((((map__44816.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44816.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44816):map__44816);
var bullseye_x = cljs.core.get.call(null,map__44816__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var bullseye_y = cljs.core.get.call(null,map__44816__$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__44820 = bullseye;
var map__44820__$1 = ((((!((map__44820 == null)))?((((map__44820.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44820.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44820):map__44820);
var heading = cljs.core.get.call(null,map__44820__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var distance = cljs.core.get.call(null,map__44820__$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 args44822 = [];
var len__24369__auto___44834 = arguments.length;
var i__24370__auto___44835 = (0);
while(true){
if((i__24370__auto___44835 < len__24369__auto___44834)){
args44822.push((arguments[i__24370__auto___44835]));

var G__44836 = (i__24370__auto___44835 + (1));
i__24370__auto___44835 = G__44836;
continue;
} else {
}
break;
}

var G__44824 = args44822.length;
switch (G__44824) {
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(args44822.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__44826 = 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__44826,(0),null);
var ny = cljs.core.nth.call(null,vec__44826,(1),null);
var map__44829 = pan;
var map__44829__$1 = ((((!((map__44829 == null)))?((((map__44829.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44829.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44829):map__44829);
var x = cljs.core.get.call(null,map__44829__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__44829__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__44830 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__44830,(0),null);
var height = cljs.core.nth.call(null,vec__44830,(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 (e44825){var err = e44825;
return taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"weathergen.ui",null,1241,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,-1087231941);
}});

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__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto__){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto__){
return (function (state_44880){
var state_val_44881 = (state_44880[(1)]);
if((state_val_44881 === (1))){
var state_44880__$1 = state_44880;
var statearr_44882_44896 = state_44880__$1;
(statearr_44882_44896[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44881 === (2))){
var inst_44868 = f.call(null);
var state_44880__$1 = state_44880;
if(cljs.core.truth_(inst_44868)){
var statearr_44883_44897 = state_44880__$1;
(statearr_44883_44897[(1)] = (4));

} else {
var statearr_44884_44898 = state_44880__$1;
(statearr_44884_44898[(1)] = (5));

}

return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44881 === (3))){
var inst_44878 = (state_44880[(2)]);
var state_44880__$1 = state_44880;
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44880__$1,inst_44878);
} else {
if((state_val_44881 === (4))){
var state_44880__$1 = state_44880;
var statearr_44885_44899 = state_44880__$1;
(statearr_44885_44899[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44881 === (5))){
var inst_44871 = cljs.core.async.timeout.call(null,interval);
var state_44880__$1 = state_44880;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44880__$1,(7),inst_44871);
} else {
if((state_val_44881 === (6))){
var inst_44876 = (state_44880[(2)]);
var state_44880__$1 = state_44880;
var statearr_44886_44900 = state_44880__$1;
(statearr_44886_44900[(2)] = inst_44876);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
if((state_val_44881 === (7))){
var inst_44873 = (state_44880[(2)]);
var state_44880__$1 = (function (){var statearr_44887 = state_44880;
(statearr_44887[(7)] = inst_44873);

return statearr_44887;
})();
var statearr_44888_44901 = state_44880__$1;
(statearr_44888_44901[(2)] = null);

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


return new cljs.core.Keyword(null,"recur","recur",-437573268);
} else {
return null;
}
}
}
}
}
}
}
});})(c__39047__auto__))
;
return ((function (switch__38933__auto__,c__39047__auto__){
return (function() {
var weathergen$ui$retry_$_state_machine__38934__auto__ = null;
var weathergen$ui$retry_$_state_machine__38934__auto____0 = (function (){
var statearr_44892 = [null,null,null,null,null,null,null,null];
(statearr_44892[(0)] = weathergen$ui$retry_$_state_machine__38934__auto__);

(statearr_44892[(1)] = (1));

return statearr_44892;
});
var weathergen$ui$retry_$_state_machine__38934__auto____1 = (function (state_44880){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44880);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44893){if((e44893 instanceof Object)){
var ex__38937__auto__ = e44893;
var statearr_44894_44902 = state_44880;
(statearr_44894_44902[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44903 = state_44880;
state_44880 = G__44903;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$retry_$_state_machine__38934__auto__ = function(state_44880){
switch(arguments.length){
case 0:
return weathergen$ui$retry_$_state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$retry_$_state_machine__38934__auto____1.call(this,state_44880);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$retry_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$retry_$_state_machine__38934__auto____0;
weathergen$ui$retry_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$retry_$_state_machine__38934__auto____1;
return weathergen$ui$retry_$_state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto__))
})();
var state__39049__auto__ = (function (){var statearr_44895 = f__39048__auto__.call(null);
(statearr_44895[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44895;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto__))
);

return c__39047__auto__;
});
/**
 * Perform `f` asynchronously `interval` milliseconds from now.
 */
weathergen.ui.later = (function weathergen$ui$later(interval,f){
var c__39047__auto__ = cljs.core.async.chan.call(null,(1));
cljs.core.async.impl.dispatch.run.call(null,((function (c__39047__auto__){
return (function (){
var f__39048__auto__ = (function (){var switch__38933__auto__ = ((function (c__39047__auto__){
return (function (state_44924){
var state_val_44925 = (state_44924[(1)]);
if((state_val_44925 === (1))){
var inst_44919 = cljs.core.async.timeout.call(null,interval);
var state_44924__$1 = state_44924;
return cljs.core.async.impl.ioc_helpers.take_BANG_.call(null,state_44924__$1,(2),inst_44919);
} else {
if((state_val_44925 === (2))){
var inst_44921 = (state_44924[(2)]);
var inst_44922 = f.call(null);
var state_44924__$1 = (function (){var statearr_44926 = state_44924;
(statearr_44926[(7)] = inst_44921);

return statearr_44926;
})();
return cljs.core.async.impl.ioc_helpers.return_chan.call(null,state_44924__$1,inst_44922);
} else {
return null;
}
}
});})(c__39047__auto__))
;
return ((function (switch__38933__auto__,c__39047__auto__){
return (function() {
var weathergen$ui$later_$_state_machine__38934__auto__ = null;
var weathergen$ui$later_$_state_machine__38934__auto____0 = (function (){
var statearr_44930 = [null,null,null,null,null,null,null,null];
(statearr_44930[(0)] = weathergen$ui$later_$_state_machine__38934__auto__);

(statearr_44930[(1)] = (1));

return statearr_44930;
});
var weathergen$ui$later_$_state_machine__38934__auto____1 = (function (state_44924){
while(true){
var ret_value__38935__auto__ = (function (){try{while(true){
var result__38936__auto__ = switch__38933__auto__.call(null,state_44924);
if(cljs.core.keyword_identical_QMARK_.call(null,result__38936__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
continue;
} else {
return result__38936__auto__;
}
break;
}
}catch (e44931){if((e44931 instanceof Object)){
var ex__38937__auto__ = e44931;
var statearr_44932_44934 = state_44924;
(statearr_44932_44934[(5)] = ex__38937__auto__);


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

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

}
}})();
if(cljs.core.keyword_identical_QMARK_.call(null,ret_value__38935__auto__,new cljs.core.Keyword(null,"recur","recur",-437573268))){
var G__44935 = state_44924;
state_44924 = G__44935;
continue;
} else {
return ret_value__38935__auto__;
}
break;
}
});
weathergen$ui$later_$_state_machine__38934__auto__ = function(state_44924){
switch(arguments.length){
case 0:
return weathergen$ui$later_$_state_machine__38934__auto____0.call(this);
case 1:
return weathergen$ui$later_$_state_machine__38934__auto____1.call(this,state_44924);
}
throw(new Error('Invalid arity: ' + (arguments.length - 1)));
};
weathergen$ui$later_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$0 = weathergen$ui$later_$_state_machine__38934__auto____0;
weathergen$ui$later_$_state_machine__38934__auto__.cljs$core$IFn$_invoke$arity$1 = weathergen$ui$later_$_state_machine__38934__auto____1;
return weathergen$ui$later_$_state_machine__38934__auto__;
})()
;})(switch__38933__auto__,c__39047__auto__))
})();
var state__39049__auto__ = (function (){var statearr_44933 = f__39048__auto__.call(null);
(statearr_44933[cljs.core.async.impl.ioc_helpers.USER_START_IDX] = c__39047__auto__);

return statearr_44933;
})();
return cljs.core.async.impl.ioc_helpers.run_state_machine_wrapped.call(null,state__39049__auto__);
});})(c__39047__auto__))
);

return c__39047__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__29571__auto__){
var vec__44950 = hoplon.core.parse_args.call(null,args__29571__auto__);
var attrs = cljs.core.nth.call(null,vec__44950,(0),null);
var contents = cljs.core.nth.call(null,vec__44950,(1),null);
var map__44953 = attrs;
var map__44953__$1 = ((((!((map__44953 == null)))?((((map__44953.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44953.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44953):map__44953);
var inner = cljs.core.get.call(null,map__44953__$1,new cljs.core.Keyword(null,"inner","inner",-1383171215));
var outer = cljs.core.get.call(null,map__44953__$1,new cljs.core.Keyword(null,"outer","outer",-375185956));
var css = cljs.core.get.call(null,map__44953__$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__44953,map__44953__$1,inner,outer,css,attrs__$1,vec__44950,attrs,contents){
return (function (G__44956,G__44957,G__44955){
return G__44955.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__44956,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__44957);
});})(map__44953,map__44953__$1,inner,outer,css,attrs__$1,vec__44950,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__44953,map__44953__$1,inner,outer,css,attrs__$1,vec__44950,attrs,contents){
return (function (G__44960,G__44958,G__44959){
return G__44958.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__44959,new cljs.core.Keyword(null,"margin","margin",-995903681),(0),new cljs.core.Keyword(null,"padding","padding",1660304693),(0)], null),G__44960);
});})(map__44953,map__44953__$1,inner,outer,css,attrs__$1,vec__44950,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__44953,map__44953__$1,inner,outer,css,attrs__$1,vec__44950,attrs,contents){
return (function (G__44962,G__44963,G__44961){
return G__44961.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__44962,new cljs.core.Keyword(null,"margin","margin",-995903681),(0)], null),G__44963);
});})(map__44953,map__44953__$1,inner,outer,css,attrs__$1,vec__44950,attrs,contents))
).call(null,outer,css,cljs.core.merge),contents)));
};
var weathergen$ui$triple_border = function (var_args){
var args__29571__auto__ = null;
if (arguments.length > 0) {
var G__44964__i = 0, G__44964__a = new Array(arguments.length -  0);
while (G__44964__i < G__44964__a.length) {G__44964__a[G__44964__i] = arguments[G__44964__i + 0]; ++G__44964__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__44964__a,0,null);
} 
return weathergen$ui$triple_border__delegate.call(this,args__29571__auto__);};
weathergen$ui$triple_border.cljs$lang$maxFixedArity = 0;
weathergen$ui$triple_border.cljs$lang$applyTo = (function (arglist__44965){
var args__29571__auto__ = cljs.core.seq(arglist__44965);
return weathergen$ui$triple_border__delegate(args__29571__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__29571__auto__){
var vec__44971 = hoplon.core.parse_args.call(null,args__29571__auto__);
var attributes = cljs.core.nth.call(null,vec__44971,(0),null);
var children = cljs.core.nth.call(null,vec__44971,(1),null);
var map__44974 = attributes;
var map__44974__$1 = ((((!((map__44974 == null)))?((((map__44974.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__44974.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__44974):map__44974);
var title = cljs.core.get.call(null,map__44974__$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__29571__auto__ = null;
if (arguments.length > 0) {
var G__44976__i = 0, G__44976__a = new Array(arguments.length -  0);
while (G__44976__i < G__44976__a.length) {G__44976__a[G__44976__i] = arguments[G__44976__i + 0]; ++G__44976__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__44976__a,0,null);
} 
return weathergen$ui$control_subsection__delegate.call(this,args__29571__auto__);};
weathergen$ui$control_subsection.cljs$lang$maxFixedArity = 0;
weathergen$ui$control_subsection.cljs$lang$applyTo = (function (arglist__44977){
var args__29571__auto__ = cljs.core.seq(arglist__44977);
return weathergen$ui$control_subsection__delegate(args__29571__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__44980){
var map__45062 = p__44980;
var map__45062__$1 = ((((!((map__45062 == null)))?((((map__45062.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45062.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45062):map__45062);
var opts = map__45062__$1;
var limit_time_QMARK_ = cljs.core.get.call(null,map__45062__$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__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (G__45064,G__45067,G__45065,G__45066){
return G__45064.call(null,((function (map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (p1__44978_SHARP_){
return G__45065.call(null,G__45066,p1__44978_SHARP_);
});})(map__45062,map__45062__$1,opts,limit_time_QMARK_))
,G__45067.call(null,G__45066));
});})(map__45062,map__45062__$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__45070 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (p__45073){
var map__45074 = p__45073;
var map__45074__$1 = ((((!((map__45074 == null)))?((((map__45074.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45074.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45074):map__45074);
var coordinates = cljs.core.get.call(null,map__45074__$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__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,weathergen.ui.selected_cell));
var coordinates = cljs.core.nth.call(null,vec__45070,(0),null);
var vec__45082 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (p__45085){
var vec__45086 = p__45085;
var x = cljs.core.nth.call(null,vec__45086,(0),null);
var y = cljs.core.nth.call(null,vec__45086,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null);
});})(vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,coordinates));
var x = cljs.core.nth.call(null,vec__45082,(0),null);
var y = cljs.core.nth.call(null,vec__45082,(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__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (p1__44979_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__44979_SHARP_))));
});})(vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$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__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (G__45090,G__45089){
return G__45089.call(null,new cljs.core.Keyword(null,"named","named",-422393479),G__45090);
});})(vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$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__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (location_type,x__$1,y__$1){
var pred__45091 = cljs.core._EQ_;
var expr__45092 = location_type;
if(cljs.core.truth_(pred__45091.call(null,new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668),expr__45092))){
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__45091.call(null,new cljs.core.Keyword(null,"named","named",-422393479),expr__45092))){
return "";
} else {
if(cljs.core.truth_(pred__45091.call(null,new cljs.core.Keyword(null,"none","none",1333468478),expr__45092))){
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__45092)].join('')));
}
}
}
});})(vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$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__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (G__45094,G__45096,G__45095){
return G__45094.call(null,G__45095,G__45096);
});})(vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,cljs.core.map_indexed,airbases,cljs.core.vector),((function (vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (item__29615__auto__){
var vec__45097 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (indexed){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [indexed], null);
});})(vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,item__29615__auto__));
var indexed = cljs.core.nth.call(null,vec__45097,(0),null);
var vec__45106 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__45097,indexed,vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (p__45109){
var vec__45110 = p__45109;
var index = cljs.core.nth.call(null,vec__45110,(0),null);
var ab = cljs.core.nth.call(null,vec__45110,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [ab,index], null);
});})(vec__45097,indexed,vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,indexed));
var ab = cljs.core.nth.call(null,vec__45106,(0),null);
var index = cljs.core.nth.call(null,vec__45106,(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__45106,ab,index,vec__45097,indexed,vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (G__45114,G__45113,G__45115){
return G__45113.call(null,G__45114,new cljs.core.Keyword(null,"location","location",1815599388).cljs$core$IFn$_invoke$arity$1(G__45115));
});})(vec__45106,ab,index,vec__45097,indexed,vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,ab,cljs.core._EQ_,weathergen.ui.selected_cell),javelin.core.formula.call(null,((function (vec__45106,ab,index,vec__45097,indexed,vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (G__45118,G__45116,G__45117){
return G__45116.call(null,G__45117,G__45118);
});})(vec__45106,ab,index,vec__45097,indexed,vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
).call(null,ab,weathergen.falcon.files.mission.objective_name,weathergen.ui.mission));
});})(vec__45082,x,y,vec__45070,coordinates,airbases,map__45062,map__45062__$1,opts,limit_time_QMARK_))
));
})(),javelin.core.formula.call(null,((function (map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (pressure_unit,forecast,cloud_params){
var td1 = ((function (map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function() { 
var G__45143__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__45143 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__45144__i = 0, G__45144__a = new Array(arguments.length -  0);
while (G__45144__i < G__45144__a.length) {G__45144__a[G__45144__i] = arguments[G__45144__i + 0]; ++G__45144__i;}
  args = new cljs.core.IndexedSeq(G__45144__a,0,null);
} 
return G__45143__delegate.call(this,args);};
G__45143.cljs$lang$maxFixedArity = 0;
G__45143.cljs$lang$applyTo = (function (arglist__45145){
var args = cljs.core.seq(arglist__45145);
return G__45143__delegate(args);
});
G__45143.cljs$core$IFn$_invoke$arity$variadic = G__45143__delegate;
return G__45143;
})()
;})(map__45062,map__45062__$1,opts,limit_time_QMARK_))
;
var td2 = ((function (td1,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function() { 
var G__45146__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__45146 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__45147__i = 0, G__45147__a = new Array(arguments.length -  0);
while (G__45147__i < G__45147__a.length) {G__45147__a[G__45147__i] = arguments[G__45147__i + 0]; ++G__45147__i;}
  args = new cljs.core.IndexedSeq(G__45147__a,0,null);
} 
return G__45146__delegate.call(this,args);};
G__45146.cljs$lang$maxFixedArity = 0;
G__45146.cljs$lang$applyTo = (function (arglist__45148){
var args = cljs.core.seq(arglist__45148);
return G__45146__delegate(args);
});
G__45146.cljs$core$IFn$_invoke$arity$variadic = G__45146__delegate;
return G__45146;
})()
;})(td1,map__45062,map__45062__$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__24010__auto__ = ((function (td1,td2,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function weathergen$ui$forecast_section_$_iter__45119(s__45120){
return (new cljs.core.LazySeq(null,((function (td1,td2,map__45062,map__45062__$1,opts,limit_time_QMARK_){
return (function (){
var s__45120__$1 = s__45120;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__45120__$1);
if(temp__5278__auto__){
var s__45120__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__45120__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__45120__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__45122 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__45121 = (0);
while(true){
if((i__45121 < size__24009__auto__)){
var vec__45133 = cljs.core._nth.call(null,c__24008__auto__,i__45121);
var time = cljs.core.nth.call(null,vec__45133,(0),null);
var weather = cljs.core.nth.call(null,vec__45133,(1),null);
var map__45136 = weather;
var map__45136__$1 = ((((!((map__45136 == null)))?((((map__45136.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45136.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45136):map__45136);
var pressure = cljs.core.get.call(null,map__45136__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__45136__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__45136__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__45136__$1,new cljs.core.Keyword(null,"type","type",1174270348));
cljs.core.chunk_append.call(null,b__45122,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__45149 = (i__45121 + (1));
i__45121 = G__45149;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45122),weathergen$ui$forecast_section_$_iter__45119.call(null,cljs.core.chunk_rest.call(null,s__45120__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45122),null);
}
} else {
var vec__45138 = cljs.core.first.call(null,s__45120__$2);
var time = cljs.core.nth.call(null,vec__45138,(0),null);
var weather = cljs.core.nth.call(null,vec__45138,(1),null);
var map__45141 = weather;
var map__45141__$1 = ((((!((map__45141 == null)))?((((map__45141.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45141.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45141):map__45141);
var pressure = cljs.core.get.call(null,map__45141__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__45141__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__45141__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__45141__$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__45119.call(null,cljs.core.rest.call(null,s__45120__$2)));
}
} else {
return null;
}
break;
}
});})(td1,td2,map__45062,map__45062__$1,opts,limit_time_QMARK_))
,null,null));
});})(td1,td2,map__45062,map__45062__$1,opts,limit_time_QMARK_))
;
return iter__24010__auto__.call(null,forecast);
})())));
});})(map__45062,map__45062__$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__45169 = cljs.core.first.call(null,cljs.core.filter.call(null,(function (p__45178){
var vec__45179 = p__45178;
var vec__45182 = cljs.core.nth.call(null,vec__45179,(0),null);
var low = cljs.core.nth.call(null,vec__45182,(0),null);
var l = cljs.core.nth.call(null,vec__45182,(1),null);
var vec__45185 = cljs.core.nth.call(null,vec__45179,(1),null);
var high = cljs.core.nth.call(null,vec__45185,(0),null);
var h = cljs.core.nth.call(null,vec__45185,(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__45172 = cljs.core.nth.call(null,vec__45169,(0),null);
var low = cljs.core.nth.call(null,vec__45172,(0),null);
var l = cljs.core.nth.call(null,vec__45172,(1),null);
var vec__45175 = cljs.core.nth.call(null,vec__45169,(1),null);
var high = cljs.core.nth.call(null,vec__45175,(0),null);
var h = cljs.core.nth.call(null,vec__45175,(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__45191 = weathergen.ui.gradient_color.call(null,weathergen.ui.pressure_map,pressure);
var r = cljs.core.nth.call(null,vec__45191,(0),null);
var g = cljs.core.nth.call(null,vec__45191,(1),null);
var b = cljs.core.nth.call(null,vec__45191,(2),null);
var a = cljs.core.nth.call(null,vec__45191,(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__45197 = weathergen.ui.gradient_color.call(null,weathergen.ui.temp_map,temp);
var r = cljs.core.nth.call(null,vec__45197,(0),null);
var g = cljs.core.nth.call(null,vec__45197,(1),null);
var b = cljs.core.nth.call(null,vec__45197,(2),null);
var a = cljs.core.nth.call(null,vec__45197,(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__45203 = cljs.core._EQ_;
var expr__45204 = display;
if(cljs.core.truth_(pred__45203.call(null,new cljs.core.Keyword(null,"type","type",1174270348),expr__45204))){
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__45203.call(null,new cljs.core.Keyword(null,"pressure","pressure",505343747),expr__45204))){
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__45203.call(null,new cljs.core.Keyword(null,"temperature","temperature",899018429),expr__45204))){
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__45228 = cljs.core.seq.call(null,weather_data);
var chunk__45230 = null;
var count__45231 = (0);
var i__45232 = (0);
while(true){
if((i__45232 < count__45231)){
var vec__45234 = cljs.core._nth.call(null,chunk__45230,i__45232);
var vec__45237 = cljs.core.nth.call(null,vec__45234,(0),null);
var x = cljs.core.nth.call(null,vec__45237,(0),null);
var y = cljs.core.nth.call(null,vec__45237,(1),null);
var weather = cljs.core.nth.call(null,vec__45234,(1),null);
var map__45240_45250 = new cljs.core.Keyword(null,"wind","wind",-527553074).cljs$core$IFn$_invoke$arity$1(weather);
var map__45240_45251__$1 = ((((!((map__45240_45250 == null)))?((((map__45240_45250.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45240_45250.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45240_45250):map__45240_45250);
var speed_45252 = cljs.core.get.call(null,map__45240_45251__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_45253 = cljs.core.get.call(null,map__45240_45251__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_45254 = 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_45254.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_45253));

cell_45254.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_45252))].join(''));

var G__45255 = seq__45228;
var G__45256 = chunk__45230;
var G__45257 = count__45231;
var G__45258 = (i__45232 + (1));
seq__45228 = G__45255;
chunk__45230 = G__45256;
count__45231 = G__45257;
i__45232 = G__45258;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__45228);
if(temp__5278__auto__){
var seq__45228__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__45228__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__45228__$1);
var G__45259 = cljs.core.chunk_rest.call(null,seq__45228__$1);
var G__45260 = c__24059__auto__;
var G__45261 = cljs.core.count.call(null,c__24059__auto__);
var G__45262 = (0);
seq__45228 = G__45259;
chunk__45230 = G__45260;
count__45231 = G__45261;
i__45232 = G__45262;
continue;
} else {
var vec__45242 = cljs.core.first.call(null,seq__45228__$1);
var vec__45245 = cljs.core.nth.call(null,vec__45242,(0),null);
var x = cljs.core.nth.call(null,vec__45245,(0),null);
var y = cljs.core.nth.call(null,vec__45245,(1),null);
var weather = cljs.core.nth.call(null,vec__45242,(1),null);
var map__45248_45263 = new cljs.core.Keyword(null,"wind","wind",-527553074).cljs$core$IFn$_invoke$arity$1(weather);
var map__45248_45264__$1 = ((((!((map__45248_45263 == null)))?((((map__45248_45263.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45248_45263.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45248_45263):map__45248_45263);
var speed_45265 = cljs.core.get.call(null,map__45248_45264__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading_45266 = cljs.core.get.call(null,map__45248_45264__$1,new cljs.core.Keyword(null,"heading","heading",-1312171873));
var cell_45267 = 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_45267.setAttribute("transform",weathergen.ui.common.svg_rotate.call(null,heading_45266));

cell_45267.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_45265))].join(''));

var G__45268 = cljs.core.next.call(null,seq__45228__$1);
var G__45269 = null;
var G__45270 = (0);
var G__45271 = (0);
seq__45228 = G__45268;
chunk__45230 = G__45269;
count__45231 = G__45270;
i__45232 = G__45271;
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__24179__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24180__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24181__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24182__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24183__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__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__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__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24183__auto__,method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__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__45272 = new cljs.core.Keyword(null,"temperature","temperature",899018429).cljs$core$IFn$_invoke$arity$1(weather);
return G__45272;
})().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__45291 = cljs.core.seq.call(null,weather_data);
var chunk__45293 = null;
var count__45294 = (0);
var i__45295 = (0);
while(true){
if((i__45295 < count__45294)){
var vec__45297 = cljs.core._nth.call(null,chunk__45293,i__45295);
var vec__45300 = cljs.core.nth.call(null,vec__45297,(0),null);
var x = cljs.core.nth.call(null,vec__45300,(0),null);
var y = cljs.core.nth.call(null,vec__45300,(1),null);
var weather = cljs.core.nth.call(null,vec__45297,(1),null);
var text_45309 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_45310 = 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_45310.innerHTML = text_45309;

var G__45311 = seq__45291;
var G__45312 = chunk__45293;
var G__45313 = count__45294;
var G__45314 = (i__45295 + (1));
seq__45291 = G__45311;
chunk__45293 = G__45312;
count__45294 = G__45313;
i__45295 = G__45314;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__45291);
if(temp__5278__auto__){
var seq__45291__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__45291__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__45291__$1);
var G__45315 = cljs.core.chunk_rest.call(null,seq__45291__$1);
var G__45316 = c__24059__auto__;
var G__45317 = cljs.core.count.call(null,c__24059__auto__);
var G__45318 = (0);
seq__45291 = G__45315;
chunk__45293 = G__45316;
count__45294 = G__45317;
i__45295 = G__45318;
continue;
} else {
var vec__45303 = cljs.core.first.call(null,seq__45291__$1);
var vec__45306 = cljs.core.nth.call(null,vec__45303,(0),null);
var x = cljs.core.nth.call(null,vec__45306,(0),null);
var y = cljs.core.nth.call(null,vec__45306,(1),null);
var weather = cljs.core.nth.call(null,vec__45303,(1),null);
var text_45319 = weathergen.ui.overlay_text.call(null,weather,display_params);
var cell_45320 = 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_45320.innerHTML = text_45319;

var G__45321 = cljs.core.next.call(null,seq__45291__$1);
var G__45322 = null;
var G__45323 = (0);
var G__45324 = (0);
seq__45291 = G__45321;
chunk__45293 = G__45322;
count__45294 = G__45323;
i__45295 = G__45324;
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__45328 = cljs.core.contains_QMARK_;
var expr__45329 = new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(display_params);
if(cljs.core.truth_(pred__45328.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__45329))){
return weathergen.ui.update_wind_layer.call(null,weather_data,display_params);
} else {
if(cljs.core.truth_(pred__45328.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__45329))){
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__45355 = cljs.core.seq.call(null,weather_data);
var chunk__45357 = null;
var count__45358 = (0);
var i__45359 = (0);
while(true){
if((i__45359 < count__45358)){
var vec__45361 = cljs.core._nth.call(null,chunk__45357,i__45359);
var vec__45364 = cljs.core.nth.call(null,vec__45361,(0),null);
var x = cljs.core.nth.call(null,vec__45364,(0),null);
var y = cljs.core.nth.call(null,vec__45364,(1),null);
var weather = cljs.core.nth.call(null,vec__45361,(1),null);
var vec__45367_45379 = 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_45380 = cljs.core.nth.call(null,vec__45367_45379,(0),null);
var g_45381 = cljs.core.nth.call(null,vec__45367_45379,(1),null);
var b_45382 = cljs.core.nth.call(null,vec__45367_45379,(2),null);
var a_45383 = cljs.core.nth.call(null,vec__45367_45379,(3),null);
var cell_45384 = 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_45384)){
cell_45384.setAttribute("fill",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgba("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_45380),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_45381),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_45382),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_45383),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join(''));
} else {
}

var G__45385 = seq__45355;
var G__45386 = chunk__45357;
var G__45387 = count__45358;
var G__45388 = (i__45359 + (1));
seq__45355 = G__45385;
chunk__45357 = G__45386;
count__45358 = G__45387;
i__45359 = G__45388;
continue;
} else {
var temp__5278__auto__ = cljs.core.seq.call(null,seq__45355);
if(temp__5278__auto__){
var seq__45355__$1 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__45355__$1)){
var c__24059__auto__ = cljs.core.chunk_first.call(null,seq__45355__$1);
var G__45389 = cljs.core.chunk_rest.call(null,seq__45355__$1);
var G__45390 = c__24059__auto__;
var G__45391 = cljs.core.count.call(null,c__24059__auto__);
var G__45392 = (0);
seq__45355 = G__45389;
chunk__45357 = G__45390;
count__45358 = G__45391;
i__45359 = G__45392;
continue;
} else {
var vec__45370 = cljs.core.first.call(null,seq__45355__$1);
var vec__45373 = cljs.core.nth.call(null,vec__45370,(0),null);
var x = cljs.core.nth.call(null,vec__45373,(0),null);
var y = cljs.core.nth.call(null,vec__45373,(1),null);
var weather = cljs.core.nth.call(null,vec__45370,(1),null);
var vec__45376_45393 = 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_45394 = cljs.core.nth.call(null,vec__45376_45393,(0),null);
var g_45395 = cljs.core.nth.call(null,vec__45376_45393,(1),null);
var b_45396 = cljs.core.nth.call(null,vec__45376_45393,(2),null);
var a_45397 = cljs.core.nth.call(null,vec__45376_45393,(3),null);
var cell_45398 = 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_45398)){
cell_45398.setAttribute("fill",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("rgba("),cljs.core.str.cljs$core$IFn$_invoke$arity$1(r_45394),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(g_45395),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(b_45396),cljs.core.str.cljs$core$IFn$_invoke$arity$1(","),cljs.core.str.cljs$core$IFn$_invoke$arity$1(a_45397),cljs.core.str.cljs$core$IFn$_invoke$arity$1(")")].join(''));
} else {
}

var G__45399 = cljs.core.next.call(null,seq__45355__$1);
var G__45400 = null;
var G__45401 = (0);
var G__45402 = (0);
seq__45355 = G__45399;
chunk__45357 = G__45400;
count__45358 = G__45401;
i__45359 = G__45402;
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 = hoplon.svg.defs.call(null,(function (){var iter__24010__auto__ = (function weathergen$ui$iter__45403(s__45404){
return (new cljs.core.LazySeq(null,(function (){
var s__45404__$1 = s__45404;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__45404__$1);
if(temp__5278__auto__){
var s__45404__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__45404__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__45404__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__45406 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__45405 = (0);
while(true){
if((i__45405 < size__24009__auto__)){
var speed = cljs.core._nth.call(null,c__24008__auto__,i__45405);
cljs.core.chunk_append.call(null,b__45406,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__45407 = (i__45405 + (1));
i__45405 = G__45407;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45406),weathergen$ui$iter__45403.call(null,cljs.core.chunk_rest.call(null,s__45404__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45406),null);
}
} else {
var speed = cljs.core.first.call(null,s__45404__$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$iter__45403.call(null,cljs.core.rest.call(null,s__45404__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24010__auto__.call(null,cljs.core.range.call(null,(5),(weathergen.ui.max_wind_vector_speed + (1)),(5)));
})());
weathergen.ui.bullseye_info_box = (function (){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__45410,G__45411,G__45409,G__45412){
return [cljs.core.str.cljs$core$IFn$_invoke$arity$1((function (){var G__45408 = G__45409;
var G__45408__$1 = (cljs.core.truth_((G__45408 == null))?null:G__45410.call(null,G__45411,G__45408));
if(cljs.core.truth_((G__45408__$1 == null))){
return null;
} else {
return G__45412.call(null,G__45408__$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___45425 = watched;
if(cljs.core.truth_(temp__5278__auto___45425)){
var w__15571__auto___45426 = temp__5278__auto___45425;
cljs.core.add_watch.call(null,w__15571__auto___45426,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15571__auto___45426,temp__5278__auto___45425,x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (_,___$1,___$2,___$3){
return setTimeout(((function (w__15571__auto___45426,temp__5278__auto___45425,x,y,w,h,t,update_bbox__15569__auto__,watched){
return (function (){
return update_bbox__15569__auto__.call(null);
});})(w__15571__auto___45426,temp__5278__auto___45425,x,y,w,h,t,update_bbox__15569__auto__,watched))
,(0));
});})(w__15571__auto___45426,temp__5278__auto___45425,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__45413){
return cljs.core.not.call(null,(G__45413 == 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__45414 = mouse_location;
var map__45414__$1 = ((((!((map__45414 == null)))?((((map__45414.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45414.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45414):map__45414);
var x__$1 = cljs.core.get.call(null,map__45414__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__45414__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var vec__45415 = map_size;
var width = cljs.core.nth.call(null,vec__45415,(0),null);
var height = cljs.core.nth.call(null,vec__45415,(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__45419,G__45421,G__45420){
return G__45419.call(null,(G__45420 / G__45421));
});})(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__45422){
return (G__45422 * -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__45423){
return (- (0.8 * G__45423));
});})(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__45424){
return (G__45424 * 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__45462 = hover_cell;
var map__45462__$1 = ((((!((map__45462 == null)))?((((map__45462.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45462.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45462):map__45462);
var x = cljs.core.get.call(null,map__45462__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__45462__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.not.call(null,(function (){var and__23136__auto__ = x;
if(cljs.core.truth_(and__23136__auto__)){
var and__23136__auto____$1 = y;
if(cljs.core.truth_(and__23136__auto____$1)){
return ((((0) <= x)) && ((x <= (nx - (1))))) && ((((0) <= y)) && ((y <= (ny - (1)))));
} else {
return and__23136__auto____$1;
}
} else {
return and__23136__auto__;
}
})())){
return cljs.core.PersistentVector.EMPTY;
} else {
var width = (13);
var height = (8);
var map__45464 = cljs.core.get.call(null,weather_data,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [x,y], null));
var map__45464__$1 = ((((!((map__45464 == null)))?((((map__45464.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45464.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45464):map__45464);
var pressure = cljs.core.get.call(null,map__45464__$1,new cljs.core.Keyword(null,"pressure","pressure",505343747));
var temperature = cljs.core.get.call(null,map__45464__$1,new cljs.core.Keyword(null,"temperature","temperature",899018429));
var wind = cljs.core.get.call(null,map__45464__$1,new cljs.core.Keyword(null,"wind","wind",-527553074));
var type = cljs.core.get.call(null,map__45464__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var map__45465 = wind;
var map__45465__$1 = ((((!((map__45465 == null)))?((((map__45465.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45465.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45465):map__45465);
var speed = cljs.core.get.call(null,map__45465__$1,new cljs.core.Keyword(null,"speed","speed",1257663751));
var heading = cljs.core.get.call(null,map__45465__$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__45464,map__45464__$1,pressure,temperature,wind,type,map__45465,map__45465__$1,speed,heading,map__45462,map__45462__$1,x,y){
return (function (G__45468){
return cljs.core.not.call(null,(G__45468 == null));
});})(width,height,map__45464,map__45464__$1,pressure,temperature,wind,type,map__45465,map__45465__$1,speed,heading,map__45462,map__45462__$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__24010__auto__ = ((function (cloud_descriptions,width,height,map__45464,map__45464__$1,pressure,temperature,wind,type,map__45465,map__45465__$1,speed,heading,map__45462,map__45462__$1,x,y){
return (function weathergen$ui$info_overlay_$_iter__45469(s__45470){
return (new cljs.core.LazySeq(null,((function (cloud_descriptions,width,height,map__45464,map__45464__$1,pressure,temperature,wind,type,map__45465,map__45465__$1,speed,heading,map__45462,map__45462__$1,x,y){
return (function (){
var s__45470__$1 = s__45470;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__45470__$1);
if(temp__5278__auto__){
var s__45470__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__45470__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__45470__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__45472 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__45471 = (0);
while(true){
if((i__45471 < size__24009__auto__)){
var vec__45485 = cljs.core._nth.call(null,c__24008__auto__,i__45471);
var line = cljs.core.nth.call(null,vec__45485,(0),null);
var vec__45488 = cljs.core.nth.call(null,vec__45485,(1),null);
var label = cljs.core.nth.call(null,vec__45488,(0),null);
var value = cljs.core.nth.call(null,vec__45488,(1),null);
cljs.core.chunk_append.call(null,b__45472,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__45497 = (i__45471 + (1));
i__45471 = G__45497;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45472),weathergen$ui$info_overlay_$_iter__45469.call(null,cljs.core.chunk_rest.call(null,s__45470__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45472),null);
}
} else {
var vec__45491 = cljs.core.first.call(null,s__45470__$2);
var line = cljs.core.nth.call(null,vec__45491,(0),null);
var vec__45494 = cljs.core.nth.call(null,vec__45491,(1),null);
var label = cljs.core.nth.call(null,vec__45494,(0),null);
var value = cljs.core.nth.call(null,vec__45494,(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__45469.call(null,cljs.core.rest.call(null,s__45470__$2)));
}
} else {
return null;
}
break;
}
});})(cloud_descriptions,width,height,map__45464,map__45464__$1,pressure,temperature,wind,type,map__45465,map__45465__$1,speed,heading,map__45462,map__45462__$1,x,y))
,null,null));
});})(cloud_descriptions,width,height,map__45464,map__45464__$1,pressure,temperature,wind,type,map__45465,map__45465__$1,speed,heading,map__45462,map__45462__$1,x,y))
;
return iter__24010__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__45500 = proposed;
var map__45500__$1 = ((((!((map__45500 == null)))?((((map__45500.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__45500.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__45500):map__45500);
var x = cljs.core.get.call(null,map__45500__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__45500__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__45500__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__45500__$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__45897,G__45895,G__45896){
return G__45895.call(null,G__45896,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__45897));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__45892 = 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__45892,(0),null);
var ny = cljs.core.nth.call(null,vec__45892,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__45892,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__24010__auto__ = ((function (indexed,vec__45892,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__45898(s__45899){
return (new cljs.core.LazySeq(null,((function (indexed,vec__45892,nx,ny){
return (function (){
var s__45899__$1 = s__45899;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__45899__$1);
if(temp__5278__auto__){
var s__45899__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__45899__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__45899__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__45901 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__45900 = (0);
while(true){
if((i__45900 < size__24009__auto__)){
var vec__46092 = cljs.core._nth.call(null,c__24008__auto__,i__45900);
var index = cljs.core.nth.call(null,vec__46092,(0),null);
var area = cljs.core.nth.call(null,vec__46092,(1),null);
cljs.core.chunk_append.call(null,b__45901,(function (){var map__46095 = area;
var map__46095__$1 = ((((!((map__46095 == null)))?((((map__46095.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46095.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46095):map__46095);
var bounds = cljs.core.get.call(null,map__46095__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var editing_QMARK_ = cljs.core.get.call(null,map__46095__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__46096 = bounds;
var map__46096__$1 = ((((!((map__46096 == null)))?((((map__46096.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46096.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46096):map__46096);
var x = cljs.core.get.call(null,map__46096__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46096__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__46096__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__46096__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var mousedown = ((function (i__45900,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__45900,starting_bounds,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (p__46099,final_QMARK_){
var vec__46100 = p__46099;
var dx = cljs.core.nth.call(null,vec__46100,(0),null);
var dy = cljs.core.nth.call(null,vec__46100,(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__45900,dx__$1,dy__$1,vec__46100,dx,dy,starting_bounds,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__45900,dx__$1,dy__$1,vec__46100,dx,dy,starting_bounds,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__45900,dx__$1,dy__$1,vec__46100,dx,dy,starting_bounds,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__45900,dx__$1,dy__$1,vec__46100,dx,dy,starting_bounds,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
);
});
;})(i__45900,starting_bounds,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
})());
});})(i__45900,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__24010__auto__ = ((function (i__45900,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46103(s__46104){
return (new cljs.core.LazySeq(null,((function (i__45900,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (){
var s__46104__$1 = s__46104;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46104__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var vec__46148 = cljs.core.first.call(null,xs__5831__auto__);
var dx = cljs.core.nth.call(null,vec__46148,(0),null);
var dir_h = cljs.core.nth.call(null,vec__46148,(1),null);
var iterys__24006__auto__ = ((function (s__46104__$1,i__45900,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46103_$_iter__46105(s__46106){
return (new cljs.core.LazySeq(null,((function (s__46104__$1,i__45900,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (){
var s__46106__$1 = s__46106;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__46106__$1);
if(temp__5278__auto____$2){
var s__46106__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46106__$2)){
var c__24008__auto____$1 = cljs.core.chunk_first.call(null,s__46106__$2);
var size__24009__auto____$1 = cljs.core.count.call(null,c__24008__auto____$1);
var b__46108 = cljs.core.chunk_buffer.call(null,size__24009__auto____$1);
if((function (){var i__46107 = (0);
while(true){
if((i__46107 < size__24009__auto____$1)){
var vec__46169 = cljs.core._nth.call(null,c__24008__auto____$1,i__46107);
var dy = cljs.core.nth.call(null,vec__46169,(0),null);
var dir_v = cljs.core.nth.call(null,vec__46169,(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__46108,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__46107,s__46106__$1,s__46104__$1,i__45900,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46107,s__46106__$1,s__46104__$1,i__45900,starting_bounds,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (p__46172,final_QMARK_){
var vec__46173 = p__46172;
var dx__$1 = cljs.core.nth.call(null,vec__46173,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__46173,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (i__46107,s__46106__$1,s__46104__$1,i__45900,vec__46173,dx__$1,dy__$1,starting_bounds,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46107,s__46106__$1,s__46104__$1,i__45900,vec__46173,dx__$1,dy__$1,starting_bounds,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__23148__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__46177 = bounds__$1;
var G__46177__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__46177,starting_bounds,dx__$2):G__46177);
var G__46177__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__46177__$1,starting_bounds,dx__$2):G__46177__$1);
var G__46177__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__46177__$2,starting_bounds,dy__$2):G__46177__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__46177__$3,starting_bounds,dy__$2);
} else {
return G__46177__$3;
}
})());
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return bounds__$1;
}
});})(i__46107,s__46106__$1,s__46104__$1,i__45900,vec__46173,dx__$1,dy__$1,starting_bounds,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46107,s__46106__$1,s__46104__$1,i__45900,vec__46173,dx__$1,dy__$1,starting_bounds,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
);
});
;})(i__46107,s__46106__$1,s__46104__$1,i__45900,starting_bounds,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
})());
});})(i__46107,s__46106__$1,s__46104__$1,i__45900,vec__46169,dy,dir_v,c__24008__auto____$1,size__24009__auto____$1,b__46108,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
));

var G__46282 = (i__46107 + (1));
i__46107 = G__46282;
continue;
} else {
var G__46283 = (i__46107 + (1));
i__46107 = G__46283;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46108),weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46103_$_iter__46105.call(null,cljs.core.chunk_rest.call(null,s__46106__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46108),null);
}
} else {
var vec__46178 = cljs.core.first.call(null,s__46106__$2);
var dy = cljs.core.nth.call(null,vec__46178,(0),null);
var dir_v = cljs.core.nth.call(null,vec__46178,(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__46106__$1,s__46104__$1,i__45900,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46106__$1,s__46104__$1,i__45900,starting_bounds,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (p__46181,final_QMARK_){
var vec__46182 = p__46181;
var dx__$1 = cljs.core.nth.call(null,vec__46182,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__46182,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (s__46106__$1,s__46104__$1,i__45900,vec__46182,dx__$1,dy__$1,starting_bounds,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46106__$1,s__46104__$1,i__45900,vec__46182,dx__$1,dy__$1,starting_bounds,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__23148__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__46186 = bounds__$1;
var G__46186__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__46186,starting_bounds,dx__$2):G__46186);
var G__46186__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__46186__$1,starting_bounds,dx__$2):G__46186__$1);
var G__46186__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__46186__$2,starting_bounds,dy__$2):G__46186__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__46186__$3,starting_bounds,dy__$2);
} else {
return G__46186__$3;
}
})());
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return bounds__$1;
}
});})(s__46106__$1,s__46104__$1,i__45900,vec__46182,dx__$1,dy__$1,starting_bounds,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46106__$1,s__46104__$1,i__45900,vec__46182,dx__$1,dy__$1,starting_bounds,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
);
});
;})(s__46106__$1,s__46104__$1,i__45900,starting_bounds,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
})());
});})(s__46106__$1,s__46104__$1,i__45900,vec__46178,dy,dir_v,s__46106__$2,temp__5278__auto____$2,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
),weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46103_$_iter__46105.call(null,cljs.core.rest.call(null,s__46106__$2)));
} else {
var G__46284 = cljs.core.rest.call(null,s__46106__$2);
s__46106__$1 = G__46284;
continue;
}
}
} else {
return null;
}
break;
}
});})(s__46104__$1,i__45900,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
,null,null));
});})(s__46104__$1,i__45900,vec__46148,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__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__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46103.call(null,cljs.core.rest.call(null,s__46104__$1)));
} else {
var G__46285 = cljs.core.rest.call(null,s__46104__$1);
s__46104__$1 = G__46285;
continue;
}
} else {
return null;
}
break;
}
});})(i__45900,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
,null,null));
});})(i__45900,map__46095,map__46095__$1,bounds,editing_QMARK_,map__46096,map__46096__$1,x,y,width,height,mousedown,vec__46092,index,area,c__24008__auto__,size__24009__auto__,b__45901,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
;
return iter__24010__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__46286 = (i__45900 + (1));
i__45900 = G__46286;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45901),weathergen$ui$wind_stability_overlay_$_iter__45898.call(null,cljs.core.chunk_rest.call(null,s__45899__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__45901),null);
}
} else {
var vec__46187 = cljs.core.first.call(null,s__45899__$2);
var index = cljs.core.nth.call(null,vec__46187,(0),null);
var area = cljs.core.nth.call(null,vec__46187,(1),null);
return cljs.core.cons.call(null,(function (){var map__46190 = area;
var map__46190__$1 = ((((!((map__46190 == null)))?((((map__46190.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46190.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46190):map__46190);
var bounds = cljs.core.get.call(null,map__46190__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var editing_QMARK_ = cljs.core.get.call(null,map__46190__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__46191 = bounds;
var map__46191__$1 = ((((!((map__46191 == null)))?((((map__46191.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46191.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46191):map__46191);
var x = cljs.core.get.call(null,map__46191__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46191__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__46191__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__46191__$1,new cljs.core.Keyword(null,"height","height",1025178622));
var mousedown = ((function (map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (p__46194,final_QMARK_){
var vec__46195 = p__46194;
var dx = cljs.core.nth.call(null,vec__46195,(0),null);
var dy = cljs.core.nth.call(null,vec__46195,(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__46195,dx,dy,starting_bounds,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46195,dx,dy,starting_bounds,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46195,dx,dy,starting_bounds,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46195,dx,dy,starting_bounds,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
);
});
;})(starting_bounds,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
})());
});})(map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__24010__auto__ = ((function (map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46198(s__46199){
return (new cljs.core.LazySeq(null,((function (map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (){
var s__46199__$1 = s__46199;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46199__$1);
if(temp__5278__auto____$1){
var xs__5831__auto__ = temp__5278__auto____$1;
var vec__46243 = cljs.core.first.call(null,xs__5831__auto__);
var dx = cljs.core.nth.call(null,vec__46243,(0),null);
var dir_h = cljs.core.nth.call(null,vec__46243,(1),null);
var iterys__24006__auto__ = ((function (s__46199__$1,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46198_$_iter__46200(s__46201){
return (new cljs.core.LazySeq(null,((function (s__46199__$1,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (){
var s__46201__$1 = s__46201;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__46201__$1);
if(temp__5278__auto____$2){
var s__46201__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46201__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__46201__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__46203 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__46202 = (0);
while(true){
if((i__46202 < size__24009__auto__)){
var vec__46264 = cljs.core._nth.call(null,c__24008__auto__,i__46202);
var dy = cljs.core.nth.call(null,vec__46264,(0),null);
var dir_v = cljs.core.nth.call(null,vec__46264,(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__46203,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__46202,s__46201__$1,s__46199__$1,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46202,s__46201__$1,s__46199__$1,starting_bounds,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (p__46267,final_QMARK_){
var vec__46268 = p__46267;
var dx__$1 = cljs.core.nth.call(null,vec__46268,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__46268,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (i__46202,s__46201__$1,s__46199__$1,vec__46268,dx__$1,dy__$1,starting_bounds,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46202,s__46201__$1,s__46199__$1,vec__46268,dx__$1,dy__$1,starting_bounds,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__23148__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__46272 = bounds__$1;
var G__46272__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__46272,starting_bounds,dx__$2):G__46272);
var G__46272__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__46272__$1,starting_bounds,dx__$2):G__46272__$1);
var G__46272__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__46272__$2,starting_bounds,dy__$2):G__46272__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__46272__$3,starting_bounds,dy__$2);
} else {
return G__46272__$3;
}
})());
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return bounds__$1;
}
});})(i__46202,s__46201__$1,s__46199__$1,vec__46268,dx__$1,dy__$1,starting_bounds,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46202,s__46201__$1,s__46199__$1,vec__46268,dx__$1,dy__$1,starting_bounds,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
);
});
;})(i__46202,s__46201__$1,s__46199__$1,starting_bounds,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
})());
});})(i__46202,s__46201__$1,s__46199__$1,vec__46264,dy,dir_v,c__24008__auto__,size__24009__auto__,b__46203,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
));

var G__46287 = (i__46202 + (1));
i__46202 = G__46287;
continue;
} else {
var G__46288 = (i__46202 + (1));
i__46202 = G__46288;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46203),weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46198_$_iter__46200.call(null,cljs.core.chunk_rest.call(null,s__46201__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46203),null);
}
} else {
var vec__46273 = cljs.core.first.call(null,s__46201__$2);
var dy = cljs.core.nth.call(null,vec__46273,(0),null);
var dir_v = cljs.core.nth.call(null,vec__46273,(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__46201__$1,s__46199__$1,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46201__$1,s__46199__$1,starting_bounds,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny){
return (function (p__46276,final_QMARK_){
var vec__46277 = p__46276;
var dx__$1 = cljs.core.nth.call(null,vec__46277,(0),null);
var dy__$1 = cljs.core.nth.call(null,vec__46277,(1),null);
return javelin.core.dosync_STAR_.call(null,((function (s__46201__$1,s__46199__$1,vec__46277,dx__$1,dy__$1,starting_bounds,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46201__$1,s__46199__$1,vec__46277,dx__$1,dy__$1,starting_bounds,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__23148__auto__ = weathergen.ui.restrict.call(null,nx,ny,(function (){var G__46281 = bounds__$1;
var G__46281__$1 = ((cljs.core._EQ_.call(null,dir_h,"w"))?weathergen.ui.adjust_west.call(null,G__46281,starting_bounds,dx__$2):G__46281);
var G__46281__$2 = ((cljs.core._EQ_.call(null,dir_h,"e"))?weathergen.ui.adjust_east.call(null,G__46281__$1,starting_bounds,dx__$2):G__46281__$1);
var G__46281__$3 = ((cljs.core._EQ_.call(null,dir_v,"n"))?weathergen.ui.adjust_north.call(null,G__46281__$2,starting_bounds,dy__$2):G__46281__$2);
if(cljs.core._EQ_.call(null,dir_v,"s")){
return weathergen.ui.adjust_south.call(null,G__46281__$3,starting_bounds,dy__$2);
} else {
return G__46281__$3;
}
})());
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return bounds__$1;
}
});})(s__46201__$1,s__46199__$1,vec__46277,dx__$1,dy__$1,starting_bounds,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,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__46201__$1,s__46199__$1,vec__46277,dx__$1,dy__$1,starting_bounds,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
);
});
;})(s__46201__$1,s__46199__$1,starting_bounds,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
})());
});})(s__46201__$1,s__46199__$1,vec__46273,dy,dir_v,s__46201__$2,temp__5278__auto____$2,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
),weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46198_$_iter__46200.call(null,cljs.core.rest.call(null,s__46201__$2)));
} else {
var G__46289 = cljs.core.rest.call(null,s__46201__$2);
s__46201__$1 = G__46289;
continue;
}
}
} else {
return null;
}
break;
}
});})(s__46199__$1,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
,null,null));
});})(s__46199__$1,vec__46243,dx,dir_h,xs__5831__auto__,temp__5278__auto____$1,map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__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__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$wind_stability_overlay_$_iter__45898_$_iter__46198.call(null,cljs.core.rest.call(null,s__46199__$1)));
} else {
var G__46290 = cljs.core.rest.call(null,s__46199__$1);
s__46199__$1 = G__46290;
continue;
}
} else {
return null;
}
break;
}
});})(map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
,null,null));
});})(map__46190,map__46190__$1,bounds,editing_QMARK_,map__46191,map__46191__$1,x,y,width,height,mousedown,vec__46187,index,area,s__45899__$2,temp__5278__auto__,indexed,vec__45892,nx,ny))
;
return iter__24010__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__45898.call(null,cljs.core.rest.call(null,s__45899__$2)));
}
} else {
return null;
}
break;
}
});})(indexed,vec__45892,nx,ny))
,null,null));
});})(indexed,vec__45892,nx,ny))
;
return iter__24010__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__45892,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__46443,G__46441,G__46442){
return G__46441.call(null,G__46442,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710).cljs$core$IFn$_invoke$arity$1(G__46443));
})).call(null,weather_params,cljs.core.map_indexed,cljs.core.vector);
var vec__46438 = 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__46438,(0),null);
var ny = cljs.core.nth.call(null,vec__46438,(1),null);
return javelin.core.formula.call(null,((function (indexed,vec__46438,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__24010__auto__ = ((function (indexed,vec__46438,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__46444(s__46445){
return (new cljs.core.LazySeq(null,((function (indexed,vec__46438,nx,ny){
return (function (){
var s__46445__$1 = s__46445;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46445__$1);
if(temp__5278__auto__){
var s__46445__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46445__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__46445__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__46447 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__46446 = (0);
while(true){
if((i__46446 < size__24009__auto__)){
var vec__46516 = cljs.core._nth.call(null,c__24008__auto__,i__46446);
var index = cljs.core.nth.call(null,vec__46516,(0),null);
var override = cljs.core.nth.call(null,vec__46516,(1),null);
var map__46519 = override;
var map__46519__$1 = ((((!((map__46519 == null)))?((((map__46519.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46519.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46519):map__46519);
var location = cljs.core.get.call(null,map__46519__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__46519__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__46519__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__46519__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__46519__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__46520 = location;
var map__46520__$1 = ((((!((map__46520 == null)))?((((map__46520.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46520.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46520):map__46520);
var x = cljs.core.get.call(null,map__46520__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46520__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__23148__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return editing_QMARK_;
}
})())){
cljs.core.chunk_append.call(null,b__46447,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__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,starting,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46523,final_QMARK_){
var vec__46524 = p__46523;
var dx = cljs.core.nth.call(null,vec__46524,(0),null);
var dy = cljs.core.nth.call(null,vec__46524,(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__46446,s__46445__$1,dx__$1,dy__$1,vec__46524,dx,dy,starting,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,dx__$1,dy__$1,vec__46524,dx,dy,starting,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,dx__$1,dy__$1,vec__46524,dx,dy,starting,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,dx__$1,dy__$1,vec__46524,dx,dy,starting,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});
;})(i__46446,s__46445__$1,starting,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
})());
});})(i__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (rad,mutate){
var iter__24010__auto__ = ((function (i__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__46444_$_iter__46527(s__46528){
return (new cljs.core.LazySeq(null,((function (i__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (){
var s__46528__$1 = s__46528;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46528__$1);
if(temp__5278__auto____$1){
var s__46528__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46528__$2)){
var c__24008__auto____$1 = cljs.core.chunk_first.call(null,s__46528__$2);
var size__24009__auto____$1 = cljs.core.count.call(null,c__24008__auto____$1);
var b__46530 = cljs.core.chunk_buffer.call(null,size__24009__auto____$1);
if((function (){var i__46529 = (0);
while(true){
if((i__46529 < size__24009__auto____$1)){
var theta = cljs.core._nth.call(null,c__24008__auto____$1,i__46529);
cljs.core.chunk_append.call(null,b__46530,(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__46529,i__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto____$1,size__24009__auto____$1,b__46530,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46529,i__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto____$1,size__24009__auto____$1,b__46530,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46539,final_QMARK_){
var vec__46540 = p__46539;
var dx = cljs.core.nth.call(null,vec__46540,(0),null);
var dy = cljs.core.nth.call(null,vec__46540,(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__46529,i__46446,s__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46540,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto____$1,size__24009__auto____$1,b__46530,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46529,i__46446,s__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46540,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto____$1,size__24009__auto____$1,b__46530,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46529,i__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto____$1,size__24009__auto____$1,b__46530,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46529,i__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto____$1,size__24009__auto____$1,b__46530,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
})());

var G__46584 = (i__46529 + (1));
i__46529 = G__46584;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46530),weathergen$ui$weather_overrides_overlay_$_iter__46444_$_iter__46527.call(null,cljs.core.chunk_rest.call(null,s__46528__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46530),null);
}
} else {
var theta = cljs.core.first.call(null,s__46528__$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__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46543,final_QMARK_){
var vec__46544 = p__46543;
var dx = cljs.core.nth.call(null,vec__46544,(0),null);
var dy = cljs.core.nth.call(null,vec__46544,(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__46446,s__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46544,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46544,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46446,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46528__$2,temp__5278__auto____$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__46444_$_iter__46527.call(null,cljs.core.rest.call(null,s__46528__$2)));
}
} else {
return null;
}
break;
}
});})(i__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
,null,null));
});})(i__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
;
return iter__24010__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(i__46446,s__46445__$1,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46547){
var map__46548 = p__46547;
var map__46548__$1 = ((((!((map__46548 == null)))?((((map__46548.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46548.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46548):map__46548);
var override__$1 = map__46548__$1;
var falloff__$1 = cljs.core.get.call(null,map__46548__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__46548__$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__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
),circle_edit.call(null,radius,((function (i__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__23486__auto__ = (1);
var y__23487__auto__ = cljs.core.long$.call(null,r);
return ((x__23486__auto__ > y__23487__auto__) ? x__23486__auto__ : y__23487__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__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p1__46291_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__46291_SHARP_);
});})(i__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46446,s__46445__$1,circle_edit,map__46519,map__46519__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46520,map__46520__$1,x,y,vec__46516,index,override,c__24008__auto__,size__24009__auto__,b__46447,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
)], null);
}
})()], null));

var G__46585 = (i__46446 + (1));
i__46446 = G__46585;
continue;
} else {
var G__46586 = (i__46446 + (1));
i__46446 = G__46586;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46447),weathergen$ui$weather_overrides_overlay_$_iter__46444.call(null,cljs.core.chunk_rest.call(null,s__46445__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46447),null);
}
} else {
var vec__46550 = cljs.core.first.call(null,s__46445__$2);
var index = cljs.core.nth.call(null,vec__46550,(0),null);
var override = cljs.core.nth.call(null,vec__46550,(1),null);
var map__46553 = override;
var map__46553__$1 = ((((!((map__46553 == null)))?((((map__46553.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46553.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46553):map__46553);
var location = cljs.core.get.call(null,map__46553__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__46553__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var falloff = cljs.core.get.call(null,map__46553__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var show_outline_QMARK_ = cljs.core.get.call(null,map__46553__$1,new cljs.core.Keyword(null,"show-outline?","show-outline?",820145348));
var editing_QMARK_ = cljs.core.get.call(null,map__46553__$1,new cljs.core.Keyword(null,"editing?","editing?",1646440800));
var map__46554 = location;
var map__46554__$1 = ((((!((map__46554 == null)))?((((map__46554.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46554.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46554):map__46554);
var x = cljs.core.get.call(null,map__46554__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46554__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
if(cljs.core.truth_((function (){var or__23148__auto__ = show_outline_QMARK_;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,starting,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46557,final_QMARK_){
var vec__46558 = p__46557;
var dx = cljs.core.nth.call(null,vec__46558,(0),null);
var dy = cljs.core.nth.call(null,vec__46558,(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__46445__$1,dx__$1,dy__$1,vec__46558,dx,dy,starting,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,dx__$1,dy__$1,vec__46558,dx,dy,starting,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,dx__$1,dy__$1,vec__46558,dx,dy,starting,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,dx__$1,dy__$1,vec__46558,dx,dy,starting,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});
;})(s__46445__$1,starting,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
})());
});})(s__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (rad,mutate){
var iter__24010__auto__ = ((function (s__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function weathergen$ui$weather_overrides_overlay_$_iter__46444_$_iter__46561(s__46562){
return (new cljs.core.LazySeq(null,((function (s__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (){
var s__46562__$1 = s__46562;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__46562__$1);
if(temp__5278__auto____$1){
var s__46562__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46562__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__46562__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__46564 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__46563 = (0);
while(true){
if((i__46563 < size__24009__auto__)){
var theta = cljs.core._nth.call(null,c__24008__auto__,i__46563);
cljs.core.chunk_append.call(null,b__46564,(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__46563,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto__,size__24009__auto__,b__46564,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46563,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto__,size__24009__auto__,b__46564,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46573,final_QMARK_){
var vec__46574 = p__46573;
var dx = cljs.core.nth.call(null,vec__46574,(0),null);
var dy = cljs.core.nth.call(null,vec__46574,(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__46563,s__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46574,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto__,size__24009__auto__,b__46564,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46563,s__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46574,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto__,size__24009__auto__,b__46564,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46563,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto__,size__24009__auto__,b__46564,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(i__46563,s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,c__24008__auto__,size__24009__auto__,b__46564,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
})());

var G__46587 = (i__46563 + (1));
i__46563 = G__46587;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46564),weathergen$ui$weather_overrides_overlay_$_iter__46444_$_iter__46561.call(null,cljs.core.chunk_rest.call(null,s__46562__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46564),null);
}
} else {
var theta = cljs.core.first.call(null,s__46562__$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__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46577,final_QMARK_){
var vec__46578 = p__46577;
var dx = cljs.core.nth.call(null,vec__46578,(0),null);
var dy = cljs.core.nth.call(null,vec__46578,(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__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46578,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,dx_SINGLEQUOTE_,dy_SINGLEQUOTE_,r_SINGLEQUOTE_,vec__46578,dx,dy,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(s__46445__$1,alpha,r,sin_a,cos_a,x_offset,y_offset,lx,ly,theta,s__46562__$2,temp__5278__auto____$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
})(),weathergen$ui$weather_overrides_overlay_$_iter__46444_$_iter__46561.call(null,cljs.core.rest.call(null,s__46562__$2)));
}
} else {
return null;
}
break;
}
});})(s__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
,null,null));
});})(s__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
;
return iter__24010__auto__.call(null,cljs.core.range.call(null,(0),(360),(45)));
});})(s__46445__$1,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p__46581){
var map__46582 = p__46581;
var map__46582__$1 = ((((!((map__46582 == null)))?((((map__46582.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46582.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46582):map__46582);
var override__$1 = map__46582__$1;
var falloff__$1 = cljs.core.get.call(null,map__46582__$1,new cljs.core.Keyword(null,"falloff","falloff",-1639069456));
var radius__$1 = cljs.core.get.call(null,map__46582__$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__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(s__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
),circle_edit.call(null,radius,((function (s__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,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__23486__auto__ = (1);
var y__23487__auto__ = cljs.core.long$.call(null,r);
return ((x__23486__auto__ > y__23487__auto__) ? x__23486__auto__ : y__23487__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__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny){
return (function (p1__46291_SHARP_){
return weathergen.math.clamp.call(null,(0),cljs.core.long$.call(null,r),p1__46291_SHARP_);
});})(s__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
);
});})(s__46445__$1,circle_edit,map__46553,map__46553__$1,location,radius,falloff,show_outline_QMARK_,editing_QMARK_,map__46554,map__46554__$1,x,y,vec__46550,index,override,s__46445__$2,temp__5278__auto__,indexed,vec__46438,nx,ny))
)], null);
}
})()], null),weathergen$ui$weather_overrides_overlay_$_iter__46444.call(null,cljs.core.rest.call(null,s__46445__$2)));
} else {
var G__46588 = cljs.core.rest.call(null,s__46445__$2);
s__46445__$1 = G__46588;
continue;
}
}
} else {
return null;
}
break;
}
});})(indexed,vec__46438,nx,ny))
,null,null));
});})(indexed,vec__46438,nx,ny))
;
return iter__24010__auto__.call(null,indexed__$1);
})());
});})(indexed,vec__46438,nx,ny))
).call(null,indexed);
});
weathergen.ui.flight_path__GT_path = (function weathergen$ui$flight_path__GT_path(size,path){
var G__46609 = path;
var vec__46610 = G__46609;
var seq__46611 = cljs.core.seq.call(null,vec__46610);
var first__46612 = cljs.core.first.call(null,seq__46611);
var seq__46611__$1 = cljs.core.next.call(null,seq__46611);
var point = first__46612;
var more = seq__46611__$1;
var landed_QMARK_ = false;
var s = null;
var G__46609__$1 = G__46609;
var landed_QMARK___$1 = landed_QMARK_;
var s__$1 = s;
while(true){
var vec__46613 = G__46609__$1;
var seq__46614 = cljs.core.seq.call(null,vec__46613);
var first__46615 = cljs.core.first.call(null,seq__46614);
var seq__46614__$1 = cljs.core.next.call(null,seq__46614);
var point__$1 = first__46615;
var more__$1 = seq__46614__$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__46616 = temp__5276__auto__;
var map__46616__$1 = ((((!((map__46616 == null)))?((((map__46616.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46616.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46616):map__46616);
var coordinates = cljs.core.get.call(null,map__46616__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var action = cljs.core.get.call(null,map__46616__$1,new cljs.core.Keyword("weathergen.dtc","action","weathergen.dtc/action",1537999145));
var map__46618 = coordinates;
var map__46618__$1 = ((((!((map__46618 == null)))?((((map__46618.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46618.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46618):map__46618);
var x = cljs.core.get.call(null,map__46618__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__46618__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__46619 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var gx = cljs.core.nth.call(null,vec__46619,(0),null);
var gy = cljs.core.nth.call(null,vec__46619,(1),null);
if(landed_QMARK___$2){
return s__$2;
} else {
var G__46623 = more__$1;
var G__46624 = (landed_QMARK___$2) || (cljs.core._EQ_.call(null,action,new cljs.core.Keyword(null,"land","land",-1402569867)));
var G__46625 = [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__46609__$1 = G__46623;
landed_QMARK___$1 = G__46624;
s__$1 = G__46625;
continue;
}
} else {
return s__$2;
}
break;
}
});
weathergen.ui.line__GT_path = (function weathergen$ui$line__GT_path(size,line){
var G__46646 = line;
var vec__46647 = G__46646;
var seq__46648 = cljs.core.seq.call(null,vec__46647);
var first__46649 = cljs.core.first.call(null,seq__46648);
var seq__46648__$1 = cljs.core.next.call(null,seq__46648);
var point = first__46649;
var more = seq__46648__$1;
var s = null;
var G__46646__$1 = G__46646;
var s__$1 = s;
while(true){
var vec__46650 = G__46646__$1;
var seq__46651 = cljs.core.seq.call(null,vec__46650);
var first__46652 = cljs.core.first.call(null,seq__46651);
var seq__46651__$1 = cljs.core.next.call(null,seq__46651);
var point__$1 = first__46652;
var more__$1 = seq__46651__$1;
var s__$2 = s__$1;
var temp__5276__auto__ = point__$1;
if(cljs.core.truth_(temp__5276__auto__)){
var map__46653 = temp__5276__auto__;
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 coordinates = cljs.core.get.call(null,map__46653__$1,new cljs.core.Keyword("weathergen.dtc","coordinates","weathergen.dtc/coordinates",-1965136125));
var map__46655 = coordinates;
var map__46655__$1 = ((((!((map__46655 == null)))?((((map__46655.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46655.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46655):map__46655);
var x = cljs.core.get.call(null,map__46655__$1,new cljs.core.Keyword("weathergen.dtc","x","weathergen.dtc/x",-384550566));
var y = cljs.core.get.call(null,map__46655__$1,new cljs.core.Keyword("weathergen.dtc","y","weathergen.dtc/y",-474567375));
var vec__46656 = weathergen.coordinates.ffeet__GT_weather.call(null,size,x,y);
var wx = cljs.core.nth.call(null,vec__46656,(0),null);
var wy = cljs.core.nth.call(null,vec__46656,(1),null);
var G__46660 = more__$1;
var G__46661 = [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__46646__$1 = G__46660;
s__$1 = G__46661;
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__29625__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__46758,G__46757){
return G__46757.call(null,G__46758);
});})(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__23136__auto__ = x__$1;
if(cljs.core.truth_(and__23136__auto__)){
return y__$1;
} else {
return and__23136__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__46759){
return new cljs.core.Keyword(null,"airbase-label-style","airbase-label-style",-1349798514).cljs$core$IFn$_invoke$arity$1(G__46759);
});})(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__46760){
return new cljs.core.Keyword("weathergen.falcon.files.mission","status","weathergen.falcon.files.mission/status",667063917).cljs$core$IFn$_invoke$arity$1(G__46760);
});})(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__46761 = image;
var map__46761__$1 = ((((!((map__46761 == null)))?((((map__46761.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46761.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46761):map__46761);
var image_data = cljs.core.get.call(null,map__46761__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__46762 = image_data;
var map__46762__$1 = ((((!((map__46762 == null)))?((((map__46762.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46762.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46762):map__46762);
var size = cljs.core.get.call(null,map__46762__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var center = cljs.core.get.call(null,map__46762__$1,new cljs.core.Keyword(null,"center","center",-748944368));
var vec__46763 = size;
var w = cljs.core.nth.call(null,vec__46763,(0),null);
var h = cljs.core.nth.call(null,vec__46763,(1),null);
var vec__46766 = center;
var cx = cljs.core.nth.call(null,vec__46766,(0),null);
var cy = cljs.core.nth.call(null,vec__46766,(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__46772,G__46771){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__46771) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__46771) - G__46772) / (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__46774,G__46773){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__46773) - ((2) * G__46774));
});})(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__29625__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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__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__29625__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__29627__auto__ = ((function (con__29625__auto__,alt__29626__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__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__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__29627__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__29625__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__46775,G__46776){
return G__46775.call(null,G__46776);
});})(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__46777,G__46778){
return ((G__46777 * G__46778) / (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__46779,G__46780){
return G__46779.call(null,G__46780);
});})(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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__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__29625__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__29627__auto__ = ((function (con__29625__auto__,alt__29626__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__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__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__29627__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__46781,G__46782,G__46783){
return (G__46781 + (G__46782 * (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__46783) + new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46783))));
});})(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__46784,G__46785,G__46786){
return cljs.core.PersistentHashSet.createAsIfByAssoc([G__46786,G__46785,G__46784]);
});})(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__46787 = 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__46787,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__46789,G__46788){
return (new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__46788) + ((new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__46788) - G__46789) / (2)));
});})(G__46787,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__46787,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__46787,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__46787,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__29615__auto__){
var vec__46790 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__46787,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__46787,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__29615__auto__));
var indexed = cljs.core.nth.call(null,vec__46790,(0),null);
var vec__46799 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__46790,indexed,G__46787,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__46802){
var vec__46803 = p__46802;
var i = cljs.core.nth.call(null,vec__46803,(0),null);
var squadron = cljs.core.nth.call(null,vec__46803,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [i,squadron], null);
});})(vec__46790,indexed,G__46787,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__46799,(0),null);
var squadron = cljs.core.nth.call(null,vec__46799,(1),null);
return hoplon.svg.tspan.call(null,new cljs.core.Keyword(null,"y","y",-1757859776),javelin.core.formula.call(null,((function (vec__46799,i,squadron,vec__46790,indexed,G__46787,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__46806,G__46807){
return ((G__46806 + (2)) * G__46807);
});})(vec__46799,i,squadron,vec__46790,indexed,G__46787,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__46799,i,squadron,vec__46790,indexed,G__46787,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__46808){
return (- (G__46808 / (2)));
});})(vec__46799,i,squadron,vec__46790,indexed,G__46787,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__46799,i,squadron,vec__46790,indexed,G__46787,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__46809,G__46810){
return G__46809.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__46810)),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__46810)));
});})(vec__46799,i,squadron,vec__46790,indexed,G__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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___46852 = bbox_trigger;
if(cljs.core.truth_(temp__5278__auto___46852)){
var w__15571__auto___46853 = temp__5278__auto___46852;
cljs.core.add_watch.call(null,w__15571__auto___46853,cljs.core.keyword.call(null,cljs.core.gensym.call(null)),((function (w__15571__auto___46853,temp__5278__auto___46852,G__46787,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___46853,temp__5278__auto___46852,G__46787,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___46853,temp__5278__auto___46852,G__46787,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___46853,temp__5278__auto___46852,G__46787,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__29625__auto__ = (new cljs.core.Delay(((function (G__46787,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__46787,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__46811,G__46812){
return G__46811.call(null,(0),G__46812);
});})(G__46787,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__46787,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__46813,G__46814){
return G__46813.call(null,G__46814);
});})(G__46787,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__29625__auto__ = (new cljs.core.Delay(((function (G__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__46787,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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__,G__46787,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__29625__auto__,G__46787,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__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,G__46787,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__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,G__46787,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__29627__auto__).call(null,weathergen.ui.map_show_text_background_QMARK_);
})(),t));
});})(G__46787,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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__,G__46787,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__29625__auto__,G__46787,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__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,G__46787,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__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,G__46787,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__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,G__46787,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__46815,G__46816){
return G__46815.call(null,G__46816,new cljs.core.Keyword(null,"nothing","nothing",-1022703296));
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,G__46787,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__46787,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__46817,G__46818){
return G__46817.call(null,G__46818);
});})(G__46787,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__29625__auto__ = (new cljs.core.Delay(((function (G__46787,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__46787,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__46787,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__46819,squadron){
var vec__46820 = p__46819;
var squadrons = cljs.core.nth.call(null,vec__46820,(0),null);
var cum_width = cljs.core.nth.call(null,vec__46820,(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__46787,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__46787,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__46787,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__29615__auto__){
var vec__46823 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (squadron_icon_scale,squadrons,G__46787,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__46787,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__29615__auto__));
var squadron = cljs.core.nth.call(null,vec__46823,(0),null);
var info = javelin.core.formula.call(null,((function (vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46826 = image;
var map__46826__$1 = ((((!((map__46826 == null)))?((((map__46826.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46826.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46826):map__46826);
var image_data = cljs.core.get.call(null,map__46826__$1,new cljs.core.Keyword(null,"image-data","image-data",-377483758));
var map__46827 = image_data;
var map__46827__$1 = ((((!((map__46827 == null)))?((((map__46827.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46827.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46827):map__46827);
var size = cljs.core.get.call(null,map__46827__$1,new cljs.core.Keyword(null,"size","size",1098693007));
var vec__46828 = size;
var w = cljs.core.nth.call(null,vec__46828,(0),null);
var h = cljs.core.nth.call(null,vec__46828,(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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46833,G__46835,G__46834){
return G__46833.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__46834),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46834),new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46835));
});})(info,vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46836){
return new cljs.core.Keyword(null,"src","src",-1651076051).cljs$core$IFn$_invoke$arity$1(G__46836);
});})(info,vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46838,G__46837){
return (new cljs.core.Keyword("weathergen.ui","x-offset","weathergen.ui/x-offset",666987585).cljs$core$IFn$_invoke$arity$1(G__46837) + (new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__46838) / (2)));
});})(info,vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46840,G__46839){
return (new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__46839) + (new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46839) - new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46840)));
});})(info,vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46841){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__46841);
});})(info,vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46842){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46842);
});})(info,vec__46823,squadron,squadron_icon_scale,squadrons,G__46787,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__46787,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__46787,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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__,G__46787,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__29625__auto__,G__46787,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__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,G__46787,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__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,G__46787,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__29627__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__46787,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__46845,G__46843,G__46844){
return G__46843.call(null,G__46844,new cljs.core.Keyword("weathergen.falcon.files.mission","image","weathergen.falcon.files.mission/image",-1683332210).cljs$core$IFn$_invoke$arity$1(G__46845));
});})(G__46787,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__46787,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__46846){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__46846);
});})(G__46787,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__46787,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__46847){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__46847);
});})(G__46787,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__46787,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__46848){
return new cljs.core.Keyword(null,"w","w",354169001).cljs$core$IFn$_invoke$arity$1(G__46848);
});})(G__46787,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__46787,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__46849){
return new cljs.core.Keyword(null,"h","h",1109658740).cljs$core$IFn$_invoke$arity$1(G__46849);
});})(G__46787,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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__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__29625__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__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__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,icon_scale,coords,x,y,label,camp_id,visible_QMARK_,highlighted_QMARK_,font_size,color,text_stroke_width,contrasting_color){
return (function (G__46850,G__46851){
var or__23148__auto__ = G__46850;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return G__46851;
}
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__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__29615__auto__){
var vec__46854 = 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__29615__auto__));
var airbase = cljs.core.nth.call(null,vec__46854,(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__46857,G__46858){
return G__46857.call(null,G__46858);
})).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__46865 = area;
var map__46865__$1 = ((((!((map__46865 == null)))?((((map__46865.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46865.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46865):map__46865);
var bounds = cljs.core.get.call(null,map__46865__$1,new cljs.core.Keyword(null,"bounds","bounds",1691609455));
var map__46866 = bounds;
var map__46866__$1 = ((((!((map__46866 == null)))?((((map__46866.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46866.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46866):map__46866);
var x = cljs.core.get.call(null,map__46866__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46866__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__46866__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__46866__$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__46867 = cell;
var map__46867__$1 = ((((!((map__46867 == null)))?((((map__46867.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46867.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46867):map__46867);
var x__$1 = cljs.core.get.call(null,map__46867__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__46867__$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__46877 = override;
var map__46877__$1 = ((((!((map__46877 == null)))?((((map__46877.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46877.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46877):map__46877);
var location = cljs.core.get.call(null,map__46877__$1,new cljs.core.Keyword(null,"location","location",1815599388));
var radius = cljs.core.get.call(null,map__46877__$1,new cljs.core.Keyword(null,"radius","radius",-2073122258));
var map__46878 = location;
var map__46878__$1 = ((((!((map__46878 == null)))?((((map__46878.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46878.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46878):map__46878);
var x = cljs.core.get.call(null,map__46878__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46878__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var cx = x;
var cy = y;
var map__46879 = cell;
var map__46879__$1 = ((((!((map__46879 == null)))?((((map__46879.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46879.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46879):map__46879);
var x__$1 = cljs.core.get.call(null,map__46879__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y__$1 = cljs.core.get.call(null,map__46879__$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__29625__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__46929 = mission__$1;
var map__46929__$1 = ((((!((map__46929 == null)))?((((map__46929.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46929.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46929):map__46929);
var campaign_info = cljs.core.get.call(null,map__46929__$1,new cljs.core.Keyword(null,"campaign-info","campaign-info",1158908966));
var map__46930 = campaign_info;
var map__46930__$1 = ((((!((map__46930 == null)))?((((map__46930.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46930.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46930):map__46930);
var bx = cljs.core.get.call(null,map__46930__$1,new cljs.core.Keyword(null,"bullseye-x","bullseye-x",-1698783852));
var by = cljs.core.get.call(null,map__46930__$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__46933){
return new cljs.core.Keyword(null,"x","x",2099068185).cljs$core$IFn$_invoke$arity$1(G__46933);
});})(stroke_width,bw))
).call(null,bw);
var by = javelin.core.formula.call(null,((function (stroke_width,bw,bx){
return (function (G__46934){
return new cljs.core.Keyword(null,"y","y",-1757859776).cljs$core$IFn$_invoke$arity$1(G__46934);
});})(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__46935,G__46936,G__46937){
return G__46935.call(null,G__46936,G__46937);
});})(stroke_width,bw,bx,by))
).call(null,weathergen.ui.common.svg_translate,bx,by),(function (){var iter__24010__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__46938(s__46939){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__46939__$1 = s__46939;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46939__$1);
if(temp__5278__auto__){
var s__46939__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46939__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__46939__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__46941 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__46940 = (0);
while(true){
if((i__46940 < size__24009__auto__)){
var r = cljs.core._nth.call(null,c__24008__auto__,i__46940);
cljs.core.chunk_append.call(null,b__46941,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__46940,r,c__24008__auto__,size__24009__auto__,b__46941,s__46939__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__46950,G__46948,G__46949){
return G__46948.call(null,G__46949,G__46950);
});})(i__46940,r,c__24008__auto__,size__24009__auto__,b__46941,s__46939__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)));

var G__46975 = (i__46940 + (1));
i__46940 = G__46975;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46941),weathergen$ui$bullseye_overlay_$_iter__46938.call(null,cljs.core.chunk_rest.call(null,s__46939__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46941),null);
}
} else {
var r = cljs.core.first.call(null,s__46939__$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__46939__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__46953,G__46951,G__46952){
return G__46951.call(null,G__46952,G__46953);
});})(r,s__46939__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,r,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__46938.call(null,cljs.core.rest.call(null,s__46939__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__24010__auto__.call(null,cljs.core.range.call(null,(30),(200),(30)));
})(),(function (){var iter__24010__auto__ = ((function (stroke_width,bw,bx,by){
return (function weathergen$ui$bullseye_overlay_$_iter__46954(s__46955){
return (new cljs.core.LazySeq(null,((function (stroke_width,bw,bx,by){
return (function (){
var s__46955__$1 = s__46955;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__46955__$1);
if(temp__5278__auto__){
var s__46955__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__46955__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__46955__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__46957 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__46956 = (0);
while(true){
if((i__46956 < size__24009__auto__)){
var theta = cljs.core._nth.call(null,c__24008__auto__,i__46956);
cljs.core.chunk_append.call(null,b__46957,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__46956,theta,c__24008__auto__,size__24009__auto__,b__46957,s__46955__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__46966,G__46967){
return G__46966.call(null,G__46967,(-200));
});})(i__46956,theta,c__24008__auto__,size__24009__auto__,b__46957,s__46955__$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__46956,theta,c__24008__auto__,size__24009__auto__,b__46957,s__46955__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__46968,G__46969){
return G__46968.call(null,G__46969,(200));
});})(i__46956,theta,c__24008__auto__,size__24009__auto__,b__46957,s__46955__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)));

var G__46976 = (i__46956 + (1));
i__46956 = G__46976;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46957),weathergen$ui$bullseye_overlay_$_iter__46954.call(null,cljs.core.chunk_rest.call(null,s__46955__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__46957),null);
}
} else {
var theta = cljs.core.first.call(null,s__46955__$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__46955__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__46970,G__46971){
return G__46970.call(null,G__46971,(-200));
});})(theta,s__46955__$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__46955__$2,temp__5278__auto__,stroke_width,bw,bx,by){
return (function (G__46972,G__46973){
return G__46972.call(null,G__46973,(200));
});})(theta,s__46955__$2,temp__5278__auto__,stroke_width,bw,bx,by))
).call(null,weathergen.coordinates.nm__GT_weather,mission)),weathergen$ui$bullseye_overlay_$_iter__46954.call(null,cljs.core.rest.call(null,s__46955__$2)));
}
} else {
return null;
}
break;
}
});})(stroke_width,bw,bx,by))
,null,null));
});})(stroke_width,bw,bx,by))
;
return iter__24010__auto__.call(null,cljs.core.range.call(null,(0),(180),(30)));
})());
}),null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__){
return (function (){
return null;
});})(con__29625__auto__))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__){
return (function (G__46974){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__46974);
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__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__46977,zoom,p__46978){
var vec__46984 = p__46977;
var nx = cljs.core.nth.call(null,vec__46984,(0),null);
var ny = cljs.core.nth.call(null,vec__46984,(1),null);
var map__46987 = p__46978;
var map__46987__$1 = ((((!((map__46987 == null)))?((((map__46987.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__46987.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__46987):map__46987);
var x = cljs.core.get.call(null,map__46987__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__46987__$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__46989){
var vec__46999 = p__46989;
var dx = cljs.core.nth.call(null,vec__46999,(0),null);
var dy = cljs.core.nth.call(null,vec__46999,(1),null);
var zoom = cljs.core.deref.call(null,weathergen.ui.map_zoom);
var vec__47002 = 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__47002,(0),null);
var ny = cljs.core.nth.call(null,vec__47002,(1),null);
var vec__47005 = cljs.core.deref.call(null,weathergen.ui.map_size);
var width = cljs.core.nth.call(null,vec__47005,(0),null);
var height = cljs.core.nth.call(null,vec__47005,(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__47008,amount){
var vec__47017 = p__47008;
var cx = cljs.core.nth.call(null,vec__47017,(0),null);
var cy = cljs.core.nth.call(null,vec__47017,(1),null);
var vec__47020 = 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__47020,(0),null);
var ny = cljs.core.nth.call(null,vec__47020,(1),null);
var map__47023 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__47023__$1 = ((((!((map__47023 == null)))?((((map__47023.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47023.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47023):map__47023);
var px0 = cljs.core.get.call(null,map__47023__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__47023__$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__47020,nx,ny,map__47023,map__47023__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__47017,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__47020,nx,ny,map__47023,map__47023__$1,px0,py0,z_SINGLEQUOTE_,dz,px1,py1,px,py,vec__47017,cx,cy))
);
});
/**
 * @param {...*} var_args
 */
weathergen.ui.grid = (function() { 
var weathergen$ui$grid__delegate = function (args__29571__auto__){
var vec__47132 = hoplon.core.parse_args.call(null,args__29571__auto__);
var map__47135 = cljs.core.nth.call(null,vec__47132,(0),null);
var map__47135__$1 = ((((!((map__47135 == null)))?((((map__47135.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47135.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47135):map__47135);
var attrs = map__47135__$1;
var display_params = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"display-params","display-params",573405707));
var selected_cell = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"selected-cell","selected-cell",1638390443));
var weather_data = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"weather-data","weather-data",-664219401));
var wind_stability_areas = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204));
var weather_overrides = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"weather-overrides","weather-overrides",-837381710));
var pressure_unit = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"pressure-unit","pressure-unit",1615584243));
var computing = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"computing","computing",-1002386157));
var nx = cljs.core.get.call(null,map__47135__$1,new cljs.core.Keyword(null,"nx","nx",-1996436366));
var ny = cljs.core.get.call(null,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__47025_SHARP_){
var or__23148__auto__ = p1__47025_SHARP_;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return h;
}
});})(drag_handler,drag_start,vec__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
);
});})(drag_handler,drag_start,vec__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47137 = cljs.core.deref.call(null,drag_start);
var sx = cljs.core.nth.call(null,vec__47137,(0),null);
var sy = cljs.core.nth.call(null,vec__47137,(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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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___47237 = cljs.core.deref.call(null,drag_handler);
if(cljs.core.truth_(temp__5278__auto___47237)){
var h_47238 = temp__5278__auto___47237;
var x_47239 = (e["offsetX"]);
var y_47240 = (e["offsetY"]);
var vec__47143_47241 = cljs.core.deref.call(null,drag_start);
var sx_47242 = cljs.core.nth.call(null,vec__47143_47241,(0),null);
var sy_47243 = cljs.core.nth.call(null,vec__47143_47241,(1),null);
var dx_47244 = (x_47239 - sx_47242);
var dy_47245 = (y_47240 - sy_47243);
h_47238.call(null,weathergen.ui.pixels__GT_weather.call(null,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [dx_47244,dy_47245], 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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47146){
return cljs.core.not.call(null,(new cljs.core.Keyword(null,"display","display",242065432).cljs$core$IFn$_invoke$arity$1(G__47146) == null));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47147){
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__47147)], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,vec__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47148,G__47149){
return G__47148.call(null,new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__47149),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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47152,G__47151){
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__47150 = G__47151;
var G__47150__$1 = (cljs.core.truth_((G__47150 == null))?null:new cljs.core.Keyword(null,"overlay","overlay",-139131598).cljs$core$IFn$_invoke$arity$1(G__47150));
if(cljs.core.truth_((G__47150__$1 == null))){
return null;
} else {
return G__47152.call(null,G__47150__$1);
}
})())].join('')], null);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47153){
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__47153));
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,vec__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47154){
return new cljs.core.Keyword(null,"coordinates","coordinates",-1225332668).cljs$core$IFn$_invoke$arity$1(G__47154);
});})(drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
).call(null,selected_cell);
var vec__47161 = 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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__47164){
var vec__47165 = p__47164;
var x = cljs.core.nth.call(null,vec__47165,(0),null);
var y = cljs.core.nth.call(null,vec__47165,(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__47132,map__47135,map__47135__$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__47161,(0),null);
var y = cljs.core.nth.call(null,vec__47161,(1),null);
var con__29625__auto__ = (new cljs.core.Delay(((function (vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$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__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$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__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$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__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__,vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (){
return null;
});})(con__29625__auto__,vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$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__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$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__23136__auto__ = x__$1;
if(cljs.core.truth_(and__23136__auto__)){
return y__$1;
} else {
return and__23136__auto__;
}
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,vec__47161,x,y,coords,drag_handler,drag_start,register_drag_handler,doc_move,doc_up,_,___$1,brightness_layer,primary_layer,wind_overlay,text_overlay,vec__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__23148__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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (area){
var and__23136__auto__ = weathergen.ui.within_area_QMARK_.call(null,area,hover_cell);
if(cljs.core.truth_(and__23136__auto__)){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(area);
} else {
return and__23136__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__47132,map__47135,map__47135__$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__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.some.call(null,((function (or__23148__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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (override){
var and__23136__auto__ = weathergen.ui.within_override_QMARK_.call(null,override,hover_cell);
if(cljs.core.truth_(and__23136__auto__)){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(override);
} else {
return and__23136__auto__;
}
});})(or__23148__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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p1__47026_SHARP_){
return (p1__47026_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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (map_viewbox){
var map__47168 = map_viewbox;
var map__47168__$1 = ((((!((map__47168 == null)))?((((map__47168.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47168.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47168):map__47168);
var x = cljs.core.get.call(null,map__47168__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47168__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__47168__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__47168__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47170,G__47171){
return G__47170.call(null,G__47171);
});})(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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47172,G__47173){
return G__47172.call(null,G__47173);
});})(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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47174 = weathergen.ui.mouse_weather_coords.call(null,e);
var x = cljs.core.nth.call(null,vec__47174,(0),null);
var y = cljs.core.nth.call(null,vec__47174,(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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47177 = cljs.core.deref.call(null,weathergen.ui.map_pan);
var map__47177__$1 = ((((!((map__47177 == null)))?((((map__47177.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47177.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47177):map__47177);
var px0 = cljs.core.get.call(null,map__47177__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var py0 = cljs.core.get.call(null,map__47177__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
return register_drag_handler.call(null,((function (map__47177,map__47177__$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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (p__47179,final_QMARK_){
var vec__47180 = p__47179;
var dx = cljs.core.nth.call(null,vec__47180,(0),null);
var dy = cljs.core.nth.call(null,vec__47180,(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__47177,map__47177__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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,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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny){
return (function (G__47184,G__47183){
if(cljs.core.not.call(null,G__47183)){
return "images/kto.jpg";
} else {
return G__47184.call(null,G__47183,new cljs.core.Keyword(null,"map-image","map-image",-5560498).cljs$core$IFn$_invoke$arity$1(G__47183));
}
});})(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__47132,map__47135,map__47135__$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);
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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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___47246 = "Initial create";
var ignore__15522__auto___47247 = console.time(timer_name__15521__auto___47246);
var result__15523__auto___47248 = (function (){
var frag_47249 = document.createDocumentFragment();
var seq__47185_47250 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__47190_47251 = null;
var count__47191_47252 = (0);
var i__47192_47253 = (0);
while(true){
if((i__47192_47253 < count__47191_47252)){
var x_47254 = cljs.core._nth.call(null,chunk__47190_47251,i__47192_47253);
var seq__47193_47255 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__47194_47256 = null;
var count__47195_47257 = (0);
var i__47196_47258 = (0);
while(true){
if((i__47196_47258 < count__47195_47257)){
var y_47259 = cljs.core._nth.call(null,chunk__47194_47256,i__47196_47258);
var r_47260 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__47197_47261 = r_47260;
G__47197_47261.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47254),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47259)].join(''));

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

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

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

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

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

G__47197_47261.onclick = ((function (seq__47193_47255,chunk__47194_47256,count__47195_47257,i__47196_47258,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47197_47261,r_47260,y_47259,x_47254,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$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_47254,y_47259], null)], null));
});})(seq__47193_47255,chunk__47194_47256,count__47195_47257,i__47196_47258,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47197_47261,r_47260,y_47259,x_47254,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_47249,r_47260);

var G__47262 = seq__47193_47255;
var G__47263 = chunk__47194_47256;
var G__47264 = count__47195_47257;
var G__47265 = (i__47196_47258 + (1));
seq__47193_47255 = G__47262;
chunk__47194_47256 = G__47263;
count__47195_47257 = G__47264;
i__47196_47258 = G__47265;
continue;
} else {
var temp__5278__auto___47266 = cljs.core.seq.call(null,seq__47193_47255);
if(temp__5278__auto___47266){
var seq__47193_47267__$1 = temp__5278__auto___47266;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47193_47267__$1)){
var c__24059__auto___47268 = cljs.core.chunk_first.call(null,seq__47193_47267__$1);
var G__47269 = cljs.core.chunk_rest.call(null,seq__47193_47267__$1);
var G__47270 = c__24059__auto___47268;
var G__47271 = cljs.core.count.call(null,c__24059__auto___47268);
var G__47272 = (0);
seq__47193_47255 = G__47269;
chunk__47194_47256 = G__47270;
count__47195_47257 = G__47271;
i__47196_47258 = G__47272;
continue;
} else {
var y_47273 = cljs.core.first.call(null,seq__47193_47267__$1);
var r_47274 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__47198_47275 = r_47274;
G__47198_47275.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47254),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47273)].join(''));

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

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

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

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

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

G__47198_47275.onclick = ((function (seq__47193_47255,chunk__47194_47256,count__47195_47257,i__47196_47258,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47198_47275,r_47274,y_47273,seq__47193_47267__$1,temp__5278__auto___47266,x_47254,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$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_47254,y_47273], null)], null));
});})(seq__47193_47255,chunk__47194_47256,count__47195_47257,i__47196_47258,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47198_47275,r_47274,y_47273,seq__47193_47267__$1,temp__5278__auto___47266,x_47254,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_47249,r_47274);

var G__47276 = cljs.core.next.call(null,seq__47193_47267__$1);
var G__47277 = null;
var G__47278 = (0);
var G__47279 = (0);
seq__47193_47255 = G__47276;
chunk__47194_47256 = G__47277;
count__47195_47257 = G__47278;
i__47196_47258 = G__47279;
continue;
}
} else {
}
}
break;
}

var G__47280 = seq__47185_47250;
var G__47281 = chunk__47190_47251;
var G__47282 = count__47191_47252;
var G__47283 = (i__47192_47253 + (1));
seq__47185_47250 = G__47280;
chunk__47190_47251 = G__47281;
count__47191_47252 = G__47282;
i__47192_47253 = G__47283;
continue;
} else {
var temp__5278__auto___47284 = cljs.core.seq.call(null,seq__47185_47250);
if(temp__5278__auto___47284){
var seq__47185_47285__$1 = temp__5278__auto___47284;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47185_47285__$1)){
var c__24059__auto___47286 = cljs.core.chunk_first.call(null,seq__47185_47285__$1);
var G__47287 = cljs.core.chunk_rest.call(null,seq__47185_47285__$1);
var G__47288 = c__24059__auto___47286;
var G__47289 = cljs.core.count.call(null,c__24059__auto___47286);
var G__47290 = (0);
seq__47185_47250 = G__47287;
chunk__47190_47251 = G__47288;
count__47191_47252 = G__47289;
i__47192_47253 = G__47290;
continue;
} else {
var x_47291 = cljs.core.first.call(null,seq__47185_47285__$1);
var seq__47186_47292 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__47187_47293 = null;
var count__47188_47294 = (0);
var i__47189_47295 = (0);
while(true){
if((i__47189_47295 < count__47188_47294)){
var y_47296 = cljs.core._nth.call(null,chunk__47187_47293,i__47189_47295);
var r_47297 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__47199_47298 = r_47297;
G__47199_47298.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47291),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47296)].join(''));

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

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

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

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

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

G__47199_47298.onclick = ((function (seq__47186_47292,chunk__47187_47293,count__47188_47294,i__47189_47295,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47199_47298,r_47297,y_47296,x_47291,seq__47185_47285__$1,temp__5278__auto___47284,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$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_47291,y_47296], null)], null));
});})(seq__47186_47292,chunk__47187_47293,count__47188_47294,i__47189_47295,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47199_47298,r_47297,y_47296,x_47291,seq__47185_47285__$1,temp__5278__auto___47284,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_47249,r_47297);

var G__47299 = seq__47186_47292;
var G__47300 = chunk__47187_47293;
var G__47301 = count__47188_47294;
var G__47302 = (i__47189_47295 + (1));
seq__47186_47292 = G__47299;
chunk__47187_47293 = G__47300;
count__47188_47294 = G__47301;
i__47189_47295 = G__47302;
continue;
} else {
var temp__5278__auto___47303__$1 = cljs.core.seq.call(null,seq__47186_47292);
if(temp__5278__auto___47303__$1){
var seq__47186_47304__$1 = temp__5278__auto___47303__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47186_47304__$1)){
var c__24059__auto___47305 = cljs.core.chunk_first.call(null,seq__47186_47304__$1);
var G__47306 = cljs.core.chunk_rest.call(null,seq__47186_47304__$1);
var G__47307 = c__24059__auto___47305;
var G__47308 = cljs.core.count.call(null,c__24059__auto___47305);
var G__47309 = (0);
seq__47186_47292 = G__47306;
chunk__47187_47293 = G__47307;
count__47188_47294 = G__47308;
i__47189_47295 = G__47309;
continue;
} else {
var y_47310 = cljs.core.first.call(null,seq__47186_47304__$1);
var r_47311 = document.createElementNS("http://www.w3.org/2000/svg","rect");
var G__47200_47312 = r_47311;
G__47200_47312.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-primary-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47291),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47310)].join(''));

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

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

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

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

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

G__47200_47312.onclick = ((function (seq__47186_47292,chunk__47187_47293,count__47188_47294,i__47189_47295,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47200_47312,r_47311,y_47310,seq__47186_47304__$1,temp__5278__auto___47303__$1,x_47291,seq__47185_47285__$1,temp__5278__auto___47284,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$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_47291,y_47310], null)], null));
});})(seq__47186_47292,chunk__47187_47293,count__47188_47294,i__47189_47295,seq__47185_47250,chunk__47190_47251,count__47191_47252,i__47192_47253,G__47200_47312,r_47311,y_47310,seq__47186_47304__$1,temp__5278__auto___47303__$1,x_47291,seq__47185_47285__$1,temp__5278__auto___47284,frag_47249,timer_name__15521__auto___47246,ignore__15522__auto___47247,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__47132,map__47135,map__47135__$1,attrs,display_params,selected_cell,weather_data,wind_stability_areas,weather_overrides,pressure_unit,computing,nx,ny))
;


goog.dom.appendChild(frag_47249,r_47311);

var G__47313 = cljs.core.next.call(null,seq__47186_47304__$1);
var G__47314 = null;
var G__47315 = (0);
var G__47316 = (0);
seq__47186_47292 = G__47313;
chunk__47187_47293 = G__47314;
count__47188_47294 = G__47315;
i__47189_47295 = G__47316;
continue;
}
} else {
}
}
break;
}

var G__47317 = cljs.core.next.call(null,seq__47185_47285__$1);
var G__47318 = null;
var G__47319 = (0);
var G__47320 = (0);
seq__47185_47250 = G__47317;
chunk__47190_47251 = G__47318;
count__47191_47252 = G__47319;
i__47192_47253 = G__47320;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(primary_layer,frag_47249);

var frag_47321 = document.createDocumentFragment();
var seq__47201_47322 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__47206_47323 = null;
var count__47207_47324 = (0);
var i__47208_47325 = (0);
while(true){
if((i__47208_47325 < count__47207_47324)){
var x_47326 = cljs.core._nth.call(null,chunk__47206_47323,i__47208_47325);
var seq__47209_47327 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__47210_47328 = null;
var count__47211_47329 = (0);
var i__47212_47330 = (0);
while(true){
if((i__47212_47330 < count__47211_47329)){
var y_47331 = cljs.core._nth.call(null,chunk__47210_47328,i__47212_47330);
var g_47332 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_47333 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__47213_47334 = g_47332;
G__47213_47334.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_47326 + 0.5),(y_47331 + 0.5)));


var G__47214_47335 = r_47333;
G__47214_47335.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47326),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47331)].join(''));


goog.dom.appendChild(g_47332,r_47333);

goog.dom.appendChild(frag_47321,g_47332);

var G__47336 = seq__47209_47327;
var G__47337 = chunk__47210_47328;
var G__47338 = count__47211_47329;
var G__47339 = (i__47212_47330 + (1));
seq__47209_47327 = G__47336;
chunk__47210_47328 = G__47337;
count__47211_47329 = G__47338;
i__47212_47330 = G__47339;
continue;
} else {
var temp__5278__auto___47340 = cljs.core.seq.call(null,seq__47209_47327);
if(temp__5278__auto___47340){
var seq__47209_47341__$1 = temp__5278__auto___47340;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47209_47341__$1)){
var c__24059__auto___47342 = cljs.core.chunk_first.call(null,seq__47209_47341__$1);
var G__47343 = cljs.core.chunk_rest.call(null,seq__47209_47341__$1);
var G__47344 = c__24059__auto___47342;
var G__47345 = cljs.core.count.call(null,c__24059__auto___47342);
var G__47346 = (0);
seq__47209_47327 = G__47343;
chunk__47210_47328 = G__47344;
count__47211_47329 = G__47345;
i__47212_47330 = G__47346;
continue;
} else {
var y_47347 = cljs.core.first.call(null,seq__47209_47341__$1);
var g_47348 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_47349 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__47215_47350 = g_47348;
G__47215_47350.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_47326 + 0.5),(y_47347 + 0.5)));


var G__47216_47351 = r_47349;
G__47216_47351.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47326),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47347)].join(''));


goog.dom.appendChild(g_47348,r_47349);

goog.dom.appendChild(frag_47321,g_47348);

var G__47352 = cljs.core.next.call(null,seq__47209_47341__$1);
var G__47353 = null;
var G__47354 = (0);
var G__47355 = (0);
seq__47209_47327 = G__47352;
chunk__47210_47328 = G__47353;
count__47211_47329 = G__47354;
i__47212_47330 = G__47355;
continue;
}
} else {
}
}
break;
}

var G__47356 = seq__47201_47322;
var G__47357 = chunk__47206_47323;
var G__47358 = count__47207_47324;
var G__47359 = (i__47208_47325 + (1));
seq__47201_47322 = G__47356;
chunk__47206_47323 = G__47357;
count__47207_47324 = G__47358;
i__47208_47325 = G__47359;
continue;
} else {
var temp__5278__auto___47360 = cljs.core.seq.call(null,seq__47201_47322);
if(temp__5278__auto___47360){
var seq__47201_47361__$1 = temp__5278__auto___47360;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47201_47361__$1)){
var c__24059__auto___47362 = cljs.core.chunk_first.call(null,seq__47201_47361__$1);
var G__47363 = cljs.core.chunk_rest.call(null,seq__47201_47361__$1);
var G__47364 = c__24059__auto___47362;
var G__47365 = cljs.core.count.call(null,c__24059__auto___47362);
var G__47366 = (0);
seq__47201_47322 = G__47363;
chunk__47206_47323 = G__47364;
count__47207_47324 = G__47365;
i__47208_47325 = G__47366;
continue;
} else {
var x_47367 = cljs.core.first.call(null,seq__47201_47361__$1);
var seq__47202_47368 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__47203_47369 = null;
var count__47204_47370 = (0);
var i__47205_47371 = (0);
while(true){
if((i__47205_47371 < count__47204_47370)){
var y_47372 = cljs.core._nth.call(null,chunk__47203_47369,i__47205_47371);
var g_47373 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_47374 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__47217_47375 = g_47373;
G__47217_47375.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_47367 + 0.5),(y_47372 + 0.5)));


var G__47218_47376 = r_47374;
G__47218_47376.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47367),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47372)].join(''));


goog.dom.appendChild(g_47373,r_47374);

goog.dom.appendChild(frag_47321,g_47373);

var G__47377 = seq__47202_47368;
var G__47378 = chunk__47203_47369;
var G__47379 = count__47204_47370;
var G__47380 = (i__47205_47371 + (1));
seq__47202_47368 = G__47377;
chunk__47203_47369 = G__47378;
count__47204_47370 = G__47379;
i__47205_47371 = G__47380;
continue;
} else {
var temp__5278__auto___47381__$1 = cljs.core.seq.call(null,seq__47202_47368);
if(temp__5278__auto___47381__$1){
var seq__47202_47382__$1 = temp__5278__auto___47381__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47202_47382__$1)){
var c__24059__auto___47383 = cljs.core.chunk_first.call(null,seq__47202_47382__$1);
var G__47384 = cljs.core.chunk_rest.call(null,seq__47202_47382__$1);
var G__47385 = c__24059__auto___47383;
var G__47386 = cljs.core.count.call(null,c__24059__auto___47383);
var G__47387 = (0);
seq__47202_47368 = G__47384;
chunk__47203_47369 = G__47385;
count__47204_47370 = G__47386;
i__47205_47371 = G__47387;
continue;
} else {
var y_47388 = cljs.core.first.call(null,seq__47202_47382__$1);
var g_47389 = document.createElementNS("http://www.w3.org/2000/svg","g");
var r_47390 = document.createElementNS("http://www.w3.org/2000/svg","use");
var G__47219_47391 = g_47389;
G__47219_47391.setAttribute("transform",weathergen.ui.common.svg_translate.call(null,(x_47367 + 0.5),(y_47388 + 0.5)));


var G__47220_47392 = r_47390;
G__47220_47392.setAttribute("id",[cljs.core.str.cljs$core$IFn$_invoke$arity$1("grid-wind-cell-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(x_47367),cljs.core.str.cljs$core$IFn$_invoke$arity$1("-"),cljs.core.str.cljs$core$IFn$_invoke$arity$1(y_47388)].join(''));


goog.dom.appendChild(g_47389,r_47390);

goog.dom.appendChild(frag_47321,g_47389);

var G__47393 = cljs.core.next.call(null,seq__47202_47382__$1);
var G__47394 = null;
var G__47395 = (0);
var G__47396 = (0);
seq__47202_47368 = G__47393;
chunk__47203_47369 = G__47394;
count__47204_47370 = G__47395;
i__47205_47371 = G__47396;
continue;
}
} else {
}
}
break;
}

var G__47397 = cljs.core.next.call(null,seq__47201_47361__$1);
var G__47398 = null;
var G__47399 = (0);
var G__47400 = (0);
seq__47201_47322 = G__47397;
chunk__47206_47323 = G__47398;
count__47207_47324 = G__47399;
i__47208_47325 = G__47400;
continue;
}
} else {
}
}
break;
}

goog.dom.appendChild(wind_overlay,frag_47321);

var frag = document.createDocumentFragment();
var scale = 0.03;
var seq__47221_47401 = cljs.core.seq.call(null,cljs.core.range.call(null,nx));
var chunk__47226_47402 = null;
var count__47227_47403 = (0);
var i__47228_47404 = (0);
while(true){
if((i__47228_47404 < count__47227_47403)){
var x_47405 = cljs.core._nth.call(null,chunk__47226_47402,i__47228_47404);
var seq__47229_47406 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__47230_47407 = null;
var count__47231_47408 = (0);
var i__47232_47409 = (0);
while(true){
if((i__47232_47409 < count__47231_47408)){
var y_47410 = cljs.core._nth.call(null,chunk__47230_47407,i__47232_47409);
var t_47411 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__47233_47412 = t_47411;
G__47233_47412.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_47405 + 0.5) / scale),((y_47410 + 0.9) / scale)))].join(''));

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

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


goog.dom.appendChild(frag,t_47411);

var G__47413 = seq__47229_47406;
var G__47414 = chunk__47230_47407;
var G__47415 = count__47231_47408;
var G__47416 = (i__47232_47409 + (1));
seq__47229_47406 = G__47413;
chunk__47230_47407 = G__47414;
count__47231_47408 = G__47415;
i__47232_47409 = G__47416;
continue;
} else {
var temp__5278__auto___47417 = cljs.core.seq.call(null,seq__47229_47406);
if(temp__5278__auto___47417){
var seq__47229_47418__$1 = temp__5278__auto___47417;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47229_47418__$1)){
var c__24059__auto___47419 = cljs.core.chunk_first.call(null,seq__47229_47418__$1);
var G__47420 = cljs.core.chunk_rest.call(null,seq__47229_47418__$1);
var G__47421 = c__24059__auto___47419;
var G__47422 = cljs.core.count.call(null,c__24059__auto___47419);
var G__47423 = (0);
seq__47229_47406 = G__47420;
chunk__47230_47407 = G__47421;
count__47231_47408 = G__47422;
i__47232_47409 = G__47423;
continue;
} else {
var y_47424 = cljs.core.first.call(null,seq__47229_47418__$1);
var t_47425 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__47234_47426 = t_47425;
G__47234_47426.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_47405 + 0.5) / scale),((y_47424 + 0.9) / scale)))].join(''));

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

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


goog.dom.appendChild(frag,t_47425);

var G__47427 = cljs.core.next.call(null,seq__47229_47418__$1);
var G__47428 = null;
var G__47429 = (0);
var G__47430 = (0);
seq__47229_47406 = G__47427;
chunk__47230_47407 = G__47428;
count__47231_47408 = G__47429;
i__47232_47409 = G__47430;
continue;
}
} else {
}
}
break;
}

var G__47431 = seq__47221_47401;
var G__47432 = chunk__47226_47402;
var G__47433 = count__47227_47403;
var G__47434 = (i__47228_47404 + (1));
seq__47221_47401 = G__47431;
chunk__47226_47402 = G__47432;
count__47227_47403 = G__47433;
i__47228_47404 = G__47434;
continue;
} else {
var temp__5278__auto___47435 = cljs.core.seq.call(null,seq__47221_47401);
if(temp__5278__auto___47435){
var seq__47221_47436__$1 = temp__5278__auto___47435;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47221_47436__$1)){
var c__24059__auto___47437 = cljs.core.chunk_first.call(null,seq__47221_47436__$1);
var G__47438 = cljs.core.chunk_rest.call(null,seq__47221_47436__$1);
var G__47439 = c__24059__auto___47437;
var G__47440 = cljs.core.count.call(null,c__24059__auto___47437);
var G__47441 = (0);
seq__47221_47401 = G__47438;
chunk__47226_47402 = G__47439;
count__47227_47403 = G__47440;
i__47228_47404 = G__47441;
continue;
} else {
var x_47442 = cljs.core.first.call(null,seq__47221_47436__$1);
var seq__47222_47443 = cljs.core.seq.call(null,cljs.core.range.call(null,ny));
var chunk__47223_47444 = null;
var count__47224_47445 = (0);
var i__47225_47446 = (0);
while(true){
if((i__47225_47446 < count__47224_47445)){
var y_47447 = cljs.core._nth.call(null,chunk__47223_47444,i__47225_47446);
var t_47448 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__47235_47449 = t_47448;
G__47235_47449.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_47442 + 0.5) / scale),((y_47447 + 0.9) / scale)))].join(''));

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

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


goog.dom.appendChild(frag,t_47448);

var G__47450 = seq__47222_47443;
var G__47451 = chunk__47223_47444;
var G__47452 = count__47224_47445;
var G__47453 = (i__47225_47446 + (1));
seq__47222_47443 = G__47450;
chunk__47223_47444 = G__47451;
count__47224_47445 = G__47452;
i__47225_47446 = G__47453;
continue;
} else {
var temp__5278__auto___47454__$1 = cljs.core.seq.call(null,seq__47222_47443);
if(temp__5278__auto___47454__$1){
var seq__47222_47455__$1 = temp__5278__auto___47454__$1;
if(cljs.core.chunked_seq_QMARK_.call(null,seq__47222_47455__$1)){
var c__24059__auto___47456 = cljs.core.chunk_first.call(null,seq__47222_47455__$1);
var G__47457 = cljs.core.chunk_rest.call(null,seq__47222_47455__$1);
var G__47458 = c__24059__auto___47456;
var G__47459 = cljs.core.count.call(null,c__24059__auto___47456);
var G__47460 = (0);
seq__47222_47443 = G__47457;
chunk__47223_47444 = G__47458;
count__47224_47445 = G__47459;
i__47225_47446 = G__47460;
continue;
} else {
var y_47461 = cljs.core.first.call(null,seq__47222_47455__$1);
var t_47462 = document.createElementNS("http://www.w3.org/2000/svg","text");
var G__47236_47463 = t_47462;
G__47236_47463.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_47442 + 0.5) / scale),((y_47461 + 0.9) / scale)))].join(''));

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

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


goog.dom.appendChild(frag,t_47462);

var G__47464 = cljs.core.next.call(null,seq__47222_47455__$1);
var G__47465 = null;
var G__47466 = (0);
var G__47467 = (0);
seq__47222_47443 = G__47464;
chunk__47223_47444 = G__47465;
count__47224_47445 = G__47466;
i__47225_47446 = G__47467;
continue;
}
} else {
}
}
break;
}

var G__47468 = cljs.core.next.call(null,seq__47221_47436__$1);
var G__47469 = null;
var G__47470 = (0);
var G__47471 = (0);
seq__47221_47401 = G__47468;
chunk__47226_47402 = G__47469;
count__47227_47403 = G__47470;
i__47228_47404 = G__47471;
continue;
}
} else {
}
}
break;
}

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


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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__47132,map__47135,map__47135__$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__29571__auto__ = null;
if (arguments.length > 0) {
var G__47472__i = 0, G__47472__a = new Array(arguments.length -  0);
while (G__47472__i < G__47472__a.length) {G__47472__a[G__47472__i] = arguments[G__47472__i + 0]; ++G__47472__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__47472__a,0,null);
} 
return weathergen$ui$grid__delegate.call(this,args__29571__auto__);};
weathergen$ui$grid.cljs$lang$maxFixedArity = 0;
weathergen$ui$grid.cljs$lang$applyTo = (function (arglist__47473){
var args__29571__auto__ = cljs.core.seq(arglist__47473);
return weathergen$ui$grid__delegate(args__29571__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__23136__auto__ = parsed;
if(cljs.core.truth_(and__23136__auto__)){
return !((parsed < (0)));
} else {
return and__23136__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__23136__auto__ = parsed;
if(cljs.core.truth_(and__23136__auto__)){
return (parsed > (0));
} else {
return and__23136__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__23136__auto__ = parsed;
if(cljs.core.truth_(and__23136__auto__)){
return ((from <= parsed)) && ((parsed <= to));
} else {
return and__23136__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__29571__auto__){
var vec__47488 = hoplon.core.parse_args.call(null,args__29571__auto__);
var attrs = cljs.core.nth.call(null,vec__47488,(0),null);
var _ = cljs.core.nth.call(null,vec__47488,(1),null);
var map__47491 = attrs;
var map__47491__$1 = ((((!((map__47491 == null)))?((((map__47491.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47491.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47491):map__47491);
var align = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"align","align",1964212802));
var fmt = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"fmt","fmt",332300772));
var placeholder = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"placeholder","placeholder",-104873083));
var css = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"css","css",1135045163));
var width = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var update = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var conform = cljs.core.get.call(null,map__47491__$1,new cljs.core.Keyword(null,"conform","conform",1846236460));
var source = cljs.core.get.call(null,map__47491__$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__23148__auto__ = fmt;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.str;
}
})();
var value = javelin.core.formula.call(null,((function (interim,fmt__$1,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_))
).call(null,interim,source);
var parsed = conform.call(null,value);
var update__$1 = (function (){var or__23148__auto__ = update;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return ((function (or__23148__auto__,interim,fmt__$1,value,parsed,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (p1__47474_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.constantly.call(null,p1__47474_SHARP_));
});
;})(or__23148__auto__,interim,fmt__$1,value,parsed,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (G__47493){
return G__47493;
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__23148__auto__ = width;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (p1__47475_SHARP_){
cljs.core.reset_BANG_.call(null,interim,cljs.core.deref.call(null,p1__47475_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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_))
);
} else {
return null;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_))
);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__23148__auto__ = width;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (G__47494){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__47494);
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (){
return (function (){var G__47495 = i;
return G__47495;
})().focus();
});})(i,interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (G__47498,G__47497,G__47496){
var and__23136__auto__ = G__47496.call(null,G__47497);
if(cljs.core.truth_(and__23136__auto__)){
return G__47498;
} else {
return and__23136__auto__;
}
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,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__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_){
return (function (G__47499){
return new cljs.core.Keyword(null,"message","message",-406056002).cljs$core$IFn$_invoke$arity$1(G__47499);
});})(interim,fmt__$1,value,parsed,update__$1,state,focused_QMARK_,align__$1,valid_QMARK_,map__47491,map__47491__$1,align,fmt,placeholder,css,width,update,conform,source,attrs__$1,vec__47488,attrs,_))
).call(null,parsed)));
};
var weathergen$ui$validating_edit = function (var_args){
var args__29571__auto__ = null;
if (arguments.length > 0) {
var G__47500__i = 0, G__47500__a = new Array(arguments.length -  0);
while (G__47500__i < G__47500__a.length) {G__47500__a[G__47500__i] = arguments[G__47500__i + 0]; ++G__47500__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__47500__a,0,null);
} 
return weathergen$ui$validating_edit__delegate.call(this,args__29571__auto__);};
weathergen$ui$validating_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$validating_edit.cljs$lang$applyTo = (function (arglist__47501){
var args__29571__auto__ = cljs.core.seq(arglist__47501);
return weathergen$ui$validating_edit__delegate(args__29571__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__29571__auto__){
var vec__47510 = hoplon.core.parse_args.call(null,args__29571__auto__);
var map__47513 = cljs.core.nth.call(null,vec__47510,(0),null);
var map__47513__$1 = ((((!((map__47513 == null)))?((((map__47513.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47513.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47513):map__47513);
var attrs = map__47513__$1;
var source = cljs.core.get.call(null,map__47513__$1,new cljs.core.Keyword(null,"source","source",-433931539));
var update = cljs.core.get.call(null,map__47513__$1,new cljs.core.Keyword(null,"update","update",1045576396));
var _ = cljs.core.nth.call(null,vec__47510,(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__47510,map__47513,map__47513__$1,attrs,source,update,_){
return (function (val){
return javelin.core.formula.call(null,((function (vec__47510,map__47513,map__47513__$1,attrs,source,update,_){
return (function (val__$1){
var vec__47515 = cljs.core.re_matches.call(null,/(\d+)\/(\d\d):(\d\d)/,val__$1);
var all = cljs.core.nth.call(null,vec__47515,(0),null);
var dd = cljs.core.nth.call(null,vec__47515,(1),null);
var hh = cljs.core.nth.call(null,vec__47515,(2),null);
var mm = cljs.core.nth.call(null,vec__47515,(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__23136__auto__ = dd;
if(cljs.core.truth_(and__23136__auto__)){
var and__23136__auto____$1 = hh;
if(cljs.core.truth_(and__23136__auto____$1)){
var and__23136__auto____$2 = mm;
if(cljs.core.truth_(and__23136__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__23136__auto____$2;
}
} else {
return and__23136__auto____$1;
}
} else {
return and__23136__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__23136__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__23136__auto__)){
var and__23136__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__23136__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__23136__auto____$1;
}
} else {
return and__23136__auto__;
}
})();
return new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"valid?","valid?",-212412379),(function (){var and__23136__auto__ = valid_QMARK_;
if(cljs.core.truth_(and__23136__auto__)){
return cljs.core.not.call(null,over_max_QMARK_);
} else {
return and__23136__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__47510,map__47513,map__47513__$1,attrs,source,update,_))
).call(null,val);
});})(vec__47510,map__47513,map__47513__$1,attrs,source,update,_))
);
};
var weathergen$ui$time_edit = function (var_args){
var args__29571__auto__ = null;
if (arguments.length > 0) {
var G__47518__i = 0, G__47518__a = new Array(arguments.length -  0);
while (G__47518__i < G__47518__a.length) {G__47518__a[G__47518__i] = arguments[G__47518__i + 0]; ++G__47518__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__47518__a,0,null);
} 
return weathergen$ui$time_edit__delegate.call(this,args__29571__auto__);};
weathergen$ui$time_edit.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_edit.cljs$lang$applyTo = (function (arglist__47519){
var args__29571__auto__ = cljs.core.seq(arglist__47519);
return weathergen$ui$time_edit__delegate(args__29571__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 args47522 = [];
var len__24369__auto___47530 = arguments.length;
var i__24370__auto___47531 = (0);
while(true){
if((i__24370__auto___47531 < len__24369__auto___47530)){
args47522.push((arguments[i__24370__auto___47531]));

var G__47532 = (i__24370__auto___47531 + (1));
i__24370__auto___47531 = G__47532;
continue;
} else {
}
break;
}

var G__47524 = args47522.length;
switch (G__47524) {
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(args47522.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__47525 = opts;
var map__47525__$1 = ((((!((map__47525 == null)))?((((map__47525.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47525.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47525):map__47525);
var change_fn = cljs.core.get.call(null,map__47525__$1,new cljs.core.Keyword(null,"change-fn","change-fn",1566440825));
var input_attrs = cljs.core.get.call(null,map__47525__$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__47525,map__47525__$1,change_fn,input_attrs){
return (function (G__47529,G__47528,G__47527){
return G__47527.call(null,G__47528,G__47529);
});})(map__47525,map__47525__$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__47525,map__47525__$1,change_fn,input_attrs){
return (function (p1__47520_SHARP_){
return change_fn.call(null,Number(cljs.core.deref.call(null,p1__47520_SHARP_)));
});})(map__47525,map__47525__$1,change_fn,input_attrs))
:((function (map__47525,map__47525__$1,change_fn,input_attrs){
return (function (p1__47521_SHARP_){
return cljs.core.swap_BANG_.call(null,c,cljs.core.assoc_in,path,Number(cljs.core.deref.call(null,p1__47521_SHARP_)));
});})(map__47525,map__47525__$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__47534_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__47534_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__29571__auto__){
var vec__47541 = hoplon.core.parse_args.call(null,args__29571__auto__);
var attrs = cljs.core.nth.call(null,vec__47541,(0),null);
var _ = cljs.core.nth.call(null,vec__47541,(1),null);
var map__47544 = attrs;
var map__47544__$1 = ((((!((map__47544 == null)))?((((map__47544.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47544.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47544):map__47544);
var path = cljs.core.get.call(null,map__47544__$1,new cljs.core.Keyword(null,"path","path",-188191168));
var source = cljs.core.get.call(null,map__47544__$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__47544,map__47544__$1,path,source,vec__47541,attrs,_){
return (function (source__$1){
return cljs.core.get_in.call(null,source__$1,path);
});})(map__47544,map__47544__$1,path,source,vec__47541,attrs,_))
).call(null,source)),new cljs.core.Keyword(null,"update","update",1045576396),((function (map__47544,map__47544__$1,path,source,vec__47541,attrs,_){
return (function (p1__47535_SHARP_){
return cljs.core.swap_BANG_.call(null,source,cljs.core.assoc_in,path,p1__47535_SHARP_);
});})(map__47544,map__47544__$1,path,source,vec__47541,attrs,_))
));
};
var weathergen$ui$time_entry = function (var_args){
var args__29571__auto__ = null;
if (arguments.length > 0) {
var G__47546__i = 0, G__47546__a = new Array(arguments.length -  0);
while (G__47546__i < G__47546__a.length) {G__47546__a[G__47546__i] = arguments[G__47546__i + 0]; ++G__47546__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__47546__a,0,null);
} 
return weathergen$ui$time_entry__delegate.call(this,args__29571__auto__);};
weathergen$ui$time_entry.cljs$lang$maxFixedArity = 0;
weathergen$ui$time_entry.cljs$lang$applyTo = (function (arglist__47547){
var args__29571__auto__ = cljs.core.seq(arglist__47547);
return weathergen$ui$time_entry__delegate(args__29571__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__47550 = cljs.core.deref.call(null,weathergen.ui.map_viewbox);
var map__47550__$1 = ((((!((map__47550 == null)))?((((map__47550.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47550.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47550):map__47550);
var x = cljs.core.get.call(null,map__47550__$1,new cljs.core.Keyword(null,"x","x",2099068185));
var y = cljs.core.get.call(null,map__47550__$1,new cljs.core.Keyword(null,"y","y",-1757859776));
var width = cljs.core.get.call(null,map__47550__$1,new cljs.core.Keyword(null,"width","width",-384071477));
var height = cljs.core.get.call(null,map__47550__$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__47600__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__47600 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47601__i = 0, G__47601__a = new Array(arguments.length -  0);
while (G__47601__i < G__47601__a.length) {G__47601__a[G__47601__i] = arguments[G__47601__i + 0]; ++G__47601__i;}
  kids = new cljs.core.IndexedSeq(G__47601__a,0,null);
} 
return G__47600__delegate.call(this,kids);};
G__47600.cljs$lang$maxFixedArity = 0;
G__47600.cljs$lang$applyTo = (function (arglist__47602){
var kids = cljs.core.seq(arglist__47602);
return G__47600__delegate(kids);
});
G__47600.cljs$core$IFn$_invoke$arity$variadic = G__47600__delegate;
return G__47600;
})()
;
var field_help = ((function (field){
return (function() { 
var G__47603__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__47603 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47604__i = 0, G__47604__a = new Array(arguments.length -  0);
while (G__47604__i < G__47604__a.length) {G__47604__a[G__47604__i] = arguments[G__47604__i + 0]; ++G__47604__i;}
  kids = new cljs.core.IndexedSeq(G__47604__a,0,null);
} 
return G__47603__delegate.call(this,kids);};
G__47603.cljs$lang$maxFixedArity = 0;
G__47603.cljs$lang$applyTo = (function (arglist__47605){
var kids = cljs.core.seq(arglist__47605);
return G__47603__delegate(kids);
});
G__47603.cljs$core$IFn$_invoke$arity$variadic = G__47603__delegate;
return G__47603;
})()
;})(field))
;
var field_input = ((function (field,field_help){
return (function() { 
var G__47606__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__47606 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47607__i = 0, G__47607__a = new Array(arguments.length -  0);
while (G__47607__i < G__47607__a.length) {G__47607__a[G__47607__i] = arguments[G__47607__i + 0]; ++G__47607__i;}
  kids = new cljs.core.IndexedSeq(G__47607__a,0,null);
} 
return G__47606__delegate.call(this,kids);};
G__47606.cljs$lang$maxFixedArity = 0;
G__47606.cljs$lang$applyTo = (function (arglist__47608){
var kids = cljs.core.seq(arglist__47608);
return G__47606__delegate(kids);
});
G__47606.cljs$core$IFn$_invoke$arity$variadic = G__47606__delegate;
return G__47606;
})()
;})(field,field_help))
;
var field_label = ((function (field,field_help,field_input){
return (function() { 
var G__47609__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__47609 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47610__i = 0, G__47610__a = new Array(arguments.length -  0);
while (G__47610__i < G__47610__a.length) {G__47610__a[G__47610__i] = arguments[G__47610__i + 0]; ++G__47610__i;}
  kids = new cljs.core.IndexedSeq(G__47610__a,0,null);
} 
return G__47609__delegate.call(this,kids);};
G__47609.cljs$lang$maxFixedArity = 0;
G__47609.cljs$lang$applyTo = (function (arglist__47611){
var kids = cljs.core.seq(arglist__47611);
return G__47609__delegate(kids);
});
G__47609.cljs$core$IFn$_invoke$arity$variadic = G__47609__delegate;
return G__47609;
})()
;})(field,field_help,field_input))
;
var iter__24010__auto__ = ((function (field,field_help,field_input,field_label){
return (function weathergen$ui$control_layout_$_iter__47576(s__47577){
return (new cljs.core.LazySeq(null,((function (field,field_help,field_input,field_label){
return (function (){
var s__47577__$1 = s__47577;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47577__$1);
if(temp__5278__auto__){
var s__47577__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47577__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__47577__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__47579 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__47578 = (0);
while(true){
if((i__47578 < size__24009__auto__)){
var vec__47590 = cljs.core._nth.call(null,c__24008__auto__,i__47578);
var label = cljs.core.nth.call(null,vec__47590,(0),null);
var selector = cljs.core.nth.call(null,vec__47590,(1),null);
var map__47593 = cljs.core.nth.call(null,vec__47590,(2),null);
var map__47593__$1 = ((((!((map__47593 == null)))?((((map__47593.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47593.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47593):map__47593);
var opts = map__47593__$1;
var extra = cljs.core.get.call(null,map__47593__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__47593__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__47593__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__47593__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__47593__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__47593__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__23148__auto__ = cell;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return weathergen.ui.weather_params;
}
})();
cljs.core.chunk_append.call(null,b__47579,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__23148__auto__ = help_base;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__23148__auto__ = help_path;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__23148__auto__ = ui;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__23148__auto__ = extra;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())));

var G__47612 = (i__47578 + (1));
i__47578 = G__47612;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47579),weathergen$ui$control_layout_$_iter__47576.call(null,cljs.core.chunk_rest.call(null,s__47577__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47579),null);
}
} else {
var vec__47595 = cljs.core.first.call(null,s__47577__$2);
var label = cljs.core.nth.call(null,vec__47595,(0),null);
var selector = cljs.core.nth.call(null,vec__47595,(1),null);
var map__47598 = cljs.core.nth.call(null,vec__47595,(2),null);
var map__47598__$1 = ((((!((map__47598 == null)))?((((map__47598.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47598.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47598):map__47598);
var opts = map__47598__$1;
var extra = cljs.core.get.call(null,map__47598__$1,new cljs.core.Keyword(null,"extra","extra",1612569067));
var type = cljs.core.get.call(null,map__47598__$1,new cljs.core.Keyword(null,"type","type",1174270348));
var help_base = cljs.core.get.call(null,map__47598__$1,new cljs.core.Keyword(null,"help-base","help-base",-1618186240));
var help_path = cljs.core.get.call(null,map__47598__$1,new cljs.core.Keyword(null,"help-path","help-path",840478713));
var cell = cljs.core.get.call(null,map__47598__$1,new cljs.core.Keyword(null,"cell","cell",764245084));
var ui = cljs.core.get.call(null,map__47598__$1,new cljs.core.Keyword(null,"ui","ui",-469653645));
var cell__$1 = (function (){var or__23148__auto__ = cell;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__23148__auto__ = help_base;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return new cljs.core.Keyword(null,"weather-params","weather-params",-259271365);
}
})()], null),(function (){var or__23148__auto__ = help_path;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return selector;
}
})()),label)),field_input.call(null,(function (){var or__23148__auto__ = ui;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__23148__auto__ = extra;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.PersistentVector.EMPTY;
}
})())),weathergen$ui$control_layout_$_iter__47576.call(null,cljs.core.rest.call(null,s__47577__$2)));
}
} else {
return null;
}
break;
}
});})(field,field_help,field_input,field_label))
,null,null));
});})(field,field_help,field_input,field_label))
;
return iter__24010__auto__.call(null,controls);
});
weathergen.ui.weather_display_controls = (function weathergen$ui$weather_display_controls(p__47614){
var map__47619 = p__47614;
var map__47619__$1 = ((((!((map__47619 == null)))?((((map__47619.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47619.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47619):map__47619);
var prevent_map_change_QMARK_ = cljs.core.get.call(null,map__47619__$1,new cljs.core.Keyword(null,"prevent-map-change?","prevent-map-change?",1926330460));
var title = cljs.core.get.call(null,map__47619__$1,new cljs.core.Keyword(null,"title","title",636505583));
var field = ((function (map__47619,map__47619__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__47623__delegate = function (kids){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"field",kids);
};
var G__47623 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47624__i = 0, G__47624__a = new Array(arguments.length -  0);
while (G__47624__i < G__47624__a.length) {G__47624__a[G__47624__i] = arguments[G__47624__i + 0]; ++G__47624__i;}
  kids = new cljs.core.IndexedSeq(G__47624__a,0,null);
} 
return G__47623__delegate.call(this,kids);};
G__47623.cljs$lang$maxFixedArity = 0;
G__47623.cljs$lang$applyTo = (function (arglist__47625){
var kids = cljs.core.seq(arglist__47625);
return G__47623__delegate(kids);
});
G__47623.cljs$core$IFn$_invoke$arity$variadic = G__47623__delegate;
return G__47623;
})()
;})(map__47619,map__47619__$1,prevent_map_change_QMARK_,title))
;
var field_help = ((function (field,map__47619,map__47619__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__47626__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__47626 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47627__i = 0, G__47627__a = new Array(arguments.length -  0);
while (G__47627__i < G__47627__a.length) {G__47627__a[G__47627__i] = arguments[G__47627__i + 0]; ++G__47627__i;}
  kids = new cljs.core.IndexedSeq(G__47627__a,0,null);
} 
return G__47626__delegate.call(this,kids);};
G__47626.cljs$lang$maxFixedArity = 0;
G__47626.cljs$lang$applyTo = (function (arglist__47628){
var kids = cljs.core.seq(arglist__47628);
return G__47626__delegate(kids);
});
G__47626.cljs$core$IFn$_invoke$arity$variadic = G__47626__delegate;
return G__47626;
})()
;})(field,map__47619,map__47619__$1,prevent_map_change_QMARK_,title))
;
var field_input = ((function (field,field_help,map__47619,map__47619__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__47629__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__47629 = function (var_args){
var kids = null;
if (arguments.length > 0) {
var G__47630__i = 0, G__47630__a = new Array(arguments.length -  0);
while (G__47630__i < G__47630__a.length) {G__47630__a[G__47630__i] = arguments[G__47630__i + 0]; ++G__47630__i;}
  kids = new cljs.core.IndexedSeq(G__47630__a,0,null);
} 
return G__47629__delegate.call(this,kids);};
G__47629.cljs$lang$maxFixedArity = 0;
G__47629.cljs$lang$applyTo = (function (arglist__47631){
var kids = cljs.core.seq(arglist__47631);
return G__47629__delegate(kids);
});
G__47629.cljs$core$IFn$_invoke$arity$variadic = G__47629__delegate;
return G__47629;
})()
;})(field,field_help,map__47619,map__47619__$1,prevent_map_change_QMARK_,title))
;
var field_label = ((function (field,field_help,field_input,map__47619,map__47619__$1,prevent_map_change_QMARK_,title){
return (function() { 
var G__47632__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__47632 = function (help_path,var_args){
var kids = null;
if (arguments.length > 1) {
var G__47633__i = 0, G__47633__a = new Array(arguments.length -  1);
while (G__47633__i < G__47633__a.length) {G__47633__a[G__47633__i] = arguments[G__47633__i + 1]; ++G__47633__i;}
  kids = new cljs.core.IndexedSeq(G__47633__a,0,null);
} 
return G__47632__delegate.call(this,help_path,kids);};
G__47632.cljs$lang$maxFixedArity = 1;
G__47632.cljs$lang$applyTo = (function (arglist__47634){
var help_path = cljs.core.first(arglist__47634);
var kids = cljs.core.rest(arglist__47634);
return G__47632__delegate(help_path,kids);
});
G__47632.cljs$core$IFn$_invoke$arity$variadic = G__47632__delegate;
return G__47632;
})()
;})(field,field_help,field_input,map__47619,map__47619__$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__23148__auto__ = title;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__47619,map__47619__$1,prevent_map_change_QMARK_,title){
return (function (G__47621,G__47622){
return G__47621.call(null,(new cljs.core.Keyword(null,"opacity","opacity",397153780).cljs$core$IFn$_invoke$arity$1(G__47622) * (100)));
});})(opts,field,field_help,field_input,field_label,map__47619,map__47619__$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__47619,map__47619__$1,prevent_map_change_QMARK_,title){
return (function (p1__47613_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__47613_SHARP_) / 100.0));
});})(opts,field,field_help,field_input,field_label,map__47619,map__47619__$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__47637,G__47638){
return G__47637.call(null,G__47638,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__47658,G__47659){
return G__47658.call(null,G__47659,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__47662,G__47660,G__47661){
return G__47660.call(null,G__47661,new cljs.core.Keyword(null,"wind-stability-areas","wind-stability-areas",1732901204).cljs$core$IFn$_invoke$arity$1(G__47662));
})).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__29599__auto__){
var vec__47669 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_wind_stability_areas){
return (function (p__47672){
var vec__47673 = p__47672;
var index = cljs.core.nth.call(null,vec__47673,(0),null);
var area = cljs.core.nth.call(null,vec__47673,(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__29599__auto__));
var index = cljs.core.nth.call(null,vec__47669,(0),null);
var area = cljs.core.nth.call(null,vec__47669,(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__47669,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__47669,index,area,indexed_wind_stability_areas){
return (function (areas){
return weathergen.ui.remove_nth.call(null,areas,cljs.core.deref.call(null,index));
});})(vec__47669,index,area,indexed_wind_stability_areas))
);
});})(vec__47669,index,area,indexed_wind_stability_areas))
),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__47669,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__47669,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__47669,index,area,indexed_wind_stability_areas){
return (function (G__47676){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__47676);
});})(vec__47669,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__47723,G__47724){
return G__47723.call(null,G__47724,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__29599__auto__){
var vec__47731 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (indexed_weather_overrides){
return (function (p__47734){
var vec__47735 = p__47734;
var index = cljs.core.nth.call(null,vec__47735,(0),null);
var override = cljs.core.nth.call(null,vec__47735,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [override,index], null);
});})(indexed_weather_overrides))
).call(null,item__29599__auto__));
var override = cljs.core.nth.call(null,vec__47731,(0),null);
var index = cljs.core.nth.call(null,vec__47731,(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__47731,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_checkbox(l,k,p__47738){
var map__47743 = p__47738;
var map__47743__$1 = ((((!((map__47743 == null)))?((((map__47743.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__47743.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__47743):map__47743);
var change = cljs.core.get.call(null,map__47743__$1,new cljs.core.Keyword(null,"change","change",-1163046502));
var row_attrs = cljs.core.get.call(null,map__47743__$1,new cljs.core.Keyword(null,"row-attrs","row-attrs",2139633863));
return hoplon.core.tr.call(null,(function (){var or__23148__auto__ = row_attrs;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__47743,map__47743__$1,change,row_attrs,vec__47731,override,index,indexed_weather_overrides){
return (function (G__47746,G__47745){
return G__47745.call(null,G__47746);
});})(map__47743,map__47743__$1,change,row_attrs,vec__47731,override,index,indexed_weather_overrides))
).call(null,override,k),new cljs.core.Keyword(null,"change","change",-1163046502),(function (){var or__23148__auto__ = change;
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return ((function (or__23148__auto__,map__47743,map__47743__$1,change,row_attrs,vec__47731,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__23148__auto__,map__47743,map__47743__$1,change,row_attrs,vec__47731,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__47731,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__47731,override,index,indexed_weather_overrides){
return (function (___$1){
return javelin.core.dosync_STAR_.call(null,((function (checkbox,vec__47731,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__47731,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__47731,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__47731,override,index,indexed_weather_overrides))
);
});})(checkbox,vec__47731,override,index,indexed_weather_overrides))
], null)),(function (){var iter__24010__auto__ = ((function (checkbox,vec__47731,override,index,indexed_weather_overrides){
return (function weathergen$ui$weather_override_parameters_$_iter__47747(s__47748){
return (new cljs.core.LazySeq(null,((function (checkbox,vec__47731,override,index,indexed_weather_overrides){
return (function (){
var s__47748__$1 = s__47748;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47748__$1);
if(temp__5278__auto__){
var s__47748__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47748__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__47748__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__47750 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__47749 = (0);
while(true){
if((i__47749 < size__24009__auto__)){
var vec__47759 = cljs.core._nth.call(null,c__24008__auto__,i__47749);
var label = cljs.core.nth.call(null,vec__47759,(0),null);
var k = cljs.core.nth.call(null,vec__47759,(1),null);
cljs.core.chunk_append.call(null,b__47750,hoplon.core.tr.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (i__47749,vec__47759,label,k,c__24008__auto__,size__24009__auto__,b__47750,s__47748__$2,temp__5278__auto__,checkbox,vec__47731,override,index,indexed_weather_overrides){
return (function (G__47762){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__47762);
});})(i__47749,vec__47759,label,k,c__24008__auto__,size__24009__auto__,b__47750,s__47748__$2,temp__5278__auto__,checkbox,vec__47731,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__47769 = (i__47749 + (1));
i__47749 = G__47769;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47750),weathergen$ui$weather_override_parameters_$_iter__47747.call(null,cljs.core.chunk_rest.call(null,s__47748__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47750),null);
}
} else {
var vec__47763 = cljs.core.first.call(null,s__47748__$2);
var label = cljs.core.nth.call(null,vec__47763,(0),null);
var k = cljs.core.nth.call(null,vec__47763,(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__47763,label,k,s__47748__$2,temp__5278__auto__,checkbox,vec__47731,override,index,indexed_weather_overrides){
return (function (G__47766){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__47766);
});})(vec__47763,label,k,s__47748__$2,temp__5278__auto__,checkbox,vec__47731,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__47747.call(null,cljs.core.rest.call(null,s__47748__$2)));
}
} else {
return null;
}
break;
}
});})(checkbox,vec__47731,override,index,indexed_weather_overrides))
,null,null));
});})(checkbox,vec__47731,override,index,indexed_weather_overrides))
;
return iter__24010__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__47731,override,index,indexed_weather_overrides){
return (function (G__47767){
return new cljs.core.Keyword(null,"animate?","animate?",-1559039739).cljs$core$IFn$_invoke$arity$1(G__47767);
});})(checkbox,vec__47731,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__47731,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__47731,override,index,indexed_weather_overrides){
return (function (overrides){
return weathergen.ui.remove_nth.call(null,overrides,cljs.core.deref.call(null,index));
});})(vec__47731,override,index,indexed_weather_overrides))
);
});})(vec__47731,override,index,indexed_weather_overrides))
),weathergen.ui.buttons.image_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (vec__47731,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__47731,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__47731,override,index,indexed_weather_overrides){
return (function (G__47768){
return new cljs.core.Keyword(null,"editing?","editing?",1646440800).cljs$core$IFn$_invoke$arity$1(G__47768);
});})(vec__47731,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__47825,G__47826){
return G__47825.call(null,G__47826,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__47770_SHARP_){
return cljs.core.apply.call(null,hoplon.core.td,p1__47770_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__24010__auto__ = (function weathergen$ui$weather_type_configuration_$_iter__47827(s__47828){
return (new cljs.core.LazySeq(null,(function (){
var s__47828__$1 = s__47828;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__47828__$1);
if(temp__5278__auto__){
var s__47828__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47828__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__47828__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__47830 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__47829 = (0);
while(true){
if((i__47829 < size__24009__auto__)){
var category = cljs.core._nth.call(null,c__24008__auto__,i__47829);
cljs.core.chunk_append.call(null,b__47830,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__47855 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__47855,(0),null);
var g = cljs.core.nth.call(null,vec__47855,(1),null);
var b = cljs.core.nth.call(null,vec__47855,(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__47858 = cljs.core.contains_QMARK_;
var expr__47859 = category;
if(cljs.core.truth_(pred__47858.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__47859))){
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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit))], null);
} else {
if(cljs.core.truth_(pred__47858.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__47859))){
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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47858.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__47859))){
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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47829,pred__47858,expr__47859,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$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__47859)].join('')));
}
}
}
})(),(function (){var iter__24010__auto__ = ((function (i__47829,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47861(s__47862){
return (new cljs.core.LazySeq(null,((function (i__47829,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__){
return (function (){
var s__47862__$1 = s__47862;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__47862__$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__24006__auto__ = ((function (s__47862__$1,i__47829,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47861_$_iter__47863(s__47864){
return (new cljs.core.LazySeq(null,((function (s__47862__$1,i__47829,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__){
return (function (){
var s__47864__$1 = s__47864;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__47864__$1);
if(temp__5278__auto____$2){
var s__47864__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47864__$2)){
var c__24008__auto____$1 = cljs.core.chunk_first.call(null,s__47864__$2);
var size__24009__auto____$1 = cljs.core.count.call(null,c__24008__auto____$1);
var b__47866 = cljs.core.chunk_buffer.call(null,size__24009__auto____$1);
if((function (){var i__47865 = (0);
while(true){
if((i__47865 < size__24009__auto____$1)){
var metric = cljs.core._nth.call(null,c__24008__auto____$1,i__47865);
cljs.core.chunk_append.call(null,b__47866,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__47879 = (i__47865 + (1));
i__47865 = G__47879;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47866),weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47861_$_iter__47863.call(null,cljs.core.chunk_rest.call(null,s__47864__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47866),null);
}
} else {
var metric = cljs.core.first.call(null,s__47864__$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__47827_$_iter__47861_$_iter__47863.call(null,cljs.core.rest.call(null,s__47864__$2)));
}
} else {
return null;
}
break;
}
});})(s__47862__$1,i__47829,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__))
,null,null));
});})(s__47862__$1,i__47829,param,xs__5831__auto__,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__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__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47861.call(null,cljs.core.rest.call(null,s__47862__$1)));
} else {
var G__47880 = cljs.core.rest.call(null,s__47862__$1);
s__47862__$1 = G__47880;
continue;
}
} else {
return null;
}
break;
}
});})(i__47829,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__))
,null,null));
});})(i__47829,category,c__24008__auto__,size__24009__auto__,b__47830,s__47828__$2,temp__5278__auto__))
;
return iter__24010__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__47881 = (i__47829 + (1));
i__47829 = G__47881;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47830),weathergen$ui$weather_type_configuration_$_iter__47827.call(null,cljs.core.chunk_rest.call(null,s__47828__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47830),null);
}
} else {
var category = cljs.core.first.call(null,s__47828__$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__47867 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__47867,(0),null);
var g = cljs.core.nth.call(null,vec__47867,(1),null);
var b = cljs.core.nth.call(null,vec__47867,(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__47870 = cljs.core.contains_QMARK_;
var expr__47871 = category;
if(cljs.core.truth_(pred__47870.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__47871))){
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__47870,expr__47871,category,s__47828__$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__47870,expr__47871,category,s__47828__$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__47870,expr__47871,category,s__47828__$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__47870,expr__47871,category,s__47828__$2,temp__5278__auto__))
).call(null,weathergen.ui.weather_params,weathergen.ui.pressure_unit))], null);
} else {
if(cljs.core.truth_(pred__47870.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__47871))){
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__47870,expr__47871,category,s__47828__$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__47870,expr__47871,category,s__47828__$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__47870.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__47871))){
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__47870,expr__47871,category,s__47828__$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__47870,expr__47871,category,s__47828__$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__47871)].join('')));
}
}
}
})(),(function (){var iter__24010__auto__ = ((function (category,s__47828__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47873(s__47874){
return (new cljs.core.LazySeq(null,((function (category,s__47828__$2,temp__5278__auto__){
return (function (){
var s__47874__$1 = s__47874;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__47874__$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__24006__auto__ = ((function (s__47874__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__47828__$2,temp__5278__auto__){
return (function weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47873_$_iter__47875(s__47876){
return (new cljs.core.LazySeq(null,((function (s__47874__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__47828__$2,temp__5278__auto__){
return (function (){
var s__47876__$1 = s__47876;
while(true){
var temp__5278__auto____$2 = cljs.core.seq.call(null,s__47876__$1);
if(temp__5278__auto____$2){
var s__47876__$2 = temp__5278__auto____$2;
if(cljs.core.chunked_seq_QMARK_.call(null,s__47876__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__47876__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__47878 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__47877 = (0);
while(true){
if((i__47877 < size__24009__auto__)){
var metric = cljs.core._nth.call(null,c__24008__auto__,i__47877);
cljs.core.chunk_append.call(null,b__47878,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__47882 = (i__47877 + (1));
i__47877 = G__47882;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47878),weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47873_$_iter__47875.call(null,cljs.core.chunk_rest.call(null,s__47876__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__47878),null);
}
} else {
var metric = cljs.core.first.call(null,s__47876__$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__47827_$_iter__47873_$_iter__47875.call(null,cljs.core.rest.call(null,s__47876__$2)));
}
} else {
return null;
}
break;
}
});})(s__47874__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__47828__$2,temp__5278__auto__))
,null,null));
});})(s__47874__$1,param,xs__5831__auto__,temp__5278__auto____$1,category,s__47828__$2,temp__5278__auto__))
;
var fs__24007__auto__ = cljs.core.seq.call(null,iterys__24006__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__24007__auto__){
return cljs.core.concat.call(null,fs__24007__auto__,weathergen$ui$weather_type_configuration_$_iter__47827_$_iter__47873.call(null,cljs.core.rest.call(null,s__47874__$1)));
} else {
var G__47883 = cljs.core.rest.call(null,s__47874__$1);
s__47874__$1 = G__47883;
continue;
}
} else {
return null;
}
break;
}
});})(category,s__47828__$2,temp__5278__auto__))
,null,null));
});})(category,s__47828__$2,temp__5278__auto__))
;
return iter__24010__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__47827.call(null,cljs.core.rest.call(null,s__47828__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24010__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__24179__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var prefer_table__24180__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var method_cache__24181__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var cached_hierarchy__24182__auto__ = cljs.core.atom.call(null,cljs.core.PersistentArrayMap.EMPTY);
var hierarchy__24183__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__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__){
return (function (params,column,category){
return column;
});})(method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__auto__,hierarchy__24183__auto__))
,new cljs.core.Keyword(null,"default","default",-1987822328),hierarchy__24183__auto__,method_table__24179__auto__,prefer_table__24180__auto__,method_cache__24181__auto__,cached_hierarchy__24182__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__23136__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__23136__auto__)){
return (stratus_top < new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1));
} else {
return and__23136__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__23486__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__23487__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__23486__auto__ > y__23487__auto__) ? x__23486__auto__ : y__23487__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__23136__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__23136__auto__)){
return (new cljs.core.Keyword(null,"value","value",305978217).cljs$core$IFn$_invoke$arity$1(conformed__$1) < stratus_base);
} else {
return and__23136__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__48007,G__48008){
return G__48007.call(null,G__48008,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__48009,G__48010){
return G__48009.call(null,G__48010,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__47884_SHARP_){
return cljs.core.reset_BANG_.call(null,l,cljs.core.long$.call(null,cljs.core.deref.call(null,p1__47884_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__48011,G__48012){
return G__48011.call(null,G__48012,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__48013,G__48014){
return G__48013.call(null,(G__48014 * (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__47885_SHARP_){
return cljs.core.reset_BANG_.call(null,l,(cljs.core.long$.call(null,cljs.core.deref.call(null,p1__47885_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__47886_SHARP_){
return hoplon.core.div.call(null,weathergen.help.with_help.call(null,path,p1__47886_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__24010__auto__ = (function weathergen$ui$cloud_controls_$_iter__48015(s__48016){
return (new cljs.core.LazySeq(null,(function (){
var s__48016__$1 = s__48016;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48016__$1);
if(temp__5278__auto__){
var s__48016__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48016__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48016__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48018 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48017 = (0);
while(true){
if((i__48017 < size__24009__auto__)){
var category = cljs.core._nth.call(null,c__24008__auto__,i__48017);
cljs.core.chunk_append.call(null,b__48018,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__48073 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__48073,(0),null);
var g = cljs.core.nth.call(null,vec__48073,(1),null);
var b = cljs.core.nth.call(null,vec__48073,(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__24010__auto__ = ((function (i__48017,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__){
return (function weathergen$ui$cloud_controls_$_iter__48015_$_iter__48076(s__48077){
return (new cljs.core.LazySeq(null,((function (i__48017,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__){
return (function (){
var s__48077__$1 = s__48077;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48077__$1);
if(temp__5278__auto____$1){
var s__48077__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48077__$2)){
var c__24008__auto____$1 = cljs.core.chunk_first.call(null,s__48077__$2);
var size__24009__auto____$1 = cljs.core.count.call(null,c__24008__auto____$1);
var b__48079 = cljs.core.chunk_buffer.call(null,size__24009__auto____$1);
if((function (){var i__48078 = (0);
while(true){
if((i__48078 < size__24009__auto____$1)){
var column = cljs.core._nth.call(null,c__24008__auto____$1,i__48078);
cljs.core.chunk_append.call(null,b__48079,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__23136__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23136__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__23136__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__48078,i__48017,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48078,i__48017,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48078,i__48017,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48078,i__48017,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__29625__auto__ = (new cljs.core.Delay(((function (i__48078,i__48017,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48078,i__48017,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48078,i__48017,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
).call(null,l));
});})(i__48078,i__48017,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
,null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (i__48078,i__48017,con__29625__auto__,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48090 = cljs.core._EQ_;
var expr__48091 = column;
if(cljs.core.truth_(pred__48090.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__48091))){
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__48078,i__48017,con__29625__auto__,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
,null));
var tpl__29627__auto__ = ((function (i__48078,i__48017,con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__48078,i__48017,con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (i__48078,i__48017,con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__){
return (function (G__48093,G__48094){
return G__48093.call(null,G__48094,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__48078,i__48017,con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,c__24008__auto____$1,size__24009__auto____$1,b__48079,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()));

var G__48127 = (i__48078 + (1));
i__48078 = G__48127;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48079),weathergen$ui$cloud_controls_$_iter__48015_$_iter__48076.call(null,cljs.core.chunk_rest.call(null,s__48077__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48079),null);
}
} else {
var column = cljs.core.first.call(null,s__48077__$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__23136__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23136__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__23136__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__48017,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48017,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48017,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48017,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__29625__auto__ = (new cljs.core.Delay(((function (i__48017,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48017,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48017,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
).call(null,l));
});})(i__48017,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
,null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (i__48017,con__29625__auto__,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$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__48095 = cljs.core._EQ_;
var expr__48096 = column;
if(cljs.core.truth_(pred__48095.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__48096))){
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__48017,con__29625__auto__,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
,null));
var tpl__29627__auto__ = ((function (i__48017,con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__48017,con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (i__48017,con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__){
return (function (G__48098,G__48099){
return G__48098.call(null,G__48099,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__48017,con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,s__48077__$2,temp__5278__auto____$1,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()),weathergen$ui$cloud_controls_$_iter__48015_$_iter__48076.call(null,cljs.core.rest.call(null,s__48077__$2)));
}
} else {
return null;
}
break;
}
});})(i__48017,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
,null,null));
});})(i__48017,category,c__24008__auto__,size__24009__auto__,b__48018,s__48016__$2,temp__5278__auto__))
;
return iter__24010__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__48128 = (i__48017 + (1));
i__48017 = G__48128;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48018),weathergen$ui$cloud_controls_$_iter__48015.call(null,cljs.core.chunk_rest.call(null,s__48016__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48018),null);
}
} else {
var category = cljs.core.first.call(null,s__48016__$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__48100 = weathergen.ui.weather_color.call(null,category);
var r = cljs.core.nth.call(null,vec__48100,(0),null);
var g = cljs.core.nth.call(null,vec__48100,(1),null);
var b = cljs.core.nth.call(null,vec__48100,(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__24010__auto__ = ((function (category,s__48016__$2,temp__5278__auto__){
return (function weathergen$ui$cloud_controls_$_iter__48015_$_iter__48103(s__48104){
return (new cljs.core.LazySeq(null,((function (category,s__48016__$2,temp__5278__auto__){
return (function (){
var s__48104__$1 = s__48104;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48104__$1);
if(temp__5278__auto____$1){
var s__48104__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48104__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48104__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48106 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48105 = (0);
while(true){
if((i__48105 < size__24009__auto__)){
var column = cljs.core._nth.call(null,c__24008__auto__,i__48105);
cljs.core.chunk_append.call(null,b__48106,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__23136__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23136__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__23136__auto__;
}
})())){
return hoplon.core.div.call(null,new cljs.core.Keyword(null,"css","css",1135045163),literal_style,javelin.core.formula.call(null,((function (i__48105,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48105,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48105,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48105,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__29625__auto__ = (new cljs.core.Delay(((function (i__48105,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48105,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48105,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
).call(null,l));
});})(i__48105,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
,null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (i__48105,con__29625__auto__,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48117 = cljs.core._EQ_;
var expr__48118 = column;
if(cljs.core.truth_(pred__48117.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__48118))){
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__48105,con__29625__auto__,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
,null));
var tpl__29627__auto__ = ((function (i__48105,con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(i__48105,con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (i__48105,con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__){
return (function (G__48120,G__48121){
return G__48120.call(null,G__48121,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(i__48105,con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,c__24008__auto__,size__24009__auto__,b__48106,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()));

var G__48129 = (i__48105 + (1));
i__48105 = G__48129;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48106),weathergen$ui$cloud_controls_$_iter__48015_$_iter__48103.call(null,cljs.core.chunk_rest.call(null,s__48104__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48106),null);
}
} else {
var column = cljs.core.first.call(null,s__48104__$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__23136__auto__ = cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"stratus-top","stratus-top",784220574),column);
if(and__23136__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__23136__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__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48104__$2,temp__5278__auto____$1,category,s__48016__$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__29625__auto__ = (new cljs.core.Delay(((function (l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
).call(null,l));
});})(l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
,null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__,l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$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__48122 = cljs.core._EQ_;
var expr__48123 = column;
if(cljs.core.truth_(pred__48122.call(null,new cljs.core.Keyword(null,"visibility","visibility",1338380893),expr__48123))){
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__29625__auto__,l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__){
return (function (G__48125,G__48126){
return G__48125.call(null,G__48126,new cljs.core.Keyword(null,"briefing","briefing",-176308969));
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,l,path,literal_style,column,s__48104__$2,temp__5278__auto____$1,category,s__48016__$2,temp__5278__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.display_mode));
})());

}
}
}
})()),weathergen$ui$cloud_controls_$_iter__48015_$_iter__48103.call(null,cljs.core.rest.call(null,s__48104__$2)));
}
} else {
return null;
}
break;
}
});})(category,s__48016__$2,temp__5278__auto__))
,null,null));
});})(category,s__48016__$2,temp__5278__auto__))
;
return iter__24010__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__48015.call(null,cljs.core.rest.call(null,s__48016__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24010__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__48132,G__48133){
return G__48132.call(null,G__48133,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__48149,G__48150){
return G__48149.call(null,G__48150);
})).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__48152,G__48151){
return G__48151.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__48152)));
});})(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__48154,G__48153){
return G__48153.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__48154)));
});})(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__48156,G__48155){
return G__48155.call(null,G__48156);
});})(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__29625__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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__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__29625__auto__,mission_time,max_time,weather_time){
return (function (G__48157,G__48158){
return G__48157.call(null,G__48158,new cljs.core.Keyword(null,"edit","edit",-1641834166));
});})(con__29625__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__29625__auto__,mission_time,max_time,weather_time))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,mission_time,max_time,weather_time){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,mission_time,max_time,weather_time))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,mission_time,max_time,weather_time){
return (function (G__48159,G__48160){
return G__48159.call(null,G__48160,new cljs.core.Keyword(null,"browse","browse",2070502601));
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__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__48161){
return new cljs.core.Keyword(null,"step","step",1288888124).cljs$core$IFn$_invoke$arity$1(G__48161);
});})(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__48134_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.movement_params,cljs.core.assoc,new cljs.core.Keyword(null,"step","step",1288888124),p1__48134_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__48162){
if(cljs.core.truth_(new cljs.core.Keyword(null,"looping?","looping?",78344245).cljs$core$IFn$_invoke$arity$1(G__48162))){
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__48178__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__48178 = function (css,var_args){
var contents = null;
if (arguments.length > 1) {
var G__48179__i = 0, G__48179__a = new Array(arguments.length -  1);
while (G__48179__i < G__48179__a.length) {G__48179__a[G__48179__i] = arguments[G__48179__i + 1]; ++G__48179__i;}
  contents = new cljs.core.IndexedSeq(G__48179__a,0,null);
} 
return G__48178__delegate.call(this,css,contents);};
G__48178.cljs$lang$maxFixedArity = 1;
G__48178.cljs$lang$applyTo = (function (arglist__48180){
var css = cljs.core.first(arglist__48180);
var contents = cljs.core.rest(arglist__48180);
return G__48178__delegate(css,contents);
});
G__48178.cljs$core$IFn$_invoke$arity$variadic = G__48178__delegate;
return G__48178;
})()
;
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__48171,G__48172){
return G__48171.call(null,G__48172,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__48181__delegate = function (rest__48163_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__48163_SHARP_);
};
var G__48181 = function (var_args){
var rest__48163_SHARP_ = null;
if (arguments.length > 0) {
var G__48182__i = 0, G__48182__a = new Array(arguments.length -  0);
while (G__48182__i < G__48182__a.length) {G__48182__a[G__48182__i] = arguments[G__48182__i + 0]; ++G__48182__i;}
  rest__48163_SHARP_ = new cljs.core.IndexedSeq(G__48182__a,0,null);
} 
return G__48181__delegate.call(this,rest__48163_SHARP_);};
G__48181.cljs$lang$maxFixedArity = 0;
G__48181.cljs$lang$applyTo = (function (arglist__48183){
var rest__48163_SHARP_ = cljs.core.seq(arglist__48183);
return G__48181__delegate(rest__48163_SHARP_);
});
G__48181.cljs$core$IFn$_invoke$arity$variadic = G__48181__delegate;
return G__48181;
})()
;})(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__48173){
return cljs.core.not.call(null,(G__48173 == 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__48184__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__48184 = function (label,help_path,edit,var_args){
var more = null;
if (arguments.length > 3) {
var G__48185__i = 0, G__48185__a = new Array(arguments.length -  3);
while (G__48185__i < G__48185__a.length) {G__48185__a[G__48185__i] = arguments[G__48185__i + 3]; ++G__48185__i;}
  more = new cljs.core.IndexedSeq(G__48185__a,0,null);
} 
return G__48184__delegate.call(this,label,help_path,edit,more);};
G__48184.cljs$lang$maxFixedArity = 3;
G__48184.cljs$lang$applyTo = (function (arglist__48186){
var label = cljs.core.first(arglist__48186);
arglist__48186 = cljs.core.next(arglist__48186);
var help_path = cljs.core.first(arglist__48186);
arglist__48186 = cljs.core.next(arglist__48186);
var edit = cljs.core.first(arglist__48186);
var more = cljs.core.rest(arglist__48186);
return G__48184__delegate(label,help_path,edit,more);
});
G__48184.cljs$core$IFn$_invoke$arity$variadic = G__48184__delegate;
return G__48184;
})()
;})(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__48174){
var or__23148__auto__ = new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__48174);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__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__48175){
return cljs.core.not.call(null,(G__48175 == 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__23136__auto__ = progress__$1;
if(cljs.core.truth_(and__23136__auto__)){
return cancelling_QMARK___$1;
} else {
return and__23136__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__29625__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__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (){
return null;
});})(con__29625__auto__,progress,cancelling_QMARK_,save_file,row,inline))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__,progress,cancelling_QMARK_,save_file,row,inline))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__,progress,cancelling_QMARK_,save_file,row,inline){
return (function (G__48176,G__48177){
var and__23136__auto__ = G__48176;
if(cljs.core.truth_(and__23136__auto__)){
return G__48177;
} else {
return and__23136__auto__;
}
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__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__48187){
var map__48190 = p__48187;
var map__48190__$1 = ((((!((map__48190 == null)))?((((map__48190.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48190.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48190):map__48190);
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),"One",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,"This is one",hoplon.core.button.call(null,"button"))], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Two",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,"This is two")], 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),hoplon.core.div.call(null,"This is three")], null)], null)));
});
/**
 * @param {...*} var_args
 */
weathergen.ui.select2 = (function() { 
var weathergen$ui$select2__delegate = function (args__29571__auto__){
var vec__48199 = hoplon.core.parse_args.call(null,args__29571__auto__);
var attrs = cljs.core.nth.call(null,vec__48199,(0),null);
var kids = cljs.core.nth.call(null,vec__48199,(1),null);
var elem = hoplon.core.select.call(null,attrs,kids);
hoplon.core.when_dom.call(null,elem,((function (elem,vec__48199,attrs,kids){
return (function (){
return (function (){var G__48202 = jQuery(elem);
return G__48202;
})().select2();
});})(elem,vec__48199,attrs,kids))
);

return elem;
};
var weathergen$ui$select2 = function (var_args){
var args__29571__auto__ = null;
if (arguments.length > 0) {
var G__48203__i = 0, G__48203__a = new Array(arguments.length -  0);
while (G__48203__i < G__48203__a.length) {G__48203__a[G__48203__i] = arguments[G__48203__i + 0]; ++G__48203__i;}
  args__29571__auto__ = new cljs.core.IndexedSeq(G__48203__a,0,null);
} 
return weathergen$ui$select2__delegate.call(this,args__29571__auto__);};
weathergen$ui$select2.cljs$lang$maxFixedArity = 0;
weathergen$ui$select2.cljs$lang$applyTo = (function (arglist__48204){
var args__29571__auto__ = cljs.core.seq(arglist__48204);
return weathergen$ui$select2__delegate(args__29571__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__48305__delegate = function (args){
return cljs.core.apply.call(null,hoplon.core.div,new cljs.core.Keyword(null,"class","class",-2030961996),"row",args);
};
var G__48305 = function (var_args){
var args = null;
if (arguments.length > 0) {
var G__48306__i = 0, G__48306__a = new Array(arguments.length -  0);
while (G__48306__i < G__48306__a.length) {G__48306__a[G__48306__i] = arguments[G__48306__i + 0]; ++G__48306__i;}
  args = new cljs.core.IndexedSeq(G__48306__a,0,null);
} 
return G__48305__delegate.call(this,args);};
G__48305.cljs$lang$maxFixedArity = 0;
G__48305.cljs$lang$applyTo = (function (arglist__48307){
var args = cljs.core.seq(arglist__48307);
return G__48305__delegate(args);
});
G__48305.cljs$core$IFn$_invoke$arity$variadic = G__48305__delegate;
return G__48305;
})()
;})(expand_state))
;
var G__48258 = (new cljs.core.Delay(((function (expand_state,row){
return (function (){
return "No mission loaded";
});})(expand_state,row))
,null));
var G__48259 = (new cljs.core.Delay(((function (G__48258,expand_state,row){
return (function (){
return "No airbases present in the mission.";
});})(G__48258,expand_state,row))
,null));
var G__48260 = (new cljs.core.Delay(((function (G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_empty_airbases_QMARK_,cljs.core.not);
});})(G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (){
return cljs.core.swap_BANG_.call(null,weathergen.ui.hide_inoperable_airbases_QMARK_,cljs.core.not);
});})(G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row))
,"Check all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__48258,G__48259,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.included_squadron_types,cljs.core.PersistentHashSet.EMPTY);
});})(G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (G__48261,G__48262){
return G__48261.call(null,G__48262);
});})(G__48258,G__48259,expand_state,row))
).call(null,cljs.core.sort,weathergen.ui.all_squadron_types),((function (G__48258,G__48259,expand_state,row){
return (function (item__29615__auto__){
var vec__48263 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (G__48258,G__48259,expand_state,row){
return (function (squadron_type){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [squadron_type], null);
});})(G__48258,G__48259,expand_state,row))
).call(null,item__29615__auto__));
var squadron_type = cljs.core.nth.call(null,vec__48263,(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__48263,squadron_type,G__48258,G__48259,expand_state,row){
return (function (G__48266,G__48268,G__48267){
return G__48266.call(null,G__48267,G__48268);
});})(vec__48263,squadron_type,G__48258,G__48259,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__48263,squadron_type,G__48258,G__48259,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__48263,squadron_type,G__48258,G__48259,expand_state,row))
);
})(),hoplon.core.label.call(null,squadron_type));
});})(G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row))
,"Expand all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__48258,G__48259,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__48258,G__48259,expand_state,row))
,"Collapse all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row))
,"Show all"),weathergen.ui.buttons.a_button.call(null,new cljs.core.Keyword(null,"click","click",1912301393),((function (G__48258,G__48259,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.checked_airbases,cljs.core.PersistentHashSet.EMPTY);
});})(G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (mission,all_airbases){
return cljs.core.group_by.call(null,((function (G__48258,G__48259,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__48258,G__48259,expand_state,row))
,all_airbases);
});})(G__48258,G__48259,expand_state,row))
).call(null,weathergen.ui.mission,weathergen.ui.all_airbases);
var sorted = javelin.core.formula.call(null,((function (by_side,G__48258,G__48259,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__24010__auto__ = ((function (timer_name__15521__auto__,ignore__15522__auto__,by_side,G__48258,G__48259,expand_state,row){
return (function weathergen$ui$air_forces_section_$_iter__48269(s__48270){
return (new cljs.core.LazySeq(null,((function (timer_name__15521__auto__,ignore__15522__auto__,by_side,G__48258,G__48259,expand_state,row){
return (function (){
var s__48270__$1 = s__48270;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48270__$1);
if(temp__5278__auto__){
var s__48270__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48270__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48270__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48272 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48271 = (0);
while(true){
if((i__48271 < size__24009__auto__)){
var side = cljs.core._nth.call(null,c__24008__auto__,i__48271);
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__48272,new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [side,airbases], null));

var G__48308 = (i__48271 + (1));
i__48271 = G__48308;
continue;
} else {
var G__48309 = (i__48271 + (1));
i__48271 = G__48309;
continue;
}
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48272),weathergen$ui$air_forces_section_$_iter__48269.call(null,cljs.core.chunk_rest.call(null,s__48270__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48272),null);
}
} else {
var side = cljs.core.first.call(null,s__48270__$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__48269.call(null,cljs.core.rest.call(null,s__48270__$2)));
} else {
var G__48310 = cljs.core.rest.call(null,s__48270__$2);
s__48270__$1 = G__48310;
continue;
}
}
} else {
return null;
}
break;
}
});})(timer_name__15521__auto__,ignore__15522__auto__,by_side,G__48258,G__48259,expand_state,row))
,null,null));
});})(timer_name__15521__auto__,ignore__15522__auto__,by_side,G__48258,G__48259,expand_state,row))
;
return iter__24010__auto__.call(null,weathergen.falcon.files.mission.sides.call(null,mission));
})();
console.timeEnd(timer_name__15521__auto__);

return result__15523__auto__;
});})(by_side,G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (expanded_QMARK_,item){
var vec__48279 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (p__48282){
var vec__48283 = p__48282;
var side = cljs.core.nth.call(null,vec__48283,(0),null);
var airbases = cljs.core.nth.call(null,vec__48283,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [airbases,side], null);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,item));
var airbases = cljs.core.nth.call(null,vec__48279,(0),null);
var side = cljs.core.nth.call(null,vec__48279,(1),null);
return weathergen.ui.common.inl.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),javelin.core.formula.call(null,((function (vec__48279,airbases,side,by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (G__48286,G__48287){
return G__48286.call(null,"air-forces-side-%d",G__48287);
});})(vec__48279,airbases,side,by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,goog.string.format,side),new cljs.core.Keyword(null,"css","css",1135045163),javelin.core.formula.call(null,((function (vec__48279,airbases,side,by_side,sorted,G__48258,G__48259,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__48279,airbases,side,by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,side),javelin.core.formula.call(null,((function (vec__48279,airbases,side,by_side,sorted,G__48258,G__48259,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__48279,airbases,side,by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,weathergen.ui.mission,side));
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (item){
return javelin.core.formula.call(null,((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (item__$1,mission){
var vec__48288 = item__$1;
var side = cljs.core.nth.call(null,vec__48288,(0),null);
var airbases = cljs.core.nth.call(null,vec__48288,(1),null);
return cljs.core.sort_by.call(null,((function (vec__48288,side,airbases,by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (airbase){
return weathergen.falcon.files.mission.objective_name.call(null,mission,airbase);
});})(vec__48288,side,airbases,by_side,sorted,G__48258,G__48259,expand_state,row))
,airbases);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,item,weathergen.ui.mission);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (airbase__$1,listed_airbases){
return listed_airbases.call(null,airbase__$1);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,airbase,weathergen.ui.listed_airbases)], null);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
,new cljs.core.Keyword(null,"children","children",-940561982),((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (airbase){
return javelin.core.formula.call(null,((function (by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row))
).call(null,airbase);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (expanded_QMARK_,airbase){
var ab_name = javelin.core.formula.call(null,((function (by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row))
).call(null,airbase);
var status = javelin.core.formula.call(null,((function (ab_name,by_side,sorted,G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (G__48292,G__48291){
return G__48291.call(null,"air-forces-airbase-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__48292));
});})(ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row))
).call(null,expanded_QMARK_),new cljs.core.Keyword(null,"click","click",1912301393),((function (ab_name,status,by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (){
return javelin.core.dosync_STAR_.call(null,((function (ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row))
);
});})(ab_name,status,by_side,sorted,G__48258,G__48259,expand_state,row))
,new cljs.core.Keyword(null,"mouseenter","mouseenter",-1792413560),((function (ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row))
,new cljs.core.Keyword(null,"mouseleave","mouseleave",531566580),((function (ab_name,status,by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (){
return cljs.core.reset_BANG_.call(null,weathergen.ui.highlighted_airbase,null);
});})(ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (airbase__$1,checked_airbases){
return checked_airbases.call(null,airbase__$1);
});})(ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (item__29615__auto__){
var vec__48293 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row))
).call(null,item__29615__auto__));
var squadron = cljs.core.nth.call(null,vec__48293,(0),null);
return hoplon.core.img.call(null,new cljs.core.Keyword(null,"toggle","toggle",1291842030),javelin.core.formula.call(null,((function (vec__48293,squadron,ab_name,status,by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(vec__48293,squadron,ab_name,status,by_side,sorted,G__48258,G__48259,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__48293,squadron,ab_name,status,by_side,sorted,G__48258,G__48259,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__48293,squadron,ab_name,status,by_side,sorted,G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (status__$1){
return goog.string.format("Status: %d%%",status__$1);
});})(ab_name,status,by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,status)));
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
], null),new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"attrs","attrs",-2090668713),((function (by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (squadron__$1,included_squadrons){
return included_squadrons.call(null,squadron__$1);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,squadron,weathergen.ui.included_squadrons)], null);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
,new cljs.core.Keyword(null,"formatter","formatter",-483008823),((function (by_side,sorted,G__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (G__48296,G__48297){
return G__48296.call(null,"air-forces-squadron-%d",new cljs.core.Keyword(null,"camp-id","camp-id",618705690).cljs$core$IFn$_invoke$arity$1(G__48297));
});})(by_side,sorted,G__48258,G__48259,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__48258,G__48259,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__48258,G__48259,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__48258,G__48259,expand_state,row){
return (function (G__48298){
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__48298)))].join('');
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,squadron)),weathergen.ui.common.inl.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (G__48299){
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__48299));
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,squadron))),hoplon.core.div.call(null,javelin.core.formula.call(null,((function (by_side,sorted,G__48258,G__48259,expand_state,row){
return (function (G__48300){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__48300);
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
).call(null,squadron))));
});})(by_side,sorted,G__48258,G__48259,expand_state,row))
], null)], null),sorted);
})())));
});})(G__48258,G__48259,expand_state,row))
,null));
var tpl__29643__auto__ = ((function (G__48258,G__48259,G__48260,expand_state,row){
return (function (G__48255,G__48256,G__48257){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(G__48255)?G__48258:(cljs.core.truth_(G__48256)?G__48259:(cljs.core.truth_(G__48257)?G__48260:null)));
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(G__48258,G__48259,G__48260,expand_state,row))
;
return javelin.core.formula.call(null,tpl__29643__auto__).call(null,javelin.core.formula.call(null,((function (G__48258,G__48259,G__48260,tpl__29643__auto__,expand_state,row){
return (function (G__48302,G__48301){
return G__48301.call(null,G__48302);
});})(G__48258,G__48259,G__48260,tpl__29643__auto__,expand_state,row))
).call(null,weathergen.ui.mission,cljs.core.not),javelin.core.formula.call(null,((function (G__48258,G__48259,G__48260,tpl__29643__auto__,expand_state,row){
return (function (G__48304,G__48303){
return (G__48303.call(null,G__48304) === (0));
});})(G__48258,G__48259,G__48260,tpl__29643__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__29625__auto__ = (new cljs.core.Delay((function (){
return "No mission loaded";
}),null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (con__29625__auto__){
return (function (){
var side_type_units = javelin.core.formula.call(null,((function (con__29625__auto__){
return (function (G__48362,G__48361,G__48359,G__48363,G__48360){
return G__48359.call(null,((function (con__29625__auto__){
return (function (m,side,units){
return G__48360.call(null,m,side,G__48361.call(null,new cljs.core.Keyword(null,"type","type",1174270348),units));
});})(con__29625__auto__))
,cljs.core.PersistentArrayMap.EMPTY,G__48361.call(null,((function (con__29625__auto__){
return (function (p1__48311_SHARP_){
return G__48362.call(null,G__48363,new cljs.core.Keyword(null,"owner","owner",-392611939).cljs$core$IFn$_invoke$arity$1(p1__48311_SHARP_));
});})(con__29625__auto__))
,new cljs.core.Keyword(null,"units","units",-533089095).cljs$core$IFn$_invoke$arity$1(G__48363)));
});})(con__29625__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__29625__auto__){
return (function (p1__48312_SHARP_){
return cljs.core.reset_BANG_.call(null,search_text,cljs.core.deref.call(null,p1__48312_SHARP_));
});})(side_type_units,search_text,con__29625__auto__))
),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,side_type_units,((function (side_type_units,search_text,con__29625__auto__){
return (function (item__29615__auto__){
var vec__48370 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (side_type_units,search_text,con__29625__auto__){
return (function (p__48373){
var vec__48374 = p__48373;
var side = cljs.core.nth.call(null,vec__48374,(0),null);
var type_units = cljs.core.nth.call(null,vec__48374,(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__29625__auto__))
).call(null,item__29615__auto__));
var type_units = cljs.core.nth.call(null,vec__48370,(0),null);
var side = cljs.core.nth.call(null,vec__48370,(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__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (G__48378,G__48379,G__48380,G__48377){
return new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"color","color",1011675173),G__48377.call(null,G__48378,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__48379.call(null,G__48380)], null))], null);
});})(vec__48370,type_units,side,side_type_units,search_text,con__29625__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__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (G__48381,G__48382,G__48383){
return G__48381.call(null,G__48382,G__48383);
});})(vec__48370,type_units,side,side_type_units,search_text,con__29625__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__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (item__29615__auto____$1){
var vec__48390 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (p__48393){
var vec__48394 = p__48393;
var type = cljs.core.nth.call(null,vec__48394,(0),null);
var units = cljs.core.nth.call(null,vec__48394,(1),null);
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [units,type], null);
});})(vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__))
).call(null,item__29615__auto____$1));
var units = cljs.core.nth.call(null,vec__48390,(0),null);
var type = cljs.core.nth.call(null,vec__48390,(1),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (G__48397,G__48398){
return G__48397.call(null,G__48398);
});})(vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__))
).call(null,cljs.core.name,type)),hoplon.core.ol.call(null,hoplon.core.loop_tpl_STAR_.call(null,units,((function (vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (item__29615__auto____$2){
var vec__48399 = javelin.core.cell_map.call(null,cljs.core.identity,javelin.core.formula.call(null,((function (vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (unit){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [unit], null);
});})(vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__))
).call(null,item__29615__auto____$2));
var unit = cljs.core.nth.call(null,vec__48399,(0),null);
return hoplon.core.li.call(null,hoplon.core.span.call(null,javelin.core.formula.call(null,((function (vec__48399,unit,vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__){
return (function (G__48402){
return new cljs.core.Keyword(null,"name","name",1843675177).cljs$core$IFn$_invoke$arity$1(G__48402);
});})(vec__48399,unit,vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__))
).call(null,unit)));
});})(vec__48390,units,type,vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__))
)));
});})(vec__48370,type_units,side,side_type_units,search_text,con__29625__auto__))
)));
});})(side_type_units,search_text,con__29625__auto__))
)));
});})(con__29625__auto__))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__))
;
return javelin.core.formula.call(null,tpl__29627__auto__).call(null,javelin.core.formula.call(null,((function (con__29625__auto__,alt__29626__auto__,tpl__29627__auto__){
return (function (G__48404,G__48403){
return G__48403.call(null,G__48404);
});})(con__29625__auto__,alt__29626__auto__,tpl__29627__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__29625__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__48412,G__48411){
return G__48411.call(null,G__48412);
})).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__48413){
return new cljs.core.Keyword(null,"mission-name","mission-name",1479736582).cljs$core$IFn$_invoke$arity$1(G__48413);
})).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__48415,G__48416,G__48414){
return G__48414.call(null,G__48415.call(null,G__48416));
})).call(null,weathergen.falcon.files.mission.mission_time,weathergen.ui.mission,weathergen.ui.common.format_time)));
}),null));
var alt__29626__auto__ = (new cljs.core.Delay(((function (con__29625__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__29625__auto__))
,null));
var tpl__29627__auto__ = ((function (con__29625__auto__,alt__29626__auto__){
return (function (p__29628__auto__){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(p__29628__auto__)?con__29625__auto__:alt__29626__auto__);
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(con__29625__auto__,alt__29626__auto__))
;
return javelin.core.formula.call(null,tpl__29627__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__48435,G__48436){
return G__48435.call(null,G__48436,new cljs.core.Keyword(null,"edit","edit",-1641834166));
})).call(null,cljs.core._EQ_,weathergen.ui.display_mode),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__48440 = (new cljs.core.Delay((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 (G__48443,G__48444){
return G__48443.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__48444));
})).call(null,cljs.core.first,weathergen.ui.mission)));
}),null));
var G__48441 = (new cljs.core.Delay(((function (G__48440){
return (function (){
return "Cannot find a matching installation of Falcon BMS for this mission.";
});})(G__48440))
,null));
var G__48442 = (new cljs.core.Delay(((function (G__48440,G__48441){
return (function (){
return "Two or more installed copies of Falcon BMS point at the same directory. Cannot save briefing due to ambiguity. TODO: Tyrant should fix this. :)";
});})(G__48440,G__48441))
,null));
var tpl__29643__auto__ = ((function (G__48440,G__48441,G__48442){
return (function (G__48437,G__48438,G__48439){
return cljs.core.deref.call(null,(function (){var or__23148__auto__ = (cljs.core.truth_(G__48437)?G__48440:(cljs.core.truth_(G__48438)?G__48441:(cljs.core.truth_(G__48439)?G__48442:null)));
if(cljs.core.truth_(or__23148__auto__)){
return or__23148__auto__;
} else {
return cljs.core.atom.call(null);
}
})());
});})(G__48440,G__48441,G__48442))
;
return javelin.core.formula.call(null,tpl__29643__auto__).call(null,javelin.core.formula.call(null,((function (G__48440,G__48441,G__48442,tpl__29643__auto__){
return (function (G__48445,G__48447,G__48446){
return G__48445.call(null,G__48446.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__48447)),(1));
});})(G__48440,G__48441,G__48442,tpl__29643__auto__))
).call(null,cljs.core._EQ_,weathergen.ui.mission,cljs.core.count),javelin.core.formula.call(null,((function (G__48440,G__48441,G__48442,tpl__29643__auto__){
return (function (G__48449,G__48448){
return (G__48448.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__48449)) === (0));
});})(G__48440,G__48441,G__48442,tpl__29643__auto__))
).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,"toggle","toggle",1291842030),javelin.core.formula.call(null,(function (G__48450,G__48452,G__48451){
return G__48450.call(null,G__48451.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(G__48452)),(1));
})).call(null,cljs.core._EQ_,weathergen.ui.mission,cljs.core.count),new cljs.core.Keyword(null,"click","click",1912301393),(function (){
return weathergen.ui.save_briefing.call(null,cljs.core.first.call(null,new cljs.core.Keyword(null,"candidate-installs","candidate-installs",1512655313).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,weathergen.ui.mission))),cljs.core.deref.call(null,weathergen.ui.visible_sides));
}),"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))));
});
/**
 * 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__48466){
var map__48467 = p__48466;
var map__48467__$1 = ((((!((map__48467 == null)))?((((map__48467.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48467.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48467):map__48467);
var label = cljs.core.get.call(null,map__48467__$1,new cljs.core.Keyword(null,"label","label",1718410804));
var key = cljs.core.get.call(null,map__48467__$1,new cljs.core.Keyword(null,"key","key",-1516042587));
var init = cljs.core.get.call(null,map__48467__$1,new cljs.core.Keyword(null,"init","init",-1875481434));
var min = cljs.core.get.call(null,map__48467__$1,new cljs.core.Keyword(null,"min","min",444991522));
var max = cljs.core.get.call(null,map__48467__$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__24010__auto__ = ((function (id,map__48467,map__48467__$1,label,key,init,min,max){
return (function weathergen$ui$map_controls_section_$_iter__48469(s__48470){
return (new cljs.core.LazySeq(null,((function (id,map__48467,map__48467__$1,label,key,init,min,max){
return (function (){
var s__48470__$1 = s__48470;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48470__$1);
if(temp__5278__auto__){
var s__48470__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48470__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48470__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48472 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48471 = (0);
while(true){
if((i__48471 < size__24009__auto__)){
var val = cljs.core._nth.call(null,c__24008__auto__,i__48471);
cljs.core.chunk_append.call(null,b__48472,hoplon.core.option.call(null,new cljs.core.Keyword(null,"value","value",305978217),val));

var G__48478 = (i__48471 + (1));
i__48471 = G__48478;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48472),weathergen$ui$map_controls_section_$_iter__48469.call(null,cljs.core.chunk_rest.call(null,s__48470__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48472),null);
}
} else {
var val = cljs.core.first.call(null,s__48470__$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__48469.call(null,cljs.core.rest.call(null,s__48470__$2)));
}
} else {
return null;
}
break;
}
});})(id,map__48467,map__48467__$1,label,key,init,min,max))
,null,null));
});})(id,map__48467,map__48467__$1,label,key,init,min,max))
;
return iter__24010__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__48467,map__48467__$1,label,key,init,min,max){
return (function (G__48473,G__48475,G__48474){
return (G__48473.call(null,G__48474,G__48475) * (100));
});})(id,map__48467,map__48467__$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__48467,map__48467__$1,label,key,init,min,max){
return (function (p1__48453_SHARP_){
return cljs.core.swap_BANG_.call(null,weathergen.ui.map_display,cljs.core.assoc,key,(cljs.core.deref.call(null,p1__48453_SHARP_) / 100.0));
});})(id,map__48467,map__48467__$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__48467,map__48467__$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__48467,map__48467__$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__48476){
return new cljs.core.Keyword(null,"show-text-background?","show-text-background?",-442833124).cljs$core$IFn$_invoke$arity$1(G__48476);
});})(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__48477){
return new cljs.core.Keyword(null,"show-bullseye?","show-bullseye?",310289003).cljs$core$IFn$_invoke$arity$1(G__48477);
});})(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__24010__auto__ = (function weathergen$ui$message_display_$_iter__48483(s__48484){
return (new cljs.core.LazySeq(null,(function (){
var s__48484__$1 = s__48484;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48484__$1);
if(temp__5278__auto__){
var s__48484__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48484__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48484__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48486 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48485 = (0);
while(true){
if((i__48485 < size__24009__auto__)){
var message = cljs.core._nth.call(null,c__24008__auto__,i__48485);
cljs.core.chunk_append.call(null,b__48486,(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__48485,visible_QMARK_,message,c__24008__auto__,size__24009__auto__,b__48486,s__48484__$2,temp__5278__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(i__48485,visible_QMARK_,message,c__24008__auto__,size__24009__auto__,b__48486,s__48484__$2,temp__5278__auto__))
,"\u00D7"));
})());

var G__48487 = (i__48485 + (1));
i__48485 = G__48487;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48486),weathergen$ui$message_display_$_iter__48483.call(null,cljs.core.chunk_rest.call(null,s__48484__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48486),null);
}
} else {
var message = cljs.core.first.call(null,s__48484__$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__48484__$2,temp__5278__auto__){
return (function (){
return cljs.core.reset_BANG_.call(null,visible_QMARK_,false);
});})(visible_QMARK_,message,s__48484__$2,temp__5278__auto__))
,"\u00D7"));
})(),weathergen$ui$message_display_$_iter__48483.call(null,cljs.core.rest.call(null,s__48484__$2)));
}
} else {
return null;
}
break;
}
}),null,null));
});
return iter__24010__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,"id","id",-1388402092),"titlebar",hoplon.core.div.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"words",hoplon.core.span.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"title","Virtual Mission Tools"),hoplon.core.span.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"byline","by",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")),hoplon.core.span.call(null,new cljs.core.Keyword(null,"id","id",-1388402092),"helpstring","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,"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,"id","id",-1388402092),"winglogo",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,"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.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__48574 = map_size;
var grid_width = cljs.core.nth.call(null,vec__48574,(0),null);
var grid_height = cljs.core.nth.call(null,vec__48574,(1),null);
var vec__48577 = window_size;
var window_width = cljs.core.nth.call(null,vec__48577,(0),null);
var window_height = cljs.core.nth.call(null,vec__48577,(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__48580){
var vec__48581 = p__48580;
var window_width = cljs.core.nth.call(null,vec__48581,(0),null);
var window_height = cljs.core.nth.call(null,vec__48581,(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__24010__auto__ = ((function (right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__48584(s__48585){
return (new cljs.core.LazySeq(null,((function (right_column,right_width,portrait_QMARK_){
return (function (){
var s__48585__$1 = s__48585;
while(true){
var temp__5278__auto__ = cljs.core.seq.call(null,s__48585__$1);
if(temp__5278__auto__){
var s__48585__$2 = temp__5278__auto__;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48585__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48585__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48587 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48586 = (0);
while(true){
if((i__48586 < size__24009__auto__)){
var map__48624 = cljs.core._nth.call(null,c__24008__auto__,i__48586);
var map__48624__$1 = ((((!((map__48624 == null)))?((((map__48624.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48624.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48624):map__48624);
var title = cljs.core.get.call(null,map__48624__$1,new cljs.core.Keyword(null,"title","title",636505583));
var id = cljs.core.get.call(null,map__48624__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var sections = cljs.core.get.call(null,map__48624__$1,new cljs.core.Keyword(null,"sections","sections",-886710106));
cljs.core.chunk_append.call(null,b__48587,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__24010__auto__ = ((function (i__48586,map__48624,map__48624__$1,title,id,sections,c__24008__auto__,size__24009__auto__,b__48587,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__48584_$_iter__48626(s__48627){
return (new cljs.core.LazySeq(null,((function (i__48586,map__48624,map__48624__$1,title,id,sections,c__24008__auto__,size__24009__auto__,b__48587,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function (){
var s__48627__$1 = s__48627;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48627__$1);
if(temp__5278__auto____$1){
var s__48627__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48627__$2)){
var c__24008__auto____$1 = cljs.core.chunk_first.call(null,s__48627__$2);
var size__24009__auto____$1 = cljs.core.count.call(null,c__24008__auto____$1);
var b__48629 = cljs.core.chunk_buffer.call(null,size__24009__auto____$1);
if((function (){var i__48628 = (0);
while(true){
if((i__48628 < size__24009__auto____$1)){
var vec__48636 = cljs.core._nth.call(null,c__24008__auto____$1,i__48628);
var section = cljs.core.nth.call(null,vec__48636,(0),null);
var opts = cljs.core.nth.call(null,vec__48636,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__48629,(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__48660 = (i__48628 + (1));
i__48628 = G__48660;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48629),weathergen$ui$weather_page_$_iter__48584_$_iter__48626.call(null,cljs.core.chunk_rest.call(null,s__48627__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48629),null);
}
} else {
var vec__48639 = cljs.core.first.call(null,s__48627__$2);
var section = cljs.core.nth.call(null,vec__48639,(0),null);
var opts = cljs.core.nth.call(null,vec__48639,(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__48584_$_iter__48626.call(null,cljs.core.rest.call(null,s__48627__$2)));
}
} else {
return null;
}
break;
}
});})(i__48586,map__48624,map__48624__$1,title,id,sections,c__24008__auto__,size__24009__auto__,b__48587,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
,null,null));
});})(i__48586,map__48624,map__48624__$1,title,id,sections,c__24008__auto__,size__24009__auto__,b__48587,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
;
return iter__24010__auto__.call(null,cljs.core.partition.call(null,(2),sections));
})()], null));

var G__48661 = (i__48586 + (1));
i__48586 = G__48661;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48587),weathergen$ui$weather_page_$_iter__48584.call(null,cljs.core.chunk_rest.call(null,s__48585__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48587),null);
}
} else {
var map__48642 = cljs.core.first.call(null,s__48585__$2);
var map__48642__$1 = ((((!((map__48642 == null)))?((((map__48642.cljs$lang$protocol_mask$partition0$ & (64))) || ((cljs.core.PROTOCOL_SENTINEL === map__48642.cljs$core$ISeq$)))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__48642):map__48642);
var title = cljs.core.get.call(null,map__48642__$1,new cljs.core.Keyword(null,"title","title",636505583));
var id = cljs.core.get.call(null,map__48642__$1,new cljs.core.Keyword(null,"id","id",-1388402092));
var sections = cljs.core.get.call(null,map__48642__$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__24010__auto__ = ((function (map__48642,map__48642__$1,title,id,sections,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function weathergen$ui$weather_page_$_iter__48584_$_iter__48644(s__48645){
return (new cljs.core.LazySeq(null,((function (map__48642,map__48642__$1,title,id,sections,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_){
return (function (){
var s__48645__$1 = s__48645;
while(true){
var temp__5278__auto____$1 = cljs.core.seq.call(null,s__48645__$1);
if(temp__5278__auto____$1){
var s__48645__$2 = temp__5278__auto____$1;
if(cljs.core.chunked_seq_QMARK_.call(null,s__48645__$2)){
var c__24008__auto__ = cljs.core.chunk_first.call(null,s__48645__$2);
var size__24009__auto__ = cljs.core.count.call(null,c__24008__auto__);
var b__48647 = cljs.core.chunk_buffer.call(null,size__24009__auto__);
if((function (){var i__48646 = (0);
while(true){
if((i__48646 < size__24009__auto__)){
var vec__48654 = cljs.core._nth.call(null,c__24008__auto__,i__48646);
var section = cljs.core.nth.call(null,vec__48654,(0),null);
var opts = cljs.core.nth.call(null,vec__48654,(1),null);
var ctor = weathergen.ui.section_ctor.call(null,section);
cljs.core.chunk_append.call(null,b__48647,(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__48662 = (i__48646 + (1));
i__48646 = G__48662;
continue;
} else {
return true;
}
break;
}
})()){
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48647),weathergen$ui$weather_page_$_iter__48584_$_iter__48644.call(null,cljs.core.chunk_rest.call(null,s__48645__$2)));
} else {
return cljs.core.chunk_cons.call(null,cljs.core.chunk.call(null,b__48647),null);
}
} else {
var vec__48657 = cljs.core.first.call(null,s__48645__$2);
var section = cljs.core.nth.call(null,vec__48657,(0),null);
var opts = cljs.core.nth.call(null,vec__48657,(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__48584_$_iter__48644.call(null,cljs.core.rest.call(null,s__48645__$2)));
}
} else {
return null;
}
break;
}
});})(map__48642,map__48642__$1,title,id,sections,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
,null,null));
});})(map__48642,map__48642__$1,title,id,sections,s__48585__$2,temp__5278__auto__,right_column,right_width,portrait_QMARK_))
;
return iter__24010__auto__.call(null,cljs.core.partition.call(null,(2),sections));
})()], null),weathergen$ui$weather_page_$_iter__48584.call(null,cljs.core.rest.call(null,s__48585__$2)));
}
} else {
return null;
}
break;
}
});})(right_column,right_width,portrait_QMARK_))
,null,null));
});})(right_column,right_width,portrait_QMARK_))
;
return iter__24010__auto__.call(null,section_infos);
})()));
})());
})()),weathergen.ui.debug_info.call(null)));
});
