!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/js/",n(n.s=33)}([function(e,t,n){"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var n=0,r=e.length;n":">",'"':""","'":"'","`":"`","=":"="},o=/[&<>"'`=]/g,a=/[&<>"'`=]/;function i(e){return r[e]}function l(e){for(var t=1;t= 2.0.0-beta.1",7:">= 4.0.0"};function u(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},i.registerDefaultHelpers(this),l.registerDefaultDecorators(this)}u.prototype={constructor:u,logger:s.default,log:s.default.log,registerHelper:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===o.toString.call(e))o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var c=s.default.log;t.log=c,t.createFrame=o.createFrame,t.logger=s.default},function(e,t){e.exports=function(e,t){return e===t?'selected="selected"':""}},function(e,t,n){var r=n(2);function o(e){return e&&(e.__esModule?e.default:e)}e.exports=(r.default||r).template({1:function(e,t,n,r,o){return" modified"},3:function(e,t,n,r,o){return'\t\t\t\n'},5:function(e,t,r,a,i,l,s){var u,c=e.lambda,f=e.escapeExpression,d=null!=t?t:e.nullContext||{};return'\t\t\t
\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n'},6:function(e,t,r,a,i,l,s){var u,c=e.lambda,f=e.escapeExpression;return'\t\t\t\t\t\t\n"},8:function(e,t,r,a,i,l,s){var u,c=e.lambda,f=e.escapeExpression;return'\t\t\t\t\t\t\n"},10:function(e,t,n,r,o){var a;return(null!=(a=n.if.call(null!=t?t:e.nullContext||{},null!=(a=null!=t?t.operation:t)?a.id:a,{name:"if",hash:{},fn:e.program(11,o,0),inverse:e.noop,data:o}))?a:"")+'\t\t\n"},11:function(e,t,n,r,o){return'\t\t\t\n"},13:function(e,t,n,r,o){return'\t\t\n\t\t'+e.escapeExpression(e.lambda(null!=t?t.savingTXT:t,t))+"\n\t"},15:function(e,t,n,r,o){var a;return null!=(a=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.message:t,{name:"if",hash:{},fn:e.program(16,o,0),inverse:e.noop,data:o}))?a:""},16:function(e,t,n,r,o){var a,i=null!=t?t:e.nullContext||{};return'\n\t\t\n\t\t\t\t\t'+e.escapeExpression(e.lambda(null!=t?t.message:t,t))+(null!=(a=n.if.call(i,null!=t?t.errorMessage:t,{name:"if",hash:{},fn:e.program(21,o,0),inverse:e.noop,data:o}))?a:"")+"\n\t\t\t\t\n\t"},17:function(e,t,n,r,o){return"error"},19:function(e,t,n,r,o){return"success"},21:function(e,t,n,r,o){return" "+e.escapeExpression(e.lambda(null!=t?t.errorMessage:t,t))},compiler:[7,">= 4.0.0"],main:function(e,t,n,r,o,a,i){var l,s=null!=t?t:e.nullContext||{},u=e.lambda,c=e.escapeExpression;return'
\n\t
\n\t\t\n\t\t\n'+(null!=(l=n.if.call(s,null!=(l=null!=t?t.operation:t)?l.id:l,{name:"if",hash:{},fn:e.program(3,o,0,a,i),inverse:e.noop,data:o}))?l:"")+'\t
\n\n\t
\n'+(null!=(l=n.each.call(s,null!=(l=null!=t?t.operation:t)?l.checks:l,{name:"each",hash:{},fn:e.program(5,o,0,a,i),inverse:e.noop,data:o}))?l:"")+'\t
\n\t\n"+(null!=(l=n.if.call(s,null!=t?t.hasChanged:t,{name:"if",hash:{},fn:e.program(10,o,0,a,i),inverse:e.noop,data:o}))?l:"")+(null!=(l=n.if.call(s,null!=t?t.saving:t,{name:"if",hash:{},fn:e.program(13,o,0,a,i),inverse:e.program(15,o,0,a,i),data:o}))?l:"")+"\n
\n"},useData:!0,useDepths:!0})},function(e,t,n){var r=n(2);e.exports=(r.default||r).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,r,o){var a;return'
\n\n"},useData:!0})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var a=o(n(3)),i=r(n(19)),l=r(n(1)),s=o(n(0)),u=o(n(20)),c=r(n(21));function f(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=i.default,e.Exception=l.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=f();d.create=f,c.default(d),d.default=d,t.default=d,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),i.default(e),l.default(e),s.default(e),u.default(e),c.default(e)};var o=r(n(9)),a=r(n(10)),i=r(n(11)),l=r(n(12)),s=r(n(13)),u=r(n(14)),c=r(n(15))},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerHelper("blockHelperMissing",function(t,n){var o=n.inverse,a=n.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(r.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):o(this);if(n.data&&n.ids){var i=r.createFrame(n.data);i.contextPath=r.appendContextPath(n.data.contextPath,n.name),n={data:i}}return a(t,n)})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(0),a=n(1),i=(r=a)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("each",function(e,t){if(!t)throw new i.default("Must pass iterator to #each");var n=t.fn,r=t.inverse,a=0,l="",s=void 0,u=void 0;function c(t,r,a){s&&(s.key=t,s.index=r,s.first=0===r,s.last=!!a,u&&(s.contextPath=u+t)),l+=n(e[t],{data:s,blockParams:o.blockParams([e[t],t],[u+t,null])})}if(t.data&&t.ids&&(u=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(s=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var f=e.length;a=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a").attr("type","text").attr("placeholder",t("workflowengine","Start")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("start").val(r).insertBefore(i),$("").attr("type","text").attr("placeholder",t("workflowengine","End")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("end").val(o).insertBefore(i);var f=$("").attr("type","hidden").css("width","250px").insertBefore(i).val(a);f.select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select timezone…"),ajax:{url:OC.generateUrl("apps/workflowengine/timezones"),dataType:"json",quietMillis:100,data:function(e){return""===e&&(e=(e=jstz.determine().name().split("/"))[0]),{search:e}},results:function(e){var t=[];return $.each(e,function(e){t.push({id:e})}),{results:t,more:!1}}},initSelection:function(e,t){t(e.val())},formatResult:function(e){return""+e.id+""},formatSelection:function(e){return _.isUndefined(e.id)||(e=e.id),""+e+""}}),f.addClass("timezone"),i.parent().on("change",".start",_.bind(this.update,this)).on("change",".end",_.bind(this.update,this)).on("change",".timezone",_.bind(this.update,this)),this._$element=i}},update:function(e){for(var t=e.target.value,n=null,r=0;r0?t({id:r,displayname:n.find(function(e){return e.id===r}).displayname}):r?t({id:r,displayname:r}):t()},formatResult:function(e){return""+escapeHTML(e.displayname)+""},formatSelection:function(e){return''+escapeHTML(e.displayname)+""}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin)},function(e,n,r){"use strict";r.r(n);var o=r(5),a=r.n(o),i=r(6),l=r.n(i);OCA.WorkflowEngine=_.extend(OCA.WorkflowEngine||{},{availablePlugins:[],availableChecks:[],getCheckByClass:function(e){for(var t=OCA.WorkflowEngine.availableChecks.length,n=0;n0?(n.ocs.data.groups.forEach(function(t){e.groups.push({id:t.id,displayname:t.displayname})}),e.render()):(OC.Notification.error(t("workflowengine","Group list is empty"),{type:"error"}),console.log(n))}).error(function(e){OC.Notification.error(t("workflowengine","Unable to retrieve the group list"),{type:"error"}),console.log(e)})},delete:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.delete,this)):(this.model.destroy(),this.remove())},reset:function(){this.hasChanged=!1,this.model.set(this.originalModel,{silent:!0}),this.render()},save:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.save,this)):(this.hasChanged=!1,this.saving=!0,this.render(),this.model.save(null,{success:function(e,n,r){this.saving=!1,this.originalModel=JSON.parse(JSON.stringify(this.model)),this.message=t("workflowengine","Saved"),this.errorMessage="",this.render()},error:function(e,n,r){this.saving=!1,this.hasChanged=!0,this.message=t("workflowengine","Saving failed:"),this.errorMessage=n.responseText,this.render()},context:this}))},add:function(){var e=_.clone(this.model.get("checks")),t=OCA.WorkflowEngine.availableChecks[0].class,n=OCA.WorkflowEngine.availableChecks[0].operators;e.push({class:t,operator:n[0].operator,value:""}),this.model.set({checks:e})},checkChanged:function(e){for(var t=e.target.value,n=$(e.target.parentElement).data("id"),r=JSON.parse(JSON.stringify(this.model.get("checks"))),o=null,a=0;a