// Compiled by ClojureScript 1.10.520 {}
goog.provide('vmt.pages.mission');
goog.require('cljs.core');
goog.require('weathergen.ipc');
goog.require('weathergen.progress');
goog.require('weathergen.ui');
goog.require('taoensso.timbre');
vmt.pages.mission.make_progress_reporter = (function vmt$pages$mission$make_progress_reporter(){
if((typeof vmt !== 'undefined') && (typeof vmt.pages !== 'undefined') && (typeof vmt.pages.mission !== 'undefined') && (typeof vmt.pages.mission.t_vmt$pages$mission43290 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {weathergen.progress.Reporter}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
vmt.pages.mission.t_vmt$pages$mission43290 = (function (meta43291){
this.meta43291 = meta43291;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
vmt.pages.mission.t_vmt$pages$mission43290.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = (function (_43292,meta43291__$1){
var self__ = this;
var _43292__$1 = this;
return (new vmt.pages.mission.t_vmt$pages$mission43290(meta43291__$1));
});

vmt.pages.mission.t_vmt$pages$mission43290.prototype.cljs$core$IMeta$_meta$arity$1 = (function (_43292){
var self__ = this;
var _43292__$1 = this;
return self__.meta43291;
});

vmt.pages.mission.t_vmt$pages$mission43290.prototype.weathergen$progress$Reporter$ = cljs.core.PROTOCOL_SENTINEL;

vmt.pages.mission.t_vmt$pages$mission43290.prototype.weathergen$progress$Reporter$_start_step$arity$3 = (function (this$,step_name,parent){
var self__ = this;
var this$__$1 = this;
var step_id = cljs.core.str.cljs$core$IFn$_invoke$arity$1(cljs.core.gensym.call(null));
weathergen.ipc.send_to_main.call(null,"load-step-started",new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"id","id",-1388402092),step_id,new cljs.core.Keyword(null,"name","name",1843675177),step_name,new cljs.core.Keyword(null,"parent","parent",-878878779),(cljs.core.truth_(parent)?weathergen.progress._id.call(null,parent):null)], null));

if((typeof vmt !== 'undefined') && (typeof vmt.pages !== 'undefined') && (typeof vmt.pages.mission !== 'undefined') && (typeof vmt.pages.mission.t_vmt$pages$mission43293 !== 'undefined')){
} else {

/**
* @constructor
 * @implements {weathergen.progress.Step}
 * @implements {cljs.core.IMeta}
 * @implements {cljs.core.IWithMeta}
*/
vmt.pages.mission.t_vmt$pages$mission43293 = (function (meta43291,this$,step_name,parent,step_id,meta43294){
this.meta43291 = meta43291;
this.this$ = this$;
this.step_name = step_name;
this.parent = parent;
this.step_id = step_id;
this.meta43294 = meta43294;
this.cljs$lang$protocol_mask$partition0$ = 393216;
this.cljs$lang$protocol_mask$partition1$ = 0;
});
vmt.pages.mission.t_vmt$pages$mission43293.prototype.cljs$core$IWithMeta$_with_meta$arity$2 = ((function (step_id,this$__$1){
return (function (_43295,meta43294__$1){
var self__ = this;
var _43295__$1 = this;
return (new vmt.pages.mission.t_vmt$pages$mission43293(self__.meta43291,self__.this$,self__.step_name,self__.parent,self__.step_id,meta43294__$1));
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.prototype.cljs$core$IMeta$_meta$arity$1 = ((function (step_id,this$__$1){
return (function (_43295){
var self__ = this;
var _43295__$1 = this;
return self__.meta43294;
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.prototype.weathergen$progress$Step$ = cljs.core.PROTOCOL_SENTINEL;

vmt.pages.mission.t_vmt$pages$mission43293.prototype.weathergen$progress$Step$_id$arity$1 = ((function (step_id,this$__$1){
return (function (this$__$1){
var self__ = this;
var this$__$2 = this;
return self__.step_id;
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.prototype.weathergen$progress$Step$_succeeded$arity$1 = ((function (step_id,this$__$1){
return (function (this$__$1){
var self__ = this;
var this$__$2 = this;
return weathergen.ipc.send_to_main.call(null,"load-step-succeeded",new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"id","id",-1388402092),self__.step_id], null));
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.prototype.weathergen$progress$Step$_warn$arity$2 = ((function (step_id,this$__$1){
return (function (this$__$1,message){
var self__ = this;
var this$__$2 = this;
return weathergen.ipc.send_to_main.call(null,"load-step-warning",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),self__.step_id,new cljs.core.Keyword(null,"message","message",-406056002),message], null));
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.prototype.weathergen$progress$Step$_failed$arity$2 = ((function (step_id,this$__$1){
return (function (this$__$1,message){
var self__ = this;
var this$__$2 = this;
return weathergen.ipc.send_to_main.call(null,"load-step-failed",new cljs.core.PersistentArrayMap(null, 2, [new cljs.core.Keyword(null,"id","id",-1388402092),self__.step_id,new cljs.core.Keyword(null,"message","message",-406056002),message], null));
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.getBasis = ((function (step_id,this$__$1){
return (function (){
return new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta43291","meta43291",-787429199,null),cljs.core.with_meta(new cljs.core.Symbol(null,"this","this",1028897902,null),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"tag","tag",-1290361223),new cljs.core.Symbol("vmt.pages.mission","t_vmt$pages$mission43290","vmt.pages.mission/t_vmt$pages$mission43290",415540834,null)], null)),new cljs.core.Symbol(null,"step-name","step-name",1827656920,null),new cljs.core.Symbol(null,"parent","parent",761652748,null),new cljs.core.Symbol(null,"step-id","step-id",-1941481725,null),new cljs.core.Symbol(null,"meta43294","meta43294",589262788,null)], null);
});})(step_id,this$__$1))
;

vmt.pages.mission.t_vmt$pages$mission43293.cljs$lang$type = true;

vmt.pages.mission.t_vmt$pages$mission43293.cljs$lang$ctorStr = "vmt.pages.mission/t_vmt$pages$mission43293";

vmt.pages.mission.t_vmt$pages$mission43293.cljs$lang$ctorPrWriter = ((function (step_id,this$__$1){
return (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"vmt.pages.mission/t_vmt$pages$mission43293");
});})(step_id,this$__$1))
;

/**
 * Positional factory function for vmt.pages.mission/t_vmt$pages$mission43293.
 */
vmt.pages.mission.__GT_t_vmt$pages$mission43293 = ((function (step_id,this$__$1){
return (function vmt$pages$mission$make_progress_reporter_$___GT_t_vmt$pages$mission43293(meta43291__$1,this$__$2,step_name__$1,parent__$1,step_id__$1,meta43294){
return (new vmt.pages.mission.t_vmt$pages$mission43293(meta43291__$1,this$__$2,step_name__$1,parent__$1,step_id__$1,meta43294));
});})(step_id,this$__$1))
;

}

return (new vmt.pages.mission.t_vmt$pages$mission43293(self__.meta43291,this$__$1,step_name,parent,step_id,cljs.core.PersistentArrayMap.EMPTY));
});

vmt.pages.mission.t_vmt$pages$mission43290.getBasis = (function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Symbol(null,"meta43291","meta43291",-787429199,null)], null);
});

vmt.pages.mission.t_vmt$pages$mission43290.cljs$lang$type = true;

vmt.pages.mission.t_vmt$pages$mission43290.cljs$lang$ctorStr = "vmt.pages.mission/t_vmt$pages$mission43290";

vmt.pages.mission.t_vmt$pages$mission43290.cljs$lang$ctorPrWriter = (function (this__4374__auto__,writer__4375__auto__,opt__4376__auto__){
return cljs.core._write.call(null,writer__4375__auto__,"vmt.pages.mission/t_vmt$pages$mission43290");
});

/**
 * Positional factory function for vmt.pages.mission/t_vmt$pages$mission43290.
 */
vmt.pages.mission.__GT_t_vmt$pages$mission43290 = (function vmt$pages$mission$make_progress_reporter_$___GT_t_vmt$pages$mission43290(meta43291){
return (new vmt.pages.mission.t_vmt$pages$mission43290(meta43291));
});

}

return (new vmt.pages.mission.t_vmt$pages$mission43290(cljs.core.PersistentArrayMap.EMPTY));
});
cljs.core._add_method.call(null,weathergen.ipc.on_message,"open-mission",(function (_,event,installations,path){
try{var _STAR_reporter_STAR__orig_val__43297_43299 = weathergen.progress._STAR_reporter_STAR_;
var _STAR_reporter_STAR__temp_val__43298_43300 = vmt.pages.mission.make_progress_reporter.call(null);
weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR__temp_val__43298_43300;

try{taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"vmt.pages.mission",null,35,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (_STAR_reporter_STAR__orig_val__43297_43299,_STAR_reporter_STAR__temp_val__43298_43300){
return (function (){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["open-mission",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"path","path",-188191168),path], null);
});})(_STAR_reporter_STAR__orig_val__43297_43299,_STAR_reporter_STAR__temp_val__43298_43300))
,null)),null,1137312127);

weathergen.ui.load_mission.call(null,installations,path);
}finally {weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR__orig_val__43297_43299;
}
return weathergen.ipc.send_to_main.call(null,"load-complete");
}catch (e43296){var e = e43296;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"vmt.pages.mission",null,39,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (e){
return (function (){
return new cljs.core.PersistentVector(null, 4, 5, cljs.core.PersistentVector.EMPTY_NODE, [e,"Load failed",new cljs.core.Keyword(null,"stack","stack",-793405930),e.stack], null);
});})(e))
,null)),null,181505221);

return weathergen.ipc.send_to_main.call(null,"load-failed",((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data.call(null,e)),new cljs.core.Keyword("weathergen.progress","propagated-error","weathergen.progress/propagated-error",1931683700)))?null:e.stack));
}}));
cljs.core._add_method.call(null,weathergen.ipc.on_message,"open-briefing",(function (_,event,installations,path){
try{var _STAR_reporter_STAR__orig_val__43302_43304 = weathergen.progress._STAR_reporter_STAR_;
var _STAR_reporter_STAR__temp_val__43303_43305 = vmt.pages.mission.make_progress_reporter.call(null);
weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR__temp_val__43303_43305;

try{taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"debug","debug",-1608172596),"vmt.pages.mission",null,48,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (_STAR_reporter_STAR__orig_val__43302_43304,_STAR_reporter_STAR__temp_val__43303_43305){
return (function (){
return new cljs.core.PersistentVector(null, 5, 5, cljs.core.PersistentVector.EMPTY_NODE, ["open-mission",new cljs.core.Keyword(null,"installations","installations",-2091217739),installations,new cljs.core.Keyword(null,"path","path",-188191168),path], null);
});})(_STAR_reporter_STAR__orig_val__43302_43304,_STAR_reporter_STAR__temp_val__43303_43305))
,null)),null,-396214962);

weathergen.ui.load_briefing.call(null,installations,path);
}finally {weathergen.progress._STAR_reporter_STAR_ = _STAR_reporter_STAR__orig_val__43302_43304;
}
return weathergen.ipc.send_to_main.call(null,"load-complete");
}catch (e43301){var e = e43301;
taoensso.timbre._log_BANG_.call(null,taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"error","error",-978969032),"vmt.pages.mission",null,52,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay(((function (e){
return (function (){
return new cljs.core.PersistentVector(null, 8, 5, cljs.core.PersistentVector.EMPTY_NODE, [e,"Load failed",new cljs.core.Keyword(null,"ex-data","ex-data",-309040259),cljs.core.ex_data.call(null,e),new cljs.core.Keyword(null,"propagated?","propagated?",-1087520388),cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data.call(null,e)),new cljs.core.Keyword("weathergen.progress","propagated-error","weathergen.progress/propagated-error",1931683700)),new cljs.core.Keyword(null,"stack","stack",-793405930),e.stack], null);
});})(e))
,null)),null,-985305964);

