BUG Fix routing tests

BUG Fix issue with top level routes without trailing slashes
This commit is contained in:
Damian Mooyman 2016-04-22 11:16:48 +12:00
parent 3ef35778cb
commit fa8075367d
7 changed files with 32 additions and 32 deletions

View File

@ -184,7 +184,7 @@
_router2.default.base(basePath);
_config2.default.getTopLevelRoutes().forEach(function (route) {
(0, _router2.default)('/' + route + '*', function (ctx, next) {
(0, _router2.default)('/' + route + '(/*?)?', function (ctx, next) {
if (document.readyState !== 'complete') {
return next();
}

View File

@ -1,4 +1,4 @@
!function e(t,n,i){function s(o,r){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!r&&l)return l(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return s(n?n:e)},c,c.exports,e,t,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)s(i[o]);return s}({1:[function(e,t,n){"use strict";e("../legacy/LeftAndMain.Layout.js"),e("../legacy/LeftAndMain.js"),e("../legacy/LeftAndMain.ActionTabSet.js"),e("../legacy/LeftAndMain.Panel.js"),e("../legacy/LeftAndMain.Tree.js"),e("../legacy/LeftAndMain.Content.js"),e("../legacy/LeftAndMain.EditForm.js"),e("../legacy/LeftAndMain.Menu.js"),e("../legacy/LeftAndMain.Preview.js"),e("../legacy/LeftAndMain.BatchActions.js"),e("../legacy/LeftAndMain.FieldHelp.js"),e("../legacy/LeftAndMain.FieldDescriptionToggle.js"),e("../legacy/LeftAndMain.TreeDropdownField.js")},{"../legacy/LeftAndMain.ActionTabSet.js":2,"../legacy/LeftAndMain.BatchActions.js":3,"../legacy/LeftAndMain.Content.js":4,"../legacy/LeftAndMain.EditForm.js":5,"../legacy/LeftAndMain.FieldDescriptionToggle.js":6,"../legacy/LeftAndMain.FieldHelp.js":7,"../legacy/LeftAndMain.Layout.js":8,"../legacy/LeftAndMain.Menu.js":9,"../legacy/LeftAndMain.Panel.js":10,"../legacy/LeftAndMain.Preview.js":11,"../legacy/LeftAndMain.Tree.js":12,"../legacy/LeftAndMain.TreeDropdownField.js":13,"../legacy/LeftAndMain.js":14}],2:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".ss-tabset.ss-ui-action-tabset").entwine({IgnoreTabState:!0,onadd:function(){this._super(),this.tabs({collapsible:!0,active:!1})},onremove:function(){var t=e(".cms-container").find("iframe");t.each(function(t,n){try{e(n).contents().off("click.ss-ui-action-tabset")}catch(i){console.warn("Unable to access iframe, possible https mis-match")}}),e(document).off("click.ss-ui-action-tabset"),this._super()},ontabsbeforeactivate:function(e,t){this.riseUp(e,t)},onclick:function(e,t){this.attachCloseHandler(e,t)},attachCloseHandler:function(t,n){var i,s=this,a=e(".cms-container").find("iframe");i=function(t){var n,a;n=e(t.target).closest(".ss-ui-action-tabset .ui-tabs-panel"),e(t.target).closest(s).length||n.length||(s.tabs("option","active",!1),a=e(".cms-container").find("iframe"),a.each(function(t,n){e(n).contents().off("click.ss-ui-action-tabset",i)}),e(document).off("click.ss-ui-action-tabset",i))},e(document).on("click.ss-ui-action-tabset",i),a.length>0&&a.each(function(t,n){e(n).contents().on("click.ss-ui-action-tabset",i)})},riseUp:function(t,n){var i,s,a,o,r,l,d,c,u;return i=e(this).find(".ui-tabs-panel").outerHeight(),s=e(this).find(".ui-tabs-nav").outerHeight(),a=e(window).height()+e(document).scrollTop()-s,o=e(this).find(".ui-tabs-nav").offset().top,r=n.newPanel,l=n.newTab,o+i>=a&&o-i>0?(this.addClass("rise-up"),null!==l.position()&&(d=-r.outerHeight(),c=r.parents(".south"),c&&(u=l.offset().top-c.offset().top,d-=u),e(r).css("top",d+"px"))):(this.removeClass("rise-up"),null!==l.position()&&e(r).css("top","0px")),!1}}),e(".cms-content-actions .ss-tabset.ss-ui-action-tabset").entwine({ontabsbeforeactivate:function(t,n){this._super(t,n),e(n.newPanel).length>0&&e(n.newPanel).css("left",n.newTab.position().left+"px")}}),e(".cms-actions-row.ss-tabset.ss-ui-action-tabset").entwine({ontabsbeforeactivate:function(t,n){this._super(t,n),e(this).closest(".ss-ui-action-tabset").removeClass("tabset-open tabset-open-last")}}),e(".cms-content-fields .ss-tabset.ss-ui-action-tabset").entwine({ontabsbeforeactivate:function(t,n){this._super(t,n),e(n.newPanel).length>0&&(e(n.newTab).hasClass("last")?(e(n.newPanel).css({left:"auto",right:"0px"}),e(n.newPanel).parent().addClass("tabset-open-last")):(e(n.newPanel).css("left",n.newTab.position().left+"px"),e(n.newTab).hasClass("first")&&(e(n.newPanel).css("left","0px"),e(n.newPanel).parent().addClass("tabset-open"))))}}),e(".cms-tree-view-sidebar .cms-actions-row.ss-tabset.ss-ui-action-tabset").entwine({"from .ui-tabs-nav li":{onhover:function(t){e(t.target).parent().find("li .active").removeClass("active"),e(t.target).find("a").addClass("active")}},ontabsbeforeactivate:function(t,n){this._super(t,n),e(n.newPanel).css({left:"auto",right:"auto"}),e(n.newPanel).length>0&&e(n.newPanel).parent().addClass("tabset-open")}})})},{jQuery:"jQuery"}],3:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s),o=e("i18n"),r=i(o);a["default"].entwine("ss.tree",function(e){e("#Form_BatchActionsForm").entwine({Actions:[],getTree:function(){return e(".cms-tree")},fromTree:{oncheck_node:function(e,t){this.serializeFromTree()},onuncheck_node:function(e,t){this.serializeFromTree()}},registerDefault:function(){this.register("admin/pages/batchactions/publish",function(e){var t=confirm(r["default"].inject(r["default"]._t("CMSMAIN.BATCH_PUBLISH_PROMPT","You have {num} page(s) selected.\n\nDo you really want to publish?"),{num:e.length}));return t?e:!1}),this.register("admin/pages/batchactions/unpublish",function(e){var t=confirm(r["default"].inject(r["default"]._t("CMSMAIN.BATCH_UNPUBLISH_PROMPT","You have {num} page(s) selected.\n\nDo you really want to unpublish"),{num:e.length}));return t?e:!1}),this.register("admin/pages/batchactions/delete",function(e){var t=confirm(r["default"].inject(r["default"]._t("CMSMAIN.BATCH_DELETE_PROMPT","You have {num} page(s) selected.\n\nDo you really want to delete?"),{num:e.length}));return t?e:!1}),this.register("admin/pages/batchactions/archive",function(e){var t=confirm(r["default"].inject(r["default"]._t("CMSMAIN.BATCH_ARCHIVE_PROMPT","You have {num} page(s) selected.\n\nAre you sure you want to archive these pages?\n\nThese pages and all of their children pages will be unpublished and sent to the archive."),{num:e.length}));return t?e:!1}),this.register("admin/pages/batchactions/restore",function(e){var t=confirm(r["default"].inject(r["default"]._t("CMSMAIN.BATCH_RESTORE_PROMPT","You have {num} page(s) selected.\n\nDo you really want to restore to stage?\n\nChildren of archived pages will be restored to the root level, unless those pages are also being restored."),{num:e.length}));return t?e:!1}),this.register("admin/pages/batchactions/deletefromlive",function(e){var t=confirm(r["default"].inject(r["default"]._t("CMSMAIN.BATCH_DELETELIVE_PROMPT","You have {num} page(s) selected.\n\nDo you really want to delete these pages from live?"),{num:e.length}));return t?e:!1})},onadd:function(){this.registerDefault(),this._super()},register:function(e,t){this.trigger("register",{type:e,callback:t});var n=this.getActions();n[e]=t,this.setActions(n)},unregister:function(e){this.trigger("unregister",{type:e});var t=this.getActions();t[e]&&delete t[e],this.setActions(t)},refreshSelected:function(t){var n=this,i=this.getTree(),s=this.getIDs(),a=[],o=e(".cms-content-batchactions-button"),r=this.find(":input[name=Action]").val();null==t&&(t=i);for(var l in s)e(e(i).getNodeByID(l)).addClass("selected").attr("selected","selected");if(!r||-1==r||!o.hasClass("active"))return void e(t).find("li").each(function(){e(this).setEnabled(!0)});e(t).find("li").each(function(){a.push(e(this).data("id")),e(this).addClass("treeloading").setEnabled(!1)});var d=e.path.parseUrl(r),c=d.hrefNoSearch+"/applicablepages/";c=e.path.addSearchParams(c,d.search),c=e.path.addSearchParams(c,{csvIDs:a.join(",")}),jQuery.getJSON(c,function(i){jQuery(t).find("li").each(function(){e(this).removeClass("treeloading");var t=e(this).data("id");0==t||e.inArray(t,i)>=0?e(this).setEnabled(!0):(e(this).removeClass("selected").setEnabled(!1),e(this).prop("selected",!1))}),n.serializeFromTree()})},serializeFromTree:function(){var e=this.getTree(),t=e.getSelectedIDs();return this.setIDs(t),!0},setIDs:function(e){this.find(":input[name=csvIDs]").val(e?e.join(","):null)},getIDs:function(){var e=this.find(":input[name=csvIDs]").val();return e?e.split(","):[]},onsubmit:function(t){var n=this,i=this.getIDs(),s=this.getTree(),a=this.getActions();if(!i||!i.length)return alert(r["default"]._t("CMSMAIN.SELECTONEPAGE","Please select at least one page")),t.preventDefault(),!1;var o=this.find(":input[name=Action]").val();if(a[o]&&(i=this.getActions()[o].apply(this,[i])),!i||!i.length)return t.preventDefault(),!1;this.setIDs(i),s.find("li").removeClass("failed");var l=this.find(":submit:first");return l.addClass("loading"),jQuery.ajax({url:o,type:"POST",data:this.serializeArray(),complete:function(e,t){l.removeClass("loading"),s.jstree("refresh",-1),n.setIDs([]),n.find(":input[name=Action]").val("").change();var i=e.getResponseHeader("X-Status");i&&statusMessage(decodeURIComponent(i),"success"==t?"good":"bad")},success:function(t,n){var i,a;if(t.modified){var o=[];for(i in t.modified)a=s.getNodeByID(i),s.jstree("set_text",a,t.modified[i].TreeTitle),o.push(a);e(o).effect("highlight")}if(t.deleted)for(i in t.deleted)a=s.getNodeByID(i),a.length&&s.jstree("delete_node",a);if(t.error)for(i in t.error)a=s.getNodeByID(i),e(a).addClass("failed")},dataType:"json"}),t.preventDefault(),!1}}),e(".cms-content-batchactions-button").entwine({onmatch:function(){this._super(),this.updateTree()},onunmatch:function(){this._super()},onclick:function(e){this.updateTree()},updateTree:function(){var t=e(".cms-tree"),n=e("#Form_BatchActionsForm");this._super(),this.data("active")?(t.addClass("multiple"),t.removeClass("draggable"),n.serializeFromTree()):(t.removeClass("multiple"),t.addClass("draggable")),e("#Form_BatchActionsForm").refreshSelected()}}),e("#Form_BatchActionsForm select[name=Action]").entwine({onchange:function(t){var n=e(t.target.form),i=n.find(":submit"),s=e(t.target).val();s&&-1!=s?i.removeAttr("disabled").button("refresh"):i.attr("disabled","disabled").button("refresh"),e("#Form_BatchActionsForm").refreshSelected(),this.trigger("chosen:updated"),this._super(t)}})})},{i18n:"i18n",jQuery:"jQuery"}],4:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".cms-content").entwine({onadd:function(){this.find(".cms-tabset").redrawTabs(),this._super()},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.add(this.find(".cms-tabset")).redrawTabs(),this.find(".cms-content-header").redraw(),this.find(".cms-content-actions").redraw()}}),e(".cms-content .cms-tree").entwine({onadd:function(){var t=this;this._super(),this.bind("select_node.jstree",function(n,i){var s=i.rslt.obj,a=t.find(":input[name=ID]").val(),o=i.args[2],r=e(".cms-container");if(!o)return!1;if(e(s).hasClass("disabled"))return!1;if(e(s).data("id")!=a){var l=e(s).find("a:first").attr("href");l&&"#"!=l?(l=l.split("?")[0],t.jstree("deselect_all"),t.jstree("uncheck_all"),e.path.isExternal(e(s).find("a:first"))&&(l=l=e.path.makeUrlAbsolute(l,e("base").attr("href"))),document.location.search&&(l=e.path.addSearchParams(l,document.location.search.replace(/^\?/,""))),r.loadPanel(l)):t.removeForm()}})}}),e(".cms-content .cms-content-fields").entwine({redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0))}}),e(".cms-content .cms-content-header, .cms-content .cms-content-actions").entwine({redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.height("auto"),this.height(this.innerHeight()-this.css("padding-top")-this.css("padding-bottom"))}})})},{jQuery:"jQuery"}],5:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s),o=e("i18n"),r=i(o);window.onbeforeunload=function(e){var t=(0,a["default"])(".cms-edit-form");return t.trigger("beforesubmitform"),t.is(".changed")&&!t.is(".discardchanges")?r["default"]._t("LeftAndMain.CONFIRMUNSAVEDSHORT"):void 0},a["default"].entwine("ss",function(e){e(".cms-edit-form").entwine({PlaceholderHtml:"",ChangeTrackerOptions:{ignoreFieldSelector:".no-change-track, .ss-upload :input, .cms-navigator :input"},onadd:function(){this.attr("autocomplete","off"),this._setupChangeTracker();for(var t in{action:!0,method:!0,enctype:!0,name:!0}){var n=this.find(":input[name=_form_"+t+"]");n&&(this.attr(t,n.val()),n.remove())}if(this.hasClass("validationerror")){var i=this.find(".message.validation, .message.required").first().closest(".tab");e(".cms-container").clearCurrentTabState(),i.closest(".ss-tabset").tabs("option","active",i.index(".tab"))}this._super()},onremove:function(){this.changetracker("destroy"),this._super()},onmatch:function(){this._super()},onunmatch:function(){this._super()},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.add(this.find(".cms-tabset")).redrawTabs(),this.find(".cms-content-header").redraw()},_setupChangeTracker:function(){this.changetracker(this.getChangeTrackerOptions())},confirmUnsavedChanges:function(){if(this.trigger("beforesubmitform"),!this.is(".changed")||this.is(".discardchanges"))return!0;var e=confirm(r["default"]._t("LeftAndMain.CONFIRMUNSAVED"));return e&&this.addClass("discardchanges"),e},onsubmit:function(e,t){return"_blank"!=this.prop("target")?(t&&this.closest(".cms-container").submitForm(this,t),!1):void 0},validate:function(){var e=!0;return this.trigger("validate",{isValid:e}),e},"from .htmleditor":{oneditorinit:function(t){var n=this,i=e(t.target).closest(".field.htmleditor"),s=i.find("textarea.htmleditor").getEditor().getInstance();s.onClick.add(function(e){n.saveFieldFocus(i.attr("id"))})}},"from .cms-edit-form :input:not(:submit)":{onclick:function(t){this.saveFieldFocus(e(t.target).attr("id"))},onfocus:function(t){this.saveFieldFocus(e(t.target).attr("id"))}},"from .cms-edit-form .treedropdown *":{onfocusin:function(t){var n=e(t.target).closest(".field.treedropdown");this.saveFieldFocus(n.attr("id"))}},"from .cms-edit-form .dropdown .chosen-container a":{onfocusin:function(t){var n=e(t.target).closest(".field.dropdown");this.saveFieldFocus(n.attr("id"))}},"from .cms-container":{ontabstaterestored:function(e){this.restoreFieldFocus()}},saveFieldFocus:function(t){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){var n=e(this).attr("id"),i=[];if(i.push({id:n,selected:t}),i)try{window.sessionStorage.setItem(n,JSON.stringify(i))}catch(s){if(s.code===DOMException.QUOTA_EXCEEDED_ERR&&0===window.sessionStorage.length)return;throw s}}},restoreFieldFocus:function(){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){var t,n,i,s,a,o=this,r="undefined"!=typeof window.sessionStorage&&window.sessionStorage,l=r?window.sessionStorage.getItem(this.attr("id")):null,d=l?JSON.parse(l):!1,c=0!==this.find(".ss-tabset").length;if(r&&d.length>0){if(e.each(d,function(n,i){o.is("#"+i.id)&&(t=e("#"+i.selected))}),e(t).length<1)return void this.focusFirstInput();if(n=e(t).closest(".ss-tabset").find(".ui-tabs-nav .ui-tabs-active .ui-tabs-anchor").attr("id"),i="tab-"+e(t).closest(".ss-tabset .ui-tabs-panel").attr("id"),c&&i!==n)return;s=e(t).closest(".togglecomposite"),s.length>0&&s.accordion("activate",s.find(".ui-accordion-header")),a=e(t).position().top,e(t).is(":visible")||(t="#"+e(t).closest(".field").attr("id"),a=e(t).position().top),e(t).focus(),a>e(window).height()/2&&o.find(".cms-content-fields").scrollTop(a)}else this.focusFirstInput()}},focusFirstInput:function(){this.find(':input:not(:submit)[data-skip-autofocus!="true"]').filter(":visible:first").focus()}}),e(".cms-edit-form .Actions input.action[type=submit], .cms-edit-form .Actions button.action").entwine({onclick:function(e){return this.hasClass("gridfield-button-delete")&&!confirm(r["default"]._t("TABLEFIELD.DELETECONFIRMMESSAGE"))?(e.preventDefault(),!1):(this.is(":disabled")||this.parents("form").trigger("submit",[this]),e.preventDefault(),!1)}}),e(".cms-edit-form .Actions input.action[type=submit].ss-ui-action-cancel, .cms-edit-form .Actions button.action.ss-ui-action-cancel").entwine({onclick:function(e){window.history.length>1?window.history.back():this.parents("form").trigger("submit",[this]),e.preventDefault()}}),e(".cms-edit-form .ss-tabset").entwine({onmatch:function(){if(!this.hasClass("ss-ui-action-tabset")){var e=this.find("> ul:first");1==e.children("li").length&&e.hide().parent().addClass("ss-tabset-tabshidden")}this._super()},onunmatch:function(){this._super()}})})},{i18n:"i18n",jQuery:"jQuery"}],6:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".cms-description-toggle").entwine({onadd:function(){var e=!1,t=this.prop("id").substr(0,this.prop("id").indexOf("_Holder")),n=this.find(".cms-description-trigger"),i=this.find(".description");this.hasClass("description-toggle-enabled")||(0===n.length&&(n=this.find(".middleColumn").first().after('<label class="right" for="'+t+'"><a class="cms-description-trigger" href="javascript:void(0)"><span class="btn-icon-information"></span></a></label>').next()),this.addClass("description-toggle-enabled"),n.on("click",function(){i[e?"hide":"show"](),e=!e}),i.hide())}})})},{jQuery:"jQuery"}],7:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".cms .field.cms-description-tooltip").entwine({onmatch:function(){this._super();var e=this.find(".description");e.length&&(this.attr("title",e.text()).tooltip({content:e.html()}),e.remove())}}),e(".cms .field.cms-description-tooltip :input").entwine({onfocusin:function(e){this.closest(".field").tooltip("open")},onfocusout:function(e){this.closest(".field").tooltip("close")}})})},{jQuery:"jQuery"}],8:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].fn.layout.defaults.resize=!1,jLayout="undefined"==typeof jLayout?{}:jLayout,jLayout.threeColumnCompressor=function(e,t){function n(e){var t=e+"Size";return function(e){var n=s[t](),i=o[t](),a=r[t](),l=e.insets();return width=n.width+i.width+a.width,height=Math.max(n.height,i.height,a.height),{width:l.left+l.right+width,height:l.top+l.bottom+height}}}if("undefined"==typeof e.menu||"undefined"==typeof e.content||"undefined"==typeof e.preview)throw'Spec is invalid. Please provide "menu", "content" and "preview" elements.';if("undefined"==typeof t.minContentWidth||"undefined"==typeof t.minPreviewWidth||"undefined"==typeof t.mode)throw'Spec is invalid. Please provide "minContentWidth", "minPreviewWidth", "mode"';if("split"!==t.mode&&"content"!==t.mode&&"preview"!==t.mode)throw'Spec is invalid. "mode" should be either "split", "content" or "preview"';var i={options:t},s=a["default"].jLayoutWrap(e.menu),o=a["default"].jLayoutWrap(e.content),r=a["default"].jLayoutWrap(e.preview);return i.layout=function(n){var i=n.bounds(),a=n.insets(),l=a.top,d=i.height-a.bottom,c=a.left,u=i.width-a.right,h=e.menu.width(),f=0,p=0;"preview"===this.options.mode?(f=0,p=u-c-h):"content"===this.options.mode?(f=u-c-h,p=0):(f=(u-c-h)/2,p=u-c-(h+f),f<this.options.minContentWidth?(f=this.options.minContentWidth,p=u-c-(h+f)):p<this.options.minPreviewWidth&&(p=this.options.minPreviewWidth,f=u-c-(h+p)),(f<this.options.minContentWidth||p<this.options.minPreviewWidth)&&(f=u-c-h,p=0));var m={content:e.content.hasClass("column-hidden"),preview:e.preview.hasClass("column-hidden")},g={content:0===f,preview:0===p};return e.content.toggleClass("column-hidden",g.content),e.preview.toggleClass("column-hidden",g.preview),s.bounds({x:c,y:l,height:d-l,width:h}),s.doLayout(),c+=h,o.bounds({x:c,y:l,height:d-l,width:f}),g.content||o.doLayout(),c+=f,r.bounds({x:c,y:l,height:d-l,width:p}),g.preview||r.doLayout(),g.content!==m.content&&e.content.trigger("columnvisibilitychanged"),g.preview!==m.preview&&e.preview.trigger("columnvisibilitychanged"),f+p<t.minContentWidth+t.minPreviewWidth?e.preview.trigger("disable"):e.preview.trigger("enable"),n},i.preferred=n("preferred"),i.minimum=n("minimum"),i.maximum=n("maximum"),i}},{jQuery:"jQuery"}],9:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".cms-panel.cms-menu").entwine({togglePanel:function(t,n,i){e(".cms-menu-list").children("li").each(function(){t?e(this).children("ul").each(function(){e(this).removeClass("collapsed-flyout"),e(this).data("collapse")&&(e(this).removeData("collapse"),e(this).addClass("collapse"))}):e(this).children("ul").each(function(){e(this).addClass("collapsed-flyout"),e(this).hasClass("collapse"),e(this).removeClass("collapse"),e(this).data("collapse",!0)})}),this.toggleFlyoutState(t),this._super(t,n,i)},toggleFlyoutState:function(t){if(t)e(".collapsed").find("li").show(),e(".cms-menu-list").find(".child-flyout-indicator").hide();else{e(".collapsed-flyout").find("li").each(function(){e(this).hide()});var n=e(".cms-menu-list ul.collapsed-flyout").parent();0===n.children(".child-flyout-indicator").length&&n.append('<span class="child-flyout-indicator"></span>').fadeIn(),n.children(".child-flyout-indicator").fadeIn()}},siteTreePresent:function(){return e("#cms-content-tools-CMSMain").length>0},getPersistedStickyState:function(){var t,n;return void 0!==e.cookie&&(n=e.cookie("cms-menu-sticky"),void 0!==n&&null!==n&&(t="true"===n)),t},setPersistedStickyState:function(t){void 0!==e.cookie&&e.cookie("cms-menu-sticky",t,{path:"/",expires:31})},getEvaluatedCollapsedState:function(){var t,n=this.getPersistedCollapsedState(),i=e(".cms-menu").getPersistedStickyState(),s=this.siteTreePresent();return t=void 0===n?s:n!==s&&i?n:s},onadd:function(){var t=this;setTimeout(function(){t.togglePanel(!t.getEvaluatedCollapsedState(),!1,!1)},0),e(window).on("ajaxComplete",function(e){setTimeout(function(){t.togglePanel(!t.getEvaluatedCollapsedState(),!1,!1)},0)}),this._super()}}),e(".cms-menu-list").entwine({onmatch:function(){this.find("li.current").select(),this.updateItems(),this._super()},onunmatch:function(){this._super()},updateMenuFromResponse:function(e){var t=e.getResponseHeader("X-Controller");if(t){var n=this.find("li#Menu-"+t.replace(/\\/g,"-").replace(/[^a-zA-Z0-9\-_:.]+/,""));n.hasClass("current")||n.select()}this.updateItems()},"from .cms-container":{onafterstatechange:function(e,t){this.updateMenuFromResponse(t.xhr)},onaftersubmitform:function(e,t){this.updateMenuFromResponse(t.xhr)}},"from .cms-edit-form":{onrelodeditform:function(e,t){this.updateMenuFromResponse(t.xmlhttp)}},getContainingPanel:function(){return this.closest(".cms-panel")},fromContainingPanel:{ontoggle:function(t){this.toggleClass("collapsed",e(t.target).hasClass("collapsed")),e(".cms-container").trigger("windowresize"),this.hasClass("collapsed")&&this.find("li.children.opened").removeClass("opened"),this.hasClass("collapsed")||e(".toggle-children.opened").closest("li").addClass("opened")}},updateItems:function(){var t=this.find("#Menu-CMSMain");t[t.is(".current")?"show":"hide"]();var n=e(".cms-content input[name=ID]").val();n&&this.find("li").each(function(){e.isFunction(e(this).setRecordID)&&e(this).setRecordID(n)})}}),e(".cms-menu-list li").entwine({toggleFlyout:function(t){var n=e(this);if(n.children("ul").first().hasClass("collapsed-flyout"))if(t){if(!n.children("ul").first().children("li").first().hasClass("clone")){var i=n.clone();i.addClass("clone").css({}),i.children("ul").first().remove(),i.find("span").not(".text").remove(),i.find("a").first().unbind("click"),n.children("ul").prepend(i)}e(".collapsed-flyout").show(),n.addClass("opened"),n.children("ul").find("li").fadeIn("fast")}else i&&i.remove(),e(".collapsed-flyout").hide(),n.removeClass("opened"),n.find("toggle-children").removeClass("opened"),n.children("ul").find("li").hide()}}),e(".cms-menu-list li").hoverIntent(function(){e(this).toggleFlyout(!0)},function(){e(this).toggleFlyout(!1)}),e(".cms-menu-list .toggle").entwine({onclick:function(t){t.preventDefault(),e(this).toogleFlyout(!0)}}),e(".cms-menu-list li").entwine({onmatch:function(){this.find("ul").length&&this.find("a:first").append('<span class="toggle-children"><span class="toggle-children-icon"></span></span>'),this._super()},onunmatch:function(){this._super()},toggle:function(){this[this.hasClass("opened")?"close":"open"]()},open:function(){var e=this.getMenuItem();e&&e.open(),this.find("li.clone")&&this.find("li.clone").remove(),this.addClass("opened").find("ul").show(),this.find(".toggle-children").addClass("opened")},close:function(){this.removeClass("opened").find("ul").hide(),this.find(".toggle-children").removeClass("opened")},select:function(){var e=this.getMenuItem();if(this.addClass("current").open(),this.siblings().removeClass("current").close(),this.siblings().find("li").removeClass("current"),e){var t=e.siblings();e.addClass("current"),t.removeClass("current").close(),t.find("li").removeClass("current").close()}this.getMenu().updateItems(),this.trigger("select")}}),e(".cms-menu-list *").entwine({getMenu:function(){return this.parents(".cms-menu-list:first")}}),e(".cms-menu-list li *").entwine({getMenuItem:function(){return this.parents("li:first")}}),e(".cms-menu-list li a").entwine({onclick:function(t){var n=e.path.isExternal(this.attr("href"));if(!(t.which>1||n)&&"_blank"!=this.attr("target")){t.preventDefault();var i=this.getMenuItem(),s=this.attr("href");n||(s=e("base").attr("href")+s);var a=i.find("li");if(a.length)a.first().find("a").click();else if(!e(".cms-container").loadPanel(s))return!1;i.select()}}}),e(".cms-menu-list li .toggle-children").entwine({onclick:function(e){var t=this.closest("li");return t.toggle(),!1}}),e(".cms .profile-link").entwine({onclick:function(){return e(".cms-container").loadPanel(this.attr("href")),e(".cms-menu-list li").removeClass("current").close(),!1}}),e(".cms-menu .sticky-toggle").entwine({onadd:function(){var t=!!e(".cms-menu").getPersistedStickyState();this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto")},onclick:function(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n;void 0===t?e.setPersistedCollapsedState(e.hasClass("collapsed")):void 0!==t&&i===!1&&e.clearPersistedCollapsedState(),e.setPersistedStickyState(i),this.toggleCSS(i),this.toggleIndicator(i),this._super()}})})},{jQuery:"jQuery"}],10:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e.entwine.warningLevel=e.entwine.WARN_LEVEL_BESTPRACTISE,e(".cms-panel").entwine({WidthExpanded:null,WidthCollapsed:null,canSetCookie:function(){return void 0!==e.cookie&&void 0!==this.attr("id")},getPersistedCollapsedState:function(){var t,n;return this.canSetCookie()&&(n=e.cookie("cms-panel-collapsed-"+this.attr("id")),void 0!==n&&null!==n&&(t="true"===n)),t},setPersistedCollapsedState:function(t){this.canSetCookie()&&e.cookie("cms-panel-collapsed-"+this.attr("id"),t,{path:"/",expires:31})},clearPersistedCollapsedState:function(){this.canSetCookie()&&e.cookie("cms-panel-collapsed-"+this.attr("id"),"",{path:"/",expires:-1})},getInitialCollapsedState:function(){var e=this.getPersistedCollapsedState();return void 0===e&&(e=this.hasClass("collapsed")),e},onadd:function(){var t,n;if(!this.find(".cms-panel-content").length)throw new Exception('Content panel for ".cms-panel" not found');this.find(".cms-panel-toggle").length||(n=e("<div class='cms-panel-toggle south'></div>").append('<a class="toggle-expand" href="#"><span>&raquo;</span></a>').append('<a class="toggle-collapse" href="#"><span>&laquo;</span></a>'),this.append(n)),this.setWidthExpanded(this.find(".cms-panel-content").innerWidth()),t=this.find(".cms-panel-content-collapsed"),this.setWidthCollapsed(t.length?t.innerWidth():this.find(".toggle-expand").innerWidth()),this.togglePanel(!this.getInitialCollapsedState(),!0,!1),this._super()},togglePanel:function(e,t,n){var i,s;t||(this.trigger("beforetoggle.sspanel",e),this.trigger(e?"beforeexpand":"beforecollapse")),this.toggleClass("collapsed",!e),i=e?this.getWidthExpanded():this.getWidthCollapsed(),this.width(i),s=this.find(".cms-panel-content-collapsed"),s.length&&(this.find(".cms-panel-content")[e?"show":"hide"](),this.find(".cms-panel-content-collapsed")[e?"hide":"show"]()),n!==!1&&this.setPersistedCollapsedState(!e),this.trigger("toggle",e),this.trigger(e?"expand":"collapse")},expandPanel:function(e){(e||this.hasClass("collapsed"))&&this.togglePanel(!0)},collapsePanel:function(e){!e&&this.hasClass("collapsed")||this.togglePanel(!1)}}),e(".cms-panel.collapsed .cms-panel-toggle").entwine({onclick:function(e){this.expandPanel(),e.preventDefault()}}),e(".cms-panel *").entwine({getPanel:function(){return this.parents(".cms-panel:first")}}),e(".cms-panel .toggle-expand").entwine({onclick:function(e){e.preventDefault(),e.stopPropagation(),this.getPanel().expandPanel(),this._super(e)}}),e(".cms-panel .toggle-collapse").entwine({onclick:function(e){e.preventDefault(),e.stopPropagation(),this.getPanel().collapsePanel(),this._super(e)}}),e(".cms-content-tools.collapsed").entwine({onclick:function(e){this.expandPanel(),this._super(e)}})})},{jQuery:"jQuery"}],11:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s),o=e("i18n"),r=i(o);a["default"].entwine("ss.preview",function(e){e(".cms-preview").entwine({AllowedStates:["StageLink","LiveLink","ArchiveLink"],CurrentStateName:null,CurrentSizeName:"auto",IsPreviewEnabled:!1,DefaultMode:"split",Sizes:{auto:{width:"100%",height:"100%"},mobile:{width:"335px",height:"568px"},mobileLandscape:{width:"583px",height:"320px"},tablet:{width:"783px",height:"1024px"},tabletLandscape:{width:"1039px",height:"768px"},desktop:{width:"1024px",height:"800px"}},changeState:function(t,n){var i=this,s=this._getNavigatorStates();return n!==!1&&e.each(s,function(e,n){i.saveState("state",t)}),this.setCurrentStateName(t),this._loadCurrentState(),this.redraw(),this},changeMode:function(t,n){var i=e(".cms-container");if("split"==t)i.entwine(".ss").splitViewMode(),this.setIsPreviewEnabled(!0),this._loadCurrentState();else if("content"==t)i.entwine(".ss").contentViewMode(),this.setIsPreviewEnabled(!1);else{if("preview"!=t)throw"Invalid mode: "+t;i.entwine(".ss").previewMode(),this.setIsPreviewEnabled(!0),this._loadCurrentState()}return n!==!1&&this.saveState("mode",t),this.redraw(),this},changeSize:function(e){var t=this.getSizes();return this.setCurrentSizeName(e),this.removeClass("auto desktop tablet mobile").addClass(e),this.find(".preview-device-outer").width(t[e].width).height(t[e].height),this.find(".preview-device-inner").width(t[e].width),this.saveState("size",e),this.redraw(),this},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0));var t=this.getCurrentStateName();t&&this.find(".cms-preview-states").changeVisibleState(t);var n=e(".cms-container").entwine(".ss").getLayoutOptions();n&&e(".preview-mode-selector").changeVisibleMode(n.mode);var i=this.getCurrentSizeName();return i&&this.find(".preview-size-selector").changeVisibleSize(this.getCurrentSizeName()),this},saveState:function(e,t){this._supportsLocalStorage()&&window.localStorage.setItem("cms-preview-state-"+e,t)},loadState:function(e){return this._supportsLocalStorage()?window.localStorage.getItem("cms-preview-state-"+e):void 0},disablePreview:function(){return this.setPendingURL(null),this._loadUrl("about:blank"),this._block(),this.changeMode("content",!1),this.setIsPreviewEnabled(!1),this},enablePreview:function(){return this.getIsPreviewEnabled()||(this.setIsPreviewEnabled(!0),e.browser.msie&&e.browser.version.slice(0,3)<=7?this.changeMode("content"):this.changeMode(this.getDefaultMode(),!1)),this},getOrAppendFontFixStyleElement:function(){var t=e("#FontFixStyleElement");return t.length||(t=e('<style type="text/css" id="FontFixStyleElement" disabled="disabled">:before,:after{content:none !important}</style>').appendTo("head")),
t},onadd:function(){var t=this,n=(this.parent(),this.find("iframe"));n.addClass("center"),n.bind("load",function(){t._adjustIframeForPreview(),t._loadCurrentPage(),e(this).removeClass("loading")}),e.browser.msie&&8===parseInt(e.browser.version,10)&&n.bind("readystatechange",function(e){"interactive"==n[0].readyState&&(t.getOrAppendFontFixStyleElement().removeAttr("disabled"),setTimeout(function(){t.getOrAppendFontFixStyleElement().attr("disabled","disabled")},0))}),this.append('<div class="cms-preview-overlay ui-widget-overlay-light"></div>'),this.find(".cms-preview-overlay").hide(),this.disablePreview(),this._super()},_supportsLocalStorage:function(){var e,t,n=new Date;try{return(e=window.localStorage).setItem(n,n),t=e.getItem(n)==n,e.removeItem(n),t&&e}catch(i){console.warn("localStorge is not available due to current browser / system settings.")}},onenable:function(){var t=e(".preview-mode-selector");t.removeClass("split-disabled"),t.find(".disabled-tooltip").hide()},ondisable:function(){var t=e(".preview-mode-selector");t.addClass("split-disabled"),t.find(".disabled-tooltip").show()},_block:function(){return this.addClass("blocked"),this.find(".cms-preview-overlay").show(),this},_unblock:function(){return this.removeClass("blocked"),this.find(".cms-preview-overlay").hide(),this},_initialiseFromContent:function(){var t,n;return e(".cms-previewable").length?(t=this.loadState("mode"),n=this.loadState("size"),this._moveNavigator(),t&&"content"==t||(this.enablePreview(),this._loadCurrentState()),this.redraw(),t&&this.changeMode(t),n&&this.changeSize(n)):this.disablePreview(),this},"from .cms-container":{onafterstatechange:function(e,t){t.xhr.getResponseHeader("X-ControllerURL")||this._initialiseFromContent()}},PendingURL:null,oncolumnvisibilitychanged:function(){var e=this.getPendingURL();e&&!this.is(".column-hidden")&&(this.setPendingURL(null),this._loadUrl(e),this._unblock())},"from .cms-container .cms-edit-form":{onaftersubmitform:function(){this._initialiseFromContent()}},_loadUrl:function(e){return this.find("iframe").addClass("loading").attr("src",e),this},_getNavigatorStates:function(){var t=e.map(this.getAllowedStates(),function(t){var n=e(".cms-preview-states .state-name[data-name="+t+"]");return n.length?{name:t,url:n.attr("data-link"),active:n.is(":radio")?n.is(":checked"):n.is(":selected")}:null});return t},_loadCurrentState:function(){if(!this.getIsPreviewEnabled())return this;var t=this._getNavigatorStates(),n=this.getCurrentStateName(),i=null;t&&(i=e.grep(t,function(e,t){return n===e.name||!n&&e.active}));var s=null;return i[0]?s=i[0].url:t.length?(this.setCurrentStateName(t[0].name),s=t[0].url):this.setCurrentStateName(null),s+=(-1===s.indexOf("?")?"?":"&")+"CMSPreview=1",this.is(".column-hidden")?(this.setPendingURL(s),this._loadUrl("about:blank"),this._block()):(this.setPendingURL(null),s?(this._loadUrl(s),this._unblock()):this._block()),this},_moveNavigator:function(){var t=e(".cms-preview .cms-preview-controls"),n=e(".cms-edit-form .cms-navigator");n.length&&t.length?t.html(e(".cms-edit-form .cms-navigator").detach()):this._block()},_loadCurrentPage:function(){if(this.getIsPreviewEnabled()){var t;e(".cms-container");try{t=this.find("iframe")[0].contentDocument}catch(n){console.warn("Unable to access iframe, possible https mis-match")}if(t){var i=e(t).find("meta[name=x-page-id]").attr("content"),s=e(t).find("meta[name=x-cms-edit-link]").attr("content"),a=e(".cms-content");i&&a.find(":input[name=ID]").val()!=i&&e(".cms-container").entwine(".ss").loadPanel(s)}}},_adjustIframeForPreview:function(){var e,t=this.find("iframe")[0];if(t){try{e=t.contentDocument}catch(n){console.warn("Unable to access iframe, possible https mis-match")}if(e){for(var i=e.getElementsByTagName("A"),s=0;s<i.length;s++){var a=i[s].getAttribute("href");a&&a.match(/^http:\/\//)&&i[s].setAttribute("target","_blank")}var o=e.getElementById("SilverStripeNavigator");o&&(o.style.display="none");var r=e.getElementById("SilverStripeNavigatorMessage");r&&(r.style.display="none"),this.trigger("afterIframeAdjustedForPreview",[e])}}}}),e(".cms-edit-form").entwine({onadd:function(){this._super(),e(".cms-preview")._initialiseFromContent()}}),e(".cms-preview-states").entwine({changeVisibleState:function(e){this.find('input[data-name="'+e+'"]').prop("checked",!0)}}),e(".cms-preview-states .state-name").entwine({onclick:function(t){this.parent().find(".active").removeClass("active"),this.next("label").addClass("active");var n=e(this).attr("data-name");e(".cms-preview").changeState(n)}}),e(".preview-mode-selector").entwine({changeVisibleMode:function(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-mode-selector select").entwine({onchange:function(t){this._super(t),t.preventDefault();var n=e(this).val();e(".cms-preview").changeMode(n)}}),e(".cms-preview.column-hidden").entwine({onmatch:function(){e("#preview-mode-dropdown-in-content").show(),e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(r["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"),this._super()},onunmatch:function(){e("#preview-mode-dropdown-in-content").hide(),this._super()}}),e("#preview-mode-dropdown-in-content").entwine({onmatch:function(){e(".cms-preview").is(".column-hidden")?this.show():this.hide(),this._super()},onunmatch:function(){this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function(t){t.preventDefault();var n=e(this).val();e(".cms-preview").changeSize(n)}}),e(".preview-selector select.preview-dropdown").entwine({"onchosen:ready":function(){this._super(),this._addIcon()},_addIcon:function(){var e=this.find(":selected"),t=e.attr("data-icon"),n=this.parent().find(".chosen-container a.chosen-single"),i=n.attr("data-icon");return"undefined"!=typeof i&&n.removeClass(i),n.addClass(t),n.attr("data-icon",t),this}}),e(".preview-mode-selector .chosen-drop li:last-child").entwine({onmatch:function(){e(".preview-mode-selector").hasClass("split-disabled")?this.parent().append('<div class="disabled-tooltip"></div>'):this.parent().append('<div class="disabled-tooltip" style="display: none;"></div>')}}),e(".preview-device-outer").entwine({onclick:function(){this.toggleClass("rotate")}})})},{i18n:"i18n",jQuery:"jQuery"}],12:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss.tree",function(e){e(".cms-tree").entwine({Hints:null,IsUpdatingTree:!1,IsLoaded:!1,onadd:function(){if(this._super(),!e.isNumeric(this.data("jstree_instance_id"))){var t=this.attr("data-hints");t&&this.setHints(e.parseJSON(t));var n=this;this.jstree(this.getTreeConfig()).bind("loaded.jstree",function(t,i){n.setIsLoaded(!0),i.inst._set_settings({html_data:{ajax:{url:n.data("urlTree"),data:function(t){var i=n.data("searchparams")||[];return i=e.grep(i,function(e,t){return"ID"!=e.name&&"value"!=e.name}),i.push({name:"ID",value:e(t).data("id")?e(t).data("id"):0}),i.push({name:"ajax",value:1}),i}}}}),n.updateFromEditForm(),n.css("visibility","visible"),i.inst.hide_checkboxes()}).bind("before.jstree",function(t,i){if("start_drag"==i.func&&(!n.hasClass("draggable")||n.hasClass("multiselect")))return t.stopImmediatePropagation(),!1;if(e.inArray(i.func,["check_node","uncheck_node"])){var s=e(i.args[0]).parents("li:first"),a=s.find("li:not(.disabled)");if(s.hasClass("disabled")&&0==a)return t.stopImmediatePropagation(),!1}}).bind("move_node.jstree",function(t,i){if(!n.getIsUpdatingTree()){var s=i.rslt.o,a=i.rslt.np,o=(i.inst._get_parent(s),e(a).data("id")||0),r=e(s).data("id"),l=e.map(e(s).siblings().andSelf(),function(t){return e(t).data("id")});e.ajax({url:n.data("urlSavetreenode"),type:"POST",data:{ID:r,ParentID:o,SiblingIDs:l},success:function(){e(".cms-edit-form :input[name=ID]").val()==r&&e(".cms-edit-form :input[name=ParentID]").val(o),n.updateNodesFromServer([r])},statusCode:{403:function(){e.jstree.rollback(i.rlbk)}}})}}).bind("select_node.jstree check_node.jstree uncheck_node.jstree",function(t,n){e(document).triggerHandler(t,n)})}},onremove:function(){this.jstree("destroy"),this._super()},"from .cms-container":{onafterstatechange:function(e){this.updateFromEditForm()}},"from .cms-container form":{onaftersubmitform:function(t){var n=e(".cms-edit-form :input[name=ID]").val();this.updateNodesFromServer([n])}},getTreeConfig:function(){var t=this;return{core:{initially_open:["record-0"],animation:0,html_titles:!0},html_data:{},ui:{select_limit:1,initially_select:[this.find(".current").attr("id")]},crrm:{move:{check_move:function(n){var i=e(n.o),s=e(n.np),a=n.ot.get_container()[0]==n.np[0],o=i.getClassname(),r=s.getClassname(),l=t.getHints(),d=[],c=r?r:"Root",u=l&&"undefined"!=typeof l[c]?l[c]:null;u&&i.attr("class").match(/VirtualPage-([^\s]*)/)&&(o=RegExp.$1),u&&(d="undefined"!=typeof u.disallowedChildren?u.disallowedChildren:[]);var h=!(0===i.data("id")||i.hasClass("status-archived")||a&&"inside"!=n.p||s.hasClass("nochildren")||d.length&&-1!=e.inArray(o,d));return h}}},dnd:{drop_target:!1,drag_target:!1},checkbox:{two_state:!0},themes:{theme:"apple",url:e("body").data("frameworkpath")+"/thirdparty/jstree/themes/apple/style.css"},plugins:["html_data","ui","dnd","crrm","themes","checkbox"]}},search:function(e,t){e?this.data("searchparams",e):this.removeData("searchparams"),this.jstree("refresh",-1,t)},getNodeByID:function(e){return this.find("*[data-id="+e+"]")},createNode:function(t,n,i){var s=this,a=void 0!==n.ParentID?s.getNodeByID(n.ParentID):!1,o=e(t),r={data:""};o.hasClass("jstree-open")?r.state="open":o.hasClass("jstree-closed")&&(r.state="closed"),this.jstree("create_node",a.length?a:-1,"last",r,function(e){for(var t=e.attr("class"),n=0;n<o[0].attributes.length;n++){var s=o[0].attributes[n];e.attr(s.name,s.value)}e.addClass(t).html(o.html()),i(e)})},updateNode:function(t,n,i){var s=e(n),a=t.attr("class"),o=i.NextID?this.getNodeByID(i.NextID):!1,r=i.PrevID?this.getNodeByID(i.PrevID):!1,l=i.ParentID?this.getNodeByID(i.ParentID):!1;e.each(["id","style","class","data-pagetype"],function(e,n){t.attr(n,s.attr(n))}),a=a.replace(/status-[^\s]*/,"");var d=t.children("ul").detach();t.addClass(a).html(s.html()).append(d),o&&o.length?this.jstree("move_node",t,o,"before"):r&&r.length?this.jstree("move_node",t,r,"after"):this.jstree("move_node",t,l.length?l:-1)},updateFromEditForm:function(){var t,n=e(".cms-edit-form :input[name=ID]").val();n?(t=this.getNodeByID(n),t.length?(this.jstree("deselect_all"),this.jstree("select_node",t)):this.updateNodesFromServer([n])):this.jstree("deselect_all")},updateNodesFromServer:function(t){if(!this.getIsUpdatingTree()&&this.getIsLoaded()){var n=this,i=!1;this.setIsUpdatingTree(!0),n.jstree("save_selected");var s=function(e){n.getNodeByID(e.data("id")).not(e).remove(),n.jstree("deselect_all"),n.jstree("select_node",e)};n.jstree("open_node",this.getNodeByID(0)),n.jstree("save_opened"),n.jstree("save_selected"),e.ajax({url:e.path.addSearchParams(this.data("urlUpdatetreenodes"),"ids="+t.join(",")),dataType:"json",success:function(t,a){e.each(t,function(e,t){var a=n.getNodeByID(e);return t?void(a.length?(n.updateNode(a,t.html,t),setTimeout(function(){s(a)},500)):(i=!0,t.ParentID&&!n.find("li[data-id="+t.ParentID+"]").length?n.jstree("load_node",-1,function(){newNode=n.find("li[data-id="+e+"]"),s(newNode)}):n.createNode(t.html,t,function(e){s(e)}))):void n.jstree("delete_node",a)}),i||(n.jstree("deselect_all"),n.jstree("reselect"),n.jstree("reopen"))},complete:function(){n.setIsUpdatingTree(!1)}})}}}),e(".cms-tree.multiple").entwine({onmatch:function(){this._super(),this.jstree("show_checkboxes")},onunmatch:function(){this._super(),this.jstree("uncheck_all"),this.jstree("hide_checkboxes")},getSelectedIDs:function(){return e(this).jstree("get_checked").not(".disabled").map(function(){return e(this).data("id")}).get()}}),e(".cms-tree li").entwine({setEnabled:function(e){this.toggleClass("disabled",!e)},getClassname:function(){var e=this.attr("class").match(/class-([^\s]*)/i);return e?e[1]:""},getID:function(){return this.data("id")}})})},{jQuery:"jQuery"}],13:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".TreeDropdownField").entwine({"from .cms-container form":{onaftersubmitform:function(e){this.find(".tree-holder").empty(),this._super()}}})})},{jQuery:"jQuery"}],14:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function getUrlPath(e){var t=document.createElement("a");return t.href=e,t.pathname}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_router=require("router"),_router2=_interopRequireDefault(_router),_config=require("config"),_config2=_interopRequireDefault(_config),windowWidth,windowHeight;_jQuery2["default"].noConflict(),window.ss=window.ss||{},window.ss.router=_router2["default"],window.ss.debounce=function(e,t,n){var i,s,a,o=function(){i=null,n||e.apply(s,a)};return function(){var r=n&&!i;s=this,a=arguments,clearTimeout(i),i=setTimeout(o,t),r&&e.apply(s,a)}},(0,_jQuery2["default"])(window).bind("resize.leftandmain",function(e){(0,_jQuery2["default"])(".cms-container").trigger("windowresize")}),_jQuery2["default"].entwine.warningLevel=_jQuery2["default"].entwine.WARN_LEVEL_BESTPRACTISE,_jQuery2["default"].entwine("ss",function($){$(window).on("message",function(e){var t,n=e.originalEvent,i="object"===_typeof(n.data)?n.data:JSON.parse(n.data);if($.path.parseUrl(window.location.href).domain===$.path.parseUrl(n.origin).domain)switch(t=$("undefined"==typeof i.target?window:i.target),i.type){case"event":t.trigger(i.event,i.data);break;case"callback":t[i.callback].call(t,i.data)}});var positionLoadingSpinner=function(){var e=120,t=$(".ss-loading-screen .loading-animation"),n=($(window).height()-t.height())/2;t.css("top",n+e),t.show()},applyChosen=function e(t){t.is(":visible")?t.addClass("has-chosen").chosen({allow_single_deselect:!0,disable_search_threshold:20,display_disabled_options:!0}):setTimeout(function(){t.show(),e(t)},500)},isSameUrl=function(e,t){var n=$("base").attr("href");e=$.path.isAbsoluteUrl(e)?e:$.path.makeUrlAbsolute(e,n),t=$.path.isAbsoluteUrl(t)?t:$.path.makeUrlAbsolute(t,n);var i=$.path.parseUrl(e),s=$.path.parseUrl(t);return i.pathname.replace(/\/*$/,"")==s.pathname.replace(/\/*$/,"")&&i.search==s.search},ajaxCompleteEvent=window.ss.debounce(function(){$(window).trigger("ajaxComplete")},1e3,!0);$(window).bind("resize",positionLoadingSpinner).trigger("resize"),$(document).ajaxComplete(function(e,t,n){var i,s=t.getResponseHeader("X-ControllerURL"),a=n.url,o=null!==t.getResponseHeader("X-Status")?t.getResponseHeader("X-Status"):t.statusText,r=t.status<200||t.status>399?"bad":"good",l=["OK"];return i=window.history.state?window.history.state.path:document.URL,null===s||isSameUrl(i,s)&&isSameUrl(a,s)||_router2["default"].show(s,{id:(new Date).getTime()+String(Math.random()).replace(/\D/g,""),pjax:t.getResponseHeader("X-Pjax")?t.getResponseHeader("X-Pjax"):n.headers["X-Pjax"]}),t.getResponseHeader("X-Reauthenticate")?void $(".cms-container").showLoginDialog():(0!==t.status&&o&&$.inArray(o,l)&&statusMessage(decodeURIComponent(o),r),void ajaxCompleteEvent(this))}),$(".cms-container").entwine({StateChangeXHR:null,FragmentXHR:{},StateChangeCount:0,LayoutOptions:{minContentWidth:940,minPreviewWidth:400,mode:"content"},onadd:function(){var e=this,t=getUrlPath($("base")[0].href);return t=t.replace(/\/$/,""),_router2["default"].base(t),_config2["default"].getTopLevelRoutes().forEach(function(t){(0,_router2["default"])("/"+t+"*",function(t,n){return"complete"!==document.readyState?n():void e.handleStateChange(null,t.state).done(n)})}),_router2["default"].start(),$.browser.msie&&parseInt($.browser.version,10)<8?($(".ss-loading-screen").append('<p class="ss-loading-incompat-warning"><span class="notice">Your browser is not compatible with the CMS interface. Please use Internet Explorer 8+, Google Chrome or Mozilla Firefox.</span></p>').css("z-index",$(".ss-loading-screen").css("z-index")+1),$(".loading-animation").remove(),void this._super()):(this.redraw(),$(".ss-loading-screen").hide(),$("body").removeClass("loading"),$(window).unbind("resize",positionLoadingSpinner),this.restoreTabState(),void this._super())},fromWindow:{onstatechange:function(e,t){this.handleStateChange(e,t)}},onwindowresize:function(){this.redraw()},"from .cms-panel":{ontoggle:function(){this.redraw()}},"from .cms-container":{onaftersubmitform:function(){this.redraw()}},"from .cms-menu-list li a":{onclick:function(e){var t=$(e.target).attr("href");e.which>1||t==this._tabStateUrl()||this.splitViewMode()}},updateLayoutOptions:function(e){var t=this.getLayoutOptions(),n=!1;for(var i in e)t[i]!==e[i]&&(t[i]=e[i],n=!0);n&&this.redraw()},splitViewMode:function(){this.updateLayoutOptions({mode:"split"})},contentViewMode:function(){this.updateLayoutOptions({mode:"content"})},previewMode:function(){this.updateLayoutOptions({mode:"preview"})},RedrawSuppression:!1,redraw:function(){this.getRedrawSuppression()||(window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.data("jlayout",jLayout.threeColumnCompressor({menu:this.children(".cms-menu"),content:this.children(".cms-content"),preview:this.children(".cms-preview")},this.getLayoutOptions())),this.layout(),this.find(".cms-panel-layout").redraw(),this.find(".cms-content-fields[data-layout-type]").redraw(),this.find(".cms-edit-form[data-layout-type]").redraw(),this.find(".cms-preview").redraw(),this.find(".cms-content").redraw())},checkCanNavigate:function(e){var t=this._findFragments(e||["Content"]),n=t.find(":data(changetracker)").add(t.filter(":data(changetracker)")),i=!0;return n.length?(n.each(function(){$(this).confirmUnsavedChanges()||(i=!1)}),i):!0},loadPanel:function(e){var t=(arguments.length<=1||void 0===arguments[1]?"":arguments[1],arguments.length<=2||void 0===arguments[2]?{}:arguments[2]),n=arguments[3],i=arguments.length<=4||void 0===arguments[4]?window.history.state.path:arguments[4];this.checkCanNavigate(t.pjax?t.pjax.split(","):["Content"])&&(this.saveTabState(),t.__forceReferer=i,n&&(t.__forceReload=Math.random()),_router2["default"].show(e,t))},reloadCurrentPanel:function(){this.loadPanel(window.history.state.path,null,null,!0)},submitForm:function(e,t,n,i){var s=this;t||(t=this.find(".Actions :submit[name=action_save]")),t||(t=this.find(".Actions :submit:first")),e.trigger("beforesubmitform"),this.trigger("submitform",{form:e,button:t}),$(t).addClass("loading");var a=e.validate();if("undefined"!=typeof a&&!a)return statusMessage("Validation failed.","bad"),$(t).removeClass("loading"),!1;var o=e.serializeArray();return o.push({name:$(t).attr("name"),value:"1"}),o.push({name:"BackURL",value:window.history.state.path.replace(/\/$/,"")}),this.saveTabState(),jQuery.ajax(jQuery.extend({headers:{"X-Pjax":"CurrentForm,Breadcrumbs"},url:e.attr("action"),data:o,type:"POST",complete:function(){$(t).removeClass("loading")},success:function(t,i,a){e.removeClass("changed"),n&&n(t,i,a);var r=s.handleAjaxResponse(t,i,a);r&&r.filter("form").trigger("aftersubmitform",{status:i,xhr:a,formData:o})}},i)),!1},LastState:null,PauseState:!1,handleStateChange:function(e){var t=arguments.length<=1||void 0===arguments[1]?window.history.state:arguments[1];if(!this.getPauseState()){this.getStateChangeXHR()&&this.getStateChangeXHR().abort();var n=this,i=t.pjax||"Content",s={},a=i.split(","),o=this._findFragments(a);if(this.setStateChangeCount(this.getStateChangeCount()+1),!this.checkCanNavigate()){var r=this.getLastState();return this.setPauseState(!0),null!==r?_router2["default"].show(r.url):_router2["default"].back(),void this.setPauseState(!1)}if(this.setLastState(t),o.length<a.length&&(i="Content",a=["Content"],o=this._findFragments(a)),this.trigger("beforestatechange",{state:t,element:o}),s["X-Pjax"]=i,"undefined"!=typeof t.__forceReferer){var l=t.__forceReferer;try{l=decodeURI(l)}catch(d){}finally{s["X-Backurl"]=encodeURI(l)}}o.addClass("loading");var c=$.ajax({headers:s,url:t.path}).done(function(e,i,s){var a=n.handleAjaxResponse(e,i,s,t);n.trigger("afterstatechange",{data:e,status:i,xhr:s,element:a,state:t})}).always(function(){n.setStateChangeXHR(null),o.removeClass("loading")});return this.setStateChangeXHR(c),c}},loadFragment:function(e,t){var n,i=this,s={},a=$("base").attr("href"),o=this.getFragmentXHR();return"undefined"!=typeof o[t]&&null!==o[t]&&(o[t].abort(),o[t]=null),e=$.path.isAbsoluteUrl(e)?e:$.path.makeUrlAbsolute(e,a),s["X-Pjax"]=t,n=$.ajax({headers:s,url:e,success:function(e,t,n){var s=i.handleAjaxResponse(e,t,n,null);i.trigger("afterloadfragment",{data:e,status:t,xhr:n,elements:s})},error:function(e,t,n){i.trigger("loadfragmenterror",{xhr:e,status:t,error:n})},complete:function(){var e=i.getFragmentXHR();"undefined"!=typeof e[t]&&null!==e[t]&&(e[t]=null)}}),o[t]=n,n},handleAjaxResponse:function(e,t,n,i){var s,a,o,r;if(n.getResponseHeader("X-Reload")&&n.getResponseHeader("X-ControllerURL")){var l=$("base").attr("href"),d=n.getResponseHeader("X-ControllerURL"),s=$.path.isAbsoluteUrl(d)?d:$.path.makeUrlAbsolute(d,l);return void(document.location.href=s)}if(e){var c=n.getResponseHeader("X-Title");c&&(document.title=decodeURIComponent(c.replace(/\+/g," ")));var u,h={};n.getResponseHeader("Content-Type").match(/^((text)|(application))\/json[ \t]*;?/i)?h=e:(o=document.createDocumentFragment(),jQuery.clean([e],document,o,[]),r=$(jQuery.merge([],o.childNodes)),a="Content",r.is("form")&&!r.is("[data-pjax-fragment~=Content]")&&(a="CurrentForm"),h[a]=r),this.setRedrawSuppression(!0);try{$.each(h,function(e,t){var n=$("[data-pjax-fragment]").filter(function(){return-1!=$.inArray(e,$(this).data("pjaxFragment").split(" "))}),i=$(t);if(u?u.add(i):u=i,i.find(".cms-container").length)throw'Content loaded via ajax is not allowed to contain tags matching the ".cms-container" selector to avoid infinite loops';var s=n.attr("style"),a=n.parent(),o="undefined"!=typeof a.data("jlayout"),r=["east","west","center","north","south","column-hidden"],l=n.attr("class"),d=[];l&&(d=$.grep(l.split(" "),function(e){return $.inArray(e,r)>=0})),i.removeClass(r.join(" ")).addClass(d.join(" ")),s&&i.attr("style",s);var c=i.find("style").detach();c.length&&$(document).find("head").append(c),n.replaceWith(i),!a.is(".cms-container")&&o&&a.layout()});var f=u.filter("form");f.hasClass("cms-tabset")&&f.removeClass("cms-tabset").addClass("cms-tabset")}finally{this.setRedrawSuppression(!1)}return this.redraw(),this.restoreTabState(i&&"undefined"!=typeof i.tabState?i.tabState:null),u}},_findFragments:function(e){return $("[data-pjax-fragment]").filter(function(){var t,n=$(this).data("pjaxFragment").split(" ");for(t in e)if(-1!=$.inArray(e[t],n))return!0;return!1})},refresh:function(){$(window).trigger("statechange"),$(this).redraw()},saveTabState:function(){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){var e=[],t=this._tabStateUrl();if(this.find(".cms-tabset,.ss-tabset").each(function(t,n){var i=$(n).attr("id");i&&$(n).data("tabs")&&($(n).data("ignoreTabState")||$(n).getIgnoreTabState()||e.push({id:i,selected:$(n).tabs("option","selected")}))}),e){var n="tabs-"+t;try{window.sessionStorage.setItem(n,JSON.stringify(e))}catch(i){if(i.code===DOMException.QUOTA_EXCEEDED_ERR&&0===window.sessionStorage.length)return;throw i}}}},restoreTabState:function(e){var t=this,n=this._tabStateUrl(),i="undefined"!=typeof window.sessionStorage&&window.sessionStorage,s=i?window.sessionStorage.getItem("tabs-"+n):null,a=s?JSON.parse(s):!1;this.find(".cms-tabset, .ss-tabset").each(function(){var n,i,s=$(this),o=s.attr("id"),r=s.find(".ss-tabs-force-active");s.data("tabs")&&(s.tabs("refresh"),r.length?n=r.index():e&&e[o]?(i=s.find(e[o].tabSelector),i.length&&(n=i.index())):a&&$.each(a,function(e,t){s.is("#"+t.id)&&(n=t.selected)}),null!==n&&(s.tabs("option","active",n),t.trigger("tabstaterestored")))})},clearTabState:function(e){if("undefined"!=typeof window.sessionStorage){var t=window.sessionStorage;if(e)t.removeItem("tabs-"+e);else for(var n=0;n<t.length;n++)t.key(n).match(/^tabs-/)&&t.removeItem(t.key(n))}},clearCurrentTabState:function(){this.clearTabState(this._tabStateUrl())},_tabStateUrl:function(){return window.history.state.path.replace(/\?.*/,"").replace(/#.*/,"").replace($("base").attr("href"),"")},showLoginDialog:function(){var e=$("body").data("member-tempid"),t=$(".leftandmain-logindialog"),n="CMSSecurity/login";t.length&&t.remove(),n=$.path.addSearchParams(n,{tempid:e,BackURL:window.location.href}),t=$('<div class="leftandmain-logindialog"></div>'),t.attr("id",(new Date).getTime()),t.data("url",n),$("body").append(t)}}),$(".leftandmain-logindialog").entwine({onmatch:function(){this._super(),this.ssdialog({iframeUrl:this.data("url"),dialogClass:"leftandmain-logindialog-dialog",autoOpen:!0,minWidth:500,maxWidth:500,minHeight:370,maxHeight:400,closeOnEscape:!1,open:function(){$(".ui-widget-overlay").addClass("leftandmain-logindialog-overlay")},close:function(){$(".ui-widget-overlay").removeClass("leftandmain-logindialog-overlay")}})},onunmatch:function(){this._super()},open:function(){this.ssdialog("open")},close:function(){this.ssdialog("close")},toggle:function(e){this.is(":visible")?this.close():this.open()},reauthenticate:function(e){"undefined"!=typeof e.SecurityID&&$(":input[name=SecurityID]").val(e.SecurityID),"undefined"!=typeof e.TempID&&$("body").data("member-tempid",e.TempID),this.close()}}),$("form.loading,.cms-content.loading,.cms-content-fields.loading,.cms-content-view.loading").entwine({onmatch:function(){this.append('<div class="cms-content-loading-overlay ui-widget-overlay-light"></div><div class="cms-content-loading-spinner"></div>'),this._super()},onunmatch:function(){this.find(".cms-content-loading-overlay,.cms-content-loading-spinner").remove(),this._super()}}),$('.cms input[type="submit"], .cms button, .cms input[type="reset"], .cms .ss-ui-button').entwine({onadd:function(){this.addClass("ss-ui-button"),this.data("button")||this.button(),this._super()},onremove:function(){this.data("button")&&this.button("destroy"),this._super()}}),$(".cms .cms-panel-link").entwine({onclick:function(e){if($(this).hasClass("external-link"))return void e.stopPropagation();var t=this.attr("href"),n=t&&!t.match(/^#/)?t:this.data("href"),i={pjax:this.data("pjaxTarget")};$(".cms-container").loadPanel(n,null,i),e.preventDefault()}}),$(".cms .ss-ui-button-ajax").entwine({onclick:function onclick(e){$(this).removeClass("ui-button-text-only"),$(this).addClass("ss-ui-button-loading ui-button-text-icons");var loading=$(this).find(".ss-ui-loading-icon");loading.length<1&&(loading=$("<span></span>").addClass("ss-ui-loading-icon ui-button-icon-primary ui-icon"),$(this).prepend(loading)),loading.show();var href=this.attr("href"),url=href?href:this.data("href");jQuery.ajax({url:url,complete:function complete(xmlhttp,status){var msg=xmlhttp.getResponseHeader("X-Status")?xmlhttp.getResponseHeader("X-Status"):xmlhttp.responseText;try{"undefined"!=typeof msg&&null!==msg&&eval(msg)}catch(e){}loading.hide(),$(".cms-container").refresh(),$(this).removeClass("ss-ui-button-loading ui-button-text-icons"),$(this).addClass("ui-button-text-only")},dataType:"html"}),e.preventDefault()}}),$(".cms .ss-ui-dialog-link").entwine({UUID:null,onmatch:function(){this._super(),this.setUUID((new Date).getTime())},onunmatch:function(){this._super()},onclick:function(){this._super();var e="ss-ui-dialog-"+this.getUUID(),t=$("#"+e);t.length||(t=$('<div class="ss-ui-dialog" id="'+e+'" />'),$("body").append(t));var n=this.data("popupclass")?this.data("popupclass"):"";return t.ssdialog({iframeUrl:this.attr("href"),autoOpen:!0,dialogExtraClass:n}),!1}}),$(".cms-content .Actions").entwine({onmatch:function(){this.find(".ss-ui-button").click(function(){var e=this.form;e&&(e.clickedButton=this,setTimeout(function(){e.clickedButton=null},10))}),this.redraw(),this._super()},onunmatch:function(){this._super()},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.contents().filter(function(){return 3==this.nodeType&&!/\S/.test(this.nodeValue)}).remove(),this.find(".ss-ui-button").each(function(){$(this).data("button")||$(this).button()}),this.find(".ss-ui-buttonset").buttonset()}}),$(".cms .field.date input.text").entwine({onmatch:function(){var e=$(this).parents(".field.date:first"),t=e.data();return t.showcalendar?(t.showOn="button",t.locale&&$.datepicker.regional[t.locale]&&(t=$.extend(t,$.datepicker.regional[t.locale],{})),$(this).datepicker(t),void this._super()):void this._super()},onunmatch:function(){this._super()}}),$(".cms .field.dropdown select, .cms .field select[multiple], .fieldholder-small select.dropdown").entwine({onmatch:function(){return this.is(".no-chosen")?void this._super():(this.data("placeholder")||this.data("placeholder"," "),this.removeClass("has-chosen").chosen("destroy"),this.siblings(".chosen-container").remove(),applyChosen(this),void this._super())},onunmatch:function(){this._super()}}),$(".cms-panel-layout").entwine({redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0))}}),$(".cms .ss-gridfield").entwine({showDetailView:function(e){var t=window.location.search.replace(/^\?/,"");t&&(e=$.path.addSearchParams(e,t)),$(".cms-container").loadPanel(e)}}),$(".cms-search-form").entwine({onsubmit:function(e){var t,n;t=this.find(":input:not(:submit)").filter(function(){var e=$.grep($(this).fieldValue(),function(e){return e});return e.length}),n=this.attr("action"),t.length&&(n=$.path.addSearchParams(n,t.serialize().replace("+","%20")));var i=this.closest(".cms-container");return i.find(".cms-edit-form").tabs("select",0),i.loadPanel(n,"",{},!0),!1}}),$(".cms-search-form button[type=reset], .cms-search-form input[type=reset]").entwine({onclick:function(e){e.preventDefault();var t=$(this).parents("form");t.clearForm(),t.find(".dropdown select").prop("selectedIndex",0).trigger("chosen:updated"),t.submit()}}),window._panelDeferredCache={},$(".cms-panel-deferred").entwine({onadd:function(){this._super(),this.redraw()},onremove:function(){window.debug&&console.log("saving",this.data("url"),this),this.data("deferredNoCache")||(window._panelDeferredCache[this.data("url")]=this.html()),this._super()},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0));var e=this,t=this.data("url");if(!t)throw'Elements of class .cms-panel-deferred need a "data-url" attribute';this._super(),this.children().length||(this.data("deferredNoCache")||"undefined"==typeof window._panelDeferredCache[t]?(this.addClass("loading"),$.ajax({url:t,complete:function(){e.removeClass("loading")},success:function(t,n,i){e.html(t)}})):this.html(window._panelDeferredCache[t]))}}),$(".cms-tabset").entwine({onadd:function(){this.redrawTabs(),this._super()},onremove:function(){this.data("tabs")&&this.tabs("destroy"),this._super()},redrawTabs:function(){this.rewriteHashlinks();var e=(this.attr("id"),this.find("ul:first .ui-tabs-active"));this.data("uiTabs")||this.tabs({active:-1!=e.index()?e.index():0,beforeLoad:function(e,t){return!1},activate:function(e,t){var n=$(this).closest("form").find(".Actions");$(t.newTab).closest("li").hasClass("readonly")?n.fadeOut():n.show()}})},rewriteHashlinks:function(){$(this).find("ul a").each(function(){if($(this).attr("href")){var e=$(this).attr("href").match(/#.*/);e&&$(this).attr("href",document.location.href.replace(/#.*/,"")+e[0])}})}}),$("#filters-button").entwine({onmatch:function(){this._super(),this.data("collapsed",!0),this.data("animating",!1)},onunmatch:function(){
this._super()},showHide:function(){var e=this,t=$(".cms-content-filters").first(),n=this.data("collapsed");this.data("animating")||(this.toggleClass("active"),this.data("animating",!0),t[n?"slideDown":"slideUp"]({complete:function(){e.data("collapsed",!n),e.data("animating",!1)}}))},onclick:function(){this.showHide()}})});var statusMessage=function(e,t){e=jQuery("<div/>").text(e).html(),jQuery.noticeAdd({text:e,type:t,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})},errorMessage=function(e){jQuery.noticeAdd({text:e,type:"error",stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}},{config:"config",jQuery:"jQuery",router:"router"}]},{},[1]);
t},onadd:function(){var t=this,n=(this.parent(),this.find("iframe"));n.addClass("center"),n.bind("load",function(){t._adjustIframeForPreview(),t._loadCurrentPage(),e(this).removeClass("loading")}),e.browser.msie&&8===parseInt(e.browser.version,10)&&n.bind("readystatechange",function(e){"interactive"==n[0].readyState&&(t.getOrAppendFontFixStyleElement().removeAttr("disabled"),setTimeout(function(){t.getOrAppendFontFixStyleElement().attr("disabled","disabled")},0))}),this.append('<div class="cms-preview-overlay ui-widget-overlay-light"></div>'),this.find(".cms-preview-overlay").hide(),this.disablePreview(),this._super()},_supportsLocalStorage:function(){var e,t,n=new Date;try{return(e=window.localStorage).setItem(n,n),t=e.getItem(n)==n,e.removeItem(n),t&&e}catch(i){console.warn("localStorge is not available due to current browser / system settings.")}},onenable:function(){var t=e(".preview-mode-selector");t.removeClass("split-disabled"),t.find(".disabled-tooltip").hide()},ondisable:function(){var t=e(".preview-mode-selector");t.addClass("split-disabled"),t.find(".disabled-tooltip").show()},_block:function(){return this.addClass("blocked"),this.find(".cms-preview-overlay").show(),this},_unblock:function(){return this.removeClass("blocked"),this.find(".cms-preview-overlay").hide(),this},_initialiseFromContent:function(){var t,n;return e(".cms-previewable").length?(t=this.loadState("mode"),n=this.loadState("size"),this._moveNavigator(),t&&"content"==t||(this.enablePreview(),this._loadCurrentState()),this.redraw(),t&&this.changeMode(t),n&&this.changeSize(n)):this.disablePreview(),this},"from .cms-container":{onafterstatechange:function(e,t){t.xhr.getResponseHeader("X-ControllerURL")||this._initialiseFromContent()}},PendingURL:null,oncolumnvisibilitychanged:function(){var e=this.getPendingURL();e&&!this.is(".column-hidden")&&(this.setPendingURL(null),this._loadUrl(e),this._unblock())},"from .cms-container .cms-edit-form":{onaftersubmitform:function(){this._initialiseFromContent()}},_loadUrl:function(e){return this.find("iframe").addClass("loading").attr("src",e),this},_getNavigatorStates:function(){var t=e.map(this.getAllowedStates(),function(t){var n=e(".cms-preview-states .state-name[data-name="+t+"]");return n.length?{name:t,url:n.attr("data-link"),active:n.is(":radio")?n.is(":checked"):n.is(":selected")}:null});return t},_loadCurrentState:function(){if(!this.getIsPreviewEnabled())return this;var t=this._getNavigatorStates(),n=this.getCurrentStateName(),i=null;t&&(i=e.grep(t,function(e,t){return n===e.name||!n&&e.active}));var s=null;return i[0]?s=i[0].url:t.length?(this.setCurrentStateName(t[0].name),s=t[0].url):this.setCurrentStateName(null),s+=(-1===s.indexOf("?")?"?":"&")+"CMSPreview=1",this.is(".column-hidden")?(this.setPendingURL(s),this._loadUrl("about:blank"),this._block()):(this.setPendingURL(null),s?(this._loadUrl(s),this._unblock()):this._block()),this},_moveNavigator:function(){var t=e(".cms-preview .cms-preview-controls"),n=e(".cms-edit-form .cms-navigator");n.length&&t.length?t.html(e(".cms-edit-form .cms-navigator").detach()):this._block()},_loadCurrentPage:function(){if(this.getIsPreviewEnabled()){var t;e(".cms-container");try{t=this.find("iframe")[0].contentDocument}catch(n){console.warn("Unable to access iframe, possible https mis-match")}if(t){var i=e(t).find("meta[name=x-page-id]").attr("content"),s=e(t).find("meta[name=x-cms-edit-link]").attr("content"),a=e(".cms-content");i&&a.find(":input[name=ID]").val()!=i&&e(".cms-container").entwine(".ss").loadPanel(s)}}},_adjustIframeForPreview:function(){var e,t=this.find("iframe")[0];if(t){try{e=t.contentDocument}catch(n){console.warn("Unable to access iframe, possible https mis-match")}if(e){for(var i=e.getElementsByTagName("A"),s=0;s<i.length;s++){var a=i[s].getAttribute("href");a&&a.match(/^http:\/\//)&&i[s].setAttribute("target","_blank")}var o=e.getElementById("SilverStripeNavigator");o&&(o.style.display="none");var r=e.getElementById("SilverStripeNavigatorMessage");r&&(r.style.display="none"),this.trigger("afterIframeAdjustedForPreview",[e])}}}}),e(".cms-edit-form").entwine({onadd:function(){this._super(),e(".cms-preview")._initialiseFromContent()}}),e(".cms-preview-states").entwine({changeVisibleState:function(e){this.find('input[data-name="'+e+'"]').prop("checked",!0)}}),e(".cms-preview-states .state-name").entwine({onclick:function(t){this.parent().find(".active").removeClass("active"),this.next("label").addClass("active");var n=e(this).attr("data-name");e(".cms-preview").changeState(n)}}),e(".preview-mode-selector").entwine({changeVisibleMode:function(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-mode-selector select").entwine({onchange:function(t){this._super(t),t.preventDefault();var n=e(this).val();e(".cms-preview").changeMode(n)}}),e(".cms-preview.column-hidden").entwine({onmatch:function(){e("#preview-mode-dropdown-in-content").show(),e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(r["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"),this._super()},onunmatch:function(){e("#preview-mode-dropdown-in-content").hide(),this._super()}}),e("#preview-mode-dropdown-in-content").entwine({onmatch:function(){e(".cms-preview").is(".column-hidden")?this.show():this.hide(),this._super()},onunmatch:function(){this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function(t){t.preventDefault();var n=e(this).val();e(".cms-preview").changeSize(n)}}),e(".preview-selector select.preview-dropdown").entwine({"onchosen:ready":function(){this._super(),this._addIcon()},_addIcon:function(){var e=this.find(":selected"),t=e.attr("data-icon"),n=this.parent().find(".chosen-container a.chosen-single"),i=n.attr("data-icon");return"undefined"!=typeof i&&n.removeClass(i),n.addClass(t),n.attr("data-icon",t),this}}),e(".preview-mode-selector .chosen-drop li:last-child").entwine({onmatch:function(){e(".preview-mode-selector").hasClass("split-disabled")?this.parent().append('<div class="disabled-tooltip"></div>'):this.parent().append('<div class="disabled-tooltip" style="display: none;"></div>')}}),e(".preview-device-outer").entwine({onclick:function(){this.toggleClass("rotate")}})})},{i18n:"i18n",jQuery:"jQuery"}],12:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss.tree",function(e){e(".cms-tree").entwine({Hints:null,IsUpdatingTree:!1,IsLoaded:!1,onadd:function(){if(this._super(),!e.isNumeric(this.data("jstree_instance_id"))){var t=this.attr("data-hints");t&&this.setHints(e.parseJSON(t));var n=this;this.jstree(this.getTreeConfig()).bind("loaded.jstree",function(t,i){n.setIsLoaded(!0),i.inst._set_settings({html_data:{ajax:{url:n.data("urlTree"),data:function(t){var i=n.data("searchparams")||[];return i=e.grep(i,function(e,t){return"ID"!=e.name&&"value"!=e.name}),i.push({name:"ID",value:e(t).data("id")?e(t).data("id"):0}),i.push({name:"ajax",value:1}),i}}}}),n.updateFromEditForm(),n.css("visibility","visible"),i.inst.hide_checkboxes()}).bind("before.jstree",function(t,i){if("start_drag"==i.func&&(!n.hasClass("draggable")||n.hasClass("multiselect")))return t.stopImmediatePropagation(),!1;if(e.inArray(i.func,["check_node","uncheck_node"])){var s=e(i.args[0]).parents("li:first"),a=s.find("li:not(.disabled)");if(s.hasClass("disabled")&&0==a)return t.stopImmediatePropagation(),!1}}).bind("move_node.jstree",function(t,i){if(!n.getIsUpdatingTree()){var s=i.rslt.o,a=i.rslt.np,o=(i.inst._get_parent(s),e(a).data("id")||0),r=e(s).data("id"),l=e.map(e(s).siblings().andSelf(),function(t){return e(t).data("id")});e.ajax({url:n.data("urlSavetreenode"),type:"POST",data:{ID:r,ParentID:o,SiblingIDs:l},success:function(){e(".cms-edit-form :input[name=ID]").val()==r&&e(".cms-edit-form :input[name=ParentID]").val(o),n.updateNodesFromServer([r])},statusCode:{403:function(){e.jstree.rollback(i.rlbk)}}})}}).bind("select_node.jstree check_node.jstree uncheck_node.jstree",function(t,n){e(document).triggerHandler(t,n)})}},onremove:function(){this.jstree("destroy"),this._super()},"from .cms-container":{onafterstatechange:function(e){this.updateFromEditForm()}},"from .cms-container form":{onaftersubmitform:function(t){var n=e(".cms-edit-form :input[name=ID]").val();this.updateNodesFromServer([n])}},getTreeConfig:function(){var t=this;return{core:{initially_open:["record-0"],animation:0,html_titles:!0},html_data:{},ui:{select_limit:1,initially_select:[this.find(".current").attr("id")]},crrm:{move:{check_move:function(n){var i=e(n.o),s=e(n.np),a=n.ot.get_container()[0]==n.np[0],o=i.getClassname(),r=s.getClassname(),l=t.getHints(),d=[],c=r?r:"Root",u=l&&"undefined"!=typeof l[c]?l[c]:null;u&&i.attr("class").match(/VirtualPage-([^\s]*)/)&&(o=RegExp.$1),u&&(d="undefined"!=typeof u.disallowedChildren?u.disallowedChildren:[]);var h=!(0===i.data("id")||i.hasClass("status-archived")||a&&"inside"!=n.p||s.hasClass("nochildren")||d.length&&-1!=e.inArray(o,d));return h}}},dnd:{drop_target:!1,drag_target:!1},checkbox:{two_state:!0},themes:{theme:"apple",url:e("body").data("frameworkpath")+"/thirdparty/jstree/themes/apple/style.css"},plugins:["html_data","ui","dnd","crrm","themes","checkbox"]}},search:function(e,t){e?this.data("searchparams",e):this.removeData("searchparams"),this.jstree("refresh",-1,t)},getNodeByID:function(e){return this.find("*[data-id="+e+"]")},createNode:function(t,n,i){var s=this,a=void 0!==n.ParentID?s.getNodeByID(n.ParentID):!1,o=e(t),r={data:""};o.hasClass("jstree-open")?r.state="open":o.hasClass("jstree-closed")&&(r.state="closed"),this.jstree("create_node",a.length?a:-1,"last",r,function(e){for(var t=e.attr("class"),n=0;n<o[0].attributes.length;n++){var s=o[0].attributes[n];e.attr(s.name,s.value)}e.addClass(t).html(o.html()),i(e)})},updateNode:function(t,n,i){var s=e(n),a=t.attr("class"),o=i.NextID?this.getNodeByID(i.NextID):!1,r=i.PrevID?this.getNodeByID(i.PrevID):!1,l=i.ParentID?this.getNodeByID(i.ParentID):!1;e.each(["id","style","class","data-pagetype"],function(e,n){t.attr(n,s.attr(n))}),a=a.replace(/status-[^\s]*/,"");var d=t.children("ul").detach();t.addClass(a).html(s.html()).append(d),o&&o.length?this.jstree("move_node",t,o,"before"):r&&r.length?this.jstree("move_node",t,r,"after"):this.jstree("move_node",t,l.length?l:-1)},updateFromEditForm:function(){var t,n=e(".cms-edit-form :input[name=ID]").val();n?(t=this.getNodeByID(n),t.length?(this.jstree("deselect_all"),this.jstree("select_node",t)):this.updateNodesFromServer([n])):this.jstree("deselect_all")},updateNodesFromServer:function(t){if(!this.getIsUpdatingTree()&&this.getIsLoaded()){var n=this,i=!1;this.setIsUpdatingTree(!0),n.jstree("save_selected");var s=function(e){n.getNodeByID(e.data("id")).not(e).remove(),n.jstree("deselect_all"),n.jstree("select_node",e)};n.jstree("open_node",this.getNodeByID(0)),n.jstree("save_opened"),n.jstree("save_selected"),e.ajax({url:e.path.addSearchParams(this.data("urlUpdatetreenodes"),"ids="+t.join(",")),dataType:"json",success:function(t,a){e.each(t,function(e,t){var a=n.getNodeByID(e);return t?void(a.length?(n.updateNode(a,t.html,t),setTimeout(function(){s(a)},500)):(i=!0,t.ParentID&&!n.find("li[data-id="+t.ParentID+"]").length?n.jstree("load_node",-1,function(){newNode=n.find("li[data-id="+e+"]"),s(newNode)}):n.createNode(t.html,t,function(e){s(e)}))):void n.jstree("delete_node",a)}),i||(n.jstree("deselect_all"),n.jstree("reselect"),n.jstree("reopen"))},complete:function(){n.setIsUpdatingTree(!1)}})}}}),e(".cms-tree.multiple").entwine({onmatch:function(){this._super(),this.jstree("show_checkboxes")},onunmatch:function(){this._super(),this.jstree("uncheck_all"),this.jstree("hide_checkboxes")},getSelectedIDs:function(){return e(this).jstree("get_checked").not(".disabled").map(function(){return e(this).data("id")}).get()}}),e(".cms-tree li").entwine({setEnabled:function(e){this.toggleClass("disabled",!e)},getClassname:function(){var e=this.attr("class").match(/class-([^\s]*)/i);return e?e[1]:""},getID:function(){return this.data("id")}})})},{jQuery:"jQuery"}],13:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=e("jQuery"),a=i(s);a["default"].entwine("ss",function(e){e(".TreeDropdownField").entwine({"from .cms-container form":{onaftersubmitform:function(e){this.find(".tree-holder").empty(),this._super()}}})})},{jQuery:"jQuery"}],14:[function(require,module,exports){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function getUrlPath(e){var t=document.createElement("a");return t.href=e,t.pathname}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_jQuery=require("jQuery"),_jQuery2=_interopRequireDefault(_jQuery),_router=require("router"),_router2=_interopRequireDefault(_router),_config=require("config"),_config2=_interopRequireDefault(_config),windowWidth,windowHeight;_jQuery2["default"].noConflict(),window.ss=window.ss||{},window.ss.router=_router2["default"],window.ss.debounce=function(e,t,n){var i,s,a,o=function(){i=null,n||e.apply(s,a)};return function(){var r=n&&!i;s=this,a=arguments,clearTimeout(i),i=setTimeout(o,t),r&&e.apply(s,a)}},(0,_jQuery2["default"])(window).bind("resize.leftandmain",function(e){(0,_jQuery2["default"])(".cms-container").trigger("windowresize")}),_jQuery2["default"].entwine.warningLevel=_jQuery2["default"].entwine.WARN_LEVEL_BESTPRACTISE,_jQuery2["default"].entwine("ss",function($){$(window).on("message",function(e){var t,n=e.originalEvent,i="object"===_typeof(n.data)?n.data:JSON.parse(n.data);if($.path.parseUrl(window.location.href).domain===$.path.parseUrl(n.origin).domain)switch(t=$("undefined"==typeof i.target?window:i.target),i.type){case"event":t.trigger(i.event,i.data);break;case"callback":t[i.callback].call(t,i.data)}});var positionLoadingSpinner=function(){var e=120,t=$(".ss-loading-screen .loading-animation"),n=($(window).height()-t.height())/2;t.css("top",n+e),t.show()},applyChosen=function e(t){t.is(":visible")?t.addClass("has-chosen").chosen({allow_single_deselect:!0,disable_search_threshold:20,display_disabled_options:!0}):setTimeout(function(){t.show(),e(t)},500)},isSameUrl=function(e,t){var n=$("base").attr("href");e=$.path.isAbsoluteUrl(e)?e:$.path.makeUrlAbsolute(e,n),t=$.path.isAbsoluteUrl(t)?t:$.path.makeUrlAbsolute(t,n);var i=$.path.parseUrl(e),s=$.path.parseUrl(t);return i.pathname.replace(/\/*$/,"")==s.pathname.replace(/\/*$/,"")&&i.search==s.search},ajaxCompleteEvent=window.ss.debounce(function(){$(window).trigger("ajaxComplete")},1e3,!0);$(window).bind("resize",positionLoadingSpinner).trigger("resize"),$(document).ajaxComplete(function(e,t,n){var i,s=t.getResponseHeader("X-ControllerURL"),a=n.url,o=null!==t.getResponseHeader("X-Status")?t.getResponseHeader("X-Status"):t.statusText,r=t.status<200||t.status>399?"bad":"good",l=["OK"];return i=window.history.state?window.history.state.path:document.URL,null===s||isSameUrl(i,s)&&isSameUrl(a,s)||_router2["default"].show(s,{id:(new Date).getTime()+String(Math.random()).replace(/\D/g,""),pjax:t.getResponseHeader("X-Pjax")?t.getResponseHeader("X-Pjax"):n.headers["X-Pjax"]}),t.getResponseHeader("X-Reauthenticate")?void $(".cms-container").showLoginDialog():(0!==t.status&&o&&$.inArray(o,l)&&statusMessage(decodeURIComponent(o),r),void ajaxCompleteEvent(this))}),$(".cms-container").entwine({StateChangeXHR:null,FragmentXHR:{},StateChangeCount:0,LayoutOptions:{minContentWidth:940,minPreviewWidth:400,mode:"content"},onadd:function(){var e=this,t=getUrlPath($("base")[0].href);return t=t.replace(/\/$/,""),_router2["default"].base(t),_config2["default"].getTopLevelRoutes().forEach(function(t){(0,_router2["default"])("/"+t+"(/*?)?",function(t,n){return"complete"!==document.readyState?n():void e.handleStateChange(null,t.state).done(n)})}),_router2["default"].start(),$.browser.msie&&parseInt($.browser.version,10)<8?($(".ss-loading-screen").append('<p class="ss-loading-incompat-warning"><span class="notice">Your browser is not compatible with the CMS interface. Please use Internet Explorer 8+, Google Chrome or Mozilla Firefox.</span></p>').css("z-index",$(".ss-loading-screen").css("z-index")+1),$(".loading-animation").remove(),void this._super()):(this.redraw(),$(".ss-loading-screen").hide(),$("body").removeClass("loading"),$(window).unbind("resize",positionLoadingSpinner),this.restoreTabState(),void this._super())},fromWindow:{onstatechange:function(e,t){this.handleStateChange(e,t)}},onwindowresize:function(){this.redraw()},"from .cms-panel":{ontoggle:function(){this.redraw()}},"from .cms-container":{onaftersubmitform:function(){this.redraw()}},"from .cms-menu-list li a":{onclick:function(e){var t=$(e.target).attr("href");e.which>1||t==this._tabStateUrl()||this.splitViewMode()}},updateLayoutOptions:function(e){var t=this.getLayoutOptions(),n=!1;for(var i in e)t[i]!==e[i]&&(t[i]=e[i],n=!0);n&&this.redraw()},splitViewMode:function(){this.updateLayoutOptions({mode:"split"})},contentViewMode:function(){this.updateLayoutOptions({mode:"content"})},previewMode:function(){this.updateLayoutOptions({mode:"preview"})},RedrawSuppression:!1,redraw:function(){this.getRedrawSuppression()||(window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.data("jlayout",jLayout.threeColumnCompressor({menu:this.children(".cms-menu"),content:this.children(".cms-content"),preview:this.children(".cms-preview")},this.getLayoutOptions())),this.layout(),this.find(".cms-panel-layout").redraw(),this.find(".cms-content-fields[data-layout-type]").redraw(),this.find(".cms-edit-form[data-layout-type]").redraw(),this.find(".cms-preview").redraw(),this.find(".cms-content").redraw())},checkCanNavigate:function(e){var t=this._findFragments(e||["Content"]),n=t.find(":data(changetracker)").add(t.filter(":data(changetracker)")),i=!0;return n.length?(n.each(function(){$(this).confirmUnsavedChanges()||(i=!1)}),i):!0},loadPanel:function(e){var t=(arguments.length<=1||void 0===arguments[1]?"":arguments[1],arguments.length<=2||void 0===arguments[2]?{}:arguments[2]),n=arguments[3],i=arguments.length<=4||void 0===arguments[4]?window.history.state.path:arguments[4];this.checkCanNavigate(t.pjax?t.pjax.split(","):["Content"])&&(this.saveTabState(),t.__forceReferer=i,n&&(t.__forceReload=Math.random()),_router2["default"].show(e,t))},reloadCurrentPanel:function(){this.loadPanel(window.history.state.path,null,null,!0)},submitForm:function(e,t,n,i){var s=this;t||(t=this.find(".Actions :submit[name=action_save]")),t||(t=this.find(".Actions :submit:first")),e.trigger("beforesubmitform"),this.trigger("submitform",{form:e,button:t}),$(t).addClass("loading");var a=e.validate();if("undefined"!=typeof a&&!a)return statusMessage("Validation failed.","bad"),$(t).removeClass("loading"),!1;var o=e.serializeArray();return o.push({name:$(t).attr("name"),value:"1"}),o.push({name:"BackURL",value:window.history.state.path.replace(/\/$/,"")}),this.saveTabState(),jQuery.ajax(jQuery.extend({headers:{"X-Pjax":"CurrentForm,Breadcrumbs"},url:e.attr("action"),data:o,type:"POST",complete:function(){$(t).removeClass("loading")},success:function(t,i,a){e.removeClass("changed"),n&&n(t,i,a);var r=s.handleAjaxResponse(t,i,a);r&&r.filter("form").trigger("aftersubmitform",{status:i,xhr:a,formData:o})}},i)),!1},LastState:null,PauseState:!1,handleStateChange:function(e){var t=arguments.length<=1||void 0===arguments[1]?window.history.state:arguments[1];if(!this.getPauseState()){this.getStateChangeXHR()&&this.getStateChangeXHR().abort();var n=this,i=t.pjax||"Content",s={},a=i.split(","),o=this._findFragments(a);if(this.setStateChangeCount(this.getStateChangeCount()+1),!this.checkCanNavigate()){var r=this.getLastState();return this.setPauseState(!0),null!==r?_router2["default"].show(r.url):_router2["default"].back(),void this.setPauseState(!1)}if(this.setLastState(t),o.length<a.length&&(i="Content",a=["Content"],o=this._findFragments(a)),this.trigger("beforestatechange",{state:t,element:o}),s["X-Pjax"]=i,"undefined"!=typeof t.__forceReferer){var l=t.__forceReferer;try{l=decodeURI(l)}catch(d){}finally{s["X-Backurl"]=encodeURI(l)}}o.addClass("loading");var c=$.ajax({headers:s,url:t.path}).done(function(e,i,s){var a=n.handleAjaxResponse(e,i,s,t);n.trigger("afterstatechange",{data:e,status:i,xhr:s,element:a,state:t})}).always(function(){n.setStateChangeXHR(null),o.removeClass("loading")});return this.setStateChangeXHR(c),c}},loadFragment:function(e,t){var n,i=this,s={},a=$("base").attr("href"),o=this.getFragmentXHR();return"undefined"!=typeof o[t]&&null!==o[t]&&(o[t].abort(),o[t]=null),e=$.path.isAbsoluteUrl(e)?e:$.path.makeUrlAbsolute(e,a),s["X-Pjax"]=t,n=$.ajax({headers:s,url:e,success:function(e,t,n){var s=i.handleAjaxResponse(e,t,n,null);i.trigger("afterloadfragment",{data:e,status:t,xhr:n,elements:s})},error:function(e,t,n){i.trigger("loadfragmenterror",{xhr:e,status:t,error:n})},complete:function(){var e=i.getFragmentXHR();"undefined"!=typeof e[t]&&null!==e[t]&&(e[t]=null)}}),o[t]=n,n},handleAjaxResponse:function(e,t,n,i){var s,a,o,r;if(n.getResponseHeader("X-Reload")&&n.getResponseHeader("X-ControllerURL")){var l=$("base").attr("href"),d=n.getResponseHeader("X-ControllerURL"),s=$.path.isAbsoluteUrl(d)?d:$.path.makeUrlAbsolute(d,l);return void(document.location.href=s)}if(e){var c=n.getResponseHeader("X-Title");c&&(document.title=decodeURIComponent(c.replace(/\+/g," ")));var u,h={};n.getResponseHeader("Content-Type").match(/^((text)|(application))\/json[ \t]*;?/i)?h=e:(o=document.createDocumentFragment(),jQuery.clean([e],document,o,[]),r=$(jQuery.merge([],o.childNodes)),a="Content",r.is("form")&&!r.is("[data-pjax-fragment~=Content]")&&(a="CurrentForm"),h[a]=r),this.setRedrawSuppression(!0);try{$.each(h,function(e,t){var n=$("[data-pjax-fragment]").filter(function(){return-1!=$.inArray(e,$(this).data("pjaxFragment").split(" "))}),i=$(t);if(u?u.add(i):u=i,i.find(".cms-container").length)throw'Content loaded via ajax is not allowed to contain tags matching the ".cms-container" selector to avoid infinite loops';var s=n.attr("style"),a=n.parent(),o="undefined"!=typeof a.data("jlayout"),r=["east","west","center","north","south","column-hidden"],l=n.attr("class"),d=[];l&&(d=$.grep(l.split(" "),function(e){return $.inArray(e,r)>=0})),i.removeClass(r.join(" ")).addClass(d.join(" ")),s&&i.attr("style",s);var c=i.find("style").detach();c.length&&$(document).find("head").append(c),n.replaceWith(i),!a.is(".cms-container")&&o&&a.layout()});var f=u.filter("form");f.hasClass("cms-tabset")&&f.removeClass("cms-tabset").addClass("cms-tabset")}finally{this.setRedrawSuppression(!1)}return this.redraw(),this.restoreTabState(i&&"undefined"!=typeof i.tabState?i.tabState:null),u}},_findFragments:function(e){return $("[data-pjax-fragment]").filter(function(){var t,n=$(this).data("pjaxFragment").split(" ");for(t in e)if(-1!=$.inArray(e[t],n))return!0;return!1})},refresh:function(){$(window).trigger("statechange"),$(this).redraw()},saveTabState:function(){if("undefined"!=typeof window.sessionStorage&&null!==window.sessionStorage){var e=[],t=this._tabStateUrl();if(this.find(".cms-tabset,.ss-tabset").each(function(t,n){var i=$(n).attr("id");i&&$(n).data("tabs")&&($(n).data("ignoreTabState")||$(n).getIgnoreTabState()||e.push({id:i,selected:$(n).tabs("option","selected")}))}),e){var n="tabs-"+t;try{window.sessionStorage.setItem(n,JSON.stringify(e))}catch(i){if(i.code===DOMException.QUOTA_EXCEEDED_ERR&&0===window.sessionStorage.length)return;throw i}}}},restoreTabState:function(e){var t=this,n=this._tabStateUrl(),i="undefined"!=typeof window.sessionStorage&&window.sessionStorage,s=i?window.sessionStorage.getItem("tabs-"+n):null,a=s?JSON.parse(s):!1;this.find(".cms-tabset, .ss-tabset").each(function(){var n,i,s=$(this),o=s.attr("id"),r=s.find(".ss-tabs-force-active");s.data("tabs")&&(s.tabs("refresh"),r.length?n=r.index():e&&e[o]?(i=s.find(e[o].tabSelector),i.length&&(n=i.index())):a&&$.each(a,function(e,t){s.is("#"+t.id)&&(n=t.selected)}),null!==n&&(s.tabs("option","active",n),t.trigger("tabstaterestored")))})},clearTabState:function(e){if("undefined"!=typeof window.sessionStorage){var t=window.sessionStorage;if(e)t.removeItem("tabs-"+e);else for(var n=0;n<t.length;n++)t.key(n).match(/^tabs-/)&&t.removeItem(t.key(n))}},clearCurrentTabState:function(){this.clearTabState(this._tabStateUrl())},_tabStateUrl:function(){return window.history.state.path.replace(/\?.*/,"").replace(/#.*/,"").replace($("base").attr("href"),"")},showLoginDialog:function(){var e=$("body").data("member-tempid"),t=$(".leftandmain-logindialog"),n="CMSSecurity/login";t.length&&t.remove(),n=$.path.addSearchParams(n,{tempid:e,BackURL:window.location.href}),t=$('<div class="leftandmain-logindialog"></div>'),t.attr("id",(new Date).getTime()),t.data("url",n),$("body").append(t)}}),$(".leftandmain-logindialog").entwine({onmatch:function(){this._super(),this.ssdialog({iframeUrl:this.data("url"),dialogClass:"leftandmain-logindialog-dialog",autoOpen:!0,minWidth:500,maxWidth:500,minHeight:370,maxHeight:400,closeOnEscape:!1,open:function(){$(".ui-widget-overlay").addClass("leftandmain-logindialog-overlay")},close:function(){$(".ui-widget-overlay").removeClass("leftandmain-logindialog-overlay")}})},onunmatch:function(){this._super()},open:function(){this.ssdialog("open")},close:function(){this.ssdialog("close")},toggle:function(e){this.is(":visible")?this.close():this.open()},reauthenticate:function(e){"undefined"!=typeof e.SecurityID&&$(":input[name=SecurityID]").val(e.SecurityID),"undefined"!=typeof e.TempID&&$("body").data("member-tempid",e.TempID),this.close()}}),$("form.loading,.cms-content.loading,.cms-content-fields.loading,.cms-content-view.loading").entwine({onmatch:function(){this.append('<div class="cms-content-loading-overlay ui-widget-overlay-light"></div><div class="cms-content-loading-spinner"></div>'),this._super()},onunmatch:function(){this.find(".cms-content-loading-overlay,.cms-content-loading-spinner").remove(),this._super()}}),$('.cms input[type="submit"], .cms button, .cms input[type="reset"], .cms .ss-ui-button').entwine({onadd:function(){this.addClass("ss-ui-button"),this.data("button")||this.button(),this._super()},onremove:function(){this.data("button")&&this.button("destroy"),this._super()}}),$(".cms .cms-panel-link").entwine({onclick:function(e){if($(this).hasClass("external-link"))return void e.stopPropagation();var t=this.attr("href"),n=t&&!t.match(/^#/)?t:this.data("href"),i={pjax:this.data("pjaxTarget")};$(".cms-container").loadPanel(n,null,i),e.preventDefault()}}),$(".cms .ss-ui-button-ajax").entwine({onclick:function onclick(e){$(this).removeClass("ui-button-text-only"),$(this).addClass("ss-ui-button-loading ui-button-text-icons");var loading=$(this).find(".ss-ui-loading-icon");loading.length<1&&(loading=$("<span></span>").addClass("ss-ui-loading-icon ui-button-icon-primary ui-icon"),$(this).prepend(loading)),loading.show();var href=this.attr("href"),url=href?href:this.data("href");jQuery.ajax({url:url,complete:function complete(xmlhttp,status){var msg=xmlhttp.getResponseHeader("X-Status")?xmlhttp.getResponseHeader("X-Status"):xmlhttp.responseText;try{"undefined"!=typeof msg&&null!==msg&&eval(msg)}catch(e){}loading.hide(),$(".cms-container").refresh(),$(this).removeClass("ss-ui-button-loading ui-button-text-icons"),$(this).addClass("ui-button-text-only")},dataType:"html"}),e.preventDefault()}}),$(".cms .ss-ui-dialog-link").entwine({UUID:null,onmatch:function(){this._super(),this.setUUID((new Date).getTime())},onunmatch:function(){this._super()},onclick:function(){this._super();var e="ss-ui-dialog-"+this.getUUID(),t=$("#"+e);t.length||(t=$('<div class="ss-ui-dialog" id="'+e+'" />'),$("body").append(t));var n=this.data("popupclass")?this.data("popupclass"):"";return t.ssdialog({iframeUrl:this.attr("href"),autoOpen:!0,dialogExtraClass:n}),!1}}),$(".cms-content .Actions").entwine({onmatch:function(){this.find(".ss-ui-button").click(function(){var e=this.form;e&&(e.clickedButton=this,setTimeout(function(){e.clickedButton=null},10))}),this.redraw(),this._super()},onunmatch:function(){this._super()},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0)),this.contents().filter(function(){return 3==this.nodeType&&!/\S/.test(this.nodeValue)}).remove(),this.find(".ss-ui-button").each(function(){$(this).data("button")||$(this).button()}),this.find(".ss-ui-buttonset").buttonset()}}),$(".cms .field.date input.text").entwine({onmatch:function(){var e=$(this).parents(".field.date:first"),t=e.data();return t.showcalendar?(t.showOn="button",t.locale&&$.datepicker.regional[t.locale]&&(t=$.extend(t,$.datepicker.regional[t.locale],{})),$(this).datepicker(t),void this._super()):void this._super()},onunmatch:function(){this._super()}}),$(".cms .field.dropdown select, .cms .field select[multiple], .fieldholder-small select.dropdown").entwine({onmatch:function(){return this.is(".no-chosen")?void this._super():(this.data("placeholder")||this.data("placeholder"," "),this.removeClass("has-chosen").chosen("destroy"),this.siblings(".chosen-container").remove(),applyChosen(this),void this._super())},onunmatch:function(){this._super()}}),$(".cms-panel-layout").entwine({redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0))}}),$(".cms .ss-gridfield").entwine({showDetailView:function(e){var t=window.location.search.replace(/^\?/,"");t&&(e=$.path.addSearchParams(e,t)),$(".cms-container").loadPanel(e)}}),$(".cms-search-form").entwine({onsubmit:function(e){var t,n;t=this.find(":input:not(:submit)").filter(function(){var e=$.grep($(this).fieldValue(),function(e){return e});return e.length}),n=this.attr("action"),t.length&&(n=$.path.addSearchParams(n,t.serialize().replace("+","%20")));var i=this.closest(".cms-container");return i.find(".cms-edit-form").tabs("select",0),i.loadPanel(n,"",{},!0),!1}}),$(".cms-search-form button[type=reset], .cms-search-form input[type=reset]").entwine({onclick:function(e){e.preventDefault();var t=$(this).parents("form");t.clearForm(),t.find(".dropdown select").prop("selectedIndex",0).trigger("chosen:updated"),t.submit()}}),window._panelDeferredCache={},$(".cms-panel-deferred").entwine({onadd:function(){this._super(),this.redraw()},onremove:function(){window.debug&&console.log("saving",this.data("url"),this),this.data("deferredNoCache")||(window._panelDeferredCache[this.data("url")]=this.html()),this._super()},redraw:function(){window.debug&&console.log("redraw",this.attr("class"),this.get(0));var e=this,t=this.data("url");if(!t)throw'Elements of class .cms-panel-deferred need a "data-url" attribute';this._super(),this.children().length||(this.data("deferredNoCache")||"undefined"==typeof window._panelDeferredCache[t]?(this.addClass("loading"),$.ajax({url:t,complete:function(){e.removeClass("loading")},success:function(t,n,i){e.html(t)}})):this.html(window._panelDeferredCache[t]))}}),$(".cms-tabset").entwine({onadd:function(){this.redrawTabs(),this._super()},onremove:function(){this.data("tabs")&&this.tabs("destroy"),this._super()},redrawTabs:function(){this.rewriteHashlinks();var e=(this.attr("id"),this.find("ul:first .ui-tabs-active"));this.data("uiTabs")||this.tabs({active:-1!=e.index()?e.index():0,beforeLoad:function(e,t){return!1},activate:function(e,t){var n=$(this).closest("form").find(".Actions");$(t.newTab).closest("li").hasClass("readonly")?n.fadeOut():n.show()}})},rewriteHashlinks:function(){$(this).find("ul a").each(function(){if($(this).attr("href")){var e=$(this).attr("href").match(/#.*/);e&&$(this).attr("href",document.location.href.replace(/#.*/,"")+e[0])}})}}),$("#filters-button").entwine({onmatch:function(){this._super(),this.data("collapsed",!0),this.data("animating",!1);
},onunmatch:function(){this._super()},showHide:function(){var e=this,t=$(".cms-content-filters").first(),n=this.data("collapsed");this.data("animating")||(this.toggleClass("active"),this.data("animating",!0),t[n?"slideDown":"slideUp"]({complete:function(){e.data("collapsed",!n),e.data("animating",!1)}}))},onclick:function(){this.showHide()}})});var statusMessage=function(e,t){e=jQuery("<div/>").text(e).html(),jQuery.noticeAdd({text:e,type:t,stayTime:5e3,inEffect:{left:"0",opacity:"show"}})},errorMessage=function(e){jQuery.noticeAdd({text:e,type:"error",stayTime:5e3,inEffect:{left:"0",opacity:"show"}})}},{config:"config",jQuery:"jQuery",router:"router"}]},{},[1]);
//# sourceMappingURL=bundle-legacy.js.map

