aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2020-05-13 17:48:16 +0000
committernpmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>2020-05-13 18:27:32 +0000
commit3d1836ad34d80318b59389edb89ba02678b687d5 (patch)
treefa57f1b64a2bc7dc0bc1c834bc809d0b154c6b81 /apps/workflowengine
parent7e369ea0555b596d6a54e9617db14c794db50d3a (diff)
downloadnextcloud-server-3d1836ad34d80318b59389edb89ba02678b687d5.tar.gz
nextcloud-server-3d1836ad34d80318b59389edb89ba02678b687d5.zip
Bump @babel/core from 7.9.0 to 7.9.6
Bumps [@babel/core](https://github.com/babel/babel) from 7.9.0 to 7.9.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) - [Commits](https://github.com/babel/babel/compare/v7.9.0...v7.9.6) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/workflowengine')
-rw-r--r--apps/workflowengine/js/workflowengine.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js
index 9105c4c3bab..91d2e196213 100644
--- a/apps/workflowengine/js/workflowengine.js
+++ b/apps/workflowengine/js/workflowengine.js
@@ -322,7 +322,7 @@ var r,a;r=this,a=function(e){var t=function(e){return new t.lib.init(e)};functio
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- */a.default.use(o.a);var _=new o.a.Store({state:{rules:[],scope:Object(c.loadState)("workflowengine","scope"),appstoreEnabled:Object(c.loadState)("workflowengine","appstoreenabled"),operations:Object(c.loadState)("workflowengine","operators"),plugins:a.default.observable({checks:{},operators:{}}),entities:Object(c.loadState)("workflowengine","entities"),events:Object(c.loadState)("workflowengine","entities").map((function(e){return e.events.map((function(t){return h({id:"".concat(e.id,"::").concat(t.eventName),entity:e},t)}))})).flat(),checks:Object(c.loadState)("workflowengine","checks")},mutations:{addRule:function(e,t){e.rules.push(h(h({},t),{},{valid:!0}))},updateRule:function(e,t){var n=e.rules.findIndex((function(e){return t.id===e.id})),r=Object.assign({},t);a.default.set(e.rules,n,r)},removeRule:function(e,t){var n=e.rules.findIndex((function(e){return t.id===e.id}));e.rules.splice(n,1)},addPluginCheck:function(e,t){a.default.set(e.plugins.checks,t.class,t)},addPluginOperator:function(e,t){t=Object.assign({color:"var(--color-primary-element)"},t,e.operations[t.id]||{}),void 0!==e.operations[t.id]&&a.default.set(e.operations,t.id,t)}},actions:{fetchRules:function(e){return f(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.a.get(d(""));case 2:n=t.sent,r=n.data,Object.values(r.ocs.data).flat().forEach((function(t){e.commit("addRule",t)}));case 5:case"end":return t.stop()}}),t)})))()},createNewRule:function(e,t){var n=null,r=[];!1===t.isComplex&&""===t.fixedEntity&&(r=[(n=(n=e.state.entities.find((function(e){return t.entities&&t.entities[0]===e.id})))||Object.values(e.state.entities)[0]).events[0].eventName]),e.commit("addRule",{id:-(new Date).getTime(),class:t.id,entity:n?n.id:t.fixedEntity,events:r,name:"",checks:[{class:null,operator:null,value:""}],operation:t.operation||""})},updateRule:function(e,t){e.commit("updateRule",h(h({},t),{},{events:"string"==typeof t.events?JSON.parse(t.events):t.events}))},removeRule:function(e,t){e.commit("removeRule",t)},pushUpdateRule:function(e,t){return f(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!==e.state.scope){n.next=3;break}return n.next=3,m()();case 3:if(!(t.id<0)){n.next=9;break}return n.next=6,s.a.post(d(""),t);case 6:r=n.sent,n.next=12;break;case 9:return n.next=11,s.a.put(d("/".concat(t.id)),t);case 11:r=n.sent;case 12:a.default.set(t,"id",r.data.ocs.data.id),e.commit("updateRule",t);case 14:case"end":return n.stop()}}),n)})))()},deleteRule:function(e,t){return f(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,m()();case 2:return n.next=4,s.a.delete(d("/".concat(t.id)));case 4:e.commit("removeRule",t);case 5:case"end":return n.stop()}}),n)})))()},setValid:function(e,t){var n=t.rule,r=t.valid;n.valid=r,e.commit("updateRule",n)}},getters:{getRules:function(e){return e.rules.filter((function(t){return void 0!==e.operations[t.class]})).sort((function(e,t){return e.id-t.id||t.class-e.class}))},getOperationForRule:function(e){return function(t){return e.operations[t.class]}},getEntityForOperation:function(e){return function(t){return e.entities.find((function(e){return t.fixedEntity===e.id}))}},getEventsForOperation:function(e){return function(t){return e.events}},getChecksForEntity:function(e){return function(t){return Object.values(e.checks).filter((function(e){return e.supportedEntities.indexOf(t)>-1||0===e.supportedEntities.length})).map((function(t){return e.plugins.checks[t.id]})).reduce((function(e,t){return e[t.class]=t,e}),{})}}}}),b=r(344),v=r.n(b),y=r(85),L=r.n(y),T=r(86),w=r.n(T),z=r(9),O=r.n(z),x=r(346),k={name:"Event",components:{Multiselect:O.a},props:{rule:{type:Object,required:!0}},computed:{entity:function(){return this.$store.getters.getEntityForOperation(this.operation)},operation:function(){return this.$store.getters.getOperationForRule(this.rule)},allEvents:function(){return this.$store.getters.getEventsForOperation(this.operation)},currentEvent:function(){var e=this;return this.allEvents.filter((function(t){return t.entity.id===e.rule.entity&&-1!==e.rule.events.indexOf(t.eventName)}))}},methods:{updateEvent:function(e){if(0!==e.length){var n=this.rule.entity,r=e.map((function(e){return e.entity.id})).filter((function(e,t,n){return n.indexOf(e)===t})),a=null;a=r.length>1?r.filter((function(e){return e!==n}))[0]:r[0],this.$set(this.rule,"entity",a),this.$set(this.rule,"events",e.filter((function(e){return e.entity.id===a})).map((function(e){return e.eventName}))),this.$emit("update",this.rule)}else Object(x.showWarning)(t("workflowengine","At least one event must be selected"))}}};r(475);function N(e,t,n,r,a,o,i,s){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},l._ssrRegister=c):a&&(c=s?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}var S=N(k,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"event"},[e.operation.isComplex&&""!==e.operation.fixedEntity?n("div",{staticClass:"isComplex"},[n("img",{staticClass:"option__icon",attrs:{src:e.entity.icon}}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(e.operation.triggerHint))])]):n("Multiselect",{attrs:{value:e.currentEvent,options:e.allEvents,"track-by":"id",multiple:!0,"auto-limit":!1,disabled:e.allEvents.length<=1},on:{input:e.updateEvent},scopedSlots:e._u([{key:"selection",fn:function(t){var r=t.values,a=(t.search,t.isOpen);return[r.length&&!a?n("div",{staticClass:"eventlist"},[n("img",{staticClass:"option__icon",attrs:{src:r[0].entity.icon}}),e._v(" "),e._l(r,(function(t,a){return n("span",{key:t.id,staticClass:"text option__title option__title_single"},[e._v(e._s(t.displayName)+" "),a+1<r.length?n("span",[e._v(", ")]):e._e()])}))],2):e._e()]}},{key:"option",fn:function(t){return[n("img",{staticClass:"option__icon",attrs:{src:t.option.entity.icon}}),e._v(" "),n("span",{staticClass:"option__title"},[e._v(e._s(t.option.displayName))])]}}])})],1)}),[],!1,null,"4189d537",null).exports,E=r(347),D=r.n(E),Y={name:"Check",components:{ActionButton:w.a,Actions:L.a,Multiselect:O.a},directives:{ClickOutside:D.a},props:{check:{type:Object,required:!0},rule:{type:Object,required:!0}},data:function(){return{deleteVisible:!1,currentOption:null,currentOperator:null,options:[],valid:!1}},computed:{checks:function(){return this.$store.getters.getChecksForEntity(this.rule.entity)},operators:function(){if(!this.currentOption)return[];var e=this.checks[this.currentOption.class].operators;return"function"==typeof e?e(this.check):e},currentComponent:function(){return this.currentOption?this.checks[this.currentOption.class].component:[]},valuePlaceholder:function(){return this.currentOption&&this.currentOption.placeholder?this.currentOption.placeholder(this.check):""}},watch:{"check.operator":function(){this.validate()}},mounted:function(){var e=this;this.options=Object.values(this.checks),this.currentOption=this.checks[this.check.class],this.currentOperator=this.operators.find((function(t){return t.operator===e.check.operator})),null===this.check.class&&this.$nextTick((function(){return e.$refs.checkSelector.$el.focus()})),this.validate()},methods:{showDelete:function(){this.deleteVisible=!0},hideDelete:function(){this.deleteVisible=!1},validate:function(){this.valid=!0,this.currentOption&&this.currentOption.validate&&(this.valid=!!this.currentOption.validate(this.check)),this.check.invalid=!this.valid,this.$emit("validate",this.valid)},updateCheck:function(){var e=this,t=this.operators.findIndex((function(t){return e.check.operator===t.operator}));this.check.class===this.currentOption.class&&-1!==t||(this.currentOperator=this.operators[0]),this.check.class=this.currentOption.class,this.check.operator=this.currentOperator.operator,this.validate(),this.$emit("update",this.check)}}},C=(r(477),N(Y,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideDelete,expression:"hideDelete"}],staticClass:"check",on:{click:e.showDelete}},[n("Multiselect",{ref:"checkSelector",attrs:{options:e.options,label:"name","track-by":"class","allow-empty":!1,placeholder:e.t("workflowengine","Select a filter")},on:{input:e.updateCheck},model:{value:e.currentOption,callback:function(t){e.currentOption=t},expression:"currentOption"}}),e._v(" "),n("Multiselect",{staticClass:"comparator",attrs:{disabled:!e.currentOption,options:e.operators,label:"name","track-by":"operator","allow-empty":!1,placeholder:e.t("workflowengine","Select a comparator")},on:{input:e.updateCheck},model:{value:e.currentOperator,callback:function(t){e.currentOperator=t},expression:"currentOperator"}}),e._v(" "),e.currentOperator&&e.currentComponent?n(e.currentOption.component,{tag:"component",staticClass:"option",attrs:{disabled:!e.currentOption,check:e.check},on:{input:e.updateCheck,valid:function(t){(e.valid=!0)&&e.validate()},invalid:function(t){!(e.valid=!1)&&e.validate()}},model:{value:e.check.value,callback:function(t){e.$set(e.check,"value",t)},expression:"check.value"}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.check.value,expression:"check.value"}],staticClass:"option",class:{invalid:!e.valid},attrs:{type:"text",disabled:!e.currentOption,placeholder:e.valuePlaceholder},domProps:{value:e.check.value},on:{input:[function(t){t.target.composing||e.$set(e.check,"value",t.target.value)},e.updateCheck]}}),e._v(" "),e.deleteVisible||!e.currentOption?n("Actions",[n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return e.$emit("remove")}}})],1):e._e()],1)}),[],!1,null,"f4da0348",null).exports),B={name:"Operation",props:{operation:{type:Object,required:!0},colored:{type:Boolean,default:!0}}},W=(r(479),N(B,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"actions__item",class:{colored:e.colored},style:{backgroundColor:e.colored?e.operation.color:"transparent"}},[n("div",{staticClass:"icon",class:e.operation.iconClass,style:{backgroundImage:e.operation.iconClass?"":"url("+e.operation.icon+")"}}),e._v(" "),n("div",{staticClass:"actions__item__description"},[n("h3",[e._v(e._s(e.operation.name))]),e._v(" "),n("small",[e._v(e._s(e.operation.description))]),e._v(" "),n("div",[e.colored?n("button",[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Add new flow"))+"\n\t\t\t")]):e._e()])]),e._v(" "),n("div",{staticClass:"actions__item_options"},[e._t("default")],2)])}),[],!1,null,"34495584",null).exports);function q(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}function P(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){q(o,r,a,i,s,"next",e)}function s(e){q(o,r,a,i,s,"throw",e)}i(void 0)}))}}var j={name:"Rule",components:{Operation:W,Check:C,Event:S,Actions:L.a,ActionButton:w.a},directives:{Tooltip:v.a},props:{rule:{type:Object,required:!0}},data:function(){return{editing:!1,checks:[],error:null,dirty:this.rule.id<0,originalRule:null}},computed:{operation:function(){return this.$store.getters.getOperationForRule(this.rule)},ruleStatus:function(){return this.error||!this.rule.valid||0===this.rule.checks.length||this.rule.checks.some((function(e){return!0===e.invalid}))?{title:t("workflowengine","The configuration is invalid"),class:"icon-close-white invalid",tooltip:{placement:"bottom",show:!0,content:this.error}}:this.dirty?{title:t("workflowengine","Save"),class:"icon-confirm-white primary"}:{title:t("workflowengine","Active"),class:"icon icon-checkmark"}},lastCheckComplete:function(){var e=this.rule.checks[this.rule.checks.length-1];return void 0===e||null!==e.class}},mounted:function(){this.originalRule=JSON.parse(JSON.stringify(this.rule))},methods:{updateOperation:function(e){var t=this;return P(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.$set(t.rule,"operation",e),n.next=3,t.updateRule();case 3:case"end":return n.stop()}}),n)})))()},validate:function(e){this.error=null,this.$store.dispatch("updateRule",this.rule)},updateRule:function(){this.dirty||(this.dirty=!0),this.error=null,this.$store.dispatch("updateRule",this.rule)},saveRule:function(){var e=this;return P(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$store.dispatch("pushUpdateRule",e.rule);case 3:e.dirty=!1,e.error=null,e.originalRule=JSON.parse(JSON.stringify(e.rule)),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(0),console.error("Failed to save operation"),e.error=t.t0.response.data.ocs.meta.message;case 12:case"end":return t.stop()}}),t,null,[[0,8]])})))()},deleteRule:function(){var e=this;return P(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$store.dispatch("deleteRule",e.rule);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),console.error("Failed to delete operation"),e.error=t.t0.response.data.ocs.meta.message;case 9:case"end":return t.stop()}}),t,null,[[0,5]])})))()},cancelRule:function(){this.rule.id<0?this.$store.dispatch("removeRule",this.rule):(this.$store.dispatch("updateRule",this.originalRule),this.originalRule=JSON.parse(JSON.stringify(this.rule)),this.dirty=!1)},removeCheck:function(e){var t=this;return P(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:(r=t.rule.checks.findIndex((function(t){return t===e})))>-1&&t.$delete(t.rule.checks,r),t.$store.dispatch("updateRule",t.rule);case 3:case"end":return n.stop()}}),n)})))()}}},I=(r(481),N(j,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.operation?n("div",{staticClass:"section rule",style:{borderLeftColor:e.operation.color||""}},[n("div",{staticClass:"trigger"},[n("p",[n("span",[e._v(e._s(e.t("workflowengine","When")))]),e._v(" "),n("Event",{attrs:{rule:e.rule},on:{update:e.updateRule}})],1),e._v(" "),e._l(e.rule.checks,(function(t,r){return n("p",{key:r},[n("span",[e._v(e._s(e.t("workflowengine","and")))]),e._v(" "),n("Check",{attrs:{check:t,rule:e.rule},on:{update:e.updateRule,validate:e.validate,remove:function(n){return e.removeCheck(t)}}})],1)})),e._v(" "),n("p",[n("span"),e._v(" "),e.lastCheckComplete?n("input",{staticClass:"check--add",attrs:{type:"button",value:"Add a new filter"},on:{click:function(t){return e.rule.checks.push({class:null,operator:null,value:""})}}}):e._e()])],2),e._v(" "),n("div",{staticClass:"flow-icon icon-confirm"}),e._v(" "),n("div",{staticClass:"action"},[n("Operation",{attrs:{operation:e.operation,colored:!1}},[e.operation.options?n(e.operation.options,{tag:"component",on:{input:e.updateOperation},model:{value:e.rule.operation,callback:function(t){e.$set(e.rule,"operation",t)},expression:"rule.operation"}}):e._e()],1),e._v(" "),n("div",{staticClass:"buttons"},[n("button",{staticClass:"status-button icon",class:e.ruleStatus.class,on:{click:e.saveRule}},[e._v("\n\t\t\t\t"+e._s(e.ruleStatus.title)+"\n\t\t\t")]),e._v(" "),e.rule.id<-1||e.dirty?n("button",{on:{click:e.cancelRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Cancel"))+"\n\t\t\t")]):e.dirty?e._e():n("button",{on:{click:e.deleteRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Delete"))+"\n\t\t\t")])]),e._v(" "),e.error?n("p",{staticClass:"error-message"},[e._v("\n\t\t\t"+e._s(e.error)+"\n\t\t")]):e._e()],1)]):e._e()}),[],!1,null,"1680636e",null).exports);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F={name:"Workflow",components:{Operation:W,Rule:I},data:function(){return{showMoreOperations:!1,appstoreUrl:Object(l.generateUrl)("settings/apps/workflow")}},computed:X(X(X({},Object(o.b)({rules:"getRules"})),Object(o.c)({appstoreEnabled:"appstoreEnabled",scope:"scope",operations:"operations"})),{},{hasMoreOperations:function(){return Object.keys(this.operations).length>3},getMainOperations:function(){return this.showMoreOperations?Object.values(this.operations):Object.values(this.operations).slice(0,3)},showAppStoreHint:function(){return 0===this.scope&&this.appstoreEnabled&&OC.isUserAdmin()}}),mounted:function(){this.$store.dispatch("fetchRules")},methods:{createNewRule:function(e){this.$store.dispatch("createNewRule",e)}}},U=(r(483),N(F,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"workflowengine"}},[n("div",{staticClass:"section"},[n("h2",[e._v(e._s(e.t("workflowengine","Available flows")))]),e._v(" "),0===e.scope?n("p",{staticClass:"settings-hint"},[n("a",{attrs:{href:"https://nextcloud.com/developer/"}},[e._v(e._s(e.t("workflowengine","For details on how to write your own flow, check out the development documentation.")))])]):e._e(),e._v(" "),n("transition-group",{staticClass:"actions",attrs:{name:"slide",tag:"div"}},[e._l(e.getMainOperations,(function(t){return n("Operation",{key:t.id,attrs:{operation:t},nativeOn:{click:function(n){return e.createNewRule(t)}}})})),e._v(" "),e.showAppStoreHint?n("a",{key:"add",staticClass:"actions__item colored more",attrs:{href:e.appstoreUrl}},[n("div",{staticClass:"icon icon-add"}),e._v(" "),n("div",{staticClass:"actions__item__description"},[n("h3",[e._v(e._s(e.t("workflowengine","More flows")))]),e._v(" "),n("small",[e._v(e._s(e.t("workflowengine","Browse the app store")))])])]):e._e()],2),e._v(" "),e.hasMoreOperations?n("div",{staticClass:"actions__more"},[n("button",{staticClass:"icon",class:e.showMoreOperations?"icon-triangle-n":"icon-triangle-s",on:{click:function(t){e.showMoreOperations=!e.showMoreOperations}}},[e._v("\n\t\t\t\t"+e._s(e.showMoreOperations?e.t("workflowengine","Show less"):e.t("workflowengine","Show more"))+"\n\t\t\t")])]):e._e(),e._v(" "),0===e.scope?n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Configured flows"))+"\n\t\t")]):n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Your flows"))+"\n\t\t")])],1),e._v(" "),e.rules.length>0?n("transition-group",{attrs:{name:"slide"}},e._l(e.rules,(function(e){return n("Rule",{key:e.id,attrs:{rule:e}})})),1):e._e()],1)}),[],!1,null,"7000c295",null).exports),G=/^\/(.*)\/([gui]{0,3})$/,Q=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/,J={props:{value:{type:String,default:""},check:{type:Object,default:function(){return{}}}},data:function(){return{newValue:""}},watch:{value:{immediate:!0,handler:function(e){this.updateInternalValue(e)}}},methods:{updateInternalValue:function(e){this.newValue=e}}};function $(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Z={name:"FileMimeType",components:{Multiselect:O.a},mixins:[J],data:function(){return{predefinedTypes:[{icon:"icon-folder",label:t("workflowengine","Folder"),pattern:"httpd/unix-directory"},{icon:"icon-picture",label:t("workflowengine","Images"),pattern:"/image\\/.*/"},{iconUrl:Object(l.imagePath)("core","filetypes/x-office-document"),label:t("workflowengine","Office documents"),pattern:"/(vnd\\.(ms-|openxmlformats-).*)$/"},{iconUrl:Object(l.imagePath)("core","filetypes/application-pdf"),label:t("workflowengine","PDF documents"),pattern:"application/pdf"}]}},computed:{options:function(){return[].concat($(this.predefinedTypes),[this.customValue])},isPredefined:function(){var e=this;return!!this.predefinedTypes.find((function(t){return e.newValue===t.pattern}))},customValue:function(){return{icon:"icon-settings-dark",label:t("workflowengine","Custom mimetype"),pattern:""}},currentValue:function(){var e=this,n=this.predefinedTypes.find((function(t){return e.newValue===t.pattern}));return n||{icon:"icon-settings-dark",label:t("workflowengine","Custom mimetype"),pattern:this.newValue}}},methods:{validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)},setValue:function(e){null!==e&&(this.newValue=e.pattern,this.$emit("input",this.newValue))},updateCustom:function(e){this.newValue=e.target.value,this.$emit("input",this.newValue)}}},ee=(r(485),N(Z,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,placeholder:e.t("workflowengine","Select a file type"),label:"label","track-by":"pattern",options:e.options,multiple:!1,tagging:!1},on:{input:e.setValue},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[t.option.icon?n("span",{staticClass:"option__icon",class:t.option.icon}):n("img",{attrs:{src:t.option.iconUrl}}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(t.option.label))])]}},{key:"option",fn:function(t){return[t.option.icon?n("span",{staticClass:"option__icon",class:t.option.icon}):n("img",{attrs:{src:t.option.iconUrl}}),e._v(" "),n("span",{staticClass:"option__title"},[e._v(e._s(t.option.label))])]}}])}),e._v(" "),e.isPredefined?e._e():n("input",{attrs:{type:"text",placeholder:e.t("workflowengine","e.g. httpd/unix-directory")},domProps:{value:e.currentValue.pattern},on:{input:e.updateCustom}})],1)}),[],!1,null,"bee9d4fe",null).exports),te=function(e){var t=function e(t){var n={};if(1===t.nodeType){if(t.attributes.length>0){n["@attributes"]={};for(var r=0;r<t.attributes.length;r++){var a=t.attributes.item(r);n["@attributes"][a.nodeName]=a.nodeValue}}}else 3===t.nodeType&&(n=t.nodeValue);if(t.hasChildNodes())for(var o=0;o<t.childNodes.length;o++){var i=t.childNodes.item(o),s=i.nodeName;if(void 0===n[s])n[s]=e(i);else{if(void 0===n[s].push){var c=n[s];n[s]=[],n[s].push(c)}n[s].push(e(i))}}return n}(function(e){var t=null;try{t=(new DOMParser).parseFromString(e,"text/xml")}catch(e){console.error("Failed to parse xml document",e)}return t}(e))["d:multistatus"]["d:response"],n=[];for(var r in t){var a=t[r]["d:propstat"];"HTTP/1.1 200 OK"===a["d:status"]["#text"]&&n.push({id:a["d:prop"]["oc:id"]["#text"],displayName:a["d:prop"]["oc:display-name"]["#text"],canAssign:"true"===a["d:prop"]["oc:can-assign"]["#text"],userAssignable:"true"===a["d:prop"]["oc:user-assignable"]["#text"],userVisible:"true"===a["d:prop"]["oc:user-visible"]["#text"]})}return n},ne=0,re=N({name:"MultiselectTag",components:{Multiselect:O.a},props:{label:{type:String,required:!0},value:{type:[String,Array],default:null},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1}},data:function(){return{inputValObjects:[],tags:[]}},computed:{id:function(){return"settings-input-text-"+this.uuid}},watch:{value:function(e){this.inputValObjects=this.getValueObject()}},beforeCreate:function(){var e=this;this.uuid=ne.toString(),ne+=1,s()({method:"PROPFIND",url:Object(l.generateRemoteUrl)("dav")+"/systemtags/",data:'<?xml version="1.0"?>\n\t\t\t\t\t<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t\t\t\t\t <d:prop>\n\t\t\t\t\t\t<oc:id />\n\t\t\t\t\t\t<oc:display-name />\n\t\t\t\t\t\t<oc:user-visible />\n\t\t\t\t\t\t<oc:user-assignable />\n\t\t\t\t\t\t<oc:can-assign />\n\t\t\t\t\t </d:prop>\n\t\t\t\t\t</d:propfind>'}).then((function(e){return te(e.data)})).then((function(t){e.tags=t,e.inputValObjects=e.getValueObject()})).catch(console.error.bind(this))},methods:{getValueObject:function(){var e=this;return 0===this.tags.length?[]:this.multiple?this.value.filter((function(e){return""!==e})).map((function(t){return e.tags.find((function(e){return e.id===t}))})):this.tags.find((function(t){return t.id===e.value}))},update:function(){this.multiple?this.$emit("input",this.inputValObjects.map((function(e){return e.id}))):null===this.inputValObjects?this.$emit("input",""):this.$emit("input",this.inputValObjects.id)},tagLabel:function(e){var n=e.displayName,r=e.userVisible,a=e.userAssignable;return!1===r?t("systemtags","%s (invisible)").replace("%s",n):!1===a?t("systemtags","%s (restricted)").replace("%s",n):n}}},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Multiselect",{staticClass:"multiselect-vue",attrs:{options:e.tags,"options-limit":5,placeholder:e.label,"track-by":"id","custom-label":e.tagLabel,multiple:e.multiple,"close-on-select":!1,"tag-width":60,disabled:e.disabled},on:{input:e.update},scopedSlots:e._u([{key:"option",fn:function(t){return[e._v("\n\t\t"+e._s(e.tagLabel(t.option))+"\n\t")]}}]),model:{value:e.inputValObjects,callback:function(t){e.inputValObjects=t},expression:"inputValObjects"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("core","No results")))])])}),[],!1,null,null,null).exports,ae=N({name:"FileSystemTag",components:{MultiselectTag:re},props:{value:{type:String,default:""}},data:function(){return{newValue:[]}},watch:{value:function(){this.updateValue()}},beforeMount:function(){this.updateValue()},methods:{updateValue:function(){""!==this.value?this.newValue=this.value:this.newValue=null},update:function(){this.$emit("input",this.newValue||"")}}},(function(){var e=this,t=e.$createElement;return(e._self._c||t)("MultiselectTag",{attrs:{multiple:!1,label:e.t("workflowengine","Select a tag")},on:{input:e.update},model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}})}),[],!1,null,"31f5522d",null).exports,oe=function(e){return e.value.startsWith("/")?[{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")}]},ie=[{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:oe,placeholder:function(e){return"matches"===e.operator||"!matches"===e.operator?"/^dummy-.+$/i":"filename.txt"},validate:function(e){return"matches"!==e.operator&&"!matches"!==e.operator||!!(t=e.value)&&null!==G.exec(t);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:oe,component:ee},{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}],placeholder:function(e){return"5 MB"},validate:function(e){return!!e.value&&null!==e.value.match(/^[0-9]+[ ]?[kmgt]?b$/i)}},{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}],placeholder:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?"::1/128":"127.0.0.1/32"},validate:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?!!(t=e.value)&&null!==V.exec(t):function(e){return!!e&&null!==Q.exec(e)}(e.value);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}],component:ae}];function se(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var le={name:"RequestUserAgent",components:{Multiselect:O.a},mixins:[J],data:function(){return{newValue:"",predefinedTypes:[{pattern:"android",label:t("workflowengine","Android client"),icon:"icon-phone"},{pattern:"ios",label:t("workflowengine","iOS client"),icon:"icon-phone"},{pattern:"desktop",label:t("workflowengine","Desktop client"),icon:"icon-desktop"},{pattern:"mail",label:t("workflowengine","Thunderbird & Outlook addons"),icon:"icon-mail"}]}},computed:{options:function(){return[].concat(se(this.predefinedTypes),[this.customValue])},matchingPredefined:function(){var e=this;return this.predefinedTypes.find((function(t){return e.newValue===t.pattern}))},isPredefined:function(){return!!this.matchingPredefined},customValue:function(){return{icon:"icon-settings-dark",label:t("workflowengine","Custom user agent"),pattern:""}},currentValue:function(){return this.matchingPredefined?this.matchingPredefined:{icon:"icon-settings-dark",label:t("workflowengine","Custom user agent"),pattern:this.newValue}}},methods:{validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)},setValue:function(e){null!==e&&(this.newValue=e.pattern,this.$emit("input",this.newValue))},updateCustom:function(e){this.newValue=e.target.value,this.$emit("input",this.newValue)}}},ue=(r(487),N(le,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,placeholder:e.t("workflowengine","Select a user agent"),label:"label","track-by":"pattern",options:e.options,multiple:!1,tagging:!1},on:{input:e.setValue},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),n("span",{staticClass:"option__title option__title_single",domProps:{innerHTML:e._s(t.option.label)}})]}},{key:"option",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),t.option.$groupLabel?n("span",{staticClass:"option__title",domProps:{innerHTML:e._s(t.option.$groupLabel)}}):n("span",{staticClass:"option__title",domProps:{innerHTML:e._s(t.option.label)}})]}}])}),e._v(" "),e.isPredefined?e._e():n("input",{attrs:{type:"text"},domProps:{value:e.currentValue.pattern},on:{input:e.updateCustom}})],1)}),[],!1,null,"1f573f40",null).exports),de=r(57),pe=r.n(de),me=pe.a.tz.names(),Ae={name:"RequestTime",components:{Multiselect:O.a},mixins:[J],props:{value:{type:String,default:""}},data:function(){return{timezones:me,valid:!1,newValue:{startTime:null,endTime:null,timezone:pe.a.tz.guess()}}},mounted:function(){this.validate()},methods:{updateInternalValue:function(e){try{var t=JSON.parse(e);2===t.length&&(this.newValue={startTime:t[0].split(" ",2)[0],endTime:t[1].split(" ",2)[0],timezone:t[0].split(" ",2)[1]})}catch(e){}},validate:function(){return this.valid=this.newValue.startTime&&null!==this.newValue.startTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i)&&this.newValue.endTime&&null!==this.newValue.endTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i)&&null!==pe.a.tz.zone(this.newValue.timezone),this.valid?this.$emit("valid"):this.$emit("invalid"),this.valid},update:function(){if(null===this.newValue.timezone&&(this.newValue.timezone=pe.a.tz.guess()),this.validate()){var e='["'.concat(this.newValue.startTime," ").concat(this.newValue.timezone,'","').concat(this.newValue.endTime," ").concat(this.newValue.timezone,'"]');this.$emit("input",e)}}}},fe=(r(493),N(Ae,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"timeslot"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newValue.startTime,expression:"newValue.startTime"}],staticClass:"timeslot--start",attrs:{type:"text",placeholder:"e.g. 08:00"},domProps:{value:e.newValue.startTime},on:{input:[function(t){t.target.composing||e.$set(e.newValue,"startTime",t.target.value)},e.update]}}),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.newValue.endTime,expression:"newValue.endTime"}],attrs:{type:"text",placeholder:"e.g. 18:00"},domProps:{value:e.newValue.endTime},on:{input:[function(t){t.target.composing||e.$set(e.newValue,"endTime",t.target.value)},e.update]}}),e._v(" "),e.valid?e._e():n("p",{staticClass:"invalid-hint"},[e._v("\n\t\t"+e._s(e.t("workflowengine","Please enter a valid time span"))+"\n\t")]),e._v(" "),n("Multiselect",{directives:[{name:"show",rawName:"v-show",value:e.valid,expression:"valid"}],attrs:{options:e.timezones},on:{input:e.update},model:{value:e.newValue.timezone,callback:function(t){e.$set(e.newValue,"timezone",t)},expression:"newValue.timezone"}})],1)}),[],!1,null,"149baca9",null).exports);function Me(e){return function(e){if(Array.isArray(e))return he(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ge={name:"RequestURL",components:{Multiselect:O.a},mixins:[J],data:function(){return{newValue:"",predefinedTypes:[{label:t("workflowengine","Predefined URLs"),children:[{pattern:"webdav",label:t("workflowengine","Files WebDAV")}]}]}},computed:{options:function(){return[].concat(Me(this.predefinedTypes),[this.customValue])},placeholder:function(){return"matches"===this.check.operator||"!matches"===this.check.operator?"/^https\\:\\/\\/localhost\\/index\\.php$/i":"https://localhost/index.php"},matchingPredefined:function(){var e=this;return this.predefinedTypes.map((function(e){return e.children})).flat().find((function(t){return e.newValue===t.pattern}))},isPredefined:function(){return!!this.matchingPredefined},customValue:function(){return{label:t("workflowengine","Others"),children:[{icon:"icon-settings-dark",label:t("workflowengine","Custom URL"),pattern:""}]}},currentValue:function(){return this.matchingPredefined?this.matchingPredefined:{icon:"icon-settings-dark",label:t("workflowengine","Custom URL"),pattern:this.newValue}}},methods:{validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)},setValue:function(e){null!==e&&(this.newValue=e.pattern,this.$emit("input",this.newValue))},updateCustom:function(e){this.newValue=e.target.value,this.$emit("input",this.newValue)}}},_e=(r(495),N(ge,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,placeholder:e.t("workflowengine","Select a request URL"),label:"label","track-by":"pattern","group-values":"children","group-label":"label",options:e.options,multiple:!1,tagging:!1},on:{input:e.setValue},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(t.option.label))])]}},{key:"option",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),n("span",{staticClass:"option__title"},[e._v(e._s(t.option.label)+" "+e._s(t.option.$groupLabel))])]}}])}),e._v(" "),e.isPredefined?e._e():n("input",{attrs:{type:"text",placeholder:e.placeholder},domProps:{value:e.currentValue.pattern},on:{input:e.updateCustom}})],1)}),[],!1,null,"0b72cbf8",null).exports);function be(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}var ve=[],ye={isLoading:!1},Le={name:"RequestUserGroup",components:{Multiselect:O.a},props:{value:{type:String,default:""},check:{type:Object,default:function(){return{}}}},data:function(){return{groups:ve,status:ye}},computed:{currentValue:function(){var e=this;return this.groups.find((function(t){return t.id===e.value}))||null}},mounted:function(){var e,t=this;return(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.groups.length){e.next=3;break}return e.next=3,t.searchAsync("");case 3:if(null!==t.currentValue){e.next=6;break}return e.next=6,t.searchAsync(t.value);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){be(o,r,a,i,s,"next",e)}function s(e){be(o,r,a,i,s,"throw",e)}i(void 0)}))})()},methods:{searchAsync:function(e){var t=this;if(!this.status.isLoading)return this.status.isLoading=!0,s.a.get(Object(l.generateOcsUrl)("cloud",2)+"groups?limit=20&search="+encodeURI(e)).then((function(e){e.data.ocs.data.groups.reduce((function(e,t){return e.push({id:t,displayname:t}),e}),[]).forEach((function(e){return t.addGroup(e)})),t.status.isLoading=!1}),(function(e){console.error("Error while loading group list",e.response)}))},addGroup:function(e){-1===this.groups.findIndex((function(t){return t.id===e.id}))&&this.groups.push(e)}}},Te=(r(497),N(Le,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,loading:e.status.isLoading&&0===e.groups.length,options:e.groups,multiple:!1,label:"displayname","track-by":"id"},on:{"search-change":e.searchAsync,input:function(t){return e.$emit("input",t.id)}}})],1)}),[],!1,null,"0e9e1554",null).exports),we=[{class:"OCA\\WorkflowEngine\\Check\\RequestURL",name:t("workflowengine","Request URL"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}],component:_e},{class:"OCA\\WorkflowEngine\\Check\\RequestTime",name:t("workflowengine","Request time"),operators:[{operator:"in",name:t("workflowengine","between")},{operator:"!in",name:t("workflowengine","not between")}],component:fe},{class:"OCA\\WorkflowEngine\\Check\\RequestUserAgent",name:t("workflowengine","Request user agent"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}],component:ue},{class:"OCA\\WorkflowEngine\\Check\\UserGroupMembership",name:t("workflowengine","User group membership"),operators:[{operator:"is",name:t("workflowengine","is member of")},{operator:"!is",name:t("workflowengine","is not member of")}],component:Te}];function ze(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
+ */a.default.use(o.a);var _=new o.a.Store({state:{rules:[],scope:Object(c.loadState)("workflowengine","scope"),appstoreEnabled:Object(c.loadState)("workflowengine","appstoreenabled"),operations:Object(c.loadState)("workflowengine","operators"),plugins:a.default.observable({checks:{},operators:{}}),entities:Object(c.loadState)("workflowengine","entities"),events:Object(c.loadState)("workflowengine","entities").map((function(e){return e.events.map((function(t){return h({id:"".concat(e.id,"::").concat(t.eventName),entity:e},t)}))})).flat(),checks:Object(c.loadState)("workflowengine","checks")},mutations:{addRule:function(e,t){e.rules.push(h(h({},t),{},{valid:!0}))},updateRule:function(e,t){var n=e.rules.findIndex((function(e){return t.id===e.id})),r=Object.assign({},t);a.default.set(e.rules,n,r)},removeRule:function(e,t){var n=e.rules.findIndex((function(e){return t.id===e.id}));e.rules.splice(n,1)},addPluginCheck:function(e,t){a.default.set(e.plugins.checks,t.class,t)},addPluginOperator:function(e,t){t=Object.assign({color:"var(--color-primary-element)"},t,e.operations[t.id]||{}),void 0!==e.operations[t.id]&&a.default.set(e.operations,t.id,t)}},actions:{fetchRules:function(e){return f(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,s.a.get(d(""));case 2:n=t.sent,r=n.data,Object.values(r.ocs.data).flat().forEach((function(t){e.commit("addRule",t)}));case 5:case"end":return t.stop()}}),t)})))()},createNewRule:function(e,t){var n=null,r=[];!1===t.isComplex&&""===t.fixedEntity&&(r=[(n=(n=e.state.entities.find((function(e){return t.entities&&t.entities[0]===e.id})))||Object.values(e.state.entities)[0]).events[0].eventName]),e.commit("addRule",{id:-(new Date).getTime(),class:t.id,entity:n?n.id:t.fixedEntity,events:r,name:"",checks:[{class:null,operator:null,value:""}],operation:t.operation||""})},updateRule:function(e,t){e.commit("updateRule",h(h({},t),{},{events:"string"==typeof t.events?JSON.parse(t.events):t.events}))},removeRule:function(e,t){e.commit("removeRule",t)},pushUpdateRule:function(e,t){return f(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(0!==e.state.scope){n.next=3;break}return n.next=3,m()();case 3:if(!(t.id<0)){n.next=9;break}return n.next=6,s.a.post(d(""),t);case 6:r=n.sent,n.next=12;break;case 9:return n.next=11,s.a.put(d("/".concat(t.id)),t);case 11:r=n.sent;case 12:a.default.set(t,"id",r.data.ocs.data.id),e.commit("updateRule",t);case 14:case"end":return n.stop()}}),n)})))()},deleteRule:function(e,t){return f(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,m()();case 2:return n.next=4,s.a.delete(d("/".concat(t.id)));case 4:e.commit("removeRule",t);case 5:case"end":return n.stop()}}),n)})))()},setValid:function(e,t){var n=t.rule,r=t.valid;n.valid=r,e.commit("updateRule",n)}},getters:{getRules:function(e){return e.rules.filter((function(t){return void 0!==e.operations[t.class]})).sort((function(e,t){return e.id-t.id||t.class-e.class}))},getOperationForRule:function(e){return function(t){return e.operations[t.class]}},getEntityForOperation:function(e){return function(t){return e.entities.find((function(e){return t.fixedEntity===e.id}))}},getEventsForOperation:function(e){return function(t){return e.events}},getChecksForEntity:function(e){return function(t){return Object.values(e.checks).filter((function(e){return e.supportedEntities.indexOf(t)>-1||0===e.supportedEntities.length})).map((function(t){return e.plugins.checks[t.id]})).reduce((function(e,t){return e[t.class]=t,e}),{})}}}}),b=r(344),v=r.n(b),y=r(85),L=r.n(y),T=r(86),w=r.n(T),z=r(9),O=r.n(z),x=r(346),k={name:"Event",components:{Multiselect:O.a},props:{rule:{type:Object,required:!0}},computed:{entity:function(){return this.$store.getters.getEntityForOperation(this.operation)},operation:function(){return this.$store.getters.getOperationForRule(this.rule)},allEvents:function(){return this.$store.getters.getEventsForOperation(this.operation)},currentEvent:function(){var e=this;return this.allEvents.filter((function(t){return t.entity.id===e.rule.entity&&-1!==e.rule.events.indexOf(t.eventName)}))}},methods:{updateEvent:function(e){if(0!==e.length){var n=this.rule.entity,r=e.map((function(e){return e.entity.id})).filter((function(e,t,n){return n.indexOf(e)===t})),a=null;a=r.length>1?r.filter((function(e){return e!==n}))[0]:r[0],this.$set(this.rule,"entity",a),this.$set(this.rule,"events",e.filter((function(e){return e.entity.id===a})).map((function(e){return e.eventName}))),this.$emit("update",this.rule)}else Object(x.showWarning)(t("workflowengine","At least one event must be selected"))}}};r(475);function N(e,t,n,r,a,o,i,s){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),r&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},l._ssrRegister=c):a&&(c=s?function(){a.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:a),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(e,t){return c.call(t),u(e,t)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:l}}var S=N(k,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"event"},[e.operation.isComplex&&""!==e.operation.fixedEntity?n("div",{staticClass:"isComplex"},[n("img",{staticClass:"option__icon",attrs:{src:e.entity.icon}}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(e.operation.triggerHint))])]):n("Multiselect",{attrs:{value:e.currentEvent,options:e.allEvents,"track-by":"id",multiple:!0,"auto-limit":!1,disabled:e.allEvents.length<=1},on:{input:e.updateEvent},scopedSlots:e._u([{key:"selection",fn:function(t){var r=t.values,a=(t.search,t.isOpen);return[r.length&&!a?n("div",{staticClass:"eventlist"},[n("img",{staticClass:"option__icon",attrs:{src:r[0].entity.icon}}),e._v(" "),e._l(r,(function(t,a){return n("span",{key:t.id,staticClass:"text option__title option__title_single"},[e._v(e._s(t.displayName)+" "),a+1<r.length?n("span",[e._v(", ")]):e._e()])}))],2):e._e()]}},{key:"option",fn:function(t){return[n("img",{staticClass:"option__icon",attrs:{src:t.option.entity.icon}}),e._v(" "),n("span",{staticClass:"option__title"},[e._v(e._s(t.option.displayName))])]}}])})],1)}),[],!1,null,"4189d537",null).exports,E=r(347),D=r.n(E),Y={name:"Check",components:{ActionButton:w.a,Actions:L.a,Multiselect:O.a},directives:{ClickOutside:D.a},props:{check:{type:Object,required:!0},rule:{type:Object,required:!0}},data:function(){return{deleteVisible:!1,currentOption:null,currentOperator:null,options:[],valid:!1}},computed:{checks:function(){return this.$store.getters.getChecksForEntity(this.rule.entity)},operators:function(){if(!this.currentOption)return[];var e=this.checks[this.currentOption.class].operators;return"function"==typeof e?e(this.check):e},currentComponent:function(){return this.currentOption?this.checks[this.currentOption.class].component:[]},valuePlaceholder:function(){return this.currentOption&&this.currentOption.placeholder?this.currentOption.placeholder(this.check):""}},watch:{"check.operator":function(){this.validate()}},mounted:function(){var e=this;this.options=Object.values(this.checks),this.currentOption=this.checks[this.check.class],this.currentOperator=this.operators.find((function(t){return t.operator===e.check.operator})),null===this.check.class&&this.$nextTick((function(){return e.$refs.checkSelector.$el.focus()})),this.validate()},methods:{showDelete:function(){this.deleteVisible=!0},hideDelete:function(){this.deleteVisible=!1},validate:function(){this.valid=!0,this.currentOption&&this.currentOption.validate&&(this.valid=!!this.currentOption.validate(this.check)),this.check.invalid=!this.valid,this.$emit("validate",this.valid)},updateCheck:function(){var e=this,t=this.operators.findIndex((function(t){return e.check.operator===t.operator}));this.check.class===this.currentOption.class&&-1!==t||(this.currentOperator=this.operators[0]),this.check.class=this.currentOption.class,this.check.operator=this.currentOperator.operator,this.validate(),this.$emit("update",this.check)}}},C=(r(477),N(Y,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideDelete,expression:"hideDelete"}],staticClass:"check",on:{click:e.showDelete}},[n("Multiselect",{ref:"checkSelector",attrs:{options:e.options,label:"name","track-by":"class","allow-empty":!1,placeholder:e.t("workflowengine","Select a filter")},on:{input:e.updateCheck},model:{value:e.currentOption,callback:function(t){e.currentOption=t},expression:"currentOption"}}),e._v(" "),n("Multiselect",{staticClass:"comparator",attrs:{disabled:!e.currentOption,options:e.operators,label:"name","track-by":"operator","allow-empty":!1,placeholder:e.t("workflowengine","Select a comparator")},on:{input:e.updateCheck},model:{value:e.currentOperator,callback:function(t){e.currentOperator=t},expression:"currentOperator"}}),e._v(" "),e.currentOperator&&e.currentComponent?n(e.currentOption.component,{tag:"component",staticClass:"option",attrs:{disabled:!e.currentOption,check:e.check},on:{input:e.updateCheck,valid:function(t){(e.valid=!0)&&e.validate()},invalid:function(t){!(e.valid=!1)&&e.validate()}},model:{value:e.check.value,callback:function(t){e.$set(e.check,"value",t)},expression:"check.value"}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.check.value,expression:"check.value"}],staticClass:"option",class:{invalid:!e.valid},attrs:{type:"text",disabled:!e.currentOption,placeholder:e.valuePlaceholder},domProps:{value:e.check.value},on:{input:[function(t){t.target.composing||e.$set(e.check,"value",t.target.value)},e.updateCheck]}}),e._v(" "),e.deleteVisible||!e.currentOption?n("Actions",[n("ActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return e.$emit("remove")}}})],1):e._e()],1)}),[],!1,null,"f4da0348",null).exports),B={name:"Operation",props:{operation:{type:Object,required:!0},colored:{type:Boolean,default:!0}}},W=(r(479),N(B,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"actions__item",class:{colored:e.colored},style:{backgroundColor:e.colored?e.operation.color:"transparent"}},[n("div",{staticClass:"icon",class:e.operation.iconClass,style:{backgroundImage:e.operation.iconClass?"":"url("+e.operation.icon+")"}}),e._v(" "),n("div",{staticClass:"actions__item__description"},[n("h3",[e._v(e._s(e.operation.name))]),e._v(" "),n("small",[e._v(e._s(e.operation.description))]),e._v(" "),n("div",[e.colored?n("button",[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Add new flow"))+"\n\t\t\t")]):e._e()])]),e._v(" "),n("div",{staticClass:"actions__item_options"},[e._t("default")],2)])}),[],!1,null,"34495584",null).exports);function q(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}function P(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){q(o,r,a,i,s,"next",e)}function s(e){q(o,r,a,i,s,"throw",e)}i(void 0)}))}}var j={name:"Rule",components:{Operation:W,Check:C,Event:S,Actions:L.a,ActionButton:w.a},directives:{Tooltip:v.a},props:{rule:{type:Object,required:!0}},data:function(){return{editing:!1,checks:[],error:null,dirty:this.rule.id<0,originalRule:null}},computed:{operation:function(){return this.$store.getters.getOperationForRule(this.rule)},ruleStatus:function(){return this.error||!this.rule.valid||0===this.rule.checks.length||this.rule.checks.some((function(e){return!0===e.invalid}))?{title:t("workflowengine","The configuration is invalid"),class:"icon-close-white invalid",tooltip:{placement:"bottom",show:!0,content:this.error}}:this.dirty?{title:t("workflowengine","Save"),class:"icon-confirm-white primary"}:{title:t("workflowengine","Active"),class:"icon icon-checkmark"}},lastCheckComplete:function(){var e=this.rule.checks[this.rule.checks.length-1];return void 0===e||null!==e.class}},mounted:function(){this.originalRule=JSON.parse(JSON.stringify(this.rule))},methods:{updateOperation:function(e){var t=this;return P(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return t.$set(t.rule,"operation",e),n.next=3,t.updateRule();case 3:case"end":return n.stop()}}),n)})))()},validate:function(e){this.error=null,this.$store.dispatch("updateRule",this.rule)},updateRule:function(){this.dirty||(this.dirty=!0),this.error=null,this.$store.dispatch("updateRule",this.rule)},saveRule:function(){var e=this;return P(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$store.dispatch("pushUpdateRule",e.rule);case 3:e.dirty=!1,e.error=null,e.originalRule=JSON.parse(JSON.stringify(e.rule)),t.next=12;break;case 8:t.prev=8,t.t0=t.catch(0),console.error("Failed to save operation"),e.error=t.t0.response.data.ocs.meta.message;case 12:case"end":return t.stop()}}),t,null,[[0,8]])})))()},deleteRule:function(){var e=this;return P(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$store.dispatch("deleteRule",e.rule);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),console.error("Failed to delete operation"),e.error=t.t0.response.data.ocs.meta.message;case 9:case"end":return t.stop()}}),t,null,[[0,5]])})))()},cancelRule:function(){this.rule.id<0?this.$store.dispatch("removeRule",this.rule):(this.$store.dispatch("updateRule",this.originalRule),this.originalRule=JSON.parse(JSON.stringify(this.rule)),this.dirty=!1)},removeCheck:function(e){var t=this;return P(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:(r=t.rule.checks.findIndex((function(t){return t===e})))>-1&&t.$delete(t.rule.checks,r),t.$store.dispatch("updateRule",t.rule);case 3:case"end":return n.stop()}}),n)})))()}}},I=(r(481),N(j,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.operation?n("div",{staticClass:"section rule",style:{borderLeftColor:e.operation.color||""}},[n("div",{staticClass:"trigger"},[n("p",[n("span",[e._v(e._s(e.t("workflowengine","When")))]),e._v(" "),n("Event",{attrs:{rule:e.rule},on:{update:e.updateRule}})],1),e._v(" "),e._l(e.rule.checks,(function(t,r){return n("p",{key:r},[n("span",[e._v(e._s(e.t("workflowengine","and")))]),e._v(" "),n("Check",{attrs:{check:t,rule:e.rule},on:{update:e.updateRule,validate:e.validate,remove:function(n){return e.removeCheck(t)}}})],1)})),e._v(" "),n("p",[n("span"),e._v(" "),e.lastCheckComplete?n("input",{staticClass:"check--add",attrs:{type:"button",value:"Add a new filter"},on:{click:function(t){return e.rule.checks.push({class:null,operator:null,value:""})}}}):e._e()])],2),e._v(" "),n("div",{staticClass:"flow-icon icon-confirm"}),e._v(" "),n("div",{staticClass:"action"},[n("Operation",{attrs:{operation:e.operation,colored:!1}},[e.operation.options?n(e.operation.options,{tag:"component",on:{input:e.updateOperation},model:{value:e.rule.operation,callback:function(t){e.$set(e.rule,"operation",t)},expression:"rule.operation"}}):e._e()],1),e._v(" "),n("div",{staticClass:"buttons"},[n("button",{staticClass:"status-button icon",class:e.ruleStatus.class,on:{click:e.saveRule}},[e._v("\n\t\t\t\t"+e._s(e.ruleStatus.title)+"\n\t\t\t")]),e._v(" "),e.rule.id<-1||e.dirty?n("button",{on:{click:e.cancelRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Cancel"))+"\n\t\t\t")]):e.dirty?e._e():n("button",{on:{click:e.deleteRule}},[e._v("\n\t\t\t\t"+e._s(e.t("workflowengine","Delete"))+"\n\t\t\t")])]),e._v(" "),e.error?n("p",{staticClass:"error-message"},[e._v("\n\t\t\t"+e._s(e.error)+"\n\t\t")]):e._e()],1)]):e._e()}),[],!1,null,"1680636e",null).exports);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var F={name:"Workflow",components:{Operation:W,Rule:I},data:function(){return{showMoreOperations:!1,appstoreUrl:Object(l.generateUrl)("settings/apps/workflow")}},computed:X(X(X({},Object(o.b)({rules:"getRules"})),Object(o.c)({appstoreEnabled:"appstoreEnabled",scope:"scope",operations:"operations"})),{},{hasMoreOperations:function(){return Object.keys(this.operations).length>3},getMainOperations:function(){return this.showMoreOperations?Object.values(this.operations):Object.values(this.operations).slice(0,3)},showAppStoreHint:function(){return 0===this.scope&&this.appstoreEnabled&&OC.isUserAdmin()}}),mounted:function(){this.$store.dispatch("fetchRules")},methods:{createNewRule:function(e){this.$store.dispatch("createNewRule",e)}}},U=(r(483),N(F,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"workflowengine"}},[n("div",{staticClass:"section"},[n("h2",[e._v(e._s(e.t("workflowengine","Available flows")))]),e._v(" "),0===e.scope?n("p",{staticClass:"settings-hint"},[n("a",{attrs:{href:"https://nextcloud.com/developer/"}},[e._v(e._s(e.t("workflowengine","For details on how to write your own flow, check out the development documentation.")))])]):e._e(),e._v(" "),n("transition-group",{staticClass:"actions",attrs:{name:"slide",tag:"div"}},[e._l(e.getMainOperations,(function(t){return n("Operation",{key:t.id,attrs:{operation:t},nativeOn:{click:function(n){return e.createNewRule(t)}}})})),e._v(" "),e.showAppStoreHint?n("a",{key:"add",staticClass:"actions__item colored more",attrs:{href:e.appstoreUrl}},[n("div",{staticClass:"icon icon-add"}),e._v(" "),n("div",{staticClass:"actions__item__description"},[n("h3",[e._v(e._s(e.t("workflowengine","More flows")))]),e._v(" "),n("small",[e._v(e._s(e.t("workflowengine","Browse the app store")))])])]):e._e()],2),e._v(" "),e.hasMoreOperations?n("div",{staticClass:"actions__more"},[n("button",{staticClass:"icon",class:e.showMoreOperations?"icon-triangle-n":"icon-triangle-s",on:{click:function(t){e.showMoreOperations=!e.showMoreOperations}}},[e._v("\n\t\t\t\t"+e._s(e.showMoreOperations?e.t("workflowengine","Show less"):e.t("workflowengine","Show more"))+"\n\t\t\t")])]):e._e(),e._v(" "),0===e.scope?n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Configured flows"))+"\n\t\t")]):n("h2",{staticClass:"configured-flows"},[e._v("\n\t\t\t"+e._s(e.t("workflowengine","Your flows"))+"\n\t\t")])],1),e._v(" "),e.rules.length>0?n("transition-group",{attrs:{name:"slide"}},e._l(e.rules,(function(e){return n("Rule",{key:e.id,attrs:{rule:e}})})),1):e._e()],1)}),[],!1,null,"7000c295",null).exports),G=/^\/(.*)\/([gui]{0,3})$/,Q=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/,J={props:{value:{type:String,default:""},check:{type:Object,default:function(){return{}}}},data:function(){return{newValue:""}},watch:{value:{immediate:!0,handler:function(e){this.updateInternalValue(e)}}},methods:{updateInternalValue:function(e){this.newValue=e}}};function $(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Z={name:"FileMimeType",components:{Multiselect:O.a},mixins:[J],data:function(){return{predefinedTypes:[{icon:"icon-folder",label:t("workflowengine","Folder"),pattern:"httpd/unix-directory"},{icon:"icon-picture",label:t("workflowengine","Images"),pattern:"/image\\/.*/"},{iconUrl:Object(l.imagePath)("core","filetypes/x-office-document"),label:t("workflowengine","Office documents"),pattern:"/(vnd\\.(ms-|openxmlformats-).*)$/"},{iconUrl:Object(l.imagePath)("core","filetypes/application-pdf"),label:t("workflowengine","PDF documents"),pattern:"application/pdf"}]}},computed:{options:function(){return[].concat($(this.predefinedTypes),[this.customValue])},isPredefined:function(){var e=this;return!!this.predefinedTypes.find((function(t){return e.newValue===t.pattern}))},customValue:function(){return{icon:"icon-settings-dark",label:t("workflowengine","Custom mimetype"),pattern:""}},currentValue:function(){var e=this,n=this.predefinedTypes.find((function(t){return e.newValue===t.pattern}));return n||{icon:"icon-settings-dark",label:t("workflowengine","Custom mimetype"),pattern:this.newValue}}},methods:{validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)},setValue:function(e){null!==e&&(this.newValue=e.pattern,this.$emit("input",this.newValue))},updateCustom:function(e){this.newValue=e.target.value,this.$emit("input",this.newValue)}}},ee=(r(485),N(Z,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,placeholder:e.t("workflowengine","Select a file type"),label:"label","track-by":"pattern",options:e.options,multiple:!1,tagging:!1},on:{input:e.setValue},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[t.option.icon?n("span",{staticClass:"option__icon",class:t.option.icon}):n("img",{attrs:{src:t.option.iconUrl}}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(t.option.label))])]}},{key:"option",fn:function(t){return[t.option.icon?n("span",{staticClass:"option__icon",class:t.option.icon}):n("img",{attrs:{src:t.option.iconUrl}}),e._v(" "),n("span",{staticClass:"option__title"},[e._v(e._s(t.option.label))])]}}])}),e._v(" "),e.isPredefined?e._e():n("input",{attrs:{type:"text",placeholder:e.t("workflowengine","e.g. httpd/unix-directory")},domProps:{value:e.currentValue.pattern},on:{input:e.updateCustom}})],1)}),[],!1,null,"bee9d4fe",null).exports),te=function(e){var t=function e(t){var n={};if(1===t.nodeType){if(t.attributes.length>0){n["@attributes"]={};for(var r=0;r<t.attributes.length;r++){var a=t.attributes.item(r);n["@attributes"][a.nodeName]=a.nodeValue}}}else 3===t.nodeType&&(n=t.nodeValue);if(t.hasChildNodes())for(var o=0;o<t.childNodes.length;o++){var i=t.childNodes.item(o),s=i.nodeName;if(void 0===n[s])n[s]=e(i);else{if(void 0===n[s].push){var c=n[s];n[s]=[],n[s].push(c)}n[s].push(e(i))}}return n}(function(e){var t=null;try{t=(new DOMParser).parseFromString(e,"text/xml")}catch(e){console.error("Failed to parse xml document",e)}return t}(e))["d:multistatus"]["d:response"],n=[];for(var r in t){var a=t[r]["d:propstat"];"HTTP/1.1 200 OK"===a["d:status"]["#text"]&&n.push({id:a["d:prop"]["oc:id"]["#text"],displayName:a["d:prop"]["oc:display-name"]["#text"],canAssign:"true"===a["d:prop"]["oc:can-assign"]["#text"],userAssignable:"true"===a["d:prop"]["oc:user-assignable"]["#text"],userVisible:"true"===a["d:prop"]["oc:user-visible"]["#text"]})}return n},ne=0,re=N({name:"MultiselectTag",components:{Multiselect:O.a},props:{label:{type:String,required:!0},value:{type:[String,Array],default:null},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1}},data:function(){return{inputValObjects:[],tags:[]}},computed:{id:function(){return"settings-input-text-"+this.uuid}},watch:{value:function(e){this.inputValObjects=this.getValueObject()}},beforeCreate:function(){var e=this;this.uuid=ne.toString(),ne+=1,s()({method:"PROPFIND",url:Object(l.generateRemoteUrl)("dav")+"/systemtags/",data:'<?xml version="1.0"?>\n\t\t\t\t\t<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">\n\t\t\t\t\t <d:prop>\n\t\t\t\t\t\t<oc:id />\n\t\t\t\t\t\t<oc:display-name />\n\t\t\t\t\t\t<oc:user-visible />\n\t\t\t\t\t\t<oc:user-assignable />\n\t\t\t\t\t\t<oc:can-assign />\n\t\t\t\t\t </d:prop>\n\t\t\t\t\t</d:propfind>'}).then((function(e){return te(e.data)})).then((function(t){e.tags=t,e.inputValObjects=e.getValueObject()})).catch(console.error.bind(this))},methods:{getValueObject:function(){var e=this;return 0===this.tags.length?[]:this.multiple?this.value.filter((function(e){return""!==e})).map((function(t){return e.tags.find((function(e){return e.id===t}))})):this.tags.find((function(t){return t.id===e.value}))},update:function(){this.multiple?this.$emit("input",this.inputValObjects.map((function(e){return e.id}))):null===this.inputValObjects?this.$emit("input",""):this.$emit("input",this.inputValObjects.id)},tagLabel:function(e){var n=e.displayName,r=e.userVisible,a=e.userAssignable;return!1===r?t("systemtags","%s (invisible)").replace("%s",n):!1===a?t("systemtags","%s (restricted)").replace("%s",n):n}}},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Multiselect",{staticClass:"multiselect-vue",attrs:{options:e.tags,"options-limit":5,placeholder:e.label,"track-by":"id","custom-label":e.tagLabel,multiple:e.multiple,"close-on-select":!1,"tag-width":60,disabled:e.disabled},on:{input:e.update},scopedSlots:e._u([{key:"option",fn:function(t){return[e._v("\n\t\t"+e._s(e.tagLabel(t.option))+"\n\t")]}}]),model:{value:e.inputValObjects,callback:function(t){e.inputValObjects=t},expression:"inputValObjects"}},[n("span",{attrs:{slot:"noResult"},slot:"noResult"},[e._v(e._s(e.t("core","No results")))])])}),[],!1,null,null,null).exports,ae=N({name:"FileSystemTag",components:{MultiselectTag:re},props:{value:{type:String,default:""}},data:function(){return{newValue:[]}},watch:{value:function(){this.updateValue()}},beforeMount:function(){this.updateValue()},methods:{updateValue:function(){""!==this.value?this.newValue=this.value:this.newValue=null},update:function(){this.$emit("input",this.newValue||"")}}},(function(){var e=this,t=e.$createElement;return(e._self._c||t)("MultiselectTag",{attrs:{multiple:!1,label:e.t("workflowengine","Select a tag")},on:{input:e.update},model:{value:e.newValue,callback:function(t){e.newValue=t},expression:"newValue"}})}),[],!1,null,"31f5522d",null).exports,oe=function(e){return e.value.startsWith("/")?[{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")}]},ie=[{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:oe,placeholder:function(e){return"matches"===e.operator||"!matches"===e.operator?"/^dummy-.+$/i":"filename.txt"},validate:function(e){return"matches"!==e.operator&&"!matches"!==e.operator||!!(t=e.value)&&null!==G.exec(t);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:oe,component:ee},{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}],placeholder:function(e){return"5 MB"},validate:function(e){return!!e.value&&null!==e.value.match(/^[0-9]+[ ]?[kmgt]?b$/i)}},{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}],placeholder:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?"::1/128":"127.0.0.1/32"},validate:function(e){return"matchesIPv6"===e.operator||"!matchesIPv6"===e.operator?!!(t=e.value)&&null!==V.exec(t):function(e){return!!e&&null!==Q.exec(e)}(e.value);var t}},{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}],component:ae}];function se(e){return function(e){if(Array.isArray(e))return ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var le={name:"RequestUserAgent",components:{Multiselect:O.a},mixins:[J],data:function(){return{newValue:"",predefinedTypes:[{pattern:"android",label:t("workflowengine","Android client"),icon:"icon-phone"},{pattern:"ios",label:t("workflowengine","iOS client"),icon:"icon-phone"},{pattern:"desktop",label:t("workflowengine","Desktop client"),icon:"icon-desktop"},{pattern:"mail",label:t("workflowengine","Thunderbird & Outlook addons"),icon:"icon-mail"}]}},computed:{options:function(){return[].concat(se(this.predefinedTypes),[this.customValue])},matchingPredefined:function(){var e=this;return this.predefinedTypes.find((function(t){return e.newValue===t.pattern}))},isPredefined:function(){return!!this.matchingPredefined},customValue:function(){return{icon:"icon-settings-dark",label:t("workflowengine","Custom user agent"),pattern:""}},currentValue:function(){return this.matchingPredefined?this.matchingPredefined:{icon:"icon-settings-dark",label:t("workflowengine","Custom user agent"),pattern:this.newValue}}},methods:{validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)},setValue:function(e){null!==e&&(this.newValue=e.pattern,this.$emit("input",this.newValue))},updateCustom:function(e){this.newValue=e.target.value,this.$emit("input",this.newValue)}}},ue=(r(487),N(le,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,placeholder:e.t("workflowengine","Select a user agent"),label:"label","track-by":"pattern",options:e.options,multiple:!1,tagging:!1},on:{input:e.setValue},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),n("span",{staticClass:"option__title option__title_single",domProps:{innerHTML:e._s(t.option.label)}})]}},{key:"option",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),t.option.$groupLabel?n("span",{staticClass:"option__title",domProps:{innerHTML:e._s(t.option.$groupLabel)}}):n("span",{staticClass:"option__title",domProps:{innerHTML:e._s(t.option.label)}})]}}])}),e._v(" "),e.isPredefined?e._e():n("input",{attrs:{type:"text"},domProps:{value:e.currentValue.pattern},on:{input:e.updateCustom}})],1)}),[],!1,null,"1f573f40",null).exports),de=r(57),pe=r.n(de),me=pe.a.tz.names(),Ae={name:"RequestTime",components:{Multiselect:O.a},mixins:[J],props:{value:{type:String,default:""}},data:function(){return{timezones:me,valid:!1,newValue:{startTime:null,endTime:null,timezone:pe.a.tz.guess()}}},mounted:function(){this.validate()},methods:{updateInternalValue:function(e){try{var t=JSON.parse(e);2===t.length&&(this.newValue={startTime:t[0].split(" ",2)[0],endTime:t[1].split(" ",2)[0],timezone:t[0].split(" ",2)[1]})}catch(e){}},validate:function(){return this.valid=this.newValue.startTime&&null!==this.newValue.startTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i)&&this.newValue.endTime&&null!==this.newValue.endTime.match(/^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/i)&&null!==pe.a.tz.zone(this.newValue.timezone),this.valid?this.$emit("valid"):this.$emit("invalid"),this.valid},update:function(){if(null===this.newValue.timezone&&(this.newValue.timezone=pe.a.tz.guess()),this.validate()){var e='["'.concat(this.newValue.startTime," ").concat(this.newValue.timezone,'","').concat(this.newValue.endTime," ").concat(this.newValue.timezone,'"]');this.$emit("input",e)}}}},fe=(r(493),N(Ae,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"timeslot"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newValue.startTime,expression:"newValue.startTime"}],staticClass:"timeslot--start",attrs:{type:"text",placeholder:"e.g. 08:00"},domProps:{value:e.newValue.startTime},on:{input:[function(t){t.target.composing||e.$set(e.newValue,"startTime",t.target.value)},e.update]}}),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.newValue.endTime,expression:"newValue.endTime"}],attrs:{type:"text",placeholder:"e.g. 18:00"},domProps:{value:e.newValue.endTime},on:{input:[function(t){t.target.composing||e.$set(e.newValue,"endTime",t.target.value)},e.update]}}),e._v(" "),e.valid?e._e():n("p",{staticClass:"invalid-hint"},[e._v("\n\t\t"+e._s(e.t("workflowengine","Please enter a valid time span"))+"\n\t")]),e._v(" "),n("Multiselect",{directives:[{name:"show",rawName:"v-show",value:e.valid,expression:"valid"}],attrs:{options:e.timezones},on:{input:e.update},model:{value:e.newValue.timezone,callback:function(t){e.$set(e.newValue,"timezone",t)},expression:"newValue.timezone"}})],1)}),[],!1,null,"149baca9",null).exports);function Me(e){return function(e){if(Array.isArray(e))return he(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return he(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ge={name:"RequestURL",components:{Multiselect:O.a},mixins:[J],data:function(){return{newValue:"",predefinedTypes:[{label:t("workflowengine","Predefined URLs"),children:[{pattern:"webdav",label:t("workflowengine","Files WebDAV")}]}]}},computed:{options:function(){return[].concat(Me(this.predefinedTypes),[this.customValue])},placeholder:function(){return"matches"===this.check.operator||"!matches"===this.check.operator?"/^https\\:\\/\\/localhost\\/index\\.php$/i":"https://localhost/index.php"},matchingPredefined:function(){var e=this;return this.predefinedTypes.map((function(e){return e.children})).flat().find((function(t){return e.newValue===t.pattern}))},isPredefined:function(){return!!this.matchingPredefined},customValue:function(){return{label:t("workflowengine","Others"),children:[{icon:"icon-settings-dark",label:t("workflowengine","Custom URL"),pattern:""}]}},currentValue:function(){return this.matchingPredefined?this.matchingPredefined:{icon:"icon-settings-dark",label:t("workflowengine","Custom URL"),pattern:this.newValue}}},methods:{validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)},setValue:function(e){null!==e&&(this.newValue=e.pattern,this.$emit("input",this.newValue))},updateCustom:function(e){this.newValue=e.target.value,this.$emit("input",this.newValue)}}},_e=(r(495),N(ge,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,placeholder:e.t("workflowengine","Select a request URL"),label:"label","track-by":"pattern","group-values":"children","group-label":"label",options:e.options,multiple:!1,tagging:!1},on:{input:e.setValue},scopedSlots:e._u([{key:"singleLabel",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),n("span",{staticClass:"option__title option__title_single"},[e._v(e._s(t.option.label))])]}},{key:"option",fn:function(t){return[n("span",{staticClass:"option__icon",class:t.option.icon}),e._v(" "),n("span",{staticClass:"option__title"},[e._v(e._s(t.option.label)+" "+e._s(t.option.$groupLabel))])]}}])}),e._v(" "),e.isPredefined?e._e():n("input",{attrs:{type:"text",placeholder:e.placeholder},domProps:{value:e.currentValue.pattern},on:{input:e.updateCustom}})],1)}),[],!1,null,"0b72cbf8",null).exports);function be(e,t,n,r,a,o,i){try{var s=e[o](i),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,a)}var ve=[],ye={isLoading:!1},Le={name:"RequestUserGroup",components:{Multiselect:O.a},props:{value:{type:String,default:""},check:{type:Object,default:function(){return{}}}},data:function(){return{groups:ve,status:ye}},computed:{currentValue:function(){var e=this;return this.groups.find((function(t){return t.id===e.value}))||null}},mounted:function(){var e,t=this;return(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.groups.length){e.next=3;break}return e.next=3,t.searchAsync("");case 3:if(null!==t.currentValue){e.next=6;break}return e.next=6,t.searchAsync(t.value);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){be(o,r,a,i,s,"next",e)}function s(e){be(o,r,a,i,s,"throw",e)}i(void 0)}))})()},methods:{searchAsync:function(e){var t=this;if(!this.status.isLoading)return this.status.isLoading=!0,s.a.get(Object(l.generateOcsUrl)("cloud",2)+"groups?limit=20&search="+encodeURI(e)).then((function(e){e.data.ocs.data.groups.reduce((function(e,t){return e.push({id:t,displayname:t}),e}),[]).forEach((function(e){return t.addGroup(e)})),t.status.isLoading=!1}),(function(e){console.error("Error while loading group list",e.response)}))},addGroup:function(e){-1===this.groups.findIndex((function(t){return t.id===e.id}))&&this.groups.push(e)}}},Te=(r(497),N(Le,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("Multiselect",{attrs:{value:e.currentValue,loading:e.status.isLoading&&0===e.groups.length,options:e.groups,multiple:!1,label:"displayname","track-by":"id"},on:{"search-change":e.searchAsync,input:function(t){return e.$emit("input",t.id)}}})],1)}),[],!1,null,"0e9e1554",null).exports),we=[{class:"OCA\\WorkflowEngine\\Check\\RequestURL",name:t("workflowengine","Request URL"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}],component:_e},{class:"OCA\\WorkflowEngine\\Check\\RequestTime",name:t("workflowengine","Request time"),operators:[{operator:"in",name:t("workflowengine","between")},{operator:"!in",name:t("workflowengine","not between")}],component:fe},{class:"OCA\\WorkflowEngine\\Check\\RequestUserAgent",name:t("workflowengine","Request user agent"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}],component:ue},{class:"OCA\\WorkflowEngine\\Check\\UserGroupMembership",name:t("workflowengine","User group membership"),operators:[{operator:"is",name:t("workflowengine","is member of")},{operator:"!is",name:t("workflowengine","is not member of")}],component:Te}];function ze(e){return function(e){if(Array.isArray(e))return Oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Oe(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}
/**
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*