require=function o(a,s,u){function l(t,e){if(!s[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[t]={exports:{}};a[t][0].call(i.exports,function(e){return l(a[t][1][e]||e)},i,i.exports,o,a,s,u)}return s[t].exports}for(var c="function"==typeof require&&require,e=0;e(r.camMaxFilesize||5e6)&&i.$setValidity("camVariableType",!1)),e}i.$parsers.unshift(t),i.$formatters.push(t),r.$observe("camVariableType",function(){return t(i.$viewValue)}),n.bind("change",function(){t(i.$viewValue),e.$apply()})}}}]),t.exports=i},{"./../../forms/type-util":46,"./camunda-form-angular":1,angular:"angular"}],3:[function(e,t,n){"use strict";var c=e("q"),r=e("./../events");function f(){}var i=e("./../base-class").extend({initialize:function(){this.http=this.constructor.http}},{path:"",http:{},create:function(){},list:function(n,r){"function"==typeof n&&(r=n,n={}),n=n||{},r=r||f;function i(){l&&u&&(o.trigger("loaded",a),s.resolve(a),r(null,a))}var o=this,a={count:0,items:[]},s=c.defer(),u=!1,l=!1;return o.count(n,function(e,t){e?(o.trigger("error",e),s.reject(e),r(e)):(a.count=t,u=!0,i())}),o.http.get(o.path,{data:n,done:function(e,t){e?(o.trigger("error",e),s.reject(e),r(e)):(a.items=t,a.firstResult=parseInt(n.firstResult||0,10),a.maxResults=a.firstResult+parseInt(n.maxResults||10,10),l=!0,i())}}),s.promise},count:function(e,n){"function"==typeof e&&(n=e,e={}),e=e||{},n=n||f;var r=this,i=c.defer();return this.http.get(this.path+"/count",{data:e,done:function(e,t){e?(r.trigger("error",e),i.reject(e),n(e)):(i.resolve(t.count),n(null,t.count))}}),i.promise},update:function(){},delete:function(){}});r.attach(i),t.exports=i},{"./../base-class":35,"./../events":36,q:"q"}],4:[function(e,t,n){"use strict";n.createSimpleGetQueryFunction=function(r){return function(e,t){var n=this.path+r;return"function"==typeof e&&(t=e,e={}),this.http.get(n,{data:e,done:t})}}},{}],5:[function(n,r,e){(function(l){"use strict";var c=n("superagent"),f=n("q"),t=n("./../events"),o=n("./../utils");function d(){}function e(e){if((e=e||{}).headers=e.headers||{},e.headers.Accept||(e.headers.Accept="application/hal+json, application/json; q=0.5"),!e.baseUrl)throw new Error("HttpClient needs a `baseUrl` configuration property.");t.attach(this),this.config=e}function p(n,r,i){return r=r||d,function(e,t){if(e||!t.ok&&!t.noContent)return e=e||t.error||new Error("The "+t.req.method+" request on "+t.req.url+" failed"),t&&t.body&&t.body.message&&(e.message=t.body.message),n.trigger("error",e),i&&i.reject(e),r(e);"application/hal+json"===t.type&&(t.body&&0!==Object.keys(t.body).length||(t.body=JSON.parse(t.text)),t.body=o.solveHALEmbedded(t.body)),i&&i.resolve(t.body?t.body:t.text?t.text:""),r(null,t.body?t.body:t.text?t.text:"")}}e.prototype.post=function(e,t){var n=(t=t||{}).done||d,r=f.defer(),i=this.config.baseUrl+(e?"/"+e:""),o=c.post(i),a=t.headers||this.config.headers;a.Accept=a.Accept||this.config.headers.Accept;var s=!1;if(void 0!==l)Object.keys(t.fields||{}).forEach(function(e){o.field(e,t.fields[e]),s=!0}),(t.attachments||[]).forEach(function(e,t){o.attach("data_"+t,new l(e.content),e.name),s=!0});else if(t.fields||t.attachments){var u=new Error("Multipart request is only supported in node.js environement.");return n(u),r.reject(u)}return s||o.send(t.data||{}),o.set(a).query(t.query||{}),o.end(p(this,n,r)),r.promise},e.prototype.get=function(e,t){var n=this.config.baseUrl+(e?"/"+e:"");return this.load(n,t)},e.prototype.load=function(e,t){var n=(t=t||{}).done||d,r=f.defer(),i=t.headers||this.config.headers,o=t.accept||i.Accept||this.config.headers.Accept;return c.get(e).set(i).set("Accept",o).query(t.data||{}).end(p(this,n,r)),r.promise},e.prototype.put=function(e,t){var n=(t=t||{}).done||d,r=f.defer(),i=this.config.baseUrl+(e?"/"+e:""),o=t.headers||this.config.headers;return o.Accept=o.Accept||this.config.headers.Accept,c.put(i).set(o).send(t.data||{}).end(p(this,n,r)),r.promise},e.prototype.del=function(e,t){var n=(t=t||{}).done||d,r=f.defer(),i=this.config.baseUrl+(e?"/"+e:""),o=t.headers||this.config.headers;return o.Accept=o.Accept||this.config.headers.Accept,c.del(i).set(o).send(t.data||{}).end(p(this,n,r)),r.promise},e.prototype.options=function(e,t){var n=(t=t||{}).done||d,r=f.defer(),i=this.config.baseUrl+(e?"/"+e:""),o=t.headers||this.config.headers;return o.Accept=o.Accept||this.config.headers.Accept,c("OPTIONS",i).set(o).end(p(this,n,r)),r.promise},r.exports=e}).call(this,n("buffer").Buffer)},{"./../events":36,"./../utils":49,buffer:108,q:"q",superagent:692}],6:[function(s,e,t){"use strict";var n=s("./../events");function r(e){if(!e)throw new Error("Needs configuration");if(!e.apiUri)throw new Error("An apiUri is required");n.attach(this),e.engine=void 0!==e.engine?e.engine:"default",e.mock=void 0===e.mock||e.mock,e.resources=e.resources||{},this.HttpClient=e.HttpClient||r.HttpClient,this.baseUrl=e.apiUri,e.engine&&(this.baseUrl+="/"!==this.baseUrl.slice(-1)?"/":"",this.baseUrl+="engine/"+e.engine),this.config=e,this.initialize()}r.HttpClient=s("./http-client"),function(e){e.config={};var a={};e.initialize=function(){a.authorization=s("./resources/authorization"),a.batch=s("./resources/batch"),a.deployment=s("./resources/deployment"),a["external-task"]=s("./resources/external-task"),a.filter=s("./resources/filter"),a.history=s("./resources/history"),a["process-definition"]=s("./resources/process-definition"),a["process-instance"]=s("./resources/process-instance"),a.task=s("./resources/task"),a["task-report"]=s("./resources/task-report"),a.variable=s("./resources/variable"),a["case-execution"]=s("./resources/case-execution"),a["case-instance"]=s("./resources/case-instance"),a["case-definition"]=s("./resources/case-definition"),a.user=s("./resources/user"),a.group=s("./resources/group"),a.tenant=s("./resources/tenant"),a.incident=s("./resources/incident"),a["job-definition"]=s("./resources/job-definition"),a.job=s("./resources/job"),a.metrics=s("./resources/metrics"),a["decision-definition"]=s("./resources/decision-definition"),a.execution=s("./resources/execution"),a.migration=s("./resources/migration"),a.drd=s("./resources/drd"),a.modification=s("./resources/modification"),a.message=s("./resources/message"),a["password-policy"]=s("./resources/password-policy");var e,t,n,r,i=this;function o(e){i.trigger("error",e)}for(e in this.http=new this.HttpClient({baseUrl:this.baseUrl,headers:this.config.headers}),a){for(r in t={name:e,mock:this.config.mock,baseUrl:this.baseUrl,headers:this.config.headers},n=this.config.resources[e]||{})t[r]=n[r];a[e].http=new this.HttpClient(t),a[e].http.on("error",o)}},e.resource=function(e){return a[e]}}(r.prototype),e.exports=r},{"./../events":36,"./http-client":5,"./resources/authorization":7,"./resources/batch":8,"./resources/case-definition":9,"./resources/case-execution":10,"./resources/case-instance":11,"./resources/decision-definition":12,"./resources/deployment":13,"./resources/drd":14,"./resources/execution":15,"./resources/external-task":16,"./resources/filter":17,"./resources/group":18,"./resources/history":19,"./resources/incident":20,"./resources/job":22,"./resources/job-definition":21,"./resources/message":23,"./resources/metrics":24,"./resources/migration":25,"./resources/modification":26,"./resources/password-policy":27,"./resources/process-definition":28,"./resources/process-instance":29,"./resources/task":31,"./resources/task-report":30,"./resources/tenant":32,"./resources/user":33,"./resources/variable":34}],7:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource").extend();r.path="authorization",r.list=function(e,t){return this.http.get(this.path,{data:e,done:t})},r.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},r.create=function(e,t){return this.http.post(this.path+"/create",{data:e,done:t})},r.update=function(e,t){return this.http.put(this.path+"/"+e.id,{data:e,done:t})},r.save=function(e,t){return r[e.id?"update":"create"](e,t)},r.delete=function(e,t){return this.http.del(this.path+"/"+e,{done:t})},r.check=function(e,t){return this.http.get(this.path+"/check",{data:e,done:t})},t.exports=r},{"./../abstract-client-resource":3}],8:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource").extend();r.path="batch",r.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},r.suspended=function(e,t){return this.http.put(this.path+"/"+e.id+"/suspended",{data:{suspended:!!e.suspended},done:t})},r.statistics=function(e,t){return this.http.get(this.path+"/statistics/",{data:e,done:t})},r.statisticsCount=function(e,t){return this.http.get(this.path+"/statistics/count",{data:e,done:t})},r.delete=function(e,t){var n=this.path+"/"+e.id;return e.cascade&&(n+="?cascade=true"),this.http.del(n,{done:t})},t.exports=r},{"./../abstract-client-resource":3}],9:[function(e,t,n){"use strict";function r(){}var i=e("./../abstract-client-resource").extend();i.path="case-definition",i.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},i.getByKey=function(e,t){return this.http.get(this.path+"/key/"+e,{done:t})},i.list=function(e,t){return this.http.get(this.path,{data:e,done:t})},i.create=function(e,t){var n=this.path+"/";return e.id?n+=e.id:(n=n+"key/"+e.key,e.tenantId&&(n=n+"/tenant-id/"+e.tenantId)),this.http.post(n+"/create",{data:e,done:t})},i.xml=function(e,t){var n=this.path+"/"+(e.id?e.id:"key/"+e.key)+"/xml";return this.http.get(n,{done:t||r})},i.updateHistoryTimeToLive=function(e,t,n){var r=this.path+"/"+e+"/history-time-to-live";return this.http.put(r,{data:t,done:n})},t.exports=i},{"./../abstract-client-resource":3}],10:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource"),i=e("../../utils");function o(){}var a=r.extend();a.path="case-execution",a.list=function(e,t){return t=t||o,this.http.get(this.path,{data:e,done:t})},a.disable=function(e,t,n){return this.http.post(this.path+"/"+e+"/disable",{data:t,done:n})},a.reenable=function(e,t,n){return this.http.post(this.path+"/"+e+"/reenable",{data:t,done:n})},a.manualStart=function(e,t,n){return this.http.post(this.path+"/"+e+"/manual-start",{data:t,done:n})},a.complete=function(e,t,n){return this.http.post(this.path+"/"+e+"/complete",{data:t,done:n})},a.deleteVariable=function(e,t){return this.http.del(this.path+"/"+e.id+"/localVariables/"+i.escapeUrl(e.varId),{done:t})},a.modifyVariables=function(e,t){return this.http.post(this.path+"/"+e.id+"/localVariables",{data:e,done:t})},t.exports=a},{"../../utils":49,"./../abstract-client-resource":3}],11:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource"),i=e("../../utils"),o=r.extend();o.path="case-instance",o.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},o.list=function(e,t){return this.http.get(this.path,{data:e,done:t})},o.close=function(e,t,n){return this.http.post(this.path+"/"+e+"/close",{data:t,done:n})},o.terminate=function(e,t,n){return this.http.post(this.path+"/"+e+"/terminate",{data:t,done:n})},o.setVariable=function(e,t,n){var r=this.path+"/"+e+"/variables/"+i.escapeUrl(t.name);return this.http.put(r,{data:t,done:n})},t.exports=o},{"../../utils":49,"./../abstract-client-resource":3}],12:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource").extend();r.path="decision-definition",r.list=function(e,t){return this.http.get(this.path,{data:e,done:t})},r.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},r.getXml=function(e,t){return this.http.get(this.path+"/"+e+"/xml",{done:t})},r.evaluate=function(e,t){return this.http.post(this.path+"/"+(e.id?e.id:"key/"+e.key)+"/evaluate",{data:e,done:t})},r.updateHistoryTimeToLive=function(e,t,n){var r=this.path+"/"+e+"/history-time-to-live";return this.http.put(r,{data:t,done:n})},t.exports=r},{"./../abstract-client-resource":3}],13:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource"),i=r.extend();i.path="deployment",i.create=function(e,t){var n={"deployment-name":e.deploymentName},r=Array.isArray(e.files)?e.files:[e.files];return e.deploymentSource&&(n["deployment-source"]=e.deploymentSource),e.enableDuplicateFiltering&&(n["enable-duplicate-filtering"]="true"),e.deployChangedOnly&&(n["deploy-changed-only"]="true"),e.tenantId&&(n["tenant-id"]=e.tenantId),this.http.post(this.path+"/create",{data:{},fields:n,attachments:r,done:t})},i.delete=function(e,t,n){var r=this.path+"/"+e;if(t){var i=[];for(var o in t){var a=t[o];i.push(o+"="+a)}i.length&&(r+="?"+i.join("&"))}return this.http.del(r,{done:n})},i.list=function(){return r.list.apply(this,arguments)},i.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},i.getResources=function(e,t){return this.http.get(this.path+"/"+e+"/resources",{done:t})},i.getResource=function(e,t,n){return this.http.get(this.path+"/"+e+"/resources/"+t,{done:n})},i.getResourceData=function(e,t,n){return this.http.get(this.path+"/"+e+"/resources/"+t+"/data",{accept:"*/*",done:n})},i.redeploy=function(e,t){var n=e.id;return delete e.id,this.http.post(this.path+"/"+n+"/redeploy",{data:e,done:t||function(){}})},t.exports=i},{"./../abstract-client-resource":3}],14:[function(e,t,n){"use strict";var r=e("../abstract-client-resource"),i=e("../../utils"),o=r.extend();function a(e,t){return e+"/"+i.escapeUrl(t)}function s(e,t,n){var r=e+"/key/"+i.escapeUrl(t);return"function"!=typeof n&&(r+="/tenant-id/"+i.escapeUrl(n)),r}o.path="decision-requirements-definition",o.count=function(e,t){return"function"==typeof e&&(t=e,e={}),this.http.get(this.path+"/count",{data:e,done:t})},o.list=function(e,t){return"function"==typeof e&&(t=e,e={}),this.http.get(this.path,{data:e,done:t})},o.get=function(e,t){return this.http.get(a(this.path,e),{done:t})},o.getByKey=function(e,t,n){var r=s(this.path,e,t);return"function"==typeof t&&(n=t),this.http.get(r,{done:n})},o.getXML=function(e,t){return this.http.get(a(this.path,e)+"/xml",{done:t})},o.getXMLByKey=function(e,t,n){var r=s(this.path,e,t)+"/xml";return"function"==typeof t&&(n=t),this.http.get(r,{done:n})},t.exports=o},{"../../utils":49,"../abstract-client-resource":3}],15:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource"),i=e("../../utils"),o=r.extend();o.path="execution",o.deleteVariable=function(e,t){return this.http.del(this.path+"/"+e.id+"/localVariables/"+i.escapeUrl(e.varId),{done:t})},o.modifyVariables=function(e,t){return this.http.post(this.path+"/"+e.id+"/localVariables",{data:e,done:t})},t.exports=o},{"../../utils":49,"./../abstract-client-resource":3}],16:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource").extend();r.path="external-task",r.get=function(e,t){return this.http.get(this.path+"/"+e.id,{data:e,done:t})},r.list=function(e,t){var n=this.path+"/";return n+="?firstResult="+(e.firstResult||0),n+="&maxResults="+(e.maxResults||15),this.http.post(n,{data:e,done:t})},r.count=function(e,t){return this.http.post(this.path+"/count",{data:e,done:t})},r.fetchAndLock=function(e,t){return this.http.post(this.path+"/fetchAndLock",{data:e,done:t})},r.complete=function(e,t){return this.http.post(this.path+"/"+e.id+"/complete",{data:e,done:t})},r.failure=function(e,t){return this.http.post(this.path+"/"+e.id+"/failure",{data:e,done:t})},r.unlock=function(e,t){return this.http.post(this.path+"/"+e.id+"/unlock",{data:e,done:t})},r.retries=function(e,t){return this.http.put(this.path+"/"+e.id+"/retries",{data:e,done:t})},r.retriesAsync=function(e,t){return this.http.post(this.path+"/retries-async",{data:e,done:t})},t.exports=r},{"./../abstract-client-resource":3}],17:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource").extend();r.path="filter",r.get=function(e,t){return this.http.get(this.path+"/"+e,{done:t})},r.list=function(e,t){return this.http.get(this.path,{data:e,done:t})},r.getTasks=function(e,t){var n=this.path+"/";return"string"==typeof e?(n=n+e+"/list",e={}):(n=n+e.id+"/list",delete e.id),n+="?firstResult="+(e.firstResult||0),n+="&maxResults="+(e.maxResults||15),this.http.post(n,{data:e,done:t})},r.create=function(e,t){return this.http.post(this.path+"/create",{data:e,done:t})},r.update=function(e,t){return this.http.put(this.path+"/"+e.id,{data:e,done:t})},r.save=function(e,t){return r[e.id?"update":"create"](e,t)},r.delete=function(e,t){return this.http.del(this.path+"/"+e,{done:t})},r.authorizations=function(e,t){return"function"==typeof e?this.http.options(this.path,{done:e,headers:{Accept:"application/json"}}):this.http.options(this.path+"/"+e,{done:t,headers:{Accept:"application/json"}})},t.exports=r},{"./../abstract-client-resource":3}],18:[function(e,t,n){"use strict";var r=e("./../abstract-client-resource"),i=e("../../utils");function o(){}var a=r.extend();a.path="group",a.options=function(e,t){var n;return"function"==typeof e?(t=e,n=""):void 0===(n="string"==typeof e?e:e.id)&&(n=""),this.http.options(this.path+"/"+i.escapeUrl(n),{done:t||o,headers:{Accept:"application/json"}})},a.create=function(e,t){return this.http.post(this.path+"/create",{data:e,done:t||o})},a.count=function(e,t){return e="function"==typeof e?(t=e,{}):e||{},this.http.get(this.path+"/count",{data:e,done:t||o})},a.get=function(e,t){var n="string"==typeof e?e:e.id;return this.http.get(this.path+"/"+i.escapeUrl(n),{data:e,done:t||o})},a.list=function(e,t){var n={};return(e="function"==typeof e?(t=e,{}):e||{}).maxResults&&(n.maxResults=e.maxResults,n.firstResult=e.firstResult),this.http.post(this.path,{data:e,query:n,done:t||o})},a.createMember=function(e,t){return this.http.put(this.path+"/"+i.escapeUrl(e.id)+"/members/"+i.escapeUrl(e.userId),{data:e,done:t||o})},a.deleteMember=function(e,t){return this.http.del(this.path+"/"+i.escapeUrl(e.id)+"/members/"+i.escapeUrl(e.userId),{data:e,done:t||o})},a.update=function(e,t){return this.http.put(this.path+"/"+i.escapeUrl(e.id),{data:e,done:t||o})},a.delete=function(e,t){return this.http.del(this.path+"/"+i.escapeUrl(e.id),{data:e,done:t||o})},t.exports=a},{"../../utils":49,"./../abstract-client-resource":3}],19:[function(e,t,n){"use strict";var r=e("../abstract-client-resource"),i=e("../helpers"),o=r.extend();o.path="history",o.userOperationCount=function(e,t){return"function"==typeof e&&(t=arguments[0],e={}),this.http.get(this.path+"/user-operation/count",{data:e,done:t})},o.userOperation=function(e,t){return"function"==typeof e&&(t=arguments[0],e={}),this.http.get(this.path+"/user-operation",{data:e,done:t})},o.setUserOperationAnnotation=function(e,t){return this.http.put(this.path+"/user-operation/"+e.id+"/set-annotation",{data:e,done:t})},o.clearUserOperationAnnotation=function(e,t){return this.http.put(this.path+"/user-operation/"+e+"/clear-annotation",{done:t})},o.processInstance=function(e,t){"function"==typeof e&&(t=arguments[0],e={});var n={},r={},i=["firstResult","maxResults"];for(var o in e)-1'+e+"");var t=this.formElement=$("form",this.containerElement);if(1!==t.length)throw new Error("Form must provide exaclty one element
");t.attr("name")||t.attr("name","$$camForm")},CamundaForm.prototype.initializeForm=function(n){var r=this;this.initializeFormScripts(),this.initializeFieldHandlers(),this.executeFormScripts(),this.fireEvent("form-loaded"),this.fetchVariables(function(e,t){if(e)throw e;r.mergeVariables(t),r.storeOriginalValues(t),r.fireEvent("variables-fetched"),r.restore(),r.fireEvent("variables-restored"),r.applyVariables(),r.fireEvent("variables-applied"),n(null,r)})},CamundaForm.prototype.initializeFieldHandlers=function(){for(var e in this.formFieldHandlers)this.initializeHandler(this.formFieldHandlers[e])},CamundaForm.prototype.initializeFormScripts=function(){for(var e=$("script["+constants.DIRECTIVE_CAM_SCRIPT+"]",this.formElement),t=0;t(parseInt(i.getAttribute("cam-max-filesize"),10)||5e6))throw new Error("Maximum file size of "+t(parseInt(i.getAttribute("cam-max-filesize"),10)||5e6)+" exceeded.");var a=new FileReader;a.onloadend=function(o,a){return function(e){for(var t="",n=new Uint8Array(e.target.result),r=n.byteLength,i=0;i",{value:r,text:r}))}else for(var i in t)this.element.find('option[value="'+i+'"]').length||this.element.append(s("