View File

@ -27,6 +27,6 @@ this.length=1,this;if("body"===e&&!n&&M.body)return this.context=M,this[0]=M.bod
r.length&&(c=c.add(r))}else{if("string"==typeof t&&(t={data:t}),!t.data&&""!==t.data)return c;c=e("<li />"),t.attr&&c.attr(t.attr),t.metadata&&c.data(t.metadata),t.state&&c.addClass("jstree-"+t.state),e.isArray(t.data)||(r=t.data,t.data=[],t.data.push(r)),e.each(t.data,function(n,i){r=e("<a />"),e.isFunction(i)&&(i=i.call(this,t)),"string"==typeof i?r.attr("href","#")[h?"html":"text"](i):(i.attr||(i.attr={}),i.attr.href||(i.attr.href="#"),r.attr(i.attr)[h?"html":"text"](i.title),i.language&&r.addClass(i.language)),r.prepend("<ins class='jstree-icon'>&#160;</ins>"),!i.icon&&t.icon&&(i.icon=t.icon),i.icon&&(-1===i.icon.indexOf("/")?r.children("ins").addClass(i.icon):r.children("ins").css("background","url('"+i.icon+"') center center no-repeat")),c.append(r)}),c.prepend("<ins class='jstree-icon'>&#160;</ins>"),t.children&&(d.progressive_render&&"open"!==t.state?c.addClass("jstree-closed").data("jstree_children",t.children):(d.progressive_unload&&c.data("jstree_children",t.children),e.isArray(t.children)&&t.children.length&&(r=this._parse_json(t.children,n,!0),r.length&&(l=e("<ul />"),l.append(r),c.append(l)))))}return i||(a=e("<ul />"),a.append(c),c=a),c},get_json:function(t,n,i,r){var o,s,a,l,c,u,d=[],h=this._get_settings(),p=this;return t=this._get_node(t),t&&-1!==t||(t=this.get_container().find("> ul > li")),n=e.isArray(n)?n:["id","class"],!r&&this.data.types&&n.push(h.types.type_attr),i=e.isArray(i)?i:[],t.each(function(){a=e(this),o={data:[]},n.length&&(o.attr={}),e.each(n,function(e,t){s=a.attr(t),s&&s.length&&s.replace(/jstree[^ ]*/gi,"").length&&(o.attr[t]=(" "+s).replace(/ jstree[^ ]*/gi,"").replace(/\s+$/gi," ").replace(/^ /,"").replace(/ $/,""))}),a.hasClass("jstree-open")&&(o.state="open"),a.hasClass("jstree-closed")&&(o.state="closed"),a.data()&&(o.metadata=a.data()),l=a.children("a"),l.each(function(){c=e(this),i.length||-1!==e.inArray("languages",h.plugins)||c.children("ins").get(0).style.backgroundImage.length||c.children("ins").get(0).className&&c.children("ins").get(0).className.replace(/jstree[^ ]*|$/gi,"").length?(u=!1,-1!==e.inArray("languages",h.plugins)&&e.isArray(h.languages)&&h.languages.length&&e.each(h.languages,function(e,t){return c.hasClass(t)?(u=t,!1):void 0}),s={attr:{},title:p.get_text(c,u)},e.each(i,function(e,t){s.attr[t]=(" "+(c.attr(t)||"")).replace(/ jstree[^ ]*/gi,"").replace(/\s+$/gi," ").replace(/^ /,"").replace(/ $/,"")}),-1!==e.inArray("languages",h.plugins)&&e.isArray(h.languages)&&h.languages.length&&e.each(h.languages,function(e,t){return c.hasClass(t)?(s.language=t,!0):void 0}),c.children("ins").get(0).className.replace(/jstree[^ ]*|$/gi,"").replace(/^\s+$/gi,"").length&&(s.icon=c.children("ins").get(0).className.replace(/jstree[^ ]*|$/gi,"").replace(/\s+$/gi," ").replace(/^ /,"").replace(/ $/,"")),c.children("ins").get(0).style.backgroundImage.length&&(s.icon=c.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""))):s=p.get_text(c),l.length>1?o.data.push(s):o.data=s}),a=a.find("> ul > li"),a.length&&(o.children=p.get_json(a,n,i,!0)),d.push(o)}),d}}})}(jQuery),function(e){var t=!1;e.jstree.plugin("languages",{__init:function(){this._load_css()},defaults:[],_fn:{set_lang:function(n){var i=this._get_settings().languages,r=!1,o=".jstree-"+this.get_index()+" a";if(!e.isArray(i)||0===i.length)return!1;if(-1==e.inArray(n,i)){if(!i[n])return!1;n=i[n]}return n==this.data.languages.current_language?!0:(r=e.vakata.css.get_css(o+"."+this.data.languages.current_language,!1,t),r!==!1&&(r.style.display="none"),r=e.vakata.css.get_css(o+"."+n,!1,t),r!==!1&&(r.style.display=""),this.data.languages.current_language=n,this.__callback(n),!0)},get_lang:function(){return this.data.languages.current_language},_get_string:function(t,n){var i=this._get_settings().languages,r=this._get_settings().core.strings;return e.isArray(i)&&i.length&&(n=n&&-1!=e.inArray(n,i)?n:this.data.languages.current_language),r[n]&&r[n][t]?r[n][t]:r[t]?r[t]:t},get_text:function(t,n){if(t=this._get_node(t)||this.data.ui.last_selected,!t.size())return!1;var i=this._get_settings().languages,r=this._get_settings().core.html_titles;return e.isArray(i)&&i.length?(n=n&&-1!=e.inArray(n,i)?n:this.data.languages.current_language,t=t.children("a."+n)):t=t.children("a:eq(0)"),r?(t=t.clone(),t.children("INS").remove(),t.html()):(t=t.contents().filter(function(){return 3==this.nodeType})[0],t.nodeValue)},set_text:function(t,n,i){if(t=this._get_node(t)||this.data.ui.last_selected,!t.size())return!1;var r,o=this._get_settings().languages,s=this._get_settings().core.html_titles;return e.isArray(o)&&o.length?(i=i&&-1!=e.inArray(i,o)?i:this.data.languages.current_language,t=t.children("a."+i)):t=t.children("a:eq(0)"),s?(r=t.children("INS").clone(),t.html(n).prepend(r),this.__callback({obj:t,name:n,lang:i}),!0):(t=t.contents().filter(function(){return 3==this.nodeType})[0],this.__callback({obj:t,name:n,lang:i}),t.nodeValue=n)},_load_css:function(){var n,i=this._get_settings().languages,r="/* languages css */",o=".jstree-"+this.get_index()+" a";if(e.isArray(i)&&i.length){for(this.data.languages.current_language=i[0],n=0;n<i.length;n++)r+=o+"."+i[n]+" {",i[n]!=this.data.languages.current_language&&(r+=" display:none; "),r+=" } ";t=e.vakata.css.add_sheet({str:r,title:"jstree-languages"})}},create_node:function(t,n,i,r){var o=this.__call_old(!0,t,n,i,function(t){var n,i=this._get_settings().languages,o=t.children("a");if(e.isArray(i)&&i.length){for(n=0;n<i.length;n++)o.is("."+i[n])||t.append(o.eq(0).clone().removeClass(i.join(" ")).addClass(i[n]));o.not("."+i.join(", .")).remove()}r&&r.call(this,t)});return o}}})}(jQuery),function(e){e.jstree.plugin("cookies",{__init:function(){if("undefined"==typeof e.cookie)throw"jsTree cookie: jQuery cookie plugin not included.";var t,n=this._get_settings().cookies;n.save_loaded&&(t=e.cookie(n.save_loaded),t&&t.length&&(this.data.core.to_load=t.split(","))),n.save_opened&&(t=e.cookie(n.save_opened),t&&t.length&&(this.data.core.to_open=t.split(","))),n.save_selected&&(t=e.cookie(n.save_selected),t&&t.length&&this.data.ui&&(this.data.ui.to_select=t.split(","))),this.get_container().one((this.data.ui?"reselect":"reopen")+".jstree",e.proxy(function(){this.get_container().bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree",e.proxy(function(e){this._get_settings().cookies.auto_save&&this.save_cookie((e.handleObj.namespace+e.handleObj.type).replace("jstree",""))},this))},this))},defaults:{save_loaded:"jstree_load",save_opened:"jstree_open",save_selected:"jstree_select",auto_save:!0,cookie_options:{}},_fn:{save_cookie:function(t){if(!this.data.core.refreshing){var n=this._get_settings().cookies;if(!t)return n.save_loaded&&(this.save_loaded(),e.cookie(n.save_loaded,this.data.core.to_load.join(","),n.cookie_options)),n.save_opened&&(this.save_opened(),e.cookie(n.save_opened,this.data.core.to_open.join(","),n.cookie_options)),void(n.save_selected&&this.data.ui&&(this.save_selected(),e.cookie(n.save_selected,this.data.ui.to_select.join(","),n.cookie_options)));switch(t){case"open_node":case"close_node":n.save_opened&&(this.save_opened(),e.cookie(n.save_opened,this.data.core.to_open.join(","),n.cookie_options)),n.save_loaded&&(this.save_loaded(),e.cookie(n.save_loaded,this.data.core.to_load.join(","),n.cookie_options));break;case"select_node":case"deselect_node":n.save_selected&&this.data.ui&&(this.save_selected(),e.cookie(n.save_selected,this.data.ui.to_select.join(","),n.cookie_options))}}}}})}(jQuery),function(e){e.jstree.plugin("sort",{__init:function(){this.get_container().bind("load_node.jstree",e.proxy(function(e,t){var n=this._get_node(t.rslt.obj);n=-1===n?this.get_container().children("ul"):n.children("ul"),this.sort(n)},this)).bind("rename_node.jstree create_node.jstree create.jstree",e.proxy(function(e,t){this.sort(t.rslt.obj.parent())},this)).bind("move_node.jstree",e.proxy(function(e,t){var n=-1==t.rslt.np?this.get_container():t.rslt.np;this.sort(n.children("ul"))},this))},defaults:function(e,t){return this.get_text(e)>this.get_text(t)?1:-1},_fn:{sort:function(t){var n=this._get_settings().sort,i=this;t.append(e.makeArray(t.children("li")).sort(e.proxy(n,i))),t.find("> li > ul").each(function(){i.sort(e(this))}),this.clean_node(t)}}})}(jQuery),function(e){var t=!1,n=!1,i=!1,r=!1,o=!1,s=!1,a=!1,l=!1,c=!1;e.vakata.dnd={is_down:!1,is_drag:!1,helper:!1,scroll_spd:10,init_x:0,init_y:0,threshold:5,helper_left:5,helper_top:10,user_data:{},drag_start:function(t,n,i){e.vakata.dnd.is_drag&&e.vakata.drag_stop({});try{t.currentTarget.unselectable="on",t.currentTarget.onselectstart=function(){return!1},t.currentTarget.style&&(t.currentTarget.style.MozUserSelect="none")}catch(r){}return e.vakata.dnd.init_x=t.pageX,e.vakata.dnd.init_y=t.pageY,e.vakata.dnd.user_data=n,e.vakata.dnd.is_down=!0,e.vakata.dnd.helper=e("<div id='vakata-dragged' />").html(i),e(document).bind("mousemove",e.vakata.dnd.drag),e(document).bind("mouseup",e.vakata.dnd.drag_stop),!1},drag:function(t){if(e.vakata.dnd.is_down){if(!e.vakata.dnd.is_drag){if(!(Math.abs(t.pageX-e.vakata.dnd.init_x)>5||Math.abs(t.pageY-e.vakata.dnd.init_y)>5))return;e.vakata.dnd.helper.appendTo("body"),e.vakata.dnd.is_drag=!0,e(document).triggerHandler("drag_start.vakata",{event:t,data:e.vakata.dnd.user_data})}if("mousemove"===t.type){var n=e(document),i=n.scrollTop(),r=n.scrollLeft();t.pageY-i<20?(s&&"down"===a&&(clearInterval(s),s=!1),s||(a="up",s=setInterval(function(){e(document).scrollTop(e(document).scrollTop()-e.vakata.dnd.scroll_spd)},150))):s&&"up"===a&&(clearInterval(s),s=!1),e(window).height()-(t.pageY-i)<20?(s&&"up"===a&&(clearInterval(s),s=!1),s||(a="down",s=setInterval(function(){e(document).scrollTop(e(document).scrollTop()+e.vakata.dnd.scroll_spd)},150))):s&&"down"===a&&(clearInterval(s),s=!1),t.pageX-r<20?(o&&"right"===l&&(clearInterval(o),o=!1),o||(l="left",o=setInterval(function(){e(document).scrollLeft(e(document).scrollLeft()-e.vakata.dnd.scroll_spd)},150))):o&&"left"===l&&(clearInterval(o),o=!1),e(window).width()-(t.pageX-r)<20?(o&&"left"===l&&(clearInterval(o),o=!1),o||(l="right",o=setInterval(function(){e(document).scrollLeft(e(document).scrollLeft()+e.vakata.dnd.scroll_spd)},150))):o&&"right"===l&&(clearInterval(o),o=!1)}e.vakata.dnd.helper.css({left:t.pageX+e.vakata.dnd.helper_left+"px",top:t.pageY+e.vakata.dnd.helper_top+"px"}),e(document).triggerHandler("drag.vakata",{event:t,data:e.vakata.dnd.user_data})}},drag_stop:function(t){o&&clearInterval(o),s&&clearInterval(s),e(document).unbind("mousemove",e.vakata.dnd.drag),e(document).unbind("mouseup",e.vakata.dnd.drag_stop),e(document).triggerHandler("drag_stop.vakata",{event:t,data:e.vakata.dnd.user_data}),e.vakata.dnd.helper.remove(),e.vakata.dnd.init_x=0,e.vakata.dnd.init_y=0,e.vakata.dnd.user_data={},e.vakata.dnd.is_down=!1,e.vakata.dnd.is_drag=!1}},e(function(){var t="#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ";e.vakata.css.add_sheet({str:t,title:"vakata"})}),e.jstree.plugin("dnd",{__init:function(){this.data.dnd={active:!1,after:!1,inside:!1,before:!1,off:!1,prepared:!1,w:0,to1:!1,to2:!1,cof:!1,cw:!1,ch:!1,i1:!1,i2:!1,mto:!1},this.get_container().bind("mouseenter.jstree",e.proxy(function(n){if(e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&(this.data.themes&&(i.attr("class","jstree-"+this.data.themes.theme),r&&r.attr("class","jstree-"+this.data.themes.theme),e.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)),n.currentTarget===n.target&&e.vakata.dnd.user_data.obj&&e(e.vakata.dnd.user_data.obj).length&&e(e.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==n.target)){var o,s=e.jstree._reference(n.target);s.data.dnd.foreign?(o=s._get_settings().dnd.drag_check.call(this,{o:t,r:s.get_container(),is_root:!0}),o!==!0&&o.inside!==!0&&o.before!==!0&&o.after!==!0||e.vakata.dnd.helper.children("ins").attr("class","jstree-ok")):(s.prepare_move(t,s.get_container(),"last"),s.check_move()&&e.vakata.dnd.helper.children("ins").attr("class","jstree-ok"))}},this)).bind("mouseup.jstree",e.proxy(function(n){if(e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&n.currentTarget===n.target&&e.vakata.dnd.user_data.obj&&e(e.vakata.dnd.user_data.obj).length&&e(e.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0]!==n.target){var i,r=e.jstree._reference(n.currentTarget);r.data.dnd.foreign?(i=r._get_settings().dnd.drag_check.call(this,{o:t,r:r.get_container(),is_root:!0}),i!==!0&&i.inside!==!0&&i.before!==!0&&i.after!==!0||r._get_settings().dnd.drag_finish.call(this,{o:t,r:r.get_container(),is_root:!0})):r.move_node(t,r.get_container(),"last",n[r._get_settings().dnd.copy_modifier+"Key"])}},this)).bind("mouseleave.jstree",e.proxy(function(t){return t.relatedTarget&&t.relatedTarget.id&&"jstree-marker-line"===t.relatedTarget.id?!1:void(e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),e.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&e.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")))},this)).bind("mousemove.jstree",e.proxy(function(t){if(e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree){var n=this.get_container()[0];t.pageX+24>this.data.dnd.cof.left+this.data.dnd.cw?(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i1=setInterval(e.proxy(function(){this.scrollLeft+=e.vakata.dnd.scroll_spd},n),100)):t.pageX-24<this.data.dnd.cof.left?(this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i1=setInterval(e.proxy(function(){this.scrollLeft-=e.vakata.dnd.scroll_spd},n),100)):this.data.dnd.i1&&clearInterval(this.data.dnd.i1),t.pageY+24>this.data.dnd.cof.top+this.data.dnd.ch?(this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.i2=setInterval(e.proxy(function(){this.scrollTop+=e.vakata.dnd.scroll_spd},n),100)):t.pageY-24<this.data.dnd.cof.top?(this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.i2=setInterval(e.proxy(function(){this.scrollTop-=e.vakata.dnd.scroll_spd},n),100)):this.data.dnd.i2&&clearInterval(this.data.dnd.i2)}},this)).bind("scroll.jstree",e.proxy(function(t){e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&i&&r&&(i.hide(),r.hide())},this)).delegate("a","mousedown.jstree",e.proxy(function(e){return 1===e.which?(this.start_drag(e.currentTarget,e),!1):void 0},this)).delegate("a","mouseenter.jstree",e.proxy(function(t){e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&this.dnd_enter(t.currentTarget)},this)).delegate("a","mousemove.jstree",e.proxy(function(t){e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&(n&&n.length&&n.children("a")[0]===t.currentTarget||this.dnd_enter(t.currentTarget),"undefined"==typeof this.data.dnd.off.top&&(this.data.dnd.off=e(t.target).offset()),this.data.dnd.w=(t.pageY-(this.data.dnd.off.top||0))%this.data.core.li_height,this.data.dnd.w<0&&(this.data.dnd.w+=this.data.core.li_height),this.dnd_show())},this)).delegate("a","mouseleave.jstree",e.proxy(function(t){if(e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree){if(t.relatedTarget&&t.relatedTarget.id&&"jstree-marker-line"===t.relatedTarget.id)return!1;i&&i.hide(),r&&r.hide(),this.data.dnd.mto=setTimeout(function(e){return function(){e.dnd_leave(t)}}(this),0)}},this)).delegate("a, #jstree-marker-line","mouseup.jstree",e.proxy(function(t){e.vakata.dnd.is_drag&&e.vakata.dnd.user_data.jstree&&this.dnd_finish(t)},this)),e(document).bind("drag_stop.vakata",e.proxy(function(){this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),this.data.dnd.i1&&clearInterval(this.data.dnd.i1),this.data.dnd.i2&&clearInterval(this.data.dnd.i2),this.data.dnd.after=!1,this.data.dnd.before=!1,this.data.dnd.inside=!1,this.data.dnd.off=!1,this.data.dnd.prepared=!1,this.data.dnd.w=!1,this.data.dnd.to1=!1,this.data.dnd.to2=!1,this.data.dnd.i1=!1,this.data.dnd.i2=!1,this.data.dnd.active=!1,this.data.dnd.foreign=!1,i&&i.css({top:"-2000px"}),r&&r.css({top:"-2000px"})},this)).bind("drag_start.vakata",e.proxy(function(t,n){if(n.data.jstree){var i=e(n.event.target);i.closest(".jstree").hasClass("jstree-"+this.get_index())&&this.dnd_enter(i)}},this));var o=this._get_settings().dnd;o.drag_target&&e(document).delegate(o.drag_target,"mousedown.jstree-"+this.get_index(),e.proxy(function(n){t=n.target,e.vakata.dnd.drag_start(n,{jstree:!0,obj:n.target},"<ins class='jstree-icon'></ins>"+e(n.target).text()),this.data.themes&&(i&&i.attr("class","jstree-"+this.data.themes.theme),r&&r.attr("class","jstree-"+this.data.themes.theme),e.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)),e.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");var o=this.get_container();this.data.dnd.cof=o.offset(),this.data.dnd.cw=parseInt(o.width(),10),this.data.dnd.ch=parseInt(o.height(),10),this.data.dnd.foreign=!0,n.preventDefault()},this)),o.drop_target&&e(document).delegate(o.drop_target,"mouseenter.jstree-"+this.get_index(),e.proxy(function(n){this.data.dnd.active&&this._get_settings().dnd.drop_check.call(this,{o:t,r:e(n.target),e:n})&&e.vakata.dnd.helper.children("ins").attr("class","jstree-ok")},this)).delegate(o.drop_target,"mouseleave.jstree-"+this.get_index(),e.proxy(function(t){this.data.dnd.active&&e.vakata.dnd.helper.children("ins").attr("class","jstree-invalid")},this)).delegate(o.drop_target+", #jstree-marker-line","mouseup.jstree-"+this.get_index(),e.proxy(function(n){this.data.dnd.active&&e.vakata.dnd.helper.children("ins").hasClass("jstree-ok")&&this._get_settings().dnd.drop_finish.call(this,{o:t,r:e(n.target),e:n})},this))},defaults:{copy_modifier:"ctrl",check_timeout:100,open_timeout:500,drop_target:".jstree-drop",drop_check:function(e){return!0},drop_finish:e.noop,drag_target:".jstree-draggable",drag_finish:e.noop,drag_check:function(e){return{after:!1,before:!1,inside:!0}}},__destroy:function(){e(".jstree").length<=1&&e(document).unbind("drag_start.vakata").unbind("drag_stop.vakata"),t=!1},_fn:{dnd_prepare:function(){if(n&&n.length){if(this.data.dnd.off=n.offset(),this._get_settings().core.rtl&&(this.data.dnd.off.right=this.data.dnd.off.left+n.width()),this.data.dnd.foreign){var e=this._get_settings().dnd.drag_check.call(this,{o:t,r:n});return this.data.dnd.after=e.after,this.data.dnd.before=e.before,this.data.dnd.inside=e.inside,this.data.dnd.prepared=!0,this.dnd_show()}return this.prepare_move(t,n,"before"),this.data.dnd.before=this.check_move(),this.prepare_move(t,n,"after"),this.data.dnd.after=this.check_move(),this._is_loaded(n)?(this.prepare_move(t,n,"inside"),this.data.dnd.inside=this.check_move()):this.data.dnd.inside=!1,this.data.dnd.prepared=!0,this.dnd_show()}},dnd_show:function(){if(this.data.dnd.prepared){var t,n=["before","inside","after"],o=!1,s=this._get_settings().core.rtl;switch(n=this.data.dnd.w<this.data.core.li_height/3?["before","inside","after"]:this.data.dnd.w<=2*this.data.core.li_height/3?this.data.dnd.w<this.data.core.li_height/2?["inside","before","after"]:["inside","after","before"]:["after","inside","before"],e.each(n,e.proxy(function(t,n){return this.data.dnd[n]?(e.vakata.dnd.helper.children("ins").attr("class","jstree-ok"),o=n,!1):void 0},this)),o===!1&&e.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"),t=s?this.data.dnd.off.right-18:this.data.dnd.off.left+10,o){case"before":i.css({left:t+"px",top:this.data.dnd.off.top-6+"px"}).show(),r&&r.css({left:t+8+"px",top:this.data.dnd.off.top-1+"px"}).show();break;case"after":i.css({left:t+"px",top:this.data.dnd.off.top+this.data.core.li_height-6+"px"}).show(),r&&r.css({left:t+8+"px",top:this.data.dnd.off.top+this.data.core.li_height-1+"px"}).show();break;case"inside":i.css({left:t+(s?-4:4)+"px",top:this.data.dnd.off.top+this.data.core.li_height/2-5+"px"}).show(),r&&r.hide();break;default:i.hide(),r&&r.hide()}return c=o,o}},dnd_open:function(){this.data.dnd.to2=!1,this.open_node(n,e.proxy(this.dnd_prepare,this),!0)},dnd_finish:function(e){this.data.dnd.foreign?(this.data.dnd.after||this.data.dnd.before||this.data.dnd.inside)&&this._get_settings().dnd.drag_finish.call(this,{o:t,r:n,p:c}):(this.dnd_prepare(),this.move_node(t,n,c,e[this._get_settings().dnd.copy_modifier+"Key"])),t=!1,n=!1,i.hide(),r&&r.hide()},dnd_enter:function(t){this.data.dnd.mto&&(clearTimeout(this.data.dnd.mto),this.data.dnd.mto=!1);var i=this._get_settings().dnd;this.data.dnd.prepared=!1,n=this._get_node(t),i.check_timeout?(this.data.dnd.to1&&clearTimeout(this.data.dnd.to1),this.data.dnd.to1=setTimeout(e.proxy(this.dnd_prepare,this),i.check_timeout)):this.dnd_prepare(),i.open_timeout?(this.data.dnd.to2&&clearTimeout(this.data.dnd.to2),n&&n.length&&n.hasClass("jstree-closed")&&(this.data.dnd.to2=setTimeout(e.proxy(this.dnd_open,this),i.open_timeout))):n&&n.length&&n.hasClass("jstree-closed")&&this.dnd_open()},dnd_leave:function(t){this.data.dnd.after=!1,this.data.dnd.before=!1,this.data.dnd.inside=!1,e.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"),i.hide(),r&&r.hide(),n&&n[0]===t.target.parentNode&&(this.data.dnd.to1&&(clearTimeout(this.data.dnd.to1),this.data.dnd.to1=!1),this.data.dnd.to2&&(clearTimeout(this.data.dnd.to2),this.data.dnd.to2=!1))},start_drag:function(n,o){t=this._get_node(n),this.data.ui&&this.is_selected(t)&&(t=this._get_node(null,!0));var s=t.length>1?this._get_string("multiple_selection"):this.get_text(t),a=this.get_container();this._get_settings().core.html_titles||(s=s.replace(/</gi,"&lt;").replace(/>/gi,"&gt;")),e.vakata.dnd.drag_start(o,{jstree:!0,obj:t},"<ins class='jstree-icon'></ins>"+s),this.data.themes&&(i&&i.attr("class","jstree-"+this.data.themes.theme),r&&r.attr("class","jstree-"+this.data.themes.theme),e.vakata.dnd.helper.attr("class","jstree-dnd-helper jstree-"+this.data.themes.theme)),this.data.dnd.cof=a.offset(),this.data.dnd.cw=parseInt(a.width(),10),this.data.dnd.ch=parseInt(a.height(),10),this.data.dnd.active=!0}}}),e(function(){var t="#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; } #vakata-dragged .jstree-ok { background:green; } #vakata-dragged .jstree-invalid { background:red; } #jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } #jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; }";e.vakata.css.add_sheet({str:t,title:"jstree"}),i=e("<div />").attr({id:"jstree-marker"}).hide().html("&raquo;").bind("mouseleave mouseenter",function(e){return i.hide(),r.hide(),e.preventDefault(),e.stopImmediatePropagation(),!1}).appendTo("body"),r=e("<div />").attr({id:"jstree-marker-line"}).hide().bind("mouseup",function(e){return n&&n.length?(n.children("a").trigger(e),e.preventDefault(),e.stopImmediatePropagation(),!1):void 0}).bind("mouseleave",function(t){var o=e(t.relatedTarget);return(o.is(".jstree")||0===o.closest(".jstree").length)&&n&&n.length?(n.children("a").trigger(t),i.hide(),r.hide(),t.preventDefault(),t.stopImmediatePropagation(),!1):void 0}).appendTo("body"),e(document).bind("drag_start.vakata",function(e,t){t.data.jstree&&(i.show(),r&&r.show())}),e(document).bind("drag_stop.vakata",function(e,t){t.data.jstree&&(i.hide(),r&&r.hide())})})}(jQuery),function(e){e.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui,this.data.ui&&this.data.checkbox.noui&&(this.select_node=this.deselect_node=this.deselect_all=e.noop,this.get_selected=this.get_checked),this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",e.proxy(function(e,t){this._prepare_checkboxes(t.rslt.obj)},this)).bind("loaded.jstree",e.proxy(function(e){this._prepare_checkboxes()},this)).delegate(this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox","click.jstree",e.proxy(function(e){return e.preventDefault(),this._get_node(e.target).hasClass("jstree-checked")?this.uncheck_node(e.target):this.check_node(e.target),this.data.ui&&this.data.checkbox.noui?(this.save_selected(),void(this.data.cookies&&this.save_cookie("select_node"))):(e.stopImmediatePropagation(),!1)},this))},defaults:{override_ui:!1,two_state:!1,real_checkboxes:!1,checked_parent_open:!0,real_checkboxes_names:function(e){return["check_"+(e[0].id||Math.ceil(1e4*Math.random())),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(e,t){t.checked&&this.check_node(e,!1)},_prepare_checkboxes:function(t){if(t=t&&-1!=t?this._get_node(t):this.get_container().find("> ul > li"),t!==!1){var n,i,r=this,o=this._get_settings().checkbox.two_state,s=this._get_settings().checkbox.real_checkboxes,a=this._get_settings().checkbox.real_checkboxes_names;t.each(function(){i=e(this),n=i.is("li")&&(i.hasClass("jstree-checked")||s&&i.children(":checked").length)?"jstree-checked":"jstree-unchecked",i.find("li").andSelf().each(function(){var t,i=e(this);i.children("a"+(r.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(o?"jstree-unchecked":n),s&&(i.children(":checkbox").length?i.children(":checkbox").addClass("jstree-real-checkbox"):(t=a.call(r,i),i.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+t[0]+"' name='"+t[0]+"' value='"+t[1]+"' />"))),o?(i.hasClass("jstree-checked")||i.children(":checked").length)&&i.addClass("jstree-checked").children(":checkbox").prop("checked",!0):("jstree-checked"===n||i.hasClass("jstree-checked")||i.children(":checked").length)&&i.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked",!0)})}),o||t.find(".jstree-checked").parent().parent().each(function(){r._repair_state(this)})}},change_state:function(t,n){t=this._get_node(t);var i=!1,r=this._get_settings().checkbox.real_checkboxes;if(!t||-1===t)return!1;if(n=n===!1||n===!0?n:t.hasClass("jstree-checked"),this._get_settings().checkbox.two_state)n?(t.removeClass("jstree-checked").addClass("jstree-unchecked"),r&&t.children(":checkbox").prop("checked",!1)):(t.removeClass("jstree-unchecked").addClass("jstree-checked"),r&&t.children(":checkbox").prop("checked",!0));else{if(n){if(i=t.find("li").andSelf(),!i.filter(".jstree-checked, .jstree-undetermined").length)return!1;i.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),r&&i.children(":checkbox").prop("checked",!1)}else{if(i=t.find("li").andSelf(),!i.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;i.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),r&&i.children(":checkbox").prop("checked",!0),this.data.ui&&(this.data.ui.last_selected=t),this.data.checkbox.last_selected=t}t.parentsUntil(".jstree","li").each(function(){var t=e(this);if(n){if(t.children("ul").children("li.jstree-checked, li.jstree-undetermined").length)return t.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),r&&t.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",!1),!1;t.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),r&&t.children(":checkbox").prop("checked",!1)}else{if(t.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length)return t.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),r&&t.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",!1),!1;t.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),r&&t.children(":checkbox").prop("checked",!0)}})}return this.data.ui&&this.data.checkbox.noui&&(this.data.ui.selected=this.get_checked()),this.__callback(t),!0},check_node:function(e){if(this.change_state(e,!1)){if(e=this._get_node(e),this._get_settings().checkbox.checked_parent_open){var t=this;e.parents(".jstree-closed").each(function(){t.open_node(this,!1,!0)})}this.__callback({obj:e})}},uncheck_node:function(e){this.change_state(e,!0)&&this.__callback({obj:this._get_node(e)})},check_all:function(){var e=this,t=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");t.each(function(){e.change_state(this,!1)}),this.__callback()},uncheck_all:function(){var e=this,t=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");t.each(function(){e.change_state(this,!0)}),this.__callback()},is_checked:function(e){return e=this._get_node(e),e.length?e.is(".jstree-checked"):!1},get_checked:function(e,t){return e=e&&-1!==e?this._get_node(e):this.get_container(),t||this._get_settings().checkbox.two_state?e.find(".jstree-checked"):e.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(e,t){return e=e&&-1!==e?this._get_node(e):this.get_container(),t||this._get_settings().checkbox.two_state?e.find(".jstree-unchecked"):e.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(e){if(e=this._get_node(e),e.length){if(this._get_settings().checkbox.two_state)return void e.find("li").andSelf().not(".jstree-checked").removeClass("jstree-undetermined").addClass("jstree-unchecked").children(":checkbox").prop("checked",!0);var t=this._get_settings().checkbox.real_checkboxes,n=e.find("> ul > .jstree-checked").length,i=e.find("> ul > .jstree-undetermined").length,r=e.find("> ul > li").length;0===r?e.hasClass("jstree-undetermined")&&this.change_state(e,!1):0===n&&0===i?this.change_state(e,!0):n===r?this.change_state(e,!1):(e.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),t&&e.parentsUntil(".jstree","li").andSelf().children(":checkbox").prop("checked",!1))}},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var t=this,n=this.data.ui.to_select;n=e.map(e.makeArray(n),function(e){return"#"+e.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.deselect_all(),e.each(n,function(e,n){t.check_node(n)}),this.__callback()}else this.__call_old()},save_loaded:function(){var e=this;this.data.core.to_load=[],this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&e.data.core.to_load.push("#"+this.id)})}}}),e(function(){var t=".jstree .jstree-real-checkbox { display:none; } ";e.vakata.css.add_sheet({str:t,title:"jstree"})})}(jQuery),function(e){e.vakata.xslt=function(t,n,i){var r,o,s,a,l="";return document.recalc?(r=document.createElement("xml"),o=document.createElement("xml"),r.innerHTML=t,o.innerHTML=n,e("body").append(r).append(o),setTimeout(function(t,n,i){return function(){i.call(null,t.transformNode(n.XMLDocument)),setTimeout(function(t,n){return function(){e(t).remove(),e(n).remove();
}}(t,n),200)}}(r,o,i),100),!0):("undefined"!=typeof window.DOMParser&&"undefined"!=typeof window.XMLHttpRequest&&"undefined"==typeof window.XSLTProcessor&&(t=(new DOMParser).parseFromString(t,"text/xml"),n=(new DOMParser).parseFromString(n,"text/xml")),"undefined"!=typeof window.DOMParser&&"undefined"!=typeof window.XMLHttpRequest&&"undefined"!=typeof window.XSLTProcessor?(s=new XSLTProcessor,(a=e.isFunction(s.transformDocument)?"undefined"!=typeof window.XMLSerializer:!0)?(t=(new DOMParser).parseFromString(t,"text/xml"),n=(new DOMParser).parseFromString(n,"text/xml"),e.isFunction(s.transformDocument)?(l=document.implementation.createDocument("","",null),s.transformDocument(t,n,l,null),i.call(null,(new XMLSerializer).serializeToString(l)),!0):(s.importStylesheet(n),l=s.transformToFragment(t,document),i.call(null,e("<div />").append(l).html()),!0)):!1):!1)};var t={nest:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" /><xsl:template match="/"> <xsl:call-template name="nodes"> <xsl:with-param name="node" select="/root" /> </xsl:call-template></xsl:template><xsl:template name="nodes"> <xsl:param name="node" /> <ul> <xsl:for-each select="$node/item"> <xsl:variable name="children" select="count(./item) &gt; 0" /> <li> <xsl:attribute name="class"> <xsl:if test="position() = last()">jstree-last </xsl:if> <xsl:choose> <xsl:when test="@state = \'open\'">jstree-open </xsl:when> <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when> <xsl:otherwise>jstree-leaf </xsl:otherwise> </xsl:choose> <xsl:value-of select="@class" /> </xsl:attribute> <xsl:for-each select="@*"> <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'"> <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> </xsl:if> </xsl:for-each> <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins> <xsl:for-each select="content/name"> <a> <xsl:attribute name="href"> <xsl:choose> <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when> <xsl:otherwise>#</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute> <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute> <xsl:for-each select="@*"> <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'"> <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> </xsl:if> </xsl:for-each> <ins> <xsl:attribute name="class">jstree-icon <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if> </xsl:attribute> <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if> <xsl:text>&#xa0;</xsl:text> </ins> <xsl:copy-of select="./child::node()" /> </a> </xsl:for-each> <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if> </li> </xsl:for-each> </ul></xsl:template></xsl:stylesheet>',flat:'<?xml version="1.0" encoding="utf-8" ?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ><xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" /><xsl:template match="/"> <ul> <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]"> <xsl:call-template name="nodes"> <xsl:with-param name="node" select="." /> <xsl:with-param name="is_last" select="number(position() = last())" /> </xsl:call-template> </xsl:for-each> </ul></xsl:template><xsl:template name="nodes"> <xsl:param name="node" /> <xsl:param name="is_last" /> <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) &gt; 0" /> <li> <xsl:attribute name="class"> <xsl:if test="$is_last = true()">jstree-last </xsl:if> <xsl:choose> <xsl:when test="@state = \'open\'">jstree-open </xsl:when> <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when> <xsl:otherwise>jstree-leaf </xsl:otherwise> </xsl:choose> <xsl:value-of select="@class" /> </xsl:attribute> <xsl:for-each select="@*"> <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'"> <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> </xsl:if> </xsl:for-each> <ins class="jstree-icon"><xsl:text>&#xa0;</xsl:text></ins> <xsl:for-each select="content/name"> <a> <xsl:attribute name="href"> <xsl:choose> <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when> <xsl:otherwise>#</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute> <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute> <xsl:for-each select="@*"> <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'"> <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute> </xsl:if> </xsl:for-each> <ins> <xsl:attribute name="class">jstree-icon <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if> </xsl:attribute> <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if> <xsl:text>&#xa0;</xsl:text> </ins> <xsl:copy-of select="./child::node()" /> </a> </xsl:for-each> <xsl:if test="$children"> <ul> <xsl:for-each select="//item[@parent_id=$node/attribute::id]"> <xsl:call-template name="nodes"> <xsl:with-param name="node" select="." /> <xsl:with-param name="is_last" select="number(position() = last())" /> </xsl:call-template> </xsl:for-each> </ul> </xsl:if> </li></xsl:template></xsl:stylesheet>'},n=function(e){return e.toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")};e.jstree.plugin("xml_data",{defaults:{data:!1,ajax:!1,xsl:"flat",clean_node:!1,correct_state:!0,get_skip_empty:!1,get_include_preamble:!0},_fn:{load_node:function(e,t,n){var i=this;this.load_node_xml(e,function(){i.__callback({obj:i._get_node(e)}),t.call(this)},n)},_is_loaded:function(t){var n=this._get_settings().xml_data;return t=this._get_node(t),-1==t||!t||!n.ajax&&!e.isFunction(n.data)||t.is(".jstree-open, .jstree-leaf")||t.children("ul").children("li").size()>0},load_node_xml:function(t,n,i){var r=this.get_settings().xml_data,o=function(){},s=function(){};if(t=this._get_node(t),t&&-1!==t){if(t.data("jstree_is_loading"))return;t.data("jstree_is_loading",!0)}switch(!0){case!r.data&&!r.ajax:throw"Neither data nor ajax settings supplied.";case e.isFunction(r.data):r.data.call(this,t,e.proxy(function(i){this.parse_xml(i,e.proxy(function(i){i&&(i=i.replace(/ ?xmlns="[^"]*"/gi,""),i.length>10?(i=e(i),-1!==t&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(i),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(i.children()),r.clean_node&&this.clean_node(t),n&&n.call(this)):t&&-1!==t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),r.correct_state&&(this.correct_state(t),n&&n.call(this))):r.correct_state&&(this.get_container().children("ul").empty(),n&&n.call(this)))},this))},this));break;case!!r.data&&!r.ajax||!!r.data&&!!r.ajax&&(!t||-1===t):t&&-1!=t||this.parse_xml(r.data,e.proxy(function(i){i?(i=i.replace(/ ?xmlns="[^"]*"/gi,""),i.length>10&&(i=e(i),this.get_container().children("ul").empty().append(i.children()),r.clean_node&&this.clean_node(t),n&&n.call(this))):r.correct_state&&(this.get_container().children("ul").empty(),n&&n.call(this))},this));break;case!r.data&&!!r.ajax||!!r.data&&!!r.ajax&&t&&-1!==t:o=function(e,n,o){var s=this.get_settings().xml_data.ajax.error;s&&s.call(this,e,n,o),-1!==t&&t.length?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),"success"===n&&r.correct_state&&this.correct_state(t)):"success"===n&&r.correct_state&&this.get_container().children("ul").empty(),i&&i.call(this)},s=function(i,s,a){i=a.responseText;var l=this.get_settings().xml_data.ajax.success;return l&&(i=l.call(this,i,s,a)||i),""===i||i&&i.toString&&""===i.toString().replace(/^[\s\n]+$/,"")?o.call(this,a,s,""):void this.parse_xml(i,e.proxy(function(i){i&&(i=i.replace(/ ?xmlns="[^"]*"/gi,""),i.length>10?(i=e(i),-1!==t&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(i),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(i.children()),r.clean_node&&this.clean_node(t),n&&n.call(this)):t&&-1!==t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),r.correct_state&&(this.correct_state(t),n&&n.call(this))):r.correct_state&&(this.get_container().children("ul").empty(),n&&n.call(this)))},this))},r.ajax.context=this,r.ajax.error=o,r.ajax.success=s,r.ajax.dataType||(r.ajax.dataType="xml"),e.isFunction(r.ajax.url)&&(r.ajax.url=r.ajax.url.call(this,t)),e.isFunction(r.ajax.data)&&(r.ajax.data=r.ajax.data.call(this,t)),e.ajax(r.ajax)}},parse_xml:function(n,i){var r=this._get_settings().xml_data;e.vakata.xslt(n,t[r.xsl],i)},get_xml:function(t,i,r,o,s){var a,l,c,u,d,h="",p=this._get_settings(),f=this;return t||(t="flat"),s||(s=0),i=this._get_node(i),i&&-1!==i||(i=this.get_container().find("> ul > li")),r=e.isArray(r)?r:["id","class"],!s&&this.data.types&&-1===e.inArray(p.types.type_attr,r)&&r.push(p.types.type_attr),o=e.isArray(o)?o:[],s||(p.xml_data.get_include_preamble&&(h+='<?xml version="1.0" encoding="UTF-8"?>'),h+="<root>"),i.each(function(){h+="<item",c=e(this),e.each(r,function(e,t){var i=c.attr(t);p.xml_data.get_skip_empty&&"undefined"==typeof i||(h+=" "+t+'="'+n((" "+(i||"")).replace(/ jstree[^ ]*/gi,"").replace(/\s+$/gi," ").replace(/^ /,"").replace(/ $/,""))+'"')}),c.hasClass("jstree-open")&&(h+=' state="open"'),c.hasClass("jstree-closed")&&(h+=' state="closed"'),"flat"===t&&(h+=' parent_id="'+n(s)+'"'),h+=">",h+="<content>",u=c.children("a"),u.each(function(){a=e(this),d=!1,h+="<name",-1!==e.inArray("languages",p.plugins)&&e.each(p.languages,function(e,t){return a.hasClass(t)?(h+=' lang="'+n(t)+'"',d=t,!1):void 0}),o.length&&e.each(o,function(e,t){var i=a.attr(t);p.xml_data.get_skip_empty&&"undefined"==typeof i||(h+=" "+t+'="'+n((" "+i||"").replace(/ jstree[^ ]*/gi,"").replace(/\s+$/gi," ").replace(/^ /,"").replace(/ $/,""))+'"')}),a.children("ins").get(0).className.replace(/jstree[^ ]*|$/gi,"").replace(/^\s+$/gi,"").length&&(h+=' icon="'+n(a.children("ins").get(0).className.replace(/jstree[^ ]*|$/gi,"").replace(/\s+$/gi," ").replace(/^ /,"").replace(/ $/,""))+'"'),a.children("ins").get(0).style.backgroundImage.length&&(h+=' icon="'+n(a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/gi,"").replace(/"/gi,""))+'"'),h+=">",h+="<![CDATA["+f.get_text(a,d)+"]]>",h+="</name>"}),h+="</content>",l=c[0].id||!0,c=c.find("> ul > li"),l=c.length?f.get_xml(t,c,r,o,l):"","nest"==t&&(h+=l),h+="</item>","flat"==t&&(h+=l)}),s||(h+="</root>"),h}}})}(jQuery),function(e){e.expr[":"].jstree_contains=function(e,t,n){return(e.textContent||e.innerText||"").toLowerCase().indexOf(n[3].toLowerCase())>=0},e.expr[":"].jstree_title_contains=function(e,t,n){return(e.getAttribute("title")||"").toLowerCase().indexOf(n[3].toLowerCase())>=0},e.jstree.plugin("search",{__init:function(){this.data.search.str="",this.data.search.result=e(),this._get_settings().search.show_only_matches&&this.get_container().bind("search.jstree",function(t,n){e(this).children("ul").find("li").hide().removeClass("jstree-last"),n.rslt.nodes.parentsUntil(".jstree").andSelf().show().filter("ul").each(function(){e(this).children("li:visible").eq(-1).addClass("jstree-last")})}).bind("clear_search.jstree",function(){e(this).children("ul").find("li").css("display","").end().end().jstree("clean_node",-1)})},defaults:{ajax:!1,search_method:"jstree_contains",show_only_matches:!1},_fn:{search:function(t,n){if(""===e.trim(t))return void this.clear_search();var i=this.get_settings().search,r=this,o=function(){},s=function(){};return this.data.search.str=t,!n&&i.ajax!==!1&&this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length>0?(this.search.supress_callback=!0,o=function(){},s=function(e,t,n){var i=this.get_settings().search.ajax.success;i&&(e=i.call(this,e,t,n)||e),this.data.search.to_open=e,this._search_open()},i.ajax.context=this,i.ajax.error=o,i.ajax.success=s,e.isFunction(i.ajax.url)&&(i.ajax.url=i.ajax.url.call(this,t)),e.isFunction(i.ajax.data)&&(i.ajax.data=i.ajax.data.call(this,t)),i.ajax.data||(i.ajax.data={search_string:t}),i.ajax.dataType&&!/^json/.exec(i.ajax.dataType)||(i.ajax.dataType="json"),void e.ajax(i.ajax)):(this.data.search.result.length&&this.clear_search(),this.data.search.result=this.get_container().find("a"+(this.data.languages?"."+this.get_lang():"")+":"+i.search_method+"("+this.data.search.str+")"),this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function(){r.open_node(this,!1,!0)}),void this.__callback({nodes:this.data.search.result,str:t}))},clear_search:function(t){this.data.search.result.removeClass("jstree-search"),this.__callback(this.data.search.result),this.data.search.result=e()},_search_open:function(t){var n=this,i=!0,r=[],o=[];this.data.search.to_open.length&&(e.each(this.data.search.to_open,function(t,n){return"#"==n?!0:void(e(n).length&&e(n).is(".jstree-closed")?r.push(n):o.push(n))}),r.length&&(this.data.search.to_open=o,e.each(r,function(e,t){n.open_node(t,function(){n._search_open(!0)})}),i=!1)),i&&this.search(this.data.search.str,!0)}}})}(jQuery),function(e){e.vakata.context={hide_on_mouseleave:!1,cnt:e("<div id='vakata-contextmenu' />"),vis:!1,tgt:!1,par:!1,func:!1,data:!1,rtl:!1,show:function(t,n,i,r,o,s,a){e.vakata.context.rtl=!!a;var l,c,u=e.vakata.context.parse(t);u&&(e.vakata.context.vis=!0,e.vakata.context.tgt=n,e.vakata.context.par=s||n||null,e.vakata.context.data=o||null,e.vakata.context.cnt.html(u).css({visibility:"hidden",display:"block",left:0,top:0}),e.vakata.context.hide_on_mouseleave&&e.vakata.context.cnt.one("mouseleave",function(t){e.vakata.context.hide()}),l=e.vakata.context.cnt.height(),c=e.vakata.context.cnt.width(),i+c>e(document).width()&&(i=e(document).width()-(c+5),e.vakata.context.cnt.find("li > ul").addClass("right")),r+l>e(document).height()&&(r-=l+n[0].offsetHeight,e.vakata.context.cnt.find("li > ul").addClass("bottom")),e.vakata.context.cnt.css({left:i,top:r}).find("li:has(ul)").bind("mouseenter",function(t){var n=e(document).width(),i=e(document).height(),r=e(this).children("ul").show();n!==e(document).width()&&r.toggleClass("right"),i!==e(document).height()&&r.toggleClass("bottom")}).bind("mouseleave",function(t){e(this).children("ul").hide()}).end().css({visibility:"visible"}).show(),e(document).triggerHandler("context_show.vakata"))},hide:function(){e.vakata.context.vis=!1,e.vakata.context.cnt.attr("class","").css({visibility:"hidden"}),e(document).triggerHandler("context_hide.vakata")},parse:function(t,n){if(!t)return!1;var i="",r=!1,o=!0;return n||(e.vakata.context.func={}),i+="<ul>",e.each(t,function(t,n){return n?(e.vakata.context.func[t]=n.action,!o&&n.separator_before&&(i+="<li class='vakata-separator vakata-separator-before'></li>"),o=!1,i+="<li class='"+(n._class||"")+(n._disabled?" jstree-contextmenu-disabled ":"")+"'><ins ",n.icon&&-1===n.icon.indexOf("/")&&(i+=" class='"+n.icon+"' "),n.icon&&-1!==n.icon.indexOf("/")&&(i+=" style='background:url("+n.icon+") center center no-repeat;' "),i+=">&#160;</ins><a href='#' rel='"+t+"'>",n.submenu&&(i+="<span style='float:"+(e.vakata.context.rtl?"left":"right")+";'>&raquo;</span>"),i+=n.label+"</a>",n.submenu&&(r=e.vakata.context.parse(n.submenu,!0),r&&(i+=r)),i+="</li>",void(n.separator_after&&(i+="<li class='vakata-separator vakata-separator-after'></li>",o=!0))):!0}),i=i.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,""),i+="</ul>",e(document).triggerHandler("context_parse.vakata"),i.length>10?i:!1},exec:function(t){return e.isFunction(e.vakata.context.func[t])?(e.vakata.context.func[t].call(e.vakata.context.data,e.vakata.context.par),!0):!1}},e(function(){var t="#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } #vakata-contextmenu ul { min-width:180px; *width:180px; } #vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } #vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } #vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } #vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } #vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } #vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } #vakata-contextmenu .right { right:100%; left:auto; } #vakata-contextmenu .bottom { bottom:-1px; top:auto; } #vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ";e.vakata.css.add_sheet({str:t,title:"vakata"}),e.vakata.context.cnt.delegate("a","click",function(e){e.preventDefault()}).delegate("a","mouseup",function(t){!e(this).parent().hasClass("jstree-contextmenu-disabled")&&e.vakata.context.exec(e(this).attr("rel"))?e.vakata.context.hide():e(this).blur()}).delegate("a","mouseover",function(){e.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover")}).appendTo("body"),e(document).bind("mousedown",function(t){e.vakata.context.vis&&!e.contains(e.vakata.context.cnt[0],t.target)&&e.vakata.context.hide()}),"undefined"!=typeof e.hotkeys&&e(document).bind("keydown","up",function(t){if(e.vakata.context.vis){var n=e.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();n.length||(n=e.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last()),n.addClass("vakata-hover"),t.stopImmediatePropagation(),t.preventDefault()}}).bind("keydown","down",function(t){if(e.vakata.context.vis){var n=e.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();n.length||(n=e.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first()),n.addClass("vakata-hover"),t.stopImmediatePropagation(),t.preventDefault()}}).bind("keydown","right",function(t){e.vakata.context.vis&&(e.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover"),t.stopImmediatePropagation(),t.preventDefault())}).bind("keydown","left",function(t){e.vakata.context.vis&&(e.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover"),t.stopImmediatePropagation(),t.preventDefault())}).bind("keydown","esc",function(t){e.vakata.context.hide(),t.preventDefault()}).bind("keydown","space",function(t){e.vakata.context.cnt.find(".vakata-hover").last().children("a").click(),t.preventDefault()})}),e.jstree.plugin("contextmenu",{__init:function(){this.get_container().delegate("a","contextmenu.jstree",e.proxy(function(t){t.preventDefault(),e(t.currentTarget).hasClass("jstree-loading")||this.show_contextmenu(t.currentTarget,t.pageX,t.pageY)},this)).delegate("a","click.jstree",e.proxy(function(t){this.data.contextmenu&&e.vakata.context.hide()},this)).bind("destroy.jstree",e.proxy(function(){this.data.contextmenu&&e.vakata.context.hide()},this)),e(document).bind("context_hide.vakata",e.proxy(function(){this.data.contextmenu=!1},this))},__destroy:function(){e(".jstree").length<=1&&e(document).unbind("context_hide.vakata")},defaults:{select_node:!1,show_at_node:!0,items:{create:{separator_before:!1,separator_after:!0,label:"Create",action:function(e){this.create(e)}},rename:{separator_before:!1,separator_after:!1,label:"Rename",action:function(e){this.rename(e)}},remove:{separator_before:!1,icon:!1,separator_after:!1,label:"Delete",action:function(e){this.is_selected(e)?this.remove():this.remove(e)}},ccp:{separator_before:!0,icon:!1,separator_after:!1,label:"Edit",action:!1,submenu:{cut:{separator_before:!1,separator_after:!1,label:"Cut",action:function(e){this.cut(e)}},copy:{separator_before:!1,icon:!1,separator_after:!1,label:"Copy",action:function(e){this.copy(e)}},paste:{separator_before:!1,icon:!1,separator_after:!1,label:"Paste",action:function(e){this.paste(e)}}}}}},_fn:{show_contextmenu:function(t,n,i){t=this._get_node(t);var r=this.get_settings().contextmenu,o=t.children("a:visible:eq(0)"),s=!1,a=!1;r.select_node&&this.data.ui&&!this.is_selected(t)&&(this.deselect_all(),this.select_node(t,!0)),(r.show_at_node||"undefined"==typeof n||"undefined"==typeof i)&&(s=o.offset(),n=s.left,i=s.top+this.data.core.li_height),a=t.data("jstree")&&t.data("jstree").contextmenu?t.data("jstree").contextmenu:r.items,e.isFunction(a)&&(a=a.call(this,t)),this.data.contextmenu=!0,e.vakata.context.show(a,o,n,i,this,t,this._get_settings().core.rtl),this.data.themes&&e.vakata.context.cnt.attr("class","jstree-"+this.data.themes.theme+"-context")}}})}(jQuery),function(t){t.jstree.plugin("types",{__init:function(){var n=this._get_settings().types;this.data.types.attach_to=[],this.get_container().bind("init.jstree",t.proxy(function(){var e=n.types,i=n.type_attr,r="",o=this;t.each(e,function(e,n){return t.each(n,function(e,t){/^(max_depth|max_children|icon|valid_children)$/.test(e)||o.data.types.attach_to.push(e)}),n.icon?void((n.icon.image||n.icon.position)&&(r+="default"==e?".jstree-"+o.get_index()+" a > .jstree-icon { ":".jstree-"+o.get_index()+" li["+i+'="'+e+'"] > a > .jstree-icon { ',n.icon.image&&(r+=" background-image:url("+n.icon.image+"); "),r+=n.icon.position?" background-position:"+n.icon.position+"; ":" background-position:0 0; ",r+="} ")):!0}),""!==r&&t.vakata.css.add_sheet({str:r,title:"jstree-types"})},this)).bind("before.jstree",t.proxy(function(e,n){var i,r,o=this._get_settings().types.use_data?this._get_node(n.args[0]):!1,s=o&&-1!==o&&o.length?o.data("jstree"):!1;if(s&&s.types&&s.types[n.func]===!1)return e.stopImmediatePropagation(),!1;if(-1!==t.inArray(n.func,this.data.types.attach_to)){if(!n.args[0]||!n.args[0].tagName&&!n.args[0].jquery)return;if(i=this._get_settings().types.types,r=this._get_type(n.args[0]),(i[r]&&"undefined"!=typeof i[r][n.func]||i["default"]&&"undefined"!=typeof i["default"][n.func])&&this._check(n.func,n.args[0])===!1)return e.stopImmediatePropagation(),!1}},this)),e&&this.get_container().bind("load_node.jstree set_type.jstree",t.proxy(function(e,n){var i=n&&n.rslt&&n.rslt.obj&&-1!==n.rslt.obj?this._get_node(n.rslt.obj).parent():this.get_container_ul(),r=!1,o=this._get_settings().types;t.each(o.types,function(e,t){t.icon&&(t.icon.image||t.icon.position)&&(r="default"===e?i.find("li > a > .jstree-icon"):i.find("li["+o.type_attr+"='"+e+"'] > a > .jstree-icon"),t.icon.image&&r.css("backgroundImage","url("+t.icon.image+")"),r.css("backgroundPosition",t.icon.position||"0 0"))})},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:!1,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(e,t){t.type&&this._get_settings().types.use_data&&this.set_type(t.type,e)},_get_type:function(e){return e=this._get_node(e),e&&e.length?e.attr(this._get_settings().types.type_attr)||"default":!1},set_type:function(e,t){t=this._get_node(t);var n=t.length&&e?t.attr(this._get_settings().types.type_attr,e):!1;return n&&this.__callback({obj:t,type:e}),n},_check:function(e,n,i){n=this._get_node(n);var r=!1,o=this._get_type(n),s=0,a=this,l=this._get_settings().types,c=!1;if(-1===n){if(!l[e])return;r=l[e]}else{if(o===!1)return;c=l.use_data?n.data("jstree"):!1,c&&c.types&&"undefined"!=typeof c.types[e]?r=c.types[e]:l.types[o]&&"undefined"!=typeof l.types[o][e]?r=l.types[o][e]:l.types["default"]&&"undefined"!=typeof l.types["default"][e]&&(r=l.types["default"][e])}return t.isFunction(r)&&(r=r.call(this,n)),"max_depth"===e&&-1!==n&&i!==!1&&-2!==l.max_depth&&0!==r&&n.children("a:eq(0)").parentsUntil(".jstree","li").each(function(t){return-1!==l.max_depth&&l.max_depth-(t+1)<=0?(r=0,!1):(s=0===t?r:a._check(e,this,!1),-1!==s&&0>=s-(t+1)?(r=0,!1):(s>=0&&(r>s-(t+1)||0>r)&&(r=s-(t+1)),void(l.max_depth>=0&&(l.max_depth-(t+1)<r||0>r)&&(r=l.max_depth-(t+1)))))}),r},check_move:function(){if(!this.__call_old())return!1;var e,n=this._get_move(),i=n.rt._get_settings().types,r=n.rt._check("max_children",n.cr),o=n.rt._check("max_depth",n.cr),s=n.rt._check("valid_children",n.cr),a=0,l=1;if("none"===s)return!1;if(t.isArray(s)&&n.ot&&n.ot._get_type&&(n.o.each(function(){return-1===t.inArray(n.ot._get_type(this),s)?(l=!1,!1):void 0}),l===!1))return!1;if(-2!==i.max_children&&-1!==r&&(a=-1===n.cr?this.get_container().find("> ul > li").not(n.o).length:n.cr.find("> ul > li").not(n.o).length,a+n.o.length>r))return!1;if(-2!==i.max_depth&&-1!==o){if(l=0,0===o)return!1;if("undefined"==typeof n.o.d){for(e=n.o;e.length>0;)e=e.find("> ul > li"),l++;n.o.d=l}if(o-n.o.d<0)return!1}return!0},create_node:function(e,n,i,r,o,s){if(!s&&(o||this._is_loaded(e))){var a,l="string"==typeof n&&n.match(/^before|after$/i)&&-1!==e?this._get_parent(e):this._get_node(e),c=this._get_settings().types,u=this._check("max_children",l),d=this._check("max_depth",l),h=this._check("valid_children",l);if("string"==typeof i&&(i={data:i}),i||(i={}),"none"===h)return!1;if(t.isArray(h))if(i.attr&&i.attr[c.type_attr]){if(-1===t.inArray(i.attr[c.type_attr],h))return!1}else i.attr||(i.attr={}),i.attr[c.type_attr]=h[0];if(-2!==c.max_children&&-1!==u&&(a=-1===l?this.get_container().find("> ul > li").length:l.find("> ul > li").length,a+1>u))return!1;if(-2!==c.max_depth&&-1!==d&&0>d-1)return!1}return this.__call_old(!0,e,n,i,r,o,s)}}})}(jQuery),function(e){e.jstree.plugin("html_data",{__init:function(){this.data.html_data.original_container_html=this.get_container().find(" > ul > li").clone(!0),this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function(){return 3==this.nodeType}).remove()},defaults:{data:!1,ajax:!1,correct_state:!0},_fn:{load_node:function(e,t,n){var i=this;this.load_node_html(e,function(){i.__callback({obj:i._get_node(e)}),t.call(this)},n)},_is_loaded:function(t){return t=this._get_node(t),-1==t||!t||!this._get_settings().html_data.ajax&&!e.isFunction(this._get_settings().html_data.data)||t.is(".jstree-open, .jstree-leaf")||t.children("ul").children("li").size()>0},load_node_html:function(t,n,i){var r,o=this.get_settings().html_data,s=function(){},a=function(){};if(t=this._get_node(t),t&&-1!==t){if(t.data("jstree_is_loading"))return;t.data("jstree_is_loading",!0)}switch(!0){case e.isFunction(o.data):o.data.call(this,t,e.proxy(function(i){i&&""!==i&&i.toString&&""!==i.toString().replace(/^[\s\n]+$/,"")?(i=e(i),i.is("ul")||(i=e("<ul />").append(i)),-1!=t&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(i).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(i.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node(t),n&&n.call(this)):t&&-1!==t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),o.correct_state&&(this.correct_state(t),n&&n.call(this))):o.correct_state&&(this.get_container().children("ul").empty(),n&&n.call(this))},this));break;case!o.data&&!o.ajax:t&&-1!=t||(this.get_container().children("ul").empty().append(this.data.html_data.original_container_html).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node()),n&&n.call(this);break;case!!o.data&&!o.ajax||!!o.data&&!!o.ajax&&(!t||-1===t):t&&-1!=t||(r=e(o.data),r.is("ul")||(r=e("<ul />").append(r)),this.get_container().children("ul").empty().append(r.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node()),n&&n.call(this);break;case!o.data&&!!o.ajax||!!o.data&&!!o.ajax&&t&&-1!==t:t=this._get_node(t),s=function(e,n,r){var s=this.get_settings().html_data.ajax.error;s&&s.call(this,e,n,r),-1!=t&&t.length?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),"success"===n&&o.correct_state&&this.correct_state(t)):"success"===n&&o.correct_state&&this.get_container().children("ul").empty(),i&&i.call(this)},a=function(i,r,a){var l=this.get_settings().html_data.ajax.success;return l&&(i=l.call(this,i,r,a)||i),""===i||i&&i.toString&&""===i.toString().replace(/^[\s\n]+$/,"")?s.call(this,a,r,""):void(i?(i=e(i),i.is("ul")||(i=e("<ul />").append(i)),-1!=t&&t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.append(i).children("ul").find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),t.removeData("jstree_is_loading")):this.get_container().children("ul").empty().append(i.children()).find("li, a").filter(function(){return!this.firstChild||!this.firstChild.tagName||"INS"!==this.firstChild.tagName}).prepend("<ins class='jstree-icon'>&#160;</ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"),this.clean_node(t),n&&n.call(this)):t&&-1!==t?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree_is_loading"),o.correct_state&&(this.correct_state(t),n&&n.call(this))):o.correct_state&&(this.get_container().children("ul").empty(),n&&n.call(this)))},o.ajax.context=this,o.ajax.error=s,o.ajax.success=a,o.ajax.dataType||(o.ajax.dataType="html"),e.isFunction(o.ajax.url)&&(o.ajax.url=o.ajax.url.call(this,t)),e.isFunction(o.ajax.data)&&(o.ajax.data=o.ajax.data.call(this,t)),e.ajax(o.ajax)}}}}),e.jstree.defaults.plugins.push("html_data");
}(jQuery),function(e){e.jstree.plugin("themeroller",{__init:function(){var t=this._get_settings().themeroller;this.get_container().addClass("ui-widget-content").addClass("jstree-themeroller").delegate("a","mouseenter.jstree",function(n){e(n.currentTarget).hasClass("jstree-loading")||e(this).addClass(t.item_h)}).delegate("a","mouseleave.jstree",function(){e(this).removeClass(t.item_h)}).bind("init.jstree",e.proxy(function(e,t){t.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh"),this._themeroller(t.inst.get_container().find("> ul > li"))},this)).bind("open_node.jstree create_node.jstree",e.proxy(function(e,t){this._themeroller(t.rslt.obj)},this)).bind("loaded.jstree refresh.jstree",e.proxy(function(e){this._themeroller()},this)).bind("close_node.jstree",e.proxy(function(e,t){this._themeroller(t.rslt.obj)},this)).bind("delete_node.jstree",e.proxy(function(e,t){this._themeroller(t.rslt.parent)},this)).bind("correct_state.jstree",e.proxy(function(e,n){n.rslt.obj.children("ins.jstree-icon").removeClass(t.opened+" "+t.closed+" ui-icon").end().find("> a > ins.ui-icon").filter(function(){return-1===this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")}).removeClass(t.item_open+" "+t.item_clsd).addClass(t.item_leaf||"jstree-no-icon")},this)).bind("select_node.jstree",e.proxy(function(e,n){n.rslt.obj.children("a").addClass(t.item_a)},this)).bind("deselect_node.jstree deselect_all.jstree",e.proxy(function(e,n){this.get_container().find("a."+t.item_a).removeClass(t.item_a).end().find("a.jstree-clicked").addClass(t.item_a)},this)).bind("dehover_node.jstree",e.proxy(function(e,n){n.rslt.obj.children("a").removeClass(t.item_h)},this)).bind("hover_node.jstree",e.proxy(function(e,n){this.get_container().find("a."+t.item_h).not(n.rslt.obj).removeClass(t.item_h),n.rslt.obj.children("a").addClass(t.item_h)},this)).bind("move_node.jstree",e.proxy(function(e,t){this._themeroller(t.rslt.o),this._themeroller(t.rslt.op)},this))},__destroy:function(){var t=this._get_settings().themeroller,n=["ui-icon"];e.each(t,function(e,t){t=t.split(" "),t.length&&(n=n.concat(t))}),this.get_container().removeClass("ui-widget-content").find("."+n.join(", .")).removeClass(n.join(" "))},_fn:{_themeroller:function(e){var t=this._get_settings().themeroller;e=e&&-1!=e?this._get_node(e):this.get_container_ul(),e=e&&-1!=e?e.parent():this.get_container_ul(),e.find("li.jstree-closed").children("ins.jstree-icon").removeClass(t.opened).addClass("ui-icon "+t.closed).end().children("a").addClass(t.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return-1===this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")}).removeClass(t.item_leaf+" "+t.item_open).addClass(t.item_clsd||"jstree-no-icon").end().end().end().end().find("li.jstree-open").children("ins.jstree-icon").removeClass(t.closed).addClass("ui-icon "+t.opened).end().children("a").addClass(t.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return-1===this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")}).removeClass(t.item_leaf+" "+t.item_clsd).addClass(t.item_open||"jstree-no-icon").end().end().end().end().find("li.jstree-leaf").children("ins.jstree-icon").removeClass(t.closed+" ui-icon "+t.opened).end().children("a").addClass(t.item).children("ins.jstree-icon").addClass("ui-icon").filter(function(){return-1===this.className.toString().replace(t.item_clsd,"").replace(t.item_open,"").replace(t.item_leaf,"").indexOf("ui-icon-")}).removeClass(t.item_clsd+" "+t.item_open).addClass(t.item_leaf||"jstree-no-icon")}},defaults:{opened:"ui-icon-triangle-1-se",closed:"ui-icon-triangle-1-e",item:"ui-state-default",item_h:"ui-state-hover",item_a:"ui-state-active",item_open:"ui-icon-folder-open",item_clsd:"ui-icon-folder-collapsed",item_leaf:"ui-icon-document"}}),e(function(){var t=".jstree-themeroller .ui-icon { overflow:visible; } .jstree-themeroller a { padding:0 2px; } .jstree-themeroller .jstree-no-icon { display:none; }";e.vakata.css.add_sheet({str:t,title:"jstree"})})}(jQuery),function(e){e.jstree.plugin("unique",{__init:function(){this.get_container().bind("before.jstree",e.proxy(function(t,n){var i,r,o=[],s=!0;return"move_node"==n.func&&n.args[4]===!0&&n.args[0].o&&n.args[0].o.length&&(n.args[0].o.children("a").each(function(){o.push(e(this).text().replace(/^\s+/g,""))}),s=this._check_unique(o,n.args[0].np.find("> ul > li").not(n.args[0].o),"move_node")),"create_node"==n.func&&(n.args[4]||this._is_loaded(n.args[0]))&&(i=this._get_node(n.args[0]),!n.args[1]||"before"!==n.args[1]&&"after"!==n.args[1]||(i=this._get_parent(n.args[0]),i&&-1!==i||(i=this.get_container())),"string"==typeof n.args[2]?o.push(n.args[2]):n.args[2]&&n.args[2].data?o.push(n.args[2].data):o.push(this._get_string("new_node")),s=this._check_unique(o,i.find("> ul > li"),"create_node")),"rename_node"==n.func&&(o.push(n.args[1]),r=this._get_node(n.args[0]),i=this._get_parent(r),i&&-1!==i||(i=this.get_container()),s=this._check_unique(o,i.find("> ul > li").not(r),"rename_node")),s?void 0:(t.stopPropagation(),!1)},this))},defaults:{error_callback:e.noop},_fn:{_check_unique:function(t,n,i){var r=[],o=!0;return n.children("a").each(function(){r.push(e(this).text().replace(/^\s+/g,""))}),r.length&&t.length?(e.each(t,function(t,n){return-1!==e.inArray(n,r)?(o=!1,!1):void 0}),o||this._get_settings().unique.error_callback.call(null,t,n,i),o):!0},check_move:function(){if(!this.__call_old())return!1;var t=this._get_move(),n=[];return t.o&&t.o.length?(t.o.children("a").each(function(){n.push(e(this).text().replace(/^\s+/g,""))}),this._check_unique(n,t.np.find("> ul > li").not(t.o),"check_move")):!0}}})}(jQuery),function(i){i.jstree.plugin("wholerow",{__init:function(){if(!this.data.ui)throw"jsTree wholerow: jsTree UI plugin not included.";this.data.wholerow.html=!1,this.data.wholerow.to=!1,this.get_container().bind("init.jstree",i.proxy(function(e,t){this._get_settings().core.animation=0},this)).bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree",i.proxy(function(e,t){this._prepare_wholerow_span(t&&t.rslt&&t.rslt.obj?t.rslt.obj:-1)},this)).bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree",i.proxy(function(e,t){this.data.to&&clearTimeout(this.data.to),this.data.to=setTimeout(function(e,t){return function(){e._prepare_wholerow_ul(t)}}(this,t&&t.rslt&&t.rslt.obj?t.rslt.obj:-1),0)},this)).bind("deselect_all.jstree",i.proxy(function(e,t){this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked "+(this.data.themeroller?this._get_settings().themeroller.item_a:""))},this)).bind("select_node.jstree deselect_node.jstree ",i.proxy(function(e,t){t.rslt.obj.each(function(){var e=t.inst.get_container().find(" > .jstree-wholerow li:visible:eq("+parseInt((i(this).offset().top-t.inst.get_container().offset().top+t.inst.get_container()[0].scrollTop)/t.inst.data.core.li_height,10)+")");e.children("a").attr("class",t.rslt.obj.children("a").attr("class"))})},this)).bind("hover_node.jstree dehover_node.jstree",i.proxy(function(e,t){if(this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered "+(this.data.themeroller?this._get_settings().themeroller.item_h:"")),"hover_node"===e.type){var n=this.get_container().find(" > .jstree-wholerow li:visible:eq("+parseInt((t.rslt.obj.offset().top-this.get_container().offset().top+this.get_container()[0].scrollTop)/this.data.core.li_height,10)+")");n.children("a").attr("class",t.rslt.obj.children(".jstree-hovered").attr("class"))}},this)).delegate(".jstree-wholerow-span, ins.jstree-icon, li","click.jstree",function(e){var t=i(e.currentTarget);"A"===e.target.tagName||"INS"===e.target.tagName&&t.closest("li").is(".jstree-open, .jstree-closed")||(t.closest("li").children("a:visible:eq(0)").click(),e.stopImmediatePropagation())}).delegate("li","mouseover.jstree",i.proxy(function(e){return e.stopImmediatePropagation(),i(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length?!1:(this.hover_node(e.currentTarget),!1)},this)).delegate("li","mouseleave.jstree",i.proxy(function(e){i(e.currentTarget).children("a").hasClass("jstree-hovered").length||this.dehover_node(e.currentTarget)},this)),(t||e)&&i.vakata.css.add_sheet({str:".jstree-"+this.get_index()+" { position:relative; } ",title:"jstree"})},defaults:{},__destroy:function(){this.get_container().children(".jstree-wholerow").remove(),this.get_container().find(".jstree-wholerow-span").remove()},_fn:{_prepare_wholerow_span:function(e){e=e&&-1!=e?this._get_node(e):this.get_container().find("> ul > li"),e!==!1&&e.each(function(){i(this).find("li").andSelf().each(function(){var e=i(this);return e.children(".jstree-wholerow-span").length?!0:void e.prepend("<span class='jstree-wholerow-span' style='width:"+18*e.parentsUntil(".jstree","li").length+"px;'>&#160;</span>")})})},_prepare_wholerow_ul:function(){var e=this.get_container().children("ul").eq(0),n=e.html();e.addClass("jstree-wholerow-real"),this.data.wholerow.last_html!==n&&(this.data.wholerow.last_html=n,this.get_container().children(".jstree-wholerow").remove(),this.get_container().append(e.clone().removeClass("jstree-wholerow-real").wrapAll("<div class='jstree-wholerow' />").parent().width(e.parent()[0].scrollWidth).css("top",-1*(e.height()+(t?5:0))).find("li[id]").each(function(){this.removeAttribute("id")}).end()))}}}),i(function(){var r=".jstree .jstree-wholerow-real { position:relative; z-index:1; } .jstree .jstree-wholerow-real li { cursor:pointer; } .jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } .jstree .jstree-wholerow { position:relative; z-index:0; height:0; } .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } .jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } .jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }";n&&(r+=".jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } .jstree .jstree-wholerow-real a { border-color:transparent !important; } "),(t||e)&&(r+=".jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } .jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } "),i.vakata.css.add_sheet({str:r,title:"jstree"})})}(jQuery),function(e){var t=["getChildren","getChildrenCount","getAttr","getName","getProps"],n=function(t,n){var i=!0;return t=t||{},n=[].concat(n),e.each(n,function(n,r){return e.isFunction(t[r])?void 0:(i=!1,!1)}),i};e.jstree.plugin("model",{__init:function(){if(!this.data.json_data)throw"jsTree model: jsTree json_data plugin not included.";this._get_settings().json_data.data=function(i,r){var o=-1==i?this._get_settings().model.object:i.data("jstree_model");return n(o,t)?void(this._get_settings().model.async?o.getChildren(e.proxy(function(e){this.model_done(e,r)},this)):this.model_done(o.getChildren(),r)):r.call(null,!1)}},defaults:{object:!1,id_prefix:!1,async:!1},_fn:{model_done:function(t,n){var i=[],r=this._get_settings(),o=this;e.isArray(t)||(t=[t]),e.each(t,function(t,n){var s=n.getProps()||{};s.attr=n.getAttr()||{},n.getChildrenCount()&&(s.state="closed"),s.data=n.getName(),e.isArray(s.data)||(s.data=[s.data]),o.data.types&&e.isFunction(n.getType)&&(s.attr[r.types.type_attr]=n.getType()),s.attr.id&&r.model.id_prefix&&(s.attr.id=r.model.id_prefix+s.attr.id),s.metadata||(s.metadata={}),s.metadata.jstree_model=n,i.push(s)}),n.call(null,i)}}})}(jQuery)}}()},{}],"bootstrap-collapse":[function(e,t,n){!function(i,r){if("function"==typeof define&&define.amd)define(["exports","module","./util"],r);else if("undefined"!=typeof n&&"undefined"!=typeof t)r(n,t,e("./util"));else{var o={exports:{}};r(o.exports,o,i.Util),i.collapse=o.exports}}(this,function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=i(n),a=function(e){var t="collapse",n="4.0.0-alpha",i="bs.collapse",a="."+i,l=".data-api",c=e.fn[t],u=600,d={toggle:!0,parent:""},h={toggle:"boolean",parent:"string"},p={SHOW:"show"+a,SHOWN:"shown"+a,HIDE:"hide"+a,HIDDEN:"hidden"+a,CLICK_DATA_API:"click"+a+l},f={IN:"in",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},g={WIDTH:"width",HEIGHT:"height"},m={ACTIVES:".panel > .in, .panel > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},v=function(){function a(t,n){r(this,a),this._isTransitioning=!1,this._element=t,this._config=this._getConfig(n),this._triggerArray=e.makeArray(e('[data-toggle="collapse"][href="#'+t.id+'"],'+('[data-toggle="collapse"][data-target="#'+t.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return o(a,[{key:"toggle",value:function(){e(this._element).hasClass(f.IN)?this.hide():this.show()}},{key:"show",value:function(){var t=this;if(!this._isTransitioning&&!e(this._element).hasClass(f.IN)){var n=void 0,r=void 0;if(this._parent&&(n=e.makeArray(e(m.ACTIVES)),n.length||(n=null)),!(n&&(r=e(n).data(i),r&&r._isTransitioning))){var o=e.Event(p.SHOW);if(e(this._element).trigger(o),!o.isDefaultPrevented()){n&&(a._jQueryInterface.call(e(n),"hide"),r||e(n).data(i,null));var l=this._getDimension();e(this._element).removeClass(f.COLLAPSE).addClass(f.COLLAPSING),this._element.style[l]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&e(this._triggerArray).removeClass(f.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var c=function(){e(t._element).removeClass(f.COLLAPSING).addClass(f.COLLAPSE).addClass(f.IN),t._element.style[l]="",t.setTransitioning(!1),e(t._element).trigger(p.SHOWN)};if(!s["default"].supportsTransitionEnd())return void c();var d=l[0].toUpperCase()+l.slice(1),h="scroll"+d;e(this._element).one(s["default"].TRANSITION_END,c).emulateTransitionEnd(u),this._element.style[l]=this._element[h]+"px"}}}}},{key:"hide",value:function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass(f.IN)){var n=e.Event(p.HIDE);if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension(),r=i===g.WIDTH?"offsetWidth":"offsetHeight";this._element.style[i]=this._element[r]+"px",s["default"].reflow(this._element),e(this._element).addClass(f.COLLAPSING).removeClass(f.COLLAPSE).removeClass(f.IN),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&e(this._triggerArray).addClass(f.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var o=function(){t.setTransitioning(!1),e(t._element).removeClass(f.COLLAPSING).addClass(f.COLLAPSE).trigger(p.HIDDEN)};return this._element.style[i]=0,s["default"].supportsTransitionEnd()?void e(this._element).one(s["default"].TRANSITION_END,o).emulateTransitionEnd(u):void o()}}}},{key:"setTransitioning",value:function(e){this._isTransitioning=e}},{key:"dispose",value:function(){e.removeData(this._element,i),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null}},{key:"_getConfig",value:function(n){return n=e.extend({},d,n),n.toggle=Boolean(n.toggle),s["default"].typeCheckConfig(t,n,h),n}},{key:"_getDimension",value:function(){var t=e(this._element).hasClass(g.WIDTH);return t?g.WIDTH:g.HEIGHT}},{key:"_getParent",value:function(){var t=this,n=e(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return e(n).find(i).each(function(e,n){t._addAriaAndCollapsedClass(a._getTargetFromElement(n),[n])}),n}},{key:"_addAriaAndCollapsedClass",value:function(t,n){if(t){var i=e(t).hasClass(f.IN);t.setAttribute("aria-expanded",i),n.length&&e(n).toggleClass(f.COLLAPSED,!i).attr("aria-expanded",i)}}}],[{key:"_getTargetFromElement",value:function(t){var n=s["default"].getSelectorFromElement(t);return n?e(n)[0]:null}},{key:"_jQueryInterface",value:function(t){return this.each(function(){var n=e(this),r=n.data(i),o=e.extend({},d,n.data(),"object"==typeof t&&t);if(!r&&o.toggle&&/show|hide/.test(t)&&(o.toggle=!1),r||(r=new a(this,o),n.data(i,r)),"string"==typeof t){if(void 0===r[t])throw new Error('No method named "'+t+'"');r[t]()}})}},{key:"VERSION",get:function(){return n}},{key:"Default",get:function(){return d}}]),a}();return e(document).on(p.CLICK_DATA_API,m.DATA_TOGGLE,function(t){t.preventDefault();var n=v._getTargetFromElement(this),r=e(n).data(i),o=r?"toggle":e(this).data();v._jQueryInterface.call(e(n),o)}),e.fn[t]=v._jQueryInterface,e.fn[t].Constructor=v,e.fn[t].noConflict=function(){return e.fn[t]=c,v._jQueryInterface},v}(jQuery);t.exports=a})},{"./util":309}],"components/breadcrumb/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement("ol",{className:"breadcrumb"},this.getBreadcrumbs())},t.prototype.getBreadcrumbs=function(){return"undefined"==typeof this.props.crumbs?null:[].concat(this.props.crumbs.slice(0,-1).map(function(e,t){return[c["default"].createElement("li",{className:"breadcrumb__item"},c["default"].createElement("a",{key:t,className:"breadcrumb__item-title",href:e.href},e.text))]}),this.props.crumbs.slice(-1).map(function(e,t){return[c["default"].createElement("li",{className:"breadcrumb__item breadcrumb__item--last"},c["default"].createElement("h2",{className:"breadcrumb__item-title breadcrumb__item-title--last",key:t},e.text))]}))},t}(d["default"]);h.propTypes={crumbs:c["default"].PropTypes.array},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/form-action/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(n){o(this,t);var i=s(this,e.call(this,n));return i.handleClick=i.handleClick.bind(i),i}return a(t,e),t.prototype.render=function(){var e={type:this.props.type,className:this.getButtonClasses(),disabled:this.props.disabled,onClick:this.handleClick};return"undefined"!=typeof this.props.id&&(e.id=this.props.id),c["default"].createElement("button",e,this.getLoadingIcon(),this.props.label)},t.prototype.getButtonClasses=function(){var e=["btn"];return e.push("btn-"+this.props.bootstrapButtonStyle),"undefined"==typeof this.props.label&&e.push("no-text"),"undefined"!=typeof this.props.icon&&e.push("font-icon-"+this.props.icon),this.props.loading===!0&&e.push("btn--loading"),this.props.disabled===!0&&e.push("disabled"),"undefined"!=typeof this.props.extraClass&&e.push(this.props.extraClass),e.join(" ")},t.prototype.getLoadingIcon=function(){return this.props.loading?c["default"].createElement("div",{className:"btn__loading-icon"},c["default"].createElement("svg",{viewBox:"0 0 44 12"},c["default"].createElement("circle",{cx:"6",cy:"6",r:"6"}),c["default"].createElement("circle",{cx:"22",cy:"6",r:"6"}),c["default"].createElement("circle",{cx:"38",cy:"6",r:"6"}))):null},t.prototype.handleClick=function(e){"undefined"!=typeof this.props.handleClick&&this.props.handleClick(e)},t}(d["default"]);h.propTypes={id:c["default"].PropTypes.string,handleClick:c["default"].PropTypes.func,label:c["default"].PropTypes.string,type:c["default"].PropTypes.string,loading:c["default"].PropTypes.bool,icon:c["default"].PropTypes.string,disabled:c["default"].PropTypes.bool,bootstrapButtonStyle:c["default"].PropTypes.string,extraClass:c["default"].PropTypes.string},h.defaultProps={type:"button",bootstrapButtonStyle:"secondary",disabled:!1},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/form-builder/index":[function(e,t,n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}function c(e){return{schemas:e.schemas}}function u(e){return{actions:(0,g.bindActionCreators)(v,e)}}Object.defineProperty(n,"__esModule",{value:!0}),n.FormBuilderComponent=void 0;var d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},h=e("react"),p=r(h),f=e("react-redux"),g=e("redux"),m=e("state/schema/actions"),v=i(m),_=e("silverstripe-component"),y=r(_),b=e("components/form/index"),x=r(b),w=e("components/text-field/index"),j=r(w),C=e("components/hidden-field/index"),k=r(C),E=e("components/grid-field/index"),T=r(E),D=e("isomorphic-fetch"),S=r(D),P=e("deep-freeze"),O=r(P),M=e("es6-promise"),R=r(M);R["default"].polyfill();var N={components:{TextField:j["default"],GridField:T["default"],HiddenField:k["default"]},getComponentByName:function(e){return this.components[e]},getComponentByDataType:function(e){switch(e){case"String":return this.components.TextField;case"Hidden":return this.components.HiddenField;case"Custom":return this.components.GridField;default:return null}}},I=n.FormBuilderComponent=function(e){function t(n){s(this,t);var i=a(this,e.call(this,n));return i.formSchemaPromise=null,i.state={isFetching:!1},i.mapFieldsToComponents=i.mapFieldsToComponents.bind(i),i}return l(t,e),t.prototype.componentDidMount=function(){this.fetch()},t.prototype.fetch=function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?!0:arguments[0],n=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=[];return this.state.isFetching===!0?this.formSchemaPromise:(t===!0&&i.push("schema"),n===!0&&i.push("state"),this.formSchemaPromise=(0,S["default"])(this.props.schemaUrl,{headers:{"X-FormSchema-Request":i.join()},credentials:"same-origin"}).then(function(e){return e.json()}).then(function(t){e.setState({isFetching:!1}),e.props.actions.setSchema(t)}),this.formSchemaPromise)},t.prototype.mapFieldsToComponents=function(e){var t=this.props.createFn;return e.map(function(e,n){var i=null!==e.component?N.getComponentByName(e.component):N.getComponentByDataType(e.type);if(null===i)return null;var r=(0,O["default"])(e);return"function"==typeof t?t(i,r):p["default"].createElement(i,d({key:n},r))})},t.prototype.render=function(){var e=this.props.schemas[this.props.schemaUrl];if(!e)return null;var t=d({},e.schema.attributes,{"class":null,className:e.schema.attributes["class"],enctype:null,encType:e.schema.attributes.enctype}),n={actions:e.schema.actions,attributes:t,data:e.schema.data,fields:e.schema.fields,mapFieldsToComponents:this.mapFieldsToComponents};return p["default"].createElement(x["default"],n)},t}(y["default"]);I.propTypes={actions:p["default"].PropTypes.object.isRequired,createFn:p["default"].PropTypes.func,schemaUrl:p["default"].PropTypes.string.isRequired,schemas:p["default"].PropTypes.object.isRequired},n["default"]=(0,f.connect)(c,u)(I)},{"components/form/index":"components/form/index","components/grid-field/index":"components/grid-field/index","components/hidden-field/index":"components/hidden-field/index","components/text-field/index":"components/text-field/index","deep-freeze":"deep-freeze","es6-promise":317,"isomorphic-fetch":318,react:"react","react-redux":"react-redux",redux:"redux","silverstripe-component":"silverstripe-component","state/schema/actions":8}],"components/form/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=e("components/form-action/index"),p=i(h),f=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.getFormActionComponents=function(){return this.props.actions.map(function(e){return c["default"].createElement(p["default"],e)})},t.prototype.render=function(){var e=this.props.attributes,t=this.props.mapFieldsToComponents(this.props.fields),n=this.getFormActionComponents();return c["default"].createElement("form",e,t&&c["default"].createElement("fieldset",{className:"form-group"},t),n&&c["default"].createElement("div",{className:"actions-fix-btm"},c["default"].createElement("div",{className:"btn-group",role:"group"},n)))},t}(d["default"]);f.propTypes={actions:c["default"].PropTypes.array,attributes:c["default"].PropTypes.shape({action:c["default"].PropTypes.string.isRequired,className:c["default"].PropTypes.string,encType:c["default"].PropTypes.string,id:c["default"].PropTypes.string,method:c["default"].PropTypes.string.isRequired}),data:c["default"].PropTypes.array,fields:c["default"].PropTypes.array.isRequired,mapFieldsToComponents:c["default"].PropTypes.func.isRequired},n["default"]=f},{"components/form-action/index":"components/form-action/index",react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/cell/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(n){o(this,t);var i=s(this,e.call(this,n));return i.handleDrillDown=i.handleDrillDown.bind(i),i}return a(t,e),t.prototype.render=function(){var e={className:"grid-field__cell "+this.props.className,onClick:this.handleDrillDown};return c["default"].createElement("td",e,this.props.children)},t.prototype.handleDrillDown=function(e){"undefined"!=typeof this.props.handleDrillDown&&this.props.handleDrillDown(e)},t}(d["default"]);h.PropTypes={width:c["default"].PropTypes.number,handleDrillDown:c["default"].PropTypes.func},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/header-cell":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement("th",null,this.props.children);
},t}(d["default"]);h.PropTypes={width:c["default"].PropTypes.number},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/header":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=e("./row"),p=i(h),f=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement(p["default"],null,this.props.children)},t}(d["default"]);n["default"]=f},{"./row":"components/grid-field/row",react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/index":[function(e,t,n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}function c(e,t){var n=t.data?t.data.recordType:null;return{records:e.records&&n?e.records[n]:{}}}function u(e){return{actions:(0,p.bindActionCreators)(P,e)}}Object.defineProperty(n,"__esModule",{value:!0});var d=e("react"),h=r(d),p=e("redux"),f=e("react-redux"),g=e("silverstripe-component"),m=r(g),v=e("./table"),_=r(v),y=e("./header"),b=r(y),x=e("./header-cell"),w=r(x),j=e("./row"),C=r(j),k=e("./cell"),E=r(k),T=e("./action"),D=r(T),S=e("state/records/actions"),P=i(S),O=function(e){function t(n){s(this,t);var i=a(this,e.call(this,n));return i.deleteRecord=i.deleteRecord.bind(i),i.editRecord=i.editRecord.bind(i),i}return l(t,e),t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this);var t=this.props.data;this.props.actions.fetchRecords(t.recordType,t.collectionReadEndpoint.method,t.collectionReadEndpoint.url)},t.prototype.render=function(){var e=this,t=this.props.records,n=this.props.data.handleDrillDown;if(!t)return h["default"].createElement("div",null);var i=this.props.data.columns,r=h["default"].createElement("th",{className:"grid-field__action-placeholder"}),o=i.map(function(e,t){return h["default"].createElement(w["default"],{key:t},e.name)}),s=h["default"].createElement(b["default"],null,o.concat(r)),a=Object.keys(t).map(function(r){var o=t[r],s=i.map(function(e,t){var i=e.field.split(".").reduce(function(e,t){return e[t]},o),r={handleDrillDown:n?function(e){return n(e,o)}:null,className:n?"grid-field__cell--drillable":"",key:t,width:e.width};return h["default"].createElement(E["default"],r,i)}),a=h["default"].createElement(E["default"],{key:r+"-actions"},h["default"].createElement(D["default"],{icon:"cog",handleClick:e.editRecord,key:"action-"+r+"-edit",record:o}),h["default"].createElement(D["default"],{icon:"cancel",handleClick:e.deleteRecord,key:"action-"+r+"-delete",record:o})),l={key:r,className:n?"grid-field__row--drillable":""};return h["default"].createElement(C["default"],l,s.concat(a))});return h["default"].createElement(_["default"],{header:s,rows:a})},t.prototype.deleteRecord=function(e,t){e.preventDefault(),this.props.actions.deleteRecord(this.props.data.recordType,t,this.props.data.itemDeleteEndpoint.method,this.props.data.itemDeleteEndpoint.url)},t.prototype.editRecord=function(e){e.preventDefault()},t}(m["default"]);O.propTypes={data:h["default"].PropTypes.shape({recordType:h["default"].PropTypes.string.isRequired,headerColumns:h["default"].PropTypes.array,collectionReadEndpoint:h["default"].PropTypes.object,handleDrillDown:h["default"].PropTypes.func})},n["default"]=(0,f.connect)(c,u)(O)},{"./action":2,"./cell":"components/grid-field/cell/index","./header":"components/grid-field/header","./header-cell":"components/grid-field/header-cell","./row":"components/grid-field/row","./table":"components/grid-field/table",react:"react","react-redux":"react-redux",redux:"redux","silverstripe-component":"silverstripe-component","state/records/actions":6}],"components/grid-field/row":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){var e="grid-field__row "+this.props.className;return c["default"].createElement("tr",{tabIndex:"0",className:e},this.props.children)},t}(d["default"]);n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/table":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"container-fluid grid-field"},c["default"].createElement("table",{className:"table table-hover grid-field__table"},c["default"].createElement("thead",null,this.generateHeader()),c["default"].createElement("tbody",null,this.generateRows())))},t.prototype.generateHeader=function(){return"undefined"!=typeof this.props.header?this.props.header:("undefined"!=typeof this.props.data,null)},t.prototype.generateRows=function(){return"undefined"!=typeof this.props.rows?this.props.rows:("undefined"!=typeof this.props.data,null)},t}(d["default"]);h.propTypes={data:c["default"].PropTypes.object,header:c["default"].PropTypes.object,rows:c["default"].PropTypes.array},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/hidden-field/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(n){o(this,t);var i=s(this,e.call(this,n));return i.handleChange=i.handleChange.bind(i),i}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"field hidden"},c["default"].createElement("input",this.getInputProps()))},t.prototype.getInputProps=function(){return{className:["hidden",this.props.extraClass].join(" "),id:this.props.name,name:this.props.name,onChange:this.props.onChange,type:"hidden",value:this.props.value}},t.prototype.handleChange=function(){"undefined"!=typeof this.props.onChange&&this.props.onChange()},t}(d["default"]);h.propTypes={label:c["default"].PropTypes.string,extraClass:c["default"].PropTypes.string,name:c["default"].PropTypes.string.isRequired,onChange:c["default"].PropTypes.func,value:c["default"].PropTypes.string},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/north-header/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"toolbar--north container-fluid"},this.props.children)},t}(d["default"]);n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/text-field/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(n){o(this,t);var i=s(this,e.call(this,n));return i.handleChange=i.handleChange.bind(i),i}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"field text"},this.props.label&&c["default"].createElement("label",{className:"left",htmlFor:"gallery_"+this.props.name},this.props.label),c["default"].createElement("div",{className:"middleColumn"},c["default"].createElement("input",this.getInputProps())))},t.prototype.getInputProps=function(){return{className:["text",this.props.extraClass].join(" "),id:"gallery_"+this.props.name,name:this.props.name,onChange:this.props.onChange,type:"text",value:this.props.value}},t.prototype.handleChange=function(){"undefined"!=typeof this.props.onChange&&this.props.onChange()},t}(d["default"]);h.propTypes={label:c["default"].PropTypes.string,extraClass:c["default"].PropTypes.string,name:c["default"].PropTypes.string.isRequired,onChange:c["default"].PropTypes.func,value:c["default"].PropTypes.string},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],config:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(){i(this,e)}return e.getSection=function(e){return window.ss.config.sections[e]},e.getTopLevelRoutes=function(){var e=[];return Object.keys(window.ss.config.sections).forEach(function(t){var n=window.ss.config.sections[t].route,i=n.match(/^admin\/[^\/]+(\/?)$/);if(i){i[1]||(n+="/");var r=-1===e.indexOf(n);r&&e.push(n)}}),e},e}();n["default"]=r},{}],"deep-freeze":[function(e,t,n){t.exports=function i(e){return Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){!e.hasOwnProperty(t)||null===e[t]||"object"!=typeof e[t]&&"function"!=typeof e[t]||Object.isFrozen(e[t])||i(e[t])}),e}},{}],i18n:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(){i(this,e),this.currentLocale=null,this.defaultLocale="en_US",this.lang={}}return e.prototype.setLocale=function(e){this.currentLocale=e},e.prototype.getLocale=function(){return null!==this.currentLocale?this.currentLocale:this.defaultLocale},e.prototype._t=function(e,t,n,i){var r=this.getLocale().replace(/_[\w]+/i,""),o=this.defaultLocale.replace(/_[\w]+/i,"");return this.lang&&this.lang[this.getLocale()]&&this.lang[this.getLocale()][e]?this.lang[this.getLocale()][e]:this.lang&&this.lang[r]&&this.lang[r][e]?this.lang[r][e]:this.lang&&this.lang[this.defaultLocale]&&this.lang[this.defaultLocale][e]?this.lang[this.defaultLocale][e]:this.lang&&this.lang[o]&&this.lang[o][e]?this.lang[o][e]:t?t:""},e.prototype.addDictionary=function(e,t){"undefined"==typeof this.lang[e]&&(this.lang[e]={});for(var n in t)this.lang[e][n]=t[n]},e.prototype.getDictionary=function(e){return this.lang[e]},e.prototype.stripStr=function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},e.prototype.stripStrML=function(e){for(var t=e.split("\n"),n=0;n<t.length;n+=1)t[n]=stripStr(t[n]);return stripStr(t.join(" "))},e.prototype.sprintf=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];if(0===n.length)return e;var r=new RegExp("(.?)(%s)","g"),o=0;return e.replace(r,function(e,t,i,r,s){return"%"===t?e:t+n[o++]})},e.prototype.inject=function(e,t){var n=new RegExp("{([A-Za-z0-9_]*)}","g");return e.replace(n,function(e,n,i,r){return t[n]?t[n]:e})},e.prototype.detectLocale=function(){var t,n;if(t=jQuery("body").attr("lang"),!t)for(var i=document.getElementsByTagName("meta"),r=0;r<i.length;r++)i[r].attributes["http-equiv"]&&"content-language"==i[r].attributes["http-equiv"].nodeValue.toLowerCase()&&(t=i[r].attributes.content.nodeValue);t||(t=this.defaultLocale);var o=t.match(/([^-|_]*)[-|_](.*)/);if(2==t.length){for(var s in e.lang)if(s.substr(0,2).toLowerCase()==t.toLowerCase()){n=s;break}}else o&&(n=o[1].toLowerCase()+"_"+o[2].toUpperCase());return n},e.prototype.addEvent=function(e,t,n,i){return e.addEventListener?(e.addEventListener(t,n,i),!0):e.attachEvent?e.attachEvent("on"+t,n):void console.log("Handler could not be attached")},e}(),o=new r;window.ss="undefined"!=typeof window.ss?window.ss:{},window.ss.i18n=window.i18n=o,n["default"]=o},{}],jQuery:[function(e,t,n){"use strict";var i="undefined"!=typeof window.jQuery?window.jQuery:null;t.exports=i},{}],"react-addons-css-transition-group":[function(e,t,n){t.exports=e("react/lib/ReactCSSTransitionGroup")},{"react/lib/ReactCSSTransitionGroup":364}],"react-addons-test-utils":[function(e,t,n){t.exports=e("react/lib/ReactTestUtils")},{"react/lib/ReactTestUtils":421}],"react-dom":[function(e,t,n){"use strict";t.exports=e("react/lib/ReactDOM")},{"react/lib/ReactDOM":374}],"react-redux":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}n.__esModule=!0,n.connect=n.Provider=void 0;var r=e("./components/Provider"),o=i(r),s=e("./components/connect"),a=i(s);n.Provider=o["default"],n.connect=a["default"]},{"./components/Provider":327,"./components/connect":328}],react:[function(e,t,n){"use strict";t.exports=e("./lib/React")},{"./lib/React":361}],"reducer-register":[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r={},o=function(){function e(){i(this,e)}return e.prototype.add=function(e,t){if("undefined"!=typeof r[e])throw new Error("Reducer already exists at '"+e+"'");r[e]=t},e.prototype.getAll=function(){return r},e.prototype.getByKey=function(e){return r[e]},e.prototype.remove=function(e){delete r[e]},e}(),s=new o;n["default"]=s},{}],"redux-thunk":[function(e,t,n){"use strict";function i(e){var t=e.dispatch,n=e.getState;return function(e){return function(i){return"function"==typeof i?i(t,n):e(i)}}}t.exports=i},{}],redux:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}n.__esModule=!0;var r=e("./createStore"),o=i(r),s=e("./utils/combineReducers"),a=i(s),l=e("./utils/bindActionCreators"),c=i(l),u=e("./utils/applyMiddleware"),d=i(u),h=e("./utils/compose"),p=i(h);n.createStore=o["default"],n.combineReducers=a["default"],n.bindActionCreators=c["default"],n.applyMiddleware=d["default"],n.compose=p["default"]},{"./createStore":500,"./utils/applyMiddleware":501,"./utils/bindActionCreators":502,"./utils/combineReducers":503,"./utils/compose":504}],router:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=this.getAbsoluteBase(),n=d["default"].resolve(t,e);return 0!==n.indexOf(t)?n:n.substring(t.length-1)}function o(e){return function(t,n,i,r){return e(c["default"].resolveURLToBase(t),n,i,r)}}function s(e){var t=new c["default"].Route(e);return t.match(c["default"].current,{})}function a(){var e=window.document.getElementsByTagName("base");return e&&e[0]?e[0].href:null}Object.defineProperty(n,"__esModule",{value:!0});var l=e("page.js"),c=i(l),u=e("url"),d=i(u);c["default"].getAbsoluteBase=a.bind(c["default"]),c["default"].resolveURLToBase=r.bind(c["default"]),c["default"].show=o(c["default"].show),c["default"].routeAppliesToCurrentLocation=s,n["default"]=c["default"]},{"page.js":321,url:315}],"silverstripe-backend":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=void 0,n=void 0;if(!(e.status>=200&&e.status<300))throw n=new Error(e.statusText),n.response=e,n;return t=e}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l=e("isomorphic-fetch"),c=i(l),u=e("es6-promise"),d=i(u),h=e("qs"),p=i(h),f=e("merge"),g=i(f);d["default"].polyfill();var m=function(){function e(){o(this,e),this.fetch=c["default"]}return e.prototype.createEndpointFetcher=function(e){function t(e,t){switch(e){case"application/x-www-form-urlencoded":return p["default"].stringify(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(t);default:throw new Error("Can't encode format: "+e)}}function n(e,t){switch(e){case"application/x-www-form-urlencoded":return p["default"].parse(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(t);default:throw new Error("Can't decode format: "+e)}}function i(e,t){return""===t?e:e.match(/\?/)?e+"&"+t:e+"?"+t}function o(e){return e.text().then(function(t){return n(e.headers.get("Content-Type"),t)})}function s(e,t){return Object.keys(t).reduce(function(n,i){var o=e[i];return!o||o.remove!==!0&&o.querystring!==!0?a(n,r({},i,t[i])):n},{})}function l(e,n,o){var s=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],l=n,c=Object.keys(o).reduce(function(t,n){var i=e[n],l=s.setFromData===!0&&!(i&&i.remove===!0),c=i&&i.querystring===!0&&i.remove!==!0;return l||c?a(t,r({},n,o[n])):t},{});return l=i(l,t("application/x-www-form-urlencoded",c)),l=Object.keys(e).reduce(function(t,n){var i=e[n].urlReplacement;return i?t.replace(i,o[n]):t},l)}var c=this,u=a({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},e),d={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(e){d[u[e]]&&(u[e]=d[u[e]])}),function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n={Accept:u.responseFormat,"Content-Type":u.payloadFormat},i=g["default"].recursive({},u.defaultData,e),r=l(u.payloadSchema,u.url,i,{setFromData:"get"===u.method.toLowerCase()}),a=t(u.payloadFormat,s(u.payloadSchema,i)),d="get"===u.method.toLowerCase()?[r,n]:[r,a,n];return c[u.method].apply(c,d).then(o)}},e.prototype.get=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(e,{method:"get",credentials:"same-origin",headers:t}).then(s)},e.prototype.post=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],i={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(e,{method:"post",headers:a({},i,n),credentials:"same-origin",body:t}).then(s)},e.prototype.put=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"put",credentials:"same-origin",body:t,headers:n}).then(s)},e.prototype["delete"]=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"delete",credentials:"same-origin",body:t,headers:n}).then(s)},e}(),v=new m;n["default"]=v},{"es6-promise":317,"isomorphic-fetch":318,merge:320,qs:323}],"silverstripe-component":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("../../../client/src/jQuery"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.componentDidMount=function(){if("undefined"!=typeof this.props.cmsEvents){this.cmsEvents=this.props.cmsEvents;for(var e in this.cmsEvents)({}).hasOwnProperty.call(this.cmsEvents,e)&&(0,d["default"])(document).on(e,this.cmsEvents[e].bind(this))}},t.prototype.componentWillUnmount=function(){for(var e in this.cmsEvents)({}).hasOwnProperty.call(this.cmsEvents,e)&&(0,d["default"])(document).off(e)},t.prototype.emitCmsEvent=function(e,t){(0,d["default"])(document).trigger(e,t)},t}(l.Component);h.propTypes={cmsEvents:c["default"].PropTypes.object},n["default"]=h},{"../../../client/src/jQuery":"jQuery",react:"react"}]},{},[1]),function(){var e,t,n,i,r=function(e,t){function n(){this.constructor=e}for(var i in t)o.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},o={}.hasOwnProperty;t=function(){function e(t,n){this.form_field=t,this.options=null!=n?n:{},e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return e.prototype.set_default_values=function(){return this.click_test_action=function(e){return function(t){return e.test_active_click(t)}}(this),this.activate_action=function(e){return function(t){return e.activate_field(t)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+e.group_label+"</b>"+e.html:e.html},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout(function(e){return function(){return e.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(e){return function(){return e.blur_test()}}(this),100))},e.prototype.results_option_build=function(e){var t,n,i,r,o,s,a;for(t="",a=0,s=this.results_data,r=0,o=s.length;o>r&&(n=s[r],i="",i=n.group?this.result_add_group(n):this.result_add_option(n),""!==i&&(a++,t+=i),(null!=e?e.first:void 0)&&(n.selected&&this.is_multiple?this.choice_build(n):n.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(n))),!(a>=this.max_shown_results));r++);return t},e.prototype.result_add_option=function(e){var t,n;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.style.cssText=e.style,n.setAttribute("data-option-array-index",e.array_index),n.innerHTML=e.search_text,e.title&&(n.title=e.title),this.outerHTML(n)):""},e.prototype.result_add_group=function(e){var t,n;return(e.search_match||e.group_match)&&e.active_options>0?(t=[],t.push("group-result"),e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.innerHTML=e.search_text,e.title&&(n.title=e.title),this.outerHTML(n)):""},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},e.prototype.reset_single_select_options=function(){var e,t,n,i,r;for(n=this.results_data,r=[],e=0,t=n.length;t>e;e++)i=n[e],i.selected?r.push(i.selected=!1):r.push(void 0);return r},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(){var e,t,n,i,r,o,s,a,l,c,u,d;for(this.no_results_clear(),s=0,l=this.get_search_text(),e=l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=new RegExp(e,"i"),o=this.get_search_regex(e),r=this.results_data,t=0,n=r.length;n>t;t++)i=r[t],i.search_match=!1,a=null,this.include_option_in_results(i)&&(i.group&&(i.group_match=!1,i.active_options=0),null!=i.group_array_index&&this.results_data[i.group_array_index]&&(a=this.results_data[i.group_array_index],0===a.active_options&&a.search_match&&(s+=1),a.active_options+=1),i.search_text=i.group?i.label:i.html,i.group&&!this.group_search||(i.search_match=this.search_string_match(i.search_text,o),i.search_match&&!i.group&&(s+=1),i.search_match?(l.length&&(c=i.search_text.search(d),u=i.search_text.substr(0,c+l.length)+"</em>"+i.search_text.substr(c+l.length),i.search_text=u.substr(0,c)+"<em>"+u.substr(c)),
},t}(d["default"]);h.PropTypes={width:c["default"].PropTypes.number},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/header":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=e("./row"),p=i(h),f=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement(p["default"],null,this.props.children)},t}(d["default"]);n["default"]=f},{"./row":"components/grid-field/row",react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/index":[function(e,t,n){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):o(e,t))}function c(e,t){var n=t.data?t.data.recordType:null;return{records:e.records&&n?e.records[n]:{}}}function u(e){return{actions:(0,p.bindActionCreators)(P,e)}}Object.defineProperty(n,"__esModule",{value:!0});var d=e("react"),h=r(d),p=e("redux"),f=e("react-redux"),g=e("silverstripe-component"),m=r(g),v=e("./table"),_=r(v),y=e("./header"),b=r(y),x=e("./header-cell"),w=r(x),j=e("./row"),C=r(j),k=e("./cell"),E=r(k),T=e("./action"),D=r(T),S=e("state/records/actions"),P=i(S),O=function(e){function t(n){s(this,t);var i=a(this,e.call(this,n));return i.deleteRecord=i.deleteRecord.bind(i),i.editRecord=i.editRecord.bind(i),i}return l(t,e),t.prototype.componentDidMount=function(){e.prototype.componentDidMount.call(this);var t=this.props.data;this.props.actions.fetchRecords(t.recordType,t.collectionReadEndpoint.method,t.collectionReadEndpoint.url)},t.prototype.render=function(){var e=this,t=this.props.records,n=this.props.data.handleDrillDown;if(!t)return h["default"].createElement("div",null);var i=this.props.data.columns,r=h["default"].createElement("th",{className:"grid-field__action-placeholder"}),o=i.map(function(e,t){return h["default"].createElement(w["default"],{key:t},e.name)}),s=h["default"].createElement(b["default"],null,o.concat(r)),a=Object.keys(t).map(function(r){var o=t[r],s=i.map(function(e,t){var i=e.field.split(".").reduce(function(e,t){return e[t]},o),r={handleDrillDown:n?function(e){return n(e,o)}:null,className:n?"grid-field__cell--drillable":"",key:t,width:e.width};return h["default"].createElement(E["default"],r,i)}),a=h["default"].createElement(E["default"],{key:r+"-actions"},h["default"].createElement(D["default"],{icon:"cog",handleClick:e.editRecord,key:"action-"+r+"-edit",record:o}),h["default"].createElement(D["default"],{icon:"cancel",handleClick:e.deleteRecord,key:"action-"+r+"-delete",record:o})),l={key:r,className:n?"grid-field__row--drillable":""};return h["default"].createElement(C["default"],l,s.concat(a))});return h["default"].createElement(_["default"],{header:s,rows:a})},t.prototype.deleteRecord=function(e,t){e.preventDefault(),this.props.actions.deleteRecord(this.props.data.recordType,t,this.props.data.itemDeleteEndpoint.method,this.props.data.itemDeleteEndpoint.url)},t.prototype.editRecord=function(e){e.preventDefault()},t}(m["default"]);O.propTypes={data:h["default"].PropTypes.shape({recordType:h["default"].PropTypes.string.isRequired,headerColumns:h["default"].PropTypes.array,collectionReadEndpoint:h["default"].PropTypes.object,handleDrillDown:h["default"].PropTypes.func})},n["default"]=(0,f.connect)(c,u)(O)},{"./action":2,"./cell":"components/grid-field/cell/index","./header":"components/grid-field/header","./header-cell":"components/grid-field/header-cell","./row":"components/grid-field/row","./table":"components/grid-field/table",react:"react","react-redux":"react-redux",redux:"redux","silverstripe-component":"silverstripe-component","state/records/actions":6}],"components/grid-field/row":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){var e="grid-field__row "+this.props.className;return c["default"].createElement("tr",{tabIndex:"0",className:e},this.props.children)},t}(d["default"]);n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/grid-field/table":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"container-fluid grid-field"},c["default"].createElement("table",{className:"table table-hover grid-field__table"},c["default"].createElement("thead",null,this.generateHeader()),c["default"].createElement("tbody",null,this.generateRows())))},t.prototype.generateHeader=function(){return"undefined"!=typeof this.props.header?this.props.header:("undefined"!=typeof this.props.data,null)},t.prototype.generateRows=function(){return"undefined"!=typeof this.props.rows?this.props.rows:("undefined"!=typeof this.props.data,null)},t}(d["default"]);h.propTypes={data:c["default"].PropTypes.object,header:c["default"].PropTypes.object,rows:c["default"].PropTypes.array},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/hidden-field/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(n){o(this,t);var i=s(this,e.call(this,n));return i.handleChange=i.handleChange.bind(i),i}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"field hidden"},c["default"].createElement("input",this.getInputProps()))},t.prototype.getInputProps=function(){return{className:["hidden",this.props.extraClass].join(" "),id:this.props.name,name:this.props.name,onChange:this.props.onChange,type:"hidden",value:this.props.value}},t.prototype.handleChange=function(){"undefined"!=typeof this.props.onChange&&this.props.onChange()},t}(d["default"]);h.propTypes={label:c["default"].PropTypes.string,extraClass:c["default"].PropTypes.string,name:c["default"].PropTypes.string.isRequired,onChange:c["default"].PropTypes.func,value:c["default"].PropTypes.string},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/north-header/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"toolbar--north container-fluid"},this.props.children)},t}(d["default"]);n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],"components/text-field/index":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("silverstripe-component"),d=i(u),h=function(e){function t(n){o(this,t);var i=s(this,e.call(this,n));return i.handleChange=i.handleChange.bind(i),i}return a(t,e),t.prototype.render=function(){return c["default"].createElement("div",{className:"field text"},this.props.label&&c["default"].createElement("label",{className:"left",htmlFor:"gallery_"+this.props.name},this.props.label),c["default"].createElement("div",{className:"middleColumn"},c["default"].createElement("input",this.getInputProps())))},t.prototype.getInputProps=function(){return{className:["text",this.props.extraClass].join(" "),id:"gallery_"+this.props.name,name:this.props.name,onChange:this.props.onChange,type:"text",value:this.props.value}},t.prototype.handleChange=function(){"undefined"!=typeof this.props.onChange&&this.props.onChange()},t}(d["default"]);h.propTypes={label:c["default"].PropTypes.string,extraClass:c["default"].PropTypes.string,name:c["default"].PropTypes.string.isRequired,onChange:c["default"].PropTypes.func,value:c["default"].PropTypes.string},n["default"]=h},{react:"react","silverstripe-component":"silverstripe-component"}],config:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(){i(this,e)}return e.getSection=function(e){return window.ss.config.sections[e]},e.getTopLevelRoutes=function(){var e=[];return Object.keys(window.ss.config.sections).forEach(function(t){var n=window.ss.config.sections[t].route,i=n.match(/^admin\/[^\/]+(\/?)$/);if(i){n=n.replace(/\/$/,"");var r=-1===e.indexOf(n);r&&e.push(n)}}),e},e}();n["default"]=r},{}],"deep-freeze":[function(e,t,n){t.exports=function i(e){return Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){!e.hasOwnProperty(t)||null===e[t]||"object"!=typeof e[t]&&"function"!=typeof e[t]||Object.isFrozen(e[t])||i(e[t])}),e}},{}],i18n:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(){i(this,e),this.currentLocale=null,this.defaultLocale="en_US",this.lang={}}return e.prototype.setLocale=function(e){this.currentLocale=e},e.prototype.getLocale=function(){return null!==this.currentLocale?this.currentLocale:this.defaultLocale},e.prototype._t=function(e,t,n,i){var r=this.getLocale().replace(/_[\w]+/i,""),o=this.defaultLocale.replace(/_[\w]+/i,"");return this.lang&&this.lang[this.getLocale()]&&this.lang[this.getLocale()][e]?this.lang[this.getLocale()][e]:this.lang&&this.lang[r]&&this.lang[r][e]?this.lang[r][e]:this.lang&&this.lang[this.defaultLocale]&&this.lang[this.defaultLocale][e]?this.lang[this.defaultLocale][e]:this.lang&&this.lang[o]&&this.lang[o][e]?this.lang[o][e]:t?t:""},e.prototype.addDictionary=function(e,t){"undefined"==typeof this.lang[e]&&(this.lang[e]={});for(var n in t)this.lang[e][n]=t[n]},e.prototype.getDictionary=function(e){return this.lang[e]},e.prototype.stripStr=function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},e.prototype.stripStrML=function(e){for(var t=e.split("\n"),n=0;n<t.length;n+=1)t[n]=stripStr(t[n]);return stripStr(t.join(" "))},e.prototype.sprintf=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;t>i;i++)n[i-1]=arguments[i];if(0===n.length)return e;var r=new RegExp("(.?)(%s)","g"),o=0;return e.replace(r,function(e,t,i,r,s){return"%"===t?e:t+n[o++]})},e.prototype.inject=function(e,t){var n=new RegExp("{([A-Za-z0-9_]*)}","g");return e.replace(n,function(e,n,i,r){return t[n]?t[n]:e})},e.prototype.detectLocale=function(){var t,n;if(t=jQuery("body").attr("lang"),!t)for(var i=document.getElementsByTagName("meta"),r=0;r<i.length;r++)i[r].attributes["http-equiv"]&&"content-language"==i[r].attributes["http-equiv"].nodeValue.toLowerCase()&&(t=i[r].attributes.content.nodeValue);t||(t=this.defaultLocale);var o=t.match(/([^-|_]*)[-|_](.*)/);if(2==t.length){for(var s in e.lang)if(s.substr(0,2).toLowerCase()==t.toLowerCase()){n=s;break}}else o&&(n=o[1].toLowerCase()+"_"+o[2].toUpperCase());return n},e.prototype.addEvent=function(e,t,n,i){return e.addEventListener?(e.addEventListener(t,n,i),!0):e.attachEvent?e.attachEvent("on"+t,n):void console.log("Handler could not be attached")},e}(),o=new r;window.ss="undefined"!=typeof window.ss?window.ss:{},window.ss.i18n=window.i18n=o,n["default"]=o},{}],jQuery:[function(e,t,n){"use strict";var i="undefined"!=typeof window.jQuery?window.jQuery:null;t.exports=i},{}],"react-addons-css-transition-group":[function(e,t,n){t.exports=e("react/lib/ReactCSSTransitionGroup")},{"react/lib/ReactCSSTransitionGroup":364}],"react-addons-test-utils":[function(e,t,n){t.exports=e("react/lib/ReactTestUtils")},{"react/lib/ReactTestUtils":421}],"react-dom":[function(e,t,n){"use strict";t.exports=e("react/lib/ReactDOM")},{"react/lib/ReactDOM":374}],"react-redux":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}n.__esModule=!0,n.connect=n.Provider=void 0;var r=e("./components/Provider"),o=i(r),s=e("./components/connect"),a=i(s);n.Provider=o["default"],n.connect=a["default"]},{"./components/Provider":327,"./components/connect":328}],react:[function(e,t,n){"use strict";t.exports=e("./lib/React")},{"./lib/React":361}],"reducer-register":[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var r={},o=function(){function e(){i(this,e)}return e.prototype.add=function(e,t){if("undefined"!=typeof r[e])throw new Error("Reducer already exists at '"+e+"'");r[e]=t},e.prototype.getAll=function(){return r},e.prototype.getByKey=function(e){return r[e]},e.prototype.remove=function(e){delete r[e]},e}(),s=new o;n["default"]=s},{}],"redux-thunk":[function(e,t,n){"use strict";function i(e){var t=e.dispatch,n=e.getState;return function(e){return function(i){return"function"==typeof i?i(t,n):e(i)}}}t.exports=i},{}],redux:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}n.__esModule=!0;var r=e("./createStore"),o=i(r),s=e("./utils/combineReducers"),a=i(s),l=e("./utils/bindActionCreators"),c=i(l),u=e("./utils/applyMiddleware"),d=i(u),h=e("./utils/compose"),p=i(h);n.createStore=o["default"],n.combineReducers=a["default"],n.bindActionCreators=c["default"],n.applyMiddleware=d["default"],n.compose=p["default"]},{"./createStore":500,"./utils/applyMiddleware":501,"./utils/bindActionCreators":502,"./utils/combineReducers":503,"./utils/compose":504}],router:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=this.getAbsoluteBase(),n=d["default"].resolve(t,e);return 0!==n.indexOf(t)?n:n.substring(t.length-1)}function o(e){return function(t,n,i,r){return e(c["default"].resolveURLToBase(t),n,i,r)}}function s(e){var t=new c["default"].Route(e);return t.match(c["default"].current,{})}function a(){var e=window.document.getElementsByTagName("base");return e&&e[0]?e[0].href:null}Object.defineProperty(n,"__esModule",{value:!0});var l=e("page.js"),c=i(l),u=e("url"),d=i(u);c["default"].getAbsoluteBase=a.bind(c["default"]),c["default"].resolveURLToBase=r.bind(c["default"]),c["default"].show=o(c["default"].show),c["default"].routeAppliesToCurrentLocation=s,n["default"]=c["default"]},{"page.js":321,url:315}],"silverstripe-backend":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){var t=void 0,n=void 0;if(!(e.status>=200&&e.status<300))throw n=new Error(e.statusText),n.response=e,n;return t=e}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},l=e("isomorphic-fetch"),c=i(l),u=e("es6-promise"),d=i(u),h=e("qs"),p=i(h),f=e("merge"),g=i(f);d["default"].polyfill();var m=function(){function e(){o(this,e),this.fetch=c["default"]}return e.prototype.createEndpointFetcher=function(e){function t(e,t){switch(e){case"application/x-www-form-urlencoded":return p["default"].stringify(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.stringify(t);default:throw new Error("Can't encode format: "+e)}}function n(e,t){switch(e){case"application/x-www-form-urlencoded":return p["default"].parse(t);case"application/json":case"application/x-json":case"application/x-javascript":case"text/javascript":case"text/x-javascript":case"text/x-json":return JSON.parse(t);default:throw new Error("Can't decode format: "+e)}}function i(e,t){return""===t?e:e.match(/\?/)?e+"&"+t:e+"?"+t}function o(e){return e.text().then(function(t){return n(e.headers.get("Content-Type"),t)})}function s(e,t){return Object.keys(t).reduce(function(n,i){var o=e[i];return!o||o.remove!==!0&&o.querystring!==!0?a(n,r({},i,t[i])):n},{})}function l(e,n,o){var s=arguments.length<=3||void 0===arguments[3]?{setFromData:!1}:arguments[3],l=n,c=Object.keys(o).reduce(function(t,n){var i=e[n],l=s.setFromData===!0&&!(i&&i.remove===!0),c=i&&i.querystring===!0&&i.remove!==!0;return l||c?a(t,r({},n,o[n])):t},{});return l=i(l,t("application/x-www-form-urlencoded",c)),l=Object.keys(e).reduce(function(t,n){var i=e[n].urlReplacement;return i?t.replace(i,o[n]):t},l)}var c=this,u=a({method:"get",payloadFormat:"application/x-www-form-urlencoded",responseFormat:"application/json",payloadSchema:{},defaultData:{}},e),d={json:"application/json",urlencoded:"application/x-www-form-urlencoded"};return["payloadFormat","responseFormat"].forEach(function(e){d[u[e]]&&(u[e]=d[u[e]])}),function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n={Accept:u.responseFormat,"Content-Type":u.payloadFormat},i=g["default"].recursive({},u.defaultData,e),r=l(u.payloadSchema,u.url,i,{setFromData:"get"===u.method.toLowerCase()}),a=t(u.payloadFormat,s(u.payloadSchema,i)),d="get"===u.method.toLowerCase()?[r,n]:[r,a,n];return c[u.method].apply(c,d).then(o)}},e.prototype.get=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return this.fetch(e,{method:"get",credentials:"same-origin",headers:t}).then(s)},e.prototype.post=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],i={"Content-Type":"application/x-www-form-urlencoded"};return this.fetch(e,{method:"post",headers:a({},i,n),credentials:"same-origin",body:t}).then(s)},e.prototype.put=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"put",credentials:"same-origin",body:t,headers:n}).then(s)},e.prototype["delete"]=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return this.fetch(e,{method:"delete",credentials:"same-origin",body:t,headers:n}).then(s)},e}(),v=new m;n["default"]=v},{"es6-promise":317,"isomorphic-fetch":318,merge:320,qs:323}],"silverstripe-component":[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){for(var n=Object.getOwnPropertyNames(t),i=0;i<n.length;i++){var r=n[i],o=Object.getOwnPropertyDescriptor(t,r);o&&o.configurable&&void 0===e[r]&&Object.defineProperty(e,r,o)}return e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):r(e,t))}Object.defineProperty(n,"__esModule",{value:!0});var l=e("react"),c=i(l),u=e("../../../client/src/jQuery"),d=i(u),h=function(e){function t(){return o(this,t),s(this,e.apply(this,arguments))}return a(t,e),t.prototype.componentDidMount=function(){if("undefined"!=typeof this.props.cmsEvents){this.cmsEvents=this.props.cmsEvents;for(var e in this.cmsEvents)({}).hasOwnProperty.call(this.cmsEvents,e)&&(0,d["default"])(document).on(e,this.cmsEvents[e].bind(this))}},t.prototype.componentWillUnmount=function(){for(var e in this.cmsEvents)({}).hasOwnProperty.call(this.cmsEvents,e)&&(0,d["default"])(document).off(e)},t.prototype.emitCmsEvent=function(e,t){(0,d["default"])(document).trigger(e,t)},t}(l.Component);h.propTypes={cmsEvents:c["default"].PropTypes.object},n["default"]=h},{"../../../client/src/jQuery":"jQuery",react:"react"}]},{},[1]),function(){var e,t,n,i,r=function(e,t){function n(){this.constructor=e}for(var i in t)o.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},o={}.hasOwnProperty;t=function(){function e(t,n){this.form_field=t,this.options=null!=n?n:{},e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return e.prototype.set_default_values=function(){return this.click_test_action=function(e){return function(t){return e.test_active_click(t)}}(this),this.activate_action=function(e){return function(t){return e.activate_field(t)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+e.group_label+"</b>"+e.html:e.html},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout(function(e){return function(){return e.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(e){return function(){return e.blur_test()}}(this),100))},e.prototype.results_option_build=function(e){var t,n,i,r,o,s,a;for(t="",a=0,s=this.results_data,r=0,o=s.length;o>r&&(n=s[r],i="",i=n.group?this.result_add_group(n):this.result_add_option(n),""!==i&&(a++,t+=i),(null!=e?e.first:void 0)&&(n.selected&&this.is_multiple?this.choice_build(n):n.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(n))),!(a>=this.max_shown_results));r++);return t},e.prototype.result_add_option=function(e){var t,n;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.style.cssText=e.style,n.setAttribute("data-option-array-index",e.array_index),n.innerHTML=e.search_text,e.title&&(n.title=e.title),this.outerHTML(n)):""},e.prototype.result_add_group=function(e){var t,n;return(e.search_match||e.group_match)&&e.active_options>0?(t=[],t.push("group-result"),e.classes&&t.push(e.classes),n=document.createElement("li"),n.className=t.join(" "),n.innerHTML=e.search_text,e.title&&(n.title=e.title),this.outerHTML(n)):""},e.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},e.prototype.reset_single_select_options=function(){var e,t,n,i,r;for(n=this.results_data,r=[],e=0,t=n.length;t>e;e++)i=n[e],i.selected?r.push(i.selected=!1):r.push(void 0);return r},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(){var e,t,n,i,r,o,s,a,l,c,u,d;for(this.no_results_clear(),s=0,l=this.get_search_text(),e=l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=new RegExp(e,"i"),o=this.get_search_regex(e),r=this.results_data,t=0,n=r.length;n>t;t++)i=r[t],i.search_match=!1,a=null,this.include_option_in_results(i)&&(i.group&&(i.group_match=!1,i.active_options=0),null!=i.group_array_index&&this.results_data[i.group_array_index]&&(a=this.results_data[i.group_array_index],0===a.active_options&&a.search_match&&(s+=1),a.active_options+=1),i.search_text=i.group?i.label:i.html,i.group&&!this.group_search||(i.search_match=this.search_string_match(i.search_text,o),i.search_match&&!i.group&&(s+=1),i.search_match?(l.length&&(c=i.search_text.search(d),u=i.search_text.substr(0,c+l.length)+"</em>"+i.search_text.substr(c+l.length),i.search_text=u.substr(0,c)+"<em>"+u.substr(c)),
null!=a&&(a.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),1>s&&l.length?(this.update_results_content(""),this.no_results(l)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},e.prototype.get_search_regex=function(e){var t;return t=this.search_contains?"":"^",new RegExp(t+e,"i")},e.prototype.search_string_match=function(e,t){var n,i,r,o;if(t.test(e))return!0;if(this.enable_split_word_search&&(e.indexOf(" ")>=0||0===e.indexOf("["))&&(o=e.replace(/\[|\]/g,"").split(" "),o.length))for(n=0,i=o.length;i>n;n++)if(r=o[n],t.test(r))return!0},e.prototype.choices_count=function(){var e,t,n,i;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,i=this.form_field.options,e=0,t=i.length;t>e;e++)n=i[e],n.selected&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(e){return e.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},e.prototype.keyup_checker=function(e){var t,n;switch(n=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),n){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(e.preventDefault(),this.results_showing)return this.result_select(e);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:case 18:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(e){return setTimeout(function(e){return function(){return e.results_search()}}(this),50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return this.is_multiple&&!this.display_selected_options&&e.selected?!1:!this.display_disabled_options&&e.disabled?!1:!e.empty},e.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},e.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},e.prototype.search_results_touchend=function(e){return this.touch_started?this.search_results_mouseup(e):void 0},e.prototype.outerHTML=function(e){var t;return e.outerHTML?e.outerHTML:(t=document.createElement("div"),t.appendChild(e),t.innerHTML)},e.browser_is_supported=function(){return/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:/IEMobile/i.test(window.navigator.userAgent)?!1:/Windows Phone/i.test(window.navigator.userAgent)?!1:/BlackBerry/i.test(window.navigator.userAgent)?!1:/BB10/i.test(window.navigator.userAgent)?!1:"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!0},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),i=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,n,i,r,o,s;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:this.escapeExpression(e.label),title:e.title?e.title:void 0,children:0,disabled:e.disabled,classes:e.className}),o=e.childNodes,s=[],n=0,i=o.length;i>n;n++)r=o[n],s.push(this.add_option(r,t,e.disabled));return s},e.prototype.add_option=function(e,t,n){return"OPTION"===e.nodeName.toUpperCase()?(""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title?e.title:void 0,selected:e.selected,disabled:n===!0?n:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},e.prototype.escapeExpression=function(e){var t,n;return null==e||e===!1?"":/[\&\<\>\"\'\`]/.test(e)?(t={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},n=/&(?!\w+;)|[\<\>\"\'\`]/g,e.replace(n,function(e){return t[e]||"&amp;"})):e},e}(),i.select_to_array=function(e){var t,n,r,o,s;for(o=new i,s=e.childNodes,n=0,r=s.length;r>n;n++)t=s[n],o.add_node(t);return o.parsed},e=jQuery,e.fn.extend({chosen:function(i){return t.browser_is_supported()?this.each(function(t){var r,o;return r=e(this),o=r.data("chosen"),"destroy"===i?void(o instanceof n&&o.destroy()):void(o instanceof n||r.data("chosen",new n(this,i)))}):this}}),n=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,t),n.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},n.prototype.set_up_html=function(){var t,n;return t=["chosen-container"],t.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),n={"class":t.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(n.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=e("<div />",n),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.bind("touchstart.chosen",function(e){return function(t){return e.container_mousedown(t),t.preventDefault()}}(this)),this.container.bind("touchend.chosen",function(e){return function(t){return e.container_mouseup(t),t.preventDefault()}}(this)),this.container.bind("mousedown.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.container.bind("mouseup.chosen",function(e){return function(t){e.container_mouseup(t)}}(this)),this.container.bind("mouseenter.chosen",function(e){return function(t){e.mouse_enter(t)}}(this)),this.container.bind("mouseleave.chosen",function(e){return function(t){e.mouse_leave(t)}}(this)),this.search_results.bind("mouseup.chosen",function(e){return function(t){e.search_results_mouseup(t)}}(this)),this.search_results.bind("mouseover.chosen",function(e){return function(t){e.search_results_mouseover(t)}}(this)),this.search_results.bind("mouseout.chosen",function(e){return function(t){e.search_results_mouseout(t)}}(this)),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){return function(t){e.search_results_mousewheel(t)}}(this)),this.search_results.bind("touchstart.chosen",function(e){return function(t){e.search_results_touchstart(t)}}(this)),this.search_results.bind("touchmove.chosen",function(e){return function(t){e.search_results_touchmove(t)}}(this)),this.search_results.bind("touchend.chosen",function(e){return function(t){e.search_results_touchend(t)}}(this)),this.form_field_jq.bind("chosen:updated.chosen",function(e){return function(t){e.results_update_field(t)}}(this)),this.form_field_jq.bind("chosen:activate.chosen",function(e){return function(t){e.activate_field(t)}}(this)),this.form_field_jq.bind("chosen:open.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.form_field_jq.bind("chosen:close.chosen",function(e){return function(t){e.input_blur(t)}}(this)),this.search_field.bind("blur.chosen",function(e){return function(t){e.input_blur(t)}}(this)),this.search_field.bind("keyup.chosen",function(e){return function(t){e.keyup_checker(t)}}(this)),this.search_field.bind("keydown.chosen",function(e){return function(t){e.keydown_checker(t)}}(this)),this.search_field.bind("focus.chosen",function(e){return function(t){e.input_focus(t)}}(this)),this.search_field.bind("cut.chosen",function(e){return function(t){e.clipboard_event_checker(t)}}(this)),this.search_field.bind("paste.chosen",function(e){return function(t){e.clipboard_event_checker(t)}}(this)),this.is_multiple?this.search_choices.bind("click.chosen",function(e){return function(t){e.choices_click(t)}}(this)):this.container.bind("click.chosen",function(e){e.preventDefault()})},n.prototype.destroy=function(){return e(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},n.prototype.container_mousedown=function(t){return this.is_disabled||(t&&"mousedown"===t.type&&!this.results_showing&&t.preventDefault(),null!=t&&e(t.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!t||e(t.target)[0]!==this.selected_item[0]&&!e(t.target).parents("a.chosen-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(e){return"ABBR"!==e.target.nodeName||this.is_disabled?void 0:this.results_reset(e)},n.prototype.search_results_mousewheel=function(e){var t;return e.originalEvent&&(t=e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail),null!=t?(e.preventDefault(),"DOMMouseScroll"===e.type&&(t=40*t),this.search_results.scrollTop(t+this.search_results.scrollTop())):void 0},n.prototype.blur_test=function(e){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},n.prototype.close_field=function(){return e(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},n.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(t){var n;return n=e(t.target).closest(".chosen-container"),n.length&&this.container[0]===n[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(e){var t,n,i,r,o;if(e.length){if(this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),o=this.search_results.scrollTop(),r=i+o,n=this.result_highlight.position().top+this.search_results.scrollTop(),t=n+this.result_highlight.outerHeight(),t>=r)return this.search_results.scrollTop(t-i>0?t-i:0);if(o>n)return this.search_results.scrollTop(n)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(e){return this.search_results.html(e)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(e){var t;return this.form_field.tabIndex?(t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=t):void 0},n.prototype.set_label_behavior=function(){return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=e("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(e){return function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()}}(this)):void 0},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(t){var n;return n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),n.length?(this.result_highlight=n,this.result_select(t),this.search_field.focus()):void 0},n.prototype.search_results_mouseover=function(t){var n;return n=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first(),n?this.result_do_highlight(n):void 0},n.prototype.search_results_mouseout=function(t){return e(t.target).hasClass("active-result")?this.result_clear_highlight():void 0},n.prototype.choice_build=function(t){var n,i;return n=e("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(t)+"</span>"),t.disabled?n.addClass("search-choice-disabled"):(i=e("<a />",{"class":"search-choice-close","data-option-array-index":t.array_index}),i.bind("click.chosen",function(e){return function(t){return e.choice_destroy_link_click(t)}}(this)),n.append(i)),this.search_container.before(n)},n.prototype.choice_destroy_link_click=function(t){return t.preventDefault(),t.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(e(t.target))},n.prototype.choice_destroy=function(e){return this.result_deselect(e[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()):void 0},n.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(e){var t,n;return this.result_highlight?(t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),t.addClass("result-selected"),n=this.results_data[t[0].getAttribute("data-option-array-index")],n.selected=!0,this.form_field.options[n.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(n):this.single_set_selected_text(this.choice_label(n)),(e.metaKey||e.ctrlKey)&&this.is_multiple||this.results_hide(),this.show_search_field_default(),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[n.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())):void 0},n.prototype.single_set_selected_text=function(e){return null==e&&(e=this.default_text),e===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(e)},n.prototype.result_deselect=function(e){var t;return t=this.results_data[e],this.form_field.options[t.options_index].disabled?!1:(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},n.prototype.get_search_text=function(){return e("<div/>").text(e.trim(this.search_field.val())).html()},n.prototype.winnow_results_set_highlight=function(){var e,t;return t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=t.length?t.first():this.search_results.find(".active-result").first(),null!=e?this.result_do_highlight(e):void 0},n.prototype.no_results=function(t){var n;return n=e('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),n.find("span").first().html(t),this.search_results.append(n),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result"),e.length?this.result_do_highlight(e.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last(),e.length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.keydown_checker=function(e){var t,n;switch(n=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),8!==n&&this.pending_backstroke&&this.clear_backstroke(),n){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},n.prototype.search_field_scale=function(){var t,n,i,r,o,s,a,l,c;if(this.is_multiple){for(i=0,c=0,a="position:absolute; left: -1000px; top: -1000px; display:none;",l=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],r=0,o=l.length;o>r;r++)s=l[r],a+=s+":"+this.search_field.css(s)+";";return t=e("<div />",{style:a}),t.text(this.search_field.val()),e("body").append(t),c=t.width()+25,t.remove(),n=this.container.outerWidth(),c>n-10&&(c=n-10),this.search_field.css({width:c+"px"})}},n}(t)}.call(this);
//# sourceMappingURL=bundle-lib.js.map

View File

@ -28,14 +28,14 @@ class Config {
Object.keys(window.ss.config.sections).forEach((key) => {
let route = window.ss.config.sections[key].route;
// Check if this is a top level route, which ideally hasa trailing slash
// Check if this is a top level route
const topLevelMatch = route.match(/^admin\/[^\/]+(\/?)$/);
if (!topLevelMatch) {
return;
}
if (!topLevelMatch[1]) {
route += '/';
}
// Remove trailing slash
route = route.replace(/\/$/, '');
// Check uniqueness and save
const isUnique = topLevelRoutes.indexOf(route) === -1;

View File

@ -233,7 +233,7 @@ $.entwine('ss', function($) {
// Register all top level routes.
Config.getTopLevelRoutes().forEach((route) => {
router(`/${route}*`, (ctx, next) => {
router(`/${route}(/*?)?`, (ctx, next) => {
// If the page isn't ready.
if (document.readyState !== 'complete') {

View File

@ -0,0 +1,23 @@
/* global jest, jasmine, describe, beforeEach, it, pit, expect, process */
jest.unmock('../router');
// FYI: Changing this to an import statements broke jest's automocking
const router = require('../router').default;
describe('Router', () => {
// Mock base dir
router.getAbsoluteBase = () => 'http://www.testsite.com/base/';
it('URLS resolve to the correct base route', () => {
expect(router.resolveURLToBase('http://www.testsite.com/base/somepage/subpage')).toBe('/somepage/subpage');
expect(router.resolveURLToBase('/base/somepage/subpage')).toBe('/somepage/subpage');
expect(router.resolveURLToBase('somepage/subpage')).toBe('/somepage/subpage');
});
it('External URLS are normalised to absolute paths', () => {
expect(router.resolveURLToBase('http://www.anotherpage.com/base/')).toBe('http://www.anotherpage.com/base/');
expect(router.resolveURLToBase('/wrong-base/page')).toBe('http://www.testsite.com/wrong-base/page');
expect(router.resolveURLToBase('../wrong-base/page')).toBe('http://www.testsite.com/wrong-base/page');
});
});

View File

@ -1,23 +0,0 @@
/* global jest, jasmine, describe, beforeEach, it, pit, expect, process */
jest.unmock('../router');
// FYI: Changing this to an import statements broke jest's automocking
const router = require('../router').default;
describe('Router', () => {
// Mock base dir
router.getAbsoluteBase = () => 'http://www.testsite.com/base/';
it('URLS resolve to the correct base route', () => {
expect(router.normalise('http://www.testsite.com/base/somepage/subpage')).toBe('/somepage/subpage');
expect(router.normalise('/base/somepage/subpage')).toBe('/somepage/subpage');
expect(router.normalise('somepage/subpage')).toBe('/somepage/subpage');
});
it('External URLS are normalised to absolute paths', () => {
expect(router.normalise('http://www.anotherpage.com/base/')).toBe('http://www.anotherpage.com/base/');
expect(router.normalise('/wrong-base/page')).toBe('http://www.testsite.com/wrong-base/page');
expect(router.normalise('../wrong-base/page')).toBe('http://www.testsite.com/wrong-base/page');
});
});