@enablerr-ui/form 0.2.22 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- System.register(["axios","@enablerr-ui/auth","@enablerr-ui/layout","@enablerr-ui/form"],(function(t){"use strict";var e,n,o,i,s;return{setters:[function(t){e=t.default},function(t){n=t.user},function(t){o=t.getGridHelp,i=t.getAttractions},function(t){s=t.TextArea}],execute:function(){function a(){}function r(t,e){for(const n in e)t[n]=e[n];return t}function c(t){return t()}function l(){return Object.create(null)}function u(t){t.forEach(c)}function d(t){return"function"==typeof t}function f(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function p(t,...e){if(null==t)return a;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function m(t){let e;return p(t,(t=>e=t))(),e}function h(t,e,n,o){if(t){const i=g(t,e,n,o);return t[0](i)}}function g(t,e,n,o){return t[1]&&o?r(n.ctx.slice(),t[1](o(e))):n.ctx}function $(t,e,n,o,i,s,a){const r=function(t,e,n,o){if(t[2]&&o){const i=t[2](o(n));if(void 0===e.dirty)return i;if("object"==typeof i){const t=[],n=Math.max(e.dirty.length,i.length);for(let o=0;o<n;o+=1)t[o]=e.dirty[o]|i[o];return t}return e.dirty|i}return e.dirty}(e,o,i,s);if(r){const i=g(e,n,o,a);t.p(i,r)}}function y(t,e){const n={};e=new Set(e);for(const o in t)e.has(o)||"$"===o[0]||(n[o]=t[o]);return n}function w(t,e,n){t.insertBefore(e,n||null)}function x(t){t.parentNode.removeChild(t)}function v(t){return document.createElement(t)}function b(){return t="",document.createTextNode(t);var t}function k(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function S(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let I;function j(t){I=t}function E(){if(!I)throw new Error("Function called outside component initialization");return I}function N(){const t=E();return(e,n)=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(e,n);o.slice().forEach((e=>{e.call(t,i)}))}}}const _=[],C=[],M=[],T=[],D=Promise.resolve();let F=!1;function L(t){M.push(t)}function P(t){T.push(t)}let A=!1;const B=new Set;function O(){if(!A){A=!0;do{for(let t=0;t<_.length;t+=1){const e=_[t];j(e),z(e.$$)}for(j(null),_.length=0;C.length;)C.pop()();for(let t=0;t<M.length;t+=1){const e=M[t];B.has(e)||(B.add(e),e())}M.length=0}while(_.length);for(;T.length;)T.pop()();F=!1,A=!1,B.clear()}}function z(t){if(null!==t.fragment){t.update(),u(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(L)}}const H=new Set;let q;function V(){q={r:0,c:[],p:q}}function R(){q.r||u(q.c),q=q.p}function G(t,e){t&&t.i&&(H.delete(t),t.i(e))}function J(t,e,n,o){if(t&&t.o){if(H.has(t))return;H.add(t),q&&q.c.push((()=>{H.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}function U(t,e){const n=e.token={};function o(t,o,i,s){if(e.token!==n)return;e.resolved=s;let a=e.ctx;void 0!==i&&(a=a.slice(),a[i]=s);const r=t&&(e.current=t)(a);let c=!1;e.block&&(e.blocks?e.blocks.forEach(((t,n)=>{n!==o&&t&&(V(),J(t,1,1,(()=>{e.blocks[n]===t&&(e.blocks[n]=null)})),R())})):e.block.d(1),r.c(),G(r,1),r.m(e.mount(),e.anchor),c=!0),e.block=r,e.blocks&&(e.blocks[o]=r),c&&O()}if((i=t)&&"object"==typeof i&&"function"==typeof i.then){const n=E();if(t.then((t=>{j(n),o(e.then,1,e.value,t),j(null)}),(t=>{if(j(n),o(e.catch,2,e.error,t),j(null),!e.hasCatch)throw t})),e.current!==e.pending)return o(e.pending,0),!0}else{if(e.current!==e.then)return o(e.then,1,e.value,t),!0;e.resolved=t}var i}function K(t,e,n){const o=e.slice(),{resolved:i}=t;t.current===t.then&&(o[t.value]=i),t.current===t.catch&&(o[t.error]=i),t.block.p(o,n)}function W(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}function Z(t){t&&t.c()}function Q(t,e,n,o){const{fragment:i,on_mount:s,on_destroy:a,after_update:r}=t.$$;i&&i.m(e,n),o||L((()=>{const e=s.map(c).filter(d);a?a.push(...e):u(e),t.$$.on_mount=[]})),r.forEach(L)}function X(t,e){const n=t.$$;null!==n.fragment&&(u(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(t,e){-1===t.$$.dirty[0]&&(_.push(t),F||(F=!0,D.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,n,o,i,s,r=[-1]){const c=I;j(t);const d=t.$$={fragment:null,ctx:null,props:s,update:a,not_equal:i,bound:l(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c?c.$$.context:e.context||[]),callbacks:l(),dirty:r,skip_bound:!1};let f=!1;if(d.ctx=n?n(t,e.props||{},((e,n,...o)=>{const s=o.length?o[0]:n;return d.ctx&&i(d.ctx[e],d.ctx[e]=s)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](s),f&&Y(t,e)),n})):[],d.update(),f=!0,u(d.before_update),d.fragment=!!o&&o(d.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);d.fragment&&d.fragment.l(t),t.forEach(x)}else d.fragment&&d.fragment.c();e.intro&&G(t.$$.fragment),Q(t,e.target,e.anchor,e.customElement),O()}j(c)}class et{$destroy(){X(this,1),this.$destroy=a}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function nt(t){let e,n,o,i,s;const a=t[5].default,r=h(a,t,t[4],null);return{c(){e=v("span"),r&&r.c(),S(e,"class",n="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"),S(e,"title",t[0])},m(n,a){w(n,e,a),r&&r.m(e,null),o=!0,i||(s=k(e,"click",t[2]),i=!0)},p(t,[i]){r&&r.p&&(!o||16&i)&&$(r,a,t,t[4],i,null,null),(!o||2&i&&n!==(n="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"))&&S(e,"class",n),(!o||1&i)&&S(e,"title",t[0])},i(t){o||(G(r,t),o=!0)},o(t){J(r,t),o=!1},d(t){t&&x(e),r&&r.d(t),i=!1,s()}}}function ot(t,e,n){let{$$slots:o={},$$scope:i}=e,{title:s}=e,{link:a="/"}=e,{color:r}=e;return t.$$set=t=>{"title"in t&&n(0,s=t.title),"link"in t&&n(3,a=t.link),"color"in t&&n(1,r=t.color),"$$scope"in t&&n(4,i=t.$$scope)},[s,r,()=>window.singleSpaNavigate(a),a,i,o]}const{loggedIn:it}=n,st=async(t,e)=>{const n={};return t&&(n.event={id:t}),e&&(n.task={id:e}),(await axios.post("/api/read/commChat",n)).data.filter((e=>t?e.event&&e.event.id===t:!e.event)).filter((t=>e?t.task&&t.task.id===e:!t.task))},at=(t,e)=>{if(e.id.c){for(let n in t)if(t[n].id.c[0]==e.id.c[0]&&t[n].id.c[1]==e.id.c[1])return n}else for(let n in t)if(t[n].id==e.id)return n;return-1},{loggedIn:rt}=n,ct=async(t,e)=>{const n={};return t&&(n.event={id:t}),e&&(n.task={id:e}),(await axios.post("/api/read/commFeedback",n)).data.filter((e=>t?e.event&&e.event.id===t:!e.event)).filter((t=>e?t.task&&t.task.id===e:!t.task))};let lt;lt=[{id:"0001",email:"andrea.zirn@fhnw.ch",firstName:"Andrea",lastName:"Zirn",jobDescription:"Softwaredeveloper, Design Guru",status:"busy"},{id:"0002",email:"cloe.huesser@fhnw.ch",firstName:"Cloe",lastName:"Hüsser",jobDescription:"Softwaredeveloper, Javascript Hacker",status:"online"},{id:"0003",email:"simone.beck@fhnw.ch",firstName:"Simone",lastName:"Beck",jobDescription:"HR Verantwortliche",status:"offline"},{id:"0004",email:"shenia.scherer@fhnw.ch",firstName:"Shenia",lastName:"Scherer",jobDescription:"IIT Praktikantin",status:"offline"},{id:"0005",email:"puijanjenny.tran@students.fhnw.ch",firstName:"Jenny",lastName:"Tran",jobDescription:"IP-6 Studentin",status:"offline"},{id:"0006",email:"sinead.ganz@students.fhnw.ch",firstName:"Sinead",lastName:"Ganz",jobDescription:"IP-6 Studentin",status:"offline"}];let ut=[{id:"001",userId:"001",type:"info",title:"Neuer Mitarbeiter",description:"Es wurde eine neue Mitarbeiterin Simone Beck in der Firma erfasst.",date:"01.01.2022",eventId:"609b5bf30071894811577c06",read:!1},{id:"001",userId:"002",type:"info",title:"Neuer Mitarbeiter",description:"Es wurde eine neue Mitarbeiterin Simone Beck in der Firma erfasst.",date:"01.01.2022",eventId:"609b5bf30071894811577c06",read:!1}];let dt=[{id:"0000",userId:"0000",moduleList:[{moduleId:1111,position:0},{moduleId:9999,position:1}]},{id:"0001",userId:"0001",moduleList:[{moduleId:1111,position:0},{moduleId:2222,position:1},{moduleId:3333,position:2},{moduleId:4444,position:3}]}];let ft=[{id:"001",role:"Kundenmanager",user:"002"},{id:"002",role:"HR",user:"003"},{id:"003",role:"Projektleiter",user:"001"},{id:"004",role:"Software Developer",user:"001"},{id:"005",role:"Software Developer",user:"002"}];let pt=[{id:1111,name:"TaskModule",text:"Alle Tasks",status:!1,6:o.item({x:0,y:0,w:2,h:5,fixed:!0}),5:o.item({x:0,y:0,w:2,h:5,fixed:!0}),4:o.item({x:0,y:0,w:2,h:5,fixed:!0}),3:o.item({x:0,y:0,w:2,h:5,fixed:!0}),2:o.item({x:0,y:0,w:1,h:5,fixed:!0}),1:o.item({x:0,y:0,w:1,h:5,fixed:!0})},{id:3333,name:"Chat Modul",text:"Chat",status:!1,6:o.item({x:2,y:0,w:1,h:5,fixed:!0}),5:o.item({x:2,y:0,w:1,h:5,fixed:!0}),4:o.item({x:2,y:0,w:1,h:5,fixed:!0}),3:o.item({x:2,y:0,w:1,h:5,fixed:!0}),2:o.item({x:2,y:0,w:1,h:5,fixed:!0}),1:o.item({x:2,y:0,w:1,h:5,fixed:!0})},{id:4444,name:"Feedback Modul",text:"Feedback",status:!1,6:o.item({x:3,y:0,w:1,h:5,fixed:!0}),5:o.item({x:3,y:0,w:1,h:5,fixed:!0}),4:o.item({x:3,y:0,w:1,h:5,fixed:!0}),3:o.item({x:3,y:0,w:1,h:5,fixed:!0}),2:o.item({x:3,y:0,w:1,h:5,fixed:!0}),1:o.item({x:3,y:0,w:1,h:5,fixed:!0})},{id:9999,name:"Neues Modul",text:"+",status:!1,6:o.item({x:3,y:3,w:1,h:2}),5:o.item({x:3,y:3,w:1,h:2}),4:o.item({x:3,y:3,w:1,h:2}),3:o.item({x:3,y:3,w:1,h:2}),2:o.item({x:3,y:3,w:1,h:2}),1:o.item({x:3,y:3,w:1,h:2})}];const{cacheValidator:mt,onLogout:ht}=n;e.interceptors.response.use((t=>203===t.status?Promise.reject(t.data.error):t),(t=>400===t.response.status?(ht(),Promise.reject(t)):t));let gt=new Map;const $t=t=>(...e)=>{const n=m(mt),o=n.tenant;"invalid"===n.status&&(gt=new Map,mt.set({tenant:o,status:""}));const i=[].concat(t.name,e).join("-");let s=gt.get(i);if(!s)try{s=t(...e),gt.set(i,s)}catch(t){throw t}return s};var yt={getSchema:$t((t=>axios.get("/api/schema/"+t).then((t=>t.data)).catch((e=>{throw`schema with id ${t} not found`})))),getSchemas:$t((async()=>(await axios.get("/api/schema")).data)),getSchemaByClass:$t((async t=>(await axios.get(`/api/schemabyclass/${t}`)).data)),getEvents:()=>axios.get("/api/event").then((t=>t.data)).catch((t=>{throw"Events not found"})),getEvent:$t((t=>axios.get("/api/event/"+t).then((t=>t.data)).catch((e=>{throw`Event with id ${t} not found`})))),getTask:(t,e)=>axios.get(`/api/task/${t}:${e}?display=form`).then((t=>t.data)).catch((t=>{throw"task not found"})),getTaskList:async(t,e)=>(await axios.get(`/api/task/${t}:${e}?display=list`)).data,getTasksList:t=>axios.get(`/api/tasks/${t}?display=list`).then((t=>t.data)).catch((t=>{throw"list not found"})),getTaskById:async t=>(await axios.post("/api/read/_task",{_id:t})).data[0],getTaskqueue:()=>axios.post("/api/taskqueue",{id:!1}).then((t=>t.data)).catch((t=>{throw"queue not found"})),saveData:async(t,e)=>(await axios.post(`/api/${t}`,e)).data.id,deleteTask:async t=>(await axios.delete(`/api/_task/${t}`)).data,savePlugins:async(t,e)=>(await axios.post("/api/plugin",t,e)).data,savePlugin:async(t,e)=>(await axios.post(`/api/plugin/${t}`,e)).data,deletePlugin:async t=>(await axios.delete(`/api/plugin/${t}`)).data,getAuthStatus:async t=>(await axios.post("/api/auth/status",{email:t})).data,getUserSettings:async()=>(await axios.get("/api/user")).data,saveUserSettings:async t=>(await axios.post("/api/user",t)).data,saveDefaultSettings:async(t,e)=>{let n={schema:"http://json-schema.org/draft-04/schema#",id:e,email:t,firstName:"",lastName:"",jobDescription:"",role:[],setting:{showJobDescription:!0,dashboardLayout:[{id:"0000",activated:!0,days:["Mo","Tu","We","Th","Fr","Sa","Su"],moduleList:[{moduleId:"1111",position:"0"},{moduleId:"9999",position:"1"}]}],notificationActivated:!0,showNotifications:!0,notificationToMail:!1,typesOfNotification:[]}};return(await axios.post("/api/user",n)).data},authEnroll:async t=>(await axios.post("/api/auth/enroll",t)).data,authLogin:async(t,e)=>(await axios.post("/api/auth/login",{username:t,passcode:e})).data,authLogout:async()=>await axios.post("/api/auth/logout"),setTenant:async t=>(await axios.post("/api/auth/tenant",{id:t})).data,getChat:st,saveChat:async(t,e,n)=>{const o={};t&&(o.event={id:t}),e&&(o.task={id:e});let i=await st(t,e);i[0]||(i=[...i,{...o}]);const{user:s}=m(it);let a=at(i[0].messages,n);return i[0].messages&&a>=0?i[0].messages[a]=n:(n.sender=s,i[0].messages=(i[0].messages||[]).concat(n)),console.log("chat saved",i[0]),(await axios.post("/api/commChat",i[0])).data.id},getFeedback:ct,saveFeedback:async(t,e,n,o,i)=>{const s={};t&&(s.event={id:t}),e&&(s.task={id:e});let a=await ct(t,e);if(a[0]&&null!=i){let t=a.filter((t=>t._id===i));t={...t,...o};const{user:e}=m(rt);return n.sender=e,t[0].messages=(t[0].messages||[]).concat(n),console.log("has id",t[0].messages),(await axios.post("/api/commFeedback",t[0])).data.id}{a={...s},a={...a,...o};const{user:t}=m(rt);return n.sender=t,a.messages=(a.messages||[]).concat(n),console.log("new feedback",a),(await axios.post("/api/commFeedback",a)).data.id}},getUser:t=>lt.filter((e=>e.email==t)),getSettings:t=>dt.filter((e=>e.userId===t))[0],getNotifications:t=>ut.filter((e=>e.userId===t)),getRoles:t=>ft.filter((e=>e.user===t)),getModules:t=>pt.filter((e=>t.includes(e.id))),getAllModules:()=>pt};const wt=Intl.NumberFormat().formatToParts(1.1).find((({type:t})=>"decimal"===t)).value||".",xt=t=>"function"==typeof t,vt=t=>t&&t.toString,bt=(t,...e)=>e.includes(t),kt=t=>bt(t,void 0,null),St=t=>!kt(t),It=(t=null,e,...n)=>{try{return e(...n)}catch{return t}},jt=t=>(e,...n)=>It(It("",t.toString),e,...n),Et=(t,e=2,n=0,o=t.toString(),i=n.toString())=>i.repeat(e-o.length)+o,Nt=(t,e=window)=>({listen(n,o){e[`${n}EventListener`](t,o)},start(t){this.listen("add",t)},stop(t){this.listen("remove",t)}}),_t=(...t)=>!t.map((({value:t,check:e,text:n})=>e(t)||Tt(console.error,n))).every(Boolean),Ct=t=>(e,n)=>(Promise.resolve(n).then(e),t),Mt=Ct(!0),Tt=Ct(!1);t("util",Object.freeze({__proto__:null,decimalSeparator:wt,isFunction:xt,isStringable:vt,isObjEmpty:(t={})=>!Object.keys(t).length,hasValue:bt,isNullish:kt,isNotNullish:St,bestValue:(t,...e)=>e.concat(t).find(St),tryCatch:It,ensureStrValue:jt,padLeft:(...t)=>jt(t[0])(Et,...t),showupElement:(t="",e=0,n=document.getElementById(t))=>n&&n.style&&(n.style.display="block",setTimeout((()=>n.style.display="none"),e)),getListener:Nt,isMissing:_t,go:Mt,stop:Tt}));const Dt="single-spa:routing-event",Ft=Nt(Dt);function Lt(t,{modulePath:e,update:n}){if(!1===n)return;if(_t({value:n,check:xt,text:"<update> should be a function (dataListener)"},{value:e,check:vt,text:"<modulePath> should be a string (dataListener)"}))return;const o=e.toString()||"/",i=e=>{const i=e.currentTarget.location.pathname,[,s,...a]=i.split("/");o===(s||"/")&&t.dispatchEvent(new CustomEvent("data",{detail:{data:n(...a)}}))};return Ft.start(i),{destroy:()=>Ft.stop(i)}}const Pt=()=>window.dispatchEvent(new CustomEvent(Dt)),At=t=>({prop:4&t,tenant:8&t,user:8&t}),Bt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),Ot=t=>({err:4&t,prop:4&t,tenant:8&t,user:8&t}),zt=t=>({err:t[12],prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),Ht=t=>({prop:4&t,tenant:8&t,user:8&t}),qt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),Vt=t=>({prop:4&t,tenant:8&t,user:8&t}),Rt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user});function Gt(t){let e;const n=t[8].init,o=h(n,t,t[7],Bt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,At,Bt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Jt(t){let e,n,o,i={ctx:t,current:null,token:null,hasCatch:!0,pending:Wt,then:Kt,catch:Ut,value:11,error:12,blocks:[,,,]};return U(n=t[2],i),{c(){e=b(),i.block.c()},m(t,n){w(t,e,n),i.block.m(t,i.anchor=n),i.mount=()=>e.parentNode,i.anchor=e,o=!0},p(e,o){t=e,i.ctx=t,4&o&&n!==(n=t[2])&&U(n,i)||K(i,t,o)},i(t){o||(G(i.block),o=!0)},o(t){for(let t=0;t<3;t+=1){J(i.blocks[t])}o=!1},d(t){t&&x(e),i.block.d(t),i.token=null,i=null}}}function Ut(t){let e;const n=t[8].error,o=h(n,t,t[7],zt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,Ot,zt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Kt(t){let e;const n=t[8].default,o=h(n,t,t[7],qt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,Ht,qt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Wt(t){let e,n,o,i={ctx:t,current:null,token:null,hasCatch:!1,pending:Xt,then:Qt,catch:Zt,value:10,blocks:[,,,]};return U(n=t[5](t[1]),i),{c(){e=b(),i.block.c()},m(t,n){w(t,e,n),i.block.m(t,i.anchor=n),i.mount=()=>e.parentNode,i.anchor=e,o=!0},p(e,o){t=e,i.ctx=t,2&o&&n!==(n=t[5](t[1]))&&U(n,i)||K(i,t,o)},i(t){o||(G(i.block),o=!0)},o(t){for(let t=0;t<3;t+=1){J(i.blocks[t])}o=!1},d(t){t&&x(e),i.block.d(t),i.token=null,i=null}}}function Zt(t){return{c:a,m:a,p:a,i:a,o:a,d:a}}function Qt(t){let e;const n=t[8].load,o=h(n,t,t[7],Rt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,Vt,Rt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Xt(t){return{c:a,m:a,p:a,i:a,o:a,d:a}}function Yt(t){let e,n,o,i,s,r,c;const l=[Jt,Gt],f=[];function p(t,e){return t[2]?0:1}return n=p(t),o=f[n]=l[n](t),{c(){e=v("section"),o.c(),S(e,"class","data")},m(o,l){var u;w(o,e,l),f[n].m(e,null),s=!0,r||(c=[(u=i=Lt.call(null,e,t[0]),u&&d(u.destroy)?u.destroy:a),k(e,"data",t[9])],r=!0)},p(t,[s]){let a=n;n=p(t),n===a?f[n].p(t,s):(V(),J(f[a],1,1,(()=>{f[a]=null})),R(),o=f[n],o?o.p(t,s):(o=f[n]=l[n](t),o.c()),G(o,1),o.m(e,null)),i&&d(i.update)&&1&s&&i.update.call(null,t[0])},i(t){s||(G(o),s=!0)},o(t){J(o),s=!1},d(t){t&&x(e),f[n].d(),r=!1,u(c)}}}function te(t,e,o){let i,{$$slots:s={},$$scope:a}=e;const{loggedIn:r}=n;var c,l;c=r,l=t=>o(3,i=t),t.$$.on_destroy.push(p(c,l));let u,{options:d}=e,{update:f=!1}=e,{loadingDelay:m=250}=e;f&&(d={update:f,modulePath:window.location.pathname.split("/")[1]||"/"});return t.$$set=t=>{"options"in t&&o(0,d=t.options),"update"in t&&o(6,f=t.update),"loadingDelay"in t&&o(1,m=t.loadingDelay),"$$scope"in t&&o(7,a=t.$$scope)},[d,m,u,i,r,t=>new Promise((e=>setTimeout(e,t))),f,a,s,({detail:t})=>o(2,u=t.data)]}function ee(t){let e,n;const o=[{class:"full-width"},{style:t[0]},{inputClass:t[1]||"form"},{multiline:!0},{id:t[2]},{value:t[3]},{rows:t[4]},t[7]];let i={};for(let t=0;t<o.length;t+=1)i=r(i,o[t]);return e=new t[5]({props:i}),e.$on("change",t[6]),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,[n]){const i=159&n?function(t,e){const n={},o={},i={$$scope:1};let s=t.length;for(;s--;){const a=t[s],r=e[s];if(r){for(const t in a)t in r||(o[t]=1);for(const t in r)i[t]||(n[t]=r[t],i[t]=1);t[s]=r}else for(const t in a)i[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(o,[o[0],1&n&&{style:t[0]},2&n&&{inputClass:t[1]||"form"},o[3],4&n&&{id:t[2]},8&n&&{value:t[3]},16&n&&{rows:t[4]},128&n&&(s=t[7],"object"==typeof s&&null!==s?s:{})]):{};var s;e.$set(i)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ne(t,e,n){const o=["noForm","id","value","style","rows"];let s=y(e,o);const a=N(),{TextField:c}=i;let{noForm:l=""}=e,{id:u}=e,{value:d}=e,{style:f=""}=e,{rows:p=3}=e;f+=" padding-bottom: .5em;";const m=5*(p>1),h=()=>{const t=document.getElementById(u);if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n+m}px`)};return t.$$set=t=>{e=r(r({},e),function(t){const e={};for(const n in t)"$"!==n[0]&&(e[n]=t[n]);return e}(t)),n(7,s=y(e,o)),"noForm"in t&&n(1,l=t.noForm),"id"in t&&n(2,u=t.id),"value"in t&&n(3,d=t.value),"style"in t&&n(0,f=t.style),"rows"in t&&n(4,p=t.rows)},t.$$.update=()=>{8&t.$$.dirty&&d&&setTimeout(h)},[f,l,u,d,p,c,({detail:{value:t}})=>a("blur",{value:t}),s]}function oe(t){let e,n;return e=new s({props:{style:"min-width: 25em; overflow-y: hidden; resize: none;",id:t[0],value:t[1]}}),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,[n]){const o={};1&n&&(o.id=t[0]),2&n&&(o.value=t[1]),e.$set(o)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ie(t,e,n){let{id:o}=e,{value:i}=e;return t.$$set=t=>{"id"in t&&n(0,o=t.id),"value"in t&&n(1,i=t.value)},[o,i]}class se extends et{constructor(t){super(),tt(this,t,ie,oe,f,{id:0,value:1})}}function ae(t){let e,n,o;function i(e){t[7](e)}let s={id:t[5]};return void 0!==t[2]&&(s.value=t[2]),e=new se({props:s}),C.push((()=>W(e,"value",i))),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,o){const i={};!n&&4&o&&(n=!0,i.value=t[2],P((()=>n=!1))),e.$set(i)},i(t){o||(G(e.$$.fragment,t),o=!0)},o(t){J(e.$$.fragment,t),o=!1},d(t){X(e,t)}}}function re(t){let e,n;return e=new t[4]({props:{title:t[0],closeCallback:t[10],$$slots:{default:[ae]},$$scope:{ctx:t}}}),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.title=t[0]),1024&n&&(o.closeCallback=t[10]),2052&n&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ce(t){let e,n,o;function i(e){t[8](e)}let s={$$slots:{default:[re,({closeCallback:t})=>({10:t}),({closeCallback:t})=>t?1024:0]},$$scope:{ctx:t}};return void 0!==t[1]&&(s.open=t[1]),e=new t[3]({props:s}),C.push((()=>W(e,"open",i))),e.$on("change",t[9]),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,[o]){const i={};3077&o&&(i.$$scope={dirty:o,ctx:t}),!n&&2&o&&(n=!0,i.open=t[1],P((()=>n=!1))),e.$set(i)},i(t){o||(G(e.$$.fragment,t),o=!0)},o(t){J(e.$$.fragment,t),o=!1},d(t){X(e,t)}}}function le(t,e,n){const{Modal:o,Dialog:s}=i;let a,{title:r}=e,{showMessage:c}=e,l="";return c=t=>{n(2,l=[].concat(t).join("\n")),n(1,a=!0)},t.$$set=t=>{"title"in t&&n(0,r=t.title),"showMessage"in t&&n(6,c=t.showMessage)},[r,a,l,o,s,"modalDialog",c,function(t){l=t,n(2,l)},function(t){a=t,n(1,a)},function(e){!function(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((t=>t(e)))}(t,e)}]}t("version","0.2.22");const ue=window.sessionStorage;ue.clear();t("Storage",{getItem:t=>ue.getItem(t),setItem:(t,e)=>ue.setItem(t,e)}),t("LinkIcon",class extends et{constructor(t){var e,n,o;super(),document.getElementById("svelte-1jng2dw-style")||((o=v("style")).id="svelte-1jng2dw-style",o.textContent=".red.svelte-1jng2dw{background-color:var(--m-color-red-light)}.blue.svelte-1jng2dw{background-color:var(--m-color-blue-light)}.green.svelte-1jng2dw{background-color:var(--m-color-green-light)}.icon.svelte-1jng2dw{max-height:1.2em}",e=document.head,n=o,e.appendChild(n)),tt(this,t,ot,nt,f,{title:0,link:3,color:1})}}),t("Page",class extends et{constructor(t){super(),tt(this,t,te,Yt,f,{options:0,update:6,loadingDelay:1})}}),t("Request",yt),t("TextArea",class extends et{constructor(t){super(),tt(this,t,ne,ee,f,{noForm:1,id:2,value:3,style:0,rows:4})}}),t("ModalDialog",class extends et{constructor(t){super(),tt(this,t,le,ce,f,{title:0,showMessage:6})}})}}}));
1
+ System.register(["axios","@enablerr-ui/auth","@enablerr-ui/layout","@enablerr-ui/form"],(function(t){"use strict";var e,n,o,i,s;return{setters:[function(t){e=t.default},function(t){n=t.user},function(t){o=t.getGridHelp,i=t.getAttractions},function(t){s=t.TextArea}],execute:function(){function a(){}function r(t,e){for(const n in e)t[n]=e[n];return t}function c(t){return t()}function l(){return Object.create(null)}function u(t){t.forEach(c)}function d(t){return"function"==typeof t}function f(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function p(t,...e){if(null==t)return a;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function m(t){let e;return p(t,(t=>e=t))(),e}function h(t,e,n,o){if(t){const i=g(t,e,n,o);return t[0](i)}}function g(t,e,n,o){return t[1]&&o?r(n.ctx.slice(),t[1](o(e))):n.ctx}function $(t,e,n,o,i,s,a){const r=function(t,e,n,o){if(t[2]&&o){const i=t[2](o(n));if(void 0===e.dirty)return i;if("object"==typeof i){const t=[],n=Math.max(e.dirty.length,i.length);for(let o=0;o<n;o+=1)t[o]=e.dirty[o]|i[o];return t}return e.dirty|i}return e.dirty}(e,o,i,s);if(r){const i=g(e,n,o,a);t.p(i,r)}}function y(t,e){const n={};e=new Set(e);for(const o in t)e.has(o)||"$"===o[0]||(n[o]=t[o]);return n}function w(t,e,n){t.insertBefore(e,n||null)}function v(t){t.parentNode.removeChild(t)}function b(t){return document.createElement(t)}function x(){return t="",document.createTextNode(t);var t}function k(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function I(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}let S;function E(t){S=t}function j(){if(!S)throw new Error("Function called outside component initialization");return S}function N(){const t=j();return(e,n)=>{const o=t.$$.callbacks[e];if(o){const i=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}(e,n);o.slice().forEach((e=>{e.call(t,i)}))}}}const _=[],C=[],T=[],M=[],D=Promise.resolve();let L=!1;function F(t){T.push(t)}function P(t){M.push(t)}let A=!1;const B=new Set;function O(){if(!A){A=!0;do{for(let t=0;t<_.length;t+=1){const e=_[t];E(e),z(e.$$)}for(E(null),_.length=0;C.length;)C.pop()();for(let t=0;t<T.length;t+=1){const e=T[t];B.has(e)||(B.add(e),e())}T.length=0}while(_.length);for(;M.length;)M.pop()();L=!1,A=!1,B.clear()}}function z(t){if(null!==t.fragment){t.update(),u(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(F)}}const H=new Set;let q;function V(){q={r:0,c:[],p:q}}function R(){q.r||u(q.c),q=q.p}function G(t,e){t&&t.i&&(H.delete(t),t.i(e))}function J(t,e,n,o){if(t&&t.o){if(H.has(t))return;H.add(t),q&&q.c.push((()=>{H.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}function U(t,e){const n=e.token={};function o(t,o,i,s){if(e.token!==n)return;e.resolved=s;let a=e.ctx;void 0!==i&&(a=a.slice(),a[i]=s);const r=t&&(e.current=t)(a);let c=!1;e.block&&(e.blocks?e.blocks.forEach(((t,n)=>{n!==o&&t&&(V(),J(t,1,1,(()=>{e.blocks[n]===t&&(e.blocks[n]=null)})),R())})):e.block.d(1),r.c(),G(r,1),r.m(e.mount(),e.anchor),c=!0),e.block=r,e.blocks&&(e.blocks[o]=r),c&&O()}if((i=t)&&"object"==typeof i&&"function"==typeof i.then){const n=j();if(t.then((t=>{E(n),o(e.then,1,e.value,t),E(null)}),(t=>{if(E(n),o(e.catch,2,e.error,t),E(null),!e.hasCatch)throw t})),e.current!==e.pending)return o(e.pending,0),!0}else{if(e.current!==e.then)return o(e.then,1,e.value,t),!0;e.resolved=t}var i}function K(t,e,n){const o=e.slice(),{resolved:i}=t;t.current===t.then&&(o[t.value]=i),t.current===t.catch&&(o[t.error]=i),t.block.p(o,n)}function W(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}function Z(t){t&&t.c()}function Q(t,e,n,o){const{fragment:i,on_mount:s,on_destroy:a,after_update:r}=t.$$;i&&i.m(e,n),o||F((()=>{const e=s.map(c).filter(d);a?a.push(...e):u(e),t.$$.on_mount=[]})),r.forEach(F)}function X(t,e){const n=t.$$;null!==n.fragment&&(u(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(t,e){-1===t.$$.dirty[0]&&(_.push(t),L||(L=!0,D.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,n,o,i,s,r=[-1]){const c=S;E(t);const d=t.$$={fragment:null,ctx:null,props:s,update:a,not_equal:i,bound:l(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(c?c.$$.context:e.context||[]),callbacks:l(),dirty:r,skip_bound:!1};let f=!1;if(d.ctx=n?n(t,e.props||{},((e,n,...o)=>{const s=o.length?o[0]:n;return d.ctx&&i(d.ctx[e],d.ctx[e]=s)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](s),f&&Y(t,e)),n})):[],d.update(),f=!0,u(d.before_update),d.fragment=!!o&&o(d.ctx),e.target){if(e.hydrate){const t=function(t){return Array.from(t.childNodes)}(e.target);d.fragment&&d.fragment.l(t),t.forEach(v)}else d.fragment&&d.fragment.c();e.intro&&G(t.$$.fragment),Q(t,e.target,e.anchor,e.customElement),O()}E(c)}class et{$destroy(){X(this,1),this.$destroy=a}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function nt(t){let e,n,o,i,s;const a=t[5].default,r=h(a,t,t[4],null);return{c(){e=b("span"),r&&r.c(),I(e,"class",n="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"),I(e,"title",t[0])},m(n,a){w(n,e,a),r&&r.m(e,null),o=!0,i||(s=k(e,"click",t[2]),i=!0)},p(t,[i]){r&&r.p&&(!o||16&i)&&$(r,a,t,t[4],i,null,null),(!o||2&i&&n!==(n="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"))&&I(e,"class",n),(!o||1&i)&&I(e,"title",t[0])},i(t){o||(G(r,t),o=!0)},o(t){J(r,t),o=!1},d(t){t&&v(e),r&&r.d(t),i=!1,s()}}}function ot(t,e,n){let{$$slots:o={},$$scope:i}=e,{title:s}=e,{link:a="/"}=e,{color:r}=e;return t.$$set=t=>{"title"in t&&n(0,s=t.title),"link"in t&&n(3,a=t.link),"color"in t&&n(1,r=t.color),"$$scope"in t&&n(4,i=t.$$scope)},[s,r,()=>window.singleSpaNavigate(a),a,i,o]}const{loggedIn:it}=n,st=async(t,e)=>{const n={};return t&&(n.event={id:t}),e&&(n.task={id:e}),(await axios.post("/api/read/commChat",n)).data.filter((e=>t?e.event&&e.event.id===t:!e.event)).filter((t=>e?t.task&&t.task.id===e:!t.task))},at=(t,e)=>{if(e.id.c){for(let n in t)if(t[n].id.c[0]==e.id.c[0]&&t[n].id.c[1]==e.id.c[1])return n}else for(let n in t)if(t[n].id==e.id)return n;return-1},{loggedIn:rt}=n,ct=async(t,e)=>{const n={};return t&&(n.event={id:t}),e&&(n.task={id:e}),(await axios.post("/api/read/commFeedback",n)).data.filter((e=>t?e.event&&e.event.id===t:!e.event)).filter((t=>e?t.task&&t.task.id===e:!t.task))};let lt;lt=[{id:"0001",email:"andrea.zirn@fhnw.ch",firstName:"Andrea",lastName:"Zirn",jobDescription:"Softwaredeveloper, Design Guru",status:"busy"},{id:"0002",email:"cloe.huesser@fhnw.ch",firstName:"Cloe",lastName:"Hüsser",jobDescription:"Softwaredeveloper, Javascript Hacker",status:"online"},{id:"0003",email:"simone.beck@fhnw.ch",firstName:"Simone",lastName:"Beck",jobDescription:"HR Verantwortliche",status:"offline"},{id:"0004",email:"shenia.scherer@fhnw.ch",firstName:"Shenia",lastName:"Scherer",jobDescription:"IIT Praktikantin",status:"offline"},{id:"0005",email:"puijanjenny.tran@students.fhnw.ch",firstName:"Jenny",lastName:"Tran",jobDescription:"IP-6 Studentin",status:"offline"},{id:"0006",email:"sinead.ganz@students.fhnw.ch",firstName:"Sinead",lastName:"Ganz",jobDescription:"IP-6 Studentin",status:"offline"}];let ut=[{id:"001",userId:"001",type:"info",title:"Neuer Mitarbeiter",description:"Es wurde eine neue Mitarbeiterin Simone Beck in der Firma erfasst.",date:"01.01.2022",eventId:"609b5bf30071894811577c06",read:!1},{id:"001",userId:"002",type:"info",title:"Neuer Mitarbeiter",description:"Es wurde eine neue Mitarbeiterin Simone Beck in der Firma erfasst.",date:"01.01.2022",eventId:"609b5bf30071894811577c06",read:!1}];let dt=[{id:"0001",userId:"0001",moduleList:[{moduleId:1111,position:0},{moduleId:2222,position:1}]},{id:"0002",userId:"0002",moduleList:[{moduleId:1111,position:0},{moduleId:2222,position:3},{moduleId:3333,position:2},{moduleId:4444,position:2}]},{id:"0003",userId:"0004",moduleList:[{moduleId:1111,position:0},{moduleId:2222,position:1}]},{id:"0004",userId:"0005",moduleList:[{moduleId:1111,position:0},{moduleId:9999,position:1}]},{id:"0001",userId:"0001",moduleList:[{moduleId:1111,position:0},{moduleId:2222,position:1},{moduleId:3333,position:2},{moduleId:4444,position:3}]}];let ft=[{id:"001",role:"Kundenmanager",user:"002"},{id:"002",role:"HR",user:"003"},{id:"003",role:"Projektleiter",user:"001"},{id:"004",role:"Software Developer",user:"001"},{id:"005",role:"Software Developer",user:"002"}];let pt=[{id:1111,name:"TaskModule",text:"Alle Tasks",status:!1,6:o.item({x:0,y:0,w:2,h:5}),5:o.item({x:0,y:0,w:2,h:5}),4:o.item({x:0,y:0,w:2,h:5}),3:o.item({x:0,y:0,w:2,h:5}),2:o.item({x:0,y:0,w:1,h:5}),1:o.item({x:0,y:0,w:1,h:5})},{id:3333,name:"Chat Modul",text:"Chat",status:!1,6:o.item({x:3,y:0,w:1,h:5}),5:o.item({x:3,y:0,w:1,h:5}),4:o.item({x:3,y:0,w:1,h:5}),3:o.item({x:3,y:0,w:1,h:5}),2:o.item({x:3,y:0,w:1,h:5}),1:o.item({x:3,y:0,w:1,h:5})},{id:4444,name:"Feedback Modul",text:"Feedback",status:!1,6:o.item({x:4,y:0,w:1,h:5}),5:o.item({x:4,y:0,w:1,h:5}),4:o.item({x:4,y:0,w:1,h:5}),3:o.item({x:4,y:0,w:1,h:5}),2:o.item({x:4,y:0,w:1,h:5}),1:o.item({x:4,y:0,w:1,h:5})},{id:9999,name:"Neues Modul",text:"+",status:!1,6:o.item({x:2,y:0,w:1,h:2}),5:o.item({x:2,y:0,w:1,h:2}),4:o.item({x:2,y:0,w:1,h:2}),3:o.item({x:2,y:0,w:1,h:2}),2:o.item({x:2,y:0,w:1,h:2}),1:o.item({x:2,y:0,w:1,h:2})}];const{cacheValidator:mt,onLogout:ht}=n;e.interceptors.response.use((t=>203===t.status?Promise.reject(t.data.error):t),(t=>400===t.response.status?(ht(),Promise.reject(t)):t));let gt=new Map;const $t=t=>(...e)=>{const n=m(mt),o=n.tenant;"invalid"===n.status&&(gt=new Map,mt.set({tenant:o,status:""}));const i=[].concat(t.name,e).join("-");let s=gt.get(i);if(!s)try{s=t(...e),gt.set(i,s)}catch(t){throw t}return s};var yt={getSchema:$t((t=>axios.get("/api/schema/"+t).then((t=>t.data)).catch((e=>{throw`schema with id ${t} not found`})))),getSchemas:$t((async()=>(await axios.get("/api/schema")).data)),getSchemaByClass:$t((async t=>(await axios.get(`/api/schemabyclass/${t}`)).data)),getEvents:()=>axios.get("/api/event").then((t=>t.data)).catch((t=>{throw"Events not found"})),getEvent:$t((t=>axios.get("/api/event/"+t).then((t=>t.data)).catch((e=>{throw`Event with id ${t} not found`})))),getTask:(t,e)=>axios.get(`/api/task/${t}:${e}?display=form`).then((t=>t.data)).catch((t=>{throw"task not found"})),getTaskList:async(t,e)=>(await axios.get(`/api/task/${t}:${e}?display=list`)).data,getTasksList:t=>axios.get(`/api/tasks/${t}?display=list`).then((t=>t.data)).catch((t=>{throw"list not found"})),getTaskById:async t=>(await axios.post("/api/read/_task",{_id:t})).data[0],getTaskqueue:()=>axios.post("/api/taskqueue",{id:!1}).then((t=>t.data)).catch((t=>{throw"queue not found"})),createTaskByEventId:async t=>(await axios.post("/api/workflow/task",{event:t})).data,saveData:async(t,e)=>(await axios.post(`/api/${t}`,e)).data.id,deleteTask:async t=>(await axios.delete(`/api/_task/${t}`)).data,savePlugins:async(t,e)=>(await axios.post("/api/plugin",t,e)).data,savePlugin:async(t,e)=>(await axios.post(`/api/plugin/${t}`,e)).data,deletePlugin:async t=>(await axios.delete(`/api/plugin/${t}`)).data,getAuthStatus:async t=>(await axios.post("/api/auth/status",{email:t})).data,getUserSettings:async()=>(await axios.get("/api/user")).data,saveUserSettings:async t=>(await axios.post("/api/user",t)).data,saveDefaultSettings:async(t,e)=>{let n={schema:"http://json-schema.org/draft-04/schema#",id:e,email:t,firstName:"",lastName:"",jobDescription:"",role:[],setting:{showJobDescription:!0,dashboardLayout:[{id:"0000",activated:!0,days:["Mo","Tu","We","Th","Fr","Sa","Su"],moduleList:[{moduleId:"1111",position:"0"},{moduleId:"9999",position:"1"}]}],notificationActivated:!0,showNotifications:!0,notificationToMail:!1,typesOfNotification:[]}};return(await axios.post("/api/user",n)).data},authEnroll:async t=>(await axios.post("/api/auth/enroll",t)).data,authLogin:async(t,e)=>(await axios.post("/api/auth/login",{username:t,passcode:e})).data,authLogout:async()=>await axios.post("/api/auth/logout"),setTenant:async t=>(await axios.post("/api/auth/tenant",{id:t})).data,getChat:st,saveChat:async(t,e,n)=>{const o={};t&&(o.event={id:t}),e&&(o.task={id:e});let i=await st(t,e);i[0]||(i=[...i,{...o}]);const{user:s}=m(it);let a=at(i[0].messages,n);return i[0].messages&&a>=0?(n.sender||(n.sender=s),i[0].messages[a]=n):(n.sender=s,i[0].messages=(i[0].messages||[]).concat(n)),console.log("chat saved",i[0]),(await axios.post("/api/commChat",i[0])).data.id},getFeedback:ct,saveFeedback:async(t,e,n,o,i)=>{const s={};t&&(s.event={id:t}),e&&(s.task={id:e});let a=await ct(t,e);if(a[0]&&null!=i){let t=a.filter((t=>t._id===i));t={...t,...o};const{user:e}=m(rt);return n.sender=e,t[0].messages=(t[0].messages||[]).concat(n),console.log("has id",t[0].messages),(await axios.post("/api/commFeedback",t[0])).data.id}{a={...s},a={...a,...o};const{user:t}=m(rt);return n.sender=t,a.messages=(a.messages||[]).concat(n),console.log("new feedback",a),(await axios.post("/api/commFeedback",a)).data.id}},getUser:t=>lt.filter((e=>e.email==t)),getSettings:t=>dt.filter((e=>e.userId===t))[0],getNotifications:t=>ut.filter((e=>e.userId===t)),getRoles:t=>ft.filter((e=>e.user===t)),getModules:t=>pt.filter((e=>t.includes(e.id))),getAllModules:()=>pt};const wt=Intl.NumberFormat().formatToParts(1.1).find((({type:t})=>"decimal"===t)).value||".",vt=t=>"function"==typeof t,bt=t=>t&&t.toString,xt=(t,...e)=>e.includes(t),kt=t=>xt(t,void 0,null),It=t=>!kt(t),St=(t=null,e,...n)=>{try{return e(...n)}catch{return t}},Et=t=>(e,...n)=>St(St("",t.toString),e,...n),jt=(t,e=2,n=0,o=t.toString(),i=n.toString())=>i.repeat(e-o.length)+o,Nt=(t,e=window)=>({listen(n,o){e[`${n}EventListener`](t,o)},start(t){this.listen("add",t)},stop(t){this.listen("remove",t)}}),_t=(...t)=>!t.map((({value:t,check:e,text:n})=>e(t)||Mt(console.error,n))).every(Boolean),Ct=t=>(e,n)=>(Promise.resolve(n).then(e),t),Tt=Ct(!0),Mt=Ct(!1);t("util",Object.freeze({__proto__:null,decimalSeparator:wt,isFunction:vt,isStringable:bt,isObjEmpty:(t={})=>!Object.keys(t).length,hasValue:xt,isNullish:kt,isNotNullish:It,bestValue:(t,...e)=>e.concat(t).find(It),tryCatch:St,ensureStrValue:Et,padLeft:(...t)=>Et(t[0])(jt,...t),showupElement:(t="",e=0,n=document.getElementById(t))=>n&&n.style&&(n.style.display="block",setTimeout((()=>n.style.display="none"),e)),getListener:Nt,isMissing:_t,go:Tt,stop:Mt}));const Dt="single-spa:routing-event",Lt=Nt(Dt);function Ft(t,{modulePath:e,update:n}){if(!1===n)return;if(_t({value:n,check:vt,text:"<update> should be a function (dataListener)"},{value:e,check:bt,text:"<modulePath> should be a string (dataListener)"}))return;const o=e.toString()||"/",i=e=>{const i=e.currentTarget.location.pathname,[,s,...a]=i.split("/");o===(s||"/")&&t.dispatchEvent(new CustomEvent("data",{detail:{data:n(...a)}}))};return Lt.start(i),{destroy:()=>Lt.stop(i)}}const Pt=()=>window.dispatchEvent(new CustomEvent(Dt)),At=t=>({prop:4&t,tenant:8&t,user:8&t}),Bt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),Ot=t=>({err:4&t,prop:4&t,tenant:8&t,user:8&t}),zt=t=>({err:t[12],prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),Ht=t=>({prop:4&t,tenant:8&t,user:8&t}),qt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),Vt=t=>({prop:4&t,tenant:8&t,user:8&t}),Rt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user});function Gt(t){let e;const n=t[8].init,o=h(n,t,t[7],Bt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,At,Bt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Jt(t){let e,n,o,i={ctx:t,current:null,token:null,hasCatch:!0,pending:Wt,then:Kt,catch:Ut,value:11,error:12,blocks:[,,,]};return U(n=t[2],i),{c(){e=x(),i.block.c()},m(t,n){w(t,e,n),i.block.m(t,i.anchor=n),i.mount=()=>e.parentNode,i.anchor=e,o=!0},p(e,o){t=e,i.ctx=t,4&o&&n!==(n=t[2])&&U(n,i)||K(i,t,o)},i(t){o||(G(i.block),o=!0)},o(t){for(let t=0;t<3;t+=1){J(i.blocks[t])}o=!1},d(t){t&&v(e),i.block.d(t),i.token=null,i=null}}}function Ut(t){let e;const n=t[8].error,o=h(n,t,t[7],zt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,Ot,zt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Kt(t){let e;const n=t[8].default,o=h(n,t,t[7],qt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,Ht,qt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Wt(t){let e,n,o,i={ctx:t,current:null,token:null,hasCatch:!1,pending:Xt,then:Qt,catch:Zt,value:10,blocks:[,,,]};return U(n=t[5](t[1]),i),{c(){e=x(),i.block.c()},m(t,n){w(t,e,n),i.block.m(t,i.anchor=n),i.mount=()=>e.parentNode,i.anchor=e,o=!0},p(e,o){t=e,i.ctx=t,2&o&&n!==(n=t[5](t[1]))&&U(n,i)||K(i,t,o)},i(t){o||(G(i.block),o=!0)},o(t){for(let t=0;t<3;t+=1){J(i.blocks[t])}o=!1},d(t){t&&v(e),i.block.d(t),i.token=null,i=null}}}function Zt(t){return{c:a,m:a,p:a,i:a,o:a,d:a}}function Qt(t){let e;const n=t[8].load,o=h(n,t,t[7],Rt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,i){o&&o.p&&(!e||140&i)&&$(o,n,t,t[7],i,Vt,Rt)},i(t){e||(G(o,t),e=!0)},o(t){J(o,t),e=!1},d(t){o&&o.d(t)}}}function Xt(t){return{c:a,m:a,p:a,i:a,o:a,d:a}}function Yt(t){let e,n,o,i,s,r,c;const l=[Jt,Gt],f=[];function p(t,e){return t[2]?0:1}return n=p(t),o=f[n]=l[n](t),{c(){e=b("section"),o.c(),I(e,"class","data")},m(o,l){var u;w(o,e,l),f[n].m(e,null),s=!0,r||(c=[(u=i=Ft.call(null,e,t[0]),u&&d(u.destroy)?u.destroy:a),k(e,"data",t[9])],r=!0)},p(t,[s]){let a=n;n=p(t),n===a?f[n].p(t,s):(V(),J(f[a],1,1,(()=>{f[a]=null})),R(),o=f[n],o?o.p(t,s):(o=f[n]=l[n](t),o.c()),G(o,1),o.m(e,null)),i&&d(i.update)&&1&s&&i.update.call(null,t[0])},i(t){s||(G(o),s=!0)},o(t){J(o),s=!1},d(t){t&&v(e),f[n].d(),r=!1,u(c)}}}function te(t,e,o){let i,{$$slots:s={},$$scope:a}=e;const{loggedIn:r}=n;var c,l;c=r,l=t=>o(3,i=t),t.$$.on_destroy.push(p(c,l));let u,{options:d}=e,{update:f=!1}=e,{loadingDelay:m=250}=e;f&&(d={update:f,modulePath:window.location.pathname.split("/")[1]||"/"});return t.$$set=t=>{"options"in t&&o(0,d=t.options),"update"in t&&o(6,f=t.update),"loadingDelay"in t&&o(1,m=t.loadingDelay),"$$scope"in t&&o(7,a=t.$$scope)},[d,m,u,i,r,t=>new Promise((e=>setTimeout(e,t))),f,a,s,({detail:t})=>o(2,u=t.data)]}function ee(t){let e,n;const o=[{class:"full-width"},{style:t[0]},{inputClass:t[1]||"form"},{multiline:!0},{id:t[2]},{value:t[3]},{rows:t[4]},t[7]];let i={};for(let t=0;t<o.length;t+=1)i=r(i,o[t]);return e=new t[5]({props:i}),e.$on("change",t[6]),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,[n]){const i=159&n?function(t,e){const n={},o={},i={$$scope:1};let s=t.length;for(;s--;){const a=t[s],r=e[s];if(r){for(const t in a)t in r||(o[t]=1);for(const t in r)i[t]||(n[t]=r[t],i[t]=1);t[s]=r}else for(const t in a)i[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(o,[o[0],1&n&&{style:t[0]},2&n&&{inputClass:t[1]||"form"},o[3],4&n&&{id:t[2]},8&n&&{value:t[3]},16&n&&{rows:t[4]},128&n&&(s=t[7],"object"==typeof s&&null!==s?s:{})]):{};var s;e.$set(i)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ne(t,e,n){const o=["noForm","id","value","style","rows"];let s=y(e,o);const a=N(),{TextField:c}=i;let{noForm:l=""}=e,{id:u}=e,{value:d}=e,{style:f=""}=e,{rows:p=3}=e;f+=" padding-bottom: .5em;";const m=5*(p>1),h=()=>{const t=document.getElementById(u);if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n+m}px`)};return t.$$set=t=>{e=r(r({},e),function(t){const e={};for(const n in t)"$"!==n[0]&&(e[n]=t[n]);return e}(t)),n(7,s=y(e,o)),"noForm"in t&&n(1,l=t.noForm),"id"in t&&n(2,u=t.id),"value"in t&&n(3,d=t.value),"style"in t&&n(0,f=t.style),"rows"in t&&n(4,p=t.rows)},t.$$.update=()=>{8&t.$$.dirty&&d&&setTimeout(h)},[f,l,u,d,p,c,({detail:{value:t}})=>a("blur",{value:t}),s]}function oe(t){let e,n;return e=new s({props:{style:"min-width: 25em; overflow-y: hidden; resize: none;",id:t[0],value:t[1]}}),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,[n]){const o={};1&n&&(o.id=t[0]),2&n&&(o.value=t[1]),e.$set(o)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ie(t,e,n){let{id:o}=e,{value:i}=e;return t.$$set=t=>{"id"in t&&n(0,o=t.id),"value"in t&&n(1,i=t.value)},[o,i]}class se extends et{constructor(t){super(),tt(this,t,ie,oe,f,{id:0,value:1})}}function ae(t){let e,n,o;function i(e){t[7](e)}let s={id:t[5]};return void 0!==t[2]&&(s.value=t[2]),e=new se({props:s}),C.push((()=>W(e,"value",i))),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,o){const i={};!n&&4&o&&(n=!0,i.value=t[2],P((()=>n=!1))),e.$set(i)},i(t){o||(G(e.$$.fragment,t),o=!0)},o(t){J(e.$$.fragment,t),o=!1},d(t){X(e,t)}}}function re(t){let e,n;return e=new t[4]({props:{title:t[0],closeCallback:t[10],$$slots:{default:[ae]},$$scope:{ctx:t}}}),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,n){const o={};1&n&&(o.title=t[0]),1024&n&&(o.closeCallback=t[10]),2052&n&&(o.$$scope={dirty:n,ctx:t}),e.$set(o)},i(t){n||(G(e.$$.fragment,t),n=!0)},o(t){J(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ce(t){let e,n,o;function i(e){t[8](e)}let s={$$slots:{default:[re,({closeCallback:t})=>({10:t}),({closeCallback:t})=>t?1024:0]},$$scope:{ctx:t}};return void 0!==t[1]&&(s.open=t[1]),e=new t[3]({props:s}),C.push((()=>W(e,"open",i))),e.$on("change",t[9]),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,[o]){const i={};3077&o&&(i.$$scope={dirty:o,ctx:t}),!n&&2&o&&(n=!0,i.open=t[1],P((()=>n=!1))),e.$set(i)},i(t){o||(G(e.$$.fragment,t),o=!0)},o(t){J(e.$$.fragment,t),o=!1},d(t){X(e,t)}}}function le(t,e,n){const{Modal:o,Dialog:s}=i;let a,{title:r}=e,{showMessage:c}=e,l="";return c=t=>{n(2,l=[].concat(t).join("\n")),n(1,a=!0)},t.$$set=t=>{"title"in t&&n(0,r=t.title),"showMessage"in t&&n(6,c=t.showMessage)},[r,a,l,o,s,"modalDialog",c,function(t){l=t,n(2,l)},function(t){a=t,n(1,a)},function(e){!function(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((t=>t(e)))}(t,e)}]}t("version","0.2.23");const ue=window.sessionStorage;ue.clear();t("Storage",{getItem:t=>ue.getItem(t),setItem:(t,e)=>ue.setItem(t,e)}),t("LinkIcon",class extends et{constructor(t){var e,n,o;super(),document.getElementById("svelte-1jng2dw-style")||((o=b("style")).id="svelte-1jng2dw-style",o.textContent=".red.svelte-1jng2dw{background-color:var(--m-color-red-light)}.blue.svelte-1jng2dw{background-color:var(--m-color-blue-light)}.green.svelte-1jng2dw{background-color:var(--m-color-green-light)}.icon.svelte-1jng2dw{max-height:1.2em}",e=document.head,n=o,e.appendChild(n)),tt(this,t,ot,nt,f,{title:0,link:3,color:1})}}),t("Page",class extends et{constructor(t){super(),tt(this,t,te,Yt,f,{options:0,update:6,loadingDelay:1})}}),t("Request",yt),t("TextArea",class extends et{constructor(t){super(),tt(this,t,ne,ee,f,{noForm:1,id:2,value:3,style:0,rows:4})}}),t("ModalDialog",class extends et{constructor(t){super(),tt(this,t,le,ce,f,{title:0,showMessage:6})}})}}}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@enablerr-ui/form",
3
3
  "description": "enablerr - the Next Enterprise Solution",
4
- "version": "0.2.22",
4
+ "version": "0.2.23",
5
5
  "os": [
6
6
  "darwin",
7
7
  "linux"