text: /**
   * These are Bolt’s COMPILED JS files!
   * Do not edit this file, because all changes will be lost. You can edit the 
   * `*.js` files in `/app/src/js/` and then run `grunt updateBolt` to generate 
   * this file. You will need to use the "Cloning from Git" installation method, to 
   * get these files. See: https://docs.bolt.cm/installation/install-git-clone, 
   * as well as the `README.md` file in the `app/src/` folder.
   */try{console.assert(1)}catch(a){console={log:function(){},assert:function(){}}}String.prototype.subst=function(a){return this.replace(/%[A-Z][A-Z0-9_]+%/g,function(b){return b in a?a[b]:b})};var init={depublishTracking:function(){var a="dateDepublishNotice",b=$("#datedepublish").data("notice");$("#datedepublish, #statusselect").on("change",function(){var c=$("#statusselect").val(),d=$("#datedepublish").val();$("."+a).remove(),""!==d&&"published"===c&&moment(d+Bolt.conf("timezone.offset"))<moment()&&$('<div class="'+a+' alert alert-warning alert-dismissible"><button type="button" class="close" data-dismiss="alert">×</button>'+b+"</div>").hide().insertAfter(".depublish-group").slideDown("fast")}),$("#datedepublish").trigger("change")},bindEditFile:function(a){var b;if("undefined"!=typeof CodeMirror){b=CodeMirror.fromTextArea(document.getElementById("form_contents"),{lineNumbers:!0,autofocus:!0,tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:a.readonly});var c=$(window).height()-312;c<200&&(c=200),b.setSize(null,c)}$("#saveeditfile").on("click",function(){Bolt.events.fire("Bolt.File.Save.Start"),b&&b.save();var a="Not saved";$("#saveeditfile").addClass("disabled"),$("#saveeditfile i").addClass("fa-spin fa-spinner"),$("p.lastsaved").text(Bolt.data("editcontent.msg.saving")),$.post("?returnto=ajax",$("#editfile").serialize()).done(function(a){a.ok?Bolt.events.fire("Bolt.File.Save.Done",a):(alert(a.msg),Bolt.events.fire("Bolt.File.Save.Fail",a)),$("p.lastsaved").html(a.msg)}).fail(function(){Bolt.events.fire("Bolt.File.Save.Fail"),alert(a)}).always(function(){Bolt.events.fire("Bolt.File.Save.Always"),window.setTimeout(function(){$("#saveeditfile").removeClass("disabled").blur(),$("#saveeditfile i").removeClass("fa-spin fa-spinner")},300)})})},bindEditLocale:function(a){var b=CodeMirror.fromTextArea(document.getElementById("form_contents"),{lineNumbers:!0,autofocus:!0,tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:a.readonly});b.setSize(null,$(window).height()-276)},bindFileBrowser:function(){$("#myTab a").click(function(a){a.preventDefault(),$(this).tab("show")});var a=function(a){var b=new RegExp("(?:[?&]|&)"+a+"=([^&]+)","i"),c=window.location.search.match(b);return c&&c.length>1?c[1]:null},b=a("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(a){a.preventDefault();var c=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(b,c),window.close()}),$("a.filebrowserCloseLink").bind("click",function(){window.close()})},bindCkFileSelect:function(){var a=function(a){var b=new RegExp("(?:[?&]|&)"+a+"=([^&]+)","i"),c=window.location.search.match(b);return c&&c.length>1?c[1]:null},b=a("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(a){a.preventDefault();var c=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(b,c),window.close()})},bindPrefill:function(){$("#check-all").on("click",function(){$("#form_contenttypes :checkbox").removeAttr("checked").trigger("click")}),$("#uncheck-all").on("click",function(){$("#form_contenttypes :checkbox").removeAttr("checked")})},confirmationDialogs:function(){$(".confirm").on("click",function(){return confirm($(this).data("confirm"))})},deferredWidgets:function(){$("div.widget").each(function(){if("undefined"!=typeof $(this).data("defer")){var a=$(this).data("key");$.ajax({url:Bolt.conf("paths.async")+"widget/"+a,type:"GET",success:function(b){$("#widget-"+a).html(b)},error:function(){console.log("failed to get widget")}})}})},dropDowns:function(){$('[data-toggle="dropdown"]').each(function(a,b){var c;"undefined"==typeof event?$(b).parent().click(function(a){c=a}):c=event,$(b).parent().on("show.bs.dropdown",function(){if("undefined"!=typeof c&&null!==c){var a=$(this).find('[data-toggle="dropdown"]'),b=a.next(".dropdown-menu"),d=c.pageY+20,e=b.height(),f=$(window).height()-d+e,g=37;d-e>20&&f<g&&b.css({top:"auto",bottom:"100%"})}})})},dropZone:function(){$(document).bind("dragover",function(a){var b=$(".dropzone"),c=window.dropZoneTimeout;c?clearTimeout(c):b.addClass("in"),a.target===b[0]?b.addClass("hover"):b.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,b.removeClass("in hover")},100)})},magnificPopup:function(){$(".magnific, .fancybox").magnificPopup({type:"image",gallery:{enabled:!0},disableOn:400,closeBtnInside:!0,enableEscapeKey:!0,mainClass:"mfp-with-zoom",zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(a){return a.parent().parent().find("img")}}})},focusStatusSelect:function(){$("#lastsavedstatus").click(function(a){a.preventDefault(),$('a[href="#tab-meta"]').click(),$("#statusselect").focus()})},passwordInput:function(){$(".togglepass").on("click",function(){$(this).hasClass("show-password")?($('input[name="password"]').attr("type","text"),$(".togglepass.show-password").hide(),$(".togglepass.hide-password").show()):($('input[name="password"]').attr("type","password"),$(".togglepass.show-password").show(),$(".togglepass.hide-password").hide())}),$(".login-forgot").bind("click",function(){$(".login-group, .password-group").hide(),$(".reset-group").show()}),$(".login-remembered").bind("click",function(){$(".login-group, .password-group").show(),$(".reset-group").hide()})},popOvers:function(){$(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})},sortables:function(){$("tbody.sortable").sortable({items:"tr",opacity:"0.5",axis:"y",handle:".sorthandle",update:function(){var a=$(this).sortable("serialize");$.ajax({url:$("#baseurl").attr("value")+"content/sortcontent/"+$(this).parent("table").data("contenttype"),type:"POST",data:a,success:function(){}})}})}},Bolt={};!function(bolt,$){"use strict";var actions={};actions.init=function(){$("button, input[type=button], a").off("click.action"),$("[data-action]").on("click.action",function(e){var action=$(this).attr("data-action");"undefined"!=typeof action&&""!==action&&(e.preventDefault(),eval(action),e.stopPropagation())}).on("click.popover",".popover",function(a){a.stopPropagation()}),$(".clickspinner").on("click.spinner",function(){$(this).addClass("disabled").blur(),$(this).find("i").addClass("fa-spin fa-spinner"),window.setTimeout(function(a){$(a).removeClass("disabled"),$(a).find("i").removeClass("fa-spin fa-spinner")},1e4,this)}),$(".submitspinner").on("submit.spinner",function(){$(this).find("button[type=submit]").addClass("disabled").blur(),$(this).find("button[type=submit] i").addClass("fa-spin fa-spinner"),window.setTimeout(function(a){$(a).removeClass("disabled"),$(a).find("i").removeClass("fa-spin fa-spinner")},1e4,$(this).find("button[type=submit]"))})},bolt.actions=actions}(Bolt||{},jQuery),function(a,b,c,d){"use strict";function e(){d.confirmationDialogs(),d.magnificPopup(),d.dropZone(),d.popOvers(),d.dropDowns(),d.deferredWidgets(),d.passwordInput(),d.sortables(),d.focusStatusSelect(),d.depublishTracking(),b("[data-bind]").each(function(){var c=b(this).data("bind");switch(c.bind){case"editcontent":a.editcontent.init(c);break;case"editfile":d.bindEditFile(c);break;case"editlocale":d.bindEditLocale(c);break;case"filebrowser":d.bindFileBrowser();break;case"ckfileselect":d.bindCkFileSelect();break;case"prefill":d.bindPrefill()}})}function f(){a.events.on("Bolt.GoogleMapsAPI.Load.Request",function(){if(void 0===h){h=!1;var c="https://maps.google.com/maps/api/js?sensor=false&callback=Bolt.app.gMapsApiReady";Bolt.conf.get("google_api_key")&&(c=c+"&key="+Bolt.conf.get("google_api_key")),b.getScript(c).fail(function(){h=void 0,a.events.fire("Bolt.GoogleMapsAPI.Load.Fail")})}else h===!0&&a.events.fire("Bolt.GoogleMapsAPI.Load.Done")})}function g(){var d=a.conf("locale.long");b.fn.select2.defaults.set("language",d.replace("_","-")),c.locale(d),b.datepicker.setDefaults(b.datepicker.regional[d])}var h,i={},j=1e4;i.gMapsApiReady=function(){h=!0,a.events.fire("Bolt.GoogleMapsAPI.Load.Done")},i.run=function(){a.conf.init(),a.data.init(),j=a.conf("buid").match(/(\d+)$/)[1],g(),f(),a.actions.init(),a.secmenu.init(),a.stack.init(),a.omnisearch.init(),a.extend.init(),a.ckeditor.init(),a.datetime.init(),e(),a.app.initWidgets()},i.buid=function(){return"buid-"+j++},i.initWidgets=function(a){"undefined"==typeof a&&(a=b(document.documentElement)),b("[data-bolt-widget]",a).each(function(){var a=b(this),c=a.data("bolt-widget"),d={};"string"==typeof c?d[c]={}:d=c,b.each(d,function(b,c){a[b](c).removeAttr("data-bolt-widget").removeData("bolt-widget")})})},b(document).ready(i.run),a.app=i}(Bolt||{},jQuery,moment,init),function(a,b,c){"use strict";function d(){var a=[];for(var b in arguments)if(1===arguments[b].length||arguments[b][0]){var c=arguments[b][arguments[b].length-1];"string"==typeof c&&"|"===c.substr(0,1)&&(c=c.substr(1),a=a.concat("-")),a=a.concat(c)}return a}var e={};e.init=function(){c&&(c=e.initcke(c))},e.update=function(){if(c)for(var a in c.instances)c.instances.hasOwnProperty(a)&&c.instances[a].updateElement()},e.add=function(a){c&&c.replace(a)},e.initcke=function(c){c.editorConfig=function(c){var e,f=b(this.element.$).data("param")||{},g=a.conf("ckeditor");c.language=a.conf("ckeditor.lang"),c.skin="boltcke",c.resize_enabled=!0,c.entities=!1,c.fillEmptyBlocks=!1,c.extraPlugins+=(c.extraPlugins?",":"")+"codemirror",c.baseFloatZIndex=100015,c.toolbar=d([{name:"styles",items:d(["Format"],[g.styles,"Styles"])}],[{name:"basicstyles",items:d(["Bold"],["Italic"],[g.underline,"Underline"],[g.strike,"Strike"])}],[{name:"paragraph",items:d(["NumberedList"],["BulletedList"],["Indent"],["Outdent"],[g.blockquote,"|Blockquote"])}],[{name:"links",items:d(["Link"],["Unlink"],[g.anchor,"|Anchor"])}],[g.subsuper,{name:"subsuper",items:d(["Subscript"],["Superscript"])}],[g.images,{name:"image",items:d(["Image"])}],[g.embed,{name:"embed",items:d(["oembed"])}],[g.tables,{name:"table",items:d(["Table"])}],[g.ruler,{name:"ruler",items:d(["HorizontalRule"])}],[g.align,{name:"align",items:d(["JustifyLeft"],["JustifyCenter"],["JustifyRight"],["JustifyBlock"])}],[g.fontcolor,{name:"colors",items:d(["TextColor"],["BGColor"])}],[g.codesnippet,{name:"code",items:d(["|CodeSnippet"])}],[{name:"tools",items:d(["RemoveFormat"],["Maximize"],["|Source"],[g.specialchar,"|SpecialChar"])}]),g.embed&&(c.extraPlugins+=",oembed,widget",c.oembed_maxWidth="853",c.oembed_maxHeight="480"),c.height=250,c.autoGrow_onStartup=!0,c.autoGrow_minHeight=150,c.autoGrow_maxHeight=400,c.autoGrow_bottomSpace=24,c.removePlugins="elementspath",c.resize_dir="vertical",g.filebrowser?(g.filebrowser.browseUrl&&(c.filebrowserBrowseUrl=g.filebrowser.browseUrl),g.filebrowser.imageBrowseUrl&&(c.filebrowserImageBrowseUrl=g.filebrowser.imageBrowseUrl),g.filebrowser.uploadUrl&&(c.filebrowserUploadUrl=g.filebrowser.uploadUrl),g.filebrowser.imageUploadUrl&&(c.filebrowserImageUploadUrl=g.filebrowser.imageUploadUrl)):(c.filebrowserBrowseUrl="",c.filebrowserImageBrowseUrl="",c.filebrowserUploadUrl="",c.filebrowserImageUploadUrl=""),c.codemirror={theme:"default",lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseTags:!0,autoCloseBrackets:!0,enableSearchTools:!0,enableCodeFolding:!0,enableCodeFormatting:!1,autoFormatOnStart:!1,autoFormatOnUncomment:!1,autoFormatOnModeChange:!1,highlightActiveLine:!0,highlightMatches:!0,showFormatButton:!1,showCommentButton:!1,showUncommentButton:!1};for(e in g.ck)g.ck.hasOwnProperty(e)&&(c[e]=g.ck[e]);f.height&&(c.height=parseInt(f.height),c.autoGrow_minHeight=Math.max(c.autoGrow_minHeight,c.height),c.autoGrow_maxHeight=Math.max(c.autoGrow_maxHeight,c.height));for(e in f.ckeditor)f.ckeditor.hasOwnProperty(e)&&(c[e]=f.ckeditor[e])};var e=a.conf("ckeditor");return e.ck.allowNbsp&&c.on("instanceReady",function(a){a.editor.on("paste",function(a){a.data.dataValue=a.data.dataValue.replace(/&nbsp;/g," "),a.data.dataValue=a.data.dataValue.replace(/<p> <\/p>/g,"")},null,null,9)}),c},a.ckeditor=e}(Bolt||{},jQuery,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(a,b,c){"use strict";var d={},e=function(a){var b,e=a.split("."),f=d;for(b=0;b<e.length;b++){if("undefined"==typeof f[e[b]])return c;f=f[e[b]]}return f};e.get=e,e.init=function(){d=b("script[data-config]").first().data("config")},a.conf=e}(Bolt||{},jQuery),function(a,b,c){"use strict";var d={},e=function(a,b){var e,f=a.split("."),g=d;for(e=0;e<f.length;e++){if("undefined"==typeof g[f[e]])return c;g=g[f[e]]}return b&&"string"==typeof g?g.subst(b):g};e.get=e,e.init=function(){d=b("script[data-jsdata]").first().data("jsdata")||{}},a.data=e}(Bolt||{},jQuery),function(a,b,c){"use strict";function d(a){var b,d,e,f=c(a.date.datepicker("getDate")),g=c([2001,11,24]),h=!1;if(a.time.exists){var i=new RegExp("^s*(?:(?:([01]?[0-9]|2[0-3])[:,.]([0-5]?[0-9]))|(1[012]|0?[1-9])[:,.]([0-5]?[0-9])(?:s*([AP])[. ]?M.?))s*$","i");e=a.time.val().match(i),e&&(b=parseInt(e[1]?e[1]:e[3]),d=parseInt(e[2]?e[2]:e[4]),"p"!==e[5]&&"P"!==e[5]||12===b?"a"!==e[5]&&"A"!==e[5]||12!==b||(b-=12):b+=12,g=c([2001,11,24,b,d]),h=!0)}if(f.isValid()){var j=a.time.exists?" "+g.format("HH:mm:00"):"";a.data.val(f.format("YYYY-MM-DD")+j)}else h?a.data.val(c().format("YYYY-MM-DD")+" "+g.format("HH:mm:00")):a.data.val("")}function e(a){var c,d,e,f,g="",i="";"datedepublish"===a.data.attr("id")&&"1900-01-01 00:00:00"===a.data.val()&&a.data.val(""),d=a.data.val().match(/^(\d{4}-\d{2}-\d{2})(?: (\d{2}:\d{2}:\d{2}))?$/),d&&(g=d[1],i=d[2]||""),e=""===g||"0000-00-00"===g?"":b.datepicker.parseDate("yy-mm-dd",g),a.date.datepicker("setDate",e),a.time.exists&&"0000-00-00"!==g&&(""===i?i=""!==g?"00:00":"":h?i=a.data.val().slice(11,16):(c=parseInt(i.slice(0,2)),f=c<12?" AM":" PM",i=(c%12||12)+i.slice(2,5)+f),a.time.val(i)),a.data.trigger("change")}function f(a){var b=a.date.data("field-options"),c={showOn:"none"};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);a.date.datepicker(c),a.show.click(function(){a.date.datepicker("show")}),a.clear.click(function(){a.data.val(""),e(a)})}function g(a){var b=a.closest(".datetime-container"),c={};return c.data=a,c.date=b.find("input.datepicker"),c.time=b.find("input.timepicker"),c.show=b.find("button.btn-tertiary"),c.clear=b.find("button.btn-default"),c.time.exists=c.time.length>0,c}var h,i={},j=[];i.init=function(){h=!c.localeData()._longDateFormat.LT.replace(/\[.+?\]/gi,"").match(/A/),b("input.datetime").each(function(){var a=g(b(this));j.push(a),f(a),e(a),a.date.change(function(){d(a),e(a)}),a.time.change(function(){d(a),e(a)})})},i.update=function(){for(var a in j)j.hasOwnProperty(a)&&e(j[a])},a.datetime=i}(Bolt||{},jQuery,moment),function(a,b,c,d,e,f){"use strict";function g(){b("#editcontent").attr("novalidate","novalidate").on("submit",function(c){var d=a.validation.run(this);if(b(this).data("valid",d),!d)return c.preventDefault(),!1}),b("#editcontent").on("boltvalidate",function(){var c=a.validation.run(this);return b(this).data("valid",c),c})}function h(){var a=c.location.hash;a&&b('#filtertabs a[href="#tab-'+a.replace(/^#/,"")+'"]').tab("show"),b("#filtertabs a").click(function(){var a;b(this).tab("show"),a=b("body").scrollTop(),c.location.hash=this.hash.replace(/^#tab-/,""),b("html,body").scrollTop(a)})}function i(){b("#previewbutton, #sidebarpreviewbutton").bind("click",function(a){var c=b(a.target).data("url");a.preventDefault(),b("#editcontent").attr("action",c).attr("target","_blank").submit(),b("#editcontent").attr("action","").attr("target","_self")})}function j(){}function k(){b("#deletebutton, #sidebardeletebutton").bind("click",function(d){d.preventDefault(),e.confirm(a.data("editcontent.delete"),function(d){if(b(".alert").alert(),d===!0){var e=a.conf("paths.bolt"),f=b("#id").closest("form"),g=b("#contenttype").val(),h=b("#id").val(),i=f.find('input[name="bolt_csrf_token"]').val(),j=a.conf("paths.async")+"content/action",k={};k[g]={},k[g][h]={delete:null},b.ajax({url:j,type:"POST",data:{bolt_csrf_token:i,contenttype:g,actions:k},success:function(){c.location.href=e+"overview/"+b("#contenttype").val()}})}})})}function l(){b("#sidebarsavebutton").bind("click",function(){b("#savebutton").trigger("click")}),b("#savebutton").bind("click",function(){p()})}function m(){b("#sidebarsavenewbutton, #savenewbutton").bind("click",function(){p();var a="?returnto=saveandnew";b("#editcontent").attr("action",a).submit()})}function n(e){b("#sidebarsavecontinuebutton, #savecontinuebutton").bind("click",function(g){if(g.preventDefault(),b("#editcontent").trigger("boltvalidate"),!b("#editcontent").data("valid"))return!1;var h=e.newRecord,i=e.savedon,j=e.msgNotSaved;b("#sidebarsavecontinuebutton, #savecontinuebutton").addClass("disabled"),b("#sidebarsavecontinuebutton i, #savecontinuebutton i").addClass("fa-spin fa-spinner"),b("p.lastsaved").text(a.data("editcontent.msg.saving")),h?(p(),b("#editcontent").attr("action","?returnto=new").submit()):(p(),a.events.fire("Bolt.Content.Save.Start"),b.post("?returnto=ajax",b("#editcontent").serialize()).done(function(e){a.events.fire("Bolt.Content.Save.Done",{form:e}),c.onbeforeunload=null,b("p.lastsaved").removeClass("alert alert-danger").html(i).find("strong").text(d(e.datechanged).format("MMM D, HH:mm")).end().find(".buic-moment").buicMoment().buicMoment("set",e.datechanged),b("a#lastsavedstatus strong").html('<i class="fa fa-circle status-'+b("#statusselect option:selected").val()+'"></i> '+b("#statusselect option:selected").text()),b("#sidebarsavecontinuebutton i, #savecontinuebutton i").removeClass("fa-flag fa-spin fa-spinner fa-exclamation-triangle").addClass("fa-check"),"object"===b.type(e)&&b.each(e,function(a,c){if("object"===b.type(c))b.each(c,function(c,d){b(':input[name="'+a+"["+c+']"]').val(d)});else if("array"===b.type(c));else{var d=b("#editcontent [name="+a+"]");"checkbox"===d.attr("type")?d.prop("checked","1"===c):d.val(c),f&&f.instances[a]&&f.instances[a].setData(c,{callback:function(){this.resetDirty()}})}}),a.datetime.update(),p()}).fail(function(c){a.events.fire("Bolt.Content.Save.Fail");var d=b.parseJSON(c.responseText),e="<b>"+j+"</b><br><small>"+d.error.message+"</small>";b("p.lastsaved").html(e).addClass("alert alert-danger"),b("#sidebarsavecontinuebutton i, #savecontinuebutton i").removeClass("fa-flag fa-spin fa-spinner").addClass("fa-exclamation-triangle")}).always(function(){a.events.fire("Bolt.Content.Save.Always"),c.setTimeout(function(){b("#sidebarsavecontinuebutton, #savecontinuebutton").removeClass("disabled").blur()},1e3),c.setTimeout(function(){b("#sidebarsavecontinuebutton i, #savecontinuebutton i").addClass("fa-flag")},5e3)}))})}function o(){(b("#sidebarsavecontinuebutton").is("*")||b("#saveeditfile").is("*"))&&(b("body, input").bind("keydown.ctrl_s keydown.meta_s",function(a){a.preventDefault(),p(),b("#sidebarsavecontinuebutton, #saveeditfile").trigger("click")}),c.setTimeout(function(){p()},1e3))}function p(){b("form#editcontent").find("input, textarea, select").each(function(){if("textarea"===this.type&&b(this).hasClass("ckeditor"))f.instances[this.id].checkDirty()&&(f.instances[this.id].updateElement(),f.instances[this.id].resetDirty());else{var a=r(this);void 0!==a&&b(this).data("watch",a)}}),c.onbeforeunload=function(){if(q()||a.liveEditor.active)return a.data("editcontent.msg.change_quit")}}function q(){var a=0;return b("form#editcontent").find("input, textarea, select").each(function(){if("textarea"===this.type&&b(this).hasClass("ckeditor"))f.instances[this.id].checkDirty()&&a++;else{var c=r(this);void 0!==c&&b(this).data("watch")!==c&&a++}}),a>0}function r(a){var c;return a.name&&(c=b(a).val(),"select-multiple"===a.type&&(c=JSON.stringify(c))),c}var s={};s.init=function(b){g(),l(),m(),n(b),i(),j(),k(),h(),a.liveEditor.init(b),c.setTimeout(function(){o()},1e3)},a.editcontent=s}(Bolt||{},jQuery,window,moment,bootbox,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(a,b){"use strict";function c(a){return b(".extend-bolt-container").find(a)}function d(){b("#installModal").on("hide.bs.modal",function(){c(".latest-version-container .installed-version-item").html('<tr><td colspan="3"><strong>'+a.data("extend.text.no-stable")+"</strong></td></tr>"),c(".stable-version-container .installed-version-item").html('<tr><td colspan="3"><strong>'+a.data("extend.text.no-stable")+"</strong></td></tr>"),c(".dev-version-container .installed-version-item").html('<tr><td colspan="3"><strong>'+a.data("extend.text.no-test")+"</strong></td></tr>"),c(".install-response-container .console").html(a.data("extend.text.installing")),c(".theme-postinstall").hide(),c(".theme-generate-response").hide(),c(".extension-postinstall").hide(),c(".install-response-container").hide(),c(".install-latest-container").hide(),c(".install-version-container").hide(),c(".postinstall-footer").hide(),c("#installModal .loader").show()})}function e(){var d,e;c(".update-container").show(),e=c(".update-output-console").html(),c(".update-output-notice").html(e),c(".update-output-notice").find(".update-output-element").removeClass("update-output-element").addClass("update-output").show(),c(".update-list").hide(),d=c(".update-list-items"),d.html(""),E=c(".update-output"),E.html(a.data("extend.text.updating")),b.get(a.data("extend.baseurl")+"check",function(b){if(b.updates.length>0||b.installs.length>0){var e,f;for(e in b.installs)b.installs.hasOwnProperty(e)&&(f=b.installs[e],d.append(a.data("extend.packages.install_new",{"%PACKAGE%":f.name,"%VERSION%":f.version,"%PRETTYVERSION%":f.prettyversion})));for(e in b.updates)b.updates.hasOwnProperty(e)&&(f=b.updates[e],d.append(a.data("extend.packages.install_update",{"%PACKAGE%":f.name,"%VERSION%":f.version,"%PRETTYVERSION%":f.prettyversion})));E.hide(),c(".update-list").show()}else E.html(a.data("extend.text.updated"))}).fail(function(a){B(a)})}function f(){C(a.data("extend.text.running-update-all"),a.data("extend.text.running-update"),!1),b.get(a.data("extend.baseurl")+"update",function(a){setTimeout(function(){c(".update-container").hide()},7e3),D(a),j()}).fail(function(a){B(a)})}function g(d){var e=c(".update-output").html(a.data("extend.text.updating")),f=b(d.target).data("package");e.show(),E=e,b.get(a.data("extend.baseurl")+"update?package="+f).success(function(a){c(".update-output").html(a),c('.update-list-items tr[data-package="'+f+'"]').remove(),I(function(){E.hide()},4e3),c(".update-list-items tbody tr").length<1&&c(".update-container").hide(),j()}).fail(function(a){B(a)}),d.preventDefault()}function h(d){C(a.data("extend.text.install-running"),a.data("extend.text.install-all"),!1),b.get(a.data("extend.baseurl")+"installAll",function(a){I(function(){c(".update-container").hide()},7e3),D(a),j()}).fail(function(a){B(a)}),d.stopPropagation(),d.preventDefault()}function i(d){C(a.data("extend.text.autoloader-update"),a.data("extend.text.autoloader-start")+" …",!1),b.get(a.data("extend.baseurl")+"dumpAutoload",function(a){I(function(){c(".update-container").hide()},7e3),D(a)}).fail(function(a){B(a)}),d.stopPropagation(),d.preventDefault()}function j(){c(".installed-container").each(function(){var d=b(this).find(".installed-list");E=c(".installed-container .console"),b.get(a.data("extend.baseurl")+"installed",function(b){var e="";if("object"!=typeof b)return void E.html(a.data("extend.text.bad-json"));d.show(),d.find(".installed-list-items").html(""),c(".installed-container .console").hide();var f=!0;"object"==typeof b&&(e+=k(b),f=!1),f&&(e=a.data("extend.packages.empty"),E.hide()),d.find(".installed-list-items").append(e)}).fail(function(a){B(a)})})}function k(b){var c="";for(var d in b)if(b.hasOwnProperty(d)){var e=b[d],f=a.data("extend.packages"),g=[],h=[],i=0;if(e.authors&&e.authors.length>0)for(i=0;i<e.authors.length;i++)g.push(f.author.subst({"%AUTHOR%":e.authors[i].name}));if(g=g.length?f.authors.subst({"%AUTHORS%":g.join(", ")}):"",e.keywords&&e.keywords.length>0)for(i=0;i<e.keywords.length;i++)h.push(f.keyword.subst({"%KEYWORD%":e.keywords[i]}));h=h.length?f.keywords.subst({"%KEYWORDS%":h.join(" ")}):"","wikimedia/composer-merge-plugin"===e.name&&(e.title="Local Extension Helper");var j="",k={"%NAME%":e.name,"%VERSION%":e.version,"%BASEURL%":a.data("extend.baseurl"),"%MARKETPLACE_URL%":"https://extensions.bolt.cm/view/"+e.name,"%REPOSITORY_URL%":e.repositoryLink};j="installed"===e.status&&"composer-plugin"!==e.type?f.manage_dropdown_installed.subst(k):f.manage_dropdown_uninstalled.subst(k);var l=" — [INVALID] ",m=" — [DISABLED] ",n='<i class="fa fa-cog fa-fw"></i>',o=f.left_buttons.subst({"%README%":null!==e.readmeLink?f.readme_button.subst({"%README%":e.readmeLink}):"","%CONFIG%":null!==e.configLink?f.config_button.subst({"%CONFIG%":e.configLink}):"","%THEME%":"bolt-theme"===e.type?f.theme_button.subst({"%NAME%":e.name}):""});c+=f.item.subst({"%TITLE%":e.title?e.title:e.name,"%NAME%":e.name,"%VERSION%":e.version,"%AUTHORS%":g,"%TYPE%":e.type,"%MANAGE%":j,"%DETAILS%":o,"%BASEURL%":a.data("extend.baseurl"),"%DESCRIPTION%":e.description?f.description.subst({"%DESCRIPTION%":e.description}):"","%KEYWORDS%":h,"%STATUS%":e.valid===!1?l:"","%ENABLED%":e.enabled===!1?m:"","%CONSTRAINT%":null!==e.constraint?n+" Requires Bolt "+e.constraint:""})}return c}function l(a){var b=c('input[name="check-package"]').val(),d=c('input[name="check-package"]').data("packagename");d&&(b=d),m(b),a.preventDefault()}function m(d){E=c(".update-output"),b.get(a.data("extend.baseurl")+"installInfo?package="+d,function(a){var b=a.dev,d=a.stable;b.length>0&&(c(".dev-version-container .installed-version-item").html(""),c(".dev-version-container .installed-version-item").append(o(b))),d.length>0?(c(".stable-version-container .installed-version-item").html(""),c(".stable-version-container .installed-version-item").append(o(d)),c(".latest-version-container .installed-version-item").html(""),c(".latest-version-container .installed-version-item").append(o([a.stable[0]])),c(".install-latest-container").show()):c(".install-version-container").show(),c("#installModal .loader").hide()}).fail(function(a){B(a)})}function n(){c(".install-latest-container").hide(),c(".install-version-container").show()}function o(b){var c,d,e="";for(var f in b)b.hasOwnProperty(f)&&(c=b[f],"undefined"!=typeof c&&(d="approved"===c.buildStatus?" label-success":"",e+=a.data("extend.packages.versions",{"%NAME%":c.name,"%VERSION%":c.version,"%CLASS%%":d,"%BUILDSTATUS%":c.buildStatus})));return e}function p(d){var e=b(d.target).data("package"),f=b(d.target).data("version");c(".install-response-container").show(),c(".install-latest-container").hide(),c(".install-version-container").hide(),E=c(".install-response-container .console"),E.html(a.data("extend.text.installing")),c("#installModal .loader .message").html(a.data("extend.text.installing")),b.get(a.data("extend.baseurl")+"install",{package:e,version:f}).done(function(){q(e,f),c(".install-response-container").hide(),c(".check-package").show(),c('input[name="check-package"]').val(""),j()}).fail(function(a){B(a)}),d.preventDefault()}function q(c,d){b.get(a.data("extend.baseurl")+"packageInfo",{package:c,version:d}).done(function(a){"bolt-extension"===a.type&&r(a),"bolt-theme"===a.type&&s(a)}).fail(function(a){B(a)})}function r(a){c(".extension-postinstall").show(),c(".extension-postinstall .modal-success").show(),c(".postinstall-footer .ext-link").attr("href",a.source),c(".postinstall-footer").show()}function s(a){var b=a.name.split(/\/+/).pop();c(".install-response-container").hide(),c(".theme-postinstall").show(),c(".theme-generation-container").show(),c(".theme-postinstall .theme-generator").data("theme",a.name),c(".theme-postinstall #theme-name").val(b),c(".postinstall-footer").show()}function t(d){var e=b(d.target),f=e.data("theme"),g=c("#theme-name").val();b.get(a.data("extend.baseurl")+"generateTheme",{theme:f,name:g}).done(function(a){c(".theme-generate-response").html("<p>"+a+"</p>").show(),c(".theme-generation-container").hide()}).fail(function(a){B(a)}),d.preventDefault()}function u(d){var e=b(d.target),f=e.data("theme"),g=c("#theme-name").val();if(confirm(a.data("extend.text.overwrite"))){var h=c(".installed-container .console").html(a.data("extend.text.copying"));h.show(),E=h,b.get(a.data("extend.baseurl")+"generateTheme",{theme:f,name:g}).done(function(a){E.html(a),I(function(){h.hide()},5e3)}).fail(function(a){B(a)})}d.preventDefault()}function v(a){b.get(b(a.target).data("readme")).done(function(a){bootbox.dialog({message:a?a:"Readme is empty."})}).fail(function(a){B(a)}),a.preventDefault()}function w(d){var e=b(d.target).data("needle"),f=b(d.target).data("constraint");c(".dependency-response-container").show(),c(".install-latest-container").hide(),c(".install-version-container").hide(),E=c(".dependency-response-container .console"),E.html(""),b.get(a.data("extend.baseurl")+"depends",{needle:e,constraint:f}).done(function(a){c(".loader").hide(),c(".dependency-response-container").hide(),c(".check-package").show(),c('input[name="check-package"]').val("");var b=c("#installModal .extension-dependencies-list");b.html(""),a.forEach(function(a){b.append("<li>"+a.link+"</li>")}),b.show(),c(".extension-dependencies").show(),c(".postinstall-footer").show()}).fail(function(a){B(a)}),d.preventDefault()}function x(a){m(b(a.target).data("available"))}function y(d){var e=c(".installed-container .console").html(a.data("extend.text.removing"));return confirm(a.data("extend.text.confirm-remove"))===!1?(d.stopPropagation(),d.preventDefault(),!1):(e.show(),E=e,b.get(b(d.target).attr("href")).done(function(a){c(".installed-container .console").html(a),j(),I(function(){E.hide()},2e3)}).fail(function(a){B(a)}),void d.preventDefault())}function z(){var d=c('input[name="check-package"]');d.on("keyup",function(){var c=b(this).val();c.length<3||I(function(){b.ajax({url:a.data("extend.siteurl")+"list.json",dataType:"jsonp",data:{name:c}}).success(function(a){if(a.packages.length){var b=d.parent().find(".auto-search");b.html("").show();for(var c in a.packages)if(a.packages.hasOwnProperty(c)){var e=a.packages[c],f='data-request="prefill-package" data-packagename="'+e.name+'"';b.append('<a class="btn btn-block btn-default prefill-package" '+f+'style="text-align: left;">'+e.title+" <small "+f+">("+e.authors+" - "+e.name+")</small></a>")}d.on("blur",function(){b.fadeOut()})}})},500)})}function A(a){var d=b(a.target);c('input[name="check-package"]').val(d.closest("a").text()),c('input[name="check-package"]').data("packagename",d.data("packagename")),c(".auto-search").hide()}function B(c){var d="",e="",f="";try{d=b.parseJSON(c.responseText)}catch(a){b(".modal").modal("hide"),bootbox.alert("<p>An unknown error occurred. This was the error message:</p>\n\n<pre>"+a.message+"</pre>")}if("Bolt\\Exception\\PackageManagerException"===d.error.type)f=d.error.message.replace(/(<http)/g,'<a href="http').replace(/(\w+>)/g,'">this link</a>'),e=a.data("extend.packages.error",{"%ERROR_TYPE%":"Composer Error","%ERROR_MESSAGE%":f,"%ERROR_LOCATION%":""});else if("Bolt\\Exception\\ExtensionsInfoServiceException"===d.error.type)f=d.error.message,e=a.data("extend.packages.error",{"%ERROR_TYPE%":"Extension Site Error","%ERROR_MESSAGE%":f,"%ERROR_LOCATION%":""});else{var g=d.error.file.replace(new RegExp(a.data("extend.rootpath"),"g"),"");e=a.data("extend.packages.error",{"%ERROR_TYPE%":"PHP Error","%ERROR_MESSAGE%":d.error.message,"%ERROR_LOCATION%":"File: "+g+"::"+d.error.line})}b(".modal").modal("hide"),bootbox.alert(e)}function C(a,b,d){var e=c(".update-container");a&&e.find(".update-output-title").html(a),b&&(e.find(".update-output-console").find(".console").html(b),e.find(".update-output-console").show()),d&&e.find(".update-output-notice").html(d).show(),e.show()}function D(a,b){var d=c(".update-container");a&&d.find(".update-output-console").find(".console").html(a).show(),b&&d.find(".update-output-notice").html(b).show()}var E,F,G={},H={click:function(a){var c=b(a.target).data("request");switch(c){case"update-check":e();break;case"update-run":f();break;case"update-package":g(a.originalEvent);break;case"check-package":l(a.originalEvent);break;case"uninstall-package":y(a.originalEvent);break;case"install-package":p(a.originalEvent);break;case"prefill-package":A(a.originalEvent);break;case"install-run":h(a.originalEvent);break;case"autoload-dump":
  i(a.originalEvent);break;case"generate-theme":t(a.originalEvent);break;case"package-available":x(a.originalEvent);break;case"package-copy":u(a.originalEvent);break;case"package-readme":v(a.originalEvent);break;case"package-depends":w(a.originalEvent);break;case"show-all":n(a.originalEvent)}}};G.init=function(){var a=b(".extend-bolt-container");a.length&&(a.on("click",H.click),b(document).ajaxStart(function(){F=setInterval(function(){E&&E.append(".")},1e3)}).ajaxSuccess(function(){clearInterval(F)}).ajaxError(function(){clearInterval(F)}),j(),z(),d())};var I=function(){var a=0;return function(b,c){clearTimeout(a),a=setTimeout(b,c)}}();a.extend=G}(Bolt||{},jQuery),function(a,b){"use strict";var c={},d={},e=/^([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_-]+))?(?:\.([a-zA-Z0-9_-]+))?(?:\.([a-zA-Z0-9_-]+))?$/;c.fire=function(a,b){var c=e.exec(a);if(c&&"undefined"!=typeof c[4])for(;a;)d[a]&&d[a].fire({namespace:c[1],domain:c[2],event:c[3],status:c[4]},b),a=a.replace(/\.?[a-zA-Z0-9_-]+$/,"")},c.on=function(a,c){e.exec(a)&&(d[a]||(d[a]=b.Callbacks("unique")),d[a].add(c))},c.off=function(a,b){e.exec(a)&&d[a]&&d[a].remove(b)},a.events=c}(Bolt||{},jQuery),function(a,b){"use strict";function c(c,d,e,f){var g={url:a.conf("paths.async")+c,type:"POST",data:d,success:function(){document.location.reload()},error:function(a){alert(a.responseText),console.log(e)}};f&&(g.success=f),b.ajax(g)}var d={};d.createFile=function(b,d){var e=window.prompt(a.data("files.msg.create_file"));e.length&&c("file/create",{filename:e,parentPath:d,namespace:b},"Something went wrong creating this file!")},d.renameFile=function(b,d,e){var f=window.prompt(a.data("files.msg.rename_file"),e);f.length&&f!==e&&c("file/rename",{namespace:b,parent:d,oldname:e,newname:f},"Something went wrong renaming this file!")},d.deleteFile=function(d,e,f){confirm(a.data("files.msg.delete_file",{"%FILENAME%":e}))&&c("file/delete",{namespace:d,filename:e},"Failed to delete the file from the server",function(){null!==f&&b(f).closest("tr").slideUp()})},d.duplicateFile=function(a,b){c("file/duplicate",{namespace:a,filename:b},"Something went wrong duplicating this file!")},d.createFolder=function(b,d){var e=window.prompt(a.data("files.msg.create_folder"));e.length&&c("folder/create",{parent:d,foldername:e,namespace:b},"Something went wrong renaming this folder!")},d.renameFolder=function(b,d,e){var f=window.prompt(a.data("files.msg.rename_folder"),e);f.length&&f!==e&&c("folder/rename",{namespace:b,parent:d,oldname:e,newname:f},"Something went wrong renaming this folder!")},d.deleteFolder=function(d,e,f){window.confirm(a.data("files.msg.delete_folder",{"%FOLDERNAME%":f}))&&(c("folder/remove",{namespace:d,parent:e,foldername:f},"Something went wrong renaming this folder!"),b.ajax({success:function(){}}))},a.files=d}(Bolt||{},jQuery),function(a,b,c,d){"use strict";var e={},f=["text","html","textarea"],g=null;e.init=function(a){e.slug=a.singularSlug,Modernizr.contenteditable?(b("#sidebar-live-editor-button, #live-editor-button").bind("click",e.start),b(".close-live-editor").bind("click",e.stop)):b(".live-editor, #sidebar-live-editor-button, #live-editor-button").remove()},e.start=function(){var c=a.validation.run(b("#editcontent")[0]);if(c){var d=function(a){a.preventDefault()},h=function(){var c=b("#live-editor-iframe")[0],g=c.contentWindow||c,h=g.document,i=b(h);i.on("click","a",d);var j=a.ckeditor.initcke(g.CKEDITOR),k=j.editorConfig;j.editorConfig=function(a){k.bind(this)(a);for(var b in a.toolbar)if("tools"===a.toolbar[b].name){var c=a.toolbar[b].items.indexOf("Source");c>-1&&delete a.toolbar[b].items[c]}},j.disableAutoInline=!1,i.find("[data-bolt-field]").each(function(){var a=b("#editcontent *[name="+e.escapejQuery(b(this).data("bolt-field"))+"]"),c=a.closest("[data-bolt-fieldset]").data("bolt-fieldset");b(this).addClass("bolt-editable"),b(this).data("no-edit")||f.indexOf(c)===-1||(b(this).attr("contenteditable",!0),"html"===c?j.inline(this,{allowedContent:""}):(b(this).on("paste",function(a){var b;a.preventDefault(),a.originalEvent.clipboardData?(b=a.originalEvent.clipboardData.getData("text/plain"),h.execCommand("insertText",!1,b)):g.clipboardData&&(b=g.clipboardData.getData("Text"),g.getSelection&&g.getSelection().getRangeAt(0).insertNode(h.createTextNode(b)))}),"textarea"===c?b(this).on("keypress",function(a){13===a.which&&(a.preventDefault(),h.execCommand("insertHTML",!1,"<br><br>"))}):b(this).on("keypress",function(a){return 13!==a.which}).on("focus blur",function(){b(this).html(b(this).text())})))})};b("#live-editor-iframe").on("load",h),a.liveEditor.active=!0,b("body").addClass("live-editor-active"),b("#navpage-primary .navbar-header a").on("click",d);var i=a.conf("paths.root")+"preview/"+e.slug;b("#editcontent *[name=_live-editor-preview]").val("yes"),b("#editcontent").attr("action",i).attr("target","live-editor-iframe").submit(),b("#editcontent").attr("action","").attr("target","_self"),b("#editcontent *[name=_live-editor-preview]").val(""),g=function(){b("#live-editor-iframe").off("load",h),b("#navpage-primary .navbar-header a").off("click",d)}}},e.stop=function(){var c=b("#live-editor-iframe")[0],f=c.contentWindow||c,h=f.document,i=b(h);i.find("[data-bolt-field]").each(function(){var a=b(this).data("bolt-field"),c=b("#editcontent [name="+e.escapejQuery(a)+"]"),f=c.closest("[data-bolt-fieldset]").data("bolt-fieldset"),g="";if("html"===f){g=b(this).html();var h=c.attr("id");d.instances.hasOwnProperty(h)&&d.instances[h].setData(g)}else g=e.cleanText(b(this),f);c.val(g)}),b(c).attr("src",""),a.liveEditor.active=!1,b("body").removeClass("live-editor-active"),g()},e.cleanText=function(a,b){return"textarea"===b&&a.html(a.html().replace(/&nbsp;/g," ").replace(/\s?<br.*?>\s?/g,"\n")),a.text()},e.escapejQuery=function(a){return a.replace(/(:|\.|\[|\]|,)/g,"\\$1")},e.active=!1,e.slug=null,a.liveEditor=e}(Bolt||{},jQuery,window,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(a,b,c){"use strict";var d={};d.init=function(){b(".omnisearch select").select2({width:"100%",placeholder:a.data("omnisearch.placeholder"),minimumInputLength:3,multiple:!0,ajax:{delay:600,url:a.conf("paths.async")+"omnisearch",dataType:"json",data:function(a){return{q:a.term}},processResults:function(a){var c=[];return b.each(a,function(a,b){c.push({id:b.path,path:b.path,text:b.label})}),{results:c}}},templateResult:function(a){var b=a.path?"<small>"+a.path+"</small>":"",c=a.loading?'<i class="fa fa-spinner fa-spin"></i> ':"";return"<div>"+c+a.text+"</div>"+b},templateSelection:function(a){return c.location.href=a.path,null},escapeMarkup:function(a){return a}})},a.omnisearch=d}(Bolt||{},jQuery,window),function(a,b,c){"use strict";function d(){b("#navpage-secondary").outerHeight(0);var a=b(document).height()-b("#navpage-secondary").position().top,e=3e3;a!==b("#navpage-secondary").outerHeight()&&(b("#navpage-secondary").outerHeight(a),e=300),c.setTimeout(d,e)}function e(){b(".navbar-toggle").on("click",function(){var a=b("#navpage-wrapper");a.hasClass("nav-secondary-opened")?a.removeClass("nav-secondary-opened nav-secondary-collapsed"):a.removeClass("nav-secondary-collapsed").addClass("nav-secondary-opened")})}function f(){b(".nav-secondary-collapse a").on("click",function(){return b("#navpage-wrapper").removeClass("nav-secondary-opened").addClass("nav-secondary-collapsed"),setTimeout(function(){b("#navpage-wrapper").addClass("nav-secondary-collapsed-hoverable")},300),b.cookie("sidebar","collapsed",{expires:21,path:"/"}),b("#bolt-footer").addClass("bolt-footer-hidden"),!1})}function g(){b(".nav-secondary-expand a").on("click",function(){return b("#navpage-wrapper").removeClass("nav-secondary-collapsed nav-secondary-opened nav-secondary-collapsed-hoverable"),b.removeCookie("sidebar",{path:"/"}),b("#bolt-footer").removeClass("bolt-footer-hidden"),!1})}function h(){b("#navpage-secondary").find("a.menu-pop").each(function(){var a=b(this),d="";a.nextAll(".submenu").children().each(function(){b(this).hasClass("subdivider")&&(d+="<hr>"),d+=b(this).html().trim().replace(/[ \n]+/g," ").replace(/(>) | (<)/g,"$1$2")}),a.popover({trigger:"manual",content:d,html:!0}),a.on("mouseover focus click dblclick",function(a){var d=this,e=300;"click"!==a.type||b(d).next().hasClass("popover")||(a.preventDefault(),e=0),c.clearTimeout(k),k=c.setTimeout(function(){b("#navpage-secondary a.menu-pop").not(d).popover("hide"),b(d).popover("show")},e)})}).end().on("mouseenter focus",".popover",function(){c.clearTimeout(k)}).on("mouseleave blur","a.menu-pop, .popover",function(){c.clearTimeout(k),k=c.setTimeout(function(){b("#navpage-secondary a.menu-pop").popover("hide")},300)})}function i(){b("#navpage-secondary a.menu-pop").on("click",function(a){var c=b(this).nextAll(".submenu");a.preventDefault(),c.hasClass("show")?c.removeClass("show"):(b("#navpage-secondary .submenu").removeClass("show"),c.addClass("show"))})}var j={};j.init=function(){var a=!b(".navbar-toggle").is(":visible");e(),f(),g(),b("#navpage-secondary").length&&d(),a?h():i()};var k=0;a.secmenu=j}(Bolt||{},jQuery,window),function(a,b){"use strict";var c={};c.init=function(){b("a[data-bolt-addtostack]").each(function(){b(this).on("click",function(a){var d=b(a.currentTarget),e=d.data("bolt-addtostack");a.preventDefault(),c.addToStack(e,d)})})},c.addToStack=function(c,d){c=c.replace(/files\//gi,""),b.get(a.conf("paths.async")+"stack/add/"+c).done(function(){d&&b(d).addClass("disabled"),b(":bolt-buicStack").buicStack("prepend",c)}).fail(function(){console.log("Failed to add file to stack")})},a.stack=c}(Bolt||{},jQuery),function(a){"use strict";var b={};b.humanBytes=function(b){for(var c=" kMGTPEZY",d=-1;++d<8&&Math.abs(b)>=1e3;)b/=1e3;return b="object"==typeof Intl&&Intl&&"function"==typeof Intl.NumberFormat?b.toLocaleString(a.conf("locale.long").replace(/_/g,"-"),{maximumSignificantDigits:3}):b.toFixed(2),b+" "+c[d].trim()+"B"},b.filterInt=function(a,b){return/^(\-|\+)?([0-9]+|Infinity)$/.test(a)?Number(a):b||NaN},a.utils=b}(Bolt||{}),function(a){"use strict";a.widget("bolt.baseField",{_create:function(){}})}(jQuery),function(a){"use strict";var b={};a.widget("bolt.baseInterval",{options:{delay:1e4},_create:function(){var c=this,d=this.widgetName;if(!b[d]){var e=a.Callbacks(),f=setInterval(e.fire,this.options.delay);b[d]={id:f,delay:this.options.delay,callbacks:e}}this._fncUpdate=function(){c._update()},b[d].callbacks.add(this._fncUpdate)},_destroy:function(){var a=this.widgetName;b[a].callbacks.remove(this._fncUpdate),b[a].callbacks.has()||(clearInterval(b[a].id),delete b[a])}})}(jQuery),function(a,b){"use strict";a.widget("bolt.buicBrowser",{options:{namespace:"",path:"",multiselect:!1},_create:function(){this._url=b.conf("paths.async")+"browse/"+this.options.namespace+(this.options.path?"/"+this.options.path:""),this._on({click:function(){this._browse()}})},_browse:function(){var b=this,c={multiselect:this.options.multiselect},d=[],e=!1;a("body").buicModal({size:"large",remote:{url:b._url,data:c},loaded:function(c,f){var g=f.footer.find("[data-fbrowser-add-checked]");f.body.find(".entry").each(function(){var b=a(this).closest("tr"),c=a(this).text().trim(),d=c.match(/\.(.+?[^\/])$/);a(b).attr("data-bolt-browse-name",c).attr("data-bolt-browse-ext",d?d[1]:"")}),f.header.on("click.bolt","[data-fbrowser-chdir]",function(c){c.preventDefault(),b._url=a(this).data("fbrowser-chdir"),b._browse()}),f.body.on("click.bolt","[data-fbrowser-chdir]",function(c){c.preventDefault(),b._url=a(this).data("fbrowser-chdir"),b._browse()}).on("click.bolt","[data-fbrowser-select]",function(c){c.preventDefault(),b._trigger("selected",null,{path:a(this).data("fbrowser-select")}),f.close()}).on("click.bolt","[aria-pressed]",function(b){var c="false"===a(this).attr("aria-pressed"),d=this.className.replace("toogle-","");a(this).attr("aria-pressed",c?"true":"false"),f.body.find("tbody."+d).toggleClass("hidden",!c),b.clientX>0&&this.blur()}).on("change",'select[name="ext"]',function(){b._filter(f)}).keyup('input[name="filter"]',function(){b._filter(f)}).on("change","[data-fbrowser-check]",function(){var b=d.indexOf(a(this).data("fbrowser-check"));b>-1?(d.splice(b,1),e=!1,console.log(d.length),0===d.length&&g.addClass("disabled")):(d.push(a(this).data("fbrowser-check")),g.removeClass("disabled"))}),f.footer.on("click.bolt",".toggle-all",function(b){b.preventDefault(),e?(f.body.find("[data-fbrowser-check]").each(function(){a(this).prop("checked",!1)}),d.length=0,e=!1,g.addClass("disabled")):(f.body.find("[data-fbrowser-check]").each(function(){a(this).prop("checked",!0),d.push(a(this).data("fbrowser-check"))}),e=!0,g.removeClass("disabled"))}).on("click.bolt","[data-fbrowser-add-checked]:not(.disabled)",function(a){a.preventDefault(),d.forEach(function(a){b._trigger("selected",null,{path:a})}),f.close()})}})},_filter:function(b){var c,d,e=b.body.find('input[name="filter"]').val(),f=b.body.find('select[name="ext"]').val();b.body.find("[data-bolt-browse-name]").each(function(){c=a(this).data("bolt-browse-name"),d=""!==f&&a(this).data("bolt-browse-ext")!==f||""!==e&&c.search(e)<0,a(this).toggleClass("hidden",d),d||a(this).find("a, span").each(function(){a(this).html(c.replace(e,"<mark>"+e+"</mark>"))})})}})}(jQuery,Bolt),function(a){"use strict";a.widget("bolt.buicCheckbox",{_create:function(){var a=this.element.find("button"),b=this.element.find("input");this._on(a,{click:function(){b.prop("checked",!b.prop("checked"))}})}})}(jQuery),function(a,b){"use strict";a.widget("bolt.buicListing",{_create:function(){this.csrfToken=this.element.data("bolt_csrf_token"),this.contentType=this.element.data("contenttype"),this.contentTypeName=this.element.data("contenttype-name"),this.element.find("table.listing tbody").buicListingPart()},modifyRecords:function(c,d,e){var f,g=this,h={},i={delete:{safe:!1,name:b.data("recordlisting.action.delete",{"%CTNAME%":this.contentTypeName}),cmd:{delete:null}},publish:{safe:!0,name:b.data("recordlisting.action.publish",{"%CTNAME%":this.contentTypeName}),cmd:{modify:{status:"published"}}},depublish:{safe:!0,name:b.data("recordlisting.action.depublish"),cmd:{modify:{status:"held"}}},draft:{safe:!0,name:b.data("recordlisting.action.draft"),cmd:{modify:{status:"draft"}}}};h[g.contentType]={},a(d).each(function(){h[g.contentType][this]=i[c].cmd}),f=1===d.length?b.data("recordlisting.confirm.one"):b.data("recordlisting.confirm.multi",{"%NUMBER%":"<b>"+d.length+"</b>"}),f=f+"<br><br><b>"+b.data("recordlisting.confirm.no-undo")+"</b>",i[c].safe?g._sendModifyRecordsQuery(h):bootbox.dialog({message:f,title:i[c].name,buttons:{cancel:{label:b.data("recordlisting.action.cancel"),className:"btn-default"},ok:{label:e,className:"btn-primary",callback:function(){g._sendModifyRecordsQuery(h)}}}})},_sendModifyRecordsQuery:function(c){var d=this,e=b.conf("paths.async")+"content/action"+window.location.search;a.ajax({url:e,type:"POST",data:{bolt_csrf_token:d.csrfToken,contenttype:d.contentType,actions:c},success:function(a){d.element.html(a),d.element.find("table.listing tbody").buicListingPart()},error:function(a,b,c){console.log(a.status+" ("+c+"):"),console.log(JSON.parse(a.responseText))},dataType:"html"})}})}(jQuery,Bolt),function(a){"use strict";a.widget("bolt.buicListingPart",{_create:function(){var b=this;this.listing=this.element.closest(":bolt-buicListing"),this.toolbar=this.element.find("tr.selectiontoolbar"),this.toolbarCount=this.toolbar.find("div.count"),this.menu=this.element.find("tr.header th.menu"),this.menuOnlyOnSelection=this.menu.find("li:not(.select-all)"),this.menuSelectionCount=this.menu.find("li.dropdown-header"),this.menuSelectionCountTemplate=this.menuSelectionCount.text(),this.selectedIds=[],this.menu.find("li.select-all, li.select-none").on("click",function(){var c=a(this).hasClass("select-all");b.element.find('td input:checkbox[name="checkRow"]').each(function(){this.checked=c,b._update(this)})}),this.element.find('td input:checkbox[name="checkRow"]').on("click",function(){b._update(this)}),this.toolbar.find('button[data-stb-cmd^="record:"]').on("click",function(){b._modifyRecords(a(this).data("stb-cmd"),b.selectedIds,a(this).html())}),this.element.find('a[data-listing-cmd^="record:"]').on("click",function(){b._modifyRecords(a(this).data("listing-cmd"),[a(this).parents("tr").attr("id").substr(5)],a(this).html())})},_modifyRecords:function(a,b,c){b.length>0&&this.listing.buicListing("modifyRecords",a.replace(/^record:/,""),b,c)},_update:function(b){var c,d=a(b).closest("tr"),e=d.attr("id").substr(5);b.checked?(this.selectedIds.push(e),d.addClass("row-selected")):(this.selectedIds.splice(this.selectedIds.indexOf(e),1),d.removeClass("row-selected")),c=this.selectedIds.length,c?(this.toolbar.removeClass("hidden"),this.menuOnlyOnSelection.removeClass("hidden")):(this.toolbar.addClass("hidden"),this.menuOnlyOnSelection.addClass("hidden")),this.toolbarCount.text(c),this.menuSelectionCount.text(this.menuSelectionCountTemplate.replace("(#)","("+c+")"))}})}(jQuery),function(a){"use strict";a.widget("bolt.buicModal",{options:{size:void 0,closer:!1,classname:void 0,headline:void 0,header:void 0,body:void 0,footer:void 0,remote:void 0,loaded:void 0},_create:function(){var b=this,c=a('<div class="modal-header hidden"/>'),d=a("<div class=modal-body/>"),e=a('<div class="modal-footer hidden"/>'),f=a("<div class=modal-content/>").append(c,d,e),g=a("<div class=modal-dialog role=document/>").append(f),h=a('<div tabindex=-1 role=dialog class="modal fade buic-modal"/>').append(g);this._ui={header:c,body:d,footer:e,content:f,dialog:g,modal:h},this._on(this.element,{"click .modal-retry":function(){b._load()}}),b.element.prepend(b._ui.modal),b._ui.modal.on("show.bs.modal",function(){b._fire("show")}).on("shown.bs.modal",function(){b._fire("shown")}).on("hide.bs.modal",function(){b._fire("hide")}).on("hidden.bs.modal",function(){b._fire("hidden"),b.destroy()}).modal("show")},_destroy:function(){this._ui.modal.data("modal",null).remove()},_fire:function(a){var b=this;b._trigger(a,null,{close:function(){b._ui.modal.modal("hide")},header:b._ui.header,body:b._ui.body,footer:b._ui.footer})},_init:function(){this._ui.dialog.toggleClass("modal-sm","small"===this.options.size).toggleClass("modal-lg","large"===this.options.size),this.options.remote?this._load():this._update()},_load:function(){var b=this;b._ui.content.addClass("modal-loading"),a.get(b.options.remote.url,b.options.remote.data||{}).done(function(c){b.options.classname=a(c)[0].className,a.each(["header","body","footer"],function(d,e){var f=a(c).children(e.replace("body","main"))[0];b.options[e]=f?f.innerHTML:void 0}),b._update(),b._fire("loaded")}).fail(function(){b.options.header=void 0,b.options.body='<button type=button class="btn btn-default modal-retry"><i class="fa fa-refresh"></i></button>',b.options.footer=void 0,b._update()}).always(function(){b._ui.content.removeClass("modal-loading")})},_update:function(){var b,c=this;void 0!==this.options.headline&&(this.options.header=a(),this.options.closer&&(this.options.header=this.options.header.add('<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>')),this.options.header=this.options.header.add(a('<h4 class="modal-title"/>').append(this.options.headline))),this._ui.content.attr("class","modal-content").addClass(this.options.classname),a.each(["header","body","footer"],function(d,e){b=a("<div>").append(c.options[e]).html()||"",c._ui[e].off().toggleClass("hidden",!b.length).html(b)}),this._ui.modal.modal("handleUpdate")}})}(jQuery),function(a,b){"use strict";a.widget("bolt.buicMoment",a.bolt.baseInterval,{options:{delay:15e3,titleFormat:"YYYY-MM-DD HH:mm:ss ZZ"},_create:function(){this.set(),this._super()},_update:function(){this.element.html(b(this.element.attr("datetime")).fromNow())},set:function(a){a?this.element.attr("datetime",b(a).format()):a=this.element.attr("datetime"),this.element.attr("title",b(a).format(this.options.titleFormat)),this._update()}})}(jQuery,moment),function(a){"use strict";var b='<div class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div></div>';a.widget("bolt.buicProgress",{_create:function(){this.bars={},this.element.addClass("buic-progress")},_set:function(a,b){b=parseFloat(b),b=isNaN(b)?0:Math.min(100,Math.max(0,Math.round(100*b))),this.bars[a]&&this.bars[a].find(".progress-bar").attr("aria-valuenow",b).css("width",b+"%")},add:function(c,d,e){this.bars[c]||(this.bars[c]=a(b),this.bars[c].attr("data-label",e||c).find(".progress-bar").text(e||c),this._set(c,d),this.element.append(this.bars[c]).show(),this.bars[c].show(300))},remove:function(a){if(this.bars[a]){var b=this,c=this.bars[a];delete this.bars[a],c.hide(300,function(){c.remove(),0===Object.keys(b.bars).length&&b.element.hide()})}},set:function(a,b){this._set(a,b)}})}(jQuery),function(a){"use strict";a.widget("bolt.buicSelect",{_create:function(){this.select=this.element.find("select"),this.buttonAll=this.element.find(".select-all"),this.buttonNone=this.element.find(".select-none"),this.buttonAll.prop("title",this.buttonAll.text().trim()),this._on(this.buttonAll,{click:function(){this.all()}}),this.buttonNone.prop("title",this.buttonNone.text().trim()),this._on(this.buttonNone,{click:function(){this.none()}}),this._update(),this._on(this.select,{change:function(){this._update()}})},_update:function(){var a=this.select.find("option"),b=a.length,c=a.filter(":selected").length,d=this.select.prop("multiple")?0===c:""===this.select.val();this.buttonAll.prop("disabled",c===b),this.buttonNone.prop("disabled",d)},all:function(){this.select.find("option").prop("selected",!0).trigger("change")},none:function(){this.select.val(null).trigger("change")}})}(jQuery),function(a,b){"use strict";a.widget("bolt.buicStack",{_addPath:function(a,c){b.stack.addToStack(c.path)},_create:function(){var a=this,b=this.element;this._ui={holder:b.find(".stackholder"),template:{image:b.find(".templates .image"),other:b.find(".templates .other")}},a._on({buicbrowserselected:a._addPath,buicuploaduploaded:a._addPath}),b.buicUpload()},prepend:function(c){var d=c.substr(c.lastIndexOf(".")+1).toUpperCase();a(".stackitem:nth-child(7)",this._ui.holder).remove(),a(".empty").remove(),this._ui.template[d.match(/^(JPE?G|PNG|GIF)$/)?"image":"other"].clone().find("img").attr("src",b.conf("paths.bolt")+"../thumbs/100x100c/"+encodeURI(c)).end().find("strong").html(d).end().find("small").html(c).end().prependTo(this._ui.holder)}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.buicUpload",{_create:function(){var c=this.element,d=a("input[type=file]",c),e=a(".dropzone",c),f=a(d).attr("accept"),g=f?f.replace(/^\./,"").split(/,\./):[],h=new RegExp("(\\.|\\/)("+g.join("|")+")$","i");if(null===this.options.maxSize){var i=Math.floor(b.conf("uploadConfig.maxSize"));this.options.maxSize=b.utils.filterInt(i,2e6)}this._ui={progress:null},d.fileupload({dataType:"json",dropZone:e,pasteZone:null,maxFileSize:this.options.maxSize>0?this.options.maxSize:void 0,minFileSize:void 0,acceptFileTypes:f?h:void 0,maxNumberOfFiles:void 0,messages:{maxFileSize:">:"+b.utils.humanBytes(this.options.maxSize),minFileSize:"<",acceptFileTypes:"T:."+g.join(", ."),maxNumberOfFiles:"#"}}),this._on({fileuploadprocessfail:this._onProcessFail,fileuploadsubmit:this._onUploadSubmit,fileuploadprogress:this._onUploadProgress,fileuploadalways:this._onUploadAlways,fileuploaddone:this._onUploadDone})},_onProcessFail:function(a,c){var d,e=c.files[c.index],f=e.error.substr(0,1),g={"%FILENAME%":e.name,"%FILESIZE%":b.utils.humanBytes(e.size),"%FILETYPE%":e.type,"%ALLOWED%":e.error.substr(2)};switch(f){case">":d=b.data("field.uploads.template.large-file",g);break;case"T":d=b.data("field.uploads.template.wrong-type",g);break;default:d="<p>"+e.error+"</p>"}bootbox.alert(d)},_onUploadSubmit:function(a,b){this._progress("add",b.files)},_onUploadProgress:function(a,b){this._progress("set",b.files,b.loaded/b.total)},_onUploadAlways:function(a,b){this._progress("remove",b.files)},_onUploadDone:function(c,d){var e=this;a.each(d.result,function(a,d){d.error?bootbox.alert(b.data("field.uploads.template.error",{"%ERROR%":d.error})):e._trigger("uploaded",c,{path:d.name})})},_progress:function(b,c,d){var e=this;null===e._ui.progress&&(e._ui.progress=a(":bolt-buicProgress",e.element)),a.each(c,function(){e._ui.progress.buicProgress(b,this.name,d)})},options:{maxSize:null}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldCategories",a.bolt.baseField,{_create:function(){var a=this.element.find("select");a.select2({width:"100%",allowClear:!0,placeholder:{id:"",text:b.data("field.categories.text.placeholder")}})}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldFile",a.bolt.baseField,{_create:function(){var c=this,d=this.element,e=(a("input[accept]",d).prop("accept")||"").replace(/\./g,""),f=a("input.path",d);f.autocomplete({source:b.conf("paths.async")+"file/autocomplete?ext="+encodeURIComponent(e),minLength:2,close:function(){a(f).trigger("change")}}),c._on({"click.select-from-stack a":c._onSelectFromStack,buicbrowserselected:c._onSetPath,buicuploaduploaded:c._onSetPath}),d.buicUpload()},_onSelectFromStack:function(b){var c=a(b.target);c.closest(".btn-group").removeClass("open"),this._onSetPath(b,{path:c.data("path")}),b.preventDefault()},_onSetPath:function(c,d){a("input.path",this.element).val(d.path).trigger("change"),"click"!==c.type&&b.stack.addToStack(d.path)}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldFilelist",a.bolt.baseField,{_create:function(){var b=this,c=this.element;this._ui={data:c.find("textarea"),list:c.find(".list")},this._lastClickIndex=0,b.options.isImage=this.options.isImage||!1,b._ui.list.sortable({helper:function(b,c){return c.addClass("selected"),a("<div/>")},start:function(b,d){var e=a(".selected",c).not(".ui-sortable-placeholder"),f=e.length,g=d.placeholder,h=g.outerHeight(!0),i=g.height(),j=parseInt(g.css("margin-top"))+parseInt(g.css("margin-bottom"));e.hide(),g.height(i+(f-1)*h-j),d.item.data("items",e)},beforeStop:function(a,b){b.item.before(b.item.data("items"))},stop:function(){a(".selected",c).show(),b._serialize()},axis:"y",delay:100,distance:5}),b._on(b._ui.list,{"click.item":b._onSelect,"click.remove":b._onRemove,"change input":b._serialize}),a("input.title",b._ui.list).on("keyup",b._updateTitle),b._on({"click.select-from-stack a":b._onSelectFromStack,buicbrowserselected:b._onAddPath,buicuploaduploaded:b._onAddPath}),c.buicUpload()},_onAddPath:function(b,c){a(">p",this._ui.list).remove(),this._ui.list.append(a(Bolt.data(this.options.isImage?"field.imagelist.template.item":"field.filelist.template.item",{"%TITLE_A%":c.path.replace(/\.[a-z0-9]+$/,""),"%FILENAME_E%":a("<div>").text(c.path).html(),"%FILENAME_A%":c.path,"%EXT_E%":c.path.replace(/^.+?\.([a-z0-9]+)$/,"$1").toUpperCase()}))),this._serialize()},_onRemove:function(c){var d=a(c.target).closest(".item"),e=d.hasClass("selected")?a(".selected",this._ui.list):d,f=this.options.isImage?"field.imagelist.message.remove":"field.filelist.message.remove",g=this.options.isImage?"field.imagelist.message.removeMulti":"field.filelist.message.removeMulti";e.addClass("zombie"),confirm(b.data(e.length>1?g:f))?(c.target.closest(".item").remove(),this._serialize()):e.removeClass("zombie"),c.preventDefault(),c.stopPropagation()},_onSelect:function(b){var c=a(b.target);if(c.hasClass("item"))if(b.shiftKey){var d=Math.min(this._lastClickIndex,c.index()),e=Math.max(this._lastClickIndex,c.index());this._ui.list.children().each(function(b,c){a(c).toggleClass("selected",b>=d&&b<=e)})}else if(b.ctrlKey||b.metaKey)c.toggleClass("selected"),this._lastClickIndex=c.index();else{var f=this._ui.list.children(".selected").not(c);f.removeClass("selected"),c.toggleClass("selected",f.length>0||null),this._lastClickIndex=c.index()}},_onSelectFromStack:function(b){var c=a(b.target);c.closest(".btn-group").removeClass("open"),this._onAddPath(b,{path:c.data("path")}),b.preventDefault()},_serialize:function(){var c=this.options.isImage?"field.imagelist.template.empty":"field.filelist.template.empty",d=[];a(".item",this._ui.list).each(function(){d.push({filename:a("input.filename",this).val(),title:a("input.title",this).val()})}),this._ui.data.val(JSON.stringify(d)),0===d.length&&this._ui.list.html(b.data(c))},_updateTitle:function(b){var c=a(b.target).closest(".item");a("a",c).attr("title",a(".title",c).val())}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldGeolocation",a.bolt.baseField,{options:{latitude:"",longitude:""},_create:function(){var a=this,c=a.element;this._ui={address:c.find(".address"),matched:c.find(".matched"),mapholder:c.find(".mapholder"),spinner:c.find(".mapholder i"),latitude:c.find(".latitude"),longitude:c.find(".longitude"),snap:c.find(".snap")},this._map=null,this._marker=null,this._timeout=0,a._on({"click.expand":a._onExpand,"click.compress":a._onExpand});var d=function(){b.events.off("Bolt.GoogleMapsAPI.Load.Done",d),a._initGoogleMap(a.options.latitude,a.options.longitude)};b.events.on("Bolt.GoogleMapsAPI.Load.Done",d),b.events.on("Bolt.GoogleMapsAPI.Load.Fail",function(){a._ui.spinner.removeClass("fa-spinner fa-spin").addClass("fa-refresh").one("click",function(){a._ui.spinner.removeClass("fa-refresh").addClass("fa-spinner fa-spin"),b.events.fire("Bolt.GoogleMapsAPI.Load.Request")})}),b.events.fire("Bolt.GoogleMapsAPI.Load.Request")},_geoCode:function(a){var b=this;a&&(new google.maps.Geocoder).geocode(a,function(c,d){if(d===google.maps.GeocoderStatus.OK){var e;e=a.latLng&&!b._ui.snap.is(":checked")?a.latLng:c[0].geometry.location,b._display(c[0].formatted_address,e.lat(),e.lng()),b._marker.setPosition(e),b._map.setCenter(e)}}),b._display()},_display:function(a,b,c){this._ui.matched.val(a||""),this._ui.latitude.val(b||""),this._ui.longitude.val(c||"")},_initGoogleMap:function(c,d){var e=this,f={zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,center:new google.maps.LatLng(c,d),streetViewControl:!1};e._map=new google.maps.Map(e._ui.mapholder[0],f),e._marker=new google.maps.Marker({map:e._map,position:f.center,title:b.data("field.geolocation.marker"),draggable:!0,animation:google.maps.Animation.DROP,icon:b.conf("paths.app")+"view/img/pin_red.png"}),google.maps.event.addListener(e._marker,"mouseup",function(){e._geoCode({latLng:e._marker.getPosition()})}),e._ui.address.on("propertychange input",function(){clearTimeout(e._timeout),e._timeout=setTimeout(function(){var a=e._ui.address.val();e._geoCode(a.length>2?{address:a}:void 0)},800)}),a('a[data-toggle="tab"]').on("shown.bs.tab",function(){e._ui.mapholder.closest("div.tab-pane").hasClass("active")&&google.maps.event.trigger(e._map,"resize")})},_onExpand:function(){var a=this._marker.getPosition();this._ui.mapholder.parent().toggleClass("expanded"),google.maps.event.trigger(this._map,"resize"),this._map.setCenter(a)}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldHtml",a.bolt.baseField,{_create:function(){b.ckeditor.add(this.element.find(".ckeditor")[0])}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldImage",a.bolt.fieldFile,{_create:function(){var a=this.element,c=a.find("input.path"),d=a.find("img"),e=d.attr("width"),f=d.attr("height");this._super(),this._on(c,{change:function(){var a=c.val(),g=b.conf("paths.app")+"view/img/default_empty_4x3.png";a&&(g=b.conf("paths.root")+"thumbs/"+e+"x"+f+"c/"+encodeURI(a)),d.attr("src",g)}})}})}(jQuery,Bolt),function(a){"use strict";a.widget("bolt.fieldImagelist",a.bolt.fieldFilelist,{_create:function(){this.options.isImage=!0,this._super()}})}(jQuery),function(a,b){"use strict";a.widget("bolt.fieldMarkdown",a.bolt.baseField,{_create:function(){b.$("textarea[data-uk-htmleditor]",this.element).each(function(){var a=b.$(this);a.data("htmleditor")||b.htmleditor(a,b.Utils.options(a.attr("data-uk-htmleditor")))})}})}(jQuery,"undefined"!=typeof UIkit?UIkit:void 0),function(a){"use strict";a.widget("bolt.fieldMeta",a.bolt.baseField,{_create:function(){var a=this.element.find("#statusselect"),b=this.element.find("#ownerid");
  a.select2({width:"50%",minimumResultsForSearch:1/0}),b.select2({width:"50%",minimumResultsForSearch:1/0})}})}(jQuery),function(a,b){"use strict";a.widget("bolt.fieldRelationship",a.bolt.baseField,{_create:function(){var c=this.element.find("select");c.select2({width:"100%",placeholder:{id:"",text:b.data("field.relationship.text.placeholder")},allowClear:!0,templateSelection:function(b){var c=a(b.element).parent().attr("label");return(c?c+": ":"")+b.text}})}})}(jQuery,Bolt),function(a,b,c){"use strict";a.widget("bolt.fieldRepeater",a.bolt.baseField,{options:{minimum:1,maximum:1,name:""},_create:function(){var b=this;for(this._ui={add:b.element.find(".add-button"),slot:b.element.find(".repeater-slot")},this._template=a(b.element.find('script[type="text/template"]').html()),this._count=b._ui.slot.find("div.repeater-group").length,0===b.options.maximum&&(b.options.maximum=1/0),b._setCount(),b._ui.add.on("click",function(){b._append()}),b.element.on("click",".duplicate-button",function(){var c=a(this).closest(".repeater-group"),d=b._clone(b._template);a(c).find(":input").each(function(b){var c=a(this).val();c&&a(d).find(":input").eq(b).val(c)}),c.after(d),b._setCount(1),b._renumber()}),b.element.on("click",".delete-button",function(){var c=a(this).closest(".repeater-group");c.remove(),b._setCount(-1),b._renumber()}),b.element.on("click",".move-up",function(){var c=a(this).closest(".repeater-group");c.insertBefore(c.prev(".repeater-group")),b._renumber(),b._resetEditors(c)}),b.element.on("click",".move-down",function(){var c=a(this).closest(".repeater-group");c.insertAfter(c.next(".repeater-group")),b._renumber(),b._resetEditors(c)});b._count<b.options.minimum;)b._append()},_append:function(){var a=this._clone(this._template);this._ui.slot.append(a),this._setCount(1),this._renumber(),b.datetime.init(),b.ckeditor.init()},_clone:function(c){var d=a(c).clone();return d.find("[id]").each(function(){var c=a(this).attr("id"),e=b.app.buid();a(this).attr("id",e),d.find('[for="'+c+'"]').each(function(){a(this).attr("for",e)})}),b.app.initWidgets(d),d},_renumber:function(){var b=this.options.name,c=b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp("^"+c+"\\[(#|\\d)\\]");this._ui.slot.find("div.repeater-group").each(function(c,e){a(e).find("[name]").each(function(){this.name=this.name.replace(d,b+"["+c+"]")}),a(e).is(":first-of-type")?a(e).find(".move-up").addClass("disabled"):a(e).find(".move-up").removeClass("disabled"),a(e).is(":last-of-type")?a(e).find(".move-down").addClass("disabled"):a(e).find(".move-down").removeClass("disabled")})},_resetEditors:function(a){var b=a.find(".ckeditor");b.each(function(a,b){c.instances[b.id].destroy(),c.replace(b.id)})},_setCount:function(a){this._count+=a||0,this._count>=this.options.maximum?(this._ui.add.addClass("disabled"),this.element.find(".duplicate-button").addClass("disabled")):(this._ui.add.removeClass("disabled"),this.element.find(".duplicate-button").removeClass("disabled")),this._count<=this.options.minimum?this.element.find(".delete-button").addClass("disabled"):this.element.find(".delete-button").removeClass("disabled")}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(a,b){"use strict";a.widget("bolt.fieldSelect",a.bolt.baseField,{options:{autocomplete:!1},_create:function(){var a=this.element.find("select");a.select2({width:"100%",placeholder:{id:"",text:b.data("field.select.text.placeholder")},allowClear:!0,minimumResultsForSearch:this.options.autocomplete?0:1/0})}})}(jQuery,Bolt),function(a,b){"use strict";var c={lock:1,link:2,edit:3};a.widget("bolt.fieldSlug",a.bolt.baseField,{options:{contentId:null,key:"",slug:"",uses:[]},_create:function(){var b=this,d=this.element;this._ui={form:this.element.closest("form"),group:d.find(".input-group"),data:d.find("input"),uses:a()},a("[name]",b._ui.form).each(function(){b.options.uses.indexOf(this.name.replace(/\[\]$/,""))>=0&&(b._ui.uses=b._ui.uses.add(a(this)))}),this._timeout=0,this._mode=c.lock,this._ui.group.hasClass("linked")?this._setMode(c.link):this._ui.group.hasClass("editable")&&(this._mode=c.edit),this._on({"click li.lock":function(a){a.preventDefault(),this._setMode(c.lock)},"click li.link":function(a){a.preventDefault(),this._setMode(c.link)},"click li.edit":function(a){a.preventDefault(),this._setMode(c.edit),this.element.find("input").focus()},"focusout input":function(){this._mode===c.edit&&this._setMode(c.lock)}})},_destroy:function(){clearTimeout(this._timeout)},_setMode:function(b){var d=b===c.lock,e=b===c.link,f=b===c.edit;a("li.lock",this.element).toggleClass("disabled",d),a("li.link",this.element).toggleClass("disabled",e),a("li.edit",this.element).toggleClass("disabled",f),this._ui.group.toggleClass("locked",d).toggleClass("linked",e).toggleClass("edititable",f),a(".warning",this.element).toggleClass("hidden",!f),this._ui.data.prop("readonly",!f),e?(this._buildSlug(),this._on(this._ui.uses,{change:function(){this._buildSlug()},input:function(){this._buildSlug()}})):this._timeout>0&&(clearTimeout(this._timeout),this._timeout=0,this._off(this._ui.uses,"change"),this._off(this._ui.uses,"input")),this._mode=b},_buildSlug:function(){var b,c=this,d="";a.each(c._ui.uses,function(c,e){b=a(e).val(),b&&(d+=("object"==typeof b?b.join(" "):b)+" ")}),clearTimeout(c._timeout),c._timeout=setTimeout(function(){c._getUri(d.trim())},200)},_getUri:function(d){var e=this,f={title:d,contenttypeslug:e.options.slug,id:e.options.contentId,slugfield:e.options.key,fulluri:!1};e._ui.group.addClass("loading"),a.get(b.conf("paths.async")+"makeuri",f).done(function(a){e._mode===c.link&&e._ui.data.val(a)}).fail(function(){console.log("failed to get an URI")}).always(function(){e._ui.group.removeClass("loading")})}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldTags",a.bolt.baseField,{options:{slug:"",allowSpaces:!1},_create:function(){var c=this.element.find("select"),d=this.element.find(".tagcloud"),e=this.options.slug,f=[","],g={};this.options.allowSpaces||f.push(" "),c.select2({width:"100%",tags:g,minimumInputLength:1,tokenSeparators:f}),a.ajax({url:b.conf("paths.root")+"async/tags/"+e,dataType:"json",success:function(b){var d=c.val()||[];a.each(b,function(b,e){d.indexOf(e.name)<0&&(d.push(e.name),c.append(a("<option/>",{value:e.name,text:e.name})).trigger("change"))})}}),d&&a.ajax({url:b.conf("paths.root")+"async/populartags/"+e,dataType:"json",data:{limit:40},success:function(b){b.length>0&&(a.each(b,function(b,c){d.append(a("<button/>",{type:"button",text:c.name,rel:c.count})).append("")}),d.find("button").on("click",function(){var b=a(this).text(),d=c.find('option[value="'+b+'"]');d.length>0?d=d.not(":selected").attr("selected",!0).trigger("change"):c.append(a("<option/>",{value:b,text:b,selected:!0})).trigger("change")}),a.fn.tagcloud.defaults={size:{start:10,end:20,unit:"px"},color:{start:"#888",end:"#194770"}},d.find("button").tagcloud(),d.css("display","block"))}})}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.fieldTemplateselect",a.bolt.baseField,{options:{currentHas:!1,current:"",fieldTemplates:[]},_create:function(){var c=this,d=c.element.find("select"),e=c.element.find("p"),f=e.parent();d.select2({width:"100%",allowClear:!0,placeholder:{id:"",text:b.data("field.templateselect.text.default")},minimumResultsForSearch:1/0}),d.on("change",function(){if(f.addClass("hidden"),e.html("").removeClass("text-danger"),d.val()!==c.options.current)if(c.options.currentHas){e.html(b.data("field.templateselect.template.warning",{"%STATUS%":b.data("field.templateselect.message.status"),"%MESSAGE%":b.data("field.templateselect.message.warning")}));var g=!0;a('[name^="templatefields"]').each(function(){"checkbox"!==a(this).attr("type")&&"SELECT"!==a(this).prop("tagName")&&""!==a(this).val()&&(g=!1),"checkbox"===a(this).attr("type")&&a(this).prop("checked")&&(g=!1)}),g?a("#tabindicator-tab-template").hide():(e.addClass("text-danger"),f.removeClass("hidden"))}else c.options.fieldTemplates.indexOf(d.val())>-1&&(e.html(b.data("field.templateselect.message.change")),f.removeClass("hidden"),a("#tabindicator-tab-template").show())})}})}(jQuery,Bolt),function(a){"use strict";a.widget("bolt.fieldText",a.bolt.baseField,{_create:function(){}})}(jQuery),function(a){"use strict";a.widget("bolt.fieldTextarea",a.bolt.baseField,{_create:function(){}})}(jQuery),function(a,b){"use strict";a.widget("bolt.fieldVideo",a.bolt.baseField,{_create:function(){var b=this,c=this.element,d=0;this._ui={url:c.find("input.url"),width:c.find("input.width"),height:c.find("input.height"),html:c.find("input.html"),ratio:c.find("input.ratio"),authorName:c.find("input.authorname"),authorUrl:c.find("input.authorurl"),title:c.find("input.title"),thumbnailUrl:c.find("input.thumbnailurl"),preview:c.find("img"),play:c.find(".imageholder button"),refresh:c.find("button.refresh"),spinner:c.find("button.refresh i")},b._ui.url.on("propertychange input",function(){clearTimeout(d),d=setTimeout(function(){b._update()},1e3)}),b._ui.width.on("propertychange input",function(){b._ui.ratio.val()>0&&b._ui.height.val(Math.round(b._ui.width.val()/b._ui.ratio.val()))}),b._ui.height.on("propertychange input",function(){b._ui.ratio.val()>0&&b._ui.width.val(Math.round(b._ui.height.val()*b._ui.ratio.val()))}),b._ui.refresh.on("click",function(){b._update()}),b._ui.play.on("click",function(){a("body").buicModal({size:"large",closer:!0,headline:b._ui.title.val(),body:b._ui.html.val()})})},_update:function(){var b=this,c="https://api.embed.ly/1/oembed",d={format:"json",key:"51fa004148ad4d05b115940be9dd3c7e",url:b._ui.url.val()};d.url.length<2?b._set({}):(this._ui.refresh.prop("disabled",!0),b._ui.spinner.addClass("fa-spin"),a.getJSON(c,d).done(function(a){b._set(a)}).fail(function(){b._set({})}).always(function(){b._ui.spinner.removeClass("fa-spin")}))},_set:function(a){var c=a.thumbnail_url||b.conf("paths.app")+"view/img/default_empty_4x3.png";this._ui.html.val(a.html||""),this._ui.width.val(a.width||""),this._ui.height.val(a.height||""),this._ui.ratio.val(a.width&&a.height?a.width/a.height:""),this._ui.authorName.val(a.author_name||""),this._ui.authorUrl.val(a.author_url||""),this._ui.title.val(a.title||""),this._ui.thumbnailUrl.val(a.thumbnail_url||""),this._ui.preview.attr("src",c),a.html?this._ui.play.removeClass("hidden"):this._ui.play.addClass("hidden"),this._ui.refresh.prop("disabled",this._ui.url.val().length<=2||this._ui.html.val().length>0)}})}(jQuery,Bolt),function(a,b){"use strict";a.widget("bolt.panelActivity",a.bolt.baseInterval,{options:{delay:3e4,url:""},_create:function(){this.options.url||(this.options.url=b.conf("paths.async")+"latestactivity"),this._super()},_update:function(){var c=this;a.get(c.options.url).done(function(d){var e=a(d);b.app.initWidgets(e),c.element.html(e)})}})}(jQuery,Bolt),Bolt.validation=function(){function a(a){var b=!0,c=a.value,d=a.getAttribute("type"),e="checkbox"===d||"radio"===d,f=a.getAttribute("required"),g=a.getAttribute("minlength"),h=a.getAttribute("maxlength"),i=a.getAttribute("pattern");return a.disabled?b:(b=b&&(!f||e&&a.checked||!e&&""!==c),b=b&&(e||(!g||c.length>=g)&&(!h||c.length<=h)),b&&i&&(i=new RegExp("^(?:"+i+")$"),b=i.test(c)),b)}function b(a,b){$(a).addClass("error"),b&&$("#cke_"+a.id).addClass("cke_error")}function c(a,b){$(a).removeClass("error"),b&&$("#cke_"+a.id).removeClass("cke_error")}function d(a,b,c){var d;d=Bolt.data("validation.alertbox",{"%NOTICE_ID%":a,"%FIELD_ID%":b.id,"%FIELD_NAME%":$('label[for="'+b.id+'"]').contents().first().text().trim()||b.name,"%MESSAGE%":c||$(b).data("errortext")||Bolt.data("validation.generic_msg")}),$(d).hide().insertAfter(".page-header").slideDown("fast")}function e(a){return""===a||a.match(/^[-+]?[0-9]*[,.]?[0-9]+([eE][-+]?[0-9]+)?$/)?"":Bolt.data("validation.float")}function f(a,b){return b===!0&&""===a?Bolt.data("validation.required"):""}function g(a,b){return""!==a&&Number(a.replace(",","."))<b?Bolt.data("validation.min",{"%MINVAL%":b}):""}function h(a,b){return""!==a&&Number(a.replace(",","."))>b?Bolt.data("validation.max",{"%MAXVAL%":b}):""}function i(a,b){"undefined"!=typeof a.willValidate?a.setCustomValidity(b):a.validity.valid=""===b}function j(j){var k,l,m,n="undefined"!=typeof j.willValidate,o=j.value,p="",q=$(j).data("validate");if(q){for(l in q)if(q.hasOwnProperty(l)){switch(m=q[l],l){case"float":p=e(o);break;case"required":p=f(o,m);break;case"min":p=g(o,m);break;case"max":p=h(o,m);break;default:console.log("UNKNOWN VALIDATION"+l+" -> "+m)}if(p)break}i(j,p)}else if(n?("INPUT"===j.nodeName&&j.type!==j.getAttribute("type")&&j.setCustomValidity(a(j)?"":"error"),j.checkValidity()):(j.validity=j.validity||{},j.validity.valid=a(j)),k="TEXTAREA"===j.nodeName&&$(j).hasClass("ckeditor")){var r,s=CKEDITOR.instances[j.id];s&&(r=s._.required===!0&&""===s.getData().trim(),i(j,r?"Required":""))}var t="notice--"+j.id;return $("#"+t).remove(),j.validity.valid?(c(j,k),!0):(b(j,k),d(t,j,p),!1)}return{run:function(a){var b,c,d=a.elements.length,e=!0;for(b=0;b<d;b++)c=a.elements[b],"INPUT"!==c.nodeName&&"TEXTAREA"!==c.nodeName&&"SELECT"!==c.nodeName||("INPUT"===c.nodeName&&(c.value=c.value.trim()),j(c)===!1&&(e=!1));return e}}}();