@enablerr-ui/form 0.2.27 → 0.2.28
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 +1 -1
- package/package.json +1 -1
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,s,i;return{setters:[function(t){e=t.default},function(t){n=t.user},function(t){o=t.getGridHelp,s=t.getAttractions},function(t){i=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 p(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function f(t,...e){if(null==t)return a;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function m(t){let e;return f(t,(t=>e=t))(),e}function h(t,e,n,o){if(t){const s=g(t,e,n,o);return t[0](s)}}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,s,i,a){const r=function(t,e,n,o){if(t[2]&&o){const s=t[2](o(n));if(void 0===e.dirty)return s;if("object"==typeof s){const t=[],n=Math.max(e.dirty.length,s.length);for(let o=0;o<n;o+=1)t[o]=e.dirty[o]|s[o];return t}return e.dirty|s}return e.dirty}(e,o,s,i);if(r){const s=g(e,n,o,a);t.p(s,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 b(t){t.parentNode.removeChild(t)}function v(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 s=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,s)}))}}}const _=[],D=[],T=[],C=[],M=Promise.resolve();let L=!1;function F(t){T.push(t)}function P(t){C.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;D.length;)D.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(;C.length;)C.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,s,i){if(e.token!==n)return;e.resolved=i;let a=e.ctx;void 0!==s&&(a=a.slice(),a[s]=i);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((s=t)&&"object"==typeof s&&"function"==typeof s.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 s}function K(t,e,n){const o=e.slice(),{resolved:s}=t;t.current===t.then&&(o[t.value]=s),t.current===t.catch&&(o[t.error]=s),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:s,on_mount:i,on_destroy:a,after_update:r}=t.$$;s&&s.m(e,n),o||F((()=>{const e=i.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,M.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,n,o,s,i,r=[-1]){const c=S;E(t);const d=t.$$={fragment:null,ctx:null,props:i,update:a,not_equal:s,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 p=!1;if(d.ctx=n?n(t,e.props||{},((e,n,...o)=>{const i=o.length?o[0]:n;return d.ctx&&s(d.ctx[e],d.ctx[e]=i)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](i),p&&Y(t,e)),n})):[],d.update(),p=!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(b)}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,s,i;const a=t[5].default,r=h(a,t,t[4],null);return{c(){e=v("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,s||(i=k(e,"click",t[2]),s=!0)},p(t,[s]){r&&r.p&&(!o||16&s)&&$(r,a,t,t[4],s,null,null),(!o||2&s&&n!==(n="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"))&&I(e,"class",n),(!o||1&s)&&I(e,"title",t[0])},i(t){o||(G(r,t),o=!0)},o(t){J(r,t),o=!1},d(t){t&&b(e),r&&r.d(t),s=!1,i()}}}function ot(t,e,n){let{$$slots:o={},$$scope:s}=e,{title:i}=e,{link:a="/"}=e,{color:r}=e;return t.$$set=t=>{"title"in t&&n(0,i=t.title),"link"in t&&n(3,a=t.link),"color"in t&&n(1,r=t.color),"$$scope"in t&&n(4,s=t.$$scope)},[i,r,()=>window.singleSpaNavigate(a),a,s,o]}const{loggedIn:st}=n,it=(t,e)=>{let n="";return t&&(n+=`/${t}`,e&&(n+=`/${e}`)),n},at=async(t,e)=>{const n=it(t,e);return(await axios.get("/api/comm/chat"+n)).data.filter((e=>t?e.event&&e.event.id===t:!e.event)).filter((t=>e?t.task&&t.task.id===e:!t.task))},{loggedIn:rt}=n,ct=async(t,e)=>[];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 pt=[{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 ft=[{id:1111,name:"TaskModule",text:"Alle Tasks",status:!1,6:o.item({x:0,y:0,w:4,h:5,customDragger:!0}),5:o.item({x:0,y:0,w:4,h:5,customDragger:!0}),4:o.item({x:0,y:0,w:3,h:5,customDragger:!0}),3:o.item({x:0,y:0,w:2,h:5,customDragger:!0}),2:o.item({x:0,y:0,w:1,h:5,customDragger:!0}),1:o.item({x:0,y:0,w:1,h:5,customDragger:!0})},{id:3333,name:"Chat Modul",text:"Chat",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:3,y:0,w:1,h:5}),3:o.item({x:2,y:0,w:1,h:5}),2:o.item({x:1,y:0,w:1,h:5}),1:o.item({x:1,y:0,w:1,h:5})},{id:4444,name:"Feedback Modul",text:"Feedback",status:!1,6:o.item({x:5,y:0,w:1,h:5}),5:o.item({x:5,y:0,w:1,h:5}),4:o.item({x:4,y:0,w:1,h:5}),3:o.item({x:3,y:0,w:1,h:5}),2:o.item({x:2,y:0,w:1,h:5}),1:o.item({x:2,y:0,w:1,h:5})},{id:9999,name:"Neues Modul",text:"+",status:!1,6:o.item({x:4,y:0,w:1,h:2}),5:o.item({x:4,y:0,w:1,h:2}),4:o.item({x:3,y:0,w:1,h:2}),3:o.item({x:2,y:0,w:1,h:2}),2:o.item({x:1,y:0,w:1,h:2}),1:o.item({x:1,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 s=[].concat(t.name,e).join("-");let i=gt.get(s);if(!i)try{i=t(...e),gt.set(s,i)}catch(t){throw t}return i};var yt={getSchema: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:at,saveChat:async(t,e,n)=>{const{user:o}=m(st);n.sender=o;const s=(await at(t,e))[0]?"patch":"post",i=it(t,e);return(await axios[s]("/api/comm/chat"+i,n)).data.id},getFeedback:ct,saveFeedback:async(t,e,n,o,s)=>{const i={};t&&(i.event={id:t}),e&&(i.task={id:e});let a=await ct();if(a[0]&&null!=s){let t=a.filter((t=>t._id===s));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={...i},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=>pt.filter((e=>e.user===t)),getModules:t=>ft.filter((e=>t.includes(e.id))),getAllModules:()=>ft};const wt=Intl.NumberFormat().formatToParts(1.1).find((({type:t})=>"decimal"===t)).value||".",bt=t=>"function"==typeof t,vt=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(),s=n.toString())=>s.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)||Ct(console.error,n))).every(Boolean),Dt=t=>(e,n)=>(Promise.resolve(n).then(e),t),Tt=Dt(!0),Ct=Dt(!1);t("util",Object.freeze({__proto__:null,decimalSeparator:wt,isFunction:bt,isStringable:vt,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:Ct}));const Mt="single-spa:routing-event",Lt=Nt(Mt);function Ft(t,{modulePath:e,update:n}){if(!1===n)return;if(_t({value:n,check:bt,text:"<update> should be a function (dataListener)"},{value:e,check:vt,text:"<modulePath> should be a string (dataListener)"}))return;const o=e.toString()||"/",s=e=>{const s=e.currentTarget.location.pathname,[,i,...a]=s.split("/");o===(i||"/")&&t.dispatchEvent(new CustomEvent("data",{detail:{data:n(...a)}}))};return Lt.start(s),{destroy:()=>Lt.stop(s)}}const Pt=()=>window.dispatchEvent(new CustomEvent(Mt)),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,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,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,s={ctx:t,current:null,token:null,hasCatch:!0,pending:Wt,then:Kt,catch:Ut,value:11,error:12,blocks:[,,,]};return U(n=t[2],s),{c(){e=x(),s.block.c()},m(t,n){w(t,e,n),s.block.m(t,s.anchor=n),s.mount=()=>e.parentNode,s.anchor=e,o=!0},p(e,o){t=e,s.ctx=t,4&o&&n!==(n=t[2])&&U(n,s)||K(s,t,o)},i(t){o||(G(s.block),o=!0)},o(t){for(let t=0;t<3;t+=1){J(s.blocks[t])}o=!1},d(t){t&&b(e),s.block.d(t),s.token=null,s=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,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,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,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,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,s={ctx:t,current:null,token:null,hasCatch:!1,pending:Xt,then:Qt,catch:Zt,value:10,blocks:[,,,]};return U(n=t[5](t[1]),s),{c(){e=x(),s.block.c()},m(t,n){w(t,e,n),s.block.m(t,s.anchor=n),s.mount=()=>e.parentNode,s.anchor=e,o=!0},p(e,o){t=e,s.ctx=t,2&o&&n!==(n=t[5](t[1]))&&U(n,s)||K(s,t,o)},i(t){o||(G(s.block),o=!0)},o(t){for(let t=0;t<3;t+=1){J(s.blocks[t])}o=!1},d(t){t&&b(e),s.block.d(t),s.token=null,s=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,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,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,s,i,r,c;const l=[Jt,Gt],p=[];function f(t,e){return t[2]?0:1}return n=f(t),o=p[n]=l[n](t),{c(){e=v("section"),o.c(),I(e,"class","data")},m(o,l){var u;w(o,e,l),p[n].m(e,null),i=!0,r||(c=[(u=s=Ft.call(null,e,t[0]),u&&d(u.destroy)?u.destroy:a),k(e,"data",t[9])],r=!0)},p(t,[i]){let a=n;n=f(t),n===a?p[n].p(t,i):(V(),J(p[a],1,1,(()=>{p[a]=null})),R(),o=p[n],o?o.p(t,i):(o=p[n]=l[n](t),o.c()),G(o,1),o.m(e,null)),s&&d(s.update)&&1&i&&s.update.call(null,t[0])},i(t){i||(G(o),i=!0)},o(t){J(o),i=!1},d(t){t&&b(e),p[n].d(),r=!1,u(c)}}}function te(t,e,o){let s,{$$slots:i={},$$scope:a}=e;const{loggedIn:r}=n;var c,l;c=r,l=t=>o(3,s=t),t.$$.on_destroy.push(f(c,l));let u,{options:d}=e,{update:p=!1}=e,{loadingDelay:m=250}=e;p&&(d={update:p,modulePath:window.location.pathname.split("/")[1]||"/"});return t.$$set=t=>{"options"in t&&o(0,d=t.options),"update"in t&&o(6,p=t.update),"loadingDelay"in t&&o(1,m=t.loadingDelay),"$$scope"in t&&o(7,a=t.$$scope)},[d,m,u,s,r,t=>new Promise((e=>setTimeout(e,t))),p,a,i,({detail:t})=>o(2,u=t.data)]}function ee(t){let e,n;const o=[{class:"full-width"},{style:t[0]},{inputClass:t[1]||t[5]},{multiline:!0},{id:t[2]},{value:t[3]},{rows:t[4]},t[8]];let s={};for(let t=0;t<o.length;t+=1)s=r(s,o[t]);return e=new t[6]({props:s}),e.$on("change",t[7]),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,[n]){const s=319&n?function(t,e){const n={},o={},s={$$scope:1};let i=t.length;for(;i--;){const a=t[i],r=e[i];if(r){for(const t in a)t in r||(o[t]=1);for(const t in r)s[t]||(n[t]=r[t],s[t]=1);t[i]=r}else for(const t in a)s[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(o,[o[0],1&n&&{style:t[0]},34&n&&{inputClass:t[1]||t[5]},o[3],4&n&&{id:t[2]},8&n&&{value:t[3]},16&n&&{rows:t[4]},256&n&&(i=t[8],"object"==typeof i&&null!==i?i:{})]):{};var i;e.$set(s)},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","classId"];let i=y(e,o);const a=N(),{TextField:c}=s;let{noForm:l=""}=e,{id:u}=e,{value:d}=e,{style:p=""}=e,{rows:f=3}=e,{classId:m}=e;p+=" padding-bottom: .5em;";const h=5*(f>1),g=()=>{const t=document.getElementById(u);if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n+h}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(8,i=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,p=t.style),"rows"in t&&n(4,f=t.rows),"classId"in t&&n(5,m=t.classId)},t.$$.update=()=>{8&t.$$.dirty&&d&&setTimeout(g)},[p,l,u,d,f,m,c,({detail:{value:t}})=>a("blur",{value:t}),i]}function oe(t){let e,n;return e=new i({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 se(t,e,n){let{id:o}=e,{value:s}=e;return t.$$set=t=>{"id"in t&&n(0,o=t.id),"value"in t&&n(1,s=t.value)},[o,s]}class ie extends et{constructor(t){super(),tt(this,t,se,oe,p,{id:0,value:1})}}function ae(t){let e,n,o;function s(e){t[7](e)}let i={id:t[5]};return void 0!==t[2]&&(i.value=t[2]),e=new ie({props:i}),D.push((()=>W(e,"value",s))),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,o){const s={};!n&&4&o&&(n=!0,s.value=t[2],P((()=>n=!1))),e.$set(s)},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 s(e){t[8](e)}let i={$$slots:{default:[re,({closeCallback:t})=>({10:t}),({closeCallback:t})=>t?1024:0]},$$scope:{ctx:t}};return void 0!==t[1]&&(i.open=t[1]),e=new t[3]({props:i}),D.push((()=>W(e,"open",s))),e.$on("change",t[9]),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,[o]){const s={};3077&o&&(s.$$scope={dirty:o,ctx:t}),!n&&2&o&&(n=!0,s.open=t[1],P((()=>n=!1))),e.$set(s)},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:i}=s;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,i,"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.27");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,p,{title:0,link:3,color:1})}}),t("Page",class extends et{constructor(t){super(),tt(this,t,te,Yt,p,{options:0,update:6,loadingDelay:1})}}),t("Request",yt),t("TextArea",class extends et{constructor(t){super(),tt(this,t,ne,ee,p,{noForm:1,id:2,value:3,style:0,rows:4,classId:5})}}),t("ModalDialog",class extends et{constructor(t){super(),tt(this,t,le,ce,p,{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,s,a;return{setters:[function(t){e=t.default},function(t){n=t.user},function(t){o=t.getGridHelp,s=t.getAttractions},function(t){a=t.TextArea}],execute:function(){function i(){}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 p(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function f(t,...e){if(null==t)return i;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function m(t){let e;return f(t,(t=>e=t))(),e}function h(t,e,n,o){if(t){const s=g(t,e,n,o);return t[0](s)}}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,s,a,i){const r=function(t,e,n,o){if(t[2]&&o){const s=t[2](o(n));if(void 0===e.dirty)return s;if("object"==typeof s){const t=[],n=Math.max(e.dirty.length,s.length);for(let o=0;o<n;o+=1)t[o]=e.dirty[o]|s[o];return t}return e.dirty|s}return e.dirty}(e,o,s,a);if(r){const s=g(e,n,o,i);t.p(s,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 b(t){t.parentNode.removeChild(t)}function v(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 s=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,s)}))}}}const _=[],D=[],T=[],C=[],M=Promise.resolve();let L=!1;function F(t){T.push(t)}function P(t){C.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;D.length;)D.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(;C.length;)C.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 R;function q(){R={r:0,c:[],p:R}}function U(){R.r||u(R.c),R=R.p}function V(t,e){t&&t.i&&(H.delete(t),t.i(e))}function G(t,e,n,o){if(t&&t.o){if(H.has(t))return;H.add(t),R&&R.c.push((()=>{H.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}}function J(t,e){const n=e.token={};function o(t,o,s,a){if(e.token!==n)return;e.resolved=a;let i=e.ctx;void 0!==s&&(i=i.slice(),i[s]=a);const r=t&&(e.current=t)(i);let c=!1;e.block&&(e.blocks?e.blocks.forEach(((t,n)=>{n!==o&&t&&(q(),G(t,1,1,(()=>{e.blocks[n]===t&&(e.blocks[n]=null)})),U())})):e.block.d(1),r.c(),V(r,1),r.m(e.mount(),e.anchor),c=!0),e.block=r,e.blocks&&(e.blocks[o]=r),c&&O()}if((s=t)&&"object"==typeof s&&"function"==typeof s.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 s}function K(t,e,n){const o=e.slice(),{resolved:s}=t;t.current===t.then&&(o[t.value]=s),t.current===t.catch&&(o[t.error]=s),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:s,on_mount:a,on_destroy:i,after_update:r}=t.$$;s&&s.m(e,n),o||F((()=>{const e=a.map(c).filter(d);i?i.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,M.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function tt(t,e,n,o,s,a,r=[-1]){const c=S;E(t);const d=t.$$={fragment:null,ctx:null,props:a,update:i,not_equal:s,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 p=!1;if(d.ctx=n?n(t,e.props||{},((e,n,...o)=>{const a=o.length?o[0]:n;return d.ctx&&s(d.ctx[e],d.ctx[e]=a)&&(!d.skip_bound&&d.bound[e]&&d.bound[e](a),p&&Y(t,e)),n})):[],d.update(),p=!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(b)}else d.fragment&&d.fragment.c();e.intro&&V(t.$$.fragment),Q(t,e.target,e.anchor,e.customElement),O()}E(c)}class et{$destroy(){X(this,1),this.$destroy=i}$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,s,a;const i=t[5].default,r=h(i,t,t[4],null);return{c(){e=v("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,i){w(n,e,i),r&&r.m(e,null),o=!0,s||(a=k(e,"click",t[2]),s=!0)},p(t,[s]){r&&r.p&&(!o||16&s)&&$(r,i,t,t[4],s,null,null),(!o||2&s&&n!==(n="pointer icon flex brd-radius-full brd-with-sm "+t[1]+" svelte-1jng2dw"))&&I(e,"class",n),(!o||1&s)&&I(e,"title",t[0])},i(t){o||(V(r,t),o=!0)},o(t){G(r,t),o=!1},d(t){t&&b(e),r&&r.d(t),s=!1,a()}}}function ot(t,e,n){let{$$slots:o={},$$scope:s}=e,{title:a}=e,{link:i="/"}=e,{color:r}=e;return t.$$set=t=>{"title"in t&&n(0,a=t.title),"link"in t&&n(3,i=t.link),"color"in t&&n(1,r=t.color),"$$scope"in t&&n(4,s=t.$$scope)},[a,r,()=>window.singleSpaNavigate(i),i,s,o]}const{loggedIn:st}=n,at=(t,e)=>{let n="";return t&&(n+=`/${t}`,e&&(n+=`/${e}`)),n},it=async(t,e)=>{const n=at(t,e);return(await axios.get("/api/comm/chat"+n)).data.filter((e=>t?e.event&&e.event.id===t:!e.event)).filter((t=>e?t.task&&t.task.id===e:!t.task))},{loggedIn:rt}=n,ct=async(t,e)=>[];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 pt=[{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 ft=[{id:1111,name:"TaskModule",text:"Alle Tasks",status:!1,6:o.item({x:0,y:0,w:4,h:5,customDragger:!0}),5:o.item({x:0,y:0,w:4,h:5,customDragger:!0}),4:o.item({x:0,y:0,w:3,h:5,customDragger:!0}),3:o.item({x:0,y:0,w:2,h:5,customDragger:!0}),2:o.item({x:0,y:0,w:1,h:5,customDragger:!0}),1:o.item({x:0,y:0,w:1,h:5,customDragger:!0})},{id:3333,name:"Chat Modul",text:"Chat",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:3,y:0,w:1,h:5}),3:o.item({x:2,y:0,w:1,h:5}),2:o.item({x:1,y:0,w:1,h:5}),1:o.item({x:1,y:0,w:1,h:5})},{id:4444,name:"Feedback Modul",text:"Feedback",status:!1,6:o.item({x:5,y:0,w:1,h:5}),5:o.item({x:5,y:0,w:1,h:5}),4:o.item({x:4,y:0,w:1,h:5}),3:o.item({x:3,y:0,w:1,h:5}),2:o.item({x:2,y:0,w:1,h:5}),1:o.item({x:2,y:0,w:1,h:5})},{id:9999,name:"Neues Modul",text:"+",status:!1,6:o.item({x:4,y:0,w:1,h:2}),5:o.item({x:4,y:0,w:1,h:2}),4:o.item({x:3,y:0,w:1,h:2}),3:o.item({x:2,y:0,w:1,h:2}),2:o.item({x:1,y:0,w:1,h:2}),1:o.item({x:1,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 s=[].concat(t.name,e).join("-");let a=gt.get(s);if(!a)try{a=t(...e),gt.set(s,a)}catch(t){throw t}return a};var yt={getSchema: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:(t=!1)=>axios.post("/api/taskqueue",{id:t}).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:it,saveChat:async(t,e,n)=>{const{user:o}=m(st);n.sender=o;const s=(await it(t,e))[0]?"patch":"post",a=at(t,e);return(await axios[s]("/api/comm/chat"+a,n)).data.id},getFeedback:ct,saveFeedback:async(t,e,n,o,s)=>{const a={};t&&(a.event={id:t}),e&&(a.task={id:e});let i=await ct();if(i[0]&&null!=s){let t=i.filter((t=>t._id===s));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}{i={...a},i={...i,...o};const{user:t}=m(rt);return n.sender=t,i.messages=(i.messages||[]).concat(n),console.log("new feedback",i),(await axios.post("/api/commFeedback",i)).data.id}},getUserReports:async t=>(await axios.get("/api/userreport/list/"+t)).data,uploadUserReport:async(t,e)=>(await axios.post("/api/userreport/"+t,e)).data,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=>pt.filter((e=>e.user===t)),getModules:t=>ft.filter((e=>t.includes(e.id))),getAllModules:()=>ft};const wt=Intl.NumberFormat().formatToParts(1.1).find((({type:t})=>"decimal"===t)).value||".",bt=t=>"function"==typeof t,vt=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(),s=n.toString())=>s.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)||Ct(console.error,n))).every(Boolean),Dt=t=>(e,n)=>(Promise.resolve(n).then(e),t),Tt=Dt(!0),Ct=Dt(!1);t("util",Object.freeze({__proto__:null,decimalSeparator:wt,isFunction:bt,isStringable:vt,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:Ct}));const Mt="single-spa:routing-event",Lt=Nt(Mt);function Ft(t,{modulePath:e,update:n}){if(!1===n)return;if(_t({value:n,check:bt,text:"<update> should be a function (dataListener)"},{value:e,check:vt,text:"<modulePath> should be a string (dataListener)"}))return;const o=e.toString()||"/",s=e=>{const s=e.currentTarget.location.pathname,[,a,...i]=s.split("/");o===(a||"/")&&t.dispatchEvent(new CustomEvent("data",{detail:{data:n(...i)}}))};return Lt.start(s),{destroy:()=>Lt.stop(s)}}const Pt=()=>window.dispatchEvent(new CustomEvent(Mt)),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}),Rt=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user}),qt=t=>({prop:4&t,tenant:8&t,user:8&t}),Ut=t=>({prop:t[11],refresh:Pt,tenant:t[3].tenant,user:t[3].user});function Vt(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,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,At,Bt)},i(t){e||(V(o,t),e=!0)},o(t){G(o,t),e=!1},d(t){o&&o.d(t)}}}function Gt(t){let e,n,o,s={ctx:t,current:null,token:null,hasCatch:!0,pending:Wt,then:Kt,catch:Jt,value:11,error:12,blocks:[,,,]};return J(n=t[2],s),{c(){e=x(),s.block.c()},m(t,n){w(t,e,n),s.block.m(t,s.anchor=n),s.mount=()=>e.parentNode,s.anchor=e,o=!0},p(e,o){t=e,s.ctx=t,4&o&&n!==(n=t[2])&&J(n,s)||K(s,t,o)},i(t){o||(V(s.block),o=!0)},o(t){for(let t=0;t<3;t+=1){G(s.blocks[t])}o=!1},d(t){t&&b(e),s.block.d(t),s.token=null,s=null}}}function Jt(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,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,Ot,zt)},i(t){e||(V(o,t),e=!0)},o(t){G(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],Rt);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,Ht,Rt)},i(t){e||(V(o,t),e=!0)},o(t){G(o,t),e=!1},d(t){o&&o.d(t)}}}function Wt(t){let e,n,o,s={ctx:t,current:null,token:null,hasCatch:!1,pending:Xt,then:Qt,catch:Zt,value:10,blocks:[,,,]};return J(n=t[5](t[1]),s),{c(){e=x(),s.block.c()},m(t,n){w(t,e,n),s.block.m(t,s.anchor=n),s.mount=()=>e.parentNode,s.anchor=e,o=!0},p(e,o){t=e,s.ctx=t,2&o&&n!==(n=t[5](t[1]))&&J(n,s)||K(s,t,o)},i(t){o||(V(s.block),o=!0)},o(t){for(let t=0;t<3;t+=1){G(s.blocks[t])}o=!1},d(t){t&&b(e),s.block.d(t),s.token=null,s=null}}}function Zt(t){return{c:i,m:i,p:i,i:i,o:i,d:i}}function Qt(t){let e;const n=t[8].load,o=h(n,t,t[7],Ut);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,s){o&&o.p&&(!e||140&s)&&$(o,n,t,t[7],s,qt,Ut)},i(t){e||(V(o,t),e=!0)},o(t){G(o,t),e=!1},d(t){o&&o.d(t)}}}function Xt(t){return{c:i,m:i,p:i,i:i,o:i,d:i}}function Yt(t){let e,n,o,s,a,r,c;const l=[Gt,Vt],p=[];function f(t,e){return t[2]?0:1}return n=f(t),o=p[n]=l[n](t),{c(){e=v("section"),o.c(),I(e,"class","data")},m(o,l){var u;w(o,e,l),p[n].m(e,null),a=!0,r||(c=[(u=s=Ft.call(null,e,t[0]),u&&d(u.destroy)?u.destroy:i),k(e,"data",t[9])],r=!0)},p(t,[a]){let i=n;n=f(t),n===i?p[n].p(t,a):(q(),G(p[i],1,1,(()=>{p[i]=null})),U(),o=p[n],o?o.p(t,a):(o=p[n]=l[n](t),o.c()),V(o,1),o.m(e,null)),s&&d(s.update)&&1&a&&s.update.call(null,t[0])},i(t){a||(V(o),a=!0)},o(t){G(o),a=!1},d(t){t&&b(e),p[n].d(),r=!1,u(c)}}}function te(t,e,o){let s,{$$slots:a={},$$scope:i}=e;const{loggedIn:r}=n;var c,l;c=r,l=t=>o(3,s=t),t.$$.on_destroy.push(f(c,l));let u,{options:d}=e,{update:p=!1}=e,{loadingDelay:m=250}=e;p&&(d={update:p,modulePath:window.location.pathname.split("/")[1]||"/"});return t.$$set=t=>{"options"in t&&o(0,d=t.options),"update"in t&&o(6,p=t.update),"loadingDelay"in t&&o(1,m=t.loadingDelay),"$$scope"in t&&o(7,i=t.$$scope)},[d,m,u,s,r,t=>new Promise((e=>setTimeout(e,t))),p,i,a,({detail:t})=>o(2,u=t.data)]}function ee(t){let e,n;const o=[{class:"full-width"},{style:t[0]},{inputClass:t[1]||t[5]},{multiline:!0},{id:t[2]},{value:t[3]},{rows:t[4]},t[8]];let s={};for(let t=0;t<o.length;t+=1)s=r(s,o[t]);return e=new t[6]({props:s}),e.$on("change",t[7]),{c(){Z(e.$$.fragment)},m(t,o){Q(e,t,o),n=!0},p(t,[n]){const s=319&n?function(t,e){const n={},o={},s={$$scope:1};let a=t.length;for(;a--;){const i=t[a],r=e[a];if(r){for(const t in i)t in r||(o[t]=1);for(const t in r)s[t]||(n[t]=r[t],s[t]=1);t[a]=r}else for(const t in i)s[t]=1}for(const t in o)t in n||(n[t]=void 0);return n}(o,[o[0],1&n&&{style:t[0]},34&n&&{inputClass:t[1]||t[5]},o[3],4&n&&{id:t[2]},8&n&&{value:t[3]},16&n&&{rows:t[4]},256&n&&(a=t[8],"object"==typeof a&&null!==a?a:{})]):{};var a;e.$set(s)},i(t){n||(V(e.$$.fragment,t),n=!0)},o(t){G(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ne(t,e,n){const o=["noForm","id","value","style","rows","classId"];let a=y(e,o);const i=N(),{TextField:c}=s;let{noForm:l=""}=e,{id:u}=e,{value:d}=e,{style:p=""}=e,{rows:f=3}=e,{classId:m}=e;p+=" padding-bottom: .5em;";const h=5*(f>1),g=()=>{const t=document.getElementById(u);if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n+h}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(8,a=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,p=t.style),"rows"in t&&n(4,f=t.rows),"classId"in t&&n(5,m=t.classId)},t.$$.update=()=>{8&t.$$.dirty&&d&&setTimeout(g)},[p,l,u,d,f,m,c,({detail:{value:t}})=>i("blur",{value:t}),a]}function oe(t){let e,n;return e=new a({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||(V(e.$$.fragment,t),n=!0)},o(t){G(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function se(t,e,n){let{id:o}=e,{value:s}=e;return t.$$set=t=>{"id"in t&&n(0,o=t.id),"value"in t&&n(1,s=t.value)},[o,s]}class ae extends et{constructor(t){super(),tt(this,t,se,oe,p,{id:0,value:1})}}function ie(t){let e,n,o;function s(e){t[7](e)}let a={id:t[5]};return void 0!==t[2]&&(a.value=t[2]),e=new ae({props:a}),D.push((()=>W(e,"value",s))),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,o){const s={};!n&&4&o&&(n=!0,s.value=t[2],P((()=>n=!1))),e.$set(s)},i(t){o||(V(e.$$.fragment,t),o=!0)},o(t){G(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:[ie]},$$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||(V(e.$$.fragment,t),n=!0)},o(t){G(e.$$.fragment,t),n=!1},d(t){X(e,t)}}}function ce(t){let e,n,o;function s(e){t[8](e)}let a={$$slots:{default:[re,({closeCallback:t})=>({10:t}),({closeCallback:t})=>t?1024:0]},$$scope:{ctx:t}};return void 0!==t[1]&&(a.open=t[1]),e=new t[3]({props:a}),D.push((()=>W(e,"open",s))),e.$on("change",t[9]),{c(){Z(e.$$.fragment)},m(t,n){Q(e,t,n),o=!0},p(t,[o]){const s={};3077&o&&(s.$$scope={dirty:o,ctx:t}),!n&&2&o&&(n=!0,s.open=t[1],P((()=>n=!1))),e.$set(s)},i(t){o||(V(e.$$.fragment,t),o=!0)},o(t){G(e.$$.fragment,t),o=!1},d(t){X(e,t)}}}function le(t,e,n){const{Modal:o,Dialog:a}=s;let i,{title:r}=e,{showMessage:c}=e,l="";return c=t=>{n(2,l=[].concat(t).join("\n")),n(1,i=!0)},t.$$set=t=>{"title"in t&&n(0,r=t.title),"showMessage"in t&&n(6,c=t.showMessage)},[r,i,l,o,a,"modalDialog",c,function(t){l=t,n(2,l)},function(t){i=t,n(1,i)},function(e){!function(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach((t=>t(e)))}(t,e)}]}t("version","0.2.28");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,p,{title:0,link:3,color:1})}}),t("Page",class extends et{constructor(t){super(),tt(this,t,te,Yt,p,{options:0,update:6,loadingDelay:1})}}),t("Request",yt),t("TextArea",class extends et{constructor(t){super(),tt(this,t,ne,ee,p,{noForm:1,id:2,value:3,style:0,rows:4,classId:5})}}),t("ModalDialog",class extends et{constructor(t){super(),tt(this,t,le,ce,p,{title:0,showMessage:6})}})}}}));
|