return weathergen.ipc.send_to_main.call(null,"load-failed",((cljs.core._EQ_.call(null,new cljs.core.Keyword(null,"type","type",1174270348).cljs$core$IFn$_invoke$arity$1(cljs.core.ex_data.call(null,e)),new cljs.core.Keyword("weathergen.progress","propagated-error","weathergen.progress/propagated-error",1931683700)))?null:e.stack));
}}));
cljs.core.reset_BANG_.call(null,weathergen.ui.weather_params,weathergen.ui.default_weather_params);
if(cljs.core.truth_(weathergen.ui.safari_QMARK_)){
cljs.core.swap_BANG_.call(null,weathergen.ui.messages,cljs.core.conj,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Due to bugs related to downloading files in Safari, Safari\n  is not recommended for use with WeatherGen. To use Safari, make use\n  of the workarounds detailed below. Use of Chrome is recommended."], null));
} else {
}
if(cljs.core.truth_(weathergen.ui.ie_QMARK_)){
cljs.core.swap_BANG_.call(null,weathergen.ui.messages,cljs.core.conj,new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Unfortunately, the weather design features of\n         WeatherGen (i.e. this page) do not currently work correctly\n         in Internet Explorer. Shared forecasts work fine, so forecast\n         links can be shared with pilots using IE. Use of Chrome is\n         recommended."], null));
} else {
}
weathergen.ui.weather_page.call(null,new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Mission",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"mission-info","mission-info",1263062521),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"mission-info-section","mission-info-section",1401749344),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"save-briefing-section","save-briefing-section",143974425),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"briefing-notes-section","briefing-notes-section",1870993417),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Map",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"map-controls","map-controls",-1453318552),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 6, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"map-controls-section","map-controls-section",684229466),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"title","title",636505583),"Weather Display Options"], null),new cljs.core.Keyword(null,"map-image-save-controls","map-image-save-controls",-702527229),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Annotations",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"annotation-controls","annotation-controls",-1755737750),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"annotation-controls","annotation-controls",-1755737750),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Air Forces",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"air-forces","air-forces",-1539372068),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"air-forces-section","air-forces-section",-222064121),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Flights",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"flights","flights",-1637719124),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"flights-section","flights-section",1247077532),cljs.core.PersistentArrayMap.EMPTY], null)], null),new cljs.core.PersistentArrayMap(null, 3, [new cljs.core.Keyword(null,"title","title",636505583),"Weather",new cljs.core.Keyword(null,"id","id",-1388402092),new cljs.core.Keyword(null,"weather","weather",1320452344),new cljs.core.Keyword(null,"sections","sections",-886710106),new cljs.core.PersistentVector(null, 18, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"serialization-controls","serialization-controls",-789590644),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"step-controls","step-controls",-854420677),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-display-controls","weather-display-controls",941597221),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-parameters","weather-parameters",-1852076459),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"forecast-section","forecast-section",-1278731643),new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"forecast-link?","forecast-link?",93596965),false], null),new cljs.core.Keyword(null,"weather-type-configuration","weather-type-configuration",-358032997),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"atmosphere-controls","atmosphere-controls",-1058305013),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"weather-override-parameters","weather-override-parameters",491414981),cljs.core.PersistentArrayMap.EMPTY,new cljs.core.Keyword(null,"advanced-controls","advanced-controls",-278238996),cljs.core.PersistentArrayMap.EMPTY], null)], null)], null));
