'),a.put("uikit/mw-exception-handler/i18n/de_DE.json",'{ "ExceptionHandler": { "mwExceptionModal": { "title": "Es ist etwas schiefgelaufen", "unknownError": "Leider ist ein unvorhergesehener Fehler aufgetreten. Sie können uns einen Fehlerbericht senden, sodass wir diesen schnellst möglich beseitigen können. Vielen Dank.", "userMessage": "Sie können uns zusätzlich ihre letzten Schritte beschreiben, sodass wir den Fehler schneller nachstellen können.", "userMessagePlaceholder": "(Optional)", "report": "Fehler melden", "thanks": "Vielen Dank für Ihre Rückmeldung. Wir werden uns umgehend um diesen Fehler kümmern." } } }'),a.put("uikit/mw-exception-handler/i18n/en_US.json",'{ "ExceptionHandler": { "mwExceptionModal": { "title": "Something went wrong", "unknownError": "Unfortunatly something went wrong. You can report this error so we can fix it. Thank you.", "userMessage": "You can leave some additional information to make it easier for us to reproduce the error", "userMessagePlaceholder": "(Optional)", "report": "Report error", "thanks": "Thanks for your feedback. We will have a look at this error as soon as possible." } } }'),a.put("uikit/mw-form/i18n/de_DE.json",'{ "mwForm": { "leaveConfirmation": "Ihre Änderungen wurden noch nicht gespeichert. Wenn Sie diese Seite verlassen gehen diese verloren!", "formActions": { "save": "Speichern", "cancel": "Abbrechen" } }, "mwErrorMessages": { "required": "ist ein Pflichtfeld", "hasToBeValidEmail": "muss eine valide E-Mail Adresse sein", "hasToMatchPattern": "muss dem Muster entsprechen", "hasToBeValidUrl": "muss eine valide URL sein", "hasToBeValidPhoneNumber": "muss die Ländervorwahl beinhalten zum Beispiel: +49 1577 / 8344", "hasToBeMin": "muss mindestens {{min}} sein", "hasToBeMinLength": "muss mindestens {{ngMinlength}} Zeichen haben", "hasToBeSmaller": "darf maximal {{max}} sein", "hasToBeSmallerLength": "darf maximal {{ngMaxlength}} Zeichen haben", "invalidInput": "Eingabe is ungültig" } }'),a.put("uikit/mw-form/i18n/en_US.json",'{ "mwForm": { "leaveConfirmation": "Your changes haven\'t been saved yet. If you leave this page all changes will be discarded!", "formActions": { "save": "Save", "cancel": "Cancel" } }, "mwErrorMessages": { "required": "is required", "hasToBeValidEmail": "has to be a valid e-mail", "hasToMatchPattern": "has to match the pattern", "hasToBeValidUrl": "has to be a valid URL", "hasToBeValidPhoneNumber": "must include the country code e.g. +49 1577 834-443", "hasToBeMin": "has to be at least {{min}}", "hasToBeMinLength": "has to have a least {{ngMinlength}} chars", "hasToBeSmaller": "must not be greater than {{max}}", "hasToBeSmallerLength": "must not have more chars than {{ngMaxlength}}", "invalidInput": "input is invalid" } }'),a.put("uikit/mw-inputs/i18n/de_DE.json",'{ "mwSelectBox": { "pleaseSelect": "Option auswählen" } }'),a.put("uikit/mw-inputs/i18n/en_US.json",'{ "mwSelectBox": { "pleaseSelect": "Select an option" } }'),a.put("uikit/mw-list/i18n/de_DE.json",'{ "List": { "mwListHead": { "items": "Einträge", "selectAll": "Alle selektieren", "clearSelection": "Selektion aufheben", "itemSelected": "{{name}} ist selektiert", "itemsSelected": "{{count}} von {{total}} {{name}} sind selektiert", "itemAmount": "{{total}} {{name}}", "searchFor": "{{name}} suchen", "notAvailable": "N/V", "notAvailableTooltip": "Der Eintrag ist nicht verfügbar. Eventuell wurde dieser gelöscht." }, "mwListFooter": { "noneFound": "Es wurden keine Einträge gefunden" } } }'),
+a.put("uikit/mw-list/i18n/en_US.json",'{ "List": { "mwListHead": { "items": "Items", "selectAll": "Select all", "clearSelection": "Clear selection", "itemSelected": "{{name}} is selected", "itemsSelected": "{{count}} out of {{total}} {{name}} are selected", "itemAmount": "{{total}} {{name}}", "searchFor": "Search for {{name}}", "notAvailable": "N/V", "notAvailableTooltip": "The entry is not available anymore. Maybe is has been deleted." }, "mwListFooter": { "noneFound": "No entries have been found." } } }'),a.put("uikit/mw-modal/i18n/de_DE.json",'{ "Modal": { "mwModalConfirm": { "areYouSure": "Sind Sie sich sicher?" } } }'),a.put("uikit/mw-modal/i18n/en_US.json",'{ "Modal": { "mwModalConfirm": { "areYouSure": "Are you sure?" } } }'),a.put("uikit/mw-ui-components/i18n/de_DE.json",'{ "UiComponents": { "mwToggle": { "on": "An", "off": "Aus" }, "mwTimelineFieldset": { "entriesHiddenSingular": "1 Eintrag ist ausgeblendet", "entriesHiddenPlural": "{{count}} Einträge sind ausgeblendet" }, "mwTextCollapsible": { "showMore": "mehr anzeigen", "showLess": "weniger anzeigen" }, "mwButtonHelp": { "isDisabledBecause": "Dieser Button ist deaktiviert weil:" }, "mwIndefiniteLoading": { "loading": "Lade Daten..." } } }'),a.put("uikit/mw-ui-components/i18n/en_US.json",'{ "UiComponents": { "mwToggle": { "on": "On", "off": "Off" }, "mwTimelineFieldset": { "entriesHiddenSingular": "One entry is hidden", "entriesHiddenPlural": "{{count}} entries are hidden" }, "mwTextCollapsable": { "showMore": "show more", "showLess": "show less" }, "mwButtonHelp": { "isDisabledBecause": "This button is currently disabled because:" }, "mwIndefiniteLoading": { "loading": "Loading data..." } } }'),a.put("uikit/mw-utils/i18n/de_DE.json",'{ "Utils": { "ok": "Ok", "cancel": "Abbrechen", "mwLeaveConfirmationModal": { "title": "Möchten Sie wirklich die aktuelle Seite verlassen?", "continue": "Fortfahren", "stay": "Auf Seite bleiben" } } }'),a.put("uikit/mw-utils/i18n/en_US.json",'{ "Utils": { "ok": "Ok", "cancel": "Cancel", "mwLeaveConfirmationModal": { "title": "Do you really want to leave the current page?", "continue": "Continue", "stay": "Stay on this page" } } }'),a.put("uikit/mw_ui_icons.json",'{ "check": "fa-check", "angleLeft": "fa-angle-left", "angleRight": "fa-angle-right", "angleUp": "fa-angle-up", "angleDown": "fa-angle-down", "caretRight": "fa-caret-right", "sort": "fa-sort", "sortAsc": "fa-sort-asc", "sortDesc": "fa-sort-desc", "warning": "fa-warning", "cross": "fa-times", "chevronUpCircle": "fa-chevron-circle-up", "chevronDownCircle": "fa-chevron-circle-down", "question": "fa-question", "questionCircle": "fa-question-circle-o", "refresh": "fa-refresh", "gears": "fa-cog", "undo": "fa-undo", "info": "fa-info" }')}]),window.mwUI.Backbone={hostName:"",basePath:"",Selectable:{},Utils:{},use$http:!0},b.module("mwUI.Backbone",[]),mwUI.Backbone.Utils.concatUrlParts=function(){var a=_.toArray(arguments),b=[];return a=_.compact(a),_.each(a,function(a,c){a=0===c?a.replace(/\/$/g,""):a.replace(/^\/|\/$/g,""),b.push(a)}),b.join("/")},mwUI.Backbone.Utils.getUrl=function(a){var b,c,d;if(!(a instanceof mwUI.Backbone.Model||a instanceof mwUI.Backbone.Collection))throw new Error("An instance of a collection or a model has to be passed as argument to the function");if(b=_.result(a,"hostName")||"",c=_.result(a,"basePath")||"",d=_.result(a,"endpoint"),!d||0===d.length)throw new Error("An endpoint has to be specified");return window.mwUI.Backbone.Utils.concatUrlParts(b,c,d)},mwUI.Backbone.Utils.request=function(a,b,c,d){c=c||{};var e,f={url:a,type:b};return d&&(f.instance=d),a&&!a.match(/\/\//)&&(e=d instanceof mwUI.Backbone.Model||d instanceof mwUI.Backbone.Collection?_.result(d,"hostName"):mwUI.Backbone.hostName||"",f.url=mwUI.Backbone.Utils.concatUrlParts(e,a)),Backbone.ajax(_.extend(f,c))},mwUI.Backbone.NestedModel=Backbone.NestedModel=Backbone.Model.extend({nested:function(){return{}},_prepare:function(){var a=this.nested(),b={};for(var c in a){if("function"!=typeof a[c])throw new Error("Nested attribute "+c+" is not a valid constructor. Do not set an instance as nested attribute.");var d=new a[c];d.parent=this,b[c]=d}return b},_setNestedModel:function(a,b){if(_.isObject(b))this.get(a).set(b);else{var c=this.get(a).idAttribute;this.get(a).set(c,b)}},_setNestedCollection:function(a,b){if(_.isObject(b)&&!_.isArray(b))this.get(a).add(b);else if(_.isArray(b))b.forEach(function(b){this._setNestedCollection(a,b)}.bind(this));else{var c=this.get(a).model.prototype.idAttribute,d={};d[c]=b,this.get(a).add(d)}},_setNestedAttributes:function(a){for(var b in a){var c=this.nested(),d=a[b],e=c[b];!e||d instanceof e||!this.get(b)||(this.get(b)instanceof Backbone.Model?this._setNestedModel(b,d):this.get(b)instanceof Backbone.Collection&&this._setNestedCollection(b,d),delete a[b])}return a},_nestedModelToJson:function(a){var b;return b=a instanceof Backbone.NestedModel?a._prepareDataForServer():a.toJSON()},_prepareDataForServer:function(){var a=_.extend({},this.attributes),b=this.nested();for(var c in b){var d=this.get(c);if(d instanceof Backbone.Model)a[c]=this._nestedModelToJson(d);else if(d instanceof Backbone.Collection){var e=[];d.each(function(a){e.push(this._nestedModelToJson(a))}.bind(this)),a[c]=e}}return this.compose(a)},constructor:function(a,b){return b=b||{},b.parse&&(a=this.parse(a),b.parse=!1),this.attributes=this._prepare(),this.set(a),a=this.attributes,Backbone.Model.prototype.constructor.call(this,a,b)},set:function(a,b){var c={};return _.isString(a)?c[a]=b:_.isObject(a)&&(c=a),_.isObject(b)||(b=null),c=this._setNestedAttributes(c),Backbone.Model.prototype.set.call(this,c,b)},compose:function(a){return a},toJSON:function(a){return a?this._prepareDataForServer():Backbone.Model.prototype.toJSON.apply(this,arguments)},clear:function(a){var b={};for(var c in this.attributes)this.get(c)instanceof Backbone.Model?this.get(c).clear():this.get(c)instanceof Backbone.Collection?this.get(c).reset():b[c]=void 0;return this.set(b,_.extend({},a,{unset:!0}))}}),mwUI.Backbone.Selectable.Model=function(a,b){var c=a,d=b.selected||!1;this.isInCollection=!1,this.hasDisabledFn="function"==typeof b.isDisabled||!1,this.isDisabled=function(){return this.hasDisabledFn?b.isDisabled.apply(a,arguments):!1},this.isSelected=function(){return d},this.select=function(b){b=b||{},this.isDisabled()&&!b.force||this.isSelected()||(d=!0,b.silent||this.trigger("change change:select",a,this))},this.unSelect=function(b){b=b||{},this.isSelected()&&(d=!1,b.silent||this.trigger("change change:unselect",a,this))},this.toggleSelect=function(){this.isSelected()?this.unSelect():this.select()};var e=function(){if(!(c instanceof Backbone.Model))throw new Error("First parameter has to be the instance of a model")};e.call(this)},_.extend(mwUI.Backbone.Selectable.Model.prototype,Backbone.Events),mwUI.Backbone.SelectableModel=Backbone.SelectableModel=Backbone.Model.extend({selectable:!0,selectableOptions:function(){return{selected:!1,isDisabled:null}},selectableModelConstructor:function(a){this.selectable&&(this.selectable=new mwUI.Backbone.Selectable.Model(this,this.selectableOptions.call(this,a))),this.on("destroy",function(){this.collection&&this.collection.filterable&&this.collection.filterable.getTotalAmount()>0&&this.collection.filterable.setTotalAmount(this.collection.filterable.getTotalAmount()-1)})},constructor:function(a,b){var c=Backbone.Model.prototype.constructor.call(this,a,b);return this.selectableModelConstructor(b),c}}),mwUI.Backbone.Model=mwUI.Backbone.NestedModel.extend({selectable:!0,hostName:function(){return mwUI.Backbone.hostName},basePath:function(){return mwUI.Backbone.basePath},endpoint:null,selectableOptions:mwUI.Backbone.SelectableModel.prototype.selectableOptions,urlRoot:function(){return mwUI.Backbone.Utils.getUrl(this)},constructor:function(){var a=mwUI.Backbone.NestedModel.prototype.constructor.apply(this,arguments);return mwUI.Backbone.SelectableModel.prototype.selectableModelConstructor.apply(this,arguments),a},getEndpoint:function(){return this.urlRoot()},setEndpoint:function(a){this.endpoint=a},sync:function(a,b,c){return c.instance=this,mwUI.Backbone.NestedModel.prototype.sync.call(this,a,b,c)},request:function(a,b,c){return mwUI.Backbone.Utils.request(a,b,c,this)}}),mwUI.Backbone.Filter=function(){var a=function(a,b){return _.isUndefined(a)||null===a||""===a||0===a.length||_.isArray(a)&&0===_.compact(a).length?null:b},b=function(b,c){var d=!1;if(!_.isObject(b))throw console.log(b),new Error("The argument values has to be an object");for(var e in b)a(b[e],!0)?d=!0:delete c[e];return d?c:null};return{containsString:function(b,c){return a(c,{type:"containsString",fieldName:b,contains:c})},string:function(b,c){return a(c,{type:"string",fieldName:b,value:c})},and:function(a){return this.logOp(a,"AND")},nand:function(a){return this.logOp(a,"NAND")},or:function(a){return this.logOp(a,"OR")},logOp:function(a,b){return a=_.without(a,null),0===a.length?null:{type:"logOp",operation:b,filters:a}},"boolean":function(b,c){return a(c,{type:"boolean",fieldName:b,value:c})},stringMap:function(b,c,d){return"%%"===d&&(d=""),a(d,{type:"stringMap",fieldName:b,value:d,key:c})},stringEnum:function(b,c){return a(c,{type:"stringEnum",fieldName:b,values:_.flatten(c)})},"long":function(b,c){return a(c,{type:"long",fieldName:b,value:c})},like:function(b,c){return a(c,{type:"like",fieldName:b,like:c})},notNull:function(b){return a(!0,{type:"null",fieldName:b})},dateRange:function(a,c,d){return c=c?+new Date(c):null,d=d?+new Date(d):null,b({min:c,max:d},{type:"dateRange",fieldName:a,min:c,max:d})},longRange:function(a,c,d){return b({min:c,max:d},{type:"longRange",fieldName:a,min:c,max:d})}}},mwUI.Backbone.Filterable=function(a,b){b=b||{};var c,d,e=a,f=b.limit,g=f?b.offset:!1,h=b.page||1,i=b.perPage||30,j=b.customUrlParams||{},k=b.filterValues||{},l=b.filterDefinition,m=b.sortOrder,n=function(a){return JSON.parse(JSON.stringify(a))};this.filterValues={},this.customUrlParams={},this.fields=b.fields,this.filterIsSet=!1,this.hasFilterChanged=function(a){return JSON.stringify(a)!==JSON.stringify(d)},this.getRequestParams=function(a){a=a||{},a.params=a.params||{};var b=this.getFilters();return b&&(a.params.filter=b),i&&h&&(f||_.isUndefined(f))&&(a.params.limit=i,a.params.offset=h>1?i*(h-1):0),m&&m.length>0&&(a.params.sortOrder=m),(f||g)&&(a.params.limit=f,a.params.offset=g),f===!1&&delete a.params.limit,this.fields&&this.fields.length>0&&(a.params.field=this.fields),this.customUrlParams&&_.extend(a.params,_.result(this,"customUrlParams")),a.params.getNonpagedCount=!0,d=b,a.params},this.getInitialFilterValues=function(){return k},this.setInitialFilterValues=function(a){for(var b in a)this.filterValues[b]===k[b]&&(this.filterValues[b]=a[b]);_.extend(k,a),this.filterValues=_.extend({},k,this.filterValues)},this.setLimit=function(a){f=a,g=g||0},this.setTotalAmount=function(a){c=a},this.getTotalAmount=function(){return c},this.loadPreviousPage=function(){return h-=1,e.fetch({remove:!1})},this.hasPreviousPage=function(){return h>=1},this.loadNextPage=function(){return h+=1,e.fetch({remove:!1})},this.hasNextPage=function(){return c&&c>e.length},this.getPage=function(){return h},this.setPage=function(a){h=a},this.getTotalPages=function(){return Math.floor(c/i)},this.setSortOrder=function(b){h=1,m=b,a.trigger("change:sortOrder",b)},this.getSortOrder=function(){return m},this.getInvalidFilterKeys=function(a){var b=[];return _.forEach(a,function(a,c){_.has(this.filterValues,c)||b.push(c)}.bind(this)),b},this.setFilters=function(b,c){c=c||{};var d=this.getInvalidFilterKeys(b);if(d.length>0)throw new Error("[mwFilterable] The filter keys '"+d.join(",")+"' do not exist, did you add them to filterValues of the model?");_.forEach(b,function(b,d){this.filterValues[d]=b;var e={};e[d]=b,(_.isUndefined(c.silent)||!c.silent)&&a.trigger("change:filterValue",e)},this),this.resetPagination(),this.filterIsSet=!0},this.getFilters=function(){return _.isFunction(l)?l.apply(this):void 0},this.resetFilters=function(){this.filterValues=n(k),this.customUrlParams=j,this.resetPagination(),this.filterIsSet=!1},this.resetPagination=function(){this.setPage(b.page||1)},function(){if(!(e instanceof Backbone.Collection))throw new Error("First parameter has to be the instance of a collection");b.filterValues&&(k=n(b.filterValues)),this.resetFilters()}.bind(this)()},mwUI.Backbone.FilterableCollection=Backbone.FilterableCollection=Backbone.Collection.extend({selectable:!0,filterableOptions:function(){return{limit:void 0,offset:!1,page:1,perPage:30,filterValues:{},customUrlParams:{},filterDefinition:function(){},fields:[],sortOrder:""}},filterableCollectionConstructor:function(a){this.filterable&&(this.filterable=new mwUI.Backbone.Filterable(this,this.filterableOptions.call(this,a)))},constructor:function(a,b){var c=Backbone.Collection.prototype.constructor.call(this,a,b);return this.filterableCollectionConstructor(b),c},fetch:function(a){if(a=a||{},this.filterable){var b=this.filterable.getRequestParams(a);window.mwUI.Backbone.use$http?(a.params=a.params||{},_.extend(a.params,b)):(a.data=a.data||{},_.extend(a.data,b))}return Backbone.Collection.prototype.fetch.call(this,a)}}),mwUI.Backbone.Selectable.Collection=function(a,b){var c=a,d=b||{},e=!0,f=d.isSingleSelection||!1,g=d.addPreSelectedToCollection||!1,h=d.unSelectOnRemove,i=b.preSelected,j=!!b.preSelected,k=new(mwUI.Backbone.Collection.extend({selectable:!1,filterable:!1})),l=function(){if(i instanceof Backbone.Model)this.preSelectModel(i);else{if(!(i instanceof Backbone.Collection))throw new Error("The option preSelected has to be either a Backbone Model or Collection");this.preSelectCollection(i)}},m=function(a){k.get(a)||this.select(a)},n=function(a){k.get(a)&&this.unSelect(a)},o=function(a,b){b=b||{},(b.unset||!a.id||a.id.length<1)&&this.unSelect(a)},p=function(a){a.selectable.off("change:select",m,this),a.selectable.on("change:select",m,this)},q=function(a){a.selectable.off("change:unselect",n,this),a.selectable.on("change:unselect",n,this)},r=function(a,b){if(a&&a.selectable){var d=k.get(a);d?(c.get(a)?(a.selectable.isInCollection=!0,d.selectable.isInCollection=!0):(a.selectable.isInCollection=!1,d.selectable.isInCollection=!1),a.selectable.select(b),d.selectable.select(b)):a.selectable.unSelect(b),p.call(this,a),q.call(this,a)}},s=function(a,b){j&&(this.isSingleSelection()?i=b:(i.remove(a,{silent:!0}),i.add(b,{silent:!0})))},t=function(a){var b=this.getSelected().get(a);b&&(this.unSelect(b,{silent:!0}),this.select(a,{silent:!0}),s.call(this,b,a),r.call(this,b,{silent:!0}))};this.getSelected=function(){return k},this.getDisabled=function(){var a=new Backbone.Collection;return e&&c.each(function(b){b.selectable&&b.selectable.isDisabled()&&a.add(b)}),a},this.select=function(a,b){if(b=b||{},!(a instanceof Backbone.Model))throw new Error("The first argument has to be a Backbone Model");a instanceof c.model||(a=new c.model(a.toJSON())),!a.selectable||a.selectable.isDisabled()&&!b.force||(f&&this.unSelectAll(),c.get(a)&&(a=c.get(a)),a.on("change",o,this),k.add(a,b),r.call(this,a,b),b.silent||this.trigger("change change:add",a,this))},this.selectAll=function(){c.each(function(a){this.select(a)},this)},this.unSelect=function(a,b){b=b||{},a.off("change",o,this),k.remove(a,b),r.call(this,a,b),b.silent||this.trigger("change change:remove",a,this)},this.unSelectAll=function(){this.getSelected().secureEach(function(a){this.unSelect(a)},this)},this.toggleSelectAll=function(){this.allSelected()?this.unSelectAll():this.selectAll()},this.allSelected=function(){var a=this.getDisabled().length;return this.getSelected().length===c.length-a},this.allDisabled=function(){return this.getDisabled().length===c.length},this.isSingleSelection=function(){return f},this.setSingleSelection=function(a){if(i instanceof Backbone.Model){if(!a)throw new Error("isSingleSelection can not be set to false when preselected is a model!");f=!0}else f=a},this.reset=function(){this.unSelectAll(),l.call(this)},this.preSelectModel=function(a){a.id&&(j=!0,!c.get(a)&&g?c.add(a):c.get(a)&&(a=c.get(a)),this.select(a,{force:!0,silent:!0}))},this.preSelectCollection=function(a){a.each(function(a){this.preSelectModel(a)},this),a.on("add",function(a){this.preSelectModel(a)},this),a.on("remove",function(a){this.unSelect(a)},this)},this.setCollectionFromSelection=function(a){var b=this.getSelected();if(!(a instanceof mwUI.Backbone.Collection))throw new Error("[Selectable] The passed collection is not an instance of mwUI.Backbone.Collection");return a.replace(b.toJSON()),a},this.setModelFromSelection=function(a){var b=this.getSelected();if(!(a instanceof Backbone.Model))throw new Error("[Selectable] The passed model is not an instance of Backbone.Model");return 0===b.length?a.clear():a.set(b.first().toJSON()),a},this.useSelectionFor=function(a){return a instanceof Backbone.Model?this.setModelFromSelection(a):a instanceof Backbone.Collection?this.setCollectionFromSelection(a):void 0};var u=function(){if(!(c instanceof Backbone.Collection))throw new Error("The first parameter has to be from type Backbone.Collection");c.on("add",function(a){e=a.selectable.hasDisabledFn,r.call(this,a),t.call(this,a)},this),c.on("remove",function(a){h?this.unSelect(a):r.call(this,a)},this),c.on("reset",function(){h?this.unSelectAll():this.getSelected().each(function(a){r.call(this,a)},this)},this),i instanceof Backbone.Model?this.setSingleSelection(!0):this.setSingleSelection(d.isSingleSelection||!1),j&&l.call(this)}.bind(this);u.call(this)},_.extend(mwUI.Backbone.Selectable.Collection.prototype,Backbone.Events),mwUI.Backbone.SelectableCollection=Backbone.SelectableCollection=Backbone.Collection.extend({selectable:!0,selectableOptions:function(){return{isSingleSelection:!1,addPreSelectedToCollection:!1,unSelectOnRemove:!1,preSelected:new Backbone.Collection}},selectableCollectionConstructor:function(a){this.selectable&&(this.selectable=new mwUI.Backbone.Selectable.Collection(this,this.selectableOptions.call(this,a)))},constructor:function(a,b){var c=Backbone.Collection.prototype.constructor.call(this,a,b);return this.selectableCollectionConstructor(b),c}}),mwUI.Backbone.Collection=Backbone.Collection.extend({selectable:!0,filterable:!0,hostName:function(){return mwUI.Backbone.hostName},basePath:function(){return mwUI.Backbone.basePath},endpoint:null,selectableOptions:mwUI.Backbone.SelectableCollection.prototype.selectableOptions,filterableOptions:mwUI.Backbone.FilterableCollection.prototype.filterableOptions,model:mwUI.Backbone.Model,secureEach:function(a,b){_.pluck(this.models,"cid").forEach(function(c,d){var e=this.get(c,d);a.call(b,e,d,this.models)}.bind(this))},url:function(){return window.mwUI.Backbone.Utils.getUrl(this)},getEndpoint:function(){return this.url()},setEndpoint:function(a){this.endpoint=a},replace:function(a){this.reset(a),this.trigger("replace",this)},constructor:function(){var a=Backbone.Collection.prototype.constructor.apply(this,arguments);return mwUI.Backbone.SelectableCollection.prototype.selectableCollectionConstructor.apply(this,arguments),mwUI.Backbone.FilterableCollection.prototype.filterableCollectionConstructor.apply(this,arguments),a},fetch:function(){return mwUI.Backbone.FilterableCollection.prototype.fetch.apply(this,arguments)},request:function(a,b,c){return window.mwUI.Backbone.Utils.request(a,b,c,this)}}),b.module("mwUI.Backbone").directive("mwCollection",function(){return{require:["?ngModel","?^form"],link:function(a,b,c,d){var e,f,g;d.length>0&&(f=d[0]),d.length>1&&(g=d[1]);var h=function(){e.length>0?(f.$setViewValue(e),f.$render()):(f.$setViewValue(null),f.$render())},i=function(){e=a.$eval(c.mwCollection),e&&(h(),e.on("add remove reset",h),f.$setPristine(),g&&g.$setPristine(f))};if(f)if(a.mwModel)i();else var j=a.$watch("mwCollection",function(){j(),i()})}}}),b.module("mwUI.Backbone").directive("mwModel",function(){return{require:["?ngModel","?^form"],link:function(a,c,d,e){var f,g,h,i;e.length>0&&(h=e[0]),e.length>1&&(i=e[1]);var j=function(){var a=f.get(g);h.$formatters.forEach(function(b){a=b(a)}),h.$setViewValue(a),h.$render()},k=function(){var a={};a[g]=h.$modelValue,f.set(a,{fromNgModel:!0})},l=function(){var a=d.mwModelAttr,c=d.ngModel;return a&&a.length>0?a:b.isUndefined(a)&&c?c.split(".").pop():void 0},m=function(a,b,c){c.fromNgModel||j()},n=function(){if(f=a.$eval(d.mwModel),g=l(),h&&f&&g){if(f.on("change:"+g,m),h.$viewChangeListeners.push(k),h.$parsers.push(function(a){return k(),a}),f.get(g)&&h.$modelValue&&f.get(g)!==h.$modelValue)throw new Error("The ng-model and the backbone model can not have different values during initialization!");f.get(g)?(j(),h.$setPristine(),i&&i.$setPristine(h)):h.$modelValue&&k()}};if(a.mwModel&&l())n();else var o=a.$watch("mwModel",function(){o(),n()}),p=a.$watch("mwModelAttr",function(){p(),n()});a.$on("$destroy",function(){f&&g&&f.off("change:"+g,m)})}}});var c,d,e=Backbone.ajax,f=Backbone.sync;b.module("mwUI.Backbone").run(["$http","$q",function(a,b){c=a,d=b}]),Backbone.ajax=function(a){return mwUI.Backbone.use$http&&c?(a.method=a.type,a.success||a.error||!a.instance||(a.instance.isSynchronising=!0,a.instance.trigger("request")),c.apply(b,arguments).then(function(b){return a.success&&"function"==typeof a.success?a.success(b):a.instance&&(a.instance.isSynchronising=!1,a.instance.trigger("sync")),b},function(b){return a.error&&"function"==typeof a.error?a.error(b):a.instance&&(a.instance.isSynchronising=!1,a.instance.trigger("error")),d.reject(b)})):e.apply(this,arguments)},Backbone.sync=function(a,b,c){return c=c||{},_.isUndefined(c.wait)&&(c.wait=!0),b.isSynchronising=!0,f.call(Backbone,a,b,c).then(function(){return b.isSynchronising=!1,b},function(a){return b.isSynchronising=!1,d.reject(a)})},window.mwUI.Utils={ViewportBreakPoints:{XS:"xs",SM:"sm",MD:"md",LG:"lg"},shims:{}},b.module("mwUI.Utils",["mwUI.i18n","mwUI.Modal"]),b.module("mwUI.Utils").directive("mwAppendRouteClass",function(){return{link:function(a,b){var c=b.attr("class"),d=function(){b.attr("class",c)};a.$on("$routeChangeSuccess",function(a,c){d(),c&&c.cssClasses&&b.addClass(c.cssClasses)})}}}),b.module("mwUI.Utils").directive("mwDraggable",["$timeout",function(a){return{restrict:"A",scope:{mwDragData:"=",mwDragstart:"&",mwDragend:"&",mwDropEffect:"@"},link:function(b,c){c.attr("draggable",!0),c.addClass("draggable",!0),b.mwDragstart&&c.on("dragstart",function(c){c.originalEvent.dataTransfer.setData("text",JSON.stringify(b.mwDragData)),c.originalEvent.dataTransfer.effectAllowed=b.mwDropEffect,a(function(){b.mwDragstart({event:c,dragData:b.mwDragData})})}),c.on("dragend",function(c){b.mwDragend&&a(function(){b.mwDragend({event:c})})})}}}]),b.module("mwUI.Utils").directive("mwDroppable",["$timeout",function(a){return{restrict:"A",scope:{mwDropData:"=",mwDragenter:"&",mwDragleave:"&",mwDragover:"&",mwDrop:"&",disableDrop:"="},link:function(b,c){c.addClass("droppable");var d=function(a){var b=a.originalEvent.dataTransfer.getData("text");return b?JSON.parse(b):void 0};b.mwDragenter&&c.on("dragenter",function(d){b.disableDrop!==!0&&c.addClass("drag-over"),a(function(){b.mwDragenter({event:d})})}),b.mwDragleave&&c.on("dragleave",function(d){c.removeClass("drag-over"),a(function(){b.mwDragleave({event:d})})}),b.mwDrop&&c.on("drop",function(e){c.removeClass("drag-over"),e.stopPropagation&&e.stopPropagation();var f=d(e);return a(function(){b.mwDrop({event:e,dragData:f,dropData:b.mwDropData})}),!1});var e=function(a){return b.disableDrop!==!0?(a.preventDefault&&a.preventDefault(),!1):void 0};c.on("dragover",e),b.mwDragover&&c.on("dragover",function(c){a(function(){b.mwDragover({event:c})})}),b.$on("$destroy",function(){c.off()})}}}]),b.module("mwUI.Utils").directive("mwInfiniteScroll",["$window",function(a){return{restrict:"A",link:function(c,d,e){var f,g,h,i,j=!1,k=0;if(e.mwListCollection?f=c.$eval(e.mwListCollection).getCollection():e.collection?f=c.$eval(e.collection):console.warn("No collection was found for the infinite scroll pleas pass it as scope attribute"),f&&(!f||f.filterable)){var l=function(){return!j&&f.filterable.hasNextPage()?(j=!0,k++,f.filterable.loadNextPage().then(function(){j=!1})):void 0},m=function(){var a=4,b=9;return Math.min(a+k,b)/10},n=function(){var a=i[0].clientHeight||i.height(),b=a-h.height(),c=m();h.scrollTop()/b>c&&l()};if(e.scrollContainerSelector||e.scrollContentSelector){if(e.scrollContainerSelector&&d.parents(e.scrollContainerSelector).length>0)h=d.parents(e.scrollContainerSelector).first();else{if(e.scrollContainerSelector&&0===d.parents(e.scrollContainerSelector).length)throw new Error("No parent of the infinite scroll element with the selector "+e.scrollContainerSelector+" could be found!");h=d}if(e.scrollContentSelector&&d.find(e.scrollContentSelector).length>0)i=d.find(e.scrollContentSelector).first();else{if(e.scrollContentSelector&&0===d.find(e.scrollContentSelector).length)throw new Error("No child of the infinite scroll element with the selector "+e.scrollContentSelector+" could be found!");i=d}}else d.parents(".modal").length?(h=d.parents("*[mw-modal-body]"),i=d.parents(".modal-body")):(h=b.element(a),i=b.element(document));if(h===i)throw new Error("The scrollContainerElement can not be the same as the actual scrollContentElement");g=_.throttle(n,500),h.on("scroll",g),c.$on("$destroy",function(){h.off("scroll",g)})}}}}]),b.module("mwUI.Utils").directive("mwLeaveConfirmation",["$window","$rootScope","LeaveConfirmationModal",function(a,c,d){return{scope:{alertBeforeLeave:"=mwLeaveConfirmation",text:"@"},link:function(e){var f=new d,g=function(a){f.setScopeAttributes({nextUrl:a,text:e.text,leaveCallback:function(){e.changeLocationOff()},stayCallback:function(){}}),f.show()};if(e.changeLocationOff=c.$on("$locationChangeStart",function(a,b,c){e.alertBeforeLeave&&c&&b!==c&&(a.preventDefault(),g(b))}),a.onbeforeunload=function(){return e.alertBeforeLeave?e.text:void 0},!b.isDefined(e.text))throw new Error("Please specify a text in the text attribute");e.$on("$destroy",e.changeLocationOff)}}}]),b.module("mwUI.Utils").directive("mwPreventDefault",function(){return{restrict:"A",link:function(a,b,c){if(!c.mwPreventDefault)throw new Error('Directive mwPreventDefault: This directive must have an event name as attribute e.g. mw-prevent-default="click"');b.on(c.mwPreventDefault,function(a){a.preventDefault()})}}}),b.module("mwUI.Utils").directive("mwStopPropagation",function(){return{restrict:"A",link:function(a,b,c){if(!c.mwStopPropagation)throw new Error('Directive mwStopPropagation: This directive must have an event name as attribute e.g. mw-stop-propagation="keyup"');b.on(c.mwStopPropagation,function(a){a.stopPropagation()})}}}),b.module("mwUI.Utils").filter("mwReadableFileSize",function(){return function(a,c,d){if(!a||!b.isNumber(a)||0===a)return"0.0 kB";var e,f=-1,g=["kB","MB","GB","TB","PB","EB","ZB","YB"];void 0!==c&&(f=g.indexOf(c));do a/=1024,f++;while(a>1024);return e=Math.max(a,.1),d?e.toFixed(0)+" "+g[f]:e.toFixed(1)+" "+g[f]}}),b.module("mwUI.Utils").filter("reduceStringTo",function(){return function(a,b){return b&&a&&a.length>b?a.substr(0,b)+"...":a}}),b.module("mwUI.Utils").factory("LeaveConfirmationModal",["Modal",function(a){return a.prepare({templateUrl:"uikit/mw-utils/modals/templates/mw_leave_confirmation_modal.html",controller:"LeaveConfirmationModalController"})}]).controller("LeaveConfirmationModalController",["$scope",function(a){a.stay=function(){a.stayCallback(),a.hideModal()},a["continue"]=function(){if(!a.nextUrl)throw new Error("NextUrl has to be set!");a.leaveCallback(),a.hideModal().then(function(){document.location.href=a.nextUrl})}}]),b.module("mwUI.Utils").service("mwBootstrapBreakpoint",["$rootScope",function(a){var c=[],d=null,e=function(){for(var a in mwUI.Utils.ViewportBreakPoints){var d=b.element('
');b.element("body").append(d),c.push(d)}},f=function(){var b=d;c.forEach(function(a){a.is(":visible")&&(d=mwUI.Utils.ViewportBreakPoints[a.attr("data-type")])}),b!==d&&a.$broadcast("mwBootstrapBreakpoint:changed",d)},g=_.debounce(f,200);return e(),f(),b.element(window).on("resize",g),{getActiveBreakpoint:function(){return d}}}]),b.module("mwUI.Utils").provider("BrowserTitleHandler",function(){var a=!0,c="",d=null,e=function(){var a=b.element("head title");a&&!d&&(d=a.text())};this.setNewTitle=function(a){var c=b.element("head title");c&&c.text(a),d||(d=a)},this.setKeepOriginalTitle=function(b){a=b};var f=this;this.$get=function(){return{getOriginalTitle:function(){return d||e(),d},setTitle:function(a){c=a,f.setNewTitle(this.getTitle())},getTitle:function(){return c?a?this.getOriginalTitle()+"—"+c:c:this.getOriginalTitle()}}}}),b.module("mwUI.Utils").service("callbackHandler",["$injector",function(a){return{execFn:function(a,c,d){return c&&b.isArray(c)?a.apply(d,c):a.call(d,c)},getFn:function(c){if(b.isString(c))return a.get(c);if(b.isFunction(c))return c;throw new Error("First argument has to be either a valid service or function")},exec:function(a,b,c){return this.execFn(this.getFn(a),b,c)}}}]),window.mwUI.Utils.Scheduler={},window.mwUI.Utils.Scheduler.Task=window.mwUI.Backbone.Model.extend({defaults:function(){return{callback:function(){},executeInMs:0,_time:0}},getRemainingSleepTime:function(){return this.get("executeInMs")-this.get("_time")},decrementTime:function(a){a=a||1;var b=this.get("_time");this.set("_time",b+a)},canBeExecuted:function(){return this.getRemainingSleepTime()<=0},execute:function(){this.get("callback").apply(this.get("scope")),this.collection&&this.collection.remove(this)},resetTime:function(){this.set("_time",0)},kill:function(){return this.collection?this.collection.remove(this):!1}}),window.mwUI.Utils.Scheduler.TaskRunner=window.mwUI.Backbone.Collection.extend({_timer:!1,_stopped:!1,_startTime:null,_prevValue:null,model:window.mwUI.Utils.Scheduler.Task,_step:function(a){var b,c;this.isStopped()||(this._startTime&&(this._startTime=a),b=a-this._startTime,c=this._prevValue?b-this._prevValue:0,this.length>0&&(this.secureEach(function(a){a.canBeExecuted()?a.execute():a.decrementTime(c)}),this._prevValue=b,window.requestAnimationFrame(this._step.bind(this))))},start:function(){this._stopped=!1,this._startTime=null,this._prevValue=null,this.length>0&&window.requestAnimationFrame(this._step.bind(this))},isRunning:function(){return this.length>0&&!this._stopped},isStopped:function(){return this._stopped},stop:function(){this._stopped=!0},add:function(a,b,c,d){if("function"==typeof a&&(a=new window.mwUI.Utils.Scheduler.Task({id:c||_.uniqueId("task"),callback:a,executeInMs:b,scope:d||window})),mwUI.Backbone.Collection.prototype.add.call(this,a),a&&!_.isFunction(a.get("callback")))throw new Error("[mwScheduler] Task has to be a function");return this.isStopped()||this.start(),a},remove:function(a){var b=this.findWhere({callback:a});return mwUI.Backbone.Collection.prototype.remove.call(this,b||a)},get:function(a){return"function"==typeof a?this.findWhere({callback:a}):mwUI.Backbone.Collection.prototype.get.apply(this,arguments)}}),b.module("mwUI.Utils").service("mwScheduler",function(){var a=new window.mwUI.Utils.Scheduler.TaskRunner;return b.element(document).on("visibilitychange",function(){document.hidden?a.stop():a.start()}.bind(this)),b.element(window).on("blur",a.stop.bind(a)),b.element(window).on("focus",a.start.bind(a)),a}),b.module("mwUI.Utils").service("mwUrlStorage",["$rootScope","$location","$route",function(a,b,c){var d={},e=[],f=null,g=null,h=null,i=function(){c.current&&c.current.$$route&&(f&&f(),g&&g(),null===h&&(h=c.current.$$route.reloadOnSearch),f=a.$on("$routeUpdate",function(){f(),f=null;var d=b.absUrl();g=a.$on("$locationChangeStart",function(a,b){g(),b===d&&a.preventDefault()}),c.current.$$route.reloadOnSearch=h,h=null}),c.current.$$route.reloadOnSearch=!1)},j=function(){var a=_.clone(e);a.forEach(function(a,b){d[a]=null,e.splice(b,1)})},k=function(){var a,c=b.search();a=_.extend(c,d),i(),b.search(a),b.replace()};return a.$on("$routeChangeStart",function(a,b,c){
+b&&c&&b.originalPath!==c.originalPath&&(e.length>0&&j(b.params),k())}),{getItem:function(a){return b.search()[a]},setObject:function(a,b){b=b||{};var c=!1;if(!_.isObject(a))throw new Error("[mwUrlStorage] parameter has to be an object otherwise setItem(key, val) should be called ");for(var f in a)a.hasOwnProperty(f)&&d[f]!==a[f]&&(b.removeOnUrlChange&&-1===e.indexOf(f)&&e.push(f),d[f]=a[f],c=!0);c&&k()},setItem:function(a,b,c){c=c||{},d[a]!==b&&(c.removeOnUrlChange&&-1===e.indexOf(a)&&e.push(a),d[a]=b,k())},removeObject:function(a){var b=!1;if(!_.isObject(a))throw new Error("[mwUrlStorage] parameter has to be an object otherwise deleteItem(key, val) should be called ");for(var c in a)if(a.hasOwnProperty(c)){(d[c]||this.getItem(c))&&(d[c]=null,b=!0);var f=e.indexOf(c);-1!==f&&e.slice(f,1)}b&&k()},removeItem:function(a){var b=e.indexOf(a);return-1!==b&&e.slice(b,1),d[a]?(d[a]=null,k(),!0):!1},clear:function(){d={},e=[],k()}}}]),b.module("mwUI.Utils").service("mwRuntimeStorage",function(){var a={};return{getItem:function(b){return a[b]},setObject:function(b){if(!_.isObject(b))throw new Error("[mwRuntimeStorage] parameter has to be an object otherwise setItem(key, val) should be called");for(var c in b)b.hasOwnProperty(c)&&a[c]!==b[c]&&(a[c]=b[c])},setItem:function(b,c){a[b]!==c&&(a[b]=c)},removeObject:function(b){if(!_.isObject(b))throw new Error("[mwRuntimeStorage] parameter has to be an object otherwise deleteItem(key, val) should be called");for(var c in b)b.hasOwnProperty(c)&&a[c]&&(a[c]=null)},removeItem:function(b){return a[b]?(a[b]=null,!0):!1},clear:function(){a={}}}});var g=function(a,b){for(var c in b)if(c in a&&_.isObject(a[c])&&_.isObject(b[c]))g(a[c],b[c]);else{if(_.isObject(a[c])&&!_.isObject(b[c]))throw new Error("Target["+c+"] is an object but source["+c+"] is from type "+typeof b[c]+"! You can not overwrite an object with type "+typeof b[c]);a[c]=b[c]}return a};window.mwUI.Utils.shims.deepExtendObject=g,window.mwUI.Utils.shims.domObserver=function(a,c,d){var e=new MutationObserver(function(a){c.call(this,a)}),f=a instanceof b.element?a[0]:a;return d=d||{attributes:!0,childList:!0,characterData:!0},e.observe(f,d),e},window.mwUI.Utils.shims.routeToRegExp=function(a){var b=/\((.*?)\)/g,c=/(\(\?)?:\w+/g,d=/\*\w?/g,e=/[\-{}\[\]+?.,\\\^$|#\s]/g;if(!_.isString(a))throw new Error("The route "+JSON.stringify(a)+"has to be a URL");return a=a.replace(e,"\\$&").replace(b,"(?:$1)?").replace(c,function(a,b){return b?a:"([^/?]+)"}).replace(d,"([^?]*?)"),new RegExp("^"+a+"(?:\\?([\\s\\S]*))?$")};var h=[],i=function(a){-1===h.indexOf(a)&&(console.warn(a),h.push(a))};window.mwUI.Utils.shims.deprecationWarning=i,b.module("mwUI.Utils").config(["i18nProvider",function(a){a.addResource("mw-utils/i18n","uikit")}]),b.module("mwUI.ExceptionHandler",["mwUI.Modal","mwUI.i18n","mwUI.UiComponents","mwUI.Utils"]),b.module("mwUI.ExceptionHandler").factory("ExceptionModal",["Modal",function(a){return a.prepare({templateUrl:"uikit/mw-exception-handler/modals/templates/mw_exception_modal.html",controller:"ExceptionModalController"})}]).controller("ExceptionModalController",["$scope","$q","Wizard",function(a,b,c){a.exception=null,a.wizard=c.createWizard("exception"),a.report=function(){b.when(a.successCallback()).then(function(){a.wizard.next()})},a.cancel=function(){a.errorCallback?b.when(a.errorCallback()).then(function(){a.hideModal()}):a.hideModal()},a.close=function(){a.hideModal()}}]),b.module("mwUI.ExceptionHandler").provider("$exceptionHandler",function(){var a=[];return{registerHandler:function(b){a.push(b)},$get:["callbackHandler","$log",function(b,c){return function(d,e){if(d=d||"",e=e||"",_.isString(d)&&d.match(/unhandled rejection/))return console.warn(d),!1;try{a.forEach(function(a){b.exec(a,[d.toString(),e.toString()])})}catch(f){c.error(f)}c.error(d)}}]}}),b.module("mwUI.ExceptionHandler").provider("exceptionHandlerModal",function(){var a=!0,c={displayException:!1,userCanEnterMessage:!1,successCallback:null,errorCallback:null};return{disableExceptionModal:function(){a=!1},setModalOptions:function(a){_.extend(c,a)},$get:["callbackHandler","ExceptionModal",function(d,e){var f=new e,g=function(){var a=b.element.find("div[ng-view]");a&&b.element(a).hide()};return function(b,e){if(a){if(c.successCallback){var h=c.successCallback;c.successCallback=function(){return d.exec(h,[b.toString(),e.toString()])}}if(c.errorCallback){var i=c.errorCallback;c.errorCallback=function(){d.exec(i,[b.toString(),e.toString()])}}f.setScopeAttributes(_.extend({},c,{exception:b.toString(),cause:e})),g(),f.show()}}}]}}),b.module("mwUI.ExceptionHandler").config(["$exceptionHandlerProvider","i18nProvider",function(a,b){a.registerHandler("exceptionHandlerModal"),b.addResource("mw-exception-handler/i18n","uikit")}]),b.module("mwUI.Form",["mwUI.i18n","mwUI.Modal","mwUI.Utils"]),b.module("mwUI.Form").directive("mwFormActions",["$route",function(a){return{scope:{save:"&",cancel:"&",showSave:"=",showCancel:"="},templateUrl:"uikit/mw-form/directives/templates/mw_form_actions.html",link:function(c,d,e){c.form=d.inheritedData("$formController"),c.viewModel={isLoading:!1,hasSave:b.isDefined(e.save),hasCancel:b.isDefined(e.cancel),showSave:!0,showCancel:!0},c.$watch("showSave",function(a){b.isDefined(a)&&(c.viewModel.showSave=a)}),c.$watch("showCancel",function(a){b.isDefined(a)&&(c.viewModel.showCancel=a)});var f=function(){c.viewModel.isLoading=!0},g=function(){c.viewModel.isLoading=!1},h=function(a){c.form&&c.form.$setPristine();var b=c.$eval(a);b&&b.then&&(f(),b.then(g,g))};c.saveFacade=function(){h(c.save)},c.cancelFacade=function(){h(b.isDefined(e.cancel)?c.cancel:function(){return a.reload()})}}}}]),b.module("mwUI.Form").directive("mwErrorMessages",["mwValidationMessages",function(a){return{require:"^ngModelErrors",templateUrl:"uikit/mw-form/directives/templates/mw_error_messages.html",link:function(b,c,d,e){b.errors=e.getErrors,b.getMessageForError=function(b){return a.getMessageFor(b.get("error"),b.get("attrs"))}}}}]);var j=function(){return{restrict:"E",link:function(a,b){b.addClass("form-horizontal"),b.attr("novalidate","true")}}};b.module("mwUI.Form").directive("form",j),b.module("mwUI.Form").directive("mwFormLeaveConfirmation",["$compile",function(a){return{require:"^form",link:function(b,c,d,e){var f=a('')(b),g=!0;b.showConfirmation=function(){return e.$dirty&&g},c.on("submit",function(){g=!1}),c.on("input",function(){g=!0}),c.append(f),b.$on("$destroy",function(){g=!1})}}}]),b.module("mwUI.Form").directive("mwCheckboxWrapper",function(){return{transclude:!0,scope:{label:"@",tooltip:"@"},templateUrl:"uikit/mw-form/directives/templates/mw_checkbox_wrapper.html"}}),b.module("mwUI.Form").directive("mwInputWrapper",function(){return{transclude:!0,scope:{label:"@",tooltip:"@",hideErrors:"="},templateUrl:"uikit/mw-form/directives/templates/mw_input_wrapper.html",controller:function(){var a={dirty:!0,valid:!0,touched:!1},c={required:!1,focused:!1},d="text",e=function(a,c){if(!b.isObject(c))throw new Error("State has to be an object");_.extend(a,c)};this.setModelState=function(b){e(a,b)},this.getModelState=function(){return a},this.setInputState=function(a){e(c,a)},this.getInputState=function(){return c},this.setType=function(a){d=a},this.getType=function(){return d}},link:function(a,b,c,d){a.isValid=function(){return d.getModelState().valid},a.isDirty=function(){return d.getModelState().dirty},a.isTouched=function(){return d.getModelState().touched},a.isRequired=function(){return d.getInputState().required},a.isFocused=function(){return d.getInputState().focused},a.hasError=function(){return!a.hideErrors&&!a.isValid()&&a.isDirty()},a.hasRequiredError=function(){return a.isRequired()&&!a.isValid()},a.getType=d.getType}}}),b.module("mwUI.Form").directive("ngModel",function(){return{require:["ngModel","?^ngModelErrors","?^mwInputWrapper"],link:function(a,c,d,e){var f=e[0],g=e[1],h=e[2],i=_.uniqueId("input_el"),j=function(a,b){var c=_.keys(a),e=_.keys(b),f=_.difference(e,c);g.addErrorsForInput(c,i,_.clone(d)),g.removeErrorsForInput(f,i,_.clone(d))},k=function(){h.setModelState({dirty:f.$dirty,valid:f.$valid,touched:f.$touched})},l=function(){a.$watch(function(){return f.$error},function(a,b){j(a,b)},!0)},m=function(){a.$watch(function(){return f.$error},k,!0),a.$watch(function(){return f.$touched},k),d.$observe("required",function(){h.setInputState({required:b.isDefined(c.attr("required"))})}),c.on("focus blur",function(a){h.setInputState({focused:"focus"===a.type})}),a.$on("$destroy",c.off.bind(c))};g&&l(),h&&m()}}}),b.module("mwUI.Form").directive("ngModelErrors",function(){return{scope:!0,controller:function(){var a=mwUI.Backbone.Model.extend({idAttribute:"error",nested:function(){return{inputIds:Backbone.Collection}}}),b=Backbone.Collection.extend({model:a}),c=new b,d=function(a,b,d){var e=c.get(a);if(e){var f=e.get("inputIds");_.extend(e.get("attrs"),d),f.add({id:b})}else c.add({error:a,inputIds:[b],attrs:d})},e=function(a,b){var d=c.get(a);if(d){var e=d.get("inputIds"),f=e.get(b);f&&(e.remove(f),0===e.length&&c.remove(d))}};this.addErrorsForInput=function(a,b,c){a.forEach(function(a){d(a,b,c)})},this.removeErrorsForInput=function(a,b){a.forEach(function(a){e(a,b)})},this.getErrors=function(){return c}}}}),b.module("mwUI.Form").directive("mwSetDirtyOnModelChange",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.valueWatcher=function(a){return void 0!==a&&null!==a?(d.$setDirty(),d.$setTouched()):d.$setPristine(),!0}}}}),b.module("mwUI.Form").config(["mwValidationMessagesProvider",function(a){a.registerValidator("customValidation","mwErrorMessages.invalidInput")}]).directive("mwCustomErrorValidator",["mwValidationMessages","i18n",function(a,c){return{require:"ngModel",scope:{isValid:"=mwIsValid",errorMsg:"@mwCustomErrorValidator"},link:function(d,e,f,g){g.$validators.customValidation=function(){var a=!1;return a=_.isUndefined(d.isValid)?!0:d.isValid},d.$watch("isValid",function(){a.updateMessage("customValidation",function(){return d.errorMsg&&b.isString(d.errorMsg)&&"false"!==d.errorMsg?d.errorMsg:b.isUndefined(d.errorMsg)?c.get("mwErrorMessages.invalidInput"):""}),g.$validate()})}}}]),b.module("mwUI.Form").provider("mwValidationMessages",function(){var a={},b={},c={},d=function(c,d){if("function"==typeof d)b[c]=d;else if("string"==typeof d)a[c]=d;else if(d)throw new Error("The validation has to be either a string or a function. String can be also a reference to i18n")};this.registerValidator=function(c,e){if(a[c]||b[c])throw new Error("The key "+c+" has already been registered");d(c,e)},this.$get=["$rootScope","i18n",function(e,f){var g=function(b,c){var d=a[b];return f.translationIsAvailable(d)?f.get(d,c):d},h=function(a,c){return b[a](f,c)};return{getRegisteredValidators:function(){return _.extend(a,c)},getMessageFor:function(c,d){return b[c]?h(c,d):a[c]?g(c,d):void 0},updateMessage:function(c,e){if(!a[c]&&!b[c])throw new Error("The key "+c+" is not available. You have to register it first via the provider");d(c,e)}}}]}),b.module("mwUI.Form").config(["i18nProvider","mwValidationMessagesProvider",function(a,b){a.addResource("mw-form/i18n","uikit"),b.registerValidator("required","mwErrorMessages.required"),b.registerValidator("email","mwErrorMessages.hasToBeValidEmail"),b.registerValidator("pattern","mwErrorMessages.hasToMatchPattern"),b.registerValidator("url","mwErrorMessages.hasToBeValidUrl"),b.registerValidator("phone","mwErrorMessages.hasToBeValidPhoneNumber"),b.registerValidator("min","mwErrorMessages.hasToBeMin"),b.registerValidator("minlength","mwErrorMessages.hasToBeMinLength"),b.registerValidator("max","mwErrorMessages.hasToBeSmaller"),b.registerValidator("maxlength","mwErrorMessages.hasToBeSmallerLength")}]),b.module("mwUI.i18n",["mwUI.Backbone"]),b.module("mwUI.i18n").provider("i18n",function(){var a=[],c=[],d={},e=!1,f=null,g=null,h=function(){return _.findWhere(c,{active:!0})},i=function(a){var b=h(),d=_.findWhere(c,{id:a});if(!d)throw new Error("You can not set a locale that has not been registered. Please register the locale first by calling addLocale()");b&&(b.active=!1),d.active=!0},j=function(a){var c=f||h();if(c&&d&&d[c.id]){var e=d[c.id];return b.forEach(a.split("."),function(a){e=e?e[a]:null}),e}return!1},k=function(a){var b;return _.each(c,function(c){!b&&a[c.id]&&(b=a[c.id])}),b||(b=_.values(a)[0]),b},l=function(a){for(var b,c=/{{\s*([a-zA-Z0-9$_]+)\s*}}/g,d=[];null!==(b=c.exec(a));)b.index===c.lastIndex&&c.lastIndex++,d.push(b[1]);return d},m=function(a,b){if(b){var c=l(a);c.forEach(function(c){var d=c.replace(/[$_]/g,"\\$&"),e=new RegExp("{{\\s*"+d+"\\s*}}");a=a.replace(e,b[c])})}return a};this.addLocale=function(a,b,e,f){e=e||a+".json";var h=_.findWhere(c,{id:a});h?(h.name=b,h.fileExtension=e,h.basePath=f):(c.push({id:a,name:b,active:a===g,basePath:f||"",fileExtension:e}),d[a]={})},this.addResource=function(b,c){c=c||"";var d=_.findWhere(a,{path:b});d?d.basePath=c:a.push({path:b,basePath:c})},this.setDefaultLocale=function(a){g=a,_.findWhere(c,{id:a})&&i(a)},this.$get=["$templateRequest","$q","$rootScope",function(l,n,o){return{_loadResource:function(b){var c=_.findWhere(a,{path:b}),e=this.getActiveLocale(),f="";return c&&e?(f=mwUI.Backbone.Utils.concatUrlParts(e.basePath,c.basePath,c.path,e.fileExtension),l(f).then(function(a){return _.extend(d[e.id],JSON.parse(a)),a})):n.reject("Resource not available or no locale has been set")},getLocales:function(){return c},getActiveLocale:function(){return h()},get:function(a,b){var c=j(a);return c?m(c,b):e?"...":"MISSING TRANSLATION "+this.getActiveLocale().id+": "+a},setLocale:function(b){var c=[];return o.$broadcast("i18n:loadResourcesStart"),e=!0,f=this.getActiveLocale(),i(b),_.each(a,function(a){c.push(this._loadResource(a.path))},this),n.all(c).then(function(){return e=!1,o.$broadcast("i18n:loadResourcesSuccess"),f=null,o.$broadcast("i18n:localeChanged",b),b})},translationIsAvailable:function(a){return!!j(a)},localize:function(a){var c=this.getActiveLocale(),d=a[c.id];return b.isDefined(d)&&""!==d?d:a[g]||k(a)},extendForLocale:function(a,b){if(!a)throw new Error("Locale is a required argument!");if(!_.isObject(b))throw new Error("The translations argument is of type "+typeof b+" but it has to be an object!");if(!_.findWhere(c,{id:a}))throw new Error("The locale "+a+" does not exist! Make sure you have registered it.");e||mwUI.Utils.shims.deepExtendObject(d[a],b),o.$on("i18n:loadResourcesSuccess",function(){mwUI.Utils.shims.deepExtendObject(d[a],b)})},extend:function(a){if(!_.isObject(a))throw new Error("The localesWithTranslations argument is from type "+typeof a+" but it has to be an object!");for(var b in a)this.extendForLocale(b,a[b])}}}]}),b.module("mwUI.i18n").filter("i18n",["i18n",function(a){function b(b,c){return _.isString(b)?a.get(b,c):_.isObject(b)?a.localize(b):void 0}return b.$stateful=!0,b}]),b.module("mwUI.Inputs",["mwUI.i18n","mwUI.Backbone"]),b.module("mwUI.Inputs").directive("input",function(){return{restrict:"E",link:function(a,c,d){var e=function(){var a=b.element(''),d=b.element(''),e=b.element('');c.wrap(a),d.insertAfter(c),e.insertAfter(d)},f=function(){a.$on("$destroy",function(){c.off(),c.parent(".mw-checkbox").remove()}),e()};"checkbox"===d.type&&f()}}}),b.module("mwUI.Inputs").directive("mwCheckboxGroup",["i18n",function(a){return{restrict:"A",scope:{mwCollection:"=",mwOptionsCollection:"=",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/mw-inputs/directives/templates/mw_checkbox_group.html",link:function(b){var c=function(){return b.mwCollection.model.prototype.idAttribute};if(b.getLabel=function(c){var d=c.get(b.mwOptionsLabelKey);return d?b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+d):d:void 0},b.isOptionDisabled=function(a){return a.selectable.isDisabled()},b.isSelected=function(a){return!!b.mwCollection.get(a.get(c()))},b.toggleModel=function(a){var c=b.mwCollection.findWhere(a.toJSON());c?b.mwCollection.remove(c):b.mwCollection.add(a.toJSON())},!(b.mwCollection instanceof Backbone.Collection))throw new Error("[mwCheckboxGroup] The attribute mwCollection is required and has to be an instanceof Backbone Collection");if(!(b.mwOptionsCollection instanceof Backbone.Collection))throw new Error("[mwCheckboxGroup] The attribute mwOptionsCollection is required and has to be an instanceof Backbone Collection")}}}]);var k=function(){return{restrict:"E",require:"?^mwInputWrapper",link:function(a,b,c,d){var e=["radio","checkbox"];-1===e.indexOf(c.type)&&b.addClass("form-control"),d&&(c.type?d.setType(c.type):b[0].tagName&&d.setType(b[0].tagName.toLowerCase()))}}};b.module("mwUI.Inputs").directive("select",k).directive("input",k).directive("textarea",k),b.module("mwUI.Inputs").directive("input",function(){return{restrict:"E",link:function(a,c,d){var e=function(){var a=b.element(''),d=b.element(''),e=b.element('');c.wrap(a),d.insertAfter(c),e.insertAfter(d)},f=function(){a.$on("$destroy",function(){c.off(),c.parent(".mw-radio").remove()}),e()};"radio"===d.type&&f()}}}),b.module("mwUI.Inputs").directive("mwRadioGroup",["i18n",function(a){return{restrict:"A",scope:{mwModel:"=",mwModelAttr:"@",mwOptionsCollection:"=",mwOptionsKey:"@",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/mw-inputs/directives/templates/mw_radio_group.html",link:function(b){b.radioGroupId=_.uniqueId("radio_");var c=function(a){b.mwModelAttr?b.mwModel.set(b.mwModelAttr,a.get(b.mwOptionsKey)):b.mwModel.set(a.toJSON())},d=function(){b.mwModelAttr?b.mwModel.unset(b.mwModelAttr):b.mwModel.clear()};if(b.getLabel=function(c){var d=c.get(b.mwOptionsLabelKey);return d?b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+d):d:void 0},b.isOptionDisabled=function(a){return a.selectable.isDisabled()},b.getModelAttribute=function(){return b.mwModelAttr||b.mwModel.idAttribute},b.isChecked=function(a){return b.mwModelAttr?a.get(b.mwOptionsKey)===b.mwModel.get(b.mwModelAttr):a.id===b.mwModel.id},b.selectOption=function(a){b.isChecked(a)?d():c(a)},b.mwModelAttr&&!b.mwOptionsKey)throw new Error("[mwRadioGroup] When using mwModelAttr the attribute mwOptionsKey is required!")}}}]),b.module("mwUI.Inputs").directive("select",function(){return{link:function(a,c){var d=b.element(''),e=function(){c.wrap(d),c.addClass("custom")};e()}}}),b.module("mwUI.Inputs").directive("mwSelectBox",["i18n",function(a){return{restrict:"A",scope:{mwModel:"=",mwModelAttr:"@",mwOptionsCollection:"=",mwOptionsKey:"@",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwPlaceholder:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/mw-inputs/directives/templates/mw_select_box.html",link:function(b){b.viewModel={};var c=function(a){b.mwModelAttr?b.mwModel.set(b.mwModelAttr,a.get(b.mwOptionsKey)):b.mwModel.set(a.toJSON())},d=function(){b.mwModelAttr?b.mwModel.unset(b.mwModelAttr):b.mwModel.clear()},e=function(){b.mwModelAttr?b.viewModel.selected=b.mwModel.get(b.mwModelAttr):b.mwModel.id&&(b.viewModel.selected=b.mwModel.id.toString())},f=function(){b.mwOptionsCollection.each(function(a){if(!a.id)throw new Error("[mwSelectBox] Each model of the options collection must have an id. Make sure you set the correct model and modelId attribute!")})},g=function(){d(),b.viewModel.selected=null};if(b.getLabel=function(c){var d=c.get(b.mwOptionsLabelKey);return d?b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+d):d:void 0},b.hasPlaceholder=function(){return b.mwPlaceholder||b.mwRequired},b.getPlaceholder=function(){return b.mwPlaceholder?b.mwPlaceholder:b.mwRequired?a.get("mwSelectBox.pleaseSelect"):void 0},b.isOptionDisabled=function(a){return a.selectable.isDisabled()},b.getModelAttribute=function(){return b.mwModelAttr||b.mwModel.idAttribute},b.isChecked=function(a){return b.mwModelAttr&&b.mwModel instanceof Backbone.Model?a.get(b.mwOptionsKey)===b.mwModel.get(b.mwModelAttr):a.id===b.mwModel.id},b.select=function(a){a?b.selectOption(b.mwOptionsCollection.get(a)):g()},b.selectOption=function(a){b.isChecked(a)||c(a)},b.mwModel){if(!(b.mwModel instanceof Backbone.Model))throw new Error("[mwSelectBox] The attribute mw-model is from type "+typeof b.mwModel+" but has to be a Backbone Model!");b.mwModel.on("change:"+b.mwModel.idAttribute,e),e(),b.mwModel.on("change",function(a){(b.mwModelAttr&&!a.get(b.mwModelAttr)||!b.mwModelAttr&&!a.id)&&g()})}if(b.mwModelAttr&&!b.mwOptionsKey)throw new Error("[mwSelectBox] When using mwModelAttr the attribute mwOptionsKey is required!");if(!(b.mwOptionsCollection&&b.mwOptionsCollection instanceof Backbone.Collection))throw new Error("[mwSelectBox] An options collection is required. Make sure you set the attribute mw-options-collection and that it is a backbone collection!");f(),b.mwOptionsCollection.on("add",f)}}}]),b.module("mwUI.Inputs").directive("mwToggle",["$timeout",function(a){return{scope:{mwModel:"=",mwDisabled:"=",mwIconOn:"@",mwIconOff:"@",mwChange:"&"},replace:!0,templateUrl:"uikit/mw-inputs/directives/templates/mw_toggle.html",link:function(b){b.toggle=function(c){b.mwModel!==c&&(b.mwModel=!b.mwModel,a(function(){b.mwChange({value:b.mwModel})}))}}}}]),b.module("mwUI.Inputs").config(["i18nProvider",function(a){a.addResource("mw-inputs/i18n","uikit")}]),b.module("mwUI.Layout",["mwUI.Utils"]),b.module("mwUI.Layout").directive("mwUi",["Modal",function(a){return{transclude:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_ui.html",controller:["$scope",function(a){this.addClass=function(b){a.addClass(b)},this.removeClass=function(b){a.removeClass(b)}}],link:function(b,c){b.displayToasts=function(){return 0===a.getOpenedModals().length},b.addClass=function(a){c.addClass(a)},b.removeClass=function(a){c.removeClass(a)}}}}]),b.module("mwUI.Layout").directive("mwHeader",["$rootScope","$route","$location","BrowserTitleHandler",function(a,c,d,e){return{transclude:!0,scope:{title:"@",url:"@?",mwTitleIcon:"@?",showBackButton:"=?",mwBreadCrumbs:"=?",description:"@?",disableReload:"=?"},require:"^?mwUi",templateUrl:"uikit/mw-layout/directives/templates/mw_header.html",link:function(f,g,h,i,j){if(a.siteTitleDetails=f.title,e.setTitle(f.title),f.showRefreshButton=!0,f.mwTitleIcon&&g.find(".description").addClass("has-title-icon"),j(function(a){a&&0!==a.length||f.showBackButton||g.find(".mw-header").addClass("no-buttons"),g.find("[mw-form-actions]")&&g.find("[mw-form-actions]").length>0&&(f.showRefreshButton=!1)}),f.refresh=function(){c.reload()},f.toggleDescription=function(){f.showDescription=!f.showDescription},f.back=function(){var a=f.url.replace("#","");d.path(a)},f.canShowDescriptionButton=function(){return b.isDefined(f.description)},f.canShowBackButton=function(){return(b.isUndefined(f.showBackButton)||f.showBackButton)&&b.isDefined(f.url)},!f.url&&f.mwBreadCrumbs&&f.mwBreadCrumbs.length>0)f.url=f.mwBreadCrumbs[f.mwBreadCrumbs.length-1].url;else if(!f.url&&f.showBackButton)throw new Error("[mwHeader] Can not show back button when the attribute url is not defined");i&&(i.addClass("has-mw-header"),f.$on("$destroy",function(){i.removeClass("has-mw-header")})),f.disableReload&&(f.showRefreshButton=!1)}}}]),b.module("mwUI.Layout").directive("mwSidebar",function(){return{transclude:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_sidebar.html",link:function(a,c){var d=c.find(".mw-sidebar"),e=b.element(".mw-footer"),f=b.element(".mw-header"),g=b.element(".mw-menu-top-bar"),h=function(){var a=b.element(window).innerHeight(),c=a;f.length&&(c-=f.height()),g.length&&(c-=g.height()),e.length&&(c-=e.height()),d.css("maxHeight",c)},i=_.throttle(h,100);h(),b.element(window).on("resize",i)}}}),b.module("mwUI.Layout").directive("mwFooter",function(){return{transclude:!0,scope:{type:"@mwFooter"},templateUrl:"uikit/mw-layout/directives/templates/mw_footer.html"}}),b.module("mwUI.Layout").directive("mwSubNav",function(){return{restrict:"A",scope:{justified:"="},transclude:!0,replace:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_sub_nav.html"}}),b.module("mwUI.Layout").directive("mwSubNavPill",["$location",function(a){return{restrict:"A",scope:{url:"@mwSubNavPill",mwDisabled:"="},transclude:!0,replace:!0,templateUrl:"uikit/mw-layout/directives/templates/mw_sub_nav_pill.html",link:function(b,c){var d=function(a){b.url&&a===b.url.slice(1)?c.addClass("active"):c.removeClass("active")};b.$watch("url",function(b){b&&d(a.$$path)}),b.navigate=function(c){b.mwDisabled||(c=c.replace(/#\//,""),a.path(c),a.replace())},d(a.$$path)}}}]),b.module("mwUI.List",["mwUI.i18n","mwUI.Backbone","mwUI.UiComponents"]),window.mwUI.List={localStoragePrefix:"tbl_confg_v1"};var l=window.mwUI.Backbone.Model.extend({});window.mwUI.List.MwTableColumn=l;var m=window.mwUI.Backbone.Model.extend({fetched:!1,nested:function(){return{columns:window.mwUI.List.MwTableColumns}},sync:function(){var a=Backbone.$.Deferred();return a.resolve(this),a.promise()},fetch:function(){if(!this.fetched){var a=localStorage.getItem(window.mwUI.List.localStoragePrefix+"_"+this.id);a&&this.set(JSON.parse(a)),this.fetched=!0}return this.sync()},save:function(){return localStorage.setItem(window.mwUI.List.localStoragePrefix+"_"+this.id,JSON.stringify(this.toJSON(!0))),this.sync()},destroy:function(){return this.clear(),localStorage.removeItem(window.mwUI.List.localStoragePrefix+"_"+this.id),this.sync()},clear:function(){var a=this.get("id");mwUI.Backbone.Model.prototype.clear.apply(this,arguments),this.set("id",a)}});window.mwUI.List.MwTableConfigurator=m;var n=window.mwUI.Backbone.Collection.extend({model:window.mwUI.List.MwTableColumn});window.mwUI.List.MwTableColumns=n;var o=window.mwUI.Backbone.Collection.extend({model:window.mwUI.List.MwTableConfigurator});window.mwUI.List.MwTableConfigurators=o,b.module("mwUI.List").directive("mwListableBb",function(){return{scope:{collection:"=",mwListCollection:"=",enableConfigurator:"=?",id:"@"},compile:function(a){return a.append(""),function(a,b){b.addClass("hide-all-cols"),b.addClass("table table-striped mw-list")}},controller:["$scope","TableConfigurator",function(a,b){var c,d=a.columns=[],e=null,f=null;this.enableConfigurator=a.enableConfigurator,this.actionColumns=[],this.maxActionColumnsAmount=0;var g=function(b,c){a.$emit(b,c),d.forEach(function(a){a.scope.$broadcast(b,c)})};this.registerColumn=function(a){d.push(a),g("mwList:registerColumn")},this.updateColumn=function(a){if(a&&a.id){var b=_.findWhere(d,{id:a.id}),c=_.indexOf(d,b);if(c>-1){var e=d[c];_.extend(e,a),g("mwList:updateColumn",e)}}},this.unRegisterColumn=function(a){if(a&&a.id){var b=_.findWhere(d,{id:a.id}),c=_.indexOf(d,b);c>-1&&(d.splice(c,1),g("mwList:unRegisterColumn",d[c]))}},this.getColumns=function(){return d},this.getId=function(){return a.id},this.getCollection=function(){return e},this.getTableConfigurator=function(){if(!c){if(!a.id)return!1;c=b.getInstanceForTableId(a.id)}return c.fetch(),c},this.isSingleSelection=function(){return e&&e.selectable?e.selectable.isSingleSelection():!1},a.$on("$destroy",function(){this.actionColumns=[]}.bind(this)),a.mwListCollection?(e=a.mwListCollection.getCollection(),f=a.mwListCollection.getMwListCollectionFilter()):a.collection&&(e=a.collection)}]}}).directive("mwListableBb",function(){return{require:"mwListableBb",link:function(a,b,c,d){var e=function(){b.removeClass("hide-all-cols")},f=_.debounce(e,200),g=function(){b.removeClass(function(a,b){return(b.match(/(^|\s)(hidden-col-|visible-col-)\S+/g)||[]).join(" ")})},h=function(){g(),d.getColumns().forEach(function(a){a.scope.isVisible()?b.addClass("visible-col-"+a.pos):b.addClass("hidden-col-"+a.pos)}),f()},i=_.debounce(h,200);a.$on("mwList:registerColumn",i),a.$on("mwList:unRegisterColumn",i),a.$on("mwList:updateColumn",i)}}}),b.module("mwUI.List").directive("mwListableAction",["$timeout",function(a){return{require:["^mwListableBb","^?mwListableBodyRowBb"],transclude:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_action_button.html",scope:{action:"&mwListableAction"},link:function(b,c,d,e){var f,g=e[0],h=e[1],i=function(){if(_.isNumber(f)){var a=b.action,c=_.findWhere(g.actionColumns,{id:f});if(c)c.actions.push(a);else{var d={id:f,actions:[a]};g.actionColumns.push(d),c=d}c.actions.length>g.maxActionColumnsAmount&&(g.maxActionColumnsAmount=c.actions.length)}},j=function(){if(_.isNumber(f)){var a=_.findWhere(g.actionColumns,{id:f});if(a){var c=_.indexOf(a.actions,b.action);if(a.actions.splice(c,1),0===a.actions.length){var d=_.indexOf(g.actionColumns,a);g.actionColumns.splice(d,1)}}}};b.execute=function(){a(b.action)},h&&(f=h.getId()),i(d.action),b.$on("$destroy",j)}}}]),b.module("mwUI.List").directive("mwListableBodyRowBb",["$timeout",function(a){return{require:"^mwListableBb",controller:["$scope",function(a){this.getId=function(){return a.$id}}],compile:function(b){return b.prepend('
'),b.append('
'),function(b,c,d,e){var f="selected";if(b.collection=e.getCollection(),b.actionColumns=e.actionColumns,!b.item)throw new Error('No item available in the list! Please make sure to use ng-repeat="item in collection"');b.item&&b.item.selectable&&!b.item.selectable.isDisabled()?c.addClass("selectable clickable"):e.actionColumns&&e.actionColumns.length>0&&c.addClass("clickable"),c.on("click",function(){b.item&&b.item.selectable&&!b.item.selectable.isDisabled()&&a(function(){b.item.selectable.toggleSelect()})}),c.on("dblclick",function(){var c=b.$id;if(e.actionColumns){var d=_.findWhere(e.actionColumns,{id:c}),f=d.actions[0];f&&a(f)}}),b.$watch("item.selectable.isSelected()",function(a){a?c.addClass(f):c.removeClass(f)})}}}}]),b.module("mwUI.List").directive("mwListBodyRowCheckbox",function(){return{restrict:"A",require:"^mwListableBb",scope:{item:"="},templateUrl:"uikit/mw-list/directives/templates/mw_list_body_row_checkbox.html",link:function(a,b,c,d){a.isSingleSelection=d.isSingleSelection(),a.click=function(a,b){b.stopPropagation(),a.selectable&&a.selectable.toggleSelect()},a.$watch("item.selectable.isDisabled()",function(b){b&&a.item.selectable.unSelect()})}}}),b.module("mwUI.List").directive("mwListColumnConfigurator",["$timeout",function(a){return{require:"^mwListableBb",scope:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_column_configurator.html",link:function(c,d,e,f){var g=d.find(".dropdown-menu"),h=d.find(".btn-group"),i="scroll touchmove mousewheel resize";c.colums=f.getColumns();var j=f.getTableConfigurator(),k=function(){h.hasClass("open")&&g.dropdown("toggle")},l=function(a){j?(j.get("columns").add({id:a.persistId,visible:a.scope.isVisible()},{merge:!0}),j.save()):console.warn("In order to persist the visibility of the column the table needs an id!")};c.getColTitle=function(a){if(a&&a.scope){var b=a.scope.getTitle()||"";return b.length>0?b:!1}},c.reset=function(){c.colums.forEach(function(a){a.scope.resetColumnVisibility()}),j&&j.destroy()},c.toggleColumn=function(a){a.scope.toggleColumn(),l(a)},h.on("show.bs.dropdown",function(){var c=d[0].getBoundingClientRect();g.css({position:"fixed",top:c.top+d.innerHeight(),left:"inherit",marginLeft:-1*g.innerWidth()+d.innerWidth()}),a(function(){b.element(window).on(i,k)})}),h.on("hide.bs.dropdown",function(){b.element(window).off(i,k)})}}}]),b.module("mwUI.List").directive("mwListableFooterBb",function(){return{require:"^mwListableBb",templateUrl:"uikit/mw-list/directives/templates/mw_list_footer.html",link:function(a,b,c,d){a.collection=d.getCollection(),a.columns=d.getColumns(),a.collection.on("request",function(){
+a.isSynchronising=!0}),a.collection.on("sync error",function(){a.isSynchronising=!1}),a.showSpinner=function(){return a.isSynchronising&&a.collection.filterable.hasNextPage()}}}}),b.module("mwUI.List").directive("mwListableHead2",["$window","$document","i18n",function(a,c,d){return{scope:{collection:"=",mwListCollection:"=",affix:"=",affixOffset:"=",collectionName:"@",nameFn:"&",nameAttribute:"@",localizeName:"@",nameI18nPrefix:"@",nameI18nSuffix:"@",searchAttribute:"@"},transclude:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_head.html",link:function(c,e,f,g,h){var i,j,k=b.element("body"),l=b.element("*[mw-menu-top-bar]"),m=e.parents("*[mw-modal-body]"),n=b.element("*[mw-header]"),o=!1,p=b.isDefined(c.affix)?c.affix:!0,q=b.element(a);c.selectable=!1,c.selectedAmount=0,c.collectionName=c.collectionName||d.get("List.mwListHead.items"),c.isModal=m.length>0,c.isLoadingModelsNotInCollection=!1,c.hasFetchedModelsNotInCollection=!1,c.isLoadingModelsNotInCollection=!1,c.hasFetchedModelsNotInCollection=!1;var r,s=_.throttle(function(){if(e.is(":visible")){if(!r){var a,b,d=0,f=0,g=0;if(c.isModal){var h=e.parents(".modal-content").find(".modal-header");h.length?(d=h.offset().top,f=h.innerHeight(),g=0):g=e.innerHeight(),g-=4}else n.length?(d=n.last().offset().top,f=n.last().innerHeight(),g=5):l.length&&(d=l.innerHeight());a=d+f,b=e.offset().top,r=b-a-g}var j=i.scrollTop();j>r&&p?(e.find(".mw-listable-header").css("top",j-r),e.addClass("affixed")):p?(e.find(".mw-listable-header").css("top","initial"),e.removeClass("affixed")):i.off("scroll",s)}},10),t=_.throttle(function(){e.find(".mw-listable-header").css("top","initial"),r=null}),u=function(){if(!c.hasFetchedModelsNotInCollection){var a=[];if(c.selectable.getSelected().each(function(b){b.selectable.isInCollection||c.getModelAttribute(b)||a.push(b)}),0!==a.length){var b=j.constructor.extend({filterableOptions:function(){return{filterDefinition:function(){var b=new window.mCAP.Filter,c=[];return a.forEach(function(a){a.id&&c.push(b.string(a.idAttribute,a.id))}),b.or(c)}}}}),d=new b;d.url=j.url(),c.isLoadingModelsNotInCollection=!0,d.fetch().then(function(b){c.hasFetchedModelsNotInCollection=!0;var d=c.selectable.getSelected();b.each(function(a){d.get(a.id).set(a.toJSON())});var e=_.difference(_.pluck(a,"id"),b.pluck("uuid"));e.forEach(function(a){d.get(a).selectable.isDeletedItem=!0}),c.isLoadingModelsNotInCollection=!1})}}};c.getCollection=function(){return j},c.showSelected=function(){o=!0,u(),setTimeout(function(){var d;c.isModal?(d=m.height()+(m.offset().top-e.find(".selected-items").offset().top)+25,m.css("overflow","hidden")):(d=b.element(a).height()-e.find(".selected-items").offset().top+i.scrollTop()-25,k.css("overflow","hidden")),e.find(".selected-items").css("height",d),e.find(".selected-items").css("bottom",-1*d)})},c.hideSelected=function(){c.isModal?m.css("overflow","auto"):k.css("overflow","inherit"),o=!1},c.canShowSelected=function(){return c.selectable&&o&&c.selectedAmount>0},c.unSelect=function(a){a.selectable.unSelect()},c.toggleSelectAll=function(){c.selectable.toggleSelectAll()},c.getTotalAmount=function(){return j.filterable&&j.filterable.getTotalAmount()?j.filterable.getTotalAmount():j.length},c.toggleShowSelected=function(){o?c.hideSelected():c.showSelected()},c.getModelAttribute=function(a){if(c.nameAttribute){var e=a.get(c.nameAttribute);if(c.nameI18nPrefix||c.nameI18nSuffix){var f=c.nameI18nPrefix||"",g=c.nameI18nSuffix||"";return d.get(f+"."+e+"."+g)}return b.isDefined(c.localizeName)?d.localize(e):e}return c.nameFn({item:a})};var v=function(){c.selectable=j.selectable,i=c.isModal?m:q,i.on("scroll",s),i.on("resize",t),c.$on("$destroy",function(){i.off("scroll",s)}),c.$on("$destroy",function(){i.off("resize",t)}),e.on("focus","input[type=text]",function(){e.find(".search-bar").addClass("focused")}),e.on("blur","input[type=text]",function(){e.find(".search-bar").removeClass("focused")})};if(h(function(a){a&&a.length>0&&e.addClass("has-extra-content")}),c.$watch(function(){return c.selectable?c.selectable.getSelected().length:0},function(a){c.selectedAmount=a,1>a&&c.hideSelected()}),c.mwListCollection)j=c.mwListCollection.getCollection();else{if(!c.collection)throw new Error("[mwListableHead2] Either a collection or a mwListCollection has to be passed as attribute");j=c.collection}v()}}}]),b.module("mwUI.List").directive("mwListableHeaderBb",["$rootScope","$timeout","mwBootstrapBreakpoint",function(a,c,d){return{require:"^mwListableBb",scope:{property:"@?sort",title:"@?",hidden:"=?",mandatory:"=?"},transclude:!0,replace:!0,templateUrl:"uikit/mw-list/directives/templates/mw_list_header.html",link:function(e,f,g,h){var i,j="+",k="-",l=h.getCollection(),m=f.text()||"",n=h.getTableConfigurator(),o=e.property||g.title||m.trim(),p=!0,q=function(){return l&&l.filterable?l.filterable.getSortOrder():!1},r=function(a,b){var c=b+a;return l.filterable.setSortOrder(c),l.fetch()},s=function(){return{scope:e,pos:f.index(),id:e.$id,persistId:o}},t=function(){g.title||(e.title=f.text().trim())},u=function(){c(function(){e.pos=f.index(),t(),h.updateColumn(s())})},v=_.debounce(u,100),w=function(){var a=f.attr("class").match(/hidden-[a-z]{2}/g),b=f.attr("class").match(/visible-[a-z]{2}/g),c=d.getActiveBreakpoint(),e=!1;return a&&a.forEach(function(a){e||a.split("-")[1]!==c.toLowerCase()||(e=!0)}),b&&(e=!0,b.forEach(function(a){e&&a.split("-")[1]===c.toLowerCase()&&(e=!1)})),e},x=function(){var a=d.getActiveBreakpoint(),c=!1;return b.isArray(e.hidden)?c=-1!==e.hidden.indexOf(a):_.isBoolean(e.hidden)?c=e.hidden:b.isDefined(g.hidden)&&(c=!0),c},y=function(){p=x()||w()},z=_.debounce(y,100);if(e.hideColumn=function(){i=!0,h.updateColumn(s())},e.showColumn=function(){i=!1,h.updateColumn(s())},e.toggleColumn=function(){!e.isVisible()||e.isMandatory()?e.showColumn():e.hideColumn()},e.resetColumnVisibility=function(){i=void 0,h.updateColumn(s())},e.getTitle=function(){return e.title||""},e.isVisible=function(){return b.isUndefined(i)?!p:!i},e.canBeSorted=function(){return b.isString(e.property)&&e.property.length>0&&!!l.filterable},e.toggleSortOrder=function(){if(e.canBeSorted()){var a=j;q()===j+e.property&&(a=k),r(e.property,a)}},e.isSelected=function(a){var b=q();return b&&a?b===a+e.property:b&&!a?b==="+"+e.property||b==="-"+e.property:void 0},e.isMandatory=function(){return e.mandatory},e.$on("$destroy",function(){h.unRegisterColumn(s())}),e.$on("mwList:registerColumn",v),e.$on("mwList:registerColumn",v),e.$on("mwList:unRegisterColumn",v),e.$watch("hidden",z),g.$observe("title",v),a.$on("i18n:localeChanged",v),a.$on("mwBootstrapBreakpoint:changed",v),a.$on("mwBootstrapBreakpoint:changed",z),a.$on("$modalOpenSuccess",z),n){var A=n.get("columns").get(o);A&&(i=!A.get("visible"))}c(function(){u(),y(),h.registerColumn(s())})}}}]),b.module("mwUI.List").directive("mwListableHeaderRowBb",function(){return{require:"^mwListableBb",scope:!0,compile:function(a){return a.prepend('
'),a.append('
'),a.append('
'),function(a,c,d,e){a.hasCollection=!1;var f=e.getCollection();f&&(a.hasCollection=b.isDefined(f.length)&&f.selectable),a.actionColumns=e.actionColumns,a.enableConfigurator=e.enableConfigurator,a.getActionColumnsAmount=function(){return e.maxActionColumnsAmount}}}}}),b.module("mwUI.List").directive("mwListableLinkShowBb",["$window",function(a){return{restrict:"A",require:"^mwListableBb",templateUrl:"uikit/mw-list/directives/templates/mw_list_url_action_button.html",scope:{link:"@mwListableLinkShowBb",target:"@linkTarget"},link:function(b){b.execute=function(){var c=b.link,d=b.target;c&&!d?a.location.href=c:c&&d&&"self"!==d&&window.open(c)}}}}]),b.module("mwUI.List").service("TableConfigurator",function(){var a=new window.mwUI.List.MwTableConfigurators;return{getInstanceForTableId:function(b){if(a.get(b))return a.get(b);var c=new window.mwUI.List.MwTableConfigurator({id:b});return a.add(c),c}}}),b.module("mwUI.List").config(["i18nProvider",function(a){a.addResource("mw-list/i18n","uikit")}]),b.module("mwUI.Menu",[]),window.mwUI.Menu={};var p=mwUI.Utils.shims.routeToRegExp,q=window.mwUI.Backbone.NestedModel.extend({idAttribute:"id",defaults:function(){return{url:null,label:null,icon:null,activeUrls:[],order:null,action:null,isActive:null,target:null,isVisible:null}},nested:function(){return{subEntries:window.mwUI.Menu.MwMenuSubEntries}},_throwMissingIdError:function(a){throw new Error("No id is specified for the entry",a)},_throwNoTypeCouldBeDeterminedError:function(a){throw new Error("No type could be determinded for the given entry: ",a)},_throwNotValidEntryError:function(a){throw new Error("Is not a valid entry",a)},_determineType:function(a){return a.type||(a.url||a.subEntries&&0!==a.subEntries.length||a.label||a.icon?a.url||a.subEntries&&a.subEntries.length>0&&(a.label||a.icon)?a.type="ENTRY":this._throwNoTypeCouldBeDeterminedError():a.type="DIVIDER"),a},_missingLabel:function(a){return"ENTRY"===a.type&&!a.label&&!a.icon},_urlsAreMatching:function(a,b){return b.match("#")&&(b=b.split("#")[1]),a.match(p(b))},validate:function(a){a&&_.isObject(a)&&(a=this._determineType(a),a.id||this._throwMissingIdError(),this.isValidEntry(a)||this._throwNotValidEntryError(a))},set:function(a,b){return b=b||{},_.isUndefined(b.validate)&&this.validate(a),window.mwUI.Backbone.NestedModel.prototype.set.call(this,a,b)},isValidEntry:function(a){return a.type?!this._missingLabel(a):!1},ownUrlIsActiveForUrl:function(a){return this.get("url")?this._urlsAreMatching(a,this.get("url")):!1},activeUrlIsActiveForUrl:function(a){var b=!1;return this.get("activeUrls").forEach(function(c){b||(b=this._urlsAreMatching(a,c))}.bind(this)),b},isSubEntry:function(){return this.collection&&this.collection.parent?!0:!1},hasSubEntries:function(){return this.get("subEntries").length>0},hasManualActiveFunction:function(){return this.get("isActive")&&"function"==typeof this.get("isActive")},isActiveForUrl:function(a){return this.hasManualActiveFunction()?this.get("isActive")():this.ownUrlIsActiveForUrl(a)||this.activeUrlIsActiveForUrl(a)},getActiveSubEntryForUrl:function(a){return this.get("subEntries").getActiveEntryForUrl(a)},hasActiveSubEntryOrIsActiveForUrl:function(a){return"ENTRY"===this.get("type")?this.hasManualActiveFunction()?this.get("isActive")():!!this.getActiveSubEntryForUrl(a)||this.isActiveForUrl(a):void 0},constructor:function(a,b){return b=b||{},b.validate=a?!0:!1,window.mwUI.Backbone.NestedModel.prototype.constructor.call(this,a,b)}});window.mwUI.Menu.MwMenuEntry=q;var r=Backbone.Collection.extend({model:window.mwUI.Menu.MwMenuEntry,comparator:"order",_isAlreadyRegistered:function(a){return this.get(a.id)||a.url&&this.findWhere({url:a.url})},_throwIsAlreadyRegisteredError:function(a){throw a.url?new Error("The entry with the id "+a.id+" and the url "+a.url+" has already been registered"):new Error("The entry with the id "+a.id+" has already been registered")},add:function(a){return _.isArray(a)?a.forEach(function(a){this._isAlreadyRegistered(a)&&this._throwIsAlreadyRegisteredError(a)}.bind(this)):this._isAlreadyRegistered(a)&&this._throwIsAlreadyRegisteredError(a),Backbone.Collection.prototype.add.apply(this,arguments)},addEntry:function(a,b,c,d){d=d||{};var e={id:a,url:b,label:c,icon:d.icon,activeUrls:d.activeUrls||[],order:d.order,subEntries:d.subEntries||[],type:"ENTRY"};return this.add(e)},addDivider:function(a,b){b=b||{};var c={id:a,label:b.label,order:b.order,type:"DIVIDER"};return this.add(c)},getActiveEntryForUrl:function(a){var b=!1,c=null;return this.each(function(d){!b&&d.hasActiveSubEntryOrIsActiveForUrl(a)&&(b=!0,c=d)}),c}});window.mwUI.Menu.MwMenuEntries=r;var s=window.mwUI.Menu.MwMenuEntries.extend({});window.mwUI.Menu.MwMenuSubEntries=s;var t=window.mwUI.Menu.MwMenuEntries.extend({});window.mwUI.Menu.MwMenu=t,b.module("mwUI.Menu").directive("mwMenuTopBar",["$rootScope",function(a){return{transclude:{brand:"?img",entries:"?div"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_bar.html",require:"^?mwUi",link:function(c,d,e,f){f&&f.addClass("has-mw-menu-top-bar"),c.closeMenu=function(){var a=d.find(".navbar-collapse");a.hasClass("in")&&a.collapse("hide")};var g=_.throttle(c.closeMenu,200),h=a.$on("$locationChangeStart",g);b.element(window).on("resize",g),c.$on("$destroy",function(){h(),b.element(window).off("resize",g),f&&f.removeClass("has-mw-menu-top-bar")})}}}]),b.module("mwUI.Menu").directive("mwMenuTopEntries",["$rootScope","$timeout",function(a,b){return{scope:{menu:"=mwMenuTopEntries",right:"="},transclude:!0,templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_entries.html",controller:["$scope",function(a){var b=a.menu||new mwUI.Menu.MwMenu;this.getMenu=function(){return b}}],link:function(a,c,d,e){var f=[],g=!1;a.entries=e.getMenu();var h=function(){g||f.push(b(function(){a.entries.sort(),a.$broadcast("mw-menu:resort")}))},i=_.throttle(h,1),j=function(){g||f.push(b(function(){a.$broadcast("mw-menu:reorder")}))},k=_.throttle(j,1);a.$on("mw-menu:triggerReorder",k),a.$on("mw-menu:triggerResort",i),a.entries.on("add remove reset",k),a.$on("$destroy",function(){g=!0,f.forEach(function(a){b.cancel(a)}),a.entries.off("add remove reset",k)})}}}]),b.module("mwUI.Menu").directive("mwMenuTopDropDownItem",function(){return{scope:{entry:"=mwMenuTopDropDownItem"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_drop_down_item.html"}}),b.module("mwUI.Menu").directive("mwMenuTopItem",["$timeout",function(a){return{scope:{entry:"=mwMenuTopItem"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_top_item.html",link:function(b){b.executeAction=function(){a(function(){var a=b.entry.get("action");a&&"function"==typeof a&&a()})}}}}]),b.module("mwUI.Menu").directive("mwMenuEntry",["$timeout",function(a){return{scope:{id:"@",url:"@",icon:"@",label:"@",type:"@",target:"@","class":"@styleClass",order:"=",activeUrls:"=",isVisible:"=",action:"&",isActive:"&"},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_entry.html",require:["mwMenuEntry","?^^mwMenuEntry","?^mwMenuTopEntries"],transclude:!0,controller:function(){var a;this.setMenuEntry=function(b){a=b},this.getMenuEntry=function(){return a}},link:function(b,c,d,e){var f,g,h=e[0],i=e[1],j=e[2],k=new mwUI.Menu.MwMenuEntry,l=[],m=function(){for(var a=c;;){if(0!==a.parent(".mw-menu-entry").length||0!==a.parent(".mw-menu-entries").length)break;a=a.parent()}return a.index()+1},n=function(){if(i){if(!i.getMenuEntry())throw new Error("Menu entry is not available, so registration failed!");f=i.getMenuEntry().get("subEntries")}else j&&(f=j.getMenu(),g=!0);f&&!f.get(k)&&f.add(k)},o=function(){k.set({id:b.id||b.url||b.label||b.$id,label:b.label,url:b.url,icon:b.icon,type:b.type||"ENTRY",target:b.target,order:b.order||m(),activeUrls:b.activeUrls||[],"class":b["class"],action:d.action?function(){b.action()}:null,isActive:d.isActive?function(){return b.isActive()}:null,isVisible:_.isUndefined(b.isVisible)?!0:b.isVisible})};o(),b.menuEntry=k,l.push(a(n)),h.setMenuEntry(k),k.get("subEntries").on("add remove reset change:order",function(){b.$emit("mw-menu:triggerReorder")}),k.on("change:order",function(){b.$emit("mw-menu:triggerResort")}),b.$on("mw-menu:reorder",function(){b.order||k.set("order",m())}),b.$on("mw-menu:resort",function(){k.get("subEntries").sort()}),b.$on("$destroy",function(){l.forEach(function(b){a.cancel(b)}),f&&f.remove(k),k=null,h.setMenuEntry(k)}),b.$watchGroup(["id","label","url","icon","class","order","target","isVisible"],o)}}}]),b.module("mwUI.Menu").directive("mwMenuDivider",function(){return{scope:{id:"@",label:"@",icon:"@",order:"="},templateUrl:"uikit/mw-menu/directives/templates/mw_menu_divider.html"}}),b.module("mwUI.Menu").directive("mwMenuToggleActiveClass",["$rootScope","$location","$timeout",function(a,b,c){return{scope:{entry:"=mwMenuToggleActiveClass",isActive:"&"},link:function(d,e){var f=function(){c(function(){var a=b.url(),c=e.hasClass("active");d.entry.hasActiveSubEntryOrIsActiveForUrl(a)?e.addClass("active"):e.removeClass("active"),c!==e.hasClass("active")&&d.$emit("menu-toggle-active-class-changed",e.hasClass("active"))})};d.entry&&d.entry.get("isActive")&&d.$watch(function(){return d.entry.get("isActive")()},f),f(),a.$on("menu-toggle-active-class-changed",f),a.$on("$locationChangeSuccess",f),a.$on("$routeChangeError",f)}}}]),window.mwUI.Modal={Sizes:{DEFAULT:"DEFAULT",BIGGER:"BIGGER",LARGE:"LARGE",FULLSCREEN:"FULLSCREEN"}},b.module("mwUI.Modal",["mwUI.i18n","mwUI.Toast"]),b.module("mwUI.Modal").directive("mwModal",["mwModalTmpl",function(a){return{restrict:"A",scope:{title:"@"},transclude:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal.html",controller:["$scope",function(a){this.addClass=function(b){a.addClass(b)}}],link:function(b,c){b.$emit("COMPILE:FINISHED"),b.mwModalTmpl=a,b.addClass=function(a){c.addClass(a)},b.title&&b.addClass("has-header")}}}]),b.module("mwUI.Modal").directive("mwModalBody",function(){return{transclude:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal_body.html"}}),b.module("mwUI.Modal").directive("mwModalConfirm",function(){return{restrict:"A",transclude:!0,scope:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal_confirm.html",link:function(a,c,d){b.forEach(["ok","cancel"],function(b){a[b]=function(){a.$eval(d[b])}})}}}),b.module("mwUI.Modal").directive("mwModalFooter",function(){return{transclude:!0,templateUrl:"uikit/mw-modal/directives/templates/mw_modal_footer.html",require:"^mwModal",link:function(a,b,c,d){d.addClass("has-footer")}}}),b.module("mwUI.Modal").service("Modal",["$rootScope","$location","$templateCache","$document","$compile","$controller","$injector","$q","$templateRequest","$timeout","mwModalOptions","Toast",function(a,c,d,e,f,g,h,i,j,k,l,m){var n=[],o=function(d,e){var o,p,q,r,s=d.templateUrl,t=d.scope||a,u=d.scopeAttributes||{},v=d.resolve||{},w=d.controller,x=_.extend(l.getOptions(),d),y=_.extend(x.bootStrapModalOptions,e),z=[],A=!1,B=this,C=t.$new(),D=function(a,b){if(_.isObject(b)&&_.isObject(a))for(var c in b)a[c]=b[c]},E=function(a){if(D(C,u),w){a.$scope=C,a.modalId=s;var b=g(w,a,!0,x.controllerAs);D(b.instance,u),p=b()}},F=function(){if(!s)throw new Error("Modal service: templateUrl options is required.");return j(s)},G=function(){q.on("hidden.bs.modal",function(){B.destroy()})},H=function(){var b=a.$on("$routeChangeStart",function(a){if(q&&A){var d=c.path();a.preventDefault(),console.warn("Modal is closed because of a route change!"),B.hide().then(function(){c.path(d),b()})}else b()})},I=function(){z.forEach(function(a){C.$watch(a.expression,a.callback)})},J=function(){var a=b.extend({},v);return b.forEach(a,function(c,d){a[d]=b.isString(c)?h.get(c):h.invoke(c,null,null,d)}),a.$template=F(),i.all(a)},K=function(a){return E(a),f(a.$template)(C)},L=function(){var a=i.defer();return J().then(function(c){I(),u.hideModal=function(){return B.hide()},o=K(c),C.$on("COMPILE:FINISHED",function(){if(o.addClass("mw-modal"),o.addClass(x.size),o.addClass(x.styleClass),q=o.find(".modal"),y.show=!1,x.dismissible||(y.backdrop="static",y.keyboard=!1),q.modal(y),q.data()){var c=q.data()["bs.modal"],d=c.backdrop;c.backdrop=function(a){d.call(c,a,b.element(x.holderEl).find(".modal"))}}G(),H(),a.resolve()})}.bind(this),function(b){a.reject(b)}),a.promise};this.id=s,this.getScope=function(){return C},this.watchScope=function(a,b){z.push({expression:a,callback:b})},this.show=function(){var c=i.defer(),d=b.element(x.holderEl);if(!d||0===d.length)throw new Error("[Modal] no element could be found for the selector string "+x.holderEl+". Make sure that the element exists");return m.clear(),r=b.element(document.activeElement),a.$broadcast("$modalOpenStart"),a.$broadcast("$modalResolveDependenciesStart"),L.call(this).then(function(){a.$broadcast("$modalResolveDependenciesSuccess"),b.element(x.holderEl).append(o),A=!0,n.push(this),q.on("shown.bs.modal",function(){b.element(this).find("input:text:visible:first").focus(),a.$broadcast("$modalOpenSuccess"),c.resolve()}),r&&q.on("hidden.bs.modal",function(){r.focus()}),q.modal("show")}.bind(this),function(b){a.$broadcast("$modalOpenError",b),c.reject(b)}),c.promise},this.setScopeAttributes=function(a){D(u,a),k(function(){C&&D(C,a),p&&D(p,a)})},this.hide=function(){var b=i.defer();return a.$broadcast("$modalCloseStart"),q&&A?(q.one("hidden.bs.modal",function(){q.off(),B.destroy(),A=!1,a.$broadcast("$modalCloseSuccess"),b.resolve()}),q.modal("hide")):b.resolve(),b.promise},this.toggle=function(){q.modal("toggle")},this.destroy=function(){n=_.without(n,this);var a=m.getToasts();a.forEach(function(a){+new Date-a.initDate>500&&m.removeToast(a.id)}),k(function(){o&&(o.remove(),A=!1),C&&(C.$destroy(),C=t.$new()),u=d.scopeAttributes||{}}.bind(this))},function(){F();var a=_.values(mwUI.Modal.Sizes);if(-1===a.indexOf(x.size))throw new Error("Modal size "+x.size+" is invalid. It can be only "+a.join(",")+". mwUI.Modal.Sizes provides all available sizes");t.$on("$destroy",function(){B.hide()})}()};this.create=function(a,b){return a&&a.el&&(a.holderEl=a.el,window.mwUI.Utils.shims.deprecationWarning("[Modal] The modal options property el was renamed to holderEl")),a&&a["class"]&&(a.styleClass=a["class"],window.mwUI.Utils.shims.deprecationWarning("[Modal] The modal options property class was renamed to styleClass")),new o(a,b)},this.prepare=function(a,b){return this.create.bind(this,a,b)},this.getOpenedModals=function(){return n}}]),b.module("mwUI.Modal").provider("mwModalOptions",function(){var a={controllerAs:"$ctrl",styleClass:"",holderEl:"body",dismissible:!0,bootStrapModalOptions:{},size:mwUI.Modal.Sizes.DEFAULT};this.config=function(b){_.isObject(b)&&_.extend(a,b)},this.$get=function(){return{getOptions:function(){return _.clone(a)}}}}),b.module("mwUI.Modal").provider("mwModalTmpl",function(){var a;this.setLogoPath=function(b){a=b},this.$get=function(){return{getLogoPath:function(){return a}}}}),$.fn.modal.Constructor.prototype.backdrop=function(a,b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=$.support.transition&&c;if(this.$backdrop=$('').appendTo(b),this.$backdrop.on("click",$.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!a)return;d?this.$backdrop.one($.support.transition.end,a).emulateTransitionEnd(150):a()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),$.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one($.support.transition.end,a).emulateTransitionEnd(150):a()):a&&a()},b.module("mwUI.Modal").config(["i18nProvider",function(a){a.addResource("mw-modal/i18n","uikit")}]),b.module("mwUI.ResponseToastHandler",["mwUI.Toast","mwUI.ResponseHandler","mwUI.i18n","mwUI.Utils"]),b.module("mwUI.ResponseToastHandler").provider("ResponseToastHandler",["$provide","ResponseHandlerProvider",function(a,b){var c=[],d={DEFAULT:{type:"default",autoHide:!1}},e=function(b,c,e){e=e||{};var f=_.uniqueId("notification_factory");return a.factory(f,["Toast","i18n","callbackHandler",function(a,f,g){return function(h){if(b){var i,j=a.findToast(c),k={},l=j?b.plural:b.singular,m={id:c};if(j&&b.plural?l=b.plural:b.singular&&(l=b.singular),k.$count=j?j.replaceCount+1:0,k.$count++,k.$httpStatusCode=h.status,e.preProcess){if(_.extend(k,h.data),i=g.exec(e.preProcess,[l,k,f,h],this),!i)return}else{var n=h.data||{};if(n.results&&!_.isObject(n.results)?k={message:n.results}:n.results&&n.results.length>0&&_.extend(k,n.results[0]),h.config.instance&&"function"==typeof h.config.instance.toJSON){var o=h.config.instance.toJSON();_.extend(o,k),k=o}i=f.get(l,k)}if(e.toastType){var p=d[e.toastType];if(!p)throw new Error("Type "+e.toastType+" is not available. Make sure you have configured it first");_.extend(m,p)}else _.extend(m,d.DEFAULT);a.addToast(i,m)}}}]),f};this.registerToastType=function(a,b){if(d[a])throw new Error("The toast type "+a+" is already defined. You can configure a toast type only once");d[a]=b},this.registerToast=function(a,d,f){f=f||{};var g=f.statusCodes||[f.onSuccess?"SUCCESS":"ERROR"];if(_.isUndefined(d)||_.isObject(d)&&!d.singular)throw new Error('You have to pass a messages object and define at least the singular message {singular:"Mandatory", plural:"Optional"}');g.forEach(function(g){var h=f.id||a+"_"+f.method+"_"+g,i=e(d,h,f);if(c.indexOf(h)>-1)throw new Error("You can not define a second message for the route "+a+" and method "+f.method+" because you have already registered one!");"SUCCESS"===g||"ERROR"===g?delete f.statusCodes:f.statusCodes=[g],b.registerAction(a,i,f),c.push(h)})},this.registerSuccessToast=function(a,b,c,d,e){this.registerToast(a,b,{method:c,toastType:d,onSuccess:!0,preProcess:e})},this.registerErrorToast=function(a,b,c,d,e){this.registerToast(a,b,{method:c,toastType:d,onError:!0,preProcess:e})},this.registerDefaultSuccessToast=function(a,b,c,d){return this.registerToast("*",a,{method:b,toastType:c,onSuccess:!0,preProcess:d})},this.registerDefaultErrorToast=function(a,b,c,d){return this.registerToast("*",a,{method:b,toastType:c,onError:!0,preProcess:d})},this.$get=function(){}}]),b.module("mwUI.ResponseHandler",["mwUI.Utils"]),b.module("mwUI.ResponseHandler").provider("ResponseHandler",function(){var a={POST:[],PUT:[],GET:[],DELETE:[],PATCH:[]},b=function(a){return new Error("Method "+a+" is invalid. Valid methods are POST, PUT, GET, DELETE, PATCH")},c=mwUI.Utils.shims.routeToRegExp,d=function(a){var b={ERROR:[],SUCCESS:[]},d=a,e=null,f=function(a,c){var d=b[a],e=d||[];e.push(c),b[a]=e},g=function(a){return b[a]};this.matchesUrl=function(a){return a.match(e)},this.registerCallbackForStatusCodes=function(a,b){a.forEach(function(a){f(a,b)},this)},this.registerCallbackForSuccess=function(a){f("SUCCESS",a)},this.registerCallbackForError=function(a){f("ERROR",a)},this.getCallbacksForStatusCode=function(a){return g(a)},this.getCallbacksForSuccess=function(){return g("SUCCESS")},this.getCallbacksForError=function(){return g("ERROR")};var h=function(){e=c(d)};h.call(this)};this.registerAction=function(c,e,f){if(f=f||{},!f.onError&&!f.onSuccess&&!f.statusCodes)throw new Error("You have to specify either some statusCodes or set onSuccess or onError to true in the options parameter object");if(f.onError&&f.onSuccess||(f.onError||f.onSuccess)&&f.statusCodes)throw new Error("Definition is too imprecise");if(!f.method&&!f.methods)throw new Error('Method has to be defined in options e.g method: "POST" or methods:["POST"]');f.methods=f.methods||[f.method],f.methods.forEach(function(g){if(!a[g])throw b(g);var h=_.findWhere(a[g],{id:c}),i=h||{id:c,handler:new d(c)},j=i.handler;f.statusCodes?j.registerCallbackForStatusCodes(f.statusCodes,e):f.onSuccess?j.registerCallbackForSuccess(e):f.onError&&j.registerCallbackForError(e),h||a[g].push(i)})},this.registerSuccessAction=function(a,b,c){return this.registerAction(a,b,{method:c,onSuccess:!0})},this.registerErrorAction=function(a,b,c){return this.registerAction(a,b,{method:c,onError:!0})},this.registerDefaultAction=function(a,b){return b=b||{},this.registerAction("*",a,b)},this.registerDefaultSuccessAction=function(a,b){return this.registerAction("*",a,{method:b,onSuccess:!0})},this.registerDefaultErrorAction=function(a,b){return this.registerAction("*",a,{method:b,onError:!0})},this.$get=["$injector","$q","callbackHandler",function(c,d,e){var f=function(a,b,c,e){var g=a.shift();if(e||(e=d.defer()),g){var h,i=g(b,c);h=i&&i.then?i:c?d.reject(i||b):d.when(i||b),h.then(function(b){f(a,b,!1,e)},function(b){f(a,b,!0,e)})}else c?e.reject(b):e.resolve(b);return e.promise},g=function(a,b,c){var d=[];return a.forEach(function(a){a&&(a=e.getFn(a),d.push(a))},this),f(d,b,c)},h=function(a,b,c){var d=a.getCallbacksForStatusCode(b),e=a.getCallbacksForSuccess(),f=a.getCallbacksForError();return d?d:c?f:e};return{getHandlerForUrlAndCode:function(c,d,e,f){var g;if(!a[c])throw b(c);return a[c].forEach(function(a){var b=a.handler,c=h(b,e,f);!g&&b.matchesUrl(d)&&c&&c.length>0&&(g=b)}),g},handle:function(a,b){var c=a.config.url,d=a.config.method,e=a.status,f=this.getHandlerForUrlAndCode(d,c,e,b);if(f){var i=h(f,e,b);if(i)return g(i,a,b)}}}}]}),b.module("mwUI.ResponseHandler").config(["$provide","$httpProvider",function(a,b){a.factory("requestInterceptorForHandling",["$q","ResponseHandler",function(a,b){var c=function(c,d){var e=b.handle(c,d);return e?e:d?a.reject(c):a.when(c)};return{response:function(a){return c(a,!1)},responseError:function(a){return c(a,!0)}}}]),b.interceptors.push("requestInterceptorForHandling")}]),b.module("mwUI.Toast",["ngSanitize","mwUI.Utils"]),b.module("mwUI.Toast").provider("Toast",function(){var a=5e3,b=[],c={primary:"fa-flag-o",info:"fa-info",success:"fa-check",warning:"fa-warning",danger:"fa-exclamation"},d=function(a,b){b=b||{},b.button=b.button||{};var d={id:b.id||_.uniqueId("toast"),type:b.type||"default",visible:!0,message:a,title:b.title,autoHide:b.autoHide||!1,autoHideTime:b.autoHideTime||5e3,autoHideCallback:b.autoHideCallback,isHtmlMessage:b.isHtmlMessage,icon:b.icon||c[b.type]||"fa-info",button:{title:b.button.title,link:b.button.link,target:b.button.target,isLink:b.button.isLink||!!b.button.link,action:b.button.action},replaceCount:0,initDate:+new Date};return d.replaceMessage=function(a){d.message=a,d.replaceCount++},d};this.setAutoHideTime=function(b){a=b},this.setDefaultIcons=function(a){_.extend(c,a)},this.$get=["$timeout","mwScheduler",function(c,e){return{findToast:function(a){var c=_.findWhere(b,{id:a});return c?c.toast:!1},clear:function(){b=[],e.reset()},getToasts:function(){return _.pluck(b,"toast")},replaceToastMessage:function(a,b){var c=this.findToast(a);if(c){c.replaceMessage(b);var d=e.get(c.id);d&&d.resetTime()}return c},removeToast:function(a){var d=_.findWhere(b,{id:a}),f=_.indexOf(b,d);return d&&(e.remove(e.get(d.id)),c(function(){b.splice(f,1)})),d},addToast:function(c,f){f=f||{},f.autoHideTime=f.autoHideTime||a;var g=this.findToast(f.id);if(!g){var h=new d(c,f);return h.autoHide&&e.add(function(){f.autoHideCallback&&"function"==typeof f.autoHideCallback&&f.autoHideCallback.apply(this,arguments),this.removeToast(h.id)},h.autoHideTime,h.id,this),b.push({id:h.id,toast:h}),h}this.replaceToastMessage(g.id,c)}}}]}),b.module("mwUI.Toast").directive("mwToasts",["$sce","Toast",function(a,b){return{templateUrl:"uikit/mw-toast/directives/templates/mw_toasts.html",link:function(c){c.toasts=b.getToasts(),c.$watch(function(){return b.getToasts().length},function(){c.toasts=b.getToasts()}),c.hideToast=function(a){b.removeToast(a)},c.getHtmlMessage=function(b){return a.trustAsHtml(b)}}}}]),b.module("mwUI.UiComponents",["mwUI.i18n","mwUI.Utils","mwUI.Backbone"]),b.module("mwUI.UiComponents").directive("mwAlert",function(){return{restrict:"A",replace:!0,scope:{type:"@mwAlert"},transclude:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_alert.html"}}),b.module("mwUI.UiComponents").directive("mwArrowButton",function(){return{templateUrl:"uikit/mw-ui-components/directives/templates/mw_arrow_button.html"}}),b.module("mwUI.UiComponents").directive("mwLinkShow",function(){return{restrict:"A",scope:{link:"@mwLinkShow",linkTarget:"@?"},templateUrl:"uikit/mw-ui-components/directives/templates/mw_arrow_link.html",link:function(a,b){a.linkTarget&&b.find("a").attr("target",a.linkTarget)}}}),b.module("mwUI.UiComponents").directive("mwBadge",function(){return{restrict:"A",replace:!0,scope:{mwBadge:"@"},transclude:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_badge.html"}}),b.module("mwUI.UiComponents").directive("mwBreadCrumb",function(){
+return{scope:{url:"@",title:"@",showLeftArrow:"=?"},templateUrl:"uikit/mw-ui-components/directives/templates/mw_bread_crumb.html"}}),b.module("mwUI.UiComponents").directive("mwBreadCrumbsHolder",function(){return{transclude:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_bread_crumbs_holder.html"}}),b.module("mwUI.UiComponents").directive("mwButtonHelp",["i18n","$compile",function(a,c){return{restrict:"A",scope:!0,link:function(a,d){var e,f=c(b.element('
")})};f.hover(function(){g();var a=b.element(this).offset();b.element("body").append(e),e.css("top",a.top-e.height()/2+10-b.element(document).scrollTop()),e.css("left",a.left+40)},function(){b.element("body > .mw-button-help-popover").remove()}),a.$watch("hintsToShow",function(a){a&&a.length?f.removeClass("hidden"):f.addClass("hidden")}),a.$on("$destroy",function(){e&&e.remove()})},controller:["$scope",function(c){c.registeredHints=[],c.hintsToShow=[],c.helpText=a.get("UiComponents.mwButtonHelp.isDisabledBecause"),c.$on("i18n:localeChanged",function(){c.helpText=a.get("UiComponents.mwButtonHelp.isDisabledBecause")});var d=function(){c.hintsToShow=[],b.forEach(c.registeredHints,function(a){a.condition&&c.hintsToShow.push(a)})};this.register=function(a){c.$watch(function(){return a.condition},d),c.registeredHints.push(a)}}]}}]),b.module("mwUI.UiComponents").directive("mwButtonHelpCondition",function(){return{restrict:"A",require:"^mwButtonHelp",scope:{condition:"=mwButtonHelpCondition",text:"@mwButtonHelpText"},link:function(a,b,c,d){d.register(a)}}}),b.module("mwUI.UiComponents").directive("mwCollapsable",["$timeout",function(a){return{transclude:!0,scope:{isCollapsed:"=mwCollapsable",title:"@mwTitle",tooltip:"@?",icon:"@?"},templateUrl:"uikit/mw-ui-components/directives/templates/mw_collapsible.html",link:function(c,d){var e=d.find(".mw-collapsible > .mw-collapsible-body"),f=e.find(".collapsed-content"),g=1e3*parseFloat(e.css("transition-duration"));f.css("border","1px solid transparent");var h=function(){return f.innerHeight()},i=function(){e.css("max-height","initial"),e.css("overflow","initial"),e.off("transitionend",i)},j=function(){var b=h();b>0&&(e.on("transitionend transitionendFromTest",i),e.css("max-height",b)),a(i,g),c.isCollapsed=!1},k=function(){e.off("transitionend",i),e.css("max-height",h()),a(function(){e.css("overflow","hidden"),e.css("max-height",0)},5),c.isCollapsed=!0};c.toggle=function(){c.isCollapsed?j():k()},c.$watch("mwCollapsable",function(){c.isCollapsed||b.isUndefined(c.isCollapsed)?k():j()})}}}]),b.module("mwUI.UiComponents").directive("mwHideOnRequest",function(){return{scope:{modelOrCollection:"=mwHideOnRequest"},transclude:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_hide_on_request.html",link:function(a){if(a.modelCollectionIsRequesting=!1,!(a.modelOrCollection instanceof Backbone.Collection||a.modelOrCollection instanceof Backbone.Model))throw new Error('The directive attribute has to be a model or collection (mw-hide-on-request="backboneModelOrCollectionInstance")');a.modelOrCollection.on("request",function(){a.modelCollectionIsRequesting=!0}),a.modelOrCollection.on("sync error",function(){a.modelCollectionIsRequesting=!1})}}}),b.module("mwUI.UiComponents").directive("mwIndefiniteLoading",function(){return{templateUrl:"uikit/mw-ui-components/directives/templates/mw_indefinite_loading.html"}}),b.module("mwUI.UiComponents").directive("mwIcon",["mwIcon",function(a){return{scope:{icon:"@mwIcon",tooltip:"@"},templateUrl:"uikit/mw-ui-components/directives/templates/mw_icon.html",link:function(b){b.viewModel={icon:null,iconSet:null,oldIcon:null};var c=function(a){var c=a.match(/^fa-/),d=a.match(/rln-icon/);c?b.viewModel.oldIcon="fa "+a:d?b.viewModel.oldIcon="rln-icon "+a:b.viewModel.oldIcon="glyphicon glyphicon-"+a},d=function(a){b.viewModel.iconSet.getIconForKey(a).then(function(a){b.viewModel.icon=a})},e=function(e){var f,g,h=e.split(".");h.length>1?(f=h.splice(0,1)[0],g=h.join("."),b.viewModel.iconSet=a.getIconSet(f),d(g),b.viewModel.iconSet.on("icons:replace",function(){d(g)})):c(e)};b.$watch("icon",function(a){a&&e(a)})}}}]),b.module("mwUI.UiComponents").directive("mwOptionGroup",["$timeout",function(a){return{scope:{title:"@",description:"@?",icon:"@?",mwDisabled:"=?",badges:"=?"},transclude:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_option_group.html",link:function(b,c){if(b.randomId=_.uniqueId("option_group_"),c.find("input").attr("id",b.randomId),b.badges&&!_.isArray(b.badges))throw new Error("[mwOptionGroup] The attribute badges only accept an array of strings");b.select=function(){var b=c.find("input");b&&(b.click(),a(function(){b.triggerHandler("click")}))}}}}]),b.module("mwUI.UiComponents").directive("mwPanel",function(){return{restrict:"A",transclude:!0,scope:{type:"@mwPanel",title:"@",closeable:"="},templateUrl:"uikit/mw-ui-components/directives/templates/mw_panel.html",link:function(a,b){a.closePanel=function(){b.remove()}}}}),b.module("mwUI.UiComponents").directive("mwSpinner",function(){return{restrict:"A",scope:!0,replace:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_spinner.html"}}),b.module("mwUI.UiComponents").directive("mwRating",function(){return{restrict:"A",scope:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_star_rating.html",link:function(a,b,c){a.stars=[];var d=function(){a.stars=[];var b=a.$eval(c.mwRating)||0,d=a.$eval(c.max)||5;b>d&&(b=d),0>b&&(b=0);for(var e=0;e=.5&&a.stars.push({state:"fa-star-half-full"});c.max&&a.stars.length0?c.select(c.panes[0]):b.isDefined(c.activePaneNumber)?c.selectTabByNumber(c.activePaneNumber):b.isDefined(c.activePaneId)&&c.selectTabById(c.activePaneId)},f=_.debounce(e,10);c.getActivePane=function(){var a;return c.panes.every(function(b){return b.isSelected()?(a=b,!1):!0}),a},c.select=function(b){var e=_.indexOf(c.panes,b);if(b&&-1!==e&&e!==d){var f=c.getActivePane();f&&f.deselect(),b.select(),d=e,c.tabChanged&&"function"==typeof c.tabChanged&&(c.tabChanged(d+1,b,f),a.$emit("$mwTabChange"))}},c.selectTabByNumber=function(a){a>0&&a<=c.panes.length&&c.select(c.panes[a-1])},c.selectTabById=function(a){c.panes.every(function(b){return b.getId()===a?(c.select(b),!1):!0})},c.getActivePaneIndex=function(){return d?d:0},c.canShowPaneContent=function(){var a=c.panes[d];return a&&a.isInitialised},c.$watch("activePaneNumber",function(a,b){a&&a!==b&&c.selectTabByNumber(a)}),c.$watch("activePaneId",function(a){a&&c.selectTabById(a)}),this.registerPane=function(a){c.panes.push(a),f()},this.unRegisterPane=function(a){if(a){var b=_.indexOf(c.panes,a);-1!==b&&c.panes.splice(b,1),f()}},this.canRemoveInactiveContent=function(){return c.removeInactiveContent}}]}}]),b.module("mwUI.UiComponents").directive("mwTabsPane",function(){return{scope:{title:"@mwTabsPane",id:"@?",icon:"@?",tooltip:"@?",badge:"@?",isInvalid:"=?"},transclude:!0,replace:!0,require:["^mwTabs"],templateUrl:"uikit/mw-ui-components/directives/templates/mw_tab_pane.html",controller:["$scope",function(a){var b=!1;a.getId=function(){return a.id||a.$id},a.deselect=function(){b=!1},a.select=function(){b=!0},this.isSelected=a.isSelected=function(){return b}}],link:function(a,c,d,e){var f=e[0];f.registerPane(a),a.$on("$destroy",function(){c.remove(),a.deselect(),f.unRegisterPane(a)}),a.canUseNgIf=function(){var a=f.canRemoveInactiveContent();return f&&b.isDefined(a)?a:!1},a.isInitialised=!0}}}),b.module("mwUI.UiComponents").directive("mwTextCollapsible",["$filter",function(a){return{restrict:"A",scope:{collapsibleText:"@mwTextCollapsible",length:"="},templateUrl:"uikit/mw-ui-components/directives/templates/mw_text_collapsible.html",link:function(b){b.length&&"number"==typeof b.length?b.defaultLength=b.length:b.defaultLength=200,b.filterLength=b.defaultLength,b.text=function(){return a("reduceStringTo")(b.collapsibleText,b.filterLength)},b.showButton=!1,b.collapsibleText&&b.collapsibleText.length>b.defaultLength&&(b.showButton=!0),b.showLessOrMore=function(){return b.filterLength===b.defaultLength?"UiComponents.mwTextCollapsible.showMore":"UiComponents.mwTextCollapsible.showLess"},b.toggleLength=function(){b.filterLength===b.defaultLength?delete b.filterLength:b.filterLength=b.defaultLength}}}}]),b.module("mwUI.UiComponents").directive("mwTimeline",function(){return{transclude:!0,replace:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_timeline.html"}}),b.module("mwUI.UiComponents").directive("mwTimelineEntry",["$q",function(a){return{transclude:!0,replace:!0,template:'
',scope:!0,require:"^mwTimelineFieldset",link:function(b,c,d,e){e.register(b),b.hide=function(){var b=a.defer();return c.fadeOut("slow",function(){b.resolve()}),b.promise},b.show=function(){var b=a.defer();return c.fadeIn("slow",function(){b.resolve()}),b.promise}}}}]),b.module("mwUI.UiComponents").directive("mwTimelineFieldset",["$q",function(a){return{scope:{mwTitle:"@",collapsable:"="},transclude:!0,replace:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_timeline_fieldset.html",controller:["$scope",function(b){b.entries=[],this.register=function(a){_.findWhere(b.entries,{$id:a.$id})||b.entries.push(a)},b.entriesVisible=!0,b.toggleEntries=function(){if(b.collapsable){var c=[];b.entries.forEach(function(a){b.entriesVisible?c.push(a.hide()):c.push(a.show())}),b.entriesVisible?a.all(c).then(function(){b.entriesVisible=!b.entriesVisible}):b.entriesVisible=!b.entriesVisible}},b.hiddenEntriesText=function(){return b.entries.length>1?"UiComponents.mwTimelineFieldset.entriesHiddenPlural":"UiComponents.mwTimelineFieldset.entriesHiddenSingular"}}]}}]),b.module("mwUI.UiComponents").directive("mwTooltip",function(){return{restrict:"A",scope:{text:"@mwTooltip",placement:"@"},link:function(a,b){a.$watch("text",function(){b.data("bs.popover").setContent()}),b.popover({trigger:"hover",placement:a.placement||"bottom",content:function(){return a.text},container:"body"});var c=function(){var a=b.data("bs.popover");a&&a.tip()&&a.tip().detach().remove()};a.$on("$destroy",function(){c()})}}}),b.module("mwUI.UiComponents").directive("mwViewChangeLoader",["$rootScope",function(a){return{templateUrl:"uikit/mw-ui-components/directives/templates/mw_view_change_loader.html",link:function(b){var c=!1;b.viewModel={loading:!1};var d=a.$on("$showViewChangeLoader",function(){b.viewModel.loading=!0}),e=a.$on("$hideViewChangeLoader",function(){b.viewModel.loading=!1}),f=a.$on("$locationChangeSuccess",function(){c?c=!1:b.viewModel.loading=!0}),g=a.$on("$routeChangeSuccess",function(){b.viewModel.loading=!1}),h=a.$on("$routeChangeError",function(){b.viewModel.loading=!1}),i=a.$on("$routeUpdate",function(){c=!0});b.$on("$destroy",function(){f(),g(),h(),i(),d(),e()})}}}]),b.module("mwUI.UiComponents").directive("mwWizard",["Wizard",function(a){return{scope:{wizard:"=mwWizard"},transclude:!0,templateUrl:"uikit/mw-ui-components/directives/templates/mw_wizard.html",controller:["$scope",function(b){var c=b.wizard||a.createWizard(_.uniqueId("wizard_"));this.registerStep=function(a,b){c._registerStep(a,b)},this.unRegisterStep=function(a){c._unRegisterStep(a)},this.getWizard=function(){return c},b.$on("$destroy",function(){c.destroy()})}]}}]),b.module("mwUI.UiComponents").directive("mwWizardNavigation",function(){return{scope:{finishedAction:"&"},transclude:!0,require:"^mwWizard",templateUrl:"uikit/mw-ui-components/directives/templates/mw_wizard_navigation.html",link:function(a,b,c,d,e){a.wizard=d.getWizard(),a.finish=function(){a.$eval(a.finishedAction)},e(function(a){var c=b.find(".mw-wizard-navigation");a&&a.length>0&&c.addClass("has-extra-content")})}}}),b.module("mwUI.UiComponents").directive("mwWizardProgress",function(){return{require:"^mwWizard",templateUrl:"uikit/mw-ui-components/directives/templates/mw_wizard_progress.html",link:function(a,b,c,d){var e=d.getWizard();a.getProgress=function(){return(e.getCurrentStepNumber()+1)/e.getAllSteps().length*100}}}}),b.module("mwUI.UiComponents").directive("mwWizardStep",function(){return{restrict:"A",scope:!0,transclude:!0,replace:!0,require:"^mwWizard",templateUrl:"uikit/mw-ui-components/directives/templates/mw_wizard_step.html",link:function(a,b,c,d){a._isActive=!1,c.title=c.title||"noname",c.$observe("title",function(b){b&&b.length>0&&(a.title=b),d.registerStep(a,c.id)}),a.$on("$destroy",function(){d.unRegisterStep(a)})}}}),b.module("mwUI.UiComponents").provider("mwIcon",function(){var a=Backbone.Model.extend({defaults:function(){return{classPrefix:"",type:"FONTICON",iconsUrl:null,isLoading:!1,loaded:!1,icons:{}}},_throwNotValidIconError:function(){throw new Error("You have to set either icons or set a filePath")},_needsToBeLoaded:function(){return this.get("iconsUrl")&&!this.get("loaded")},loadFn:function(){throw new Error("Has to overwritten with a real loader fn")},$q:null,getIconForKey:function(a){var b,c=a.split("."),d=this.get("icons"),e=this.$q();if(c.forEach(function(a){b=b&&b[a]?b[a]:d[a]}),b&&!this._needsToBeLoaded())e.resolve(b);else{if(!this._needsToBeLoaded())throw new Error("No Icon was found for the key "+a);this.on("change:loaded",function(){return this.getIconForKey(a).then(function(a){e.resolve(a)})}.bind(this)),this.get("isLoading")||(this.set("isLoading",!0),this.loadFn().then(function(a){_.extend(this.get("icons"),a),this.set("isLoading",!1),this.set("loaded",!0)}.bind(this)))}return e.promise},isValidIcon:function(a){return a.icons&&_.size(a.icons)>0||a.iconsUrl},addIcons:function(a,b){var c=_.intersection(_.keys(this.get("icons")),_.keys(a));if(c.length>0&&!b)throw new Error("The icons "+c.join(",")+" already exists. If you want to replace them use the method replaceIcons");window.mwUI.Utils.shims.deepExtendObject(this.get("icons"),a),c.length>0?this.trigger("icons:replace"):this.trigger("icons:add",a)},replaceIcons:function(a){this._needsToBeLoaded()?this.on("change:loaded",function(){this.addIcons(a,!0)}.bind(this)):this.addIcons(a,!0)},constructor:function(a,b){return this.isValidIcon(a)||this._throwNotValidIconError(),a.iconsUrl&&(a.loaded=!1),Backbone.Model.prototype.constructor.call(this,a,b)}}),b=Backbone.Collection.extend({model:a}),c=new b,d=function(a){if(!a.id)throw new Error("You have to set an identifier for you iconset");if(c.get(a.id))throw new Error("The iconset has already been registered");c.add(a)},e=function(a){var b=c.get(a);if(b)return b;throw new Error("No iconset has been found for the id "+a)};this.addIconSet=d,this.getIconSet=e,this.$get=["$q","$templateRequest",function(a,b){var f=function(c){c.$q=a.defer,c.loadFn=function(){return b(c.get("iconsUrl")).then(function(a){return JSON.parse(a)})}};return c.each(f),c.on("add",f),{addIconSet:d,getIconSet:e}}]}),b.module("mwUI.UiComponents").service("Wizard",function(){var a=[],b=function(a){var b=[],c=0,d=a;this._registerStep=function(a,c){b.length<1&&(a._isActive=!0),a.slideId=c||_.uniqueId(d+"_"),b.push(a)},this._unRegisterStep=function(a){var c=_.findWhere(b,{$id:a.$id}),d=_.indexOf(b,c);d>-1&&b.splice(d,1)},this.destroy=function(){var a=this;b.forEach(function(b){a._unRegisterStep(b)})},this.getId=function(){return d},this.getAllSteps=function(){return b},this.getCurrentStep=function(){return b[c]},this.getCurrentStepNumber=function(){return c},this.getCurrentStepId=function(){return b[c].slideId},this.getTotalStepAmount=function(){return b.length},this.hasNextStep=function(){return this.getCurrentStepNumber()0},this.next=function(){this.goTo(c+1)},this.back=function(){this.goTo(c-1)},this.gotoStep=function(a){"string"==typeof a&&(a=_.findWhere(b,{slideId:a})),this.goTo(_.indexOf(b,a))},this.goTo=function(a){if(b[c]._isActive=!1,a>=b.length)throw new Error("Step "+(a+1)+" is not available");b[a]._isActive=!0,c=a}},c=function(b){var c=null;return a.forEach(function(a){a.getId===b&&(c=a)}),c},d=function(a){var b=c(a);if(b)return b;throw new Error("The wizard with the id "+a+" does not exist")},e=function(d){if(c(d))throw new Error("The wizard with the id "+d+" is already existing");var e=new b(d);return a.push(e),e};return{createWizard:e,getWizard:d}}),b.module("mwUI.UiComponents").config(["i18nProvider",function(a){a.addResource("mw-ui-components/i18n","uikit")}])}(window,angular);
\ No newline at end of file
diff --git a/dist/mw-uikit.relution.min.js b/dist/mw-uikit.relution.min.js
new file mode 100644
index 00000000..05cf0c0f
--- /dev/null
+++ b/dist/mw-uikit.relution.min.js
@@ -0,0 +1,5 @@
+angular.module("mwUI.Relution",["mwUI","ngSanitize","mwCollection","mwListable","mwForm","mwFormBb","mwComponents","mwComponentsBb","mwSidebar","mwSidebarBb","mwFormValidators","mwNav","mwPopover","mwHelper","mwMap","mwFileUpload"]).config(["mwIconProvider","i18nProvider","mwValidationMessagesProvider",function(a,b,c){"use strict";a.getIconSet("mwUI").replaceIcons({cross:"rln-icon close_cross",question:"rln-icon support"}),c.registerValidator("hex","errors.hex"),c.registerValidator("unique","errors.notUnique"),c.registerValidator("match","errors.doesNotMatch"),c.registerValidator("emailOrPlaceholder","errors.emailOrPlaceholder"),c.registerValidator("itunesOrHttpLink","errors.itunesOrHttpLink"),b.addResource("mw-ui-rln-i18n","uikit-relution"),window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),window.ieVersion=function(){return null!==new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(navigator.userAgent)?parseFloat(RegExp.$1):!1}()}]),angular.module("mwUI.Relution").directive("mwFormInput",function(){return{transclude:!0,scope:{label:"@",tooltip:"@",hideErrors:"="},templateUrl:"uikit/templates/deprecated/mw_form_input.html",link:function(){window.mwUI.Utils.shims.deprecationWarning("[mwFormInput] The directive mw-form-input has been renamed to mw-input-wrapper. Please use the new directive instead!")}}}).directive("mwFormWrapper",function(){return{transclude:!0,scope:{label:"@",tooltip:"@",hideErrors:"="},templateUrl:"uikit/templates/deprecated/mw_form_input.html",link:function(){window.mwUI.Utils.shims.deprecationWarning("[mwFormWrapper] The directive mw-form-wrapper does not exist anymore. Please use the directive mw-input-wrapper instead!")}}}).directive("mwFormCheckbox",function(){return{transclude:!0,scope:{label:"@",tooltip:"@",hideErrors:"=",badges:"@"},templateUrl:"uikit/templates/deprecated/mw_form_checkbox.html",link:function(a){if(window.mwUI.Utils.shims.deprecationWarning("[mwFormCheckbox] The directive mw-form-checkbox does not exist anymore. Please use the directive mw-input-wrapper instead!"),a.badges){var b=function(){window.mwUI.Utils.shims.deprecationWarning("[mwFormCheckbox] The badges attribute of the deprecated mw-form-checkbox is not supported anymore. Please transclude the badges instead"),a.typedBadges=[];var b=a.badges.split(",");angular.forEach(b,function(b){var c="info";b.toLowerCase().indexOf("android")>-1&&(c="android"),b.toLowerCase().indexOf("ios")>-1&&(c="info"),b.toLowerCase().indexOf("knox")>-1&&(c="knox"),b.toLowerCase().indexOf("-knox-")>-1&&(b="KNOX",c="notsafe"),b.toLowerCase().indexOf("knox")>-1&&b.toLowerCase().indexOf("android")>-1&&(c="multi"),(b.toLowerCase().indexOf("deprecated")>-1||b.toLowerCase().indexOf("veraltet")>-1)&&(c="warning"),(b.toLowerCase().indexOf("removed")>-1||b.toLowerCase().indexOf("entfernt")>-1)&&(c="danger"),a.typedBadges.push({text:b,type:c})})};a.$watch("badges",b)}}}}).directive("mwCustomCheckbox",function(){return{link:function(){window.mwUI.Utils.shims.deprecationWarning("[mwCustomCheckbox] The directive mw-custom-checkbox is deprecated. The custom checkbox is default now. You can remove this directive from the checkbox input element")}}}).directive("mwCustomRadio",function(){return{link:function(){window.mwUI.Utils.shims.deprecationWarning("[mwCustomRadio] The directive mw-custom-radio is deprecated. The custom radio box is default now. You can remove this directive from the radio input element")}}}).directive("mwCustomSelect",function(){return{link:function(){window.mwUI.Utils.shims.deprecationWarning("[mwCustomSelect] The directive mw-custom-select is deprecated. The custom selectbox is default now. You can remove this directive from the select input")}}}).directive("mwFormMultiSelect2",function(){return{scope:{mwCollection:"=",mwOptionsCollection:"=",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"="},templateUrl:"uikit/templates/deprecated/mw_form_multi_select_2.html",link:function(a){0===a.mwOptionsCollection.length&&a.mwOptionsCollection.fetch(),window.mwUI.Utils.shims.deprecationWarning("[mwFormMultiSelect2] The directive mw-form-multi-select-2 is deprecated. It has been renamed to mw-checkbox-group. The new directive wont fetch the options collection automatically when it is empty")}}}),angular.module("mwComponents",["ngSanitize","mwUI.Utils"]).directive("mwTextCollapse",["$filter",function(a){return{restrict:"A",scope:{mwTextCollapse:"@",length:"=",markdown:"="},templateUrl:"uikit/templates/mwComponents/mwTextCollapse.html",link:function(b){b.showButton=!1,b.defaultLength=200;var c=function(){b.mwTextCollapse.length>b.defaultLength?b.showButton=!0:b.showButton=!1};b.text=function(){return a("reduceStringTo")(b.mwTextCollapse,b.filterLength)},b.showLessOrMore=function(){return b.filterLength===b.defaultLength?"common.showMore":"common.showLess"},b.toggleLength=function(){b.filterLength===b.defaultLength?delete b.filterLength:b.filterLength=b.defaultLength},b.length&&"number"==typeof b.length&&(b.defaultLength=b.length),b.filterLength=b.defaultLength,c(),b.$watch("mwTextCollapse",c)}}}]).directive("mwFilterableSearch",["$timeout","$animate","Loading","Detect",function(a,b,c,d){return{scope:{filterable:"=",mwDisabled:"=",property:"@"},templateUrl:"uikit/templates/mwComponents/mwFilterableSearch.html",link:function(c,e){b.enabled(!1,e.find(".search-indicator")),c.model=c.filterable.properties[c.property],c.inputLength=0,c.isMobile=d.isMobile();var f,g=function(){return c.filterable.applyFilters()},h=function(){c.searching=!0,a.cancel(f),f=a(function(){g().then(function(){a.cancel(f),c.searching=!1},function(){c.searching=!1})},500)};c.search=function(a){a&&13!==a.keyCode?c.isMobile||h():g()},c.reset=function(){c.model.value="",g()}}}}]).service("mwMarkdown",function(){var a=new window.showdown.Converter({headerLevelStart:3,smoothLivePreview:!0,extensions:[function(){return[{type:"lang",regex:"•",replace:"-"},{type:"lang",filter:function(a){return a.replace(/https?:\/\/\S*/g,function(a){return"<"+a+">"})}}]}]});return{convert:function(b){return a.makeHtml(b)}}}).directive("mwMarkdownPreview",function(){return{scope:{mwModel:"=mwMarkdownPreview"},templateUrl:"uikit/templates/mwComponents/mwMarkdownPreview.html",link:function(a,b){b.addClass("mw-markdown-preview")}}}).directive("mwMarkdown",["$sanitize","mwMarkdown",function(a,b){return{restrict:"AE",link:function(c,d,e){var f=function(c){try{var e=c?a(b.convert(c)):"";d.html(e)}catch(f){d.text(c)}};e.mwMarkdown?c.$watch(e.mwMarkdown,function(a){f(a)}):f(d.text())}}}]).directive("mwModalOnEnter",["validateEnterKeyUp",function(a){return{restrict:"A",require:"?^form",link:function(b,c,d,e){c.parents(".modal").first().on("keyup",function(b){a.clickIfValid(c,b,e)})}}}]).service("validateEnterKeyUp",function(){return{clickIfValid:function(a,b,c){13!==b.keyCode||"SELECT"===b.target.nodeName||b.isDefaultPrevented()||(c&&c.$valid||!c)&&a.click()}}}),angular.module("mwComponentsBb",[]).service("ignoreKeyPress",function(){var a=13;return{ignoreEnterKey:function(b){b.which===a&&b.preventDefault()}}}).directive("mwFilterableSearchBb",["$timeout","$q","ignoreKeyPress",function(a,b,c){return{scope:{collection:"=",mwListCollection:"=",property:"@",customUrlParameter:"@",mwDisabled:"=",placeholder:"@",inputSearchId:"@?",minLength:"=?"},templateUrl:"uikit/templates/mwComponentsBb/mwFilterableSearch.html",link:function(d,e){d.inputSearchId=d.inputSearchId||"mw_input_search_field";var f,g,h=e.find("input"),i=function(a){if(d.customUrlParameter)f.filterable.customUrlParams[d.customUrlParameter]=a;else{var b={};b[d.property]=a,f.filterable.setFilters(b),g&&g.applySearchTerm(d.property,a)}};if(d.viewModel={searchVal:""},d.search=function(){return d.viewModel.searchVal.length>=d.minLength?(d.searching=!0,i(d.viewModel.searchVal),f.fetch()["finally"](function(){a(function(){d.searching=!1},500)})):(b.reject(),void(d.searching=!1))},d.reset=function(){d.viewModel.searchVal="",d.search()},d.hasValue=function(){return h.val().length>0},d.keyUp=function(a){c.ignoreEnterKey(a),d.searching=!0},d.focus=function(){h.focus()},e.on("focus","input[type=text]",function(){e.children().addClass("is-focused")}),e.on("blur","input[type=text]",function(){e.children().removeClass("is-focused")}),e.on("mousedown touch",function(a){var b=e.find(".trigger-search"),c=e.find(".reset-search");0!==c.find(a.target).length?d.reset():0!==b.find(a.target).length&&d.search()}),d.collection?f=d.collection:d.mwListCollection&&(f=d.mwListCollection.getCollection(),g=d.mwListCollection.getMwListCollectionFilter()),!(f instanceof Backbone.Collection))throw new Error("[mwFilterableSearchBb] Either collection or mwCollection has to be set");d.minLength||(d.minLength=0),d.$watch(function(){return f.filterable&&d.property?f.filterable.filterValues[d.property]:void 0},function(a){a&&a!==d.viewModel.searchVal&&(d.viewModel.searchVal=a)})}}}]).directive("mwVersionSelector",function(){return{restrict:"A",scope:{currentVersionModel:"=",versionCollection:"=",versionNumberKey:"@",url:"@"},templateUrl:"uikit/templates/mwComponentsBb/mwVersionSelector.html",link:function(a){a.versionNumberKey=a.versionNumberKey||"versionNumber",a.getUrl=function(b){return a.url.replace("VERSION_UUID",b)}}}}),angular.module("mwUI.Relution").directive("mwLeadingZero",function(){return{require:"ngModel",link:function(a,b,c,d){d.$formatters.unshift(function(a){return 10>a?"0"+a:a})}}}).directive("mwDatePicker",["$rootScope","$compile","$interval","$timeout","i18n",function(a,b,c,d,e){return{templateUrl:"uikit/templates/mwDatePicker/mwDatePicker.html",scope:{mwModel:"=",mwRequired:"=",mwChange:"&",showTimePicker:"=",disableDateInput:"=",options:"=",hideErrors:"=",placeholder:"@"},link:function(b,f){var g,h,i,j={clearBtn:!b.mwRequired};b.viewModel={date:null,hours:null,minutes:null,datepickerIsOpened:!1,showTimePicker:angular.isDefined(b.showTimePicker)?b.showTimePicker:!0,disableDateInput:angular.isDefined(b.disableDateInput)?b.disableDateInput:!1},b.$watch("showTimePicker",function(a){b.viewModel.showTimePicker=a}),b.$watch("disableDateInput",function(a){b.viewModel.disableDateInput=a}),b.onFocus=function(a){b.viewModel.disableDateInput&&a&&a.target&&a.target.blur()},b.canChange=function(a,c){var d=b.options||{},e=+new Date(b.mwModel);if(a=a||0,"MINUTES"===c?a=60*a*1e3:"HOURS"===c&&(a=60*a*60*1e3),d.startDate){var f=+new Date(d.startDate);return 0>a?e+a>=f:new Date(e).setHours(0,0,0,0)>=new Date(f).setHours(0,0,0,0)}if(d.endDate){var g=+new Date(d.endDate);return a>0?g>=e+a:new Date(e).setHours(0,0,0,0)<=new Date(g).setHours(0,0,0,0)}return!0},b.increment=function(a,c,d){var e=b.viewModel[a];d>e?e++:e=c,b.viewModel[a]=e},b.startIncrementCounter=function(){var a=arguments;h=c(function(){b.increment.apply(this,a)}.bind(this),200)},b.stopIncrementCounter=function(){c.cancel(h)},b.decrement=function(a,c,d){var e=b.viewModel[a];e>c?e--:e=d,b.viewModel[a]=e},b.startDecrementCounter=function(){var a=arguments;i=c(function(){b.decrement.apply(this,a)}.bind(this),200)},b.stopDecrementCounter=function(){c.cancel(i)};var k=function(a){d(function(){if(a.dates.length>0){var c=new Date(a.getDate());b.viewModel.hours?c.setHours(b.viewModel.hours):b.viewModel.hours=c.getHours(),b.viewModel.minutes?c.setMinutes(b.viewModel.minutes):b.viewModel.minutes=c.getMinutes(),b.mwModel=c,b.viewModel.date=c.toLocaleDateString()}else b.viewModel.date=null,b.viewModel.hours=null,b.viewModel.minutes=null,b.mwModel=null;b.mwChange&&b.mwChange({val:b.mwModel})})},l=function(a){a.on("changeDate",k.bind(this,a.data().datepicker)),a.on("show",function(){d(function(){b.viewModel.datepickerIsOpened=!0})}),a.on("hide",function(){d(function(){b.viewModel.datepickerIsOpened=!1})})},m=function(a,c,d){if(c){c=new Date(c);var e=c.toLocaleDateString(),f=c.getHours(),h=c.getMinutes();a.val(e),b.viewModel.hours=f,b.viewModel.minutes=h,b.viewModel.date=e,d.setDate(c),d.update(),g.val(e)}},n=function(a){if(!a.datepicker)throw new Error("bootstrap-sass-datepicker is not available. Make sure you included the javascript file")},o=function(a){var c;g&&g.data().datepicker&&g.data().datepicker.remove(),c=f.find(".date-picker"),n(c),g=c.datepicker(_.extend(j,a)),m(c,b.mwModel,g.data().datepicker),l(g)},p=function(){var a="en";"de_DE"===e.getActiveLocale().id&&(a="de"),o({language:a})};a.$on("i18n:localeChanged",p),p();var q=function(a){g&&a&&k(g.data().datepicker)};b.$watch("viewModel.minutes",q),b.$watch("viewModel.hours",q),b.$watchCollection("options",function(a){a&&o(a)}),f.on("mouseout",".number-spinner",function(){b.stopDecrementCounter(),b.stopIncrementCounter()})}}}]),angular.module("mwFileUpload",[]).provider("mwFileUpload",function(){var a={};this.setGlobalConfig=function(b){_.extend(a,b)},this.$get=function(){return{getGlobalConfig:function(){return a}}}}).directive("mwFileUpload",["$q","$timeout","$filter","mwFileUpload","ResponseHandler","mwMimetype","i18n",function(a,b,c,d,e,f,g){return{restrict:"A",scope:{url:"@",name:"@",model:"=?",attribute:"@",labelAttribute:"@",showFileName:"=",mwRequired:"=",validator:"@",text:"@",formData:"=",successCallback:"&",errorCallback:"&",stateChangeCallback:"&",fullScreen:"=",hiddenBtn:"=",showUploadBtnAlways:"=?",hasDropZone:"=?",hideCancelBtn:"=?",hideRemoveBtn:"=?",abortFlag:"=?",maxFileSizeByte:"=?"},require:"?^form",templateUrl:"uikit/templates/mwFileUpload/mwFileUpload.html",link:function(h,i,j,k){h.viewModel={uploaderOptions:{},state:null,uploadProgress:0,fileName:null,uploadError:null,isInvalid:!1,dropZoneId:_.uniqueId("dropzone"),dropZoneElmement:null,documentDragOver:!1,dropzoneDragOver:!1,hasDropzone:!1};var l=function(b,c){var d={config:{method:b.type,url:b.url},data:b.result,headers:b.headers,status:b.xhr().status,statusText:b.xhr().statusText},f=e.handle(d,c);return f?f:c?a.reject(d):a.when(d)},m=function(){var a=h.labelAttribute||"name";h.model instanceof window.Backbone.Model?h.viewModel.fileName=h.model.get(a):h.model?h.viewModel.fileName=h.model[a]:h.viewModel.fileName=null},n=function(a){h.model instanceof Backbone.Model?h.model.set(h.model.parse(a)):h.attribute?h.model=a[h.attribute]:h.model=a,m()},o=function(a,c,d){return j.validator&&!f.checkMimeType(d.contentType,j.validator)&&c&&c.message?(h.uploadError=g.get("rlnUikit.mwFileUpload.invalidMimeType",{mimeType:j.validator}),h.viewModel.isInvalid=!0,void(h.viewModel.fileName=d.name)):(n(d),void l(a,!1).then(function(){b(h.successCallback.bind(this,{result:d}))}))},p=function(){k&&k.$setDirty()},q=function(a){if(a&&angular.isArray(a)&&0!==a.length){var d=a[0],e=c("mwReadableFileSize")(d.size),f=c("mwReadableFileSize")(h.maxFileSizeByte),i=g.get("rlnUikit.mwFileUpload.fileTooLarge",{fileName:d.name,max:f,actual:"("+e+")"});b(h.errorCallback.bind(this,{result:{msg:i,code:413,fileSize:d.size,fileName:d.name,fileType:d.type,maxFileSizeByte:h.maxFileSizeByte}})),h.viewModel.fileName=d.name,h.viewModel.uploadError=i}},r=function(a){a=a||{},_.extend(h.viewModel.uploaderOptions,a)},s=function(){b(function(){h.viewModel.dropZoneElmement=i.find("#"+h.viewModel.dropZoneId)})};h.abort=function(){h.abortFlag=!0},h.dragoverDocumentStateChange=function(a){"DOCUMENT_DRAG_OVER"===a?h.viewModel.documentDragOver=!0:(h.viewModel.documentDragOver=!1,h.viewModel.dropzoneDragOver=!1)},h.dragoverDropzoneStateChange=function(a){"DROPZONE_DRAG_OVER"===a?h.viewModel.dropzoneDragOver=!0:h.viewModel.dropzoneDragOver=!1},h.canShowUploadBtn=function(){return"UPLOADING"!==h.viewModel.state&&(!h.viewModel.fileName||h.showUploadBtnAlways||h.hideRemoveBtn)},h.canShowRemoveBtn=function(){return!h.hideRemoveBtn&&h.viewModel.fileName},h.onUploadStart=function(){h.viewModel.state="UPLOADING"},h.onUploadProgress=function(a){var c="";angular.isObject(a)&&(a.data&&angular.isArray(a.data.files)&&a.data.files[0]&&(c=a.data.files[0].name),h.abortFlag=!1,h.viewModel.isInvalid=!0,h.viewModel.uploadProgress=a.progress,h.viewModel.uploadMessage=g.get("rlnUikit.mwFileUpload.uploading",{fileName:c}),b(h.stateChangeCallback.bind(this,{data:a.data,progress:a.progress})),h.dragoverDocumentStateChange(),h.dragoverDropzoneStateChange())},h.onUploadSuccess=function(a){h.viewModel.state="DONE",h.viewModel.uploadProgress=0,o(a.xhr,a.response,a.file),h.viewModel.isInvalid=!1,p(),b(h.successCallback.bind(this,{result:a.file}))},h.onUploadError=function(a){switch(h.viewModel.state="DONE",a.type){case"FILE_TOO_BIG":q(a.result.files);break;case"SERVER":break;case"CUSTOM_VALIDATION_FAILED":}h.viewModel.isInvalid=!0,p(),b(h.errorCallback.bind(this,{result:a.response||{}}))},h.onUploadAbort=function(){h.viewModel.state="DONE",h.viewModel.isInvalid=!1},h.removeFile=function(){n(null),h.viewModel.isInvalid=!1},h.$watch("url",function(a){a&&r({url:a})}),h.$watch("formData",function(a){r(a?{formData:a}:{formData:{}})},!0),h.$watch("hasDropZone",function(a){a?(h.viewModel.hasDropZone=!0,s()):h.viewModel.hasDropZone=!1}),angular.isUndefined(h.hasDropZone)&&(h.hasDropZone=!0),r(d.getGlobalConfig()),h.$watch("model",m)}}}]),angular.module("mwFileUpload").directive("mwFileUploadButton",["$q","$timeout","mwMimetype",function(a,b,c){return{restrict:"A",scope:{uploaderOptions:"=?",maxFileSizeByte:"=?",dropZoneElement:"=?",onBeforeUploadCallback:"=?",onUploadStartCallback:"=?",onProgressCallback:"=?",onSuccessCallback:"=?",onErrorCallback:"=?",onAbortCallback:"=?",abortFlag:"=?",accepts:"@?"},transclude:!0,templateUrl:"uikit/templates/mwFileUpload/mwFileUploadButton.html",link:function(a,d){var e,f=d.find("input[type=file]"),g=!1;a.mimeTypeGroup=c.getMimeTypeGroup(a.accepts),a.file=null,a.mimeTypeGroup?a.inputValidator=a.accepts:a.inputValidator="*/*";var h=function(c,d,e){"function"==typeof a.onErrorCallback&&b(a.onErrorCallback.bind(this,{type:d,xhr:c,result:e}))},i=function(a){return a&&a.results&&_.isArray(a.results)&&a.results.length>0&&(a=a.results[0]),a},j=function(c,d){"function"==typeof a.onSuccessCallback&&b(a.onSuccessCallback.bind(this,{xhr:c,file:i(d),response:d}))},k=function(){"function"==typeof a.onAbortCallback&&b(a.onAbortCallback.bind(this))},l=function(c){if(c&&"function"==typeof a.onProgressCallback){var d=c.loaded,e=c.total,f=parseInt(d/e*100,10);b(a.onProgressCallback.bind(this,{data:c,progress:f,total:e,loaded:d}))}},m=function(b){var c=!0;return a.maxFileSizeByte&&angular.forEach(b,function(b){b.size>a.maxFileSizeByte&&(c=!1)}),c};a.abort=function(){e&&(g=!0,e.abort())},f.fileupload({url:a.url,dataType:"json",formData:a.formData,autoUpload:!1}),f.bind("fileuploadadd",function(b,c){if(c&&angular.isArray(c.files)&&0!==c.files.length){if(a.file=c.files,g=!1,"function"==typeof a.onBeforeUploadCallback){var d=a.onBeforeUploadCallback(c.files);if(d===!1)return h(this,"CUSTOM_VALIDATION_FAILED",{files:c.files,response:null}),void(a.file=null)}return m(c.files)?void(e=c.submit()):(h(this,"FILE_TOO_BIG",{files:c.files,response:null}),void(a.file=null))}}),f.bind("fileuploadstart",function(){a.abortFlag=!1,"function"==typeof a.onUploadStartCallback&&a.onUploadStartCallback()}),f.bind("fileuploadprogress",function(a,b){l(b)}),f.bind("fileuploaddone",function(a,b){j(b,b.result)}),f.bind("fileuploadfail",function(b,c){g?k():(a.uploadError=c.statusText,h(this,"SERVER",{files:null,response:c.responseJSON}))}),a.triggerUploadDialog=function(){d.off("click",a.triggerUploadDialog),d.find("input[type=file]").click(),d.on("click",a.triggerUploadDialog)},a.$watch("uploaderOptions",function(a){a&&f.fileupload("option",a)},!0),a.$watch("abortFlag",function(b){b&&a.abort()}),a.$watch("dropZoneElement",function(a){a&&f.fileupload("option",{dropZone:a})}),d.on("click",a.triggerUploadDialog),a.$on("$destroy",function(){d.off("click",a.triggerUploadDialog);try{d.find("input[type=file]").fileupload("destroy")}catch(b){}})}}}]),angular.module("mwFileUpload").directive("mwFileUploadDragAndDrop",["$timeout",function(a){return{restrict:"A",templateUrl:"uikit/templates/mwFileUpload/mwFileUploadDragAndDrop.html",scope:{id:"@",onDocumentDragOverCallback:"=?",onDropzoneDragOverCallback:"=?",onDrop:"=?"},link:function(b,c){var d,e=function(c){"function"==typeof b.onDocumentDragOverCallback&&a(b.onDocumentDragOverCallback.bind(this,c))},f=function(c){"function"==typeof b.onDropzoneDragOverCallback&&a(b.onDropzoneDragOverCallback.bind(this,c))},g=function(){"function"==typeof b.onDrop&&a(b.onDrop.bind(this)),f("DROPZONE_DRAG_LEAVE"),e("DOCUMENT_DRAG_LEAVE")},h=function(c){c.preventDefault(),d?clearTimeout(d):a(function(){b.isInDragState=!0,e("DOCUMENT_DRAG_OVER")}),d=setTimeout(function(){d=null,a(function(){b.isInDragState=!1,b.isInDragOverState||e("DOCUMENT_DRAG_LEAVE")})},100)},i=function(a){a.preventDefault(),g()},j=function(){a(function(){b.isInDragOverState=!0,f("DROPZONE_DRAG_OVER")})},k=function(){a(function(){b.isInDragOverState=!1,f("DROPZONE_DRAG_LEAVE")})},l=function(){angular.element(document).on("dragover",h),c.on("dragover",j),c.on("dragleave",k),angular.element(document).on("drop",i)},m=function(){angular.element(document).off("dragover",h),c.off("dragover",j),c.off("dragleave",k),angular.element(document).off("drop",i)};l(),b.$on("$destroy",function(){m()})}}}]),angular.module("mwFileUpload").service("mwMimetype",function(){return{application:["application/atom+xml","application/ecmascript","application/EDIFACT","application/json","application/javascript","application/octet-stream","application/ogg","application/pdf","application/postscript","application/rdf+xml","application/rss+xml","application/soap+xml","application/font-woff","application/xhtml+xml","application/xml","application/xml-dtd","application/xop+xml","application/zip","application/x-pkcs12","application/x-pkcs7-mime","application/x-pkcs7-certificates","application/*"],audio:["audio/basic","audio/L24","audio/mp4","audio/mpeg","audio/ogg","audio/opus","audio/vorbis","audio/vnd.rn-realaudio","audio/vnd.wave","audio/webm","audio/*"],image:["image/gif","image/pjpeg","image/jpg","image/jpeg","image/png","image/svg+xml","image/*"],video:["video/mpeg","video/mp4","video/ogg","video/quicktime","video/webm","video/x-matroska","video/x-ms-wmv","video/x-flv","video/*"],text:["text/cmd","text/css","text/csv","text/html","text/javascript (Obsolete)","text/plain","text/vcard","text/xml","text/*"],getMimeTypeGroup:function(a){return-1!==this.text.indexOf(a)?"text":-1!==this.video.indexOf(a)?"video":-1!==this.image.indexOf(a)?"image":-1!==this.audio.indexOf(a)?"audio":-1!==this.application.indexOf(a)?"application":!1},checkMimeType:function(a,b){return"*/*"===a||"*/*"===b?!0:this.getMimeTypeGroup(b)?this.getMimeTypeGroup(a)===this.getMimeTypeGroup(b):a===b}}}),function(){var a=function(){return{restrict:"E",require:"?ngModel",link:function(a,b,c,d){var e=d,f=["checkbox","radio","hidden","file"],g=-1===f.indexOf(c.type),h=255,i=2147483647;c.type||(h=4e3),"number"!==c.type&&e&&g&&!e.$validators.maxlength&&!c.ngMaxlength&&(c.$set("ngMaxlength",h),e.$validators.maxlength=function(a,b){return 0>h||e.$isEmpty(a)||b.length<=h}),"number"!==c.type||d.$validators.max||(c.$set("max",i),d.$validators.max=function(a){return d.$isEmpty(a)||angular.isUndefined(i)||i>=a})}}};angular.module("mwForm",[]).directive("mwFormMultiSelect",function(){return{restrict:"A",transclude:!0,require:"^?form",scope:{model:"=",options:"=",query:"=filter",mwRequired:"="},templateUrl:"uikit/templates/mwForm/mwFormMultiSelect.html",controller:["$scope",function(a){if(angular.isArray(a.model)||(a.model=[]),angular.isArray(a.options)){var b={};a.options.forEach(function(a){b[a]=a}),a.options=b}a.getObjectSize=function(a){return _.size(a)},a.filter=function(b){var c={};return angular.forEach(b,function(b,d){(!a.query||!b||b.match(a.query.toLowerCase())||b.match(a.query.toUpperCase()))&&(c[d]=b)}),c},a.toggleKeyIntoModelArray=function(b){a.model=a.model||[],a.model.indexOf(b)>=0?(a.model.splice(a.model.indexOf(b),1),0===a.model.length&&delete a.model):a.model.push(b)}}],link:function(a,b,c,d){a.showRequiredMessage=function(){return(!a.model||a.model.length<1)&&a.required},a.setDirty=function(){d&&d.$setDirty()}}}}).directive("form",function(){return{restrict:"E",link:function(a,b){var c=angular.element('');b.prepend(c)}}}).directive("input",a).directive("textarea",a).directive("mwPasswordToggler",["$compile",function(a){return{restrict:"A",link:function(b,c){var d=function(){var d=angular.element(''),e=a('')(b);c.wrap(d),e.insertAfter(c)};b.isPassword=function(){return"password"===c.attr("type")},b.togglePassword=function(){b.isPassword()?c.attr("type","text"):c.attr("type","password")},b.showToggler=function(){return!c.is(":disabled")},b.$watch(b.showToggler,function(a){var b=c.parent(".mw-password-toggler");a?b.addClass("input-group"):b.removeClass("input-group")}),d()}}}])}(),angular.module("mwFormBb",["mwUI.i18n"]).directive("mwFormMultiSelectBb",function(){return{restrict:"A",transclude:!0,require:"^?form",scope:{model:"=",collection:"=",mwOptionsKey:"@",translationPrefix:"@",mwRequired:"=",disabledCollection:"="},templateUrl:"uikit/templates/mwFormBb/mwFormMultiSelect.html",link:function(a,b,c,d){if(a.optionsKey=a.mwOptionsKey||"key",!(a.collection instanceof Backbone.Collection))throw new Error("mwFormMultiSelect: collection attribute has to be a collection");if(a.disabledCollection&&!(a.disabledCollection instanceof Backbone.Collection))throw new Error("mwFormMultiSelect: disabledCollection attribuet has to be a collection");var e=function(b){return a.model.indexOf(b)>=0?(a.model.splice(a.model.indexOf(b),1),0===a.model.length&&delete a.model,!0):!1};a.disabledCollection&&a.disabledCollection.each(function(b){e(b.get(a.optionsKey))}),a.isDisabled=function(b){return a.disabledCollection?!!a.disabledCollection.get(b):void 0},a.toggleKeyIntoModelArray=function(b){a.model=a.model||[],e(b)||a.model.push(b)},a.showRequiredMessage=function(){return(!a.model||a.model.length<1)&&a.mwRequired},a.setDirty=function(){d&&d.$setDirty()}}}}).directive("mwFormRadioGroupBb",function(){return{restrict:"A",transclude:!0,require:"^?form",scope:{mwModel:"=",mwOptionsCollection:"=",mwOptionsKey:"@",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"=",name:"@"},templateUrl:"uikit/templates/mwFormBb/mwFormRadioGroup.html",link:function(a){a.optionsKey=a.mwOptionsKey||"key",0===a.mwOptionsCollection.length&&a.mwOptionsCollection.fetch()}}}).directive("mwFormSelectBb",["i18n",function(a){return{restrict:"A",transclude:!0,require:"^?form",scope:{mwModel:"=",mwOptionsCollection:"=",mwOptionsKey:"@",mwOptionsLabelKey:"@",mwOptionsLabelI18nPrefix:"@",mwRequired:"=",mwDisabled:"=",mwChange:"&",mwPlaceholder:"@placeholder",mwNullLabel:"@",mwAutoFetch:"=",name:"@"},templateUrl:"uikit/templates/mwFormBb/mwFormSelect.html",link:function(b){b.optionsKey=b.mwOptionsKey||"key",b.labelKey=b.mwOptionsLabelKey||"label",b.viewModel={val:""},b.getKey=function(a){return a.get(b.optionsKey)},b.getLabel=function(c){return null===c.get(b.optionsKey)?c.get(b.labelKey):b.mwOptionsLabelI18nPrefix?a.get(b.mwOptionsLabelI18nPrefix+"."+b.getKey(c)):b.getKey(c)},b.getSelectedModel=function(a){var c={};return c[b.optionsKey]=a,b.mwOptionsCollection.findWhere(c)};var c=function(){if(!b.mwRequired){var a={},c=null,d={};d[b.optionsKey]=c,a[b.optionsKey]=c,a[b.labelKey]=b.mwNullLabel||"",b.mwOptionsCollection.findWhere(d)||b.mwOptionsCollection.add(a)}};b.mwModel instanceof window.Backbone.Model?(b.viewModel.val=b.mwModel.get(b.optionsKey)||null,b.mwOptionsCollection.on("add",function(){b.viewModel.val&&b.getSelectedModel(b.viewModel.val)&&b.mwModel.set(b.getSelectedModel(b.viewModel.val).toJSON())}),b.$watch("viewModel.val",function(a){a&&b.getSelectedModel(a)?b.mwModel.set(b.getSelectedModel(a).toJSON()):b.mwModel.clear()})):(b.viewModel.val=b.mwModel||null,b.$watch("mwModel",function(a){(a||null===a)&&(b.viewModel.val=a)}),b.$watch("viewModel.val",function(a){b.mwModel=a})),(b.mwAutoFetch||angular.isUndefined(b.mwAutoFetch))&&0===b.mwOptionsCollection.length&&b.mwOptionsCollection.fetch(),b.mwRequired||(c(),b.mwOptionsCollection.on("reset sync",c,this))}}}]).directive("mwMultiSelectBoxes",["i18n",function(a){return{restrict:"A",scope:{mwOptionsCollection:"=",mwCollection:"=",labelProperty:"@mwOptionsLabelKey",i18nPrefix:"@mwOptionsLabelI18nPrefix",mwRequired:"=",mwDisabled:"=",name:"@hiddenFormElementName",placeholder:"@"},templateUrl:"uikit/templates/mwFormBb/mwMultiSelectBoxes.html",link:function(b){b.viewModel={tmpModel:new b.mwCollection.model},b.mwCollection.on("addBeforeSave",function(){b.viewModel&&b.viewModel.tmpModel&&null!==b.viewModel.tmpModel&&!b.viewModel.tmpModel.isNew()&&b.mwCollection.add(b.viewModel.tmpModel.toJSON())}),b.add=function(a){b.mwCollection.add(a.toJSON())},b.remove=function(a){b.mwCollection.remove(a)},b.getLabel=function(c){var d=b.labelProperty?c.get(b.labelProperty):c.get("key");return b.i18nPrefix?a.get(b.i18nPrefix+"."+d):void 0},b.mwCollection.on("add",function(a){b.mwOptionsCollection.remove(a)}),b.mwCollection.on("remove",function(a){b.mwOptionsCollection.add(a.toJSON())}),b.mwCollection.each(function(a){b.mwOptionsCollection.remove(a)})}}}]),function(){var a=function(a,b){return a?!!a.match(b):!0};angular.module("mwFormValidators",[]).directive("mwValidatePhone",function(){return{restrict:"A",require:"ngModel",link:function(b,c,d,e){var f=/^(00|\+)[0-9()\/\-\.x\s]{6,}$/,g=function(b){return a(b,f)};e.$validators.phone=g}}}).directive("mwValidateHex",function(){return{restrict:"A",require:"ngModel",link:function(b,c,d,e){var f=/^(0x)?([0-9A-Fa-f])+$/,g=function(b){return e.$setValidity("hex",a(b,f)),b};e.$formatters.push(g),e.$parsers.push(g)}}}).directive("mwValidateCollectionOrModel",function(){return{restrict:"A",scope:{mwModel:"=mwValidateCollectionOrModel",mwRequired:"=",mwKey:"@"},require:"^?form",template:'',link:function(a,b,c,d){var e=a.mwKey||"uuid";a.model={},a.uId=_.uniqueId("validator_");var f=function(){d&&d.$setDirty()},g=a.$watch("mwModel",function(){var b=a.mwModel;if(b){if(b instanceof window.Backbone.Collection)b.on("add remove reset",function(){b.length>0?a.model.tmp=b.first().get(e):a.model.tmp=void 0,f()}),b.length>0?a.model.tmp=b.first().get(e):a.model.tmp=void 0;else{if(!(b instanceof window.Backbone.Model))throw new Error("Value is neither a model nor a collection! Make its one of them",b);e=a.mwKey||b.idAttribute,b.on("change:"+e,function(){a.model.tmp=b.get(e),f()}),a.model.tmp=b.get(e)}g()}})}}}).directive("mwValidatePlaceholder",function(){return{restrict:"A",require:"ngModel",link:function(b,c,d,e){var f=/\$\{.*\}/,g=function(b){return e.$setValidity("placeholder",a(b,f)),b};e.$formatters.push(g),e.$parsers.push(g)}}}).directive("mwValidatePlaceholderOrMail",function(){return{restrict:"A",require:"ngModel",link:function(b,c,d,e){var f=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+([.][a-zA-Z0-9_-]+)*[.][a-zA-Z0-9._-]+$/,g=/\$\{.+\}/;e.$validators.emailOrPlaceholder=function(b){return!(!a(b,f)&&!a(b,g))}}}}).directive("mwValidateMatch",function(){return{require:"ngModel",link:function(a,b,c,d){var e=b.inheritedData("$formController")[c.mwValidateMatch];d.$parsers.push(function(a){var b=!1;return a===e.$viewValue&&(b=!0),d.$setValidity("match",b),a}),e.$parsers.push(function(a){var b=!1;return a===d.$viewValue&&(b=!0),d.$setValidity("match",b),a})}}}).directive("mwValidateUniqueness",function(){
+return{require:"ngModel",link:function(a,b,c,d){var e;a.$watch(c.mwValidateUniqueness,function(a){e=a});var f=function(a){var b=!0;return angular.isArray(e)&&e.length>0&&a&&d.$dirty&&(b=-1===e.indexOf(a)),d.$setValidity("unique",b),a};d.$parsers.unshift(f),d.$formatters.unshift(f)}}}).config(["mwValidationMessagesProvider",function(a){a.registerValidator("withoutChars","errors.withoutChar"),a.registerValidator("withoutChar","errors.withoutChars")}]).directive("mwValidateWithoutChar",["$parse","mwValidationMessages","i18n",function(a,b,c){return{require:"ngModel",link:function(d,e,f,g){var h,i=f.mwValidateWithoutChar;try{h=a(f.mwValidateWithoutChar)(d)}catch(j){}_.isArray(h)?(b.updateMessage("withoutChars",function(){return c.get("errors.withoutChars",{chars:'"'+h.join('", "')+'"'})}),g.$validators.withoutChars=function(a){var b=!0;return a&&h.forEach(function(c){b&&(b=a.indexOf(c)<0)}),b}):i&&(b.updateMessage("withoutChar",function(){return c.get("errors.withoutChar",{"char":i})}),g.$validators.withoutChar=function(a){var b=!0;return a&&(b=a.indexOf(i)<0),b})}}}]).config(["mwValidationMessagesProvider",function(a){a.registerValidator("onlyWordChars","errors.onlyWordChars")}]).directive("mwValidateWordChars",function(){return{require:"ngModel",link:function(a,b,c,d){d.$validators.onlyWordChars=function(a){return a?!a.match(/\W/g):!0}}}}).directive("mwValidateItunesOrHttpLink",function(){return{require:"ngModel",link:function(b,c,d,e){var f=/^(https?|itms|itms-apps):\/\/.+$/;e.$validators.itunesOrHttpLink=function(b){return a(b,f)}}}}).config(["mwValidationMessagesProvider",function(a){a.registerValidator("minValidDate","errors.minDate"),a.registerValidator("maxValidDate","errors.maxDate")}]).directive("mwValidateDate",["mwValidationMessages","i18n",function(a,b){return{require:"ngModel",link:function(c,d,e,f){f.$validators.minValidDate=function(a){var b=c.$eval(e.minDate),d=+new Date(a),f=+new Date(b);return!b||!a||d>f},f.$validators.maxValidDate=function(a){var b=c.$eval(e.maxDate),d=+new Date(a),f=+new Date(b);return!b||!a||f>d},e.$observe("minDate",function(d){d&&a.updateMessage("minValidDate",function(){return b.get("errors.minValidDate",{minDate:new Date(c.$eval(d)).toLocaleString()})})}),e.$observe("maxDate",function(d){d&&a.updateMessage("maxValidDate",function(){return b.get("errors.maxValidDate",{maxDate:new Date(c.$eval(d)).toLocaleString()})})})}}}])}(),angular.module("mwHelper",[]).directive("mwSetDirtyOn",function(){return{restrict:"A",scope:{mwSetDirtyOn:"@"},require:"^form",link:function(a,b,c,d){b.on(a.mwSetDirtyOn,function(){d.$setDirty()})}}}).service("mwDefaultFocusService",function(){var a=function(){var a=[];this.register=function(b,c){a.push({id:b,el:c,active:!1})};var b=function(b,c){var d=_.findWhere(a,{id:b}),e=_.indexOf(a,d);e>=0&&(a[e]=c)};this.setFocus=function(c){var d=_.findWhere(a,{id:c});if(this.getFocusedField()&&this.getFocusedField().id!==c)throw new Error("There can be only one focused field");d&&(d.active=!0,b(d))},this.removeFocus=function(c){var d=_.findWhere(a,{id:c});d&&(d.active=!1,b(d))},this.toggleFocus=function(c){var d=_.findWhere(a,{id:c});d&&(d.active=!d.active,b(d))},this.getFocusedField=function(){return _.findWhere(a,{active:!0})},this.remove=function(b){var c=_.findWhere(a,{id:b}),d=_.indexOf(a,c);d>=0&&a.splice(d,1)}};return new a}).directive("mwDefaultFocus",["mwDefaultFocusService",function(a){return{restrict:"A",scope:{isFocused:"=mwDefaultFocus"},link:function(b,c){var d=_.uniqueId("focus_field");a.register(d,c);var e=function(){if(!c.is(":focus"))try{a.setFocus(d),c[0].focus(),window.requestAnimFrame(e)}catch(b){console.warn(b)}};b.$watch("isFocused",function(b){b?window.requestAnimFrame(e):(c[0].blur(),a.removeFocus(d))}),b.$on("$destroy",function(){a.remove(d)})}}}]).service("LayoutWatcher",["$timeout","$window",function(a,b){var c=[],d=function(){c.forEach(function(a){a.callback.apply(a.scope)})};return angular.element("body").on("DOMNodeInserted",_.throttle(d,300)),angular.element("body").on("DOMNodeRemoved",_.throttle(d,300)),angular.element(b).on("resize",_.throttle(d,300)),a(d,500),{registerCallback:function(a,b){if("function"!=typeof a)throw new Error("Callback has to be a function");var d={callback:a,scope:b};c.push(d)}}}]).directive("mwSetFullScreenHeight",["LayoutWatcher",function(a){return{restrict:"A",scope:{subtractElements:"=",offset:"@"},link:function(b,c){c.addClass("mw-full-screen-height");var d=function(){var a=angular.element(window).height();b.subtractElements.forEach(function(b){var c=angular.element(b);if(c){var d={top:parseInt(c.css("padding-top"),10),bottom:parseInt(c.css("padding-bottom"),10)};a-=c.height(),a-=d.top,a-=d.bottom}}),b.offset&&(a-=b.offset),c.css("height",a)};a.registerCallback(d)}}}]).directive("mwInvertModelValue",function(){return{restrict:"A",require:"ngModel",link:function(a,b,c,d){var e=function(a){return"boolean"==typeof a?!a:a};d.$parsers.push(e),d.$formatters.push(e)}}}).directive("mwRemoveXs",["Detect",function(a){return{priority:1,link:function(b,c){a.isSmartphone()&&(c.remove(),b.$destroy())}}}]).directive("mwRemoveMd",["Detect",function(a){return{priority:1,link:function(b,c){(a.isSmartphone()||a.isTablet())&&(c.remove(),b.$destroy())}}}]).directive("mwAutofillCheck",["$interval",function(a){return{restrict:"A",link:function(b,c){var d=c.find("input"),e=null;d.on("keyup",function(){null===e&&(e=a(function(){d.trigger("input").trigger("change").trigger("keydown")},500))}),b.$on("$destroy",function(){a.cancel(e)})}}}]),angular.module("mwUI.mwLayout",[]),angular.module("mwUI.mwLayout").provider("mwMenu",function(){var a=[],b=function(a,b,c,d){if(this.url=a,this.label=b,this.icon=c,this.options=_.extend({order:null,activeUrls:[a],subEntries:[],divider:!1},d||{}),this.isDivider=this.options.divider,!this.url&&!d.divider)throw new Error("Url is a required constructor param");return this};_.extend(b.prototype,{isActive:function(){},getActive:function(){}});var c=function(){var a=b.apply(this,arguments);return a};c.prototype=Object.create(b.prototype),c.prototype.constructor=c;var d=function(a,c,d,e){var f=b.apply(this,arguments);return this._subEntries=[],this.options.subEntries&&this.options.subEntries.forEach(function(a){this.registerSubEntry(a.url,a.label,a.icon,e)}.bind(this)),f};d.prototype=Object.create(b.prototype),d.prototype.constructor=d,_.extend(d.prototype,{addSubEntry:function(a,b,d,e){e=_.extend({order:this._subEntries.length},e||{});var f=new c(a,a,b,d,e);if(_.findWhere(this._subEntries,{url:f.url}))throw new Error("Sub entry with the url "+f.url+" already exists");return this._subEntries.push(f),f},getSubEntries:function(){return this._subEntries},getSubEntriesWithoutDividers:function(){return _.where(this._subEntries,{isDivider:!1})},addDivider:function(a,b,d,e){e=_.extend({order:this._subEntries.length},e||{}),e.divider=!0;var f=new c(a,null,b,d,e);if(_.findWhere(this._subEntries,{id:f.id}))throw new Error("Entry with the id "+f.id+" already exists");this._subEntries.push(f)},getDividers:function(){return _.where(this._subEntries,{isDivider:!0})}}),this.$get=function(){return{getEntries:function(){return a},getActiveEntry:function(){},addEntry:function(b,c,e,f){f=_.extend({order:a.length},f||{});var g=new d(b,b,c,e,f);if(_.findWhere(a,{url:g.url}))throw new Error("Entry with the url "+g.url+" already exists");return a.push(g),g},removeEntry:function(b){if(b=_.findWhere(a,{id:b.id||b}),!b)throw new Error("The entry could not be found");a=_.without(a,b)}}}}).directive("mwMenu",function(){return{transclude:!0,templateUrl:"uikit/templates/mwLayout/mw_menu.html",link:function(){}}}),angular.module("mwCollection",["ngRoute","mwUI.Backbone","mwUI.Utils"]).service("MwListCollection",["$q","MwListCollectionFilter",function(a,b){var c=function(c,d){var e=c,f=(d||c.endpoint)+"_V1",g=new b(f);this.getMwListCollectionFilter=function(){return g},this.getCollection=function(){return e},this.fetch=function(){var b=this.getMwListCollectionFilter();return a.all([b.fetchAppliedFilter(),b.fetchAppliedSortOrder(),b.fetchAppliedSearchTerm()]).then(function(a){var c=a[0],d=a[1],f=a[2],g=c.get("filterValues");if(d.property&&e.filterable.setSortOrder(d.order+d.property),f.val){var h={};h[f.attr]=f.val;try{e.filterable.setFilters(h)}catch(i){console.warn("[MwListCollection] The filter attribute "+f.attr+" for the searchterm "+f.val+" does not exist!"),b.clearAppliedSearchTerm()}}if(!c.isNew())try{e.filterable.setFilters(g)}catch(i){console.warn("[MwListCollection] Filter could not be applied!",i),b.clearAppliedFilter()}return b.hasAppliedFilterOrSearchTerm()||(e.filterable.filterIsSet=!1),e.fetch().then(function(){return this}.bind(this))}.bind(this))},c.on("change:sortOrder",function(a){this.getMwListCollectionFilter().applySortOrder(a)},this)};return c}]),angular.module("mwCollection").service("MwListCollectionFilter",["$q","$rootScope","$location","$route","mwUrlStorage","mwRuntimeStorage","FilterHoldersCollection","FilterHolderProvider",function(a,b,c,d,e,f,g,h){var i=function(b){var c=b,d="applied_filter_"+c,i="applied_sort_order_"+c,j="applied_search_"+c,k=new g(null,b),l=h.createFilterHolder(),m={attr:null,val:null},n={order:null,property:null},o=function(){var a={};l.isNew()?a.f=null:a.f=l.id,m.val&&m.val.length>0?(a.qAttr=m.attr,a.q=m.val):(a.qAttr=null,a.q=null),n.property&&(a.s=n.property,a.sOrder="+"===n.order?"ASC":"DESC"),e.setObject(a,{removeOnUrlChange:!0})},p=function(){return e.getItem("q")&&e.getItem("qAttr")||e.getItem("f")},q=function(){return e.getItem("s")};this.hasAppliedFilterOrSearchTerm=function(){return m.val&&m.val.length>0||!l.isNew()},this.getFilters=function(){return k},this.fetchFilters=function(){return k.length>0||k.fetched?a.when(k):k.fetch().then(function(){return k.fetched=!0,k})},this.saveFilter=function(a){return k.add(a,{merge:!0}),a.save().then(function(a){return k.add(a,{merge:!0}),a})},this.deleteFilter=function(a){var b=a.id;return a.destroy().then(function(){b===l.id&&this.revokeFilter()}.bind(this))},this.getAppliedFilter=function(){return l},this.filterWasSetByUser=function(a){return this.fetchFilters().then(function(){return!!k.findWhere({uuid:a.uuid})},function(){return!1})},this._getAppliedFilterFromUrl=function(){var a=e.getItem("f");return a?{uuid:a}:null},this.fetchAppliedFilter=function(){if(p()){var b=this._getAppliedFilterFromUrl();return b?this.filterWasSetByUser(b).then(function(a){return a?(this.applyFilter(k.findWhere(b)),l):this.clearAppliedFilter()}.bind(this)):this.clearAppliedFilter()}return l.get("uuid")?a.when(l):a.when(f.getItem(d)).then(function(a){return a?this.filterWasSetByUser(a).then(function(b){return b?this.applyFilter(a):l}.bind(this)):l}.bind(this))},this.clearAppliedFilter=function(){return l.clear(),a.when(f.removeItem(d)).then(function(){return o(),l})},this.applyFilter=function(b){var c;return b instanceof Backbone.Model?c=b.toJSON():_.isObject(b)&&(c=b),c&&l.id!==c.uuid?(l.set(c),o(),a.when(f.setItem(d,c)).then(function(){return l})):a.resolve(l)},this.revokeFilter=function(){var b=[];return b.push(this.clearAppliedFilter()),b.push(this.clearAppliedSearchTerm()),a.all(b)},this.getAppliedSortOrder=function(){return n},this._getAppliedSortOrderFromUrl=function(){var a=e.getItem("s"),b=e.getItem("sOrder");return a?{order:"ASC"===b?"+":"-",property:a}:null},this.fetchAppliedSortOrder=function(){if(q()){var b=this._getAppliedSortOrderFromUrl();return this.applySortOrder(b)}return n.order&&n.property?a.when(n):a.when(f.getItem(i)).then(function(a){return n=a||{order:null,property:null}})},this.applySortOrder=function(b){if(_.isString(b)){var c=b.match(/([+-])(\w+)/);c&&3===c.length&&(b={order:c[1],property:c[2]})}return n=b,l.set(n),o(),a.when(f.setItem(i,b)).then(function(){return b})},this.revokeSortOrder=function(){return n={order:null,property:null},f.removeItem(i).then(function(){o()})},this.clearAppliedSearchTerm=function(){return m={attr:null,val:null},a.when(f.removeItem(j)).then(function(){return o(),l})},this.applySearchTerm=function(b,c){return m.val!==c&&b?(m={attr:b,val:c&&c.length>0?c:null},o(),a.when(f.setItem(j,m)).then(function(){return m})):a.resolve(m)},this._getAppliedSearchTermFromUrl=function(){var a=e.getItem("qAttr"),b=e.getItem("q");return a&&a.length>0&&b&&b.length>0?{attr:a,val:b}:null},this.fetchAppliedSearchTerm=function(){if(p()){var b=this._getAppliedSearchTermFromUrl();return b?this.applySearchTerm(b.attr,b.val):this.clearAppliedSearchTerm()}return m.val?a.when(m):a.when(f.getItem(j)).then(function(a){return a=a||{},this.applySearchTerm(a.attr,a.val)}.bind(this))}};return i}]).service("FilterHolderProvider",["FilterHolderModel",function(a){return{createFilterHolder:function(){return new a}}}]),angular.module("mwListable",[]).directive("mwListable",["$compile","$window","$document",function(a,b,c){return{restrict:"A",scope:{selectable:"=",filterable:"="},compile:function(a){return a.append(""),function(a,d){d.addClass("table table-striped mw-listable");var e=function(){a.filterable&&h.scrollTop()>=.8*(i.height()-h.height())&&a.filterable.loadMore()},f=function(){a.filterable&&g[0].scrollHeight>0&&g[0].scrollHeight-g.scrollTop()-g[0].clientHeight<2&&a.filterable.loadMore()};if(d.parents(".modal").length){var g=d.parents(".modal-body");g.on("scroll",f),a.$on("$destroy",function(){g.off("scroll",f)})}else{var h=angular.element(b),i=angular.element(c);h.on("scroll",e),a.$on("$destroy",function(){h.off("scroll",e)})}}},controller:["$scope",function(a){var b=a.columns=[];this.actionColumns=[],this.sort=function(b,c){a.filterable&&a.filterable.setSortOrder(c+b)},this.getSort=function(){return a.filterable?a.filterable.sortOrder():void 0},this.registerColumn=function(a){b.push(a)},this.getColumns=function(){return b},this.getFilterable=function(){return a.filterable},this.getSelectable=function(){return a.selectable},this.toggleAll=function(){a.selectable.allSelected()?a.selectable.unselectAll():a.selectable.selectAll()},this.isRadio=function(){return a.selectable?a.selectable.isRadio():!1}}]}}]).directive("mwListableHead",["$compile",function(a){return{require:"^mwListable",scope:{title:"@mwListableHead"},link:function(b,c,d,e){b.filterable=e.getFilterable(),b.selectable=e.getSelectable();var f='
'}}).directive("mwNavbarDropdownItem",["$rootScope",function(a){return{transclude:!0,replace:!0,scope:!0,require:["^mwNavbarDropdown","^mwNavbar"],template:'',link:function(b,c,d,e){var f=c.find("a").attr("href"),g=e[0],h=e[1];g&&g.register(f);var i=function(){b.isActive=h?h.isActive(f,!0):!1};i(),a.$on("$routeChangeSuccess",i),c.find("a").on("click",function(){b.uncollapse()})}}}]),angular.module("mwPopover",[]).service("Popover",function(){this.contents=[]}).directive("mwPopoverContent",["$compile","Popover",function(a,b){return{restrict:"A",link:function(c,d,e){d.css("display","none"),b.contents[e.mwPopoverContent]=a(d.html())(c)}}}]).directive("mwPopover",["$rootScope","$templateRequest","$compile",function(a,b,c){return{restrict:"A",link:function(a,d,e){var f=!1,g="",h=function(){d.popover("destroy"),d.popover({trigger:e.popoverTrigger||"hover",title:e.popoverTitle,html:!0,placement:e.popoverPosition,content:c(g.trim())(a)}),d.on("show.bs.popover",function(){f=!0})};d.on("blur",function(){d.popover("hide")}),e.popoverTitle=e.popoverTitle||"popoverTitle",e.$observe("popoverTitle",h),e.popoverUrl&&(g="",b(e.popoverUrl).then(function(a){g=a,h()}),h()),e.$observe("content",function(a){a&&(g=a,h())}),a.$on("$destroy",function(){var a=d.data("bs.popover");a&&a.tip()&&a.tip().detach().remove()})}}}]),angular.module("mwSidebar",[]).directive("mwSidebarSelect",function(){return{transclude:!0,scope:{filterable:"=",mwDisabled:"=",property:"@",persist:"="},templateUrl:"uikit/templates/mwSidebar/mwSidebarSelect.html",link:function(a){a.$watch("filterable",function(){a.filterable&&(a.model=a.filterable.properties[a.property],a.persist&&(a.filterable.properties[a.property].persist=a.persist))})}}}).directive("mwSidebarPanel",["$document","$window",function(a,b){return{replace:!0,transclude:!0,templateUrl:"uikit/templates/mwSidebar/mwSidebarPanel.html",link:function(c,d){var e=angular.element(b),f=function(){var b=angular.element(d).offset().top,c=0,f=0,g=15,i=a.scrollTop();angular.element("*[mw-header]").length?c=angular.element("*[mw-header]").offset().top+angular.element("*[mw-header]").height():angular.element("*[mw-menu-top-bar]").length&&(c=angular.element("*[mw-menu-top-bar]").offset().top+angular.element("*[mw-menu-top-bar]").height()),f=b-c-g,10>=f?e.off("scroll",h):i>f?angular.element(d).find(".content-container").css("top",c+g):i>1?angular.element(d).find(".content-container").css("top",b-i):angular.element(d).find(".content-container").css("top","initial")},g=function(){var a=d.find(".content-container"),b=e.height(),c=d.offset().top,f=angular.element("body > footer").height(),g=20,h=b-c-f-g;h>0?a.css("max-height",h):a.css("max-height","initial")},h=_.throttle(f,10),i=_.throttle(g,500);window.requestAnimFrame(g),setTimeout(g,500),e.on("resize",i),e.on("scroll",h),c.$on("$destroy",function(){e.off("resize",i),e.off("scroll",h)})}}}]).directive("mwSidebarActions",function(){return{transclude:!0,scope:{title:"@mwTitle"},templateUrl:"uikit/templates/mwSidebar/mwSidebarActions.html"}}).directive("mwSidebarFilters",function(){return{transclude:!0,templateUrl:"uikit/templates/mwSidebar/mwSidebarFilters.html",link:function(a){a.resetFiltersOnClose=function(){a.toggleFilters||(a.filterable.resetFilters(),a.filterable.applyFilters())},a.filterable&&a.filterable.hasPersistedFilters()&&(a.toggleFilters=!0)}}}),angular.module("mwSidebarBb",[]).directive("mwSidebarFiltersBb",["$timeout","FilterHolderModel","InvalidFilterModal",function(a,b,c){return{transclude:!0,templateUrl:"uikit/templates/mwSidebarBb/mwSidebarFilters.html",controller:["$scope",function(a){this.getCollection=function(){return a.collection},this.getFilterHolders=function(){return a.filterHolders},this.changeFilter=function(b,c,d){if(d)a.collection.filterable.customUrlParams[b]=c,a.viewModel.tmpFilter.get("customUrlParams")[b]=c;else{var e={};e[b]=c,a.collection.filterable.setFilters(e),a.viewModel.tmpFilter.set({filter:a.collection.filterable.getFilters()}),a.viewModel.tmpFilter.get("filterValues")[b]=c}a.collection.fetch()}}],link:function(d,e,f){if(d.showFilterForm=d.$eval(f.showFilterForm),d.mwListCollection=d.$eval(f.mwListCollection),d.collection=d.$eval(f.collection),d.isLoading=!1,d.mwListCollection){var g=400;d.collection=d.mwListCollection.getCollection(),d.mwListCollectionFilter=d.mwListCollection.getMwListCollectionFilter(),d.filters=d.mwListCollectionFilter.getFilters(),d.appliedFilter=d.mwListCollectionFilter.getAppliedFilter(),d.viewModel={tmpFilter:new b,showFilterForm:!1,canShowForm:!1},d.showFilterForm&&(d.viewModel.showFilterForm=!0);var h=function(a){var b=d.filters.get(a),c=d.collection.filterable.getTotalAmount();a.set("totalAmount",c),b&&b.set("totalAmount",c)},i=function(a){return d.collection.filterable.resetFilters(),d.collection.filterable.setFilters(a.get("filterValues")),d.mwListCollectionFilter.fetchAppliedSearchTerm().then(function(b){if(b.val){var c={};c[b.attr]=b.val,d.collection.filterable.setFilters(c)}return d.collection.fetch().then(function(){h(a)})})},j=function(a,b){var c=a.get("filterValues");return b.forEach(function(a){delete c[a]}),a};d.isFilterApplied=function(a){var b=d.mwListCollectionFilter.getAppliedFilter();return a?b.id===a.id:void 0},d.saveFilter=function(){var a;a=d.viewModel.tmpFilter.isNew()?new b(d.viewModel.tmpFilter.toJSON()):d.viewModel.tmpFilter,d.mwListCollectionFilter.saveFilter(a).then(function(b){d.viewModel.showFilterForm=!1,b=d.filters.get(a),b.set("invalid",!1),d.applyFilter(b)})},d.deleteFilter=function(a){var b=a.id,c=d.appliedFilter.id;return d.mwListCollectionFilter.deleteFilter(a).then(function(){b===c&&d.revokeFilter()})},d.applyFilter=function(b){d.collection.filterable.getInvalidFilterKeys(b.get("filterValues"));if(b.get("invalid")){var e=new c;e.setScopeAttributes({filterModel:b,modifyAction:function(){a(function(){d.editFilter(b)})}}),e.show()}else i(b),d.mwListCollectionFilter.applyFilter(b)},d.revokeFilter=function(){d.mwListCollectionFilter.revokeFilter().then(function(){d.collection.filterable.resetFilters(),d.collection.fetch(),d.appliedFilter.clear()})},d.addFilter=function(){var c=new b;d.viewModel.canShowForm=!0,d.viewModel.tmpFilter.clear(),d.viewModel.tmpFilter.set(c.toJSON()),d.viewModel.showFilterForm=!0,a(function(){i(d.viewModel.tmpFilter)},g)},d.editFilter=function(b){d.viewModel.canShowForm=!0,d.viewModel.tmpFilter.clear(),d.viewModel.tmpFilter.set(b.toJSON()),d.viewModel.showFilterForm=!0,a(function(){i(b)},g)},d.cancelFilterEdit=function(){d.viewModel.showFilterForm=!1,d.appliedFilter.id&&d.appliedFilter.id===d.viewModel.tmpFilter.id||a(function(){d.applyFilter(d.appliedFilter)},g)},d.filtersAreApplied=function(){return _.size(d.viewModel.tmpFilter.get("filterValues"))>0},d.mwListCollectionFilter.fetchFilters().then(function(a){a.each(function(a){var b=d.collection.filterable.getInvalidFilterKeys(a.get("filterValues"));b.length>0&&(a.set("invalid",!0),j(a,b))})}),d.mwListCollectionFilter.fetchAppliedFilter().then(function(a){h(a)})}else{if(!d.collection)throw new Error("please pass a collection or mwCollection as scope attribute");console.warn("The scope attribute collection is deprecated please use the mwCollection instead"),d.viewModel={showFilterForm:!0,canShowForm:!0,tmpFilter:new b}}d.collection.on("request",function(){d.isLoading=!0}),d.collection.on("sync error remove",function(){d.isLoading=!1})}}}]).factory("InvalidFilterModal",["Modal",function(a){return a.prepare({templateUrl:"uikit/templates/mwSidebarBb/mwInvalidFilterModal.html",controller:"InvalidFilterModalController",dismissible:!1})}]).controller("InvalidFilterModalController",["$scope",function(a){a.modify=function(){if("function"!=typeof a.modifyAction)throw new Error("[InvalidFilterModal] modifyAction has to be a function. Set callback function via modal.setScopeAttributes({modifyAction:...}");a.modifyAction(),a.hideModal()},a["delete"]=function(){if(!a.filterModel)throw new Error("[InvalidFilterModal] The scope attribute filterModel has to be a valid filterModel. Set it via modal.setScopeAttributes({filterModel:...})");a.filterModel.destroy(),a.hideModal()}}]).directive("mwSidebarSelectBb",["i18n",function(a){return{require:"^mwSidebarFiltersBb",scope:{property:"@",options:"=",placeholder:"@",mwDisabled:"=",keyProperty:"@",labelProperty:"@",labelTransformFn:"=",translationPrefix:"@",translationSuffix:"@",customUrlParameter:"@"},templateUrl:"uikit/templates/mwSidebarBb/mwSidebarSelect.html",link:function(b,c,d,e){b.viewModel={},b.key=function(a){return angular.isDefined(b.keyProperty)?a.attributes[b.keyProperty]:a.attributes.key},b.collection=e.getCollection(),b.label=function(c){var d=b.key(c);return b.translationPrefix&&b.translationSuffix?d=a.get(b.translationPrefix+"."+b.key(c)+"."+b.translationSuffix):b.translationSuffix?d=a.get(b.key(c)+"."+b.translationSuffix):b.translationPrefix&&(d=a.get(b.translationPrefix+"."+b.key(c))),d},b.changed=function(){var a=b.customUrlParameter?b.customUrlParameter:b.property;e.changeFilter(a,b.viewModel.val,!!b.customUrlParameter)},angular.isDefined(b.labelProperty)&&(b.label=function(c){return angular.isObject(c.attributes[b.labelProperty])?a.localize(c.attributes[b.labelProperty]):c.attributes[b.labelProperty]}),angular.isDefined(b.labelTransformFn)&&(b.label=b.labelTransformFn),
+b.$watch("collection.filterable.filterValues."+b.property,function(a){a&&a.length>0?b.viewModel.val=a:b.viewModel.val=null})}}}]).directive("mwSidebarInputBb",function(){return{require:"^mwSidebarFiltersBb",scope:{type:"@",property:"@",placeholder:"@",mwDisabled:"=",customUrlParameter:"@"},templateUrl:"uikit/templates/mwSidebarBb/mwSidebarInput.html",link:function(a,b,c,d){a.viewModel={},a._type=a.type||"text",a.collection=d.getCollection(),a.isValid=function(){return b.find("input").first().hasClass("ng-valid")},a.changed=function(){var b=a.customUrlParameter?a.customUrlParameter:a.property;d.changeFilter(b,a.viewModel.val,!!a.customUrlParameter)},a.$watch("collection.filterable.filterValues."+a.property,function(b){b&&b.length>0?a.viewModel.val=b:a.viewModel.val=null})}}}).directive("mwSidebarNumberInputBb",function(){return{require:"^mwSidebarFiltersBb",scope:{property:"@",placeholder:"@",mwDisabled:"=",customUrlParameter:"@",min:"@",max:"@"},templateUrl:"uikit/templates/mwSidebarBb/mwSidebarNumberInput.html",link:function(a,b,c,d){a.viewModel={},a.isValid=function(){return b.find("input").first().hasClass("ng-valid")},a.changed=function(){var b=a.customUrlParameter?a.customUrlParameter:a.property;d.changeFilter(b,a.viewModel.val,!!a.customUrlParameter)}}}}).directive("mwSidebarDateRangeBb",["$timeout","$rootScope","i18n",function(a,b,c){return{require:"^mwSidebarFiltersBb",scope:{fromProperty:"@",toProperty:"@",mwDisabled:"=",customUrlParameter:"@",min:"@",max:"@"},templateUrl:"uikit/templates/mwSidebarBb/mwSidebarDateRange.html",link:function(b,c,d,e){var f;b.isValid=function(){return c.find("input").first().hasClass("ng-valid")},b.setFromDate=function(a){b.viewModel.oldFrom=a,e.changeFilter(b.fromProperty,a)},b.setToDate=function(a){b.viewModel.oldTo=a,e.changeFilter(b.toProperty,a)},b.viewModel={oldFrom:null,oldTo:null};var g={inputs:c.find(".actualrange"),clearBtn:!0,format:"dd.mm.yyyy",endDate:b.max,startDate:b.min},h=function(d){isFinite(d.dates[0])&&isFinite(d.dates[1])?null===b.oldFrom||b.viewModel.oldFrom.toUTCString()!==d.dates[0].toUTCString()?(b.setFromDate(d.dates[0]),a(function(){c.find(".actualrange")[1].focus()})):(b.setToDate(d.dates[1]),a(function(){c.find(".actualrange").first().focus()})):isFinite(d.dates[0])?(b.setFromDate(d.dates[0]),a(function(){c.find(".actualrange")[1].focus()})):isFinite(d.dates[1])&&(b.setToDate(d.dates[1]),a(function(){c.find(".actualrange").first().focus()}))},i=function(c){c.on("changeDate",h.bind(this,c.data().datepicker)),c.on("show",function(){a(function(){b.viewModel.datepickerIsOpened=!0})}),c.on("hide",function(){a(function(){b.viewModel.datepickerIsOpened=!1})})},j=function(a){if(!a.datepicker)throw new Error("bootstrap-sass-datepicker is not available. Make sure you included the javascript file")},k=function(a){var b;f&&f.data().datepicker&&f.data().datepicker.remove(),b=c.find(".input-daterange"),j(b),f=b.datepicker(_.extend(g,a)),i(f)};k()}}}]),angular.module("mwUI.Relution").run(["$templateCache",function(a){"use strict";a.put("uikit/templates/deprecated/mw_form_checkbox.html",'
')}]),angular.module("mwUI.Relution").run(["$templateCache",function(a){"use strict";a.put("uikit-relution/mw-ui-rln-i18n/de_DE.json",'{ "rlnUikit": { "cancel": "Abbrechen", "mwFileUpload": { "dropFiles": "Datei hier hin ziehen um diese hochzuladen", "upload": "Datei auswählen", "remove": "Entfernen", "invalidMimeType": "Die hochgeladene Datei ist ungültig. Der vorgegebene Mime-Type is {{mimeType}}", "abort": "Upload abbrechen", "uploading": "{{fileName}} wird hochgeladen...", "fileTooLarge": "{{fileName}} {{actual}} übersteigt die maximal erlaubte Dateigröße von {{max}}" }, "mwSidebar": { "invalidFilterModal": { "title": "Der Filter ist nicht mehr gültig", "description": "Der Filter \\"{{name}}\\" enthält Filter Attribute die entweder nicht mehr verfügbar sind oder geändert wurden. Der Filter kann daher nicht mehr verwendet werden. Sie können den Filter entweder bearbeiten, sodass dieser wieder verwendet werden kann oder löschen.", "delete": "Filter löschen", "modify": "Filter bearbeiten" } } } }'),a.put("uikit-relution/mw-ui-rln-i18n/en_US.json",'{ "rlnUikit": { "cancel": "Cancel", "mwFileUpload": { "dropFiles": "Drop your file here to upload it", "upload": "Select file", "remove": "Remove", "invalidMimeType": "The uploaded file is invalid. Mime-Type has to be {{mimeType}}", "abort": "Abort upload", "uploading": "Uploading {{fileName}}...", "fileTooLarge": "{{fileName}} {{actual}} is exceeding the maximum allowed file-size {{max}}" }, "mwSidebar": { "invalidFilterModal": { "title": "The filter is invalid", "description": "The filter \\"{{name}}\\" contains filter attributes that are either not available anymore or have been changed. Therefore the filter does not work anymore. You can either modify the filter to make it work again or delete it.", "delete": "Delete filter", "modify": "Modify filter" } } } }');
+}]),function(){function a(a){"use strict";var b={omitExtraWLInCodeBlocks:{"default":!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{"default":!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{"default":!1,describe:"Specify a prefix to generated header ids",type:"string"},headerLevelStart:{"default":!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{"default":!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{"default":!1,describe:"Turn on/off GFM autolink style",type:"boolean"},literalMidWordUnderscores:{"default":!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},strikethrough:{"default":!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{"default":!1,describe:"Turn on/off tables support",type:"boolean"},tablesHeaderId:{"default":!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{"default":!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{"default":!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{"default":!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"}};if(a===!1)return JSON.parse(JSON.stringify(b));var c={};for(var d in b)b.hasOwnProperty(d)&&(c[d]=b[d]["default"]);return c}function b(a,b){"use strict";var c=b?"Error in "+b+" extension->":"Error in unnamed extension",e={valid:!0,error:""};d.helper.isArray(a)||(a=[a]);for(var f=0;f-1))return a;m=""}else m=c.gUrls[l],d.helper.isUndefined(c.gTitles[l])||(n=c.gTitles[l]);m=d.helper.escapeCharacters(m,"*_",!1);var o='"+k+""};return a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,e),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,e),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,e)}),d.subParser("autoLinks",function(a,b){"use strict";function c(a,b){var c=d.subParser("unescapeSpecialChars")(b);return d.subParser("encodeEmailAddress")(c)}var e=/\b(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+)(?=\s|$)(?!["<>])/gi,f=/<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)>/gi,g=/\b(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)\b/gi,h=/<(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi;return a=a.replace(f,'$1'),a=a.replace(h,c),b.simplifiedAutoLink&&(a=a.replace(e,'$1'),a=a.replace(g,c)),a}),d.subParser("blockGamut",function(a,b,c){"use strict";a=d.subParser("blockQuotes")(a,b,c),a=d.subParser("headers")(a,b,c);var e=d.subParser("hashBlock")("",b,c);return a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,e),a=a.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,e),a=a.replace(/^[ ]{0,2}([ ]?_[ ]?){3,}[ \t]*$/gm,e),a=d.subParser("lists")(a,b,c),a=d.subParser("codeBlocks")(a,b,c),a=d.subParser("tables")(a,b,c),a=d.subParser("hashHTMLBlocks")(a,b,c),a=d.subParser("paragraphs")(a,b,c)}),d.subParser("blockQuotes",function(a,b,c){"use strict";return a=a.replace(/((^[ \t]{0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,e){var f=e;return f=f.replace(/^[ \t]*>[ \t]?/gm,"~0"),f=f.replace(/~0/g,""),f=f.replace(/^[ \t]+$/gm,""),f=d.subParser("githubCodeBlocks")(f,b,c),f=d.subParser("blockGamut")(f,b,c),f=f.replace(/(^|\n)/g,"$1 "),f=f.replace(/(\s*