@enablerr-ui/detail 0.2.576 → 0.2.577

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(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],(function(e){"use strict";var t,n,o,r,i,l,s,a,c,d,u,m;return{setters:[function(e){t=e.Request,n=e.task_notification,o=e.currentRoles,r=e.TextArea,i=e.Storage,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){m=e.taskClipboard}],execute:function(){e("version","0.2.576");const f=e("checkDate",((e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map((e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e)).filter((e=>!!e)).join(" · "))),p=e=>{try{return new Date(e).toLocaleString()}catch{return e}},$=e=>e?"(ja)":"(nein)",h=(e,t)=>{const n={...t};return(e.display?.reduce(((t,o)=>{let[r,i]=o.split(".");if(e.list?.find((({name:e})=>e===r))&&i&&void 0!==n[r]){const e=`${r}_${i}`;n[e]=n[r][i],r=e}return t.find((e=>e===r))||t.push(r),t}),[]).map((e=>"boolean"==typeof n[e]?$(n[e]):f(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")};function g(){}function v(e){return e()}function y(){return Object.create(null)}function b(e){e.forEach(v)}function w(e){return"function"==typeof e}function k(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function x(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return g;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function I(e){return null==e?"":e}function _(e,t){e.appendChild(t)}function q(e,t,n){e.insertBefore(t,n||null)}function S(e){e.parentNode.removeChild(e)}function N(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function j(e){return document.createElement(e)}function C(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function L(e){return document.createTextNode(e)}function E(){return L(" ")}function F(){return L("")}function D(e,t,n,o){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n,o)}function z(e){return function(t){return t.preventDefault(),e.call(this,t)}}function T(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function V(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function A(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function B(e,t){e.value=null==t?"":t}function O(e,t,n,o){e.style.setProperty(t,n,o?"important":"")}function M(e,t,n){e.classList[n?"add":"remove"](t)}let W;function R(e){W=e}function P(){if(!W)throw new Error("Function called outside component initialization");return W}function H(e){P().$$.on_mount.push(e)}function Q(){const e=P();return(t,n)=>{const o=e.$$.callbacks[t];if(o){const r=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);o.slice().forEach((t=>{t.call(e,r)}))}}}function Y(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const G=[],J=[],U=[],Z=[],K=Promise.resolve();let X=!1;function ee(){X||(X=!0,K.then(le))}function te(){return ee(),K}function ne(e){U.push(e)}function oe(e){Z.push(e)}let re=!1;const ie=new Set;function le(){if(!re){re=!0;do{for(let e=0;e<G.length;e+=1){const t=G[e];R(t),se(t.$$)}for(R(null),G.length=0;J.length;)J.pop()();for(let e=0;e<U.length;e+=1){const t=U[e];ie.has(t)||(ie.add(t),t())}U.length=0}while(G.length);for(;Z.length;)Z.pop()();X=!1,re=!1,ie.clear()}}function se(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ne)}}const ae=new Set;let ce;function de(){ce={r:0,c:[],p:ce}}function ue(){ce.r||b(ce.c),ce=ce.p}function me(e,t){e&&e.i&&(ae.delete(e),e.i(t))}function fe(e,t,n,o){if(e&&e.o){if(ae.has(e))return;ae.add(e),ce&&ce.c.push((()=>{ae.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}}function pe(e,t){const n=t.token={};function o(e,o,r,i){if(t.token!==n)return;t.resolved=i;let l=t.ctx;void 0!==r&&(l=l.slice(),l[r]=i);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==o&&e&&(de(),fe(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),ue())})):t.block.d(1),s.c(),me(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[o]=s),a&&le()}if((r=e)&&"object"==typeof r&&"function"==typeof r.then){const n=P();if(e.then((e=>{R(n),o(t.then,1,t.value,e),R(null)}),(e=>{if(R(n),o(t.catch,2,t.error,e),R(null),!t.hasCatch)throw e})),t.current!==t.pending)return o(t.pending,0),!0}else{if(t.current!==t.then)return o(t.then,1,t.value,e),!0;t.resolved=e}var r}function $e(e,t,n){const o=t.slice(),{resolved:r}=e;e.current===e.then&&(o[e.value]=r),e.current===e.catch&&(o[e.error]=r),e.block.p(o,n)}const he="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ge(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function ve(e){e&&e.c()}function ye(e,t,n,o){const{fragment:r,on_mount:i,on_destroy:l,after_update:s}=e.$$;r&&r.m(t,n),o||ne((()=>{const t=i.map(v).filter(w);l?l.push(...t):b(t),e.$$.on_mount=[]})),s.forEach(ne)}function be(e,t){const n=e.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function we(e,t,n,o,r,i,l=[-1]){const s=W;R(e);const a=e.$$={fragment:null,ctx:null,props:i,update:g,not_equal:r,bound:y(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:y(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...o)=>{const i=o.length?o[0]:n;return a.ctx&&r(a.ctx[t],a.ctx[t]=i)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](i),c&&function(e,t){-1===e.$$.dirty[0]&&(G.push(e),ee(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,b(a.before_update),a.fragment=!!o&&o(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(S)}else a.fragment&&a.fragment.c();t.intro&&me(e.$$.fragment),ye(e,t.target,t.anchor,t.customElement),le()}R(s)}class ke{$destroy(){be(this,1),this.$destroy=g}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function xe(e){let t,n,o,r,i;return{c(){t=C("svg"),n=C("circle"),o=C("polyline"),r=C("line"),V(n,"cx","12"),V(n,"cy","12"),V(n,"r","10"),V(o,"points","8 12 12 16 16 12"),V(r,"x1","12"),V(r,"y1","8"),V(r,"x2","12"),V(r,"y2","16"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",i="feather feather-arrow-down-circle "+e[2])},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-arrow-down-circle "+e[2])&&V(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function Ie(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class _e extends ke{constructor(e){super(),we(this,e,Ie,xe,k,{size:0,strokeWidth:1,class:2})}}function qe(e){let t,n,o,r;return{c(){t=C("svg"),n=C("path"),o=C("polyline"),V(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),V(o,"points","22 4 12 14.01 9 11.01"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",r="feather feather-check-circle "+e[2])},m(e,r){q(e,t,r),_(t,n),_(t,o)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-check-circle "+e[2])&&V(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Se(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ne extends ke{constructor(e){super(),we(this,e,Se,qe,k,{size:0,strokeWidth:1,class:2})}}function je(e){let t,n,o;return{c(){t=C("svg"),n=C("path"),V(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",o="feather feather-command "+e[2])},m(e,o){q(e,t,o),_(t,n)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-command "+e[2])&&V(t,"class",o)},i:g,o:g,d(e){e&&S(t)}}}function Ce(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Le extends ke{constructor(e){super(),we(this,e,Ce,je,k,{size:0,strokeWidth:1,class:2})}}function Ee(e){let t,n,o,r;return{c(){t=C("svg"),n=C("polyline"),o=C("path"),V(n,"points","9 10 4 15 9 20"),V(o,"d","M20 4v7a4 4 0 0 1-4 4H4"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",r="feather feather-corner-down-left "+e[2])},m(e,r){q(e,t,r),_(t,n),_(t,o)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-corner-down-left "+e[2])&&V(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Fe(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class De extends ke{constructor(e){super(),we(this,e,Fe,Ee,k,{size:0,strokeWidth:1,class:2})}}function ze(e){let t,n,o,r,i;return{c(){t=C("svg"),n=C("path"),o=C("line"),r=C("line"),V(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),V(o,"x1","18"),V(o,"y1","9"),V(o,"x2","12"),V(o,"y2","15"),V(r,"x1","12"),V(r,"y1","9"),V(r,"x2","18"),V(r,"y2","15"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",i="feather feather-delete "+e[2])},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-delete "+e[2])&&V(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function Te(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ve extends ke{constructor(e){super(),we(this,e,Te,ze,k,{size:0,strokeWidth:1,class:2})}}function Ae(e){let t,n,o,r,i;return{c(){t=C("svg"),n=C("path"),o=C("polyline"),r=C("line"),V(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),V(o,"points","15 3 21 3 21 9"),V(r,"x1","10"),V(r,"y1","14"),V(r,"x2","21"),V(r,"y2","3"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",i="feather feather-external-link "+e[2])},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-external-link "+e[2])&&V(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function Be(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Oe extends ke{constructor(e){super(),we(this,e,Be,Ae,k,{size:0,strokeWidth:1,class:2})}}function Me(e){let t,n,o,r,i;return{c(){t=C("svg"),n=C("circle"),o=C("line"),r=C("path"),V(n,"cx","12"),V(n,"cy","12"),V(n,"r","10"),V(o,"x1","2"),V(o,"y1","12"),V(o,"x2","22"),V(o,"y2","12"),V(r,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",i="feather feather-globe "+e[2])},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-globe "+e[2])&&V(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function We(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Re extends ke{constructor(e){super(),we(this,e,We,Me,k,{size:0,strokeWidth:1,class:2})}}function Pe(e){let t,n,o,r;return{c(){t=C("svg"),n=C("path"),o=C("polyline"),V(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),V(o,"points","22,6 12,13 2,6"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",r="feather feather-mail "+e[2])},m(e,r){q(e,t,r),_(t,n),_(t,o)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-mail "+e[2])&&V(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function He(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Qe extends ke{constructor(e){super(),we(this,e,He,Pe,k,{size:0,strokeWidth:1,class:2})}}function Ye(e){let t,n,o,r;return{c(){t=C("svg"),n=C("path"),o=C("circle"),V(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),V(o,"cx","12"),V(o,"cy","10"),V(o,"r","3"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",r="feather feather-map-pin "+e[2])},m(e,r){q(e,t,r),_(t,n),_(t,o)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-map-pin "+e[2])&&V(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Ge(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Je extends ke{constructor(e){super(),we(this,e,Ge,Ye,k,{size:0,strokeWidth:1,class:2})}}function Ue(e){let t,n,o,r,i;return{c(){t=C("svg"),n=C("polyline"),o=C("line"),r=C("path"),V(n,"points","23 7 23 1 17 1"),V(o,"x1","16"),V(o,"y1","8"),V(o,"x2","23"),V(o,"y2","1"),V(r,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",i="feather feather-phone-outgoing "+e[2])},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-phone-outgoing "+e[2])&&V(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function Ze(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class Ke extends ke{constructor(e){super(),we(this,e,Ze,Ue,k,{size:0,strokeWidth:1,class:2})}}function Xe(e){let t,n,o,r,i;return{c(){t=C("svg"),n=C("polyline"),o=C("path"),r=C("rect"),V(n,"points","6 9 6 2 18 2 18 9"),V(o,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),V(r,"x","6"),V(r,"y","14"),V(r,"width","12"),V(r,"height","8"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",i="feather feather-printer "+e[2])},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-printer "+e[2])&&V(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function et(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class tt extends ke{constructor(e){super(),we(this,e,et,Xe,k,{size:0,strokeWidth:1,class:2})}}function nt(e){let t,n,o,r;return{c(){t=C("svg"),n=C("circle"),o=C("line"),V(n,"cx","11"),V(n,"cy","11"),V(n,"r","8"),V(o,"x1","21"),V(o,"y1","21"),V(o,"x2","16.65"),V(o,"y2","16.65"),V(t,"xmlns","http://www.w3.org/2000/svg"),V(t,"width",e[0]),V(t,"height",e[0]),V(t,"fill","none"),V(t,"viewBox","0 0 24 24"),V(t,"stroke","currentColor"),V(t,"stroke-width",e[1]),V(t,"stroke-linecap","round"),V(t,"stroke-linejoin","round"),V(t,"class",r="feather feather-search "+e[2])},m(e,r){q(e,t,r),_(t,n),_(t,o)},p(e,[n]){1&n&&V(t,"width",e[0]),1&n&&V(t,"height",e[0]),2&n&&V(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-search "+e[2])&&V(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function ot(e,t,n){let{size:o="100%"}=t,{strokeWidth:r=2}=t,{class:i=""}=t;return"100%"!==o&&(o="x"===o.slice(-1)?o.slice(0,o.length-1)+"em":parseInt(o)+"px"),e.$$set=e=>{"size"in e&&n(0,o=e.size),"strokeWidth"in e&&n(1,r=e.strokeWidth),"class"in e&&n(2,i=e.class)},[o,r,i]}class rt extends ke{constructor(e){super(),we(this,e,ot,nt,k,{size:0,strokeWidth:1,class:2})}}const{document:it}=he;function lt(e){e[33]=e[35].list,e[34]=e[35].items}function st(e,t,n){const o=e.slice();return o[36]=t[n],o}function at(e,t,n){const o=e.slice();return o[39]=t[n],o}function ct(e,t,n){const o=e.slice();return o[39]=t[n],o}function dt(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function ut(e){let t,n,o,r,i,l;lt(e);let s=e[33]?.length&&mt(e),a=e[34]?.length&&ft(e),c=e[33]?.length&&ht(e);return{c(){s&&s.c(),t=E(),n=j("div"),o=j("table"),a&&a.c(),r=E(),i=j("tbody"),c&&c.c(),V(o,"striped",""),V(o,"class","svelte-btngop"),V(n,"class","eList svelte-btngop")},m(e,d){s&&s.m(e,d),q(e,t,d),q(e,n,d),_(n,o),a&&a.m(o,null),_(o,r),_(o,i),c&&c.m(i,null),l=!0},p(e,n){lt(e),e[33]?.length?s?(s.p(e,n),4&n[0]&&me(s,1)):(s=mt(e),s.c(),me(s,1),s.m(t.parentNode,t)):s&&(de(),fe(s,1,1,(()=>{s=null})),ue()),e[34]?.length?a?a.p(e,n):(a=ft(e),a.c(),a.m(o,r)):a&&(a.d(1),a=null),e[33]?.length?c?(c.p(e,n),4&n[0]&&me(c,1)):(c=ht(e),c.c(),me(c,1),c.m(i,null)):c&&(de(),fe(c,1,1,(()=>{c=null})),ue())},i(e){l||(me(s),me(c),l=!0)},o(e){fe(s),fe(c),l=!1},d(e){s&&s.d(e),e&&S(t),e&&S(n),a&&a.d(),c&&c.d()}}}function mt(e){let t,n,o,r,i,l,s,a,c,d;function u(t){e[25](t)}let m={id:e[8]};return void 0!==e[3]&&(m.value=e[3]),o=new e[6]({props:m}),J.push((()=>ge(o,"value",u))),o.$on("input",e[12]),s=new Ve({props:{size:"18"}}),{c(){t=j("div"),n=L("Suchen: "),ve(o.$$.fragment),i=E(),l=j("span"),ve(s.$$.fragment),V(l,"class","feather pointer svelte-btngop"),O(t,"margin-bottom","1em"),O(t,"position","relative")},m(r,u){q(r,t,u),_(t,n),ye(o,t,null),_(t,i),_(t,l),ye(s,l,null),a=!0,c||(d=D(l,"click",e[15]),c=!0)},p(e,t){const n={};!r&&8&t[0]&&(r=!0,n.value=e[3],oe((()=>r=!1))),o.$set(n)},i(e){a||(me(o.$$.fragment,e),me(s.$$.fragment,e),a=!0)},o(e){fe(o.$$.fragment,e),fe(s.$$.fragment,e),a=!1},d(e){e&&S(t),be(o),be(s),c=!1,d()}}}function ft(e){let t,n,o,r=e[4]&&e[0]&&pt(),i=e[34],l=[];for(let t=0;t<i.length;t+=1)l[t]=$t(ct(e,i,t));return{c(){t=j("thead"),n=j("tr"),r&&r.c(),o=E();for(let e=0;e<l.length;e+=1)l[e].c();V(n,"class","svelte-btngop"),V(t,"class","svelte-btngop")},m(e,i){q(e,t,i),_(t,n),r&&r.m(n,null),_(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?r||(r=pt(),r.c(),r.m(n,o)):r&&(r.d(1),r=null),2052&t[0]){let o;for(i=e[34],o=0;o<i.length;o+=1){const r=ct(e,i,o);l[o]?l[o].p(r,t):(l[o]=$t(r),l[o].c(),l[o].m(n,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}},d(e){e&&S(t),r&&r.d(),N(l,e)}}}function pt(e){let t;return{c(){t=j("th"),V(t,"class","svelte-btngop")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function $t(e){let t,n,o=e[39]?.designation+"";return{c(){t=j("th"),n=L(o),V(t,"class","svelte-btngop")},m(e,o){q(e,t,o),_(t,n)},p(e,t){4&t[0]&&o!==(o=e[39]?.designation+"")&&A(n,o)},d(e){e&&S(t)}}}function ht(e){let t,n,o=e[33],r=[];for(let t=0;t<o.length;t+=1)r[t]=bt(st(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(28191&n[0]){let l;for(o=e[33],l=0;l<o.length;l+=1){const i=st(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=bt(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}function gt(e){let t,n,o,r,i=e[4]&&e[0]&&vt(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=yt(at(e,l,t));return{c(){t=j("tr"),i&&i.c(),n=E();for(let e=0;e<s.length;e+=1)s[e].c();o=E(),V(t,"class","pointer svelte-btngop"),M(t,"active",e[36]._id===e[1])},m(e,l){q(e,t,l),i&&i.m(t,null),_(t,n);for(let e=0;e<s.length;e+=1)s[e].m(t,null);_(t,o),r=!0},p(e,r){if(e[4]&&e[0]?i?(i.p(e,r),17&r[0]&&me(i,1)):(i=vt(e),i.c(),me(i,1),i.m(t,n)):i&&(de(),fe(i,1,1,(()=>{i=null})),ue()),3588&r[0]){let n;for(l=e[34],n=0;n<l.length;n+=1){const i=at(e,l,n);s[n]?s[n].p(i,r):(s[n]=yt(i),s[n].c(),s[n].m(t,o))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}2054&r[0]&&M(t,"active",e[36]._id===e[1])},i(e){r||(me(i),r=!0)},o(e){fe(i),r=!1},d(e){e&&S(t),i&&i.d(),N(s,e)}}}function vt(e){let t,n,o,r,i;return o=new Oe({props:{size:"18"}}),{c(){t=j("td"),n=j("a"),ve(o.$$.fragment),V(n,"href",r=e[14](e[36])),V(n,"target","_blank"),V(t,"class","editRow svelte-btngop")},m(e,r){q(e,t,r),_(t,n),ye(o,n,null),i=!0},p(e,t){(!i||4&t[0]&&r!==(r=e[14](e[36])))&&V(n,"href",r)},i(e){i||(me(o.$$.fragment,e),i=!0)},o(e){fe(o.$$.fragment,e),i=!1},d(e){e&&S(t),be(o)}}}function yt(e){let t,n,o,r,i=e[9](e[36],e[39])+"";return{c(){t=j("td"),n=L(i),V(t,"class","svelte-btngop")},m(i,l){q(i,t,l),_(t,n),o||(r=D(t,"click",T((function(){w(e[10](e[36]))&&e[10](e[36]).apply(this,arguments)}))),o=!0)},p(t,o){e=t,4&o[0]&&i!==(i=e[9](e[36],e[39])+"")&&A(n,i)},d(e){e&&S(t),o=!1,r()}}}function bt(e){let t,n,o=e[13](e[36],e[34],e[3]),r=o&&gt(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),q(e,t,o),n=!0},p(e,n){12&n[0]&&(o=e[13](e[36],e[34],e[3])),o?r?(r.p(e,n),12&n[0]&&me(r,1)):(r=gt(e),r.c(),me(r,1),r.m(t.parentNode,t)):r&&(de(),fe(r,1,1,(()=>{r=null})),ue())},i(e){n||(me(r),n=!0)},o(e){fe(r),n=!1},d(e){r&&r.d(e),e&&S(t)}}}function wt(e){let t,n;return t=new e[5]({}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p:g,i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function kt(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:wt,then:ut,catch:dt,value:35,blocks:[,,,]};return pe(n=e[2]&&e[11](),r),{c(){t=F(),r.block.c()},m(e,n){q(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t,o=!0},p(t,o){e=t,r.ctx=e,4&o[0]&&n!==(n=e[2]&&e[11]())&&pe(n,r)||$e(r,e,o)},i(e){o||(me(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){fe(r.blocks[e])}o=!1},d(e){e&&S(t),r.block.d(e),r.token=null,r=null}}}function xt(e,o,r){let i;const l=Q(),{Loading:s,TextField:a}=c,{currentTasks:d}=u;x(e,d,(e=>r(26,i=e)));let m,{inputList:p}=o,{eventId:h}=o,{prevEventId:g}=o,{className:v}=o,{rowId:y}=o,{filterForReady:b=!1}=o,{refStatus:w}=o,{showEdit:k=!1}=o,{praefix:I=""}=o,{selectionFields:_=!1}=o,{deList:q}=o,S=!0,N="",j=v+Math.floor(9e3*Math.random()+1e3).toString()+"search";const C=(e,t)=>{if(!t)return;let n=e[t.name];if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||n||"")},L=t.getSchemaByClass(v),E=async(e,n)=>{if(w)return r(16,w=[].concat(w)),e.filter((e=>!!w.find((t=>e._task.status===t))));if("Information"===n.state.task)return e;if(g){const n=await t.getEvent(g);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===v)return"Information"===n.state.task?e.filter((e=>"Closed"!==e._task.status)):e.filter((e=>"Ready"===e._task.status))}return e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status))},F=async(e,t,n,o)=>{const{value:r,refClass:i}=o,[l,s]=n.split("."),a=r?.get(I),c=a&&await As(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let o=e?.find((e=>e._id===n[t]))||{};o={...o};for(const e in o)n[e]&&(o[e]=n[e]);for(const e in n)n[e]&&(o[e]=n[e]);return Ts(i+o._id.toString(),o),o})):e};H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(j)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await L;e.eventId===t.id&&(Bs(t.class,e.eventId),r(2,S=!r(2,S=!1)))}));return e.$$set=e=>{"inputList"in e&&r(17,p=e.inputList),"eventId"in e&&r(18,h=e.eventId),"prevEventId"in e&&r(19,g=e.prevEventId),"className"in e&&r(20,v=e.className),"rowId"in e&&r(1,y=e.rowId),"filterForReady"in e&&r(21,b=e.filterForReady),"refStatus"in e&&r(16,w=e.refStatus),"showEdit"in e&&r(0,k=e.showEdit),"praefix"in e&&r(22,I=e.praefix),"selectionFields"in e&&r(23,_=e.selectionFields),"deList"in e&&r(24,q=e.deList)},[k,y,S,N,m,s,a,d,j,C,e=>()=>l("choose",{row:e}),async()=>{const e=await L;let n;r(4,m=(e=>!i?.length||!!i.find((t=>t===e)))(e.id));let o,s=n=p||await Ds(e.class,e.id),a=!1,c="";const d=_&&_?.find((t=>e.class===t.refClass.split(":")[0])),u=d?.value?.get&&d.value.get(I);if(u){const[n,r]=d.refClass.split(":");e.class===n&&(s=await F(s,n,r,d)),a=d.parentClass?.find((e=>"quantity"===e.name)),c=d.className,o=await t.getCountedSection(c,r.split(".")[0],u,n,"quantity")}r(0,k&&=!d),d||!b&&!w||(s=await E(s,e));let f=[],{display:$}=e;return $&&$.length?$.map((t=>{const[n,o]=t.split(".");let r=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));r&&(r={...r},r.name=`${n}_${o}`,s=s.map((e=>(e[n]&&(e[r.name]=e["_"+n]?e["_"+n][o]:e[n][o]),e)))),r||(r=e.items.find((e=>e.name===n))),f.find((e=>e?.name===n))||f.push(r)})):f=e.items,!k&&a?(f=f.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),s=s.map((e=>{const t=o.find((t=>t._id===e._id));return t&&(e.ist=t.quantity.$numberDecimal),e})),o.map((e=>{if(!s.find((t=>t._id===e._id))){const t=n.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,s.push(t)}})),l("init",s)):q&&(s=s.filter((e=>!q.find((t=>t._id===e._id))))),{list:s,items:f}},({detail:{value:e}})=>{r(3,N=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(C(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},e=>`/task/${e._task.event}/${e._task._id}/task?view=standalone`,()=>{r(3,N="")},w,p,h,g,v,b,I,_,q,function(e){N=e,r(3,N)}]}class It extends ke{constructor(e){var t;super(),it.getElementById("svelte-btngop-style")||((t=j("style")).id="svelte-btngop-style",t.textContent=".feather.svelte-btngop.svelte-btngop{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-btngop.svelte-btngop{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-btngop .editRow.svelte-btngop{width:1em}.eList.svelte-btngop table.svelte-btngop{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-btngop table thead.svelte-btngop{position:sticky;top:0;background:#326173;color:white}.eList.svelte-btngop table thead tr.svelte-btngop{height:2.3em}.eList.svelte-btngop table tbody tr.svelte-btngop{height:2.75em !important}th.svelte-btngop.svelte-btngop,td.svelte-btngop.svelte-btngop{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-btngop.svelte-btngop:hover{background-color:#DAE1E5}tr.active.svelte-btngop.svelte-btngop{color:#326173;background-color:#fcebd5}",_(it.head,t)),we(this,e,xt,kt,k,{inputList:17,eventId:18,prevEventId:19,className:20,rowId:1,filterForReady:21,refStatus:16,showEdit:0,praefix:22,selectionFields:23,deList:24},[-1,-1])}}function _t(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function qt(e){let t,n,o=e[39]&&St(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){e[39]?o?(o.p(e,n),8&n[0]&&me(o,1)):(o=St(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function St(e){let t,n;return t=new e[19]({props:{title:e[15]?"Auswahl":e[0],class:"eList "+(e[13]?"form":""),$$slots:{default:[Vt]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};32769&n[0]&&(o.title=e[15]?"Auswahl":e[0]),8192&n[0]&&(o.class="eList "+(e[13]?"form":"")),524286&n[0]|512&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Nt(e){let t,n;return t=new Ms({props:{schema:e[2],recID:e[1],readonly:e[14]}}),t.$on("choose",(function(){w(e[28](e[39]))&&e[28](e[39]).apply(this,arguments)})),t.$on("back",e[25]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(n,o){e=n;const r={};4&o[0]&&(r.schema=e[2]),2&o[0]&&(r.recID=e[1]),16384&o[0]&&(r.readonly=e[14]),t.$set(r)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function jt(e){let t,n,o,r,i,l,s;t=new e[20]({props:{text:e[15]?"Zusätzliche Auswahl":""}});const a=[Lt,Ct],c=[];function d(e,t){return e[15]?0:1}return o=d(e),r=c[o]=a[o](e),l=new It({props:{eventId:e[2].id,className:e[2].class,prevEventId:e[11],filterForReady:e[4],refStatus:e[5],praefix:e[6],selectionFields:e[7],rowId:e[1],deList:e[9],showEdit:e[8]}}),l.$on("edit",e[29]),l.$on("choose",e[32]),l.$on("init",e[30]),{c(){ve(t.$$.fragment),n=E(),r.c(),i=E(),ve(l.$$.fragment)},m(e,r){ye(t,e,r),q(e,n,r),c[o].m(e,r),q(e,i,r),ye(l,e,r),s=!0},p(e,n){const s={};32768&n[0]&&(s.text=e[15]?"Zusätzliche Auswahl":""),t.$set(s);let u=o;o=d(e),o===u?c[o].p(e,n):(de(),fe(c[u],1,1,(()=>{c[u]=null})),ue(),r=c[o],r?r.p(e,n):(r=c[o]=a[o](e),r.c()),me(r,1),r.m(i.parentNode,i));const m={};4&n[0]&&(m.eventId=e[2].id),4&n[0]&&(m.className=e[2].class),2048&n[0]&&(m.prevEventId=e[11]),16&n[0]&&(m.filterForReady=e[4]),32&n[0]&&(m.refStatus=e[5]),64&n[0]&&(m.praefix=e[6]),128&n[0]&&(m.selectionFields=e[7]),2&n[0]&&(m.rowId=e[1]),512&n[0]&&(m.deList=e[9]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(me(t.$$.fragment,e),me(r),me(l.$$.fragment,e),s=!0)},o(e){fe(t.$$.fragment,e),fe(r),fe(l.$$.fragment,e),s=!1},d(e){be(t,e),e&&S(n),c[o].d(e),e&&S(i),be(l,e)}}}function Ct(e){let t,n,o,r;n=new e[21]({props:{outline:!0,$$slots:{default:[Et]},$$scope:{ctx:e}}}),n.$on("click",e[26]);let i=e[23]&&e[10]&&Ft(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),i&&i.c(),V(t,"class","form--buttons svelte-jb5mrh")},m(e,l){q(e,t,l),ye(n,t,null),_(t,o),i&&i.m(t,null),r=!0},p(e,o){const r={};512&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r),e[23]&&e[10]?i?(i.p(e,o),1024&o[0]&&me(i,1)):(i=Ft(e),i.c(),me(i,1),i.m(t,null)):i&&(de(),fe(i,1,1,(()=>{i=null})),ue())},i(e){r||(me(n.$$.fragment,e),me(i),r=!0)},o(e){fe(n.$$.fragment,e),fe(i),r=!1},d(e){e&&S(t),be(n),i&&i.d()}}}function Lt(e){let t,n,o,r,i,l,s=e[18]&&zt(e);return o=new e[21]({props:{outline:!0,$$slots:{default:[Tt]},$$scope:{ctx:e}}}),o.$on("click",e[26]),i=new e[20]({props:{text:"Liste aus "+e[12]}}),{c(){s&&s.c(),t=E(),n=j("div"),ve(o.$$.fragment),r=E(),ve(i.$$.fragment),V(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),q(e,t,a),q(e,n,a),ye(o,n,null),q(e,r,a),ye(i,e,a),l=!0},p(e,n){e[18]?s?(s.p(e,n),262144&n[0]&&me(s,1)):(s=zt(e),s.c(),me(s,1),s.m(t.parentNode,t)):s&&(de(),fe(s,1,1,(()=>{s=null})),ue());const r={};512&n[1]&&(r.$$scope={dirty:n,ctx:e}),o.$set(r);const l={};4096&n[0]&&(l.text="Liste aus "+e[12]),i.$set(l)},i(e){l||(me(s),me(o.$$.fragment,e),me(i.$$.fragment,e),l=!0)},o(e){fe(s),fe(o.$$.fragment,e),fe(i.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&S(t),e&&S(n),be(o),e&&S(r),be(i,e)}}}function Et(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Ft(e){let t,n;return t=new e[21]({props:{filled:!0,$$slots:{default:[Dt]},$$scope:{ctx:e}}}),t.$on("click",e[27]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};512&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Dt(e){let t;return{c(){t=L("Neu")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function zt(e){let t,n;return t=new vl({props:{item:e[16],record:{_id:"",[e[16].name]:""},noForm:"true",classId:"sel_"+e[16].name,eventId:e[17],required:!1,hidden:!1,readonly:!1,deList:e[18]}}),t.$on("notify",e[31]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};65536&n[0]&&(o.item=e[16]),65536&n[0]&&(o.record={_id:"",[e[16].name]:""}),65536&n[0]&&(o.classId="sel_"+e[16].name),131072&n[0]&&(o.eventId=e[17]),262144&n[0]&&(o.deList=e[18]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Tt(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Vt(e){let t,n,o,r;const i=[jt,Nt],l=[];function s(e,t){return e[39].length&&!e[13]?0:1}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),q(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(de(),fe(l[a],1,1,(()=>{l[a]=null})),ue(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),me(n,1),n.m(o.parentNode,o))},i(e){r||(me(n),r=!0)},o(e){fe(n),r=!1},d(e){l[t].d(e),e&&S(o)}}}function At(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Bt(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:At,then:qt,catch:_t,value:39,blocks:[,,,]};return pe(n=e[24](e[3]),r),{c(){t=F(),r.block.c()},m(e,n){q(e,t,n),r.block.m(e,r.anchor=n),r.mount=()=>t.parentNode,r.anchor=t,o=!0},p(t,o){e=t,r.ctx=e,8&o[0]&&n!==(n=e[24](e[3]))&&pe(n,r)||$e(r,e,o)},i(e){o||(me(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){fe(r.blocks[e])}o=!1},d(e){e&&S(t),r.block.d(e),r.token=null,r=null}}}function Ot(e,n,o){let r;const{Dialog:i,Divider:l,Button:s}=c,a=Q(),{currentTasks:d}=u;x(e,d,(e=>o(35,r=e)));let{title:m}=n,{schema:f}=n,{recID:p}=n,{isOpening:$=!0}=n,{filterForReady:h=!1}=n,{refStatus:g}=n,{praefix:v=""}=n,{selectionFields:y=!1}=n,{showEdit:b=!0}=n,{deList:w}=n,{newAllowed:k=!0}=n,{prevEventId:I}=n,_=f.id;f.class;let q,S,N,j,C,L,E,F="",D=!1;m??=f.identity.designation;const z=!r?.length||r.find((e=>e===_));return e.$$set=e=>{"title"in e&&o(0,m=e.title),"schema"in e&&o(2,f=e.schema),"recID"in e&&o(1,p=e.recID),"isOpening"in e&&o(3,$=e.isOpening),"filterForReady"in e&&o(4,h=e.filterForReady),"refStatus"in e&&o(5,g=e.refStatus),"praefix"in e&&o(6,v=e.praefix),"selectionFields"in e&&o(7,y=e.selectionFields),"showEdit"in e&&o(8,b=e.showEdit),"deList"in e&&o(9,w=e.deList),"newAllowed"in e&&o(10,k=e.newAllowed),"prevEventId"in e&&o(11,I=e.prevEventId)},[m,p,f,$,h,g,v,y,b,w,k,I,F,D,q,N,C,L,E,i,l,s,d,z,async e=>{if(!e)return!1;const n=await Ds(f.class,f.id);if(S=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),o(15,N=S?.value?.get&&S.value.get(v)),N){j=S.refClass;const[e,n]=j.split(":"),[r]=n.split(".");o(16,C=S.parentClass.find((t=>t.name===e)));const i=await t.getSchemaByClass(C.refClass);o(17,L=i.id),o(12,F=S.parentClass.find((e=>e.name===r)).designation)}return n},()=>{o(13,D=!1),p||a("back"),b||a("back")},()=>{o(13,D=!1),a("back")},()=>{o(1,p=!1),o(14,q=!1),o(13,D=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,o]=t.split(".");let r=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));if(r){e[`${n}_${o}`]=e[n][o]}})),a("choose",{row:e})},({detail:e})=>{o(14,q=!!e._task.visum||"Closed"===e._task.status),o(1,p=e._docId),o(13,D=!0)},({detail:e})=>{N&&o(18,E=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){Y(e,t)}]}class Mt extends ke{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=j("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",_(document.head,t)),we(this,e,Ot,Bt,k,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11},[-1,-1])}}const{document:Wt}=he;function Rt(e){e[27]=e[29].list,e[28]=e[29].items}function Pt(e,t,n){const o=e.slice();return o[30]=t[n],o}function Ht(e,t,n){const o=e.slice();return o[33]=t[n],o}function Qt(e,t,n){const o=e.slice();return o[33]=t[n],o}function Yt(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Gt(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Rt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Jt]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),J.push((()=>ge(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let w=e[28]?.length&&function(e){let t,n,o,r,i=e[28],l=[];for(let t=0;t<i.length;t+=1)l[t]=Ut(Qt(e,i,t));return{c(){t=j("thead"),n=j("tr"),o=j("th"),r=E();for(let e=0;e<l.length;e+=1)l[e].c();V(o,"class","svelte-14hcfjl"),V(n,"class","svelte-14hcfjl"),V(t,"class","svelte-14hcfjl")},m(e,i){q(e,t,i),_(t,n),_(n,o),_(n,r);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let o;for(i=e[28],o=0;o<i.length;o+=1){const r=Qt(e,i,o);l[o]?l[o].p(r,t):(l[o]=Ut(r),l[o].c(),l[o].m(n,null))}for(;o<l.length;o+=1)l[o].d(1);l.length=i.length}},d(e){e&&S(t),N(l,e)}}}(e),k=e[27]?.length&&function(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Xt(Pt(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(44547&n[0]){let l;for(o=e[27],l=0;l<o.length;l+=1){const i=Pt(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=Xt(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),r=j("div"),i=L("Suchen: "),ve(l.$$.fragment),a=E(),c=j("span"),ve(d.$$.fragment),u=E(),m=j("div"),f=j("table"),w&&w.c(),p=E(),$=j("tbody"),k&&k.c(),V(t,"class","form--buttons svelte-14hcfjl"),V(c,"class","feather pointer svelte-14hcfjl"),O(r,"margin-bottom","1em"),O(r,"position","relative"),V(f,"striped",""),V(f,"class","svelte-14hcfjl"),V(m,"class","eList svelte-14hcfjl")},m(s,y){q(s,t,y),ye(n,t,null),q(s,o,y),q(s,r,y),_(r,i),ye(l,r,null),_(r,a),_(r,c),ye(d,c,null),q(s,u,y),q(s,m,y),_(m,f),w&&w.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=D(c,"click",e[14]),g=!0)},p(e,t){Rt(e);const o={};128&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],oe((()=>s=!1))),l.$set(r),e[28]?.length&&w.p(e,t),e[27]?.length&&k.p(e,t)},i(e){h||(me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),me(k),h=!0)},o(e){fe(n.$$.fragment,e),fe(l.$$.fragment,e),fe(d.$$.fragment,e),fe(k),h=!1},d(e){e&&S(t),be(n),e&&S(o),e&&S(r),be(l),be(d),e&&S(u),e&&S(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function Jt(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Ut(e){let t,n,o=e[33]?.designation+"";return{c(){t=j("th"),n=L(o),V(t,"class","svelte-14hcfjl")},m(e,o){q(e,t,o),_(t,n)},p:g,d(e){e&&S(t)}}}function Zt(e){let t,n,o,r,i,l,s,a;o=new Oe({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=Kt(Ht(e,c,t));return{c(){t=j("tr"),n=j("td"),ve(o.$$.fragment),r=E();for(let e=0;e<d.length;e+=1)d[e].c();i=E(),V(n,"class","editRow svelte-14hcfjl"),V(t,"class","pointer svelte-14hcfjl"),M(t,"active",e[30]._id===e[0])},m(c,u){q(c,t,u),_(t,n),ye(o,n,null),_(t,r);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,i),l=!0,s||(a=D(n,"click",e[15](e[30])),s=!0)},p(n,o){if(e=n,3584&o[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const r=Ht(e,c,n);d[n]?d[n].p(r,o):(d[n]=Kt(r),d[n].c(),d[n].m(t,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&o[0]&&M(t,"active",e[30]._id===e[0])},i(e){l||(me(o.$$.fragment,e),l=!0)},o(e){fe(o.$$.fragment,e),l=!1},d(e){e&&S(t),be(o),N(d,e),s=!1,a()}}}function Kt(e){let t,n,o,r,i=e[9](e[30],e[33])+"";return{c(){t=j("td"),n=L(i),V(t,"class","svelte-14hcfjl")},m(i,l){q(i,t,l),_(t,n),o||(r=D(t,"click",T(e[10](e[30]))),o=!0)},p(t,n){e=t},d(e){e&&S(t),o=!1,r()}}}function Xt(e){let t,n,o=e[13](e[30],e[28],e[1]),r=o&&Zt(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),q(e,t,o),n=!0},p(e,n){2&n[0]&&(o=e[13](e[30],e[28],e[1])),o?r?(r.p(e,n),2&n[0]&&me(r,1)):(r=Zt(e),r.c(),me(r,1),r.m(t.parentNode,t)):r&&(de(),fe(r,1,1,(()=>{r=null})),ue())},i(e){n||(me(r),n=!0)},o(e){fe(r),n=!1},d(e){r&&r.d(e),e&&S(t)}}}function en(e){let t,n;return t=new e[5]({}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p:g,i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function tn(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:en,then:Gt,catch:Yt,value:29,blocks:[,,,]};return pe(e[11](),i),{c(){ve(t.$$.fragment),n=E(),o=F(),i.block.c()},m(e,l){ye(t,e,l),q(e,n,l),q(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){$e(i,e=t,n)},i(e){r||(me(t.$$.fragment,e),me(i.block),r=!0)},o(e){fe(t.$$.fragment,e);for(let e=0;e<3;e+=1){fe(i.blocks[e])}r=!1},d(e){be(t,e),e&&S(n),e&&S(o),i.block.d(e),i.token=null,i=null}}}function nn(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[tn]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};3&n[0]|128&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function on(e,o,r){const i=Q(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=o,{classId:p}=o,{className:h}=o,{rowId:g}=o,{viewName:v}=o,{viewValue:y}=o,{recordId:b}=o,{filter:w}=o,k="",x=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass(h);H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Bs(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&r(16,m=e.item),"classId"in e&&r(17,p=e.classId),"className"in e&&r(18,h=e.className),"rowId"in e&&r(0,g=e.rowId),"viewName"in e&&r(19,v=e.viewName),"viewValue"in e&&r(20,y=e.viewValue),"recordId"in e&&r(21,b=e.recordId),"filter"in e&&r(22,w=e.filter)},[g,k,i,l,s,a,d,u,x,I,e=>()=>i("choose",{row:e}),async()=>{const e=await _;let n=[];if(m.lookup){const e="."+p+"#"+m.lookup,o=document.querySelector(e),r=o?.value||b;if(r){const e=await t.getTask(m.lookup,r);if(e){const o=e[m.name]?.map((e=>e[m.name]));o&&(n=await t.getSectionView(m.name,{_id:{$in:o}},!0))}}}else{const o="."+p+"#"+v.split(":")[0],r=document.querySelector(o);let i={[v]:r?.value||b};if(m.refItem){const e="."+p+"#"+m.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[m.refItem]:t.value},{[m.refItem]:{$exists:!0,$eq:""}}]};i={...i,...e}}}catch{}}i[v]&&(n=await t.getSectionView(e.class,i,!0)),w&&(n=n.filter((e=>e._id!=w)))}let o=[],r=e.display;return r&&r.length?r.map((t=>{const[r,i]=t.split(".");let l=e.list?.find((e=>e.name===r))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${r}_${i}`,n=n.map((e=>(e[r]&&(e[l.name]=e["_"+r]?e["_"+r][i]:e[r][i]),e)))),l||(l=e.items.find((e=>e.name===r))),o.find((e=>e?.name===r))||o.push(l)})):o=e.items,{list:n,items:o}},({detail:{value:e}})=>{r(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(I(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,k="")},e=>async()=>{const n=await t.getTaskByDocId(e._id),o=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(o)},m,p,h,v,y,b,w,()=>i("back"),function(e){k=e,r(1,k)}]}class rn extends ke{constructor(e){var t;super(),Wt.getElementById("svelte-14hcfjl-style")||((t=j("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Wt.head,t)),we(this,e,on,nn,k,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:ln}=he;function sn(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function an(e){let t,n,o=e[51]&&function(e){let t,n,o,i,l,s,a,c,d,u,m,f,p,$,h;n=new r({props:{class:"full-width",id:e[24],value:e[2],rows:"1",required:e[1],disabled:e[3],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"}}),n.$on("click",e[28]()),n.$on("onFocus",e[28](e[24]));const g=[dn,cn],v=[];function y(e,t){return!e[3]||e[14]?0:e[19]&&e[0]?1:-1}~(i=y(e))&&(l=v[i]=g[i](e));let b=(!e[3]||e[14])&&un(e);function w(t){e[39](t)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[$n]},$$scope:{ctx:e}};void 0!==e[16]&&(k.open=e[16]);m=new e[23]({props:k}),J.push((()=>ge(m,"open",w)));let x=e[17]&&hn(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),l&&l.c(),s=E(),a=j("input"),d=E(),b&&b.c(),u=E(),ve(m.$$.fragment),p=E(),x&&x.c(),$=F(),V(a,"class",c=I(e[7]||e[8])+" svelte-jox15l"),V(a,"id",e[5]),V(a,"name",e[5]),a.value=e[0],a.hidden=!0,O(t,"position","relative")},m(e,r){q(e,t,r),ye(n,t,null),_(t,o),~i&&v[i].m(t,null),_(t,s),_(t,a),_(t,d),b&&b.m(t,null),q(e,u,r),ye(m,e,r),q(e,p,r),x&&x.m(e,r),q(e,$,r),h=!0},p(e,o){const r={};4&o[0]&&(r.value=e[2]),2&o[0]&&(r.required=e[1]),8&o[0]&&(r.disabled=e[3]),n.$set(r);let d=i;i=y(e),i===d?~i&&v[i].p(e,o):(l&&(de(),fe(v[d],1,1,(()=>{v[d]=null})),ue()),~i?(l=v[i],l?l.p(e,o):(l=v[i]=g[i](e),l.c()),me(l,1),l.m(t,s)):l=null),(!h||384&o[0]&&c!==(c=I(e[7]||e[8])+" svelte-jox15l"))&&V(a,"class",c),(!h||32&o[0])&&V(a,"id",e[5]),(!h||32&o[0])&&V(a,"name",e[5]),(!h||1&o[0]&&a.value!==e[0])&&(a.value=e[0]),!e[3]||e[14]?b?(b.p(e,o),16392&o[0]&&me(b,1)):(b=un(e),b.c(),me(b,1),b.m(t,null)):b&&(de(),fe(b,1,1,(()=>{b=null})),ue());const u={};3260241&o[0]|2097152&o[1]&&(u.$$scope={dirty:o,ctx:e}),!f&&65536&o[0]&&(f=!0,u.open=e[16],oe((()=>f=!1))),m.$set(u),e[17]?x?(x.p(e,o),131072&o[0]&&me(x,1)):(x=hn(e),x.c(),me(x,1),x.m($.parentNode,$)):x&&(de(),fe(x,1,1,(()=>{x=null})),ue())},i(e){h||(me(n.$$.fragment,e),me(l),me(b),me(m.$$.fragment,e),me(x),h=!0)},o(e){fe(n.$$.fragment,e),fe(l),fe(b),fe(m.$$.fragment,e),fe(x),h=!1},d(e){e&&S(t),be(n),~i&&v[i].d(),b&&b.d(),e&&S(u),be(m,e),e&&S(p),x&&x.d(e),e&&S($)}}}(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,t){e[51]&&o.p(e,t)},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function cn(e){let t,n,o,r,i;return n=new Oe({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-jox15l")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[32]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function dn(e){let t,n,o,r,i;return n=new rt({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-jox15l")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=[D(t,"click",e[28]()),D(t,"choose",e[29])],r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,b(i)}}}function un(e){let t,n,o,r,i;return n=new Ve({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather2 pointer svelte-jox15l")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[31]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function mn(e){let t,n,o,r;const i=[pn,fn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),q(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(de(),fe(l[a],1,1,(()=>{l[a]=null})),ue(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),me(n,1),n.m(o.parentNode,o))},i(e){r||(me(n),r=!0)},o(e){fe(n),r=!1},d(e){l[t].d(e),e&&S(o)}}}function fn(e){let t,n;return t=new Mt({props:{title:e[6].designation,newAllowed:e[20],prevEventId:e[9],schema:e[15],recID:e[0],isOpening:e[16],filterForReady:e[21],refStatus:e[6].refStatus,selectionFields:e[12],deList:e[13],praefix:e[11]}}),t.$on("choose",e[29]),t.$on("back",e[30]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.title=e[6].designation),1048576&n[0]&&(o.newAllowed=e[20]),512&n[0]&&(o.prevEventId=e[9]),32768&n[0]&&(o.schema=e[15]),1&n[0]&&(o.recID=e[0]),65536&n[0]&&(o.isOpening=e[16]),2097152&n[0]&&(o.filterForReady=e[21]),64&n[0]&&(o.refStatus=e[6].refStatus),4096&n[0]&&(o.selectionFields=e[12]),8192&n[0]&&(o.deList=e[13]),2048&n[0]&&(o.praefix=e[11]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function pn(e){let t,n;return t=new rn({props:{item:e[6],className:e[15].class,classId:e[8],rowId:e[0],recordId:e[10],viewName:e[4],viewValue:""}}),t.$on("choose",e[29]),t.$on("back",e[30]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.item=e[6]),32768&n[0]&&(o.className=e[15].class),256&n[0]&&(o.classId=e[8]),1&n[0]&&(o.rowId=e[0]),1024&n[0]&&(o.recordId=e[10]),16&n[0]&&(o.viewName=e[4]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function $n(e){let t,n,o=e[16]&&mn(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){e[16]?o?(o.p(e,n),65536&n[0]&&me(o,1)):(o=mn(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function hn(e){let t,n,o;function r(t){e[40](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[vn]},$$scope:{ctx:e}};return void 0!==e[17]&&(i.open=e[17]),t=new e[23]({props:i}),J.push((()=>ge(t,"open",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};294913&o[0]|2097152&o[1]&&(r.$$scope={dirty:o,ctx:e}),!n&&131072&o[0]&&(n=!0,r.open=e[17],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function gn(e){let t,n;return t=new Ms({props:{schema:e[15],recID:e[0],readonly:!0}}),t.$on("back",e[30]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};32768&n[0]&&(o.schema=e[15]),1&n[0]&&(o.recID=e[0]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function vn(e){let t,n;return t=new e[22]({props:{title:e[18],$$slots:{default:[gn]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};262144&n[0]&&(o.title=e[18]),32769&n[0]|2097152&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function yn(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function bn(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:yn,then:an,catch:sn,value:51,blocks:[,,,]};return pe(e[27](),o),{c(){t=F(),o.block.c()},m(e,r){q(e,t,r),o.block.m(e,o.anchor=r),o.mount=()=>t.parentNode,o.anchor=t,n=!0},p(t,n){$e(o,e=t,n)},i(e){n||(me(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){fe(o.blocks[e])}n=!1},d(e){e&&S(t),o.block.d(e),o.token=null,o=null}}}function wn(e,n,r){let i,l,s;x(e,o,(e=>r(38,i=e)));const a=Q(),{Dialog:d,Modal:m}=c;let{id:f}=n,{item:p}=n,{value:$=""}=n,{desc:g=""}=n,{noForm:v=!1}=n,{classId:y}=n,{eventId:b}=n,{recordId:w}=n,{withRefValue:k=!1}=n,{refValue:I=""}=n,{required:_}=n,{disabled:q}=n,{readonly:S}=n,{praefix:N}=n,{selectionFields:j}=n,{formnovalidate:C}=n,{selection:L}=n,{deList:E}=n,{isTemplate:F}=n;const D="comment_"+f;let z,T,V,A,B,O,M=!1,W=!0,R=!0;S||=w&&p.asInput,q||=S,!L&&p.selection&&1===p.selection.split(":").length&&(L=p.selection);const{currentTasks:P,loggedIn:H}=u;x(e,P,(e=>r(42,l=e))),x(e,H,(e=>r(43,s=e)));const Y=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},G=e=>{e&&(r(2,g=h(V,e)),a("setRefDesc",g.split(" •")[0]),a("change",{value:$,description:g}),a("task",{row:e,eventId:V.id}))},J=()=>{r(16,M=!1),r(17,z=!1)};return e.$$set=e=>{"id"in e&&r(5,f=e.id),"item"in e&&r(6,p=e.item),"value"in e&&r(0,$=e.value),"desc"in e&&r(2,g=e.desc),"noForm"in e&&r(7,v=e.noForm),"classId"in e&&r(8,y=e.classId),"eventId"in e&&r(9,b=e.eventId),"recordId"in e&&r(10,w=e.recordId),"withRefValue"in e&&r(33,k=e.withRefValue),"refValue"in e&&r(34,I=e.refValue),"required"in e&&r(1,_=e.required),"disabled"in e&&r(3,q=e.disabled),"readonly"in e&&r(35,S=e.readonly),"praefix"in e&&r(11,N=e.praefix),"selectionFields"in e&&r(12,j=e.selectionFields),"formnovalidate"in e&&r(36,C=e.formnovalidate),"selection"in e&&r(4,L=e.selection),"deList"in e&&r(13,E=e.deList),"isTemplate"in e&&r(14,F=e.isTemplate)},e.$$.update=()=>{if(2&e.$$.dirty[0]|32&e.$$.dirty[1]&&r(1,_=_&&!C),12&e.$$.dirty[1]&&k&&r(0,$=I),32833&e.$$.dirty[0]&&$&&V&&Promise.resolve(zs(p.refClass,V.id,$)).then((e=>G(e))),65&e.$$.dirty[0]|192&e.$$.dirty[1]&&$&&A&&p.name===A.input?.at(0)&&A.inputLookup?.length){const{domain:e}=A.inputLookup[0]||{};"user"===e&&(i.some((e=>A.authorization?.find((t=>t.role===e&&!t.constraint))))||r(3,q=!0))}32769&e.$$.dirty[0]&&!$&&V&&G({})},[$,_,g,q,L,f,p,v,y,b,w,N,j,E,F,V,M,z,T,B,W,R,d,m,D,P,H,async()=>{try{const e=await t.getEvent(b);if(O="report"===e.output.type,r(21,R=!p.asInput),r(20,W=e.output?.class[0].name!==p.refClass),r(15,V=await t.getSchemaByClass(p.refClass)),Y(V),r(19,B=(e=>!l?.length||!!l.find((t=>t===e)))(V.id)),r(37,A=await t.getSchema(b)),b&&w&&$&&!q&&A.input?.find((e=>e===p.refClass))&&r(3,q=!0),p.properties?.query?.lookup){const{domain:e,value:n}=p.properties.query.lookup;if("user"===e){const e={[n]:s.user},o=await t.getSectionView(p.refClass,e);if(o?.length){const[{_id:e}]=o;e&&(r(34,I=e),r(33,k=!0))}i.some((e=>V.authorization?.find((t=>t.role===e&&!t.constraint))))||r(3,q=!0)}}return r(18,T=V.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if("BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}r(16,M=!0)},({detail:e})=>{r(0,$=e.row._id),J()},J,()=>{(O||B)&&(r(0,$=r(2,g="")),a("change",{value:$,description:g}),a("task",{row:{_task:{event:V.id,_id:!1}}}))},async()=>{if(!$)return;const e=await zs(p.refClass,V.id,$);if(!e._task)return;const t=e._task._id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},k,I,S,C,A,i,function(e){M=e,r(16,M)},function(e){z=e,r(17,z)}]}class kn extends ke{constructor(e){var t;super(),ln.getElementById("svelte-jox15l-style")||((t=j("style")).id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",_(ln.head,t)),we(this,e,wn,bn,k,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:33,refValue:34,required:1,disabled:3,readonly:35,praefix:11,selectionFields:12,formnovalidate:36,selection:4,deList:13,isTemplate:14},[-1,-1])}}const xn=/\d+/g,In=/%[HMSpPdmyY%]/g;function _n(e,t,n){const o=Math.floor((new Date).getFullYear()/100);let r=!1;if(""===e)return null;const i=t.split(In);let l=0,s=0;const a=new Date(0);for(const c of i){if(!e.startsWith(c,l))return n;if(l+=c.length,l===e.length){if(s!==t.length)return n;break}if("%"!==t[s+c.length])break;if(s+=c.length+1,"%"===t[s]){if("%"!==e[l])return n;l++}else if("p"===t[s].toLowerCase()){const t=e.substr(l,2).toUpperCase();if("AM"===t)r=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;r=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{xn.lastIndex=l;const i=xn.exec(e);if(null==i)return n;switch(t[s]){case"H":a.setHours(parseInt(i[0])+12*r);break;case"M":a.setMinutes(i[0]);break;case"S":a.setSeconds(i[0]);break;case"d":a.setDate(i[0]);break;case"m":a.setMonth(i[0]-1);break;case"y":a.setFullYear(100*o+parseInt(i[0]));break;case"Y":a.setFullYear(i[0])}l+=i[0].length}s++}return isNaN(a.valueOf())?n:a}function qn(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:Sn}=he;function Nn(e,t,n){const o=e.slice();return o[17]=t[n],o}function jn(e,t,n){const o=e.slice();return o[20]=t[n],o}function Cn(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Ln(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=Fn(jn(e,p,t));const h=e=>fe($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&Dn(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[Tn]},$$scope:{ctx:e}}}),a.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[Vn]},$$scope:{ctx:e}}}),{c(){t=j("form"),n=j("input"),r=E();for(let e=0;e<$.length;e+=1)$[e].c();i=E(),g&&g.c(),l=E(),s=j("div"),ve(a.$$.fragment),c=E(),ve(d.$$.fragment),V(n,"class",I(e[6])+" svelte-1phofh5"),V(n,"name","_id"),V(n,"type","hidden"),n.value=o=e[1]._id||"",V(t,"class","fTask svelte-1phofh5"),V(t,"id",e[6]),V(s,"class","form--buttons svelte-1phofh5")},m(o,p){q(o,t,p),_(t,n),_(t,r);for(let e=0;e<$.length;e+=1)$[e].m(t,null);_(t,i),g&&g.m(t,null),q(o,l,p),q(o,s,p),ye(a,s,null),_(s,c),ye(d,s,null),u=!0,m||(f=[D(t,"keydown",e[8]),D(t,"submit",z(e[10]))],m=!0)},p(e,r){if((!u||2&r&&o!==(o=e[1]._id||""))&&(n.value=o),75&r){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const o=jn(e,p,n);$[n]?($[n].p(o,r),me($[n],1)):($[n]=Fn(o),$[n].c(),me($[n],1),$[n].m(t,i))}for(de(),n=p.length;n<$.length;n+=1)h(n);ue()}e[0].list?g?(g.p(e,r),1&r&&me(g,1)):(g=Dn(e),g.c(),me(g,1),g.m(t,null)):g&&(de(),fe(g,1,1,(()=>{g=null})),ue());const l={};8388608&r&&(l.$$scope={dirty:r,ctx:e}),a.$set(l);const s={};4&r&&(s.disabled=e[2]),8388608&r&&(s.$$scope={dirty:r,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)me($[e]);me(g),me(a.$$.fragment,e),me(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)fe($[e]);fe(g),fe(a.$$.fragment,e),fe(d.$$.fragment,e),u=!1},d(e){e&&S(t),N($,e),g&&g.d(),e&&S(l),e&&S(s),be(a),be(d),m=!1,b(f)}}}function En(e){let t,n;return t=new vl({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};1&n&&(o.item=e[20]),1&n&&(o.selection=e[20].selection),2&n&&(o.record=e[1]),8&n&&(o.disabled=e[3]),1&n&&(o.eventId=e[0].id),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Fn(e){let t,n,o=On(!0,e[20]),r=o&&En(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),q(e,t,o),n=!0},p(e,n){1&n&&(o=On(!0,e[20])),o?r?(r.p(e,n),1&n&&me(r,1)):(r=En(e),r.c(),me(r,1),r.m(t.parentNode,t)):r&&(de(),fe(r,1,1,(()=>{r=null})),ue())},i(e){n||(me(r),n=!0)},o(e){fe(r),n=!1},d(e){r&&r.d(e),e&&S(t)}}}function Dn(e){let t,n,o=e[0].list,r=[];for(let t=0;t<o.length;t+=1)r[t]=zn(Nn(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(75&n){let l;for(o=e[0].list,l=0;l<o.length;l+=1){const i=Nn(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=zn(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}function zn(e){let t,n,o,r;return t=new e[4]({props:{text:e[17].designation}}),o=new Kn({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){ve(t.$$.fragment),n=E(),ve(o.$$.fragment)},m(e,i){ye(t,e,i),q(e,n,i),ye(o,e,i),r=!0},p(e,n){const r={};1&n&&(r.text=e[17].designation),t.$set(r);const i={};1&n&&(i.list=e[17]),1&n&&(i.eventId=e[0].id),1&n&&(i.schema=e[17].item),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),o.$set(i)},i(e){r||(me(t.$$.fragment,e),me(o.$$.fragment,e),r=!0)},o(e){fe(t.$$.fragment,e),fe(o.$$.fragment,e),r=!1},d(e){be(t,e),e&&S(n),be(o,e)}}}function Tn(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Vn(e){let t;return{c(){t=L("Speichern")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function An(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Bn(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:An,then:Ln,catch:Cn,value:16,blocks:[,,,]};return pe(e[7](),r),{c(){t=E(),n=j("section"),r.block.c(),Sn.title="Vorgaben",V(n,"class","sTask svelte-1phofh5")},m(e,i){q(e,t,i),q(e,n,i),r.block.m(n,r.anchor=null),r.mount=()=>n,r.anchor=null,o=!0},p(t,[n]){$e(r,e=t,n)},i(e){o||(me(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){fe(r.blocks[e])}o=!1},d(e){e&&S(t),e&&S(n),r.block.d(),r.token=null,r=null}}}const On=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Mn(e,n,r){let a,d,u;x(e,s,(e=>r(11,d=e))),x(e,o,(e=>r(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(i.getItem("Locale"));let{schema:h}=n,{record:g}=n,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const b=()=>window.history.back(),w=(e,t,n=!1)=>{const o=t.id,r=e.find((e=>e.name===o));let i=t.value;if(!n&&r&&r.properties?.multi&&(i=g[o]),i&&r&&r.type.startsWith("date"))try{return _n(i,"%d.%m.%Y").toISOString()}catch{return new Date(i).toISOString()}if(r&&"boolean"===r.type&&(i=!!t.checked),r&&"number"===r.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{i=Number(i.replace(e,".")).toString()}catch{}}return i};return e.$$set=e=>{"schema"in e&&r(0,h=e.schema),"record"in e&&r(1,g=e.record)},e.$$.update=()=>{4&e.$$.dirty&&r(3,a=y)},[h,g,y,a,m,f,v,async()=>{const e=await t.getEvent(h.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&r(2,y=!0),d.role?.length&&h.authorization?.length){const e=h.authorization.some((e=>u?.find((t=>t===e.role&&"edit"===e.activity))));r(2,y||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},b,async e=>{const n={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[o,r]=t.split("."),i=h.list.find((e=>e.name===o));n[t]=w(i.item,e)}else n[t]=w(h.items,e)})),await t.saveTemplate(h.class,n),l.success("Die Vorgaben wurden gespeichert.",2e3),b()}]}const{document:Wn}=he;function Rn(e,t,n){const o=e.slice();return o[28]=t[n],o}function Pn(e){let t,n;return t=new vl({props:{classId:e[2],item:e[28],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4],required:e[5],currency:e[8]}}),t.$on("notify",e[14]),t.$on("defPrep",e[16]),t.$on("task",e[21]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.classId=e[2]),2&n[0]&&(o.item=e[28]),2&n[0]&&(o.listName=e[1].name),8&n[0]&&(o.eventId=e[3]),1&n[0]&&(o.record=e[0]),16&n[0]&&(o.disabled=e[4]),32&n[0]&&(o.required=e[5]),256&n[0]&&(o.currency=e[8]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Hn(e){let t,n,o=On(e[7],e[28]),r=o&&Pn(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),q(e,t,o),n=!0},p(e,n){130&n[0]&&(o=On(e[7],e[28])),o?r?(r.p(e,n),130&n[0]&&me(r,1)):(r=Pn(e),r.c(),me(r,1),r.m(t.parentNode,t)):r&&(de(),fe(r,1,1,(()=>{r=null})),ue())},i(e){n||(me(r),n=!0)},o(e){fe(r),n=!1},d(e){r&&r.d(e),e&&S(t)}}}function Qn(e){let t,n,o,r=e[1].item,i=[];for(let t=0;t<r.length;t+=1)i[t]=Hn(Rn(e,r,t));const l=e=>fe(i[e],1,1,(()=>{i[e]=null}));return{c(){t=j("div");for(let e=0;e<i.length;e+=1)i[e].c();V(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){q(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,s){if(82367&s[0]){let n;for(r=e[1].item,n=0;n<r.length;n+=1){const o=Rn(e,r,n);i[n]?(i[n].p(o,s),me(i[n],1)):(i[n]=Hn(o),i[n].c(),me(i[n],1),i[n].m(t,null))}for(de(),n=r.length;n<i.length;n+=1)l(n);ue()}(!o||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&V(t,"id",n)},i(e){if(!o){for(let e=0;e<r.length;e+=1)me(i[e]);o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)fe(i[e]);o=!1},d(e){e&&S(t),N(i,e)}}}function Yn(e){let t,n,o=e[13](e[9])+"";return{c(){t=j("span"),n=L(o)},m(e,o){q(e,t,o),_(t,n)},p(e,t){512&t[0]&&o!==(o=e[13](e[9])+"")&&A(n,o)},d(e){e&&S(t)}}}function Gn(e){let t,n,o;return n=new e[10]({props:{$$slots:{default:[Yn]},$$scope:{ctx:e}}}),n.$on("click",(function(){w(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=j("div"),ve(n.$$.fragment),V(t,"class","accordion svelte-148ktt9"),V(t,"slot","handle")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p(t,o){e=t;const r={};512&o[0]|1&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r)},i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function Jn(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[Gn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[Qn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};64&n[0]&&(o.open=e[6]),134218687&n[0]|1&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Un(e){let t,n,o;return n=new e[11]({props:{$$slots:{default:[Jn]},$$scope:{ctx:e}}}),{c(){t=j("div"),ve(n.$$.fragment),V(t,"class","formList")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p(e,t){const o={};1023&t[0]|1&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function Zn(e,n,o){const{Button:r,Accordion:i,AccordionSection:l}=c;let{list:s}=n,{schema:a}=n,{record:d}=n,{classId:u}=n,{eventId:m}=n,{disabled:h}=n,{required:g}=n,{open:v=!1}=n,{template:y={}}=n,{isTemplate:b=!1}=n,{currency:w}=n,{update:k=!1}=n,x=new Map;const I={};let _=d[s.name]||{};d[s.name]=_;const q=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),S=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&o(1,s=e.list),"schema"in e&&o(18,a=e.schema),"record"in e&&o(0,d=e.record),"classId"in e&&o(2,u=e.classId),"eventId"in e&&o(3,m=e.eventId),"disabled"in e&&o(4,h=e.disabled),"required"in e&&o(5,g=e.required),"open"in e&&o(6,v=e.open),"template"in e&&o(19,y=e.template),"isTemplate"in e&&o(7,b=e.isTemplate),"currency"in e&&o(8,w=e.currency),"update"in e&&o(20,k=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&k&&d&&o(9,_=d[s.name]||{})},[d,s,u,m,h,g,v,b,w,_,r,i,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format)).map((t=>"object"===t.type?q(t.name):"boolean"===t.type?$(e[t.name]):"date"===t.type?f(e[t.name]):"datetime"===t.type?p(e[t.name]):e[t.name])).filter((e=>!!e)).join(" • ")||"+",({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;e.desc&&(I[n]=e.desc);const r=d[t];o(0,d[t]={...r,[n]:e.value},d),o(9,_=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&o(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,r=document.querySelector(n);te().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(S)})).then((()=>r.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:n,value:o}})=>{if(x.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===className+"."+s.name))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&x.set(e,i[0])},()=>{setTimeout((()=>{Array.from(x).forEach((([e,t])=>{d[s.name][e]||o(0,d[s.name][e]=t._id,d)}))}),500)},a,y,k,function(t){Y(e,t)}]}class Kn extends ke{constructor(e){var t;super(),Wn.getElementById("svelte-148ktt9-style")||((t=j("style")).id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",_(Wn.head,t)),we(this,e,Zn,Un,k,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:Xn}=he;function eo(e){e[0]=e[23].list,e[22]=e[23].items}function to(e,t,n){const o=e.slice();return o[24]=t[n],o}function no(e,t,n){const o=e.slice();return o[27]=t[n],o}function oo(e,t,n){const o=e.slice();return o[27]=t[n],o}function ro(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function io(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}eo(e),n=new e[7]({props:{outline:!0,$$slots:{default:[lo]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),J.push((()=>ge(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let w=e[22]?.length&&function(e){let t,n,o=e[22],r=[];for(let t=0;t<o.length;t+=1)r[t]=so(oo(e,o,t));return{c(){t=j("thead"),n=j("tr");for(let e=0;e<r.length;e+=1)r[e].c();V(n,"class","svelte-14hcfjl"),V(t,"class","svelte-14hcfjl")},m(e,o){q(e,t,o),_(t,n);for(let e=0;e<r.length;e+=1)r[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(o=e[22],i=0;i<o.length;i+=1){const l=oo(e,o,i);r[i]?r[i].p(l,t):(r[i]=so(l),r[i].c(),r[i].m(n,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(e){e&&S(t),N(r,e)}}}(e),k=e[0]?.length&&function(e){let t,n=e[0],o=[];for(let t=0;t<n.length;t+=1)o[t]=uo(to(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,n){for(let t=0;t<o.length;t+=1)o[t].m(e,n);q(e,t,n)},p(e,r){if(11778&r[0]){let i;for(n=e[0],i=0;i<n.length;i+=1){const l=to(e,n,i);o[i]?o[i].p(l,r):(o[i]=uo(l),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){N(o,e),e&&S(t)}}}(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),r=j("div"),i=L("Suchen: "),ve(l.$$.fragment),a=E(),c=j("span"),ve(d.$$.fragment),u=E(),m=j("div"),f=j("table"),w&&w.c(),p=E(),$=j("tbody"),k&&k.c(),V(t,"class","form--buttons svelte-14hcfjl"),V(c,"class","feather pointer svelte-14hcfjl"),O(r,"margin-bottom","1em"),O(r,"position","relative"),V(f,"striped",""),V(f,"class","svelte-14hcfjl"),V(m,"class","eList svelte-14hcfjl")},m(s,y){q(s,t,y),ye(n,t,null),q(s,o,y),q(s,r,y),_(r,i),ye(l,r,null),_(r,a),_(r,c),ye(d,c,null),q(s,u,y),q(s,m,y),_(m,f),w&&w.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=D(c,"click",e[14]),g=!0)},p(e,t){eo(e);const o={};2&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],oe((()=>s=!1))),l.$set(r),e[22]?.length&&w.p(e,t),e[0]?.length&&k.p(e,t)},i(e){h||(me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),h=!0)},o(e){fe(n.$$.fragment,e),fe(l.$$.fragment,e),fe(d.$$.fragment,e),h=!1},d(e){e&&S(t),be(n),e&&S(o),e&&S(r),be(l),be(d),e&&S(u),e&&S(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function lo(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function so(e){let t,n,o=e[27]?.designation+"";return{c(){t=j("th"),n=L(o),V(t,"class","svelte-14hcfjl")},m(e,o){q(e,t,o),_(t,n)},p:g,d(e){e&&S(t)}}}function ao(e){let t,n,o=e[22],r=[];for(let t=0;t<o.length;t+=1)r[t]=co(no(e,o,t));return{c(){t=j("tr");for(let e=0;e<r.length;e+=1)r[e].c();n=E(),V(t,"class","pointer svelte-14hcfjl")},m(e,o){q(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);_(t,n)},p(e,i){if(3584&i[0]){let l;for(o=e[22],l=0;l<o.length;l+=1){const s=no(e,o,l);r[l]?r[l].p(s,i):(r[l]=co(s),r[l].c(),r[l].m(t,n))}for(;l<r.length;l+=1)r[l].d(1);r.length=o.length}},d(e){e&&S(t),N(r,e)}}}function co(e){let t,n,o,r,i=e[9](e[24],e[27])+"";return{c(){t=j("td"),n=L(i),V(t,"class","svelte-14hcfjl")},m(i,l){q(i,t,l),_(t,n),o||(r=D(t,"click",T(e[10](e[24]))),o=!0)},p(t,n){e=t},d(e){e&&S(t),o=!1,r()}}}function uo(e){let t,n=e[13](e[24],e[22],e[1]),o=n&&ao(e);return{c(){o&&o.c(),t=F()},m(e,n){o&&o.m(e,n),q(e,t,n)},p(e,r){2&r[0]&&(n=e[13](e[24],e[22],e[1])),n?o?o.p(e,r):(o=ao(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&S(t)}}}function mo(e){let t,n;return t=new e[5]({}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p:g,i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function fo(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:mo,then:io,catch:ro,value:23,blocks:[,,,]};return pe(e[11](),i),{c(){ve(t.$$.fragment),n=E(),o=F(),i.block.c()},m(e,l){ye(t,e,l),q(e,n,l),q(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){$e(i,e=t,n)},i(e){r||(me(t.$$.fragment,e),me(i.block),r=!0)},o(e){fe(t.$$.fragment,e);for(let e=0;e<3;e+=1){fe(i.blocks[e])}r=!1},d(e){be(t,e),e&&S(n),e&&S(o),i.block.d(e),i.token=null,i=null}}}function po(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[fo]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};2&n[0]|2&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function $o(e,n,o){const r=Q(),{Dialog:i,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=n,{className:m}=n,{classId:p}=n,{list:h}=n,g="",v=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(m);H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(v)?.focus()}),200)}));return e.$$set=e=>{"item"in e&&o(15,u=e.item),"className"in e&&o(16,m=e.className),"classId"in e&&o(17,p=e.classId),"list"in e&&o(0,h=e.list)},[h,g,r,i,l,s,a,d,v,y,e=>()=>r("choose",{row:e}),async()=>{const e=await b;let t=[],n=e.display;return n&&n.length?n.map((n=>{const[r,i]=n.split(".");let l=e.list?.find((e=>e.name===r))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${r}_${i}`,o(0,h=h.map((e=>(e[r]&&(e[l.name]=e["_"+r]?e["_"+r][i]:e[r][i]),e))))),l||(l=e.items.find((e=>e.name===r))),t.find((e=>e?.name===r))||t.push(l)})):t=e.items,{list:h,items:t}},({detail:{value:e}})=>{o(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(y(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,g="")},u,m,p,()=>r("back"),function(e){g=e,o(1,g)}]}class ho extends ke{constructor(e){var t;super(),Xn.getElementById("svelte-14hcfjl-style")||((t=j("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Xn.head,t)),we(this,e,$o,po,k,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:go}=he;function vo(e,t,n){const o=e.slice();return o[11]=t[n],o}function yo(e,t,n){const o=e.slice();return o[2]=t[n],o}function bo(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function wo(e){let t,n,o,r=e[6].items,i=[];for(let t=0;t<r.length;t+=1)i[t]=qo(yo(e,r,t));const l=e=>fe(i[e],1,1,(()=>{i[e]=null}));let s=e[6].list&&So(e);return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=E(),s&&s.c(),n=F()},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);q(e,t,r),s&&s.m(e,r),q(e,n,r),o=!0},p(e,o){if(5161971&o[0]){let n;for(r=e[6].items,n=0;n<r.length;n+=1){const l=yo(e,r,n);i[n]?(i[n].p(l,o),me(i[n],1)):(i[n]=qo(l),i[n].c(),me(i[n],1),i[n].m(t.parentNode,t))}for(de(),n=r.length;n<i.length;n+=1)l(n);ue()}e[6].list?s?(s.p(e,o),64&o[0]&&me(s,1)):(s=So(e),s.c(),me(s,1),s.m(n.parentNode,n)):s&&(de(),fe(s,1,1,(()=>{s=null})),ue())},i(e){if(!o){for(let e=0;e<r.length;e+=1)me(i[e]);me(s),o=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)fe(i[e]);fe(s),o=!1},d(e){N(i,e),e&&S(t),s&&s.d(e),e&&S(n)}}}function ko(e){let t,n,o,r;const i=[Io,xo],l=[];function s(e,t){return e[2].name!==e[14]||e[15]?"lookup"!==e[2].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=i[t](e)),{c(){n&&n.c(),o=F()},m(e,n){~t&&l[t].m(e,n),q(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(de(),fe(l[a],1,1,(()=>{l[a]=null})),ue()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),me(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(me(n),r=!0)},o(e){fe(n),r=!1},d(e){~t&&l[t].d(e),e&&S(o)}}}function xo(e){let t,n;return t=new vl({props:{classId:e[7],item:e[2],record:e[5],disabled:e[2].name===e[14]&&e[15]||e[0],eventId:e[4],currency:e[8],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),64&n[0]&&(o.item=e[2]),32&n[0]&&(o.record=e[5]),65&n[0]&&(o.disabled=e[2].name===e[14]&&e[15]||e[0]),16&n[0]&&(o.eventId=e[4]),256&n[0]&&(o.currency=e[8]),512&n[0]&&(o.changeValue=e[9]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Io(e){let t,n,o,r;n=new vl({props:{classId:e[7],item:e[2],record:e[5],disabled:e[0]||!!e[1],required:!0,eventId:e[4],currency:e[8],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]);let i=e[1]&&_o(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),i&&i.c(),O(t,"padding-top",".25em"),O(t,"background-color","lightyellow"),O(t,"position","relative")},m(e,l){q(e,t,l),ye(n,t,null),_(t,o),i&&i.m(t,null),r=!0},p(e,o){const r={};128&o[0]&&(r.classId=e[7]),64&o[0]&&(r.item=e[2]),32&o[0]&&(r.record=e[5]),3&o[0]&&(r.disabled=e[0]||!!e[1]),16&o[0]&&(r.eventId=e[4]),256&o[0]&&(r.currency=e[8]),512&o[0]&&(r.changeValue=e[9]),n.$set(r),e[1]?i?(i.p(e,o),2&o[0]&&me(i,1)):(i=_o(e),i.c(),me(i,1),i.m(t,null)):i&&(de(),fe(i,1,1,(()=>{i=null})),ue())},i(e){r||(me(n.$$.fragment,e),me(i),r=!0)},o(e){fe(n.$$.fragment,e),fe(i),r=!1},d(e){e&&S(t),be(n),i&&i.d()}}}function _o(e){let t,n,o,r,i;return n=new Ve({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[22]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function qo(e){let t,n,o="list"!==e[2].type&&ko(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){"list"!==e[2].type?o?(o.p(e,n),64&n[0]&&me(o,1)):(o=ko(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function So(e){let t,n,o=e[6].list,r=[];for(let t=0;t<o.length;t+=1)r[t]=jo(vo(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(497&n[0]){let l;for(o=e[6].list,l=0;l<o.length;l+=1){const i=vo(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=jo(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}function No(e){let t,n,o,r;return t=new e[12]({props:{text:e[11].designation}}),o=new Kn({props:{classId:e[7],list:e[11],eventId:e[4],schema:e[11].item,record:e[5],disabled:e[0],currency:e[8],update:!0}}),{c(){ve(t.$$.fragment),n=E(),ve(o.$$.fragment)},m(e,i){ye(t,e,i),q(e,n,i),ye(o,e,i),r=!0},p(e,n){const r={};64&n[0]&&(r.text=e[11].designation),t.$set(r);const i={};128&n[0]&&(i.classId=e[7]),64&n[0]&&(i.list=e[11]),16&n[0]&&(i.eventId=e[4]),64&n[0]&&(i.schema=e[11].item),32&n[0]&&(i.record=e[5]),1&n[0]&&(i.disabled=e[0]),256&n[0]&&(i.currency=e[8]),o.$set(i)},i(e){r||(me(t.$$.fragment,e),me(o.$$.fragment,e),r=!0)},o(e){fe(t.$$.fragment,e),fe(o.$$.fragment,e),r=!1},d(e){be(t,e),e&&S(n),be(o,e)}}}function jo(e){let t,n,o="array"!==e[11].type&&No(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){"array"!==e[11].type?o?(o.p(e,n),64&n[0]&&me(o,1)):(o=No(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function Co(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Lo(e){let t,n;return t=new ho({props:{item:e[2],className:e[3],classId:e[7],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.item=e[2]),8&n[0]&&(o.className=e[3]),128&n[0]&&(o.classId=e[7]),2048&n[0]&&(o.list=e[11]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Eo(e){let t,n,o=e[10]&&Lo(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){e[10]?o?(o.p(e,n),1024&n[0]&&me(o,1)):(o=Lo(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function Fo(e){let t,n,o,r,i,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Co,then:wo,catch:bo,value:52,blocks:[,,,]};function a(t){e[28](t)}pe(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Eo]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),r=new e[13]({props:c}),J.push((()=>ge(r,"open",a))),{c(){s.block.c(),t=E(),ve(n.$$.fragment),o=E(),ve(r.$$.fragment)},m(e,i){s.block.m(e,s.anchor=i),s.mount=()=>t.parentNode,s.anchor=t,q(e,t,i),ye(n,e,i),q(e,o,i),ye(r,e,i),l=!0},p(t,n){$e(s,e=t,n);const o={};3212&n[0]|67108864&n[1]&&(o.$$scope={dirty:n,ctx:e}),!i&&1024&n[0]&&(i=!0,o.open=e[10],oe((()=>i=!1))),r.$set(o)},i(e){l||(me(s.block),me(n.$$.fragment,e),me(r.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){fe(s.blocks[e])}fe(n.$$.fragment,e),fe(r.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&S(t),be(n,e),e&&S(o),be(r,e)}}}function Do(e,n,o){const{Divider:r,FormField:i,Modal:l}=c,s=Q();let a,d,u,m,f,{required:p}=n,{disabled:$}=n,{readonly:h}=n,{id:g}=n,{item:v}=n,{value:y}=n,{refValue:b}=n,w={},k="CHF",x=[],I=[],_={},q=new Map,S=!1,N="";const j=v.checkOn,C=y,L=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[o,r]=n.split(".");x.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))},E=()=>{a.items.filter((e=>e.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.lookup})})),a.items.filter((e=>e.properties?.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}))},F=async e=>{const t=x.filter((t=>t.refObj===e));if(t?.length){o(9,_={});for(const e of t){const{itemName:t,refObj:n,refName:r,op:i}=e;let{action:l}=e;if(!n)break;let s,a,c=!r&&w[n];const u=w[n];u&&r&&(c=(await getTaskFull(n,u))[r]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===i&&(c=!c),"required"!==l&&"readonly"!==l||(l="required"===l?l:"disabled",setTimeout((()=>{s=`#${d} .form-field.${t} .field textarea`,a=document.querySelector(s),a||(s=`#${d} .form-field.${t} .field input`,a=document.querySelector(s)),a&&c&&a.setAttribute(l,""),a&&!c&&a.removeAttribute(l)}),0)),"hidden"===l&&(s=`#${d} .form-field.${t}`,a=document.querySelector(s),a?.classList?.toggle("hidden",!!c),c&&o(9,_[t]="",_))}}};H((()=>{D()}));const D=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(d))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of x)e.add(t.refObj||u);Array.from(e).forEach((e=>F(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(q).forEach((([e,t])=>{w[e]||o(5,w[e]=t._id,w)}))}),250)},T=async e=>{if(!e.value)return void A();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},r=await t.getSectionView(u,n);r?.length?(o(11,N=r),o(10,S=!0)):(o(1,y=""),o(23,b=""),s("setRefValue",b))},V=()=>{o(10,S=!1)},A=()=>{o(1,y=""),o(23,b=y),o(5,w={}),s("setRefValue",b)};return e.$$set=e=>{"required"in e&&o(24,p=e.required),"disabled"in e&&o(0,$=e.disabled),"readonly"in e&&o(25,h=e.readonly),"id"in e&&o(26,g=e.id),"item"in e&&o(2,v=e.item),"value"in e&&o(1,y=e.value),"refValue"in e&&o(23,b=e.refValue)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&o(0,$=$||h),134217784&e.$$.dirty[0]&&w&&s("safeReference",{record:w,class:u,event:m,taskId:f})},[$,y,v,u,m,w,a,d,k,_,S,N,r,l,j,C,async()=>{try{if(y){const e=await t.getTask(v.refClass,y);delete e._task,o(5,w=e),o(27,f=(await t.getTaskByDocId(e._id))._id)}else o(5,w={})}catch{}const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&o(8,k=n[0].designation)}return o(6,a=await t.getSchemaByClass(v.refClass)),o(7,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),o(3,u=a.class),a.identity.designation,o(4,m=a.id),["readonly","hidden","required"].map(L),E(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(o(5,w[t]=n,w),t===j)return T(e);F(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:n,lookup:r,view:i}=e,[l]=r.split(":"),s=(await t.getSectionView(l,{[i]:{$in:n}})).map((e=>e._id));for(const e of a.input.slice(1)){o(5,w[e]=[],w);const n=await t.getSchemaByClass(e);n.id;let r=await t.getTasks(n.id);if(r=r.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),r?.length){const n=r.map((e=>e._id)),i=await t.getSectionView(e,{_id:{$in:n}});for(const t of i)t[e]=t._id;o(5,w[e]=i,w)}}},async({detail:{className:e,itemName:n,value:o}})=>{if(q.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===u))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&q.set(e,i[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(o(1,y=n[0]._id),o(23,b=y),s("setRefValue",b),o(5,w=n[0])),V()},V,A,b,p,h,g,f,function(e){S=e,o(10,S)}]}class zo extends ke{constructor(e){var t;super(),go.getElementById("svelte-16mo2c-style")||((t=j("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",_(go.head,t)),we(this,e,Do,Fo,k,{required:24,disabled:0,readonly:25,id:26,item:2,value:1,refValue:23},[-1,-1])}}function To(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=j("span"),n=L(e[4]),V(t,"class","item")},m(e,o){q(e,t,o),_(t,n)},p(e,t){16&t&&A(n,e[4])},d(e){e&&S(t)}}}(e);return{c(){n&&n.c(),t=F()},m(e,o){n&&n.m(e,o),q(e,t,o)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&S(t)}}}function Vo(e){let t,n,o;return n=new e[9]({props:{withItem:!0,itemLeft:!0,lang:e[10].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[8],step:e[12],pattern:e[6],placeholder:e[13],readonly:e[7],disabled:e[3],required:e[5],$$slots:{default:[To]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=j("div"),ve(n.$$.fragment),O(t,"position","relative"),O(t,"max-width","10em")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p(e,[t]){const o={};6&t&&(o.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),256&t&&(o.value=e[8]),64&t&&(o.pattern=e[6]),128&t&&(o.readonly=e[7]),8&t&&(o.disabled=e[3]),32&t&&(o.required=e[5]),536870928&t&&(o.$$scope={dirty:t,ctx:e}),n.$set(o)},i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function Ao(e,t,n){let o;const r=Q(),{TextField:l}=c;let{id:s}=t,{item:a}=t,{value:d}=t,{noForm:u=!1}=t,{classId:m}=t,{disabled:f}=t,{formnovalidate:p}=t,{currency:$}=t;const h=JSON.parse(i.getItem("Locale")),g=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),v=Number("1.1").toLocaleString(h.id).substring(1,2),{properties:y={}}=a;let{min:b,max:w,step:k,pattern:x,decimals:I=0,unit:_="",placeholder:q,hint:S,readonly:N,negative:j,required:C=!1}=y;N=!0===N||void 0,x||(x=I?`[0-9]+([${v}][0-9]{1,${I}})?`:"[0-9]*"),j&&(x="-?"+x);return e.$$set=e=>{"id"in e&&n(0,s=e.id),"item"in e&&n(16,a=e.item),"value"in e&&n(17,d=e.value),"noForm"in e&&n(1,u=e.noForm),"classId"in e&&n(2,m=e.classId),"disabled"in e&&n(3,f=e.disabled),"formnovalidate"in e&&n(18,p=e.formnovalidate),"currency"in e&&n(4,$=e.currency)},e.$$.update=()=>{262176&e.$$.dirty&&n(5,C=C&&!p),131072&e.$$.dirty&&n(8,o=Number(d.toString().replace(v,".")).toFixed(I).toString().replace(".",v))},[s,u,m,f,$,C,x,N,o,l,h,g,k,q,({detail:e})=>r("blur",{value:e.value}),({detail:e})=>{N||Number(d.toString().replace(v,"."))||n(8,o="")},a,d,p]}class Bo extends ke{constructor(e){super(),we(this,e,Ao,Vo,k,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4})}}const{document:Oo}=he;function Mo(e){e[33]=e[35].list,e[34]=e[35].items}function Wo(e,t,n){const o=e.slice();return o[36]=t[n],o[38]=n,o}function Ro(e,t,n){const o=e.slice();return o[39]=t[n],o[41]=n,o}function Po(e,t,n){const o=e.slice();return o[39]=t[n],o}function Ho(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Qo(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v,y;Mo(e),n=new e[8]({props:{outline:!0,$$slots:{default:[Yo]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let b=!e[1]&&Go(e);function w(t){e[31](t)}let k={id:e[11]};void 0!==e[2]&&(k.value=e[2]),s=new e[6]({props:k}),J.push((()=>ge(s,"value",w))),s.$on("input",e[14]),u=new Ve({props:{size:"18"}});let x=e[34]?.length&&function(e){let t,n,o,r,i=!e[1]&&Uo(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=Zo(Po(e,l,t));return{c(){t=j("thead"),n=j("tr"),i&&i.c(),o=E();for(let e=0;e<s.length;e+=1)s[e].c();V(n,"class","svelte-1m010ne"),V(t,"class","svelte-1m010ne")},m(e,l){q(e,t,l),_(t,n),i&&i.m(n,null),_(n,o);for(let e=0;e<s.length;e+=1)s[e].m(n,null);r=!0},p(e,t){if(e[1]?i&&(de(),fe(i,1,1,(()=>{i=null})),ue()):i?(i.p(e,t),2&t[0]&&me(i,1)):(i=Uo(e),i.c(),me(i,1),i.m(n,o)),8192&t[0]){let o;for(l=e[34],o=0;o<l.length;o+=1){const r=Po(e,l,o);s[o]?s[o].p(r,t):(s[o]=Zo(r),s[o].c(),s[o].m(n,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=l.length}},i(e){r||(me(i),r=!0)},o(e){fe(i),r=!1},d(e){e&&S(t),i&&i.d(),N(s,e)}}}(e),I=e[33]?.length&&function(e){let t,n,o=e[33],r=[];for(let t=0;t<o.length;t+=1)r[t]=nr(Wo(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(569359&n[0]){let l;for(o=e[33],l=0;l<o.length;l+=1){const i=Wo(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=nr(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),b&&b.c(),r=E(),i=j("div"),l=L("Suchen: "),ve(s.$$.fragment),c=E(),d=j("span"),ve(u.$$.fragment),m=E(),f=j("div"),p=j("table"),x&&x.c(),$=E(),h=j("tbody"),I&&I.c(),V(t,"class","form--buttons svelte-1m010ne"),V(d,"class","feather pointer svelte-1m010ne"),O(i,"margin-bottom","1em"),O(i,"position","relative"),V(p,"striped",""),V(p,"class","svelte-1m010ne"),V(f,"class","eList svelte-1m010ne")},m(a,w){q(a,t,w),ye(n,t,null),_(t,o),b&&b.m(t,null),q(a,r,w),q(a,i,w),_(i,l),ye(s,i,null),_(i,c),_(i,d),ye(u,d,null),q(a,m,w),q(a,f,w),_(f,p),x&&x.m(p,null),_(p,$),_(p,h),I&&I.m(h,null),g=!0,v||(y=D(d,"click",e[16]),v=!0)},p(e,o){Mo(e);const r={};8192&o[1]&&(r.$$scope={dirty:o,ctx:e}),n.$set(r),e[1]?b&&(de(),fe(b,1,1,(()=>{b=null})),ue()):b?(b.p(e,o),2&o[0]&&me(b,1)):(b=Go(e),b.c(),me(b,1),b.m(t,null));const i={};!a&&4&o[0]&&(a=!0,i.value=e[2],oe((()=>a=!1))),s.$set(i),e[34]?.length&&x.p(e,o),e[33]?.length&&I.p(e,o)},i(e){g||(me(n.$$.fragment,e),me(b),me(s.$$.fragment,e),me(u.$$.fragment,e),me(x),me(I),g=!0)},o(e){fe(n.$$.fragment,e),fe(b),fe(s.$$.fragment,e),fe(u.$$.fragment,e),fe(x),fe(I),g=!1},d(e){e&&S(t),be(n),b&&b.d(),e&&S(r),e&&S(i),be(s),be(u),e&&S(m),e&&S(f),x&&x.d(),I&&I.d(),v=!1,y()}}}function Yo(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Go(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[Jo]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};8192&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Jo(e){let t;return{c(){t=L("Bestätigen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Uo(e){let t,n,o,r,i;return n=new Ne({props:{size:"20"}}),{c(){t=j("th"),ve(n.$$.fragment),V(t,"class","svelte-1m010ne")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[18](e[33])),r=!0)},p(t,n){e=t},i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function Zo(e){let t,n,o=e[39]+"";return{c(){t=j("th"),n=L(o),V(t,"class","svelte-1m010ne")},m(e,o){q(e,t,o),_(t,n)},p:g,d(e){e&&S(t)}}}function Ko(e){let t,n,o,r,i,l,s,a=e[0],c=er(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=tr(Ro(e,d,t));return{c(){t=j("tr"),c.c(),n=E();for(let e=0;e<u.length;e+=1)u[e].c();o=E(),V(t,"style",r=e[1]?"cursor: default;":"cursor: zoom-in;"),V(t,"title","übernimmt den Wert direkt"),V(t,"class","svelte-1m010ne"),M(t,"active",e[0].includes(e[36]))},m(r,a){q(r,t,a),c.m(t,null),_(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);_(t,o),i=!0,l||(s=D(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&k(a,a=e[0])?(de(),fe(c,1,1,g),ue(),c=er(e),c.c(),me(c),c.m(t,n)):c.p(e,s),8200&s[0]){let n;for(d=e[34],n=0;n<d.length;n+=1){const r=Ro(e,d,n);u[n]?u[n].p(r,s):(u[n]=tr(r),u[n].c(),u[n].m(t,o))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!i||2&s[0]&&r!==(r=e[1]?"cursor: default;":"cursor: zoom-in;"))&&V(t,"style",r),8193&s[0]&&M(t,"active",e[0].includes(e[36]))},i(e){i||(me(c),i=!0)},o(e){fe(c),i=!1},d(e){e&&S(t),c.d(e),N(u,e),l=!1,s()}}}function Xo(e){let t,n,o;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=j("td"),ve(n.$$.fragment),V(t,"title","Wählt den Wert aus"),V(t,"class","svelte-1m010ne")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p(e,t){const o={};1&t[0]&&(o.checked=e[0].includes(e[36])),n.$set(o)},i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function er(e){let t,n,o=!e[1]&&Xo(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){e[1]?o&&(de(),fe(o,1,1,(()=>{o=null})),ue()):o?(o.p(e,n),2&n[0]&&me(o,1)):(o=Xo(e),o.c(),me(o,1),o.m(t.parentNode,t))},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function tr(e){let t,n,o=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=j("td"),n=L(o),V(t,"class","svelte-1m010ne")},m(e,o){q(e,t,o),_(t,n)},p(e,t){8&t[0]&&o!==(o=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&A(n,o)},d(e){e&&S(t)}}}function nr(e){let t,n,o=e[15](e[36],e[2]),r=o&&Ko(e);return{c(){r&&r.c(),t=F()},m(e,o){r&&r.m(e,o),q(e,t,o),n=!0},p(e,n){4&n[0]&&(o=e[15](e[36],e[2])),o?r?(r.p(e,n),4&n[0]&&me(r,1)):(r=Ko(e),r.c(),me(r,1),r.m(t.parentNode,t)):r&&(de(),fe(r,1,1,(()=>{r=null})),ue())},i(e){n||(me(r),n=!0)},o(e){fe(r),n=!1},d(e){r&&r.d(e),e&&S(t)}}}function or(e){let t,n;return t=new e[5]({}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p:g,i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function rr(e){let t,n,o,r;t=new e[9]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:or,then:Qo,catch:Ho,value:35,blocks:[,,,]};return pe(e[13](),i),{c(){ve(t.$$.fragment),n=E(),o=F(),i.block.c()},m(e,l){ye(t,e,l),q(e,n,l),q(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){$e(i,e=t,n)},i(e){r||(me(t.$$.fragment,e),me(i.block),r=!0)},o(e){fe(t.$$.fragment,e);for(let e=0;e<3;e+=1){fe(i.blocks[e])}r=!1},d(e){be(t,e),e&&S(n),e&&S(o),i.block.d(e),i.token=null,i=null}}}function ir(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[rr]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};15&n[0]|8192&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function lr(e,n,o){const r=Q(),{Loading:i,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=n,{id:f}=n,{selection:p}=n,{refDoc:$}=n,{tableName:h}=n,{idName:g}=n,{target:v}=n,{view:y}=n,{unique:b}=n,{uniqueView:w}=n,{status:k}=n,{single:x}=n;p||=[];let I="",_=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",q=[];const S=h+g+v+"checkbox",N=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&o(21,m=e.classId),"id"in e&&o(22,f=e.id),"selection"in e&&o(0,p=e.selection),"refDoc"in e&&o(23,$=e.refDoc),"tableName"in e&&o(24,h=e.tableName),"idName"in e&&o(25,g=e.idName),"target"in e&&o(20,v=e.target),"view"in e&&o(26,y=e.view),"unique"in e&&o(27,b=e.unique),"uniqueView"in e&&o(28,w=e.uniqueView),"status"in e&&o(29,k=e.status),"single"in e&&o(1,x=e.single)},[p,x,I,q,r,i,l,s,a,d,u,_,S,async()=>{let e=[],n=[],r={};if(o(3,q=[]),g)if(y){const n=m.split("-")[1].slice(0,-4),o="input."+m+"[name='_id']",i=document.querySelector(o).value;r={[g]:f},k&&(r.$or=[{status:!0},{[n]:i}]),e=await t.getSectionView(h,r),e=e.sort(((e,t)=>{const o=e=>(e[n]||"z").toString()+e[v];return N(o(e),o(t))}))}else w?(r={[g]:f,status:!0},Object.entries(w).map((([e,t])=>{t?.length&&(r[e]={$in:t}),n.push(e)})),e=await t.getSectionView(h,r),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))})),o(3,q=e.map((e=>{const t=[e[v]];return n.map((n=>t.push(e[n]))),t})))):b?(e=await t.getSection(h,g,f,b),e=e.sort(((e,t)=>N(e,t)))):(e=await t.getSection(h,g,f),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return N(n(e),n(t))})));else r={},Array.isArray(f)||(r._id=f),e=await t.getSectionView(h,r);const i=await t.getSchemaByClass(h),l=[];if($){const t=i.items[0].name,n=i.items[1].name,r=i.list[0].name,l=e.find((e=>e[t]===$));e=l[r],o(20,v=n)}e.map((e=>{let t=e[v];if(t||h!==v||(o(20,v=i.items[0].name),t=e[v]),Array.isArray(t))for(const e of t){let t=e;"string"!=typeof e&&(t=Array.from(Object.values(e)).filter((e=>!!e&&24!==e?.length)).join(", ")),l.push(t||[])}else l.push(t||[])}));const s=i.items.find((e=>e.name===v))?.designation;return n=n.map((e=>i.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...n]}},({detail:{value:e}})=>{o(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{o(2,I="")},e=>()=>{const t=document.getElementsByName(S),n=[];t.forEach(((t,o)=>{t.checked&&n.push(e[+t.attributes.data.value])})),r("choose",{list:n})},e=>()=>{document.getElementsByName(S).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(x?r("choose",{list:[].concat(e)}):(o(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),r("choose",{list:p})))},v,m,f,$,h,g,y,b,w,k,()=>r("back"),function(e){I=e,o(2,I)}]}class sr extends ke{constructor(e){var t;super(),Oo.getElementById("svelte-1m010ne-style")||((t=j("style")).id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",_(Oo.head,t)),we(this,e,lr,ir,k,{classId:21,id:22,selection:0,refDoc:23,tableName:24,idName:25,target:20,view:26,unique:27,uniqueView:28,status:29,single:1},[-1,-1])}}const{document:ar}=he;function cr(e){let t,n,o,r,i,l=e[7].length+"";return{c(){t=j("span"),n=L("("),o=L(l),r=L(")"),V(t,"class",i=I(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,i){q(e,t,i),_(t,n),_(t,o),_(t,r)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&A(o,l),2&n[0]&&i!==(i=I(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&V(t,"class",i)},d(e){e&&S(t)}}}function dr(e){let t;return{c(){t=j("div"),V(t,"class","load-more-options"),V(t,"slot","load-more-options-message slot")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function ur(e){let t,n,o,r;const i=[pr,fr,mr],l=[];function s(e,t){return!e[16].single&&e[7].length?0:e[17]?1:e[14]&&e[16].view&&e[16].maxItem?2:-1}return~(t=s(e))&&(n=l[t]=i[t](e)),{c(){n&&n.c(),o=F()},m(e,n){~t&&l[t].m(e,n),q(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?~t&&l[t].p(e,r):(n&&(de(),fe(l[a],1,1,(()=>{l[a]=null})),ue()),~t?(n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),me(n,1),n.m(o.parentNode,o)):n=null)},i(e){r||(me(n),r=!0)},o(e){fe(n),r=!1},d(e){~t&&l[t].d(e),e&&S(o)}}}function mr(e){let t,n,o,r,i;return n=new _e({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"title","Übernehmen"),V(t,"class","feather pointer svelte-1rbaejz")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[26]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function fr(e){let t,n,o,r,i;return n=new Le({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"title",e[17].title||"Generieren"),V(t,"class","feather pointer svelte-1rbaejz")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[25]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function pr(e){let t,n,o,r,i;return n=new Ve({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"title","Löschen"),V(t,"class","feather pointer svelte-1rbaejz")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[27]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function $r(e){let t,n,o;function r(t){e[37](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[hr]},$$scope:{ctx:e}};return void 0!==e[10]&&(i.open=e[10]),t=new e[11]({props:i}),J.push((()=>ge(t,"open",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};53&o[0]|32768&o[1]&&(r.$$scope={dirty:o,ctx:e}),!n&&1024&o[0]&&(n=!0,r.open=e[10],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function hr(e){let t,n;return t=new sr({props:{classId:e[2],selection:e[0],refDoc:e[19],view:e[15],status:e[18],unique:e[16].unique&&e[4].name,uniqueView:e[16].view&&{[e[16].view]:e[5][e[16].view]},id:e[5][e[21]||e[20]],tableName:e[20],idName:e[21],target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};4&n[0]&&(o.classId=e[2]),1&n[0]&&(o.selection=e[0]),16&n[0]&&(o.unique=e[16].unique&&e[4].name),32&n[0]&&(o.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(o.id=e[5][e[21]||e[20]]),16&n[0]&&(o.target=e[4].name),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function gr(e){let t,n,o,r,i,l,s,a,c,d=!e[16].single&&e[7].length&&cr(e);function u(t){e[35](t)}function m(t){e[36](t)}let f={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:vr,minSearchLength:"3",$$slots:{"load-more-options-message slot":[dr]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),o=new e[12]({props:f}),J.push((()=>ge(o,"selection",u))),J.push((()=>ge(o,"maxOptions",m))),o.$on("change",e[22]);let p=!e[1]&&ur(e),$=e[10]&&$r(e);return{c(){t=j("div"),d&&d.c(),n=E(),ve(o.$$.fragment),l=E(),p&&p.c(),s=E(),$&&$.c(),a=F(),O(t,"position","relative")},m(e,r){q(e,t,r),d&&d.m(t,null),_(t,n),ye(o,t,null),_(t,l),p&&p.m(t,null),q(e,s,r),$&&$.m(e,r),q(e,a,r),c=!0},p(e,l){!e[16].single&&e[7].length?d?d.p(e,l):(d=cr(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const s={};8&l[0]&&(s.id=e[3]),8&l[0]&&(s.name=e[3]),8&l[0]&&(s.class=e[3]),2&l[0]&&(s.disabled=e[1]),64&l[0]&&(s.required=e[6]),256&l[0]&&(s.placeholder=e[8]),32768&l[1]&&(s.$$scope={dirty:l,ctx:e}),!r&&128&l[0]&&(r=!0,s.selection=e[7],oe((()=>r=!1))),!i&&512&l[0]&&(i=!0,s.maxOptions=e[9],oe((()=>i=!1))),o.$set(s),e[1]?p&&(de(),fe(p,1,1,(()=>{p=null})),ue()):p?(p.p(e,l),2&l[0]&&me(p,1)):(p=ur(e),p.c(),me(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&me($,1)):($=$r(e),$.c(),me($,1),$.m(a.parentNode,a)):$&&(de(),fe($,1,1,(()=>{$=null})),ue())},i(e){c||(me(o.$$.fragment,e),me(p),me($),c=!0)},o(e){fe(o.$$.fragment,e),fe(p),fe($),c=!1},d(e){e&&S(t),d&&d.d(),be(o),p&&p.d(),e&&S(s),$&&$.d(e),e&&S(a)}}}async function*vr(e){yield[{name:e}]}function yr(e,n,o){const r=Q(),{Modal:i,Autocomplete:l}=c;let{classId:s}=n,{id:a}=n,{item:d}=n,{record:u}=n,{value:m}=n,{noForm:f=!1}=n,{disabled:p}=n,{formnovalidate:$}=n,{numberInput:h}=n,{praefix:g}=n,{toDelete:v}=n,{reqQuantity:y}=n,{notifyList:b}=n;const{properties:w={}}=d;let{placeholder:k,hint:x,readonly:I,required:_=!1,lookup:q="",view:S=!1,multi:N,max:j=1e3,generate:C=!1,status:L=!0,refDoc:E}=w;const[F,D]=q.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(k="");H((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&q&&e.addEventListener("focus",V)}));const V=()=>{if(q){document.getElementById(a).blur();const e=y||j;(N.unique||T.length<e)&&o(10,z=!0)}},A=()=>{o(10,z&&=!1)},B=({detail:e})=>{o(7,T=e.list.map((e=>({name:e})))),r("blur",{value:e.list}),r("multi",{view:N.view,lookup:q,name:d.name,value:e.list}),A()},O=async()=>{const e={[D]:u[D]},n=await t.getSectionView(F,e),o=Array.from({length:n.length},((e,t)=>n[t][d.name]));B({detail:{list:o}})},M=(e=!1)=>{if(p||!N.required)return;const t=N.maxItem;if(!t||N.unique)return;o(9,j=!1!==e?e:y||u[t]||0);const n=T.length!=j,i=document.getElementById(a);i?.classList?.toggle("invalid",n),r("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&o(2,s=e.classId),"id"in e&&o(3,a=e.id),"item"in e&&o(4,d=e.item),"record"in e&&o(5,u=e.record),"value"in e&&o(0,m=e.value),"noForm"in e&&o(28,f=e.noForm),"disabled"in e&&o(1,p=e.disabled),"formnovalidate"in e&&o(29,$=e.formnovalidate),"numberInput"in e&&o(30,h=e.numberInput),"praefix"in e&&o(31,g=e.praefix),"toDelete"in e&&o(32,v=e.toDelete),"reqQuantity"in e&&o(33,y=e.reqQuantity),"notifyList"in e&&o(34,b=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&o(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&o(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&o(7,T=[]),128&e.$$.dirty[0]&&T&&(o(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:o}=e;void 0!==g&&g!==o||t&&t.name===N.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&o(6,_=_&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:n,value:i}=e||{};if(!i)return;if(d.refItem?.split(".")[0]!==n)return;const[l,s]=d.refItem.split("."),a=await t.getTask(l,i);if(!a||!a[s])return;const c=a[s];if(!Array.isArray(c)&&!c.length)return;const u=c[g][d.name];r("record",{itemName:"quantity",value:u?.length||0}),o(7,T=u&&u.map((e=>({name:e})))),setTimeout(M,250)})(b)},[m,p,s,a,d,u,_,T,k,j,z,i,l,I,q,S,N,C,L,E,F,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),o(7,T=t.map((e=>({name:e.trim()})))),r("blur",{value:T.map((e=>e.name))}),r("multi",{view:N.view,lookup:q,value:T.map((e=>e.name))})},A,B,()=>{const e=u[C.itemQuantity]||y;if(!e)return;const t=C.prefix||"",n=u[C.variable]||"",o=C.len||5,r=Array.from({length:e},((e,r)=>t+n+"-"+r.toString().padStart(o,"0")));B({detail:{list:r}})},async()=>{if(!0===S)return O();const e=y||u[N.maxItem];if(!e)return;const n={[D]:u[D],status:!0},o=[].concat(u[N.view]||[]);o.length&&(n[N.view]={$in:o});const r=await t.getSectionView(F,n),i=Array.from({length:e<r.length?e:r.length},((e,t)=>r[t][d.name]));B({detail:{list:i}})},()=>{B({detail:{list:[]}})},f,$,h,g,v,y,b,function(e){T=e,o(7,T),o(5,u),o(4,d),o(32,v)},function(e){j=e,o(9,j)},function(e){z=e,o(10,z)}]}class br extends ke{constructor(e){var t;super(),ar.getElementById("svelte-1rbaejz-style")||((t=j("style")).id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",_(ar.head,t)),we(this,e,yr,gr,k,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}const{document:wr}=he;function kr(e){e[26]=e[28].list,e[27]=e[28].items}function xr(e,t,n){const o=e.slice();return o[29]=t[n],o}function Ir(e,t,n){const o=e.slice();return o[32]=t[n],o}function _r(e,t,n){const o=e.slice();return o[32]=t[n],o}function qr(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Sr(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}kr(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Nr]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),J.push((()=>ge(l,"value",y))),l.$on("input",e[12]),d=new Ve({props:{size:"18"}});let w=e[27]?.length&&function(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=jr(_r(e,o,t));return{c(){t=j("thead"),n=j("tr");for(let e=0;e<r.length;e+=1)r[e].c();V(n,"class","svelte-14hcfjl"),V(t,"class","svelte-14hcfjl")},m(e,o){q(e,t,o),_(t,n);for(let e=0;e<r.length;e+=1)r[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(o=e[27],i=0;i<o.length;i+=1){const l=_r(e,o,i);r[i]?r[i].p(l,t):(r[i]=jr(l),r[i].c(),r[i].m(n,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=o.length}},d(e){e&&S(t),N(r,e)}}}(e),k=e[26]?.length&&function(e){let t,n=e[26],o=[];for(let t=0;t<n.length;t+=1)o[t]=Er(xr(e,n,t));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,n){for(let t=0;t<o.length;t+=1)o[t].m(e,n);q(e,t,n)},p(e,r){if(11779&r[0]){let i;for(n=e[26],i=0;i<n.length;i+=1){const l=xr(e,n,i);o[i]?o[i].p(l,r):(o[i]=Er(l),o[i].c(),o[i].m(t.parentNode,t))}for(;i<o.length;i+=1)o[i].d(1);o.length=n.length}},d(e){N(o,e),e&&S(t)}}}(e);return{c(){t=j("div"),ve(n.$$.fragment),o=E(),r=j("div"),i=L("Suchen: "),ve(l.$$.fragment),a=E(),c=j("span"),ve(d.$$.fragment),u=E(),m=j("div"),f=j("table"),w&&w.c(),p=E(),$=j("tbody"),k&&k.c(),V(t,"class","form--buttons svelte-14hcfjl"),V(c,"class","feather pointer svelte-14hcfjl"),O(r,"margin-bottom","1em"),O(r,"position","relative"),V(f,"striped",""),V(f,"class","svelte-14hcfjl"),V(m,"class","eList svelte-14hcfjl")},m(s,y){q(s,t,y),ye(n,t,null),q(s,o,y),q(s,r,y),_(r,i),ye(l,r,null),_(r,a),_(r,c),ye(d,c,null),q(s,u,y),q(s,m,y),_(m,f),w&&w.m(f,null),_(f,p),_(f,$),k&&k.m($,null),h=!0,g||(v=D(c,"click",e[14]),g=!0)},p(e,t){kr(e);const o={};64&t[1]&&(o.$$scope={dirty:t,ctx:e}),n.$set(o);const r={};!s&&2&t[0]&&(s=!0,r.value=e[1],oe((()=>s=!1))),l.$set(r),e[27]?.length&&w.p(e,t),e[26]?.length&&k.p(e,t)},i(e){h||(me(n.$$.fragment,e),me(l.$$.fragment,e),me(d.$$.fragment,e),h=!0)},o(e){fe(n.$$.fragment,e),fe(l.$$.fragment,e),fe(d.$$.fragment,e),h=!1},d(e){e&&S(t),be(n),e&&S(o),e&&S(r),be(l),be(d),e&&S(u),e&&S(m),w&&w.d(),k&&k.d(),g=!1,v()}}}function Nr(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function jr(e){let t,n,o=e[32]?.designation+"";return{c(){t=j("th"),n=L(o),V(t,"class","svelte-14hcfjl")},m(e,o){q(e,t,o),_(t,n)},p:g,d(e){e&&S(t)}}}function Cr(e){let t,n,o=e[27],r=[];for(let t=0;t<o.length;t+=1)r[t]=Lr(Ir(e,o,t));return{c(){t=j("tr");for(let e=0;e<r.length;e+=1)r[e].c();n=E(),V(t,"class","pointer svelte-14hcfjl"),M(t,"active",e[29]._id===e[0])},m(e,o){q(e,t,o);for(let e=0;e<r.length;e+=1)r[e].m(t,null);_(t,n)},p(e,i){if(3584&i[0]){let l;for(o=e[27],l=0;l<o.length;l+=1){const s=Ir(e,o,l);r[l]?r[l].p(s,i):(r[l]=Lr(s),r[l].c(),r[l].m(t,n))}for(;l<r.length;l+=1)r[l].d(1);r.length=o.length}2049&i[0]&&M(t,"active",e[29]._id===e[0])},d(e){e&&S(t),N(r,e)}}}function Lr(e){let t,n,o,r,i=e[9](e[29],e[32])+"";return{c(){t=j("td"),n=L(i),V(t,"class","svelte-14hcfjl")},m(i,l){q(i,t,l),_(t,n),o||(r=D(t,"click",T(e[10](e[29]))),o=!0)},p(t,n){e=t},d(e){e&&S(t),o=!1,r()}}}function Er(e){let t,n=e[13](e[29],e[27],e[1]),o=n&&Cr(e);return{c(){o&&o.c(),t=F()},m(e,n){o&&o.m(e,n),q(e,t,n)},p(e,r){2&r[0]&&(n=e[13](e[29],e[27],e[1])),n?o?o.p(e,r):(o=Cr(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&S(t)}}}function Fr(e){let t,n;return t=new e[5]({}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p:g,i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Dr(e){let t,n,o,r;t=new e[4]({});let i={ctx:e,current:null,token:null,hasCatch:!1,pending:Fr,then:Sr,catch:qr,value:28,blocks:[,,,]};return pe(e[11](),i),{c(){ve(t.$$.fragment),n=E(),o=F(),i.block.c()},m(e,l){ye(t,e,l),q(e,n,l),q(e,o,l),i.block.m(e,i.anchor=l),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(t,n){$e(i,e=t,n)},i(e){r||(me(t.$$.fragment,e),me(i.block),r=!0)},o(e){fe(t.$$.fragment,e);for(let e=0;e<3;e+=1){fe(i.blocks[e])}r=!1},d(e){be(t,e),e&&S(n),e&&S(o),i.block.d(e),i.token=null,i=null}}}function zr(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[Dr]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};3&n[0]|64&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Tr(e,o,r){const i=Q(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=o,{className:p}=o,{classId:h}=o,{rowId:g}=o,{viewName:v}=o,{viewValue:y}=o,{recordId:b}=o,{filter:w}=o,k="",x=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass(p);H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(x)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Bs(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&r(15,m=e.item),"className"in e&&r(16,p=e.className),"classId"in e&&r(17,h=e.classId),"rowId"in e&&r(0,g=e.rowId),"viewName"in e&&r(18,v=e.viewName),"viewValue"in e&&r(19,y=e.viewValue),"recordId"in e&&r(20,b=e.recordId),"filter"in e&&r(21,w=e.filter)},[g,k,i,l,s,a,d,u,x,I,e=>()=>i("choose",{row:e}),async()=>{const e=await _,n="."+h+"#"+v;document.querySelector(n);let o={[v]:y},r=[];o[v]&&(r=await t.getSectionView(e.class,o,!0)),w&&(r=r.filter((e=>e._id!=w)));let i=[],l=e.display;return l&&l.length?l.map((t=>{const[n,o]=t.split(".");let l=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===o));l&&(l={...l},l.name=`${n}_${o}`,r=r.map((e=>(e[n]&&(e[l.name]=e["_"+n]?e["_"+n][o]:e[n][o]),e)))),l||(l=e.items.find((e=>e.name===n))),i.find((e=>e?.name===n))||i.push(l)})):i=e.items,{list:r,items:i}},({detail:{value:e}})=>{r(1,k=e)},(e,t,n)=>{if(!n)return!0;for(const o of t)if(I(e,o)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{r(1,k="")},m,p,h,v,y,b,w,()=>i("back"),function(e){k=e,r(1,k)}]}class Vr extends ke{constructor(e){var t;super(),wr.getElementById("svelte-14hcfjl-style")||((t=j("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(wr.head,t)),we(this,e,Tr,zr,k,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Ar(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Br(e){let t,n,o,r,i;function l(t){e[21](t)}let s={id:e[2],name:e[3].name,inputClass:e[5]||e[1],disabled:e[6],formnovalidate:e[7],readonly:e[13],pattern:e[12],required:e[14],style:"padding-left:2em;"};void 0!==e[0]&&(s.value=e[0]),n=new e[10]({props:s}),J.push((()=>ge(n,"value",l)));let a=!e[6]&&Or(e);return{c(){t=j("div"),ve(n.$$.fragment),r=E(),a&&a.c(),O(t,"position","relative")},m(e,o){q(e,t,o),ye(n,t,null),_(t,r),a&&a.m(t,null),i=!0},p(e,r){const i={};4&r&&(i.id=e[2]),8&r&&(i.name=e[3].name),34&r&&(i.inputClass=e[5]||e[1]),64&r&&(i.disabled=e[6]),128&r&&(i.formnovalidate=e[7]),!o&&1&r&&(o=!0,i.value=e[0],oe((()=>o=!1))),n.$set(i),e[6]?a&&(de(),fe(a,1,1,(()=>{a=null})),ue()):a?(a.p(e,r),64&r&&me(a,1)):(a=Or(e),a.c(),me(a,1),a.m(t,null))},i(e){i||(me(n.$$.fragment,e),me(a),i=!0)},o(e){fe(n.$$.fragment,e),fe(a),i=!1},d(e){e&&S(t),be(n),a&&a.d()}}}function Or(e){let t,n,o,r,i;return n=new rt({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-wbrqzu")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[17]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function Mr(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Wr(e){let t,n,o;function r(t){e[22](t)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[Rr]},$$scope:{ctx:e}};return void 0!==e[8]&&(i.open=e[8]),t=new e[11]({props:i}),J.push((()=>ge(t,"open",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};268435994&o&&(r.$$scope={dirty:o,ctx:e}),!n&&256&o&&(n=!0,r.open=e[8],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function Rr(e){let t,n;return t=new Vr({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};8&n&&(o.item=e[3]),8&n&&(o.className=e[3].refClass),2&n&&(o.classId=e[1]),16&n&&(o.recordId=e[4]._id),512&n&&(o.viewValue=e[9]),16&n&&(o.filter=e[4]._id),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Pr(e){let t,n,o,r={ctx:e,current:null,token:null,hasCatch:!1,pending:Mr,then:Br,catch:Ar,value:27,blocks:[,,,]};pe(e[16](),r);let i=e[8]&&Wr(e);return{c(){r.block.c(),t=E(),i&&i.c(),n=F()},m(e,l){r.block.m(e,r.anchor=l),r.mount=()=>t.parentNode,r.anchor=t,q(e,t,l),i&&i.m(e,l),q(e,n,l),o=!0},p(t,[o]){$e(r,e=t,o),e[8]?i?(i.p(e,o),256&o&&me(i,1)):(i=Wr(e),i.c(),me(i,1),i.m(n.parentNode,n)):i&&(de(),fe(i,1,1,(()=>{i=null})),ue())},i(e){o||(me(r.block),me(i),o=!0)},o(e){for(let e=0;e<3;e+=1){fe(r.blocks[e])}fe(i),o=!1},d(e){r.block.d(e),r.token=null,r=null,e&&S(t),i&&i.d(e),e&&S(n)}}}function Hr(e,t,n){const{TextField:o,Modal:r}=c;let{classId:i}=t,{id:l}=t,{item:s}=t,{record:a}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:m}=t,{formnovalidate:f}=t,{praefix:p}=t;const{properties:$={}}=s;let h,{pattern:g,placeholder:v,readonly:y,required:b=!1,view:w}=$,k=!1;const x=()=>{n(8,k=!1)};return e.$$set=e=>{"classId"in e&&n(1,i=e.classId),"id"in e&&n(2,l=e.id),"item"in e&&n(3,s=e.item),"record"in e&&n(4,a=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,m=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,p=e.praefix)},[d,i,l,s,a,u,m,f,k,h,o,r,g,y,b,w,async()=>(n(9,h=a[w.selection]),!0),()=>{n(8,k=!0)},({detail:e})=>{n(0,d=e.row[w.value?w.value:"_id"]),x()},x,p,function(e){d=e,n(0,d)},function(e){k=e,n(8,k)}]}class Qr extends ke{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=j("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",_(document.head,t)),we(this,e,Hr,Pr,k,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Yr(e,t,n){const o=e.slice();return o[12]=t[n][0],o[13]=t[n][1],o}function Gr(e){let t;return{c(){t=j("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Jr(e){let t;return{c(){t=j("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function Ur(e){let t,n,o,r,i=e[12]+"";return{c(){t=j("option"),n=L(i),t.__value=o=e[13],t.value=t.__value,t.selected=r=e[0]==e[13]},m(e,o){q(e,t,o),_(t,n)},p(e,l){64&l&&i!==(i=e[12]+"")&&A(n,i),64&l&&o!==(o=e[13])&&(t.__value=o,t.value=t.__value),65&l&&r!==(r=e[0]==e[13])&&(t.selected=r)},d(e){e&&S(t)}}}function Zr(e){let t,n,o,r,i,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Jr:Gr}let o=n(e),r=o(e);return{c(){r.c(),t=F()},m(e,n){r.m(e,n),q(e,t,n)},p(e,i){o!==(o=n(e))&&(r.d(1),r=o(e),r&&(r.c(),r.m(t.parentNode,t)))},d(e){r.d(e),e&&S(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=Ur(Yr(e,s,t));return{c(){t=j("select"),l&&l.c(),n=F();for(let e=0;e<a.length;e+=1)a[e].c();V(t,"class",o=I(e[3]||e[4])+" svelte-5xpzvo"),V(t,"id",e[2]),V(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(o,s){q(o,t,s),l&&l.m(t,null),_(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);r||(i=D(t,"change",e[9]),r=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let o;for(s=e[6],o=0;o<s.length;o+=1){const r=Yr(e,s,o);a[o]?a[o].p(r,n):(a[o]=Ur(r),a[o].c(),a[o].m(t,null))}for(;o<a.length;o+=1)a[o].d(1);a.length=s.length}24&n&&o!==(o=I(e[3]||e[4])+" svelte-5xpzvo")&&V(t,"class",o),4&n&&V(t,"id",e[2]),4&n&&V(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:g,o:g,d(e){e&&S(t),l&&l.d(),N(a,e),r=!1,i()}}}function Kr(e,t,n){const o=Q();let{id:r}=t,{item:i}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=i.properties;u&&(u=u.map((e=>[e,e]))),"valueAddedTax"===m&&(l||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!!f,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,r=e.id),"item"in e&&n(10,i=e.item),"value"in e&&n(0,l=e.value),"noForm"in e&&n(3,s=e.noForm),"classId"in e&&n(4,a=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[l,c,r,s,a,d,u,m,f,e=>o("blur",{value:e.srcElement.value}),i]}class Xr extends ke{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=j("style")).id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}",_(document.head,t)),we(this,e,Kr,Zr,k,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function ei(e){let t;return{c(){t=L("Stunden")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function ti(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[ei]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ni(e){let t;return{c(){t=L("Minuten")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function oi(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[ni]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ri(e){let t;return{c(){t=L("Jetzt")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function ii(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[ri]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};4096&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function li(e){let t,n,o,r,i,l,s,a,c;return r=new e[5]({props:{value:e[0],closeOnSelection:!0}}),r.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[ii],"minutes-label":[oi],"hours-label":[ti]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=j("input"),o=E(),ve(r.$$.fragment),i=E(),ve(l.$$.fragment),V(t,"type","string"),V(t,"class",n=e[2]||e[3]),V(t,"id",e[1]),V(t,"name",e[1]),t.hidden=!0},m(n,d){q(n,t,d),B(t,e[0]),q(n,o,d),ye(r,n,d),q(n,i,d),ye(l,n,d),s=!0,a||(c=D(t,"input",e[9]),a=!0)},p(e,[o]){(!s||12&o&&n!==(n=e[2]||e[3]))&&V(t,"class",n),(!s||2&o)&&V(t,"id",e[1]),(!s||2&o)&&V(t,"name",e[1]),1&o&&B(t,e[0]);const i={};1&o&&(i.value=e[0]),r.$set(i);const a={};1&o&&(a.value=e[0]),4096&o&&(a.$$scope={dirty:o,ctx:e}),l.$set(a)},i(e){s||(me(r.$$.fragment,e),me(l.$$.fragment,e),s=!0)},o(e){fe(r.$$.fragment,e),fe(l.$$.fragment,e),s=!1},d(e){e&&S(t),e&&S(o),be(r,e),e&&S(i),be(l,e),a=!1,c()}}}function si(e,t,n){const o=Q(),{Label:r,DatePicker:i,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>o("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,s=e.value),"id"in e&&n(1,a=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[s,a,d,u,r,i,l,({detail:e})=>{var t,o;n(0,(t=e.value,o=s,s=null==t||null==o?t:(o.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),o))),m(s)},({detail:e})=>{n(0,s=qn(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class ai extends ke{constructor(e){super(),we(this,e,si,li,k,{value:0,id:1,noForm:2,classId:3})}}function ci(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],closeOnSelection:!0}}),u.$on("change",e[10]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[11]),{c(){t=j("input"),i=E(),l=j("input"),d=E(),ve(u.$$.fragment),m=L(" /\n"),ve(f.$$.fragment),V(t,"type","string"),V(t,"class",n=e[1]||e[2]),V(t,"id",o=e[0]+"_from"),V(t,"name",r=e[0]+"_from"),t.hidden=!0,V(l,"type","string"),V(l,"class",s=e[1]||e[2]),V(l,"id",a=e[0]+"_to"),V(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,o){q(n,t,o),B(t,e[7]),q(n,i,o),q(n,l,o),B(l,e[8]),q(n,d,o),ye(u,n,o),q(n,m,o),ye(f,n,o),p=!0,$||(h=[D(t,"input",e[13]),D(l,"input",e[14])],$=!0)},p(e,[i]){(!p||6&i&&n!==(n=e[1]||e[2]))&&V(t,"class",n),(!p||1&i&&o!==(o=e[0]+"_from"))&&V(t,"id",o),(!p||1&i&&r!==(r=e[0]+"_from"))&&V(t,"name",r),128&i&&B(t,e[7]),(!p||6&i&&s!==(s=e[1]||e[2]))&&V(l,"class",s),(!p||1&i&&a!==(a=e[0]+"_to"))&&V(l,"id",a),(!p||1&i&&c!==(c=e[0]+"_to"))&&V(l,"name",c),256&i&&B(l,e[8]);const d={};32&i&&(d.format=e[5]),8&i&&(d.required=e[3]),16&i&&(d.disabled=e[4]),128&i&&(d.value=e[7]),u.$set(d);const m={};64&i&&(m.format=e[6]),8&i&&(m.required=e[3]),16&i&&(m.disabled=e[4]),256&i&&(m.value=e[8]),f.$set(m)},i(e){p||(me(u.$$.fragment,e),me(f.$$.fragment,e),p=!0)},o(e){fe(u.$$.fragment,e),fe(f.$$.fragment,e),p=!1},d(e){e&&S(t),e&&S(i),e&&S(l),e&&S(d),be(u,e),e&&S(m),be(f,e),$=!1,b(h)}}}function di(e,t,n){const o=Q(),{DatePicker:r}=c;let{value:i}=t,{id:l}=t,{noForm:s=!1}=t,{classId:a}=t,{required:d}=t,{disabled:u}=t,m="%d.%m.%Y",f="%d.%m.%Y",p=i?.from,$=i?.to;"Invalid Date"===p?.toString()&&(p=void 0),"Invalid Date"===$?.toString()&&($=void 0),u&&(void 0===p&&(m=""),void 0===$&&(f=""));return e.$$set=e=>{"value"in e&&n(12,i=e.value),"id"in e&&n(0,l=e.id),"noForm"in e&&n(1,s=e.noForm),"classId"in e&&n(2,a=e.classId),"required"in e&&n(3,d=e.required),"disabled"in e&&n(4,u=e.disabled)},[l,s,a,d,u,m,f,p,$,r,({detail:e})=>{n(7,p=qn(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),o("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=qn(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),o("change",{value:$,range:"_to"})},i,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class ui extends ke{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=j("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",_(document.head,t)),we(this,e,di,ci,k,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function mi(e){let t,n,o;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:fi,placeholder:pi,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=j("div"),ve(n.$$.fragment),O(t,"max-width","4em")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p(e,[t]){const o={};4&t&&(o.inputClass=e[2]),1&t&&(o.id=e[0]),1&t&&(o.name=e[0]),2&t&&(o.value=e[1]),8&t&&(o.readonly=e[3]),16&t&&(o.disabled=e[4]),n.$set(o)},i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}const fi="([01][0-9]|2[0-3]):([0-5][0-9])",pi="";function $i(e,t,n){const o=Q(),{TextField:r}=c;let{id:i}=t,{item:l}=t,{value:s}=t,{inputClass:a}=t,{readonly:d}=t,{disabled:u}=t,{praefix:m}=t;const f=e=>{if(!e)return"";const[t,n]=e.split(":");return 4===t.length?`${t.substr(0,2)}:${t.substring(2,4)}`:3===t.length?t.substring(0,2)>23?`0${t.substring(0,1)}:${t.substring(1,3)}`:`${t.substring(0,2)}:${t.substring(2,3)}0`:2===t.length?t>23?`0${t.substring(0,1)}:${t.substring(1,2)}0`:`${t}:${(n||"0").padStart(2,"0")}`:`0${t}:${(n||"0").padStart(2,"0")}`};return e.$$set=e=>{"id"in e&&n(0,i=e.id),"item"in e&&n(7,l=e.item),"value"in e&&n(1,s=e.value),"inputClass"in e&&n(2,a=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,m=e.praefix)},[i,s,a,d,u,r,({detail:e})=>{o("blur",{value:f(e.value)}),o("checkRange",{idx:m,fieldId:i,value:e.value})},l,m]}class hi extends ke{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=j("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",_(document.head,t)),we(this,e,$i,mi,k,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:gi}=he;function vi(e,t,n){const o=e.slice();return o[0]=t[n],o}function yi(e,t,n){const o=e.slice();return o[17]=t[n],o[19]=n,o}function bi(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function wi(e){let t,n,o=e[14],r=[];for(let t=0;t<o.length;t+=1)r[t]=xi(vi(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(14&n){let l;for(o=e[14],l=0;l<o.length;l+=1){const i=vi(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=xi(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}function ki(e){let t,n,o=(e[0]["_"+e[17]]||e[0][e[17]])+"",r=e[19]&&function(e){let t;return{c(){t=L(", ")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}();return{c(){t=j("span"),r&&r.c(),n=L(o),V(t,"class","lookupValue")},m(e,o){q(e,t,o),r&&r.m(t,null),_(t,n)},p(e,t){2&t&&o!==(o=(e[0]["_"+e[17]]||e[0][e[17]])+"")&&A(n,o)},d(e){e&&S(t),r&&r.d()}}}function xi(e){let t,n,o,r,i,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=ki(yi(e,c,t));return r=new Oe({props:{size:"18"}}),{c(){t=j("div");for(let e=0;e<d.length;e+=1)d[e].c();n=E(),o=j("span"),ve(r.$$.fragment),i=E(),V(o,"class","feather pointer svelte-1u646ni"),V(t,"class","lookupItem svelte-1u646ni")},m(c,u){q(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,n),_(t,o),ye(r,o,null),_(t,i),l=!0,s||(a=D(o,"click",e[3](e[0]._id)),s=!0)},p(o,r){if(e=o,6&r){let o;for(c=e[1],o=0;o<c.length;o+=1){const i=yi(e,c,o);d[o]?d[o].p(i,r):(d[o]=ki(i),d[o].c(),d[o].m(t,n))}for(;o<d.length;o+=1)d[o].d(1);d.length=c.length}},i(e){l||(me(r.$$.fragment,e),l=!0)},o(e){fe(r.$$.fragment,e),l=!1},d(e){e&&S(t),N(d,e),be(r),s=!1,a()}}}function Ii(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function _i(e){let t,n,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Ii,then:wi,catch:bi,value:14,blocks:[,,,]};return pe(e[2](),o),{c(){t=j("div"),o.block.c(),V(t,"class","lookup svelte-1u646ni")},m(e,r){q(e,t,r),o.block.m(t,o.anchor=null),o.mount=()=>t,o.anchor=null,n=!0},p(t,[n]){$e(o,e=t,n)},i(e){n||(me(o.block),n=!0)},o(e){for(let e=0;e<3;e+=1){fe(o.blocks[e])}n=!1},d(e){e&&S(t),o.block.d(),o.token=null,o=null}}}function qi(e,n,o){let{id:r}=n,{item:i}=n,{praefix:l}=n,{record:s}=n;const{refItem:a,view:c}=i.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{te().then((()=>{const e=document.querySelector("div.form-field."+i.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&o(4,r=e.id),"item"in e&&o(0,i=e.item),"praefix"in e&&o(5,l=e.praefix),"record"in e&&o(6,s=e.record)},[i,d,async()=>{let e=[];if(s._id){const n=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const r={[u]:s[u]||s._id};if(e=await t.getSectionView(f,r,n),!n){const t=d.find((e=>e.includes(":"))).split(":")[0];e=e.map((e=>{const n=e[t].find((e=>e[t]===s._id));return n._id=e._id,n})),o(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const n=await t.getTaskByDocId(e);if(!n)return;const o=n._id,r=`/task/${n.event}/${o}/task?view=standalone`;window.open(r)},r,l,s]}class Si extends ke{constructor(e){var t;super(),gi.getElementById("svelte-1u646ni-style")||((t=j("style")).id="svelte-1u646ni-style",t.textContent=".feather.svelte-1u646ni{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1u646ni{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1u646ni{position:relative;margin-left:2em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}",_(gi.head,t)),we(this,e,qi,_i,k,{id:4,item:0,praefix:5,record:6})}}function Ni(e){let t,n,o;return n=new Je({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather2 svelte-9up2nn")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function ji(e){let t,n,o,r,i;return n=new Je({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-9up2nn")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[9]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function Ci(e){let t,n,o,r,i,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[ji,Ni],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=j("div"),ve(n.$$.fragment),o=E(),i.c(),O(t,"position","relative")},m(e,i){q(e,t,i),ye(n,t,null),_(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(de(),fe(a[d],1,1,(()=>{a[d]=null})),ue(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),me(i,1),i.m(t,null))},i(e){l||(me(n.$$.fragment,e),me(i),l=!0)},o(e){fe(n.$$.fragment,e),fe(i),l=!1},d(e){e&&S(t),be(n),a[r].d()}}}function Li(e,n,o){const{TextField:r}=c;let{inputClass:i}=n,{disabled:l}=n,{formnovalidate:s}=n,{readonly:a}=n,{required:d}=n,{id:u}=n,{name:m}=n,{value:f}=n,{record:p}=n,{item:$}=n;return e.$$set=e=>{"inputClass"in e&&o(0,i=e.inputClass),"disabled"in e&&o(1,l=e.disabled),"formnovalidate"in e&&o(2,s=e.formnovalidate),"readonly"in e&&o(3,a=e.readonly),"required"in e&&o(4,d=e.required),"id"in e&&o(5,u=e.id),"name"in e&&o(6,m=e.name),"value"in e&&o(7,f=e.value),"record"in e&&o(10,p=e.record),"item"in e&&o(11,$=e.item)},[i,l,s,a,d,u,m,f,r,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:n,houseNo:o,postcode:r,location:i,country:l}=e,s=[n&&o?n+" "+o:n,r&&i?r+" "+i:r||i||"",l&&(await t.getTask("country",l)).designation].filter((e=>!!e)).join(", "),a="https://bing.com/maps/default.aspx?where1="+encodeURIComponent(s);window.open(a,"_blank")},p,$,function(t){Y(e,t)}]}class Ei extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=j("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),we(this,e,Li,Ci,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function Fi(e){let t,n,o;return n=new Re({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather2 svelte-9up2nn")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function Di(e){let t,n,o,r,i;return n=new Re({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-9up2nn")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[9]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function zi(e){let t,n,o,r,i,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[10]);const s=[Di,Fi],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=j("div"),ve(n.$$.fragment),o=E(),i.c(),O(t,"position","relative")},m(e,i){q(e,t,i),ye(n,t,null),_(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(de(),fe(a[d],1,1,(()=>{a[d]=null})),ue(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),me(i,1),i.m(t,null))},i(e){l||(me(n.$$.fragment,e),me(i),l=!0)},o(e){fe(n.$$.fragment,e),fe(i),l=!1},d(e){e&&S(t),be(n),a[r].d()}}}function Ti(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,r=e.inputClass),"disabled"in e&&n(1,i=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value)},[r,i,l,s,a,d,u,m,o,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){Y(e,t)}]}class Vi extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=j("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),we(this,e,Ti,zi,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Ai(e){let t,n,o;return n=new Ke({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather2 svelte-9up2nn")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function Bi(e){let t,n,o,r,i;return n=new Ke({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-9up2nn")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[11]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function Oi(e){let t,n,o,r,i,l;n=new e[10]({props:{inputClass:e[2],pattern:e[0],placeholder:e[1],disabled:e[3],formnovalidate:e[4],readonly:e[5],required:e[6],id:e[7],name:e[8],value:e[9]}}),n.$on("change",e[12]);const s=[Bi,Ai],a=[];function c(e,t){return e[9]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=j("div"),ve(n.$$.fragment),o=E(),i.c(),O(t,"position","relative")},m(e,i){q(e,t,i),ye(n,t,null),_(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};4&o&&(l.inputClass=e[2]),1&o&&(l.pattern=e[0]),2&o&&(l.placeholder=e[1]),8&o&&(l.disabled=e[3]),16&o&&(l.formnovalidate=e[4]),32&o&&(l.readonly=e[5]),64&o&&(l.required=e[6]),128&o&&(l.id=e[7]),256&o&&(l.name=e[8]),512&o&&(l.value=e[9]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(de(),fe(a[d],1,1,(()=>{a[d]=null})),ue(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),me(i,1),i.m(t,null))},i(e){l||(me(n.$$.fragment,e),me(i),l=!0)},o(e){fe(n.$$.fragment,e),fe(i),l=!1},d(e){e&&S(t),be(n),a[r].d()}}}function Mi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;f||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{7,8})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,r=e.inputClass),"disabled"in e&&n(3,i=e.disabled),"formnovalidate"in e&&n(4,l=e.formnovalidate),"readonly"in e&&n(5,s=e.readonly),"required"in e&&n(6,a=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,m=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,p=e.placeholder)},[f,p,r,i,l,s,a,d,u,m,o,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){Y(e,t)}]}class Wi extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=j("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),we(this,e,Mi,Oi,k,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function Ri(e){let t,n,o;return n=new Qe({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather2 svelte-9up2nn")},m(e,r){q(e,t,r),ye(n,t,null),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n)}}}function Pi(e){let t,n,o,r,i;return n=new Qe({props:{size:"18"}}),{c(){t=j("span"),ve(n.$$.fragment),V(t,"class","feather pointer svelte-9up2nn")},m(l,s){q(l,t,s),ye(n,t,null),o=!0,r||(i=D(t,"click",e[11]),r=!0)},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n),r=!1,i()}}}function Hi(e){let t,n,o,r,i,l;n=new e[10]({props:{type:"email",inputClass:e[0],pattern:e[8],placeholder:e[9],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[Pi,Ri],a=[];function c(e,t){return e[7]?0:1}return r=c(e),i=a[r]=s[r](e),{c(){t=j("div"),ve(n.$$.fragment),o=E(),i.c(),O(t,"position","relative")},m(e,i){q(e,t,i),ye(n,t,null),_(t,o),a[r].m(t,null),l=!0},p(e,[o]){const l={};1&o&&(l.inputClass=e[0]),256&o&&(l.pattern=e[8]),512&o&&(l.placeholder=e[9]),2&o&&(l.disabled=e[1]),4&o&&(l.formnovalidate=e[2]),8&o&&(l.readonly=e[3]),16&o&&(l.required=e[4]),32&o&&(l.id=e[5]),64&o&&(l.name=e[6]),128&o&&(l.value=e[7]),n.$set(l);let d=r;r=c(e),r===d?a[r].p(e,o):(de(),fe(a[d],1,1,(()=>{a[d]=null})),ue(),i=a[r],i?i.p(e,o):(i=a[r]=s[r](e),i.c()),me(i,1),i.m(t,null))},i(e){l||(me(n.$$.fragment,e),me(i),l=!0)},o(e){fe(n.$$.fragment,e),fe(i),l=!1},d(e){e&&S(t),be(n),a[r].d()}}}function Qi(e,t,n){const{TextField:o}=c;let{inputClass:r}=t,{disabled:i}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,r=e.inputClass),"disabled"in e&&n(1,i=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value),"pattern"in e&&n(8,f=e.pattern),"placeholder"in e&&n(9,p=e.placeholder)},[r,i,l,s,a,d,u,m,f,p,o,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){Y(e,t)}]}class Yi extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=j("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),we(this,e,Qi,Hi,k,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}function Gi(e){let t,n;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+(e[20]?" hidden ":""),name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[pl,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};1048578&n[0]&&(o.class=e[1].name+(e[20]?" hidden ":"")),2&n[0]&&(o.name=e[1].designation),2&n[0]&&(o.help=e[1].properties?.hint),57671679&n[0]|33554432&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ji(e){let t,n;return t=new e[30]({props:{text:e[1].designation}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.text=e[1].designation),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ui(e){let t,n,o,r,i,l;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+" hidden",name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[$l]},$$scope:{ctx:e}}}),o=new e[30]({props:{text:e[25]}}),i=new zo({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[1],value:e[24]()}}),i.$on("setRefValue",e[40]),i.$on("safeReference",e[44]),{c(){ve(t.$$.fragment),n=E(),ve(o.$$.fragment),r=E(),ve(i.$$.fragment)},m(e,s){ye(t,e,s),q(e,n,s),ye(o,e,s),q(e,r,s),ye(i,e,s),l=!0},p(e,n){const r={};2&n[0]&&(r.class=e[1].name+" hidden"),2&n[0]&&(r.name=e[1].designation),2&n[0]&&(r.help=e[1].properties?.hint),25166210&n[0]|33554432&n[1]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r);const l={};33554432&n[0]&&(l.text=e[25]),o.$set(l);const s={};16&n[0]&&(s.required=e[4]),8&n[0]&&(s.disabled=e[3]),524288&n[0]&&(s.readonly=e[19]),2&n[0]&&(s.item=e[1]),16777216&n[0]&&(s.value=e[24]()),i.$set(s)},i(e){l||(me(t.$$.fragment,e),me(o.$$.fragment,e),me(i.$$.fragment,e),l=!0)},o(e){fe(t.$$.fragment,e),fe(o.$$.fragment,e),fe(i.$$.fragment,e),l=!1},d(e){be(t,e),e&&S(n),be(o,e),e&&S(r),be(i,e)}}}function Zi(e){let t,n;return t=new e[27]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[21],required:!0===e[4],placeholder:e[22],id:e[32],name:e[31],value:e[24]()}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),2097152&n[0]&&(o.pattern=e[21]),16&n[0]&&(o.required=!0===e[4]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ki(e){let t,n;return t=new Wi({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2097152&n[0]&&(o.pattern=e[21]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Xi(e){let t,n;return t=new Vi({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[24]()}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function el(e){let t,n;return t=new Yi({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2097152&n[0]&&(o.pattern=e[21]),4194304&n[0]&&(o.placeholder=e[22]),16777216&n[0]&&(o.value=e[24]()),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function tl(e){let t,n;return t=new hi({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[1],value:e[24](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[49]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),32&n[0]&&(o.praefix=e[5]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function nl(e){let t,n;return t=new Si({props:{id:e[32],item:e[1],praefix:e[5],record:e[0]}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.item=e[1]),32&n[0]&&(o.praefix=e[5]),1&n[0]&&(o.record=e[0]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ol(e){let t,n;return t=new Ei({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[24](),record:e[0],item:e[1]}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.value=e[24]()),1&n[0]&&(o.record=e[0]),2&n[0]&&(o.item=e[1]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function rl(e){let t,n;return t=new ai({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[33](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function il(e){let t,n;return t=new ui({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[34](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ll(e){let t,n;return t=new e[28]({props:{inputClass:e[6]||e[7],required:e[4],disabled:e[3],id:e[32],name:e[31],value:e[33](),closeOnSelection:!0}}),t.$on("change",e[35](!0)),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),16&n[0]&&(o.required=e[4]),8&n[0]&&(o.disabled=e[3]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function sl(e){let t,n;return t=new e[29]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[24]()}}),t.$on("change",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};192&n[0]&&(o.inputClass=e[6]||e[7]),524296&n[0]&&(o.disabled=e[3]||e[19]),16&n[0]&&(o.required=e[4]),16777216&n[0]&&(o.checked=e[24]()),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function al(e){let t,n;return t=new Qr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],view:e[1].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[48]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),1&n[0]&&(o.record=e[0]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.view=e[1].properties.view),32&n[0]&&(o.praefix=e[5]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function cl(e){let t,n;return t=new br({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],multi:e[1].properties.multi,numberInput:e[12],praefix:e[5],toDelete:e[15],reqQuantity:e[16],notifyList:e[18]}}),t.$on("blur",e[35]()),t.$on("invalid",e[47]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),1&n[0]&&(o.record=e[0]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.multi=e[1].properties.multi),4096&n[0]&&(o.numberInput=e[12]),32&n[0]&&(o.praefix=e[5]),32768&n[0]&&(o.toDelete=e[15]),65536&n[0]&&(o.reqQuantity=e[16]),262144&n[0]&&(o.notifyList=e[18]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function dl(e){let t,n;return t=new Bo({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[1],currency:e[17],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),16&n[0]&&(o.required=e[4]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.item=e[1]),131072&n[0]&&(o.currency=e[17]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ul(e){let t,n;return t=new Xr({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),16&n[0]&&(o.required=e[4]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ml(e){let t,n;return t=new r({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[1].name,value:e[24](),noForm:e[6],placeholder:e[1].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),8&n[0]&&(o.disabled=e[3]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.name=e[1].name),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),2&n[0]&&(o.placeholder=e[1].properties?.placeholder),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function fl(e){let t,n;return t=new kn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[1],desc:e[25],value:e[24](),noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[45]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[46]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),256&n[0]&&(o.eventId=e[8]),16&n[0]&&(o.required=e[4]),8&n[0]&&(o.disabled=e[3]),1024&n[0]&&(o.formnovalidate=e[10]),524288&n[0]&&(o.readonly=e[19]),2&n[0]&&(o.item=e[1]),33554432&n[0]&&(o.desc=e[25]),16777216&n[0]&&(o.value=e[24]()),64&n[0]&&(o.noForm=e[6]),32&n[0]&&(o.praefix=e[5]),512&n[0]&&(o.selectionFields=e[9]),2048&n[0]&&(o.selection=e[11]),8192&n[0]&&(o.deList=e[13]),4&n[0]&&(o.recordId=e[2]),16384&n[0]&&(o.isTemplate=e[14]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function pl(e){let t,n,o,r;const i=[fl,ml,ul,dl,cl,al,sl,ll,il,rl,ol,nl,tl,el,Xi,Ki,Zi],l=[];function s(e,t){return"object"===e[1].type?0:"textarea"===e[1].type||e[1].properties&&"textarea"===e[1].properties.format?1:e[1].properties&&(e[1].properties.enum||e[1].properties.regulation)?2:"number"===e[1].type?3:e[1].properties&&e[1].properties.multi?4:e[1].properties&&e[1].properties.view&&"lookup"===!e[1].properties.format?5:"boolean"===e[1].type?6:"date"===e[1].type?7:"dateRange"===e[1].type?8:"datetime"===e[1].type?9:"map"===e[1].properties?.format?10:"lookup"===e[1].properties?.format?11:"time"===e[1].properties?.format?12:"email"===e[1].type||"email"===e[1].properties?.format?13:"url"===e[1].properties?.format?14:"tel"===e[1].properties?.format?15:16}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),q(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(de(),fe(l[a],1,1,(()=>{l[a]=null})),ue(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),me(n,1),n.m(o.parentNode,o))},i(e){r||(me(n),r=!0)},o(e){fe(n),r=!1},d(e){l[t].d(e),e&&S(o)}}}function $l(e){let t,n;return t=new kn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[1],value:e[24](),withRefValue:!0,refValue:e[23]}}),t.$on("setRefDesc",e[41]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[0]&&(o.classId=e[7]),256&n[0]&&(o.eventId=e[8]),2&n[0]&&(o.item=e[1]),16777216&n[0]&&(o.value=e[24]()),8388608&n[0]&&(o.refValue=e[23]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function hl(e){let t,n,o,r;const i=[Ui,Ji,Gi],l=[];function s(e,t){return e[5]||"reference"!==e[1].saveAs||"object"!==e[1].type?"divider"===e[1].type?1:2:0}return t=s(e),n=l[t]=i[t](e),{c(){n.c(),o=F()},m(e,n){l[t].m(e,n),q(e,o,n),r=!0},p(e,r){let a=t;t=s(e),t===a?l[t].p(e,r):(de(),fe(l[a],1,1,(()=>{l[a]=null})),ue(),n=l[t],n?n.p(e,r):(n=l[t]=i[t](e),n.c()),me(n,1),n.m(o.parentNode,o))},i(e){r||(me(n),r=!0)},o(e){fe(n),r=!1},d(e){l[t].d(e),e&&S(o)}}}function gl(e,t,n){let o,r,i;const l=Q(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:m,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:b=!1}=t,{classId:w}=t,{eventId:k}=t,{disabled:x}=t,{selectionFields:I}=t,{formnovalidate:_}=t,{selection:q=!1}=t,{notifyList:S}=t,{numberInput:N}=t,{deList:j}=t,{required:C}=t,{isTemplate:L}=t,{toDelete:E}=t,{reqQuantity:F}=t,{currency:D}=t,{changeValue:z}=t;y||=v._id;let{required:T,readonly:V,hidden:A,pattern:B,placeholder:O}=h.properties||{};if("tel"===h.properties?.format&&(B||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{7,8})",O||="+41 58 234 56 78"),A=!0===A,void 0!==V&&(V=!0===V),void 0===C&&(C=T),x=x||!!V,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const M=(g?g+".":"")+h.name,W=M+(""!==$?"-"+$:""),R=(e,t=M)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let P=R(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(1,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(0,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,b=e.noForm),"classId"in e&&n(7,w=e.classId),"eventId"in e&&n(8,k=e.eventId),"disabled"in e&&n(3,x=e.disabled),"selectionFields"in e&&n(9,I=e.selectionFields),"formnovalidate"in e&&n(10,_=e.formnovalidate),"selection"in e&&n(11,q=e.selection),"notifyList"in e&&n(18,S=e.notifyList),"numberInput"in e&&n(12,N=e.numberInput),"deList"in e&&n(13,j=e.deList),"required"in e&&n(4,C=e.required),"isTemplate"in e&&n(14,L=e.isTemplate),"toDelete"in e&&n(15,E=e.toDelete),"reqQuantity"in e&&n(16,F=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue)},e.$$.update=()=>{if(4096&e.$$.dirty[1])for(const e in z)e===M&&n(0,v[M]=z[e],v);1&e.$$.dirty[0]&&n(24,o=(e=M)=>{let t=R(v);return void 0===t?"":t}),1&e.$$.dirty[0]&&(i=R(v))},n(25,r=((e=M)=>{let t=v["_"+e];return t=f(t),void 0===t?"":t})()),[v,h,y,x,C,$,b,w,k,I,_,q,N,j,L,E,F,D,S,V,A,B,O,P,o,r,s,a,d,m,p,M,W,(e=M)=>{let t=R(v);return t?new Date(t):new Date},(e=M)=>{const t=R(v,e+"_from"),n=R(v,e+"_to");return{from:void 0===t?t:new Date(t),to:void 0===n?n:new Date(n)}},e=>({detail:t})=>{let{value:o,checked:r,range:s}=t;void 0!==r&&(o=r);const a=M+(s||"");n(0,v[a]=e?function(e,t){if(null==e)return null;let n=e.getHours();return/%p/i.test(t)&&(n%=12,0===n&&(n=12)),t.replace("%Y",e.getFullYear()).replace("%y",(e.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(e.getMonth()+1).toString().padStart(2,"0")).replace("%d",e.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",e.getMinutes().toString().padStart(2,"0")).replace("%S",e.getSeconds().toString().padStart(2,"0")).replace("%p",e.getHours()<12?"am":"pm").replace("%P",e.getHours()<12?"AM":"PM").replace("%%","%")}(o,"%d.%m.%Y"):o,v);const c=Object.values(v).every((e=>!e))&&o;l("notify",{oldValue:i,value:o,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,A=!0),()=>"object"===h.type?"comment_"+W:W,({detail:e})=>{n(23,P=e)},({detail:e})=>{const{designation:t}=h;n(25,r=t+": "+(e||"(Neu)"))},g,z,function(t){Y(e,t)},function(t){Y(e,t)},function(t){Y(e,t)},function(t){Y(e,t)},function(t){Y(e,t)},function(t){Y(e,t)}]}class vl extends ke{constructor(e){var t;super(),document.getElementById("svelte-mea5fj-style")||((t=j("style")).id="svelte-mea5fj-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em}.form-field div.field > label.checkbox{padding-top:0.5em}",_(document.head,t)),we(this,e,gl,hl,k,{praefix:5,item:1,listName:42,record:0,recordId:2,noForm:6,classId:7,eventId:8,disabled:3,selectionFields:9,formnovalidate:10,selection:11,notifyList:18,numberInput:12,deList:13,required:4,isTemplate:14,toDelete:15,reqQuantity:16,currency:17,changeValue:43},[-1,-1])}}const{document:yl}=he;function bl(e,t,n){const o=e.slice();return o[83]=t[n],o[85]=n,o}function wl(e,t,n){const o=e.slice();return o[92]=t[n],o}function kl(e,t,n){const o=e.slice();return o[87]=t[n].title,o[88]=t[n].toDelete,o[89]=t[n].icon,o}function xl(e){let t,n;return t=new e[18]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[Il]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};2048&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Il(e){let t,n,o;function r(t){e[46](t)}let i={item:e[28],disabled:!0};return void 0!==e[11]&&(i.value=e[11]),t=new Bo({props:i}),J.push((()=>ge(t,"value",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};!n&&2048&o[0]&&(n=!0,r.value=e[11],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function _l(e){let t,n;return t=new e[18]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[ql]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};16384&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ql(e){let t,n,o;function r(t){e[47](t)}let i={item:e[26],disabled:!0};return void 0!==e[14]&&(i.value=e[14]),t=new Bo({props:i}),J.push((()=>ge(t,"value",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};!n&&16384&o[0]&&(n=!0,r.value=e[14],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function Sl(e){let t,n;return t=new e[18]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[Nl]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};1152&n[0]|4&n[3]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Nl(e){let t,n,o;function r(t){e[48](t)}let i={item:e[24],disabled:!0,currency:e[7]};return void 0!==e[10]&&(i.value=e[10]),t=new Bo({props:i}),J.push((()=>ge(t,"value",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&1024&o[0]&&(n=!0,r.value=e[10],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function jl(e){let t,n;return t=new e[21]({props:{class:e[15][e[85]],open:e[9]&&!e[1]&&0===e[85],$$slots:{handle:[Vl,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]],default:[Fl,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){w(e[42](e[85],e[82]))&&e[42](e[85],e[82]).apply(this,arguments)})),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(n,o){e=n;const r={};32768&o[0]&&(r.class=e[15][e[85]]),514&o[0]&&(r.open=e[9]&&!e[1]&&0===e[85]),209917&o[0]|16777216&o[2]|4&o[3]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Cl(e){let t,n;return t=new vl({props:{praefix:e[85],item:e[92],eventId:e[6],record:e[83],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:Wl,classId:e[5],disabled:e[0],required:e[22],selectionFields:e[29],numberInput:e[17],currency:e[7],formnovalidate:e[85]===e[12].length-1||e[12][e[85]]._delete}}),t.$on("notify",(function(){w(e[31](e[92],e[85]))&&e[31](e[92],e[85]).apply(this,arguments)})),t.$on("task",e[49]),t.$on("invalid",e[32]),t.$on("defPrep",e[33]),t.$on("checkRange",e[34]),t.$on("record",e[50]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(n,o){e=n;const r={};8&o[0]&&(r.item=e[92]),64&o[0]&&(r.eventId=e[6]),4096&o[0]&&(r.record=e[83]),16&o[0]&&(r.recordId=e[4]._id),4&o[0]&&(r.reqQuantity=e[2]),256&o[0]&&(r.notifyList=e[8]),32&o[0]&&(r.classId=e[5]),1&o[0]&&(r.disabled=e[0]),131072&o[0]&&(r.numberInput=e[17]),128&o[0]&&(r.currency=e[7]),4096&o[0]&&(r.formnovalidate=e[85]===e[12].length-1||e[12][e[85]]._delete),t.$set(r)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ll(e){let t,n,o=e[3].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=Cl(wl(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(541200893&n[0]|15&n[1]){let l;for(o=e[3].item,l=0;l<o.length;l+=1){const i=wl(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=Cl(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}function El(e){let t,n,o=e[12][e[85]]._delete,r=Ll(e);return{c(){r.c(),t=F()},m(e,o){r.m(e,o),q(e,t,o),n=!0},p(e,n){4096&n[0]&&k(o,o=e[12][e[85]]._delete)?(de(),fe(r,1,1,g),ue(),r=Ll(e),r.c(),me(r),r.m(t.parentNode,t)):r.p(e,n)},i(e){n||(me(r),n=!0)},o(e){fe(r),n=!1},d(e){e&&S(t),r.d(e)}}}function Fl(e){let t,n,o,r,i=e[12].length,l=El(e);return{c(){t=j("div"),l.c(),o=E(),V(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`)},m(e,n){q(e,t,n),l.m(t,null),q(e,o,n),r=!0},p(e,o){4096&o[0]&&k(i,i=e[12].length)?(de(),fe(l,1,1,g),ue(),l=El(e),l.c(),me(l),l.m(t,null)):l.p(e,o),(!r||40&o[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`))&&V(t,"id",n)},i(e){r||(me(l),r=!0)},o(e){fe(l),r=!1},d(e){e&&S(t),l.d(e),e&&S(o)}}}function Dl(e){let t,n,o,r,i,l=e[30](e[13],e[85])+"";return{c(){t=j("div"),n=L(l),V(t,"class",o=I("draggableListItem "+e[3].name)+" svelte-1es1ap1"),V(t,"draggable",!0),M(t,"delete",e[83]._delete),M(t,"is-active-top",e[16]?.top===e[85]),M(t,"is-active-bottom",e[16]?.bottom===e[85])},m(o,l){q(o,t,l),_(t,n),r||(i=[D(t,"dragover",e[40]),D(t,"dragleave",e[41](e[85])),D(t,"dragstart",e[38](e[85])),D(t,"drop",z(e[37](e[85]))),D(t,"dragenter",e[39](e[85]))],r=!0)},p(r,i){e=r,8192&i[0]&&l!==(l=e[30](e[13],e[85])+"")&&A(n,l),8&i[0]&&o!==(o=I("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&V(t,"class",o),4104&i[0]&&M(t,"delete",e[83]._delete),65544&i[0]&&M(t,"is-active-top",e[16]?.top===e[85]),65544&i[0]&&M(t,"is-active-bottom",e[16]?.bottom===e[85])},d(e){e&&S(t),r=!1,b(i)}}}function zl(e){let t,n,o;var r=e[89];return r&&(t=new r({props:{size:"20"}})),{c(){t&&ve(t.$$.fragment),n=F()},m(e,r){t&&ye(t,e,r),q(e,n,r),o=!0},p(e,o){if(r!==(r=e[89])){if(t){de();const e=t;fe(e.$$.fragment,1,0,(()=>{be(e,1)})),ue()}r?(t=new r({props:{size:"20"}}),ve(t.$$.fragment),me(t.$$.fragment,1),ye(t,n.parentNode,n)):t=null}},i(e){o||(t&&me(t.$$.fragment,e),o=!0)},o(e){t&&fe(t.$$.fragment,e),o=!1},d(e){e&&S(n),t&&be(t,e)}}}function Tl(e){let t,n,o,r,i,l=!e[0]&&!e[3].readonly&&zl(e);return{c(){t=j("span"),l&&l.c(),V(t,"class","pointer icon svelte-1es1ap1"),V(t,"title",e[87]),t.hidden=n=e[85]===e[12].length-1||!(e[83]._delete^e[88])},m(n,s){q(n,t,s),l&&l.m(t,null),o=!0,r||(i=D(t,"click",(function(){w(e[36](e[85],e[9],e[86]))&&e[36](e[85],e[9],e[86]).apply(this,arguments)})),r=!0)},p(r,i){(e=r)[0]||e[3].readonly?l&&(de(),fe(l,1,1,(()=>{l=null})),ue()):l?(l.p(e,i),9&i[0]&&me(l,1)):(l=zl(e),l.c(),me(l,1),l.m(t,null)),(!o||4096&i[0]&&n!==(n=e[85]===e[12].length-1||!(e[83]._delete^e[88])))&&(t.hidden=n)},i(e){o||(me(l),o=!0)},o(e){fe(l),o=!1},d(e){e&&S(t),l&&l.d(),r=!1,i()}}}function Vl(e){let t,n,o,r,i,l;n=new e[19]({props:{$$slots:{default:[Dl]},$$scope:{ctx:e}}}),n.$on("click",(function(){w(e[35](e[86],e[85],e[9]))&&e[35](e[86],e[85],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Ve},{title:"undo",toDelete:!1,icon:De}],a=[];for(let t=0;t<2;t+=1)a[t]=Tl(kl(e,s,t));const c=e=>fe(a[e],1,1,(()=>{a[e]=null}));return{c(){t=j("div"),ve(n.$$.fragment),o=E();for(let e=0;e<2;e+=1)a[e].c();r=E(),V(t,"class",i=I("accordion "+e[3].name)+" svelte-1es1ap1"),V(t,"slot","handle")},m(e,i){q(e,t,i),ye(n,t,null),_(t,o);for(let e=0;e<2;e+=1)a[e].m(t,null);_(t,r),l=!0},p(o,d){e=o;const u={};if(77832&d[0]|4&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|32&d[1]|16777216&d[2]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Ve},{title:"undo",toDelete:!1,icon:De}],n=0;n<2;n+=1){const o=kl(e,s,n);a[n]?(a[n].p(o,d),me(a[n],1)):(a[n]=Tl(o),a[n].c(),me(a[n],1),a[n].m(t,r))}for(de(),n=2;n<2;n+=1)c(n);ue()}(!l||8&d[0]&&i!==(i=I("accordion "+e[3].name)+" svelte-1es1ap1"))&&V(t,"class",i)},i(e){if(!l){me(n.$$.fragment,e);for(let e=0;e<2;e+=1)me(a[e]);l=!0}},o(e){fe(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)fe(a[e]);l=!1},d(e){e&&S(t),be(n),N(a,e)}}}function Al(e){let t,n,o=(!e[1]&&!e[0]||e[85]<e[12].length-1)&&jl(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){!e[1]&&!e[0]||e[85]<e[12].length-1?o?(o.p(e,n),4099&n[0]&&me(o,1)):(o=jl(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function Bl(e){let t,n,o=e[12],r=[];for(let t=0;t<o.length;t+=1)r[t]=Al(bl(e,o,t));const i=e=>fe(r[e],1,1,(()=>{r[e]=null}));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);q(e,t,o),n=!0},p(e,n){if(1615049727&n[0]|4095&n[1]|17825792&n[2]){let l;for(o=e[12],l=0;l<o.length;l+=1){const i=bl(e,o,l);r[l]?(r[l].p(i,n),me(r[l],1)):(r[l]=Al(i),r[l].c(),me(r[l],1),r[l].m(t.parentNode,t))}for(de(),l=o.length;l<r.length;l+=1)i(l);ue()}},i(e){if(!n){for(let e=0;e<o.length;e+=1)me(r[e]);n=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)fe(r[e]);n=!1},d(e){N(r,e),e&&S(t)}}}function Ol(e){let t,n,o,r,i,l,s=e[27]&&e[11]&&0!=e[11]&&xl(e),a=e[25]&&e[14]&&0!=e[14]&&_l(e),c=e[23]&&e[10]&&0!=e[10]&&Sl(e);return i=new e[20]({props:{class:e[5]+e[3].name,$$slots:{default:[Bl,({closeOtherPanels:e})=>({82:e}),({closeOtherPanels:e})=>[0,0,e?1048576:0]]},$$scope:{ctx:e}}}),{c(){t=j("div"),s&&s.c(),n=E(),a&&a.c(),o=E(),c&&c.c(),r=E(),ve(i.$$.fragment),V(t,"class","formList")},m(e,d){q(e,t,d),s&&s.m(t,null),_(t,n),a&&a.m(t,null),_(t,o),c&&c.m(t,null),_(t,r),ye(i,t,null),l=!0},p(e,l){e[27]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&me(s,1)):(s=xl(e),s.c(),me(s,1),s.m(t,n)):s&&(de(),fe(s,1,1,(()=>{s=null})),ue()),e[25]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&me(a,1)):(a=_l(e),a.c(),me(a,1),a.m(t,o)):a&&(de(),fe(a,1,1,(()=>{a=null})),ue()),e[23]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&me(c,1)):(c=Sl(e),c.c(),me(c,1),c.m(t,r)):c&&(de(),fe(c,1,1,(()=>{c=null})),ue());const d={};40&l[0]&&(d.class=e[5]+e[3].name),242687&l[0]|1048576&l[2]|4&l[3]&&(d.$$scope={dirty:l,ctx:e}),i.$set(d)},i(e){l||(me(s),me(a),me(c),me(i.$$.fragment,e),l=!0)},o(e){fe(s),fe(a),fe(c),fe(i.$$.fragment,e),l=!1},d(e){e&&S(t),s&&s.d(),a&&a.d(),c&&c.d(),be(i)}}}let Ml=new Map;const Wl=!0,Rl="pos/target";function Pl(e,n,o){let r,i;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:m}=c,h=Q();let{list:g}=n,{schema:v}=n,{record:y}=n,{classId:b}=n,{eventId:w}=n,{disabled:k}=n,{fixed:x}=n,{template:I={}}=n,{reqQuantity:_}=n,{open:q=!1}=n,{currency:S}=n,{notifyList:N}=n;const j=v.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),C=j&&v.find((e=>"quantity"===e.name));let L=0;const E=v.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let F=0;const D=v.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",z=!!D;let T=0;const V={};let A=v.properties?.readonly,B=b.split("form-")[1].slice(0,-4),O=new Map;g.group&&(x=!0);const M={};k||=A;let W,R,P=[],H=[],G=!1,J={},U=[];v.filter((e=>e.selection)).map((e=>P.push({className:B,parentClass:v,refClass:e.selection,value:""}))),v.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{v.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[o,r]=n.split(".");r||(r=o,o=void 0),U.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))}));const Z=async(e,t,n)=>{const o=y[n];if(!o?.length)return;const r=o[0][n];if(!r)return;const i=await As(n,r);return i?i[g.name]:void 0},K=async(e,t)=>{const n=U.filter((e=>(e.refObj||B)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:r,refName:i,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(r){const t=W[e][r];r===B&&i?d=y:t&&(d=await As(r,t))}!r&&i&&(d=W[e]),d&&(u=d[i],Array.isArray(u)&&0===u.length&&(u=!1)),"!"===l&&(u=!u),"required"!==c&&"readonly"!==c||(c="required"===c?c:"disabled",setTimeout((()=>{s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field textarea`,a=document.querySelector(s),a||(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field input`,a=document.querySelector(s)),a&&u&&a.setAttribute(c,""),a&&!u&&a.removeAttribute(c)}),0)),"hidden"===c&&(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n}`,a=document.querySelector(s),a?.classList?.toggle("hidden",u),u&&o(12,W[e][n]="",W))}},X=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const r=document.querySelectorAll(n);let i=!1;r.forEach((e=>{e.required&&""===e.value&&(i=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),o(15,H[e]=i||t?"invalid":"",H)},ee=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},ne=(e,t)=>{if(!t)return;const n=v.find((e=>e.name===t)),r=n.properties.value.formula,{operator:i,argument:l}=r,s=l.map((t=>W[e][t.refItem]));let a=0;"$add"===i&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===i&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,o]=e.split(":");e=o?(+n+ +o/60).toFixed(2):+n;const[r,i]=t.split(":");return r?e-=i?(+r+ +i/60).toFixed(2):+r:0})));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;o(12,W[e][t]=(a||0).toFixed(n.properties.decimals||0),W),o(17,J={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)};R=v.filter((e=>e.refClass)).reduce(((e,t)=>{const n=v.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,o]=t.selection.split(":"),[r]=o?.split(".")||[];r&&e.push({refClass:r,items:[n],selection:t.selection})}const o={refClass:t.refClass,items:[]};return n.forEach((e=>{o.items.push(e.name)})),e.push(o),e}),[]);const oe=async(e,t,n,r)=>{const i=(await R).find((e=>e.refClass===t.refClass));if(!i)return;const{refClass:l,items:s,selection:a}=i,c=t.name;if(U.find((e=>e.itemName===c))){const t=`#accordion-content-${b}-${g.name}-${e} .form-field.${l}.hidden`;if(document.querySelector(t))return}return n?Promise.all(s.map((async i=>{const c=v.find((e=>e.name===i));if(c.properties?.readonly&&!t.refInput){const n=W[e][t.refClass];return Promise.resolve(As(t.refClass,n,!0)).then((t=>{let n=t[i];Array.isArray(n)&&(n=n.length?n[0][i]:""),o(12,W[e][i]=n,W)}))}let d="";const{refInput:u}=t;if(u&&W[e]){const[t,n]=u.split(".");d=n?W[e][n]:y[t]}if(a&&n!==r)s.map((t=>{o(12,W[e][t]="",W)}));else if(u&&!d||re(e,i)||r!==n){const n=v.find((e=>e.refClass===l)),r=W[e][n.name];if(t.selection){const n=Vs(t.selection+r.toString());if(n)return Promise.resolve(n).then((t=>o(12,W[e][i]=t[i],W)))}return Promise.resolve(As(n.refClass,r)).then((t=>o(12,W[e][i]=t[i],W)))}}))):Promise.resolve(s.map((t=>{o(12,W[e][t]="",W)})))},re=(e,t)=>{let n=W[e][t];return"number"===v.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},ie=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let le=!1;const se=e=>!(!x&&e>=W.length-1),ae=(e,t=!1)=>{const[n,o]=e.split(";");return g.name===o&&(!!se(t)&&((!1===t||t!=n)&&parseInt(n)))};v.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=v.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const ce=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,o=document.querySelectorAll(n);if(!o?.length)return;const r=o[o.length-1];te().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(ie)})).then((()=>{t&&r.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&o(3,g=e.list),"schema"in e&&o(43,v=e.schema),"record"in e&&o(4,y=e.record),"classId"in e&&o(5,b=e.classId),"eventId"in e&&o(6,w=e.eventId),"disabled"in e&&o(0,k=e.disabled),"fixed"in e&&o(1,x=e.fixed),"template"in e&&o(44,I=e.template),"reqQuantity"in e&&o(2,_=e.reqQuantity),"open"in e&&o(9,q=e.open),"currency"in e&&o(7,S=e.currency),"notifyList"in e&&o(8,N=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&y&&(o(2,_=y.quantity),o(12,W=(y[g.name]||[]).concat({}))),4096&e.$$.dirty[0]&&o(13,r=W),15368&e.$$.dirty[0]&&r&&((()=>{if(E)o(14,F=W?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(z)o(11,T=W?.reduce(((e,t)=>e+(t._delete?0:+(t[D]||0))),0)||0)})(),(()=>{if(j)o(10,L=W?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}if(t.price){const n=(C?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),te().then((()=>h("save",{listName:g.name,value:W,amountValue:L,weeksValue:T})))),16384&e.$$.dirty[1]&&(i=e=>V[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[k,x,_,g,y,b,w,S,N,q,L,T,W,r,F,H,G,J,l,a,d,u,undefined,j,{name:"amountValue",properties:{decimals:2}},E,{name:"hoursValue",properties:{decimals:2}},z,{name:"weeksValue",properties:{decimals:1}},P,(e,t)=>{let n=e[t];return M["pos"+t]&&(n=M["pos"+t]),n&&v.filter((e=>!0!==e.properties?.hidden&&void 0!==n[e.name]&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?i(n[e.name]):Array.isArray(n[e.name])?n[e.name][0]||"":"boolean"===e.type?$(n[e.name]):"date"===e.type?f(n[e.name]):"datetime"===e.type?p(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:i,value:l,add:s,desc:a}=n;if(g.refItem){const n=await Z(t,e,g.refItem);n&&o(12,W=n)}ne(t,e._formulaActor);const c=P?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&W.length===t+1&&o(12,W=W.concat({})),a&&o(45,V[l]=a,V),await oe(t,e,l,i),await K(t,e.name),o(13,r=W),"number"===e.type&&o(17,J={item:e,value:l,idx:t}),X(t)},({detail:e})=>{const{idx:t,value:n}=e;X(t,n)},async({detail:{className:e,itemName:n,value:o}})=>{if(O.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===B+"."+g.name))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&O.set(e,i[0])},({detail:e})=>{const{idx:t,fieldId:n,value:o}=e;if(!o)return;const r=ee(o);let i=!1;W.forEach(((e,n)=>{if(t===n)return;const{start:o,end:l}=W[n];o&&l&&r>ee(o)&&r<ee(l)&&(i=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",i)},(e,t,n)=>n=>{W[t]._delete||(e(n),ce(t,!0))},(e,t,n)=>r=>{if(o(12,W[e]._delete=!W[e]._delete,W),W[e]._delete){M["pos"+e]={...W[e]};for(const t of v)o(12,W[e][t.name]="",W);t&&n(r)}else{if(M["pos"+e]){const t={};for(const n of v)t[n.name]=M["pos"+e][n.name];o(12,W[e]=t,W)}M["pos"+e]=void 0,t||n(r)}},e=>t=>{t.preventDefault(),o(16,G=!1);const n=ae(t.dataTransfer.getData(Rl),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const r=[...W].map(((e,t)=>(e._index=t,e)));n<e?(r.splice(e+1,0,r[n]),r.splice(n,1)):(r.splice(e,0,r[n]),r.splice(n+1,1)),r.map(((e,t)=>{return n=e._index,o=t,void Ml.set(o,n);var n,o}));let i=[];H.map(((e,t)=>{i[t]=H[(e=>{const t=Ml.get(e);return void 0===t?e:t})(t)]})),o(15,H=i),o(12,W=r.map(((e,t)=>(delete e._index,e)))),le=!1},e=>t=>{if(!se(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(Rl,e+";"+g.name),le=e},e=>t=>{const n=ae(t.dataTransfer.getData(Rl),e)||le;return!1===n||n===e?o(16,G=!1):void o(16,G={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{o(16,G=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(O).forEach((([t,n])=>{W[e][t]||o(12,W[e][t]=n._id,W)}))}),500);const r=new Set;for(const e of U)r.add(e.refObj||B);for(const t of Array.from(r))K(e,t);t(n),ce(e)},v,I,V,function(e){T=e,o(11,T)},function(e){F=e,o(14,F)},function(e){L=e,o(10,L)},function(t){Y(e,t)},function(t){Y(e,t)}]}class Hl extends ke{constructor(e){var t;super(),yl.getElementById("svelte-1es1ap1-style")||((t=j("style")).id="svelte-1es1ap1-style",t.textContent=".accordion.svelte-1es1ap1{display:flex;overflow:hidden}.accordion-content.svelte-1es1ap1{position:relative}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion > .btn{width:95% !important}.sEmbedded .formList .accordion > .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-1es1ap1{padding-top:1em}div.delete.svelte-1es1ap1{text-decoration:line-through}.icon.svelte-1es1ap1{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-1es1ap1{cursor:drag}.draggableListItem.is-active-top.svelte-1es1ap1{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-1es1ap1{border-bottom:3px purple solid;padding-bottom:2em}",_(yl.head,t)),we(this,e,Pl,Ol,k,{list:3,schema:43,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:44,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:Ql,document:Yl}=he;function Gl(e,t,n){const o=e.slice();return o[125]=t[n],o}function Jl(e,t,n){const o=e.slice();return o[128]=t[n],o}function Ul(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Zl(e){let t,n,o=e[124]&&function(e){let t,n,o,r,i,l,s,a,c,d,u,m,f,p,$,h,g=e[1].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=Xl(Jl(e,g,t));const y=e=>fe(v[e],1,1,(()=>{v[e]=null}));let w=e[1].list&&es(e),k=!e[2]&&e[39]&&e[3]&&!e[21]&&ds(e);d=new e[24]({props:{outline:!0,$$slots:{default:[ms]},$$scope:{ctx:e}}}),d.$on("click",e[42]);const x=[ps,fs],C=[];function L(e,t){return e[5]?0:e[39]?1:-1}~(m=L(e))&&(f=C[m]=x[m](e));return{c(){t=j("section"),n=j("form"),o=j("input"),i=E();for(let e=0;e<v.length;e+=1)v[e].c();l=E(),w&&w.c(),s=E(),k&&k.c(),a=E(),c=j("div"),ve(d.$$.fragment),u=E(),f&&f.c(),V(o,"class",I(e[29])+" svelte-9xiaib"),V(o,"name","_id"),V(o,"type","hidden"),o.value=r=e[4]._id||"",V(n,"class",I(e[30])+" svelte-9xiaib"),V(n,"id",e[29]),V(c,"class","form--buttons svelte-9xiaib"),V(t,"class",I(e[31])+" svelte-9xiaib")},m(r,f){q(r,t,f),_(t,n),_(n,o),_(n,i);for(let e=0;e<v.length;e+=1)v[e].m(n,null);_(n,l),w&&w.m(n,null),_(t,s),k&&k.m(t,null),_(t,a),_(t,c),ye(d,c,null),_(c,u),~m&&C[m].m(c,null),p=!0,$||(h=[D(n,"keydown",e[47]),D(n,"submit",z(e[41]))],$=!0)},p(e,i){if((!p||16&i[0]&&r!==(r=e[4]._id||""))&&(o.value=r),539003026&i[0]|14708864&i[1]){let t;for(g=e[1].items,t=0;t<g.length;t+=1){const o=Jl(e,g,t);v[t]?(v[t].p(o,i),me(v[t],1)):(v[t]=Xl(o),v[t].c(),me(v[t],1),v[t].m(n,l))}for(de(),t=g.length;t<v.length;t+=1)y(t);ue()}e[1].list?w?(w.p(e,i),2&i[0]&&me(w,1)):(w=es(e),w.c(),me(w,1),w.m(n,null)):w&&(de(),fe(w,1,1,(()=>{w=null})),ue()),!e[2]&&e[39]&&e[3]&&!e[21]?k?(k.p(e,i),2097164&i[0]&&me(k,1)):(k=ds(e),k.c(),me(k,1),k.m(t,a)):k&&(de(),fe(k,1,1,(()=>{k=null})),ue());const s={};128&i[4]&&(s.$$scope={dirty:i,ctx:e}),d.$set(s);let u=m;m=L(e),m===u?~m&&C[m].p(e,i):(f&&(de(),fe(C[u],1,1,(()=>{C[u]=null})),ue()),~m?(f=C[m],f?f.p(e,i):(f=C[m]=x[m](e),f.c()),me(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)me(v[e]);me(w),me(k),me(d.$$.fragment,e),me(f),p=!0}},o(e){v=v.filter(Ql);for(let e=0;e<v.length;e+=1)fe(v[e]);fe(w),fe(k),fe(d.$$.fragment,e),fe(f),p=!1},d(e){e&&S(t),N(v,e),w&&w.d(),k&&k.d(),be(d),~m&&C[m].d(),$=!1,b(h)}}}(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,t){e[124]&&o.p(e,t)},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function Kl(e){let t,n;return t=new vl({props:{classId:e[29],item:e[128],selection:e[128].selection,record:e[4],disabled:e[21],eventId:e[38],toDelete:e[11],currency:e[7],changeValue:e[15]}}),t.$on("task",e[43]),t.$on("notify",e[44]),t.$on("safeReference",e[53]),t.$on("multi",e[45]),t.$on("defPrep",e[52]),t.$on("record",e[54]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};2&n[0]&&(o.item=e[128]),2&n[0]&&(o.selection=e[128].selection),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),2048&n[0]&&(o.toDelete=e[11]),128&n[0]&&(o.currency=e[7]),32768&n[0]&&(o.changeValue=e[15]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Xl(e){let t,n,o="list"!==e[128].type&&Kl(e);return{c(){o&&o.c(),t=F()},m(e,r){o&&o.m(e,r),q(e,t,r),n=!0},p(e,n){"list"!==e[128].type?o?(o.p(e,n),2&n[0]&&me(o,1)):(o=Kl(e),o.c(),me(o,1),o.m(t.parentNode,t)):o&&(de(),fe(o,1,1,(()=>{o=null})),ue())},i(e){n||(me(o),n=!0)},o(e){fe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function es(e){let t,n,o,r,i,l=e[34]&&e[8]&&0!=e[8]&&ts(e),s=e[9]&&os(e),a=e[35]&&e[14]&&0!=e[14]&&is(e),c=e[1].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=cs(Gl(e,c,t));const u=e=>fe(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=E(),s&&s.c(),n=E(),a&&a.c(),o=E();for(let e=0;e<d.length;e+=1)d[e].c();r=F()},m(e,c){l&&l.m(e,c),q(e,t,c),s&&s.m(e,c),q(e,n,c),a&&a.m(e,c),q(e,o,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);q(e,r,c),i=!0},p(e,i){if(e[34]&&e[8]&&0!=e[8]?l?(l.p(e,i),256&i[0]&&me(l,1)):(l=ts(e),l.c(),me(l,1),l.m(t.parentNode,t)):l&&(de(),fe(l,1,1,(()=>{l=null})),ue()),e[9]?s?(s.p(e,i),512&i[0]&&me(s,1)):(s=os(e),s.c(),me(s,1),s.m(n.parentNode,n)):s&&(de(),fe(s,1,1,(()=>{s=null})),ue()),e[35]&&e[14]&&0!=e[14]?a?(a.p(e,i),16384&i[0]&&me(a,1)):(a=is(e),a.c(),me(a,1),a.m(o.parentNode,o)):a&&(de(),fe(a,1,1,(()=>{a=null})),ue()),539177174&i[0]|8421504&i[1]){let t;for(c=e[1].list,t=0;t<c.length;t+=1){const n=Gl(e,c,t);d[t]?(d[t].p(n,i),me(d[t],1)):(d[t]=cs(n),d[t].c(),me(d[t],1),d[t].m(r.parentNode,r))}for(de(),t=c.length;t<d.length;t+=1)u(t);ue()}},i(e){if(!i){me(l),me(s),me(a);for(let e=0;e<c.length;e+=1)me(d[e]);i=!0}},o(e){fe(l),fe(s),fe(a),d=d.filter(Ql);for(let e=0;e<d.length;e+=1)fe(d[e]);i=!1},d(e){l&&l.d(e),e&&S(t),s&&s.d(e),e&&S(n),a&&a.d(e),e&&S(o),N(d,e),e&&S(r)}}}function ts(e){let t,n;return t=new e[25]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[ns]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};384&n[0]|128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ns(e){let t,n,o;function r(t){e[63](t)}let i={item:e[32],disabled:!0,currency:e[7]};return void 0!==e[8]&&(i.value=e[8]),t=new Bo({props:i}),J.push((()=>ge(t,"value",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&256&o[0]&&(n=!0,r.value=e[8],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function os(e){let t,n;return t=new e[25]({props:{name:"Total MWSt "+(e[10]?"("+e[10]+"%)":""),nameClass:"formField_italic",$$slots:{default:[rs]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};1024&n[0]&&(o.name="Total MWSt "+(e[10]?"("+e[10]+"%)":"")),640&n[0]|128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function rs(e){let t,n,o;function r(t){e[64](t)}let i={item:e[33],disabled:!0,currency:e[7]};return void 0!==e[9]&&(i.value=e[9]),t=new Bo({props:i}),J.push((()=>ge(t,"value",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};128&o[0]&&(r.currency=e[7]),!n&&512&o[0]&&(n=!0,r.value=e[9],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function is(e){let t,n;return t=new e[25]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[ls]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};16384&n[0]|128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ls(e){let t,n,o;function r(t){e[65](t)}let i={item:e[36],disabled:!0};return void 0!==e[14]&&(i.value=e[14]),t=new Bo({props:i}),J.push((()=>ge(t,"value",r))),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};!n&&16384&o[0]&&(n=!0,r.value=e[14],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function ss(e){let t,n;return t=new Kn({props:{classId:e[29],open:!e[2]&&1===e[1].list.length,list:e[125],template:e[16],eventId:e[38],schema:e[125].item,record:e[4],disabled:e[21],currency:e[7]}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};6&n[0]&&(o.open=!e[2]&&1===e[1].list.length),2&n[0]&&(o.list=e[125]),65536&n[0]&&(o.template=e[16]),2&n[0]&&(o.schema=e[125].item),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),128&n[0]&&(o.currency=e[7]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function as(e){let t,n;return t=new Hl({props:{classId:e[29],open:e[13],list:e[125],template:e[17],eventId:e[38],schema:e[125].item,record:e[4],disabled:e[21],fixed:e[125].fixed,reqQuantity:e[12],currency:e[7],notifyList:e[6]}}),t.$on("save",e[46]),t.$on("record",e[54]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};8192&n[0]&&(o.open=e[13]),2&n[0]&&(o.list=e[125]),131072&n[0]&&(o.template=e[17]),2&n[0]&&(o.schema=e[125].item),16&n[0]&&(o.record=e[4]),2097152&n[0]&&(o.disabled=e[21]),2&n[0]&&(o.fixed=e[125].fixed),4096&n[0]&&(o.reqQuantity=e[12]),128&n[0]&&(o.currency=e[7]),64&n[0]&&(o.notifyList=e[6]),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function cs(e){let t,n,o,r,i,l;t=new e[23]({props:{text:e[125].designation}});const s=[as,ss],a=[];function c(e,t){return"array"===e[125].type?0:1}return o=c(e),r=a[o]=s[o](e),{c(){ve(t.$$.fragment),n=E(),r.c(),i=F()},m(e,r){ye(t,e,r),q(e,n,r),a[o].m(e,r),q(e,i,r),l=!0},p(e,n){const l={};2&n[0]&&(l.text=e[125].designation),t.$set(l);let d=o;o=c(e),o===d?a[o].p(e,n):(de(),fe(a[d],1,1,(()=>{a[d]=null})),ue(),r=a[o],r?r.p(e,n):(r=a[o]=s[o](e),r.c()),me(r,1),r.m(i.parentNode,i))},i(e){l||(me(t.$$.fragment,e),me(r),l=!0)},o(e){fe(t.$$.fragment,e),fe(r),l=!1},d(e){be(t,e),e&&S(n),a[o].d(e),e&&S(i)}}}function ds(e){let t,n,o,r;function i(t){e[66](t)}let l={title:"",round:!0,$$slots:{default:[us]},$$scope:{ctx:e}};return void 0!==e[20]&&(l.checked=e[20]),n=new e[26]({props:l}),J.push((()=>ge(n,"checked",i))),{c(){t=j("div"),ve(n.$$.fragment),V(t,"class","askNext"),O(t,"margin-top","1em"),O(t,"margin-left","23em")},m(e,o){q(e,t,o),ye(n,t,null),r=!0},p(e,t){const r={};128&t[4]&&(r.$$scope={dirty:t,ctx:e}),!o&&1048576&t[0]&&(o=!0,r.checked=e[20],oe((()=>o=!1))),n.$set(r)},i(e){r||(me(n.$$.fragment,e),r=!0)},o(e){fe(n.$$.fragment,e),r=!1},d(e){e&&S(t),be(n)}}}function us(e){let t;return{c(){t=j("span"),t.textContent="Weiter erfassen",O(t,"margin-left","1em")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function ms(e){let t;return{c(){t=L("Abbrechen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function fs(e){let t,n,o,r,i;t=new e[24]({props:{class:"close",disabled:e[21],form:e[29],filled:!0,type:"submit",$$slots:{default:[$s]},$$scope:{ctx:e}}});let l=e[3]&&!e[21]&&hs(e),s=e[18]&&vs(e);return{c(){ve(t.$$.fragment),n=E(),l&&l.c(),o=E(),s&&s.c(),r=F()},m(e,a){ye(t,e,a),q(e,n,a),l&&l.m(e,a),q(e,o,a),s&&s.m(e,a),q(e,r,a),i=!0},p(e,n){const i={};2097152&n[0]&&(i.disabled=e[21]),128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i),e[3]&&!e[21]?l?(l.p(e,n),2097160&n[0]&&me(l,1)):(l=hs(e),l.c(),me(l,1),l.m(o.parentNode,o)):l&&(de(),fe(l,1,1,(()=>{l=null})),ue()),e[18]?s?(s.p(e,n),262144&n[0]&&me(s,1)):(s=vs(e),s.c(),me(s,1),s.m(r.parentNode,r)):s&&(de(),fe(s,1,1,(()=>{s=null})),ue())},i(e){i||(me(t.$$.fragment,e),me(l),me(s),i=!0)},o(e){fe(t.$$.fragment,e),fe(l),fe(s),i=!1},d(e){be(t,e),e&&S(n),l&&l.d(e),e&&S(o),s&&s.d(e),e&&S(r)}}}function ps(e){let t,n,o,r;t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[qs]},$$scope:{ctx:e}}}),t.$on("click",e[50]);let i=e[19]&&Ss(e);return{c(){ve(t.$$.fragment),n=E(),i&&i.c(),o=F()},m(e,l){ye(t,e,l),q(e,n,l),i&&i.m(e,l),q(e,o,l),r=!0},p(e,n){const r={};128&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[19]?i?(i.p(e,n),524288&n[0]&&me(i,1)):(i=Ss(e),i.c(),me(i,1),i.m(o.parentNode,o)):i&&(de(),fe(i,1,1,(()=>{i=null})),ue())},i(e){r||(me(t.$$.fragment,e),me(i),r=!0)},o(e){fe(t.$$.fragment,e),fe(i),r=!1},d(e){be(t,e),e&&S(n),i&&i.d(e),e&&S(o)}}}function $s(e){let t;return{c(){t=L("Speichern und schliessen")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function hs(e){let t,n;return t=new e[24]({props:{form:e[29],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[gs]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function gs(e){let t;return{c(){t=L("Speichern")},m(e,n){q(e,t,n)},d(e){e&&S(t)}}}function vs(e){let t,n,o,r,i;const l=[bs,ys],s=[];t=function(e,t){return e[37]?0:1}(e),n=s[t]=l[t](e);let a=e[19]&&Is(e);return{c(){n.c(),o=E(),a&&a.c(),r=F()},m(e,n){s[t].m(e,n),q(e,o,n),a&&a.m(e,n),q(e,r,n),i=!0},p(e,t){n.p(e,t),e[19]?a?(a.p(e,t),524288&t[0]&&me(a,1)):(a=Is(e),a.c(),me(a,1),a.m(r.parentNode,r)):a&&(de(),fe(a,1,1,(()=>{a=null})),ue())},i(e){i||(me(n),me(a),i=!0)},o(e){fe(n),fe(a),i=!1},d(e){s[t].d(e),e&&S(o),a&&a.d(e),e&&S(r)}}}function ys(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[ws]},$$scope:{ctx:e}}}),t.$on("click",(function(){w(e[48](e[0]))&&e[48](e[0]).apply(this,arguments)})),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(n,o){e=n;const r={};128&o[4]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function bs(e){let t,n;return t=new d({props:{text:e[37],extended:!0,$$slots:{default:[xs]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};1&n[0]|128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function ws(e){let t,n,o;return n=new tt({props:{size:"18"}}),{c(){t=j("span"),t.textContent=`${e[55]()}`,ve(n.$$.fragment),O(t,"margin-right",".75em")},m(e,r){q(e,t,r),ye(n,e,r),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n,e)}}}function ks(e){let t,n,o;return n=new tt({props:{size:"18"}}),{c(){t=j("span"),t.textContent=`${e[55]()}`,ve(n.$$.fragment),O(t,"margin-right",".75em")},m(e,r){q(e,t,r),ye(n,e,r),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n,e)}}}function xs(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[ks]},$$scope:{ctx:e}}}),t.$on("click",(function(){w(e[48](e[0]))&&e[48](e[0]).apply(this,arguments)})),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(n,o){e=n;const r={};128&o[4]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Is(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[_s]},$$scope:{ctx:e}}}),t.$on("click",(function(){w(e[49](e[0]))&&e[49](e[0]).apply(this,arguments)})),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(n,o){e=n;const r={};128&o[4]&&(r.$$scope={dirty:o,ctx:e}),t.$set(r)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function _s(e){let t,n,o;return n=new rt({props:{size:"18"}}),{c(){t=j("span"),t.textContent="Daten",ve(n.$$.fragment),O(t,"margin-right",".75em")},m(e,r){q(e,t,r),ye(n,e,r),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n,e)}}}function qs(e){let t,n,o;return n=new tt({props:{size:"18"}}),{c(){t=j("span"),t.textContent="Erstellen",ve(n.$$.fragment),O(t,"margin-right",".75em")},m(e,r){q(e,t,r),ye(n,e,r),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n,e)}}}function Ss(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Ns]},$$scope:{ctx:e}}}),t.$on("click",e[51]),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,n){const o={};128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ns(e){let t,n,o;return n=new rt({props:{size:"18"}}),{c(){t=j("span"),t.textContent="Daten",ve(n.$$.fragment),O(t,"margin-right",".75em")},m(e,r){q(e,t,r),ye(n,e,r),o=!0},p:g,i(e){o||(me(n.$$.fragment,e),o=!0)},o(e){fe(n.$$.fragment,e),o=!1},d(e){e&&S(t),be(n,e)}}}function js(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Cs(e){let t,n,o,r;Yl.title=t=e[22];let i={ctx:e,current:null,token:null,hasCatch:!1,pending:js,then:Zl,catch:Ul,value:124,blocks:[,,,]};return pe(e[40](),i),{c(){n=E(),o=F(),i.block.c()},m(e,t){q(e,n,t),q(e,o,t),i.block.m(e,i.anchor=t),i.mount=()=>o.parentNode,i.anchor=o,r=!0},p(n,o){e=n,(!r||4194304&o[0])&&t!==(t=e[22])&&(Yl.title=t),$e(i,e,o)},i(e){r||(me(i.block),r=!0)},o(e){for(let e=0;e<3;e+=1){fe(i.blocks[e])}r=!1},d(e){e&&S(n),e&&S(o),i.block.d(e),i.token=null,i=null}}}let Ls=new Map,Es=new Map,Fs=new Map;const Ds=(e,n)=>{const o=n;return Ls.has(o)||Ls.set(o,t.getTasksList(n).then((({data:e})=>e))),Ls.get(o)},zs=(e,n,o)=>Es.get(o)||Ds(e,n).then((n=>n.find((({_id:e})=>e===o))||t.getTaskList(e,o))).then((e=>(Es.set(o,e),e))),Ts=(e,t)=>{Fs.set(e,t)},Vs=e=>Fs.get(e),As=(e,n,o=!1)=>!o&&Fs.get(n)||t.getTask(e,n).then((e=>(Fs.set(n,e),e))),Bs=(e,n)=>{if(!Ls.get(n))return;const o=n;Ls.set(o,t.getTasksList(n).then((({data:e})=>e)))};function Os(e,r,a){let d,f,p,$,g,v,y;x(e,m,(e=>a(76,$=e))),x(e,s,(e=>a(77,g=e))),x(e,o,(e=>a(78,v=e)));const{Divider:b,Button:w,FormField:k,Checkbox:I}=c,{loggedIn:_,currentTasks:q}=u;x(e,_,(e=>a(79,y=e))),x(e,q,(e=>a(75,p=e)));const S=JSON.parse(i.getItem("Locale")),N=Q();let j,C,L,E,F,{schema:D}=r,{recID:z}=r,{prevEventID:T=!1}=r,{prev:V=!1}=r,{taskId:A=!1}=r,{description:B=""}=r,{root:O=!1}=r,{readonly:M}=r,{isStandalone:W}=r,R={},Y={},G="form-"+D.class+Math.floor(9e3*Math.random()+1e3).toString();const J=O?"fEmbedded":"fTask",U=O?"sEmbedded":"sTask";let Z="CHF";let K,X,ee=0,ne=0,oe=0,re=0,ie=1,le=!z&&D.list&&1===D.list.length;const se={},ae=D.items.find((e=>"price"===e.name&&!e.properties?.hidden)),ce=D.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),de=D.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),ue=!!ae||!!de,me=D.list?.filter((e=>"array"===e.type))?.length>1||ue,fe=D.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,pe=!!fe,$e=D.list?.filter((e=>"array"===e.type))?.length>1||pe,he={},ge=D.result?.resultDef[0].button?.description;let ve,ye,be,we,ke=0,xe=0,Ie=[],_e=[],qe=[],Se={},Ne=new Map,je=D.class,Ce=D.id,Le=!1,Ee=-1!==window.location.search.indexOf("next=");const Fe=!p?.length||p.find((e=>e===Ce));["readonly","hidden","required"].map((e=>{D.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[o,r]=n.split(".");Ie.push({action:e,itemName:t.name,refObj:o,refName:r,op:t.properties[e].invert?"!":""})}))}));D.items.filter((e=>e.selection&&e.constraint)).map((e=>{_e.push({name:e.name,selection:e.selection,constraint:e.constraint})}));D.items.filter((e=>e.lookup)).forEach((e=>{qe.push({name:e.name,lookup:e.lookup})})),D.items.filter((e=>e.properties?.lookup)).forEach((e=>{qe.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const De=async e=>{if(e?.length)for(const n of e){if(!n.lookup)break;const{name:e}=n;if(R[e])break;const{domain:o,value:r}=n.lookup;if("user"===o&&r){const n={[r]:y.user},o=await t.getSectionView(e,n);if(o?.length){const[{_id:t}]=o;t&&a(4,R[e]=t,R)}}}},ze=async e=>{if(!D.input)return;if(!D.input.length)return;if(D.input.length<2)return;const n=!e.input.class[0].name&&e.input.class[0].selection;if(!n)return;const o=e.input.class[1].name,r=e.input.class[1].destination?.split(".")[0];if(!o||!r)return;const i=D.list?.find((e=>e.name===o));if(!i)return;const l=await t.getSchemaByClass(n),s=(await t.getTasks(l.id)).data;if(!s?.length)return;const c=[];for(const e of s){const t={};for(const n of i.item)n.name===r?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);c.push(t)}c.length&&a(4,R[o]=c,R)},Te=()=>{for(const e of D.items)e.properties?.value?.concatenation&&Ve(e)},Ve=async e=>{const t=e.properties.value.concatenation;let n="";for(const e of t)void 0!==e.constant&&(n+=e.constant),"year"===e.variable&&(n+=(new Date).getFullYear()),e.refItemNext&&(n+=await Be(e.refItemNext));a(4,R[e.name]=n,R)},Ae=async e=>{const t=Ie.filter((t=>t.refObj===e));if(t?.length){a(15,Se={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:i}=e;if(!n)break;let l,s,c=!o&&R[n];const d=R[n];d&&o&&(c=(await As(n,d))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==i&&"readonly"!==i||(i="required"===i?i:"disabled",setTimeout((()=>{l=`#${G} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(i,""),s&&!c&&s.removeAttribute(i)}),0)),"hidden"===i&&(l=`#${G} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(15,Se[t]="",Se))}}},Be=async e=>{const[n,o]=e.offset?.split(",")||[0,0],r=+e.base||0,i=+e.step||1;e.type;const l=e.refItem,s=await t.getLastId(D.class,l);if(!s?.length)return(r+i).toString().padStart(o,"0");const a=s[0][l];return((+a?.substring(n,n+o)||r)+i).toString().padStart(o,"0")},Oe=(e,t,n,o=!1)=>{const r=n||t.name,i=r.startsWith("_")?r:r.split("_")[0],l=e.find((e=>e.name===i));let s=t.value;if(!o&&l&&l.properties?.multi&&(s=R[r]),s&&l&&"dateRange"===l.type){let e=new Date(s);return"Invalid Date"==e?"":(e=`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(e).toISOString())}if(s&&l&&l.type.startsWith("date"))try{return _n(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if(l&&"boolean"===l.type&&(s=!!t.checked),l&&"number"===l.type){const e=Number("1.1").toLocaleString(S.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Me=()=>W?window.close():O?window.singleSpaNavigate("/"):N("back"),We=async(e,n)=>{if(D.input&&D.input.length>1){if(D.input[0]!==e)return;const{recursive:o}=be.input.class[1];if(n){const r=await t.getTaskOptions(`${e}:${n}`,Ce,o);a(4,R={...R,...r})}else{const e=D.input.slice(1);for(const t of e)a(4,R[t]=[],R)}}},Re=()=>{let e=0;if(ae){let t=1;ce&&(t=ie),e=re*t}de&&(e=re);let t=0;for(const e in se)t+=se[e];a(8,ee=t+e)},Pe=()=>{let e=0;for(const t in he)e+=he[t];a(14,ke=e+ +xe)};n.subscribe((async e=>{if(!e)return;if(!z)return;const n=await t.getSchema(e.eventId);if(!n)return;const o=D.list?.find((e=>e.name===n.class));if(!o)return;const r=await t.getTaskById(e.taskId);((e,t,n)=>{if(!Ls.get(e))return;const o=t;Es.set(o,n)})(r.event,r.docId,r.data);const i=await t.getTask(n.class,r.docId),l=R[n.class].filter((e=>e[n.class]==i._id));l?.length&&l.map((e=>{e[n.class]=r.docId})),a(4,R),a(62,C),a(61,j),a(1,D)})),H((()=>{Ls=new Map,Es=new Map,Fs=new Map,He()}));const He=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(G))&&++n<20;)await e(50);t&&(()=>{if(z)return;const e=new Set;for(const t of Ie)e.add(t.refObj||je);Array.from(e).forEach((e=>Ae(e)))})(),Qe()},Qe=()=>{setTimeout((()=>{Array.from(Ne).forEach((([e,t])=>{R[e]||a(4,R[e]=t._id,R)}))}),350)};var Ye;Ye=()=>{z&&function(e,t,n=t){e.set(n)}(m,$={[z]:{record:R,lists:Y}},$)},P().$$.on_destroy.push(Ye);const Ge=()=>{const e={};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,o]=t.name.split("."),r=D.list.find((e=>e.name===n));e[t.name]=Oe(r.item,t)}else e[t.name]=Oe(D.items,t,t.name.split("_")[0])})),D.list&&D.list.map((t=>{"array"===t.type&&Y[t.name]&&(e[t.name]=Y[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,o])=>("_delete"!==n&&(e[n]=Oe(t.item,{name:n,value:o,checked:o},"",!0)),e)),{}))),[]))}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const o=D.items.find((t=>t.name===e));o?.properties?.required&&!n&&(t=!1)})),t&&e},Je=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(1,D=e.schema),"recID"in e&&a(2,z=e.recID),"prevEventID"in e&&a(58,T=e.prevEventID),"prev"in e&&a(59,V=e.prev),"taskId"in e&&a(0,A=e.taskId),"description"in e&&a(56,B=e.description),"root"in e&&a(3,O=e.root),"readonly"in e&&a(57,M=e.readonly),"isStandalone"in e&&a(60,W=e.isStandalone)},e.$$.update=()=>{67108864&e.$$.dirty[1]&&a(21,d=M),2&e.$$.dirty[0]|1073741824&e.$$.dirty[1]|1&e.$$.dirty[2]&&C&&j&&D.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const o=j.items.find((t=>t.name===e));if(!o)return;if(t!==o.type)return;const r="_"+e;C[e]?a(4,R[e]=C[e],R):a(4,R[e]="",R),C[r]&&a(4,R[r]=C[r],R),a(13,le=!1)})),8&e.$$.dirty[0]|33554432&e.$$.dirty[1]&&a(22,f=O?B||"enablerr - Form":document.title)},[A,D,z,O,R,L,F,Z,ee,ne,oe,K,X,le,ke,Se,ve,ye,Le,we,Ee,d,f,b,w,k,I,_,q,G,J,U,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},me,$e,{name:"weekValue",properties:{decimals:1}},ge,Ce,Fe,async()=>{a(17,ye=await t.getTemplate(D.class));const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&a(7,Z=n[0].designation)}if(be=await t.getEvent(Ce),z||(a(16,ve=ye),De(be.input?.class),Te(),ze(be)),z){if($&&$[z]){const e=$[z].record;D.items.map((t=>{e[t.name]=Oe(D.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(4,R=e),D.list&&D.list.map((e=>{"array"===e.type&&$[z].lists[e.name]&&a(4,R[e.name]=$[z].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,o])=>("_delete"!==n&&(t[n]=Oe(e.item,{name:n,value:o,checked:o},"",!0)),t)),{}))),[]),R)}))}else a(4,R=await t.getTask(D.class,z));a(56,B=h(D,R)),a(18,Le=!!D.result?.resultDef),a(9,ne=R._tax?._amount),a(10,oe=100*R._tax?._rate||"")}if(T){a(57,M=!1),a(61,j=await t.getSchema(T)),"string"==typeof V&&a(62,C=await t.getTask(j.class,V));const e=D.items.find((e=>e.refClass===j.class));a(4,R[e.name]=C._id,R)}if($e&&(xe=R[fe]||0),be.trigger?.startOn&&!be.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(57,M=!0),g.role?.length&&D.authorization?.length){const e=D.authorization.some((e=>v?.find((t=>t===e.role&&"edit"===e.activity))));a(57,M||=!e)}if(a(5,L="report"===be.output.type),a(19,we=!!(await t.getUserSettings()).isAdmin),!we){const e=y.tenants.find((e=>e._id===y.tenant));e&&a(19,we=e.admin?.find((e=>e===y.user)))}return!0},async e=>{z||a(21,d=!0);const n=e.submitter?.className?.includes("close"),o={};if(Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((e=>{if(e.name)if(e.name.includes(".")){const[t,n]=e.name.split("."),r=D.list.find((e=>e.name===t));o[e.name]=Oe(r.item,e)}else o[e.name]=Oe(D.items,e)})),D.list&&D.list.map((e=>{"array"===e.type&&Y[e.name]&&(o[e.name]=Y[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,o])=>("_delete"!==n&&(t[n]=Oe(e.item,{name:n,value:o,checked:o},"",!0)),t)),{}))),[]))})),o._event=Ce,o._prevEventId=T,o._taskId=A,E){const e=E.record;for(const t in e)t.includes(".")&&delete e[t];e._event=E.event,e._taskId=E.taskId;const{id:n}=await t.saveData(E.class,e);o[E.class]||(o[E.class]=n)}const{id:r,task:i,tax:s,error:c}=await t.saveData(D.class,o);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(21,d=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(9,ne=s?._amount||0),a(10,oe=100*(s?._rate||0)||""),o._id=r;const u=await t.getTaskList(D.class,r);if(N("choose",{row:u}),n)return Me();if(!z){if(Ee){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Ce}/${Ce}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${Ce}/${i}/task`)}},()=>!L&&T?window.history.back():Me(),async({detail:e})=>{const{row:n}=e;let{eventId:o}=e;if((()=>{if(z)for(const e of Ie)e.refName||Ae(e.itemName)})(),z)return;if(await(async()=>{const e={...R};for(const n of D.items)if(n.refItem&&R[n.refItem]){const o=await t.getTask(n.refItem,R[n.refItem]);o&&(e[n.name]=o[n.name])}for(const n of D.list||[])if(n.refItem&&R[n.refItem]){const o=await t.getTask(n.refItem,R[n.refItem]),r=[];for(const e of o[n.name]){const t={};for(const o of n.item)e[o.name]&&(t[o.name]=e[o.name]);r.push(t)}e[n.name]=r}a(4,R=e)})(),o||=n._task?.event,(async(e,t)=>{if(!e)return;const n=be.output.class[0].name,o=qe.filter((e=>e.lookup===n));if(o?.length)for(const e of o){const{lookup:n,name:o}=e;let r="";if(t){let e=await As(n,t);e&&e[o]?.length&&(r=e[o][0][o])}a(4,R[o]=r,R)}})(o,n._id),o&&D.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const n=await t.getEvent(o);n.output.class[0]?.name===e.properties.lookup&&a(4,R[e.name]="",R)})),!n._task)return;const r=n._task.event,i=await t.getEvent(r);if(!be.output?.class?.length)return;const l=be.output.class[0]?.item.find((e=>(e.refClass||e.name)===i.output.class[0]?.name));(be.input?.class?.length&&be.input.class[0].name===i.output.class[0]?.name||l?.asInput)&&(a(61,j=await t.getSchema(r)),a(58,T=r),a(0,A=n._task._id),a(62,C=A?await t.getTask(j.class,n._task.docId):{}),We(j.class,n?._task?.docId))},async({detail:e})=>{if(a(6,F=e),"quantity"===e.itemName&&a(12,X=R.quantity),(async(e,t)=>{const n=_e.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(11,K=!1);for(const o of n){const{selection:n,constraint:r,name:i}=o;if(t)break;a(4,R[i]="",R),e===n&&a(11,K=r);const l=R[n];if(l&&e===r){let e=await As(n,l);const t=R[r];if(t?.length){const n=t[0].split(", ");e=e[r];let o="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(o=t[i])}));a(4,R[i]=o,R)}}}}})(e.itemName,e.oldValue===e.value),Ae(e.itemName),$e&&fe&&(e.itemName===fe&&(xe=+e.value),Pe()),ue&&me){if(e.itemName===ae?.name)re=e.value;else if(e.itemName===ce?.name)ie=e.value;else{if(e.itemName!==de?.name)return;re=e.value}Re()}},async({detail:e})=>{if(!(D.input?.length&&D.input.length>1))return;if(j?.class!==D.input[0])return;const{value:n,lookup:o,view:r}=e;if(!o)return;const[i]=o.split(":"),l=(await t.getSectionView(i,{[r]:{$in:n}})).map((e=>e._id));for(const e of D.input.slice(1)){a(4,R[e]=[],R);const n=await t.getSchemaByClass(e);n.id;let o=await t.getTasks(n.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[i]))),o?.length){const n=o.map((e=>e._id)),r=await t.getSectionView(e,{_id:{$in:n}});for(const t of r)t[e]=t._id;a(4,R[e]=r,R)}}},({detail:e})=>{Y[e.listName]=e.value,me&&(se[e.listName]=e.amountValue,Re()),$e&&(he[e.listName]=e.weeksValue||0,Pe())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const n=await t.getReportDoc(e)||{},{userReportId:o,type:r}=n;if(!o)return;const i="/api/userreport/"+o;if("ics"===r)return window.open(i,"_self","width=1 height=1");const l="/viewer/doc/index.html?file="+i+"&type="+r;window.open(l,"","popup=yes toolbar=no width=624 height=900")},e=>async()=>{const e=await t.getDocData(A);(async(e,t)=>{const n=window.screen.height,o=window.open("","_blank","width=800,height="+n+",location=no");await te(),o?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+e+"</textarea>")})(JSON.stringify(e,null,4),D.identity.designation)},async()=>{const e=Ge();if(!e)return;const n=be.result?.resultDef[0]?.addToReports;if(n){const o=e[n];if(o){const n={docId:o},r=(await t.getSectionView("_task",n))[0];e._taskId=r._id}}const{reportId:o,type:r}=await t.createReport(Ce,e);Je(o),setTimeout(Me,2e3)},async()=>{const e=Ge();if(!e)return;const n=await t.getReportData(Ce,e),o=window.screen.height,r=window.open("","_blank","width=800,height="+o+",location=no");await te(),r?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),r?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(n,null,4)+"</textarea>")},async({detail:{className:e,itemName:n,value:o}})=>{if(je!==o)return;if(Ne.has(e))return;if(!0!==o&&(o=(o=[].concat(o)).some((e=>e===je))),!o)return;const r={[n]:!0},i=await t.getSectionView(e,r);i?.length&&Ne.set(e,i[0])},({detail:e})=>{E=e},({detail:e})=>{setTimeout((()=>{a(4,R[e.itemName]=e.value,R)}),200)},()=>D.result.resultDef[0].button?.designation||"Dokument erstellen",B,M,T,V,W,j,C,function(e){ee=e,a(8,ee)},function(e){ne=e,a(9,ne)},function(e){ke=e,a(14,ke)},function(e){Ee=e,a(20,Ee)}]}class Ms extends ke{constructor(e){var t;super(),Yl.getElementById("svelte-9xiaib-style")||((t=j("style")).id="svelte-9xiaib-style",t.textContent="form.disabled.svelte-9xiaib input.svelte-9xiaib{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-9xiaib.svelte-9xiaib{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-9xiaib.svelte-9xiaib{min-width:30em}}.fEmbedded.svelte-9xiaib.svelte-9xiaib,.fTask.svelte-9xiaib.svelte-9xiaib{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-9xiaib.svelte-9xiaib{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-9xiaib.svelte-9xiaib{height:fit-content;max-height:70vh}.sTask.svelte-9xiaib.svelte-9xiaib{height:95%;display:inline-grid}.sTask.svelte-9xiaib .btn.svelte-9xiaib{display:initial !important}.form--buttons.svelte-9xiaib.svelte-9xiaib{display:flex;gap:1em;padding-top:0.75em}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}",_(Yl.head,t)),we(this,e,Os,Cs,k,{schema:1,recID:2,prevEventID:58,prev:59,taskId:0,description:56,root:3,readonly:57,isStandalone:60},[-1,-1,-1,-1,-1])}}function Ws(e){let t,n,o;function r(t){e[4](t)}let i={schema:e[5],recID:e[6]};return void 0!==e[0]&&(i.description=e[0]),t=new Ms({props:i}),J.push((()=>ge(t,"description",r))),t.$on("back",e[2]),{c(){ve(t.$$.fragment)},m(e,n){ye(t,e,n),o=!0},p(e,o){const r={};32&o&&(r.schema=e[5]),64&o&&(r.recID=e[6]),!n&&1&o&&(n=!0,r.description=e[0],oe((()=>n=!1))),t.$set(r)},i(e){o||(me(t.$$.fragment,e),o=!0)},o(e){fe(t.$$.fragment,e),o=!1},d(e){be(t,e)}}}function Rs(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[Ws,({prop:{schema:e,recID:t,eventID:n}})=>({5:e,6:t,7:n}),({prop:e})=>(e?32:0)|(e?64:0)|(e?128:0)]},$$scope:{ctx:e}}}),{c(){ve(t.$$.fragment)},m(e,o){ye(t,e,o),n=!0},p(e,[n]){const o={};1&n&&(o.description=e[0]),353&n&&(o.$$scope={dirty:n,ctx:e}),t.$set(o)},i(e){n||(me(t.$$.fragment,e),n=!0)},o(e){fe(t.$$.fragment,e),n=!1},d(e){be(t,e)}}}function Ps(e,n,o){let r,{refresh:i}=n;return e.$$set=e=>{"refresh"in e&&o(3,i=e.refresh)},[r,(e,n)=>t.getSchema(e).then((t=>({schema:t,recID:n,eventID:e,title:t.identity.designation}))),e=>{},i,function(e){r=e,o(0,r)}]}function Hs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qs,Ys,Gs=(Qs=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach((function(t){r(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==i(e))throw new Error("single-spa-svelte requires a configuration object");var t=o(o({},l),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var l={component:null,domElementGetter:null,props:{}};function s(e){return Promise.resolve()}function a(e,t,n){var r=Object.keys(l),i=Object.keys(e).reduce((function(t,n){return r.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var r=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?function(){return t.domElementGetter(t)}:e.domElementGetter?function(){return e.domElementGetter(t)}:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,n),l=r();t.instance=new e.component(o(o({},i),{},{target:l,props:Object.assign({},n,e.props)}))}))}function c(e,t){return Promise.resolve().then((function(){t.instance.$destroy?t.instance.$destroy():t.instance.destroy()}))}function d(e,t,n){return Promise.resolve().then((function(){t.instance.$set?t.instance.$set(n):t.instance.set(n)}))}},Qs(Ys={exports:{}},Ys.exports),Ys.exports);const Js=Hs(Gs)({component:class extends ke{constructor(e){super(),we(this,e,Ps,Rs,k,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:Us,mount:Zs,unmount:Ks}=Js;e({bootstrap:Us,mount:Zs,unmount:Ks});e("Form",Ms),e("List",It),e("Template",class extends ke{constructor(e){var t;super(),Sn.getElementById("svelte-1phofh5-style")||((t=j("style")).id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",_(Sn.head,t)),we(this,e,Mn,Bn,k,{schema:0,record:1})}})}}}));
1
+ System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],(function(e){"use strict";var t,n,i,o,r,l,s,a,c,d,u,m;return{setters:[function(e){t=e.Request,n=e.task_notification,i=e.currentRoles,o=e.TextArea,r=e.Storage,l=e.toasts,s=e.settings,a=e.Page},function(e){c=e.getAttractions,d=e.PopOver},function(e){u=e.user},function(e){m=e.taskClipboard}],execute:function(){e("version","0.2.577");const f=e("checkDate",((e,t)=>"string"!=typeof e||e.length<20||!(t=e.split(" · "))?e:t.map((e=>2===e.split("T").length&&3===e.split("T")[0].split("-").length?new Date(e).toLocaleDateString():e)).filter((e=>!!e)).join(" · "))),p=e=>{try{return new Date(e).toLocaleString()}catch{return e}},$=e=>e?"(ja)":"(nein)",h=(e,t)=>{const n={...t};return(e.display?.reduce(((t,i)=>{let[o,r]=i.split(".");if(e.list?.find((({name:e})=>e===o))&&r&&void 0!==n[o]){const e=`${o}_${r}`;n[e]=n[o][r],o=e}return t.find((e=>e===o))||t.push(o),t}),[]).map((e=>"boolean"==typeof n[e]?$(n[e]):f(n["_"+e]||n[e])))||e.items.map((e=>"object"===e.type?t["_"+e.name]:"list"===e.type?"":("boolean"==typeof t[e.name]&&$(t[e.name]),t[e.name])))).map((e=>e?.toString().split(" · ").filter((e=>!!e)).join(" · "))).filter((e=>!!e)).join(" • ")};function g(){}function v(e){return e()}function y(){return Object.create(null)}function b(e){e.forEach(v)}function w(e){return"function"==typeof e}function x(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function k(e,t,n){e.$$.on_destroy.push(function(e,...t){if(null==e)return g;const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}(t,n))}function I(e){return null==e?"":e}function _(e,t){e.appendChild(t)}function C(e,t,n){e.insertBefore(t,n||null)}function S(e){e.parentNode.removeChild(e)}function j(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function q(e){return document.createElement(e)}function N(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function E(e){return document.createTextNode(e)}function L(){return E(" ")}function F(){return E("")}function D(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function z(e){return function(t){return t.preventDefault(),e.call(this,t)}}function T(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function A(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function B(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function V(e,t){e.value=null==t?"":t}function O(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function M(e,t,n){e.classList[n?"add":"remove"](t)}let W;function P(e){W=e}function R(){if(!W)throw new Error("Function called outside component initialization");return W}function H(e){R().$$.on_mount.push(e)}function Q(e){R().$$.on_destroy.push(e)}function Y(){const e=R();return(t,n)=>{const i=e.$$.callbacks[t];if(i){const o=function(e,t){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!1,!1,t),n}(t,n);i.slice().forEach((t=>{t.call(e,o)}))}}}function G(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach((e=>e(t)))}const U=[],K=[],J=[],Z=[],X=Promise.resolve();let ee=!1;function te(){ee||(ee=!0,X.then(se))}function ne(){return te(),X}function ie(e){J.push(e)}function oe(e){Z.push(e)}let re=!1;const le=new Set;function se(){if(!re){re=!0;do{for(let e=0;e<U.length;e+=1){const t=U[e];P(t),ae(t.$$)}for(P(null),U.length=0;K.length;)K.pop()();for(let e=0;e<J.length;e+=1){const t=J[e];le.has(t)||(le.add(t),t())}J.length=0}while(U.length);for(;Z.length;)Z.pop()();ee=!1,re=!1,le.clear()}}function ae(e){if(null!==e.fragment){e.update(),b(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ie)}}const ce=new Set;let de;function ue(){de={r:0,c:[],p:de}}function me(){de.r||b(de.c),de=de.p}function fe(e,t){e&&e.i&&(ce.delete(e),e.i(t))}function pe(e,t,n,i){if(e&&e.o){if(ce.has(e))return;ce.add(e),de&&de.c.push((()=>{ce.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}}function $e(e,t){const n=t.token={};function i(e,i,o,r){if(t.token!==n)return;t.resolved=r;let l=t.ctx;void 0!==o&&(l=l.slice(),l[o]=r);const s=e&&(t.current=e)(l);let a=!1;t.block&&(t.blocks?t.blocks.forEach(((e,n)=>{n!==i&&e&&(ue(),pe(e,1,1,(()=>{t.blocks[n]===e&&(t.blocks[n]=null)})),me())})):t.block.d(1),s.c(),fe(s,1),s.m(t.mount(),t.anchor),a=!0),t.block=s,t.blocks&&(t.blocks[i]=s),a&&se()}if((o=e)&&"object"==typeof o&&"function"==typeof o.then){const n=R();if(e.then((e=>{P(n),i(t.then,1,t.value,e),P(null)}),(e=>{if(P(n),i(t.catch,2,t.error,e),P(null),!t.hasCatch)throw e})),t.current!==t.pending)return i(t.pending,0),!0}else{if(t.current!==t.then)return i(t.then,1,t.value,e),!0;t.resolved=e}var o}function he(e,t,n){const i=t.slice(),{resolved:o}=e;e.current===e.then&&(i[e.value]=o),e.current===e.catch&&(i[e.error]=o),e.block.p(i,n)}const ge="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function ve(e,t,n){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function ye(e){e&&e.c()}function be(e,t,n,i){const{fragment:o,on_mount:r,on_destroy:l,after_update:s}=e.$$;o&&o.m(t,n),i||ie((()=>{const t=r.map(v).filter(w);l?l.push(...t):b(t),e.$$.on_mount=[]})),s.forEach(ie)}function we(e,t){const n=e.$$;null!==n.fragment&&(b(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function xe(e,t,n,i,o,r,l=[-1]){const s=W;P(e);const a=e.$$={fragment:null,ctx:null,props:r,update:g,not_equal:o,bound:y(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:t.context||[]),callbacks:y(),dirty:l,skip_bound:!1};let c=!1;if(a.ctx=n?n(e,t.props||{},((t,n,...i)=>{const r=i.length?i[0]:n;return a.ctx&&o(a.ctx[t],a.ctx[t]=r)&&(!a.skip_bound&&a.bound[t]&&a.bound[t](r),c&&function(e,t){-1===e.$$.dirty[0]&&(U.push(e),te(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],a.update(),c=!0,b(a.before_update),a.fragment=!!i&&i(a.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);a.fragment&&a.fragment.l(e),e.forEach(S)}else a.fragment&&a.fragment.c();t.intro&&fe(e.$$.fragment),be(e,t.target,t.anchor,t.customElement),se()}P(s)}class ke{$destroy(){we(this,1),this.$destroy=g}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Ie(e){let t,n,i,o,r;return{c(){t=N("svg"),n=N("circle"),i=N("polyline"),o=N("line"),A(n,"cx","12"),A(n,"cy","12"),A(n,"r","10"),A(i,"points","8 12 12 16 16 12"),A(o,"x1","12"),A(o,"y1","8"),A(o,"x2","12"),A(o,"y2","16"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",r="feather feather-arrow-down-circle "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-arrow-down-circle "+e[2])&&A(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function _e(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ce extends ke{constructor(e){super(),xe(this,e,_e,Ie,x,{size:0,strokeWidth:1,class:2})}}function Se(e){let t,n,i,o;return{c(){t=N("svg"),n=N("path"),i=N("polyline"),A(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),A(i,"points","22 4 12 14.01 9 11.01"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",o="feather feather-check-circle "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-check-circle "+e[2])&&A(t,"class",o)},i:g,o:g,d(e){e&&S(t)}}}function je(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class qe extends ke{constructor(e){super(),xe(this,e,je,Se,x,{size:0,strokeWidth:1,class:2})}}function Ne(e){let t,n,i;return{c(){t=N("svg"),n=N("path"),A(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",i="feather feather-command "+e[2])},m(e,i){C(e,t,i),_(t,n)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&i!==(i="feather feather-command "+e[2])&&A(t,"class",i)},i:g,o:g,d(e){e&&S(t)}}}function Ee(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Le extends ke{constructor(e){super(),xe(this,e,Ee,Ne,x,{size:0,strokeWidth:1,class:2})}}function Fe(e){let t,n,i,o;return{c(){t=N("svg"),n=N("polyline"),i=N("path"),A(n,"points","9 10 4 15 9 20"),A(i,"d","M20 4v7a4 4 0 0 1-4 4H4"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",o="feather feather-corner-down-left "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-corner-down-left "+e[2])&&A(t,"class",o)},i:g,o:g,d(e){e&&S(t)}}}function De(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class ze extends ke{constructor(e){super(),xe(this,e,De,Fe,x,{size:0,strokeWidth:1,class:2})}}function Te(e){let t,n,i,o,r;return{c(){t=N("svg"),n=N("path"),i=N("line"),o=N("line"),A(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),A(i,"x1","18"),A(i,"y1","9"),A(i,"x2","12"),A(i,"y2","15"),A(o,"x1","12"),A(o,"y1","9"),A(o,"x2","18"),A(o,"y2","15"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",r="feather feather-delete "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-delete "+e[2])&&A(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Ae(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Be extends ke{constructor(e){super(),xe(this,e,Ae,Te,x,{size:0,strokeWidth:1,class:2})}}function Ve(e){let t,n,i,o,r;return{c(){t=N("svg"),n=N("path"),i=N("polyline"),o=N("line"),A(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),A(i,"points","15 3 21 3 21 9"),A(o,"x1","10"),A(o,"y1","14"),A(o,"x2","21"),A(o,"y2","3"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",r="feather feather-external-link "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-external-link "+e[2])&&A(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Oe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Me extends ke{constructor(e){super(),xe(this,e,Oe,Ve,x,{size:0,strokeWidth:1,class:2})}}function We(e){let t,n,i,o,r;return{c(){t=N("svg"),n=N("circle"),i=N("line"),o=N("path"),A(n,"cx","12"),A(n,"cy","12"),A(n,"r","10"),A(i,"x1","2"),A(i,"y1","12"),A(i,"x2","22"),A(i,"y2","12"),A(o,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",r="feather feather-globe "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-globe "+e[2])&&A(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Pe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Re extends ke{constructor(e){super(),xe(this,e,Pe,We,x,{size:0,strokeWidth:1,class:2})}}function He(e){let t,n,i,o;return{c(){t=N("svg"),n=N("path"),i=N("polyline"),A(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),A(i,"points","22,6 12,13 2,6"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",o="feather feather-mail "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-mail "+e[2])&&A(t,"class",o)},i:g,o:g,d(e){e&&S(t)}}}function Qe(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ye extends ke{constructor(e){super(),xe(this,e,Qe,He,x,{size:0,strokeWidth:1,class:2})}}function Ge(e){let t,n,i,o;return{c(){t=N("svg"),n=N("path"),i=N("circle"),A(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),A(i,"cx","12"),A(i,"cy","10"),A(i,"r","3"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",o="feather feather-map-pin "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-map-pin "+e[2])&&A(t,"class",o)},i:g,o:g,d(e){e&&S(t)}}}function Ue(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Ke extends ke{constructor(e){super(),xe(this,e,Ue,Ge,x,{size:0,strokeWidth:1,class:2})}}function Je(e){let t,n,i,o,r;return{c(){t=N("svg"),n=N("polyline"),i=N("line"),o=N("path"),A(n,"points","23 7 23 1 17 1"),A(i,"x1","16"),A(i,"y1","8"),A(i,"x2","23"),A(i,"y2","1"),A(o,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",r="feather feather-phone-outgoing "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-phone-outgoing "+e[2])&&A(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function Ze(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class Xe extends ke{constructor(e){super(),xe(this,e,Ze,Je,x,{size:0,strokeWidth:1,class:2})}}function et(e){let t,n,i,o,r;return{c(){t=N("svg"),n=N("polyline"),i=N("path"),o=N("rect"),A(n,"points","6 9 6 2 18 2 18 9"),A(i,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),A(o,"x","6"),A(o,"y","14"),A(o,"width","12"),A(o,"height","8"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",r="feather feather-printer "+e[2])},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&r!==(r="feather feather-printer "+e[2])&&A(t,"class",r)},i:g,o:g,d(e){e&&S(t)}}}function tt(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class nt extends ke{constructor(e){super(),xe(this,e,tt,et,x,{size:0,strokeWidth:1,class:2})}}function it(e){let t,n,i,o;return{c(){t=N("svg"),n=N("circle"),i=N("line"),A(n,"cx","11"),A(n,"cy","11"),A(n,"r","8"),A(i,"x1","21"),A(i,"y1","21"),A(i,"x2","16.65"),A(i,"y2","16.65"),A(t,"xmlns","http://www.w3.org/2000/svg"),A(t,"width",e[0]),A(t,"height",e[0]),A(t,"fill","none"),A(t,"viewBox","0 0 24 24"),A(t,"stroke","currentColor"),A(t,"stroke-width",e[1]),A(t,"stroke-linecap","round"),A(t,"stroke-linejoin","round"),A(t,"class",o="feather feather-search "+e[2])},m(e,o){C(e,t,o),_(t,n),_(t,i)},p(e,[n]){1&n&&A(t,"width",e[0]),1&n&&A(t,"height",e[0]),2&n&&A(t,"stroke-width",e[1]),4&n&&o!==(o="feather feather-search "+e[2])&&A(t,"class",o)},i:g,o:g,d(e){e&&S(t)}}}function ot(e,t,n){let{size:i="100%"}=t,{strokeWidth:o=2}=t,{class:r=""}=t;return"100%"!==i&&(i="x"===i.slice(-1)?i.slice(0,i.length-1)+"em":parseInt(i)+"px"),e.$$set=e=>{"size"in e&&n(0,i=e.size),"strokeWidth"in e&&n(1,o=e.strokeWidth),"class"in e&&n(2,r=e.class)},[i,o,r]}class rt extends ke{constructor(e){super(),xe(this,e,ot,it,x,{size:0,strokeWidth:1,class:2})}}const{document:lt}=ge;function st(e){e[33]=e[35].list,e[34]=e[35].items}function at(e,t,n){const i=e.slice();return i[36]=t[n],i}function ct(e,t,n){const i=e.slice();return i[39]=t[n],i}function dt(e,t,n){const i=e.slice();return i[39]=t[n],i}function ut(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function mt(e){let t,n,i,o,r,l;st(e);let s=e[33]?.length&&ft(e),a=e[34]?.length&&pt(e),c=e[33]?.length&&gt(e);return{c(){s&&s.c(),t=L(),n=q("div"),i=q("table"),a&&a.c(),o=L(),r=q("tbody"),c&&c.c(),A(i,"striped",""),A(i,"class","svelte-btngop"),A(n,"class","eList svelte-btngop")},m(e,d){s&&s.m(e,d),C(e,t,d),C(e,n,d),_(n,i),a&&a.m(i,null),_(i,o),_(i,r),c&&c.m(r,null),l=!0},p(e,n){st(e),e[33]?.length?s?(s.p(e,n),4&n[0]&&fe(s,1)):(s=ft(e),s.c(),fe(s,1),s.m(t.parentNode,t)):s&&(ue(),pe(s,1,1,(()=>{s=null})),me()),e[34]?.length?a?a.p(e,n):(a=pt(e),a.c(),a.m(i,o)):a&&(a.d(1),a=null),e[33]?.length?c?(c.p(e,n),4&n[0]&&fe(c,1)):(c=gt(e),c.c(),fe(c,1),c.m(r,null)):c&&(ue(),pe(c,1,1,(()=>{c=null})),me())},i(e){l||(fe(s),fe(c),l=!0)},o(e){pe(s),pe(c),l=!1},d(e){s&&s.d(e),e&&S(t),e&&S(n),a&&a.d(),c&&c.d()}}}function ft(e){let t,n,i,o,r,l,s,a,c,d;function u(t){e[25](t)}let m={id:e[8]};return void 0!==e[3]&&(m.value=e[3]),i=new e[6]({props:m}),K.push((()=>ve(i,"value",u))),i.$on("input",e[12]),s=new Be({props:{size:"18"}}),{c(){t=q("div"),n=E("Suchen: "),ye(i.$$.fragment),r=L(),l=q("span"),ye(s.$$.fragment),A(l,"class","feather pointer svelte-btngop"),O(t,"margin-bottom","1em"),O(t,"position","relative")},m(o,u){C(o,t,u),_(t,n),be(i,t,null),_(t,r),_(t,l),be(s,l,null),a=!0,c||(d=D(l,"click",e[15]),c=!0)},p(e,t){const n={};!o&&8&t[0]&&(o=!0,n.value=e[3],oe((()=>o=!1))),i.$set(n)},i(e){a||(fe(i.$$.fragment,e),fe(s.$$.fragment,e),a=!0)},o(e){pe(i.$$.fragment,e),pe(s.$$.fragment,e),a=!1},d(e){e&&S(t),we(i),we(s),c=!1,d()}}}function pt(e){let t,n,i,o=e[4]&&e[0]&&$t(),r=e[34],l=[];for(let t=0;t<r.length;t+=1)l[t]=ht(dt(e,r,t));return{c(){t=q("thead"),n=q("tr"),o&&o.c(),i=L();for(let e=0;e<l.length;e+=1)l[e].c();A(n,"class","svelte-btngop"),A(t,"class","svelte-btngop")},m(e,r){C(e,t,r),_(t,n),o&&o.m(n,null),_(n,i);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(e[4]&&e[0]?o||(o=$t(),o.c(),o.m(n,i)):o&&(o.d(1),o=null),2052&t[0]){let i;for(r=e[34],i=0;i<r.length;i+=1){const o=dt(e,r,i);l[i]?l[i].p(o,t):(l[i]=ht(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&S(t),o&&o.d(),j(l,e)}}}function $t(e){let t;return{c(){t=q("th"),A(t,"class","svelte-btngop")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function ht(e){let t,n,i=e[39]?.designation+"";return{c(){t=q("th"),n=E(i),A(t,"class","svelte-btngop")},m(e,i){C(e,t,i),_(t,n)},p(e,t){4&t[0]&&i!==(i=e[39]?.designation+"")&&B(n,i)},d(e){e&&S(t)}}}function gt(e){let t,n,i=e[33],o=[];for(let t=0;t<i.length;t+=1)o[t]=wt(at(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(28191&n[0]){let l;for(i=e[33],l=0;l<i.length;l+=1){const r=at(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=wt(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}function vt(e){let t,n,i,o,r=e[4]&&e[0]&&yt(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=bt(ct(e,l,t));return{c(){t=q("tr"),r&&r.c(),n=L();for(let e=0;e<s.length;e+=1)s[e].c();i=L(),A(t,"class","pointer svelte-btngop"),M(t,"active",e[36]._id===e[1])},m(e,l){C(e,t,l),r&&r.m(t,null),_(t,n);for(let e=0;e<s.length;e+=1)s[e].m(t,null);_(t,i),o=!0},p(e,o){if(e[4]&&e[0]?r?(r.p(e,o),17&o[0]&&fe(r,1)):(r=yt(e),r.c(),fe(r,1),r.m(t,n)):r&&(ue(),pe(r,1,1,(()=>{r=null})),me()),3588&o[0]){let n;for(l=e[34],n=0;n<l.length;n+=1){const r=ct(e,l,n);s[n]?s[n].p(r,o):(s[n]=bt(r),s[n].c(),s[n].m(t,i))}for(;n<s.length;n+=1)s[n].d(1);s.length=l.length}2054&o[0]&&M(t,"active",e[36]._id===e[1])},i(e){o||(fe(r),o=!0)},o(e){pe(r),o=!1},d(e){e&&S(t),r&&r.d(),j(s,e)}}}function yt(e){let t,n,i,o,r;return i=new Me({props:{size:"18"}}),{c(){t=q("td"),n=q("a"),ye(i.$$.fragment),A(n,"href",o=e[14](e[36])),A(n,"target","_blank"),A(t,"class","editRow svelte-btngop")},m(e,o){C(e,t,o),_(t,n),be(i,n,null),r=!0},p(e,t){(!r||4&t[0]&&o!==(o=e[14](e[36])))&&A(n,"href",o)},i(e){r||(fe(i.$$.fragment,e),r=!0)},o(e){pe(i.$$.fragment,e),r=!1},d(e){e&&S(t),we(i)}}}function bt(e){let t,n,i,o,r=e[9](e[36],e[39])+"";return{c(){t=q("td"),n=E(r),A(t,"class","svelte-btngop")},m(r,l){C(r,t,l),_(t,n),i||(o=D(t,"click",T((function(){w(e[10](e[36]))&&e[10](e[36]).apply(this,arguments)}))),i=!0)},p(t,i){e=t,4&i[0]&&r!==(r=e[9](e[36],e[39])+"")&&B(n,r)},d(e){e&&S(t),i=!1,o()}}}function wt(e){let t,n,i=e[13](e[36],e[34],e[3]),o=i&&vt(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){12&n[0]&&(i=e[13](e[36],e[34],e[3])),i?o?(o.p(e,n),12&n[0]&&fe(o,1)):(o=vt(e),o.c(),fe(o,1),o.m(t.parentNode,t)):o&&(ue(),pe(o,1,1,(()=>{o=null})),me())},i(e){n||(fe(o),n=!0)},o(e){pe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function xt(e){let t,n;return t=new e[5]({}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p:g,i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function kt(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:xt,then:mt,catch:ut,value:35,blocks:[,,,]};return $e(n=e[2]&&e[11](),o),{c(){t=F(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,4&i[0]&&n!==(n=e[2]&&e[11]())&&$e(n,o)||he(o,e,i)},i(e){i||(fe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){pe(o.blocks[e])}i=!1},d(e){e&&S(t),o.block.d(e),o.token=null,o=null}}}function It(e,i,o){let r;const l=Y(),{Loading:s,TextField:a}=c,{currentTasks:d}=u;k(e,d,(e=>o(26,r=e)));let m,{inputList:p}=i,{eventId:h}=i,{prevEventId:g}=i,{className:v}=i,{rowId:y}=i,{filterForReady:b=!1}=i,{refStatus:w}=i,{showEdit:x=!1}=i,{praefix:I=""}=i,{selectionFields:_=!1}=i,{deList:C}=i,S=!0,j="",q=v+Math.floor(9e3*Math.random()+1e3).toString()+"search";const N=(e,t)=>{if(!t)return;let n=e[t.name];if(Array.isArray(n)){const e=e=>e.replaceAll(" ",String.fromCharCode(160));n=n.map(e),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||n||"")},E=t.getSchemaByClass(v),L=async(e,n)=>{if(w)return o(16,w=[].concat(w)),e.filter((e=>!!w.find((t=>e._task.status===t))));if("Information"===n.state.task)return e;if(g){const n=await t.getEvent(g);if("report"===n?.output?.type)return e;if(n?.input?.class?.length&&n.input.class[0].name===v)return"Information"===n.state.task?e.filter((e=>"Closed"!==e._task.status)):e.filter((e=>"Ready"===e._task.status))}return e.filter((e=>"WaitingForApproval"===e._task.status||"Ready"===e._task.status||"Closing"===e._task.status))},F=async(e,t,n,i)=>{const{value:o,refClass:r}=i,[l,s]=n.split("."),a=o?.get(I),c=a&&await Js(l,a);if(!c)return e;const d=c[s];return d?.length?d.map((n=>{let i=e?.find((e=>e._id===n[t]))||{};i={...i};for(const e in i)n[e]&&(i[e]=n[e]);for(const e in n)n[e]&&(i[e]=n[e]);return Us(r+i._id.toString(),i),i})):e};H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(q)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await E;e.eventId===t.id&&(Zs(t.class,e.eventId),o(2,S=!o(2,S=!1)))}));return e.$$set=e=>{"inputList"in e&&o(17,p=e.inputList),"eventId"in e&&o(18,h=e.eventId),"prevEventId"in e&&o(19,g=e.prevEventId),"className"in e&&o(20,v=e.className),"rowId"in e&&o(1,y=e.rowId),"filterForReady"in e&&o(21,b=e.filterForReady),"refStatus"in e&&o(16,w=e.refStatus),"showEdit"in e&&o(0,x=e.showEdit),"praefix"in e&&o(22,I=e.praefix),"selectionFields"in e&&o(23,_=e.selectionFields),"deList"in e&&o(24,C=e.deList)},[x,y,S,j,m,s,a,d,q,N,e=>()=>l("choose",{row:e}),async()=>{const e=await E;let n;o(4,m=(e=>!r?.length||!!r.find((t=>t===e)))(e.id));let i,s=n=p||await Ys(e.class,e.id),a=!1,c="";const d=_&&_?.find((t=>e.class===t.refClass.split(":")[0])),u=d?.value?.get&&d.value.get(I);if(u){const[n,o]=d.refClass.split(":");e.class===n&&(s=await F(s,n,o,d)),a=d.parentClass?.find((e=>"quantity"===e.name)),c=d.className,i=await t.getCountedSection(c,o.split(".")[0],u,n,"quantity")}o(0,x&&=!d),d||!b&&!w||(s=await L(s,e));let f=[],{display:$}=e;return $&&$.length?$.map((t=>{const[n,i]=t.split(".");let o=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));o&&(o={...o},o.name=`${n}_${i}`,s=s.map((e=>(e[n]&&(e[o.name]=e["_"+n]?e["_"+n][i]:e[n][i]),e)))),o||(o=e.items.find((e=>e.name===n))),f.find((e=>e?.name===n))||f.push(o)})):f=e.items,!x&&a?(f=f.concat([{name:"quantity",designation:"h-Soll"},{name:"ist",designation:"h-Ist"}]),s=s.map((e=>{const t=i.find((t=>t._id===e._id));return t&&(e.ist=t.quantity.$numberDecimal),e})),i.map((e=>{if(!s.find((t=>t._id===e._id))){const t=n.find((t=>t._id===e._id));t.ist=e.quantity.$numberDecimal,s.push(t)}})),l("init",s)):C&&(s=s.filter((e=>!C.find((t=>t._id===e._id))))),{list:s,items:f}},({detail:{value:e}})=>{o(3,j=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(N(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},e=>`/task/${e._task.event}/${e._task._id}/task?view=standalone`,()=>{o(3,j="")},w,p,h,g,v,b,I,_,C,function(e){j=e,o(3,j)}]}class _t extends ke{constructor(e){var t;super(),lt.getElementById("svelte-btngop-style")||((t=q("style")).id="svelte-btngop-style",t.textContent=".feather.svelte-btngop.svelte-btngop{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-btngop.svelte-btngop{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-btngop .editRow.svelte-btngop{width:1em}.eList.svelte-btngop table.svelte-btngop{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-btngop table thead.svelte-btngop{position:sticky;top:0;background:#326173;color:white}.eList.svelte-btngop table thead tr.svelte-btngop{height:2.3em}.eList.svelte-btngop table tbody tr.svelte-btngop{height:2.75em !important}th.svelte-btngop.svelte-btngop,td.svelte-btngop.svelte-btngop{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-btngop.svelte-btngop:hover{background-color:#DAE1E5}tr.active.svelte-btngop.svelte-btngop{color:#326173;background-color:#fcebd5}",_(lt.head,t)),xe(this,e,It,kt,x,{inputList:17,eventId:18,prevEventId:19,className:20,rowId:1,filterForReady:21,refStatus:16,showEdit:0,praefix:22,selectionFields:23,deList:24},[-1,-1])}}function Ct(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function St(e){let t,n,i=e[39]&&jt(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[39]?i?(i.p(e,n),8&n[0]&&fe(i,1)):(i=jt(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function jt(e){let t,n;return t=new e[19]({props:{title:e[15]?"Auswahl":e[0],class:"eList "+(e[13]?"form":""),$$slots:{default:[Bt]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};32769&n[0]&&(i.title=e[15]?"Auswahl":e[0]),8192&n[0]&&(i.class="eList "+(e[13]?"form":"")),524286&n[0]|512&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function qt(e){let t,n;return t=new ea({props:{schema:e[2],recID:e[1],readonly:e[14]}}),t.$on("choose",(function(){w(e[28](e[39]))&&e[28](e[39]).apply(this,arguments)})),t.$on("back",e[25]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(n,i){e=n;const o={};4&i[0]&&(o.schema=e[2]),2&i[0]&&(o.recID=e[1]),16384&i[0]&&(o.readonly=e[14]),t.$set(o)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Nt(e){let t,n,i,o,r,l,s;t=new e[20]({props:{text:e[15]?"Zusätzliche Auswahl":""}});const a=[Lt,Et],c=[];function d(e,t){return e[15]?0:1}return i=d(e),o=c[i]=a[i](e),l=new _t({props:{eventId:e[2].id,className:e[2].class,prevEventId:e[11],filterForReady:e[4],refStatus:e[5],praefix:e[6],selectionFields:e[7],rowId:e[1],deList:e[9],showEdit:e[8]}}),l.$on("edit",e[29]),l.$on("choose",e[32]),l.$on("init",e[30]),{c(){ye(t.$$.fragment),n=L(),o.c(),r=L(),ye(l.$$.fragment)},m(e,o){be(t,e,o),C(e,n,o),c[i].m(e,o),C(e,r,o),be(l,e,o),s=!0},p(e,n){const s={};32768&n[0]&&(s.text=e[15]?"Zusätzliche Auswahl":""),t.$set(s);let u=i;i=d(e),i===u?c[i].p(e,n):(ue(),pe(c[u],1,1,(()=>{c[u]=null})),me(),o=c[i],o?o.p(e,n):(o=c[i]=a[i](e),o.c()),fe(o,1),o.m(r.parentNode,r));const m={};4&n[0]&&(m.eventId=e[2].id),4&n[0]&&(m.className=e[2].class),2048&n[0]&&(m.prevEventId=e[11]),16&n[0]&&(m.filterForReady=e[4]),32&n[0]&&(m.refStatus=e[5]),64&n[0]&&(m.praefix=e[6]),128&n[0]&&(m.selectionFields=e[7]),2&n[0]&&(m.rowId=e[1]),512&n[0]&&(m.deList=e[9]),256&n[0]&&(m.showEdit=e[8]),l.$set(m)},i(e){s||(fe(t.$$.fragment,e),fe(o),fe(l.$$.fragment,e),s=!0)},o(e){pe(t.$$.fragment,e),pe(o),pe(l.$$.fragment,e),s=!1},d(e){we(t,e),e&&S(n),c[i].d(e),e&&S(r),we(l,e)}}}function Et(e){let t,n,i,o;n=new e[21]({props:{outline:!0,$$slots:{default:[Ft]},$$scope:{ctx:e}}}),n.$on("click",e[26]);let r=e[23]&&e[10]&&Dt(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),r&&r.c(),A(t,"class","form--buttons svelte-jb5mrh")},m(e,l){C(e,t,l),be(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};512&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[23]&&e[10]?r?(r.p(e,i),1024&i[0]&&fe(r,1)):(r=Dt(e),r.c(),fe(r,1),r.m(t,null)):r&&(ue(),pe(r,1,1,(()=>{r=null})),me())},i(e){o||(fe(n.$$.fragment,e),fe(r),o=!0)},o(e){pe(n.$$.fragment,e),pe(r),o=!1},d(e){e&&S(t),we(n),r&&r.d()}}}function Lt(e){let t,n,i,o,r,l,s=e[18]&&Tt(e);return i=new e[21]({props:{outline:!0,$$slots:{default:[At]},$$scope:{ctx:e}}}),i.$on("click",e[26]),r=new e[20]({props:{text:"Liste aus "+e[12]}}),{c(){s&&s.c(),t=L(),n=q("div"),ye(i.$$.fragment),o=L(),ye(r.$$.fragment),A(n,"class","form--buttons svelte-jb5mrh")},m(e,a){s&&s.m(e,a),C(e,t,a),C(e,n,a),be(i,n,null),C(e,o,a),be(r,e,a),l=!0},p(e,n){e[18]?s?(s.p(e,n),262144&n[0]&&fe(s,1)):(s=Tt(e),s.c(),fe(s,1),s.m(t.parentNode,t)):s&&(ue(),pe(s,1,1,(()=>{s=null})),me());const o={};512&n[1]&&(o.$$scope={dirty:n,ctx:e}),i.$set(o);const l={};4096&n[0]&&(l.text="Liste aus "+e[12]),r.$set(l)},i(e){l||(fe(s),fe(i.$$.fragment,e),fe(r.$$.fragment,e),l=!0)},o(e){pe(s),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!1},d(e){s&&s.d(e),e&&S(t),e&&S(n),we(i),e&&S(o),we(r,e)}}}function Ft(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Dt(e){let t,n;return t=new e[21]({props:{filled:!0,$$slots:{default:[zt]},$$scope:{ctx:e}}}),t.$on("click",e[27]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};512&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function zt(e){let t;return{c(){t=E("Neu")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Tt(e){let t,n;return t=new El({props:{item:e[16],record:{_id:"",[e[16].name]:""},noForm:"true",classId:"sel_"+e[16].name,eventId:e[17],required:!1,hidden:!1,readonly:!1,deList:e[18]}}),t.$on("notify",e[31]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};65536&n[0]&&(i.item=e[16]),65536&n[0]&&(i.record={_id:"",[e[16].name]:""}),65536&n[0]&&(i.classId="sel_"+e[16].name),131072&n[0]&&(i.eventId=e[17]),262144&n[0]&&(i.deList=e[18]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function At(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Bt(e){let t,n,i,o;const r=[Nt,qt],l=[];function s(e,t){return e[39].length&&!e[13]?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(ue(),pe(l[a],1,1,(()=>{l[a]=null})),me(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),fe(n,1),n.m(i.parentNode,i))},i(e){o||(fe(n),o=!0)},o(e){pe(n),o=!1},d(e){l[t].d(e),e&&S(i)}}}function Vt(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Ot(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Vt,then:St,catch:Ct,value:39,blocks:[,,,]};return $e(n=e[24](e[3]),o),{c(){t=F(),o.block.c()},m(e,n){C(e,t,n),o.block.m(e,o.anchor=n),o.mount=()=>t.parentNode,o.anchor=t,i=!0},p(t,i){e=t,o.ctx=e,8&i[0]&&n!==(n=e[24](e[3]))&&$e(n,o)||he(o,e,i)},i(e){i||(fe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){pe(o.blocks[e])}i=!1},d(e){e&&S(t),o.block.d(e),o.token=null,o=null}}}function Mt(e,n,i){let o;const{Dialog:r,Divider:l,Button:s}=c,a=Y(),{currentTasks:d}=u;k(e,d,(e=>i(35,o=e)));let{title:m}=n,{schema:f}=n,{recID:p}=n,{isOpening:$=!0}=n,{filterForReady:h=!1}=n,{refStatus:g}=n,{praefix:v=""}=n,{selectionFields:y=!1}=n,{showEdit:b=!0}=n,{deList:w}=n,{newAllowed:x=!0}=n,{prevEventId:I}=n,_=f.id;f.class;let C,S,j,q,N,E,L,F="",D=!1;m??=f.identity.designation;const z=!o?.length||o.find((e=>e===_));return e.$$set=e=>{"title"in e&&i(0,m=e.title),"schema"in e&&i(2,f=e.schema),"recID"in e&&i(1,p=e.recID),"isOpening"in e&&i(3,$=e.isOpening),"filterForReady"in e&&i(4,h=e.filterForReady),"refStatus"in e&&i(5,g=e.refStatus),"praefix"in e&&i(6,v=e.praefix),"selectionFields"in e&&i(7,y=e.selectionFields),"showEdit"in e&&i(8,b=e.showEdit),"deList"in e&&i(9,w=e.deList),"newAllowed"in e&&i(10,x=e.newAllowed),"prevEventId"in e&&i(11,I=e.prevEventId)},[m,p,f,$,h,g,v,y,b,w,x,I,F,D,C,j,N,E,L,r,l,s,d,z,async e=>{if(!e)return!1;const n=await Ys(f.class,f.id);if(S=y&&y?.find((e=>f.class===e.refClass.split(":")[0])),i(15,j=S?.value?.get&&S.value.get(v)),j){q=S.refClass;const[e,n]=q.split(":"),[o]=n.split(".");i(16,N=S.parentClass.find((t=>t.name===e)));const r=await t.getSchemaByClass(N.refClass);i(17,E=r.id),i(12,F=S.parentClass.find((e=>e.name===o)).designation)}return n},()=>{i(13,D=!1),p||a("back"),b||a("back")},()=>{i(13,D=!1),a("back")},()=>{i(1,p=!1),i(14,C=!1),i(13,D=!0)},e=>({detail:{row:e}})=>{let t=f.display;t&&t.length&&t.map((t=>{const[n,i]=t.split(".");let o=f.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));if(o){e[`${n}_${i}`]=e[n][i]}})),a("choose",{row:e})},({detail:e})=>{i(14,C=!!e._task.visum||"Closed"===e._task.status),i(1,p=e._docId),i(13,D=!0)},({detail:e})=>{j&&i(18,L=e)},({detail:e})=>{if(!e.value)return;const t={_id:e.value};a("choose",{row:t})},function(t){G(e,t)}]}class Wt extends ke{constructor(e){var t;super(),document.getElementById("svelte-jb5mrh-style")||((t=q("style")).id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",_(document.head,t)),xe(this,e,Mt,Ot,x,{title:0,schema:2,recID:1,isOpening:3,filterForReady:4,refStatus:5,praefix:6,selectionFields:7,showEdit:8,deList:9,newAllowed:10,prevEventId:11},[-1,-1])}}const{document:Pt}=ge;function Rt(e){e[27]=e[29].list,e[28]=e[29].items}function Ht(e,t,n){const i=e.slice();return i[30]=t[n],i}function Qt(e,t,n){const i=e.slice();return i[33]=t[n],i}function Yt(e,t,n){const i=e.slice();return i[33]=t[n],i}function Gt(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Ut(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[24](t)}Rt(e),n=new e[7]({props:{outline:!0,$$slots:{default:[Kt]},$$scope:{ctx:e}}}),n.$on("click",e[23]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),K.push((()=>ve(l,"value",y))),l.$on("input",e[12]),d=new Be({props:{size:"18"}});let w=e[28]?.length&&function(e){let t,n,i,o,r=e[28],l=[];for(let t=0;t<r.length;t+=1)l[t]=Jt(Yt(e,r,t));return{c(){t=q("thead"),n=q("tr"),i=q("th"),o=L();for(let e=0;e<l.length;e+=1)l[e].c();A(i,"class","svelte-14hcfjl"),A(n,"class","svelte-14hcfjl"),A(t,"class","svelte-14hcfjl")},m(e,r){C(e,t,r),_(t,n),_(n,i),_(n,o);for(let e=0;e<l.length;e+=1)l[e].m(n,null)},p(e,t){if(2048&t[0]){let i;for(r=e[28],i=0;i<r.length;i+=1){const o=Yt(e,r,i);l[i]?l[i].p(o,t):(l[i]=Jt(o),l[i].c(),l[i].m(n,null))}for(;i<l.length;i+=1)l[i].d(1);l.length=r.length}},d(e){e&&S(t),j(l,e)}}}(e),x=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=en(Ht(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(44547&n[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const r=Ht(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=en(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),o=q("div"),r=E("Suchen: "),ye(l.$$.fragment),a=L(),c=q("span"),ye(d.$$.fragment),u=L(),m=q("div"),f=q("table"),w&&w.c(),p=L(),$=q("tbody"),x&&x.c(),A(t,"class","form--buttons svelte-14hcfjl"),A(c,"class","feather pointer svelte-14hcfjl"),O(o,"margin-bottom","1em"),O(o,"position","relative"),A(f,"striped",""),A(f,"class","svelte-14hcfjl"),A(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),be(n,t,null),C(s,i,y),C(s,o,y),_(o,r),be(l,o,null),_(o,a),_(o,c),be(d,c,null),C(s,u,y),C(s,m,y),_(m,f),w&&w.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=D(c,"click",e[14]),g=!0)},p(e,t){Rt(e);const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],oe((()=>s=!1))),l.$set(o),e[28]?.length&&w.p(e,t),e[27]?.length&&x.p(e,t)},i(e){h||(fe(n.$$.fragment,e),fe(l.$$.fragment,e),fe(d.$$.fragment,e),fe(x),h=!0)},o(e){pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),pe(x),h=!1},d(e){e&&S(t),we(n),e&&S(i),e&&S(o),we(l),we(d),e&&S(u),e&&S(m),w&&w.d(),x&&x.d(),g=!1,v()}}}function Kt(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Jt(e){let t,n,i=e[33]?.designation+"";return{c(){t=q("th"),n=E(i),A(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:g,d(e){e&&S(t)}}}function Zt(e){let t,n,i,o,r,l,s,a;i=new Me({props:{size:"18"}});let c=e[28],d=[];for(let t=0;t<c.length;t+=1)d[t]=Xt(Qt(e,c,t));return{c(){t=q("tr"),n=q("td"),ye(i.$$.fragment),o=L();for(let e=0;e<d.length;e+=1)d[e].c();r=L(),A(n,"class","editRow svelte-14hcfjl"),A(t,"class","pointer svelte-14hcfjl"),M(t,"active",e[30]._id===e[0])},m(c,u){C(c,t,u),_(t,n),be(i,n,null),_(t,o);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,r),l=!0,s||(a=D(n,"click",e[15](e[30])),s=!0)},p(n,i){if(e=n,3584&i[0]){let n;for(c=e[28],n=0;n<c.length;n+=1){const o=Qt(e,c,n);d[n]?d[n].p(o,i):(d[n]=Xt(o),d[n].c(),d[n].m(t,r))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}2049&i[0]&&M(t,"active",e[30]._id===e[0])},i(e){l||(fe(i.$$.fragment,e),l=!0)},o(e){pe(i.$$.fragment,e),l=!1},d(e){e&&S(t),we(i),j(d,e),s=!1,a()}}}function Xt(e){let t,n,i,o,r=e[9](e[30],e[33])+"";return{c(){t=q("td"),n=E(r),A(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=D(t,"click",T(e[10](e[30]))),i=!0)},p(t,n){e=t},d(e){e&&S(t),i=!1,o()}}}function en(e){let t,n,i=e[13](e[30],e[28],e[1]),o=i&&Zt(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){2&n[0]&&(i=e[13](e[30],e[28],e[1])),i?o?(o.p(e,n),2&n[0]&&fe(o,1)):(o=Zt(e),o.c(),fe(o,1),o.m(t.parentNode,t)):o&&(ue(),pe(o,1,1,(()=>{o=null})),me())},i(e){n||(fe(o),n=!0)},o(e){pe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function tn(e){let t,n;return t=new e[5]({}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p:g,i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function nn(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:tn,then:Ut,catch:Gt,value:29,blocks:[,,,]};return $e(e[11](),r),{c(){ye(t.$$.fragment),n=L(),i=F(),r.block.c()},m(e,l){be(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){he(r,e=t,n)},i(e){o||(fe(t.$$.fragment,e),fe(r.block),o=!0)},o(e){pe(t.$$.fragment,e);for(let e=0;e<3;e+=1){pe(r.blocks[e])}o=!1},d(e){we(t,e),e&&S(n),e&&S(i),r.block.d(e),r.token=null,r=null}}}function on(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[nn]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};3&n[0]|128&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function rn(e,i,o){const r=Y(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=i,{classId:p}=i,{className:h}=i,{rowId:g}=i,{viewName:v}=i,{viewValue:y}=i,{recordId:b}=i,{filter:w}=i,x="",k=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass(h);H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(k)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Zs(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(16,m=e.item),"classId"in e&&o(17,p=e.classId),"className"in e&&o(18,h=e.className),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(19,v=e.viewName),"viewValue"in e&&o(20,y=e.viewValue),"recordId"in e&&o(21,b=e.recordId),"filter"in e&&o(22,w=e.filter)},[g,x,r,l,s,a,d,u,k,I,e=>()=>r("choose",{row:e}),async()=>{const e=await _;let n=[];if(m.lookup){const e="."+p+"#"+m.lookup,i=document.querySelector(e),o=i?.value||b;if(o){const e=await t.getTask(m.lookup,o);if(e){const i=e[m.name]?.map((e=>e[m.name]));i&&(n=await t.getSectionView(m.name,{_id:{$in:i}},!0))}}}else{const i="."+p+"#"+v.split(":")[0],o=document.querySelector(i);let r={[v]:o?.value||b};if(m.refItem){const e="."+p+"#"+m.refItem;try{const t=document.querySelector(e);if(t){const e={$or:[{[m.refItem]:t.value},{[m.refItem]:{$exists:!0,$eq:""}}]};r={...r,...e}}}catch{}}r[v]&&(n=await t.getSectionView(e.class,r,!0)),w&&(n=n.filter((e=>e._id!=w)))}let i=[],o=e.display;return o&&o.length?o.map((t=>{const[o,r]=t.split(".");let l=e.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));l&&(l={...l},l.name=`${o}_${r}`,n=n.map((e=>(e[o]&&(e[l.name]=e["_"+o]?e["_"+o][r]:e[o][r]),e)))),l||(l=e.items.find((e=>e.name===o))),i.find((e=>e?.name===o))||i.push(l)})):i=e.items,{list:n,items:i}},({detail:{value:e}})=>{o(1,x=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,x="")},e=>async()=>{const n=await t.getTaskByDocId(e._id),i=`/task/${n.event}/${n._id}/task?view=standalone`;window.open(i)},m,p,h,v,y,b,w,()=>r("back"),function(e){x=e,o(1,x)}]}class ln extends ke{constructor(e){var t;super(),Pt.getElementById("svelte-14hcfjl-style")||((t=q("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(Pt.head,t)),xe(this,e,rn,on,x,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22},[-1,-1])}}const{document:sn}=ge;function an(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function cn(e){let t,n,i=e[51]&&function(e){let t,n,i,r,l,s,a,c,d,u,m,f,p,$,h;n=new o({props:{class:"full-width",id:e[24],value:e[2],rows:"1",required:e[1],disabled:e[3],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"}}),n.$on("click",e[28]()),n.$on("onFocus",e[28](e[24]));const g=[un,dn],v=[];function y(e,t){return!e[3]||e[14]?0:e[19]&&e[0]?1:-1}~(r=y(e))&&(l=v[r]=g[r](e));let b=(!e[3]||e[14])&&mn(e);function w(t){e[39](t)}let x={class:"tModal",noClickaway:!0,$$slots:{default:[hn]},$$scope:{ctx:e}};void 0!==e[16]&&(x.open=e[16]);m=new e[23]({props:x}),K.push((()=>ve(m,"open",w)));let k=e[17]&&gn(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),l&&l.c(),s=L(),a=q("input"),d=L(),b&&b.c(),u=L(),ye(m.$$.fragment),p=L(),k&&k.c(),$=F(),A(a,"class",c=I(e[7]||e[8])+" svelte-jox15l"),A(a,"id",e[5]),A(a,"name",e[5]),a.value=e[0],a.hidden=!0,O(t,"position","relative")},m(e,o){C(e,t,o),be(n,t,null),_(t,i),~r&&v[r].m(t,null),_(t,s),_(t,a),_(t,d),b&&b.m(t,null),C(e,u,o),be(m,e,o),C(e,p,o),k&&k.m(e,o),C(e,$,o),h=!0},p(e,i){const o={};4&i[0]&&(o.value=e[2]),2&i[0]&&(o.required=e[1]),8&i[0]&&(o.disabled=e[3]),n.$set(o);let d=r;r=y(e),r===d?~r&&v[r].p(e,i):(l&&(ue(),pe(v[d],1,1,(()=>{v[d]=null})),me()),~r?(l=v[r],l?l.p(e,i):(l=v[r]=g[r](e),l.c()),fe(l,1),l.m(t,s)):l=null),(!h||384&i[0]&&c!==(c=I(e[7]||e[8])+" svelte-jox15l"))&&A(a,"class",c),(!h||32&i[0])&&A(a,"id",e[5]),(!h||32&i[0])&&A(a,"name",e[5]),(!h||1&i[0]&&a.value!==e[0])&&(a.value=e[0]),!e[3]||e[14]?b?(b.p(e,i),16392&i[0]&&fe(b,1)):(b=mn(e),b.c(),fe(b,1),b.m(t,null)):b&&(ue(),pe(b,1,1,(()=>{b=null})),me());const u={};3260241&i[0]|2097152&i[1]&&(u.$$scope={dirty:i,ctx:e}),!f&&65536&i[0]&&(f=!0,u.open=e[16],oe((()=>f=!1))),m.$set(u),e[17]?k?(k.p(e,i),131072&i[0]&&fe(k,1)):(k=gn(e),k.c(),fe(k,1),k.m($.parentNode,$)):k&&(ue(),pe(k,1,1,(()=>{k=null})),me())},i(e){h||(fe(n.$$.fragment,e),fe(l),fe(b),fe(m.$$.fragment,e),fe(k),h=!0)},o(e){pe(n.$$.fragment,e),pe(l),pe(b),pe(m.$$.fragment,e),pe(k),h=!1},d(e){e&&S(t),we(n),~r&&v[r].d(),b&&b.d(),e&&S(u),we(m,e),e&&S(p),k&&k.d(e),e&&S($)}}}(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[51]&&i.p(e,t)},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function dn(e){let t,n,i,o,r;return n=new Me({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[32]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function un(e){let t,n,i,o,r;return n=new rt({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-jox15l")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=[D(t,"click",e[28]()),D(t,"choose",e[29])],o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,b(r)}}}function mn(e){let t,n,i,o,r;return n=new Be({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather2 pointer svelte-jox15l")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[31]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function fn(e){let t,n,i,o;const r=[$n,pn],l=[];function s(e,t){return e[6].lookup||e[4]&&!e[6].constraint?0:1}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(ue(),pe(l[a],1,1,(()=>{l[a]=null})),me(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),fe(n,1),n.m(i.parentNode,i))},i(e){o||(fe(n),o=!0)},o(e){pe(n),o=!1},d(e){l[t].d(e),e&&S(i)}}}function pn(e){let t,n;return t=new Wt({props:{title:e[6].designation,newAllowed:e[20],prevEventId:e[9],schema:e[15],recID:e[0],isOpening:e[16],filterForReady:e[21],refStatus:e[6].refStatus,selectionFields:e[12],deList:e[13],praefix:e[11]}}),t.$on("choose",e[29]),t.$on("back",e[30]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.title=e[6].designation),1048576&n[0]&&(i.newAllowed=e[20]),512&n[0]&&(i.prevEventId=e[9]),32768&n[0]&&(i.schema=e[15]),1&n[0]&&(i.recID=e[0]),65536&n[0]&&(i.isOpening=e[16]),2097152&n[0]&&(i.filterForReady=e[21]),64&n[0]&&(i.refStatus=e[6].refStatus),4096&n[0]&&(i.selectionFields=e[12]),8192&n[0]&&(i.deList=e[13]),2048&n[0]&&(i.praefix=e[11]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function $n(e){let t,n;return t=new ln({props:{item:e[6],className:e[15].class,classId:e[8],rowId:e[0],recordId:e[10],viewName:e[4],viewValue:""}}),t.$on("choose",e[29]),t.$on("back",e[30]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.item=e[6]),32768&n[0]&&(i.className=e[15].class),256&n[0]&&(i.classId=e[8]),1&n[0]&&(i.rowId=e[0]),1024&n[0]&&(i.recordId=e[10]),16&n[0]&&(i.viewName=e[4]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function hn(e){let t,n,i=e[16]&&fn(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[16]?i?(i.p(e,n),65536&n[0]&&fe(i,1)):(i=fn(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function gn(e){let t,n,i;function o(t){e[40](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[yn]},$$scope:{ctx:e}};return void 0!==e[17]&&(r.open=e[17]),t=new e[23]({props:r}),K.push((()=>ve(t,"open",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};294913&i[0]|2097152&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&131072&i[0]&&(n=!0,o.open=e[17],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function vn(e){let t,n;return t=new ea({props:{schema:e[15],recID:e[0],readonly:!0}}),t.$on("back",e[30]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};32768&n[0]&&(i.schema=e[15]),1&n[0]&&(i.recID=e[0]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function yn(e){let t,n;return t=new e[22]({props:{title:e[18],$$slots:{default:[vn]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};262144&n[0]&&(i.title=e[18]),32769&n[0]|2097152&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function bn(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function wn(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:bn,then:cn,catch:an,value:51,blocks:[,,,]};return $e(e[27](),i),{c(){t=F(),i.block.c()},m(e,o){C(e,t,o),i.block.m(e,i.anchor=o),i.mount=()=>t.parentNode,i.anchor=t,n=!0},p(t,n){he(i,e=t,n)},i(e){n||(fe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){pe(i.blocks[e])}n=!1},d(e){e&&S(t),i.block.d(e),i.token=null,i=null}}}function xn(e,n,o){let r,l,s;k(e,i,(e=>o(38,r=e)));const a=Y(),{Dialog:d,Modal:m}=c;let{id:f}=n,{item:p}=n,{value:$=""}=n,{desc:g=""}=n,{noForm:v=!1}=n,{classId:y}=n,{eventId:b}=n,{recordId:w}=n,{withRefValue:x=!1}=n,{refValue:I=""}=n,{required:_}=n,{disabled:C}=n,{readonly:S}=n,{praefix:j}=n,{selectionFields:q}=n,{formnovalidate:N}=n,{selection:E}=n,{deList:L}=n,{isTemplate:F}=n;const D="comment_"+f;let z,T,A,B,V,O,M=!1,W=!0,P=!0;S||=w&&p.asInput,C||=S,!E&&p.selection&&1===p.selection.split(":").length&&(E=p.selection);const{currentTasks:R,loggedIn:H}=u;k(e,R,(e=>o(42,l=e))),k(e,H,(e=>o(43,s=e)));const Q=async e=>{e.items.filter((e=>e.properties?.default)).forEach((t=>{a("defPrep",{className:e.class,itemName:t.name,value:t.properties.default})}))},G=e=>{e&&(o(2,g=h(A,e)),a("setRefDesc",g.split(" •")[0]),a("change",{value:$,description:g}),a("task",{row:e,eventId:A.id}))},U=()=>{o(16,M=!1),o(17,z=!1)};return e.$$set=e=>{"id"in e&&o(5,f=e.id),"item"in e&&o(6,p=e.item),"value"in e&&o(0,$=e.value),"desc"in e&&o(2,g=e.desc),"noForm"in e&&o(7,v=e.noForm),"classId"in e&&o(8,y=e.classId),"eventId"in e&&o(9,b=e.eventId),"recordId"in e&&o(10,w=e.recordId),"withRefValue"in e&&o(33,x=e.withRefValue),"refValue"in e&&o(34,I=e.refValue),"required"in e&&o(1,_=e.required),"disabled"in e&&o(3,C=e.disabled),"readonly"in e&&o(35,S=e.readonly),"praefix"in e&&o(11,j=e.praefix),"selectionFields"in e&&o(12,q=e.selectionFields),"formnovalidate"in e&&o(36,N=e.formnovalidate),"selection"in e&&o(4,E=e.selection),"deList"in e&&o(13,L=e.deList),"isTemplate"in e&&o(14,F=e.isTemplate)},e.$$.update=()=>{if(2&e.$$.dirty[0]|32&e.$$.dirty[1]&&o(1,_=_&&!N),12&e.$$.dirty[1]&&x&&o(0,$=I),32833&e.$$.dirty[0]&&$&&A&&Promise.resolve(Gs(p.refClass,A.id,$)).then((e=>G(e))),65&e.$$.dirty[0]|192&e.$$.dirty[1]&&$&&B&&p.name===B.input?.at(0)&&B.inputLookup?.length){const{domain:e}=B.inputLookup[0]||{};"user"===e&&(r.some((e=>B.authorization?.find((t=>t.role===e&&!t.constraint))))||o(3,C=!0))}32769&e.$$.dirty[0]&&!$&&A&&G({})},[$,_,g,C,E,f,p,v,y,b,w,j,q,L,F,A,M,z,T,V,W,P,d,m,D,R,H,async()=>{try{const e=await t.getEvent(b);if(O="report"===e.output.type,o(21,P=!p.asInput),o(20,W=e.output?.class[0].name!==p.refClass),o(15,A=await t.getSchemaByClass(p.refClass)),Q(A),o(19,V=(e=>!l?.length||!!l.find((t=>t===e)))(A.id)),o(37,B=await t.getSchema(b)),b&&w&&$&&!C&&B.input?.find((e=>e===p.refClass))&&o(3,C=!0),p.properties?.query?.lookup){const{domain:e,value:n}=p.properties.query.lookup;if("user"===e){const e=s.user,i={[n]:e},l=await t.getSectionView(p.refClass,i);if(l?.length){const[{_id:e}]=l;e&&(o(34,I=e),o(33,x=!0))}r.some((e=>A.authorization?.find((t=>t.role===e&&!t.constraint))))||o(3,C=!0)}}return o(18,T=A.identity.designation),!0}catch{return a("initFail",!0),!1}},e=>t=>{if("BUTTON"===t.explicitOriginalTarget?.nodeName){const t=document.getElementById(e);return t?.blur()}o(16,M=!0)},({detail:e})=>{o(0,$=e.row._id),U()},U,()=>{(O||V)&&(o(0,$=o(2,g="")),a("change",{value:$,description:g}),a("task",{row:{_task:{event:A.id,_id:!1}}}))},async()=>{if(!$)return;const e=await Gs(p.refClass,A.id,$);if(!e._task)return;const t=e._task._id,n=`/task/${e._task.event}/${t}/task?view=standalone`;window.open(n)},x,I,S,N,B,r,function(e){M=e,o(16,M)},function(e){z=e,o(17,z)}]}class kn extends ke{constructor(e){var t;super(),sn.getElementById("svelte-jox15l-style")||((t=q("style")).id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",_(sn.head,t)),xe(this,e,xn,wn,x,{id:5,item:6,value:0,desc:2,noForm:7,classId:8,eventId:9,recordId:10,withRefValue:33,refValue:34,required:1,disabled:3,readonly:35,praefix:11,selectionFields:12,formnovalidate:36,selection:4,deList:13,isTemplate:14},[-1,-1])}}const In=/\d+/g,_n=/%[HMSpPdmyY%]/g;function Cn(e,t,n){const i=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===e)return null;const r=t.split(_n);let l=0,s=0;const a=new Date(0);for(const c of r){if(!e.startsWith(c,l))return n;if(l+=c.length,l===e.length){if(s!==t.length)return n;break}if("%"!==t[s+c.length])break;if(s+=c.length+1,"%"===t[s]){if("%"!==e[l])return n;l++}else if("p"===t[s].toLowerCase()){const t=e.substr(l,2).toUpperCase();if("AM"===t)o=!1,a.getHours()>=12&&a.setHours(a.getHours()-12);else{if("PM"!==t)return n;o=!0,a.getHours()<12&&a.setHours(a.getHours()+12)}}else{In.lastIndex=l;const r=In.exec(e);if(null==r)return n;switch(t[s]){case"H":a.setHours(parseInt(r[0])+12*o);break;case"M":a.setMinutes(r[0]);break;case"S":a.setSeconds(r[0]);break;case"d":a.setDate(r[0]);break;case"m":a.setMonth(r[0]-1);break;case"y":a.setFullYear(100*i+parseInt(r[0]));break;case"Y":a.setFullYear(r[0])}l+=r[0].length}s++}return isNaN(a.valueOf())?n:a}function Sn(e,t){return null==e||null==t?e:(t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t)}const{document:jn}=ge;function qn(e,t,n){const i=e.slice();return i[17]=t[n],i}function Nn(e,t,n){const i=e.slice();return i[20]=t[n],i}function En(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Ln(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p=e[0].items,$=[];for(let t=0;t<p.length;t+=1)$[t]=Dn(Nn(e,p,t));const h=e=>pe($[e],1,1,(()=>{$[e]=null}));let g=e[0].list&&zn(e);return a=new e[5]({props:{outline:!0,$$slots:{default:[An]},$$scope:{ctx:e}}}),a.$on("click",e[9]),d=new e[5]({props:{disabled:e[2],class:"close",form:e[6],filled:!0,type:"submit",$$slots:{default:[Bn]},$$scope:{ctx:e}}}),{c(){t=q("form"),n=q("input"),o=L();for(let e=0;e<$.length;e+=1)$[e].c();r=L(),g&&g.c(),l=L(),s=q("div"),ye(a.$$.fragment),c=L(),ye(d.$$.fragment),A(n,"class",I(e[6])+" svelte-1phofh5"),A(n,"name","_id"),A(n,"type","hidden"),n.value=i=e[1]._id||"",A(t,"class","fTask svelte-1phofh5"),A(t,"id",e[6]),A(s,"class","form--buttons svelte-1phofh5")},m(i,p){C(i,t,p),_(t,n),_(t,o);for(let e=0;e<$.length;e+=1)$[e].m(t,null);_(t,r),g&&g.m(t,null),C(i,l,p),C(i,s,p),be(a,s,null),_(s,c),be(d,s,null),u=!0,m||(f=[D(t,"keydown",e[8]),D(t,"submit",z(e[10]))],m=!0)},p(e,o){if((!u||2&o&&i!==(i=e[1]._id||""))&&(n.value=i),75&o){let n;for(p=e[0].items,n=0;n<p.length;n+=1){const i=Nn(e,p,n);$[n]?($[n].p(i,o),fe($[n],1)):($[n]=Dn(i),$[n].c(),fe($[n],1),$[n].m(t,r))}for(ue(),n=p.length;n<$.length;n+=1)h(n);me()}e[0].list?g?(g.p(e,o),1&o&&fe(g,1)):(g=zn(e),g.c(),fe(g,1),g.m(t,null)):g&&(ue(),pe(g,1,1,(()=>{g=null})),me());const l={};8388608&o&&(l.$$scope={dirty:o,ctx:e}),a.$set(l);const s={};4&o&&(s.disabled=e[2]),8388608&o&&(s.$$scope={dirty:o,ctx:e}),d.$set(s)},i(e){if(!u){for(let e=0;e<p.length;e+=1)fe($[e]);fe(g),fe(a.$$.fragment,e),fe(d.$$.fragment,e),u=!0}},o(e){$=$.filter(Boolean);for(let e=0;e<$.length;e+=1)pe($[e]);pe(g),pe(a.$$.fragment,e),pe(d.$$.fragment,e),u=!1},d(e){e&&S(t),j($,e),g&&g.d(),e&&S(l),e&&S(s),we(a),we(d),m=!1,b(f)}}}function Fn(e){let t,n;return t=new El({props:{classId:e[6],item:e[20],selection:e[20].selection,record:e[1],disabled:e[3],eventId:e[0].id,required:!1,isTemplate:!0}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.item=e[20]),1&n&&(i.selection=e[20].selection),2&n&&(i.record=e[1]),8&n&&(i.disabled=e[3]),1&n&&(i.eventId=e[0].id),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Dn(e){let t,n,i=Mn(!0,e[20]),o=i&&Fn(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){1&n&&(i=Mn(!0,e[20])),i?o?(o.p(e,n),1&n&&fe(o,1)):(o=Fn(e),o.c(),fe(o,1),o.m(t.parentNode,t)):o&&(ue(),pe(o,1,1,(()=>{o=null})),me())},i(e){n||(fe(o),n=!0)},o(e){pe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function zn(e){let t,n,i=e[0].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=Tn(qn(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(75&n){let l;for(i=e[0].list,l=0;l<i.length;l+=1){const r=qn(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=Tn(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}function Tn(e){let t,n,i,o;return t=new e[4]({props:{text:e[17].designation}}),i=new Xn({props:{classId:e[6],list:e[17],eventId:e[0].id,schema:e[17].item,record:e[1],disabled:e[3],required:!1,open:!0,isTemplate:!0}}),{c(){ye(t.$$.fragment),n=L(),ye(i.$$.fragment)},m(e,r){be(t,e,r),C(e,n,r),be(i,e,r),o=!0},p(e,n){const o={};1&n&&(o.text=e[17].designation),t.$set(o);const r={};1&n&&(r.list=e[17]),1&n&&(r.eventId=e[0].id),1&n&&(r.schema=e[17].item),2&n&&(r.record=e[1]),8&n&&(r.disabled=e[3]),i.$set(r)},i(e){o||(fe(t.$$.fragment,e),fe(i.$$.fragment,e),o=!0)},o(e){pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!1},d(e){we(t,e),e&&S(n),we(i,e)}}}function An(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Bn(e){let t;return{c(){t=E("Speichern")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Vn(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function On(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Vn,then:Ln,catch:En,value:16,blocks:[,,,]};return $e(e[7](),o),{c(){t=L(),n=q("section"),o.block.c(),jn.title="Vorgaben",A(n,"class","sTask svelte-1phofh5")},m(e,r){C(e,t,r),C(e,n,r),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,i=!0},p(t,[n]){he(o,e=t,n)},i(e){i||(fe(o.block),i=!0)},o(e){for(let e=0;e<3;e+=1){pe(o.blocks[e])}i=!1},d(e){e&&S(t),e&&S(n),o.block.d(),o.token=null,o=null}}}const Mn=(e,{type:t="",properties:n={}})=>!e||"list"!==t&&("time"===n.format&&(t="time"),!["date","datetime","time"].includes(t)&&(!n.readonly&&!n.hidden));function Wn(e,n,o){let a,d,u;k(e,s,(e=>o(11,d=e))),k(e,i,(e=>o(12,u=e)));const{Divider:m,Button:f,FormField:p}=c,$=JSON.parse(r.getItem("Locale"));let{schema:h}=n,{record:g}=n,v="template-"+h.class+Math.floor(9e3*Math.random()+1e3).toString(),y=!1;const b=()=>window.history.back(),w=(e,t,n=!1)=>{const i=t.id,o=e.find((e=>e.name===i));let r=t.value;if(!n&&o&&o.properties?.multi&&(r=g[i]),r&&o&&o.type.startsWith("date"))try{return Cn(r,"%d.%m.%Y").toISOString()}catch{return new Date(r).toISOString()}if(o&&"boolean"===o.type&&(r=!!t.checked),o&&"number"===o.type){const e=Number("1.1").toLocaleString($.id).substring(1,2);try{r=Number(r.replace(e,".")).toString()}catch{}}return r};return e.$$set=e=>{"schema"in e&&o(0,h=e.schema),"record"in e&&o(1,g=e.record)},e.$$.update=()=>{4&e.$$.dirty&&o(3,a=y)},[h,g,y,a,m,f,v,async()=>{const e=await t.getEvent(h.id);if(e.trigger?.startOn&&!e.trigger?.startOn?.some((e=>"Manual"===e.type))&&o(2,y=!0),d.role?.length&&h.authorization?.length){const e=h.authorization.some((e=>u?.find((t=>t===e.role&&"edit"===e.activity))));o(2,y||=!e)}},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},b,async e=>{const n={};Array.from(document.querySelectorAll("form#"+v+" ."+v)).map((e=>{const t=e.id||e.name;if(t)if(t.includes(".")){const[i,o]=t.split("."),r=h.list.find((e=>e.name===i));n[t]=w(r.item,e)}else n[t]=w(h.items,e)})),await t.saveTemplate(h.class,n),l.success("Die Vorgaben wurden gespeichert.",2e3),b()}]}const{document:Pn}=ge;function Rn(e,t,n){const i=e.slice();return i[28]=t[n],i}function Hn(e){let t,n;return t=new El({props:{classId:e[2],item:e[28],listName:e[1].name,eventId:e[3],record:e[0],disabled:e[4],required:e[5],currency:e[8]}}),t.$on("notify",e[14]),t.$on("defPrep",e[16]),t.$on("task",e[21]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),2&n[0]&&(i.item=e[28]),2&n[0]&&(i.listName=e[1].name),8&n[0]&&(i.eventId=e[3]),1&n[0]&&(i.record=e[0]),16&n[0]&&(i.disabled=e[4]),32&n[0]&&(i.required=e[5]),256&n[0]&&(i.currency=e[8]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Qn(e){let t,n,i=Mn(e[7],e[28]),o=i&&Hn(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){130&n[0]&&(i=Mn(e[7],e[28])),i?o?(o.p(e,n),130&n[0]&&fe(o,1)):(o=Hn(e),o.c(),fe(o,1),o.m(t.parentNode,t)):o&&(ue(),pe(o,1,1,(()=>{o=null})),me())},i(e){n||(fe(o),n=!0)},o(e){pe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function Yn(e){let t,n,i,o=e[1].item,r=[];for(let t=0;t<o.length;t+=1)r[t]=Qn(Rn(e,o,t));const l=e=>pe(r[e],1,1,(()=>{r[e]=null}));return{c(){t=q("div");for(let e=0;e<r.length;e+=1)r[e].c();A(t,"id",n=`accordion-content-${e[2]}-${e[1].name}`)},m(e,n){C(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null);i=!0},p(e,s){if(82367&s[0]){let n;for(o=e[1].item,n=0;n<o.length;n+=1){const i=Rn(e,o,n);r[n]?(r[n].p(i,s),fe(r[n],1)):(r[n]=Qn(i),r[n].c(),fe(r[n],1),r[n].m(t,null))}for(ue(),n=o.length;n<r.length;n+=1)l(n);me()}(!i||6&s[0]&&n!==(n=`accordion-content-${e[2]}-${e[1].name}`))&&A(t,"id",n)},i(e){if(!i){for(let e=0;e<o.length;e+=1)fe(r[e]);i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)pe(r[e]);i=!1},d(e){e&&S(t),j(r,e)}}}function Gn(e){let t,n,i=e[13](e[9])+"";return{c(){t=q("span"),n=E(i)},m(e,i){C(e,t,i),_(t,n)},p(e,t){512&t[0]&&i!==(i=e[13](e[9])+"")&&B(n,i)},d(e){e&&S(t)}}}function Un(e){let t,n,i;return n=new e[10]({props:{$$slots:{default:[Gn]},$$scope:{ctx:e}}}),n.$on("click",(function(){w(e[15](e[27]))&&e[15](e[27]).apply(this,arguments)})),{c(){t=q("div"),ye(n.$$.fragment),A(t,"class","accordion svelte-148ktt9"),A(t,"slot","handle")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p(t,i){e=t;const o={};512&i[0]|1&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o)},i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function Kn(e){let t,n;return t=new e[12]({props:{open:e[6],$$slots:{handle:[Un,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]],default:[Yn,({toggle:e})=>({27:e}),({toggle:e})=>[e?134217728:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",e[17]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};64&n[0]&&(i.open=e[6]),134218687&n[0]|1&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Jn(e){let t,n,i;return n=new e[11]({props:{$$slots:{default:[Kn]},$$scope:{ctx:e}}}),{c(){t=q("div"),ye(n.$$.fragment),A(t,"class","formList")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p(e,t){const i={};1023&t[0]|1&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function Zn(e,n,i){const{Button:o,Accordion:r,AccordionSection:l}=c;let{list:s}=n,{schema:a}=n,{record:d}=n,{classId:u}=n,{eventId:m}=n,{disabled:h}=n,{required:g}=n,{open:v=!1}=n,{template:y={}}=n,{isTemplate:b=!1}=n,{currency:w}=n,{update:x=!1}=n,k=new Map;const I={};let _=d[s.name]||{};d[s.name]=_;const C=e=>I[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "),S=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};return e.$$set=e=>{"list"in e&&i(1,s=e.list),"schema"in e&&i(18,a=e.schema),"record"in e&&i(0,d=e.record),"classId"in e&&i(2,u=e.classId),"eventId"in e&&i(3,m=e.eventId),"disabled"in e&&i(4,h=e.disabled),"required"in e&&i(5,g=e.required),"open"in e&&i(6,v=e.open),"template"in e&&i(19,y=e.template),"isTemplate"in e&&i(7,b=e.isTemplate),"currency"in e&&i(8,w=e.currency),"update"in e&&i(20,x=e.update)},e.$$.update=()=>{1048579&e.$$.dirty[0]&&x&&d&&i(9,_=d[s.name]||{})},[d,s,u,m,h,g,v,b,w,_,o,r,l,e=>a.filter((t=>void 0!==e[t.name]&&"textarea"!==t.properties?.format)).map((t=>"object"===t.type?C(t.name):"boolean"===t.type?$(e[t.name]):"date"===t.type?f(e[t.name]):"datetime"===t.type?p(e[t.name]):e[t.name])).filter((e=>!!e)).join(" • ")||"+",({detail:e})=>{const[t,n]=e.itemName.split(".");if(!n)return;e.desc&&(I[n]=e.desc);const o=d[t];i(0,d[t]={...o,[n]:e.value},d),i(9,_=d[t])},e=>t=>{(()=>{const e=y[s.name]||{};for(const t in e)y[s.name][t]&&!d[s.name][t]&&i(0,d[s.name][t]=y[s.name][t],d)})(),e(t);const n=`#accordion-content-${u}-${s.name} > div.form-field:last-child`,o=document.querySelector(n);ne().then((()=>{const e=`#accordion-content-${u}-${s.name} textarea`;Array.from(document.querySelectorAll(e)).forEach(S)})).then((()=>o.scrollIntoView({behavior:"smooth",block:"end"})))},async({detail:{className:e,itemName:n,value:i}})=>{if(k.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===className+"."+s.name))),!i)return;const o={[n]:!0},r=await t.getSectionView(e,o);r?.length&&k.set(e,r[0])},()=>{setTimeout((()=>{Array.from(k).forEach((([e,t])=>{d[s.name][e]||i(0,d[s.name][e]=t._id,d)}))}),500)},a,y,x,function(t){G(e,t)}]}class Xn extends ke{constructor(e){var t;super(),Pn.getElementById("svelte-148ktt9-style")||((t=q("style")).id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",_(Pn.head,t)),xe(this,e,Zn,Jn,x,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:ei}=ge;function ti(e){e[0]=e[23].list,e[22]=e[23].items}function ni(e,t,n){const i=e.slice();return i[24]=t[n],i}function ii(e,t,n){const i=e.slice();return i[27]=t[n],i}function oi(e,t,n){const i=e.slice();return i[27]=t[n],i}function ri(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function li(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[19](t)}ti(e),n=new e[7]({props:{outline:!0,$$slots:{default:[si]},$$scope:{ctx:e}}}),n.$on("click",e[18]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),K.push((()=>ve(l,"value",y))),l.$on("input",e[12]),d=new Be({props:{size:"18"}});let w=e[22]?.length&&function(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=ai(oi(e,i,t));return{c(){t=q("thead"),n=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();A(n,"class","svelte-14hcfjl"),A(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[22],r=0;r<i.length;r+=1){const l=oi(e,i,r);o[r]?o[r].p(l,t):(o[r]=ai(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&S(t),j(o,e)}}}(e),x=e[0]?.length&&function(e){let t,n=e[0],i=[];for(let t=0;t<n.length;t+=1)i[t]=ui(ni(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11778&o[0]){let r;for(n=e[0],r=0;r<n.length;r+=1){const l=ni(e,n,r);i[r]?i[r].p(l,o):(i[r]=ui(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){j(i,e),e&&S(t)}}}(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),o=q("div"),r=E("Suchen: "),ye(l.$$.fragment),a=L(),c=q("span"),ye(d.$$.fragment),u=L(),m=q("div"),f=q("table"),w&&w.c(),p=L(),$=q("tbody"),x&&x.c(),A(t,"class","form--buttons svelte-14hcfjl"),A(c,"class","feather pointer svelte-14hcfjl"),O(o,"margin-bottom","1em"),O(o,"position","relative"),A(f,"striped",""),A(f,"class","svelte-14hcfjl"),A(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),be(n,t,null),C(s,i,y),C(s,o,y),_(o,r),be(l,o,null),_(o,a),_(o,c),be(d,c,null),C(s,u,y),C(s,m,y),_(m,f),w&&w.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=D(c,"click",e[14]),g=!0)},p(e,t){ti(e);const i={};2&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],oe((()=>s=!1))),l.$set(o),e[22]?.length&&w.p(e,t),e[0]?.length&&x.p(e,t)},i(e){h||(fe(n.$$.fragment,e),fe(l.$$.fragment,e),fe(d.$$.fragment,e),h=!0)},o(e){pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!1},d(e){e&&S(t),we(n),e&&S(i),e&&S(o),we(l),we(d),e&&S(u),e&&S(m),w&&w.d(),x&&x.d(),g=!1,v()}}}function si(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function ai(e){let t,n,i=e[27]?.designation+"";return{c(){t=q("th"),n=E(i),A(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:g,d(e){e&&S(t)}}}function ci(e){let t,n,i=e[22],o=[];for(let t=0;t<i.length;t+=1)o[t]=di(ii(e,i,t));return{c(){t=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=L(),A(t,"class","pointer svelte-14hcfjl")},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[22],l=0;l<i.length;l+=1){const s=ii(e,i,l);o[l]?o[l].p(s,r):(o[l]=di(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}},d(e){e&&S(t),j(o,e)}}}function di(e){let t,n,i,o,r=e[9](e[24],e[27])+"";return{c(){t=q("td"),n=E(r),A(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=D(t,"click",T(e[10](e[24]))),i=!0)},p(t,n){e=t},d(e){e&&S(t),i=!1,o()}}}function ui(e){let t,n=e[13](e[24],e[22],e[1]),i=n&&ci(e);return{c(){i&&i.c(),t=F()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[24],e[22],e[1])),n?i?i.p(e,o):(i=ci(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&S(t)}}}function mi(e){let t,n;return t=new e[5]({}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p:g,i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function fi(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:mi,then:li,catch:ri,value:23,blocks:[,,,]};return $e(e[11](),r),{c(){ye(t.$$.fragment),n=L(),i=F(),r.block.c()},m(e,l){be(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){he(r,e=t,n)},i(e){o||(fe(t.$$.fragment,e),fe(r.block),o=!0)},o(e){pe(t.$$.fragment,e);for(let e=0;e<3;e+=1){pe(r.blocks[e])}o=!1},d(e){we(t,e),e&&S(n),e&&S(i),r.block.d(e),r.token=null,r=null}}}function pi(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[fi]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};2&n[0]|2&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function $i(e,n,i){const o=Y(),{Dialog:r,Divider:l,Loading:s,TextField:a,Button:d}=c;let{item:u}=n,{className:m}=n,{classId:p}=n,{list:h}=n,g="",v=p+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},b=t.getSchemaByClass(m);H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(v)?.focus()}),200)}));return e.$$set=e=>{"item"in e&&i(15,u=e.item),"className"in e&&i(16,m=e.className),"classId"in e&&i(17,p=e.classId),"list"in e&&i(0,h=e.list)},[h,g,o,r,l,s,a,d,v,y,e=>()=>o("choose",{row:e}),async()=>{const e=await b;let t=[],n=e.display;return n&&n.length?n.map((n=>{const[o,r]=n.split(".");let l=e.list?.find((e=>e.name===o))?.item.find((e=>e.name===r));l&&(l={...l},l.name=`${o}_${r}`,i(0,h=h.map((e=>(e[o]&&(e[l.name]=e["_"+o]?e["_"+o][r]:e[o][r]),e))))),l||(l=e.items.find((e=>e.name===o))),t.find((e=>e?.name===o))||t.push(l)})):t=e.items,{list:h,items:t}},({detail:{value:e}})=>{i(1,g=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(y(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{i(1,g="")},u,m,p,()=>o("back"),function(e){g=e,i(1,g)}]}class hi extends ke{constructor(e){var t;super(),ei.getElementById("svelte-14hcfjl-style")||((t=q("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(ei.head,t)),xe(this,e,$i,pi,x,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:gi}=ge;function vi(e,t,n){const i=e.slice();return i[11]=t[n],i}function yi(e,t,n){const i=e.slice();return i[2]=t[n],i}function bi(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function wi(e){let t,n,i,o=e[6].items,r=[];for(let t=0;t<o.length;t+=1)r[t]=Ci(yi(e,o,t));const l=e=>pe(r[e],1,1,(()=>{r[e]=null}));let s=e[6].list&&Si(e);return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=L(),s&&s.c(),n=F()},m(e,o){for(let t=0;t<r.length;t+=1)r[t].m(e,o);C(e,t,o),s&&s.m(e,o),C(e,n,o),i=!0},p(e,i){if(5161971&i[0]){let n;for(o=e[6].items,n=0;n<o.length;n+=1){const l=yi(e,o,n);r[n]?(r[n].p(l,i),fe(r[n],1)):(r[n]=Ci(l),r[n].c(),fe(r[n],1),r[n].m(t.parentNode,t))}for(ue(),n=o.length;n<r.length;n+=1)l(n);me()}e[6].list?s?(s.p(e,i),64&i[0]&&fe(s,1)):(s=Si(e),s.c(),fe(s,1),s.m(n.parentNode,n)):s&&(ue(),pe(s,1,1,(()=>{s=null})),me())},i(e){if(!i){for(let e=0;e<o.length;e+=1)fe(r[e]);fe(s),i=!0}},o(e){r=r.filter(Boolean);for(let e=0;e<r.length;e+=1)pe(r[e]);pe(s),i=!1},d(e){j(r,e),e&&S(t),s&&s.d(e),e&&S(n)}}}function xi(e){let t,n,i,o;const r=[Ii,ki],l=[];function s(e,t){return e[2].name!==e[14]||e[15]?"lookup"!==e[2].properties?.format?1:-1:0}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=F()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(ue(),pe(l[a],1,1,(()=>{l[a]=null})),me()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),fe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(fe(n),o=!0)},o(e){pe(n),o=!1},d(e){~t&&l[t].d(e),e&&S(i)}}}function ki(e){let t,n;return t=new El({props:{classId:e[7],item:e[2],record:e[5],disabled:e[2].name===e[14]&&e[15]||e[0],eventId:e[4],currency:e[8],changeValue:e[9]}}),t.$on("notify",e[17]),t.$on("multi",e[18]),t.$on("defPrep",e[19]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),64&n[0]&&(i.item=e[2]),32&n[0]&&(i.record=e[5]),65&n[0]&&(i.disabled=e[2].name===e[14]&&e[15]||e[0]),16&n[0]&&(i.eventId=e[4]),256&n[0]&&(i.currency=e[8]),512&n[0]&&(i.changeValue=e[9]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ii(e){let t,n,i,o;n=new El({props:{classId:e[7],item:e[2],record:e[5],disabled:e[0]||!!e[1],required:!0,eventId:e[4],currency:e[8],changeValue:e[9]}}),n.$on("notify",e[17]),n.$on("multi",e[18]),n.$on("defPrep",e[19]);let r=e[1]&&_i(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),r&&r.c(),O(t,"padding-top",".25em"),O(t,"background-color","lightyellow"),O(t,"position","relative")},m(e,l){C(e,t,l),be(n,t,null),_(t,i),r&&r.m(t,null),o=!0},p(e,i){const o={};128&i[0]&&(o.classId=e[7]),64&i[0]&&(o.item=e[2]),32&i[0]&&(o.record=e[5]),3&i[0]&&(o.disabled=e[0]||!!e[1]),16&i[0]&&(o.eventId=e[4]),256&i[0]&&(o.currency=e[8]),512&i[0]&&(o.changeValue=e[9]),n.$set(o),e[1]?r?(r.p(e,i),2&i[0]&&fe(r,1)):(r=_i(e),r.c(),fe(r,1),r.m(t,null)):r&&(ue(),pe(r,1,1,(()=>{r=null})),me())},i(e){o||(fe(n.$$.fragment,e),fe(r),o=!0)},o(e){pe(n.$$.fragment,e),pe(r),o=!1},d(e){e&&S(t),we(n),r&&r.d()}}}function _i(e){let t,n,i,o,r;return n=new Be({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather2 pointer svelte-16mo2c")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[22]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Ci(e){let t,n,i="list"!==e[2].type&&xi(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[2].type?i?(i.p(e,n),64&n[0]&&fe(i,1)):(i=xi(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function Si(e){let t,n,i=e[6].list,o=[];for(let t=0;t<i.length;t+=1)o[t]=qi(vi(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(497&n[0]){let l;for(i=e[6].list,l=0;l<i.length;l+=1){const r=vi(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=qi(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}function ji(e){let t,n,i,o;return t=new e[12]({props:{text:e[11].designation}}),i=new Xn({props:{classId:e[7],list:e[11],eventId:e[4],schema:e[11].item,record:e[5],disabled:e[0],currency:e[8],update:!0}}),{c(){ye(t.$$.fragment),n=L(),ye(i.$$.fragment)},m(e,r){be(t,e,r),C(e,n,r),be(i,e,r),o=!0},p(e,n){const o={};64&n[0]&&(o.text=e[11].designation),t.$set(o);const r={};128&n[0]&&(r.classId=e[7]),64&n[0]&&(r.list=e[11]),16&n[0]&&(r.eventId=e[4]),64&n[0]&&(r.schema=e[11].item),32&n[0]&&(r.record=e[5]),1&n[0]&&(r.disabled=e[0]),256&n[0]&&(r.currency=e[8]),i.$set(r)},i(e){o||(fe(t.$$.fragment,e),fe(i.$$.fragment,e),o=!0)},o(e){pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!1},d(e){we(t,e),e&&S(n),we(i,e)}}}function qi(e){let t,n,i="array"!==e[11].type&&ji(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"array"!==e[11].type?i?(i.p(e,n),64&n[0]&&fe(i,1)):(i=ji(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function Ni(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Ei(e){let t,n;return t=new hi({props:{item:e[2],className:e[3],classId:e[7],list:e[11]}}),t.$on("choose",e[20]),t.$on("back",e[21]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.item=e[2]),8&n[0]&&(i.className=e[3]),128&n[0]&&(i.classId=e[7]),2048&n[0]&&(i.list=e[11]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Li(e){let t,n,i=e[10]&&Ei(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[10]?i?(i.p(e,n),1024&n[0]&&fe(i,1)):(i=Ei(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function Fi(e){let t,n,i,o,r,l,s={ctx:e,current:null,token:null,hasCatch:!1,pending:Ni,then:wi,catch:bi,value:52,blocks:[,,,]};function a(t){e[28](t)}$e(e[16](),s),n=new e[12]({});let c={class:"tModal",noClickaway:!0,$$slots:{default:[Li]},$$scope:{ctx:e}};return void 0!==e[10]&&(c.open=e[10]),o=new e[13]({props:c}),K.push((()=>ve(o,"open",a))),{c(){s.block.c(),t=L(),ye(n.$$.fragment),i=L(),ye(o.$$.fragment)},m(e,r){s.block.m(e,s.anchor=r),s.mount=()=>t.parentNode,s.anchor=t,C(e,t,r),be(n,e,r),C(e,i,r),be(o,e,r),l=!0},p(t,n){he(s,e=t,n);const i={};3212&n[0]|67108864&n[1]&&(i.$$scope={dirty:n,ctx:e}),!r&&1024&n[0]&&(r=!0,i.open=e[10],oe((()=>r=!1))),o.$set(i)},i(e){l||(fe(s.block),fe(n.$$.fragment,e),fe(o.$$.fragment,e),l=!0)},o(e){for(let e=0;e<3;e+=1){pe(s.blocks[e])}pe(n.$$.fragment,e),pe(o.$$.fragment,e),l=!1},d(e){s.block.d(e),s.token=null,s=null,e&&S(t),we(n,e),e&&S(i),we(o,e)}}}function Di(e,n,i){const{Divider:o,FormField:r,Modal:l}=c,s=Y();let a,d,u,m,f,{required:p}=n,{disabled:$}=n,{readonly:h}=n,{id:g}=n,{item:v}=n,{value:y}=n,{refValue:b}=n,w={},x="CHF",k=[],I=[],_={},C=new Map,S=!1,j="";const q=v.checkOn,N=y,E=e=>{a.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");k.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))},L=()=>{a.items.filter((e=>e.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.lookup})})),a.items.filter((e=>e.properties?.lookup)).forEach((e=>{I.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}))},F=async e=>{const t=k.filter((t=>t.refObj===e));if(t?.length){i(9,_={});for(const e of t){const{itemName:t,refObj:n,refName:o,op:r}=e;let{action:l}=e;if(!n)break;let s,a,c=!o&&w[n];const u=w[n];u&&o&&(c=(await getTaskFull(n,u))[o]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===r&&(c=!c),"required"!==l&&"readonly"!==l||(l="required"===l?l:"disabled",setTimeout((()=>{s=`#${d} .form-field.${t} .field textarea`,a=document.querySelector(s),a||(s=`#${d} .form-field.${t} .field input`,a=document.querySelector(s)),a&&c&&a.setAttribute(l,""),a&&!c&&a.removeAttribute(l)}),0)),"hidden"===l&&(s=`#${d} .form-field.${t}`,a=document.querySelector(s),a?.classList?.toggle("hidden",!!c),c&&i(9,_[t]="",_))}}};H((()=>{D()}));const D=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(d))&&++n<20;)await e(50);t&&((()=>{if(recID)return;const e=new Set;for(const t of k)e.add(t.refObj||u);Array.from(e).forEach((e=>F(e)))})(),z())},z=()=>{setTimeout((()=>{Array.from(C).forEach((([e,t])=>{w[e]||i(5,w[e]=t._id,w)}))}),250)},T=async e=>{if(!e.value)return void B();const n={[e.itemName]:{$regex:`(?i)${e.value}`}},o=await t.getSectionView(u,n);o?.length?(i(11,j=o),i(10,S=!0)):(i(1,y=""),i(23,b=""),s("setRefValue",b))},A=()=>{i(10,S=!1)},B=()=>{i(1,y=""),i(23,b=y),i(5,w={}),s("setRefValue",b)};return e.$$set=e=>{"required"in e&&i(24,p=e.required),"disabled"in e&&i(0,$=e.disabled),"readonly"in e&&i(25,h=e.readonly),"id"in e&&i(26,g=e.id),"item"in e&&i(2,v=e.item),"value"in e&&i(1,y=e.value),"refValue"in e&&i(23,b=e.refValue)},e.$$.update=()=>{33554433&e.$$.dirty[0]&&i(0,$=$||h),134217784&e.$$.dirty[0]&&w&&s("safeReference",{record:w,class:u,event:m,taskId:f})},[$,y,v,u,m,w,a,d,x,_,S,j,o,l,q,N,async()=>{try{if(y){const e=await t.getTask(v.refClass,y);delete e._task,i(5,w=e),i(27,f=(await t.getTaskByDocId(e._id))._id)}else i(5,w={})}catch{}const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&i(8,x=n[0].designation)}return i(6,a=await t.getSchemaByClass(v.refClass)),i(7,d="form-"+a.class+Math.floor(9e3*Math.random()+1e3).toString()),i(3,u=a.class),a.identity.designation,i(4,m=a.id),["readonly","hidden","required"].map(E),L(),!0},async({detail:e})=>{const{itemName:t,value:n}=e;if(i(5,w[t]=n,w),t===q)return T(e);F(t)},async({detail:e})=>{if(!(a.input?.length&&a.input.length>1))return;if(prevSchema?.class!==a.input[0])return;const{value:n,lookup:o,view:r}=e,[l]=o.split(":"),s=(await t.getSectionView(l,{[r]:{$in:n}})).map((e=>e._id));for(const e of a.input.slice(1)){i(5,w[e]=[],w);const n=await t.getSchemaByClass(e);n.id;let o=await t.getTasks(n.id);if(o=o.data.filter((e=>"Ready"===e._task?.status&&s.includes(e[l]))),o?.length){const n=o.map((e=>e._id)),r=await t.getSectionView(e,{_id:{$in:n}});for(const t of r)t[e]=t._id;i(5,w[e]=r,w)}}},async({detail:{className:e,itemName:n,value:i}})=>{if(C.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===u))),!i)return;const o={[n]:!0},r=await t.getSectionView(e,o);r?.length&&C.set(e,r[0])},async({detail:e})=>{const n=await t.getSectionView(u,{_id:e.row._id});n?.length&&(i(1,y=n[0]._id),i(23,b=y),s("setRefValue",b),i(5,w=n[0])),A()},A,B,b,p,h,g,f,function(e){S=e,i(10,S)}]}class zi extends ke{constructor(e){var t;super(),gi.getElementById("svelte-16mo2c-style")||((t=q("style")).id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",_(gi.head,t)),xe(this,e,Di,Fi,x,{required:24,disabled:0,readonly:25,id:26,item:2,value:1,refValue:23},[-1,-1])}}function Ti(e){let t,n=e[11]&&function(e){let t,n;return{c(){t=q("span"),n=E(e[4]),A(t,"class","item")},m(e,i){C(e,t,i),_(t,n)},p(e,t){16&t&&B(n,e[4])},d(e){e&&S(t)}}}(e);return{c(){n&&n.c(),t=F()},m(e,i){n&&n.m(e,i),C(e,t,i)},p(e,t){e[11]&&n.p(e,t)},d(e){n&&n.d(e),e&&S(t)}}}function Ai(e){let t,n,i;return n=new e[9]({props:{withItem:!0,itemLeft:!0,lang:e[10].id,class:"left",type:"string",inputClass:"txt-right"+(e[1]?"":" "+e[2]),id:e[0],name:e[0],value:e[8],step:e[12],pattern:e[6],placeholder:e[13],readonly:e[7],disabled:e[3],required:e[5],$$slots:{default:[Ti]},$$scope:{ctx:e}}}),n.$on("change",e[14]),n.$on("focus",e[15]),{c(){t=q("div"),ye(n.$$.fragment),O(t,"position","relative"),O(t,"max-width","10em")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p(e,[t]){const i={};6&t&&(i.inputClass="txt-right"+(e[1]?"":" "+e[2])),1&t&&(i.id=e[0]),1&t&&(i.name=e[0]),256&t&&(i.value=e[8]),64&t&&(i.pattern=e[6]),128&t&&(i.readonly=e[7]),8&t&&(i.disabled=e[3]),32&t&&(i.required=e[5]),536870928&t&&(i.$$scope={dirty:t,ctx:e}),n.$set(i)},i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function Bi(e,t,n){let i;const o=Y(),{TextField:l}=c;let{id:s}=t,{item:a}=t,{value:d}=t,{noForm:u=!1}=t,{classId:m}=t,{disabled:f}=t,{formnovalidate:p}=t,{currency:$}=t;const h=JSON.parse(r.getItem("Locale")),g=["price","amount","amountValue","taxValue","__total"].find((e=>e===a.name?.split("-")[0])),v=Number("1.1").toLocaleString(h.id).substring(1,2),{properties:y={}}=a;let{min:b,max:w,step:x,pattern:k,decimals:I=0,unit:_="",placeholder:C,hint:S,readonly:j,negative:q,required:N=!1}=y;j=!0===j||void 0,k||(k=I?`[0-9]+([${v}][0-9]{1,${I}})?`:"[0-9]*"),q&&(k="-?"+k);return e.$$set=e=>{"id"in e&&n(0,s=e.id),"item"in e&&n(16,a=e.item),"value"in e&&n(17,d=e.value),"noForm"in e&&n(1,u=e.noForm),"classId"in e&&n(2,m=e.classId),"disabled"in e&&n(3,f=e.disabled),"formnovalidate"in e&&n(18,p=e.formnovalidate),"currency"in e&&n(4,$=e.currency)},e.$$.update=()=>{262176&e.$$.dirty&&n(5,N=N&&!p),131072&e.$$.dirty&&n(8,i=Number(d.toString().replace(v,".")).toFixed(I).toString().replace(".",v))},[s,u,m,f,$,N,k,j,i,l,h,g,x,C,({detail:e})=>o("blur",{value:e.value}),({detail:e})=>{j||Number(d.toString().replace(v,"."))||n(8,i="")},a,d,p]}class Vi extends ke{constructor(e){super(),xe(this,e,Bi,Ai,x,{id:0,item:16,value:17,noForm:1,classId:2,disabled:3,formnovalidate:18,currency:4})}}const{document:Oi}=ge;function Mi(e){e[33]=e[35].list,e[34]=e[35].items}function Wi(e,t,n){const i=e.slice();return i[36]=t[n],i[38]=n,i}function Pi(e,t,n){const i=e.slice();return i[39]=t[n],i[41]=n,i}function Ri(e,t,n){const i=e.slice();return i[39]=t[n],i}function Hi(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Qi(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v,y;Mi(e),n=new e[8]({props:{outline:!0,$$slots:{default:[Yi]},$$scope:{ctx:e}}}),n.$on("click",e[30]);let b=!e[1]&&Gi(e);function w(t){e[31](t)}let x={id:e[11]};void 0!==e[2]&&(x.value=e[2]),s=new e[6]({props:x}),K.push((()=>ve(s,"value",w))),s.$on("input",e[14]),u=new Be({props:{size:"18"}});let k=e[34]?.length&&function(e){let t,n,i,o,r=!e[1]&&Ki(e),l=e[34],s=[];for(let t=0;t<l.length;t+=1)s[t]=Ji(Ri(e,l,t));return{c(){t=q("thead"),n=q("tr"),r&&r.c(),i=L();for(let e=0;e<s.length;e+=1)s[e].c();A(n,"class","svelte-1m010ne"),A(t,"class","svelte-1m010ne")},m(e,l){C(e,t,l),_(t,n),r&&r.m(n,null),_(n,i);for(let e=0;e<s.length;e+=1)s[e].m(n,null);o=!0},p(e,t){if(e[1]?r&&(ue(),pe(r,1,1,(()=>{r=null})),me()):r?(r.p(e,t),2&t[0]&&fe(r,1)):(r=Ki(e),r.c(),fe(r,1),r.m(n,i)),8192&t[0]){let i;for(l=e[34],i=0;i<l.length;i+=1){const o=Ri(e,l,i);s[i]?s[i].p(o,t):(s[i]=Ji(o),s[i].c(),s[i].m(n,null))}for(;i<s.length;i+=1)s[i].d(1);s.length=l.length}},i(e){o||(fe(r),o=!0)},o(e){pe(r),o=!1},d(e){e&&S(t),r&&r.d(),j(s,e)}}}(e),I=e[33]?.length&&function(e){let t,n,i=e[33],o=[];for(let t=0;t<i.length;t+=1)o[t]=no(Wi(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(569359&n[0]){let l;for(i=e[33],l=0;l<i.length;l+=1){const r=Wi(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=no(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),b&&b.c(),o=L(),r=q("div"),l=E("Suchen: "),ye(s.$$.fragment),c=L(),d=q("span"),ye(u.$$.fragment),m=L(),f=q("div"),p=q("table"),k&&k.c(),$=L(),h=q("tbody"),I&&I.c(),A(t,"class","form--buttons svelte-1m010ne"),A(d,"class","feather pointer svelte-1m010ne"),O(r,"margin-bottom","1em"),O(r,"position","relative"),A(p,"striped",""),A(p,"class","svelte-1m010ne"),A(f,"class","eList svelte-1m010ne")},m(a,w){C(a,t,w),be(n,t,null),_(t,i),b&&b.m(t,null),C(a,o,w),C(a,r,w),_(r,l),be(s,r,null),_(r,c),_(r,d),be(u,d,null),C(a,m,w),C(a,f,w),_(f,p),k&&k.m(p,null),_(p,$),_(p,h),I&&I.m(h,null),g=!0,v||(y=D(d,"click",e[16]),v=!0)},p(e,i){Mi(e);const o={};8192&i[1]&&(o.$$scope={dirty:i,ctx:e}),n.$set(o),e[1]?b&&(ue(),pe(b,1,1,(()=>{b=null})),me()):b?(b.p(e,i),2&i[0]&&fe(b,1)):(b=Gi(e),b.c(),fe(b,1),b.m(t,null));const r={};!a&&4&i[0]&&(a=!0,r.value=e[2],oe((()=>a=!1))),s.$set(r),e[34]?.length&&k.p(e,i),e[33]?.length&&I.p(e,i)},i(e){g||(fe(n.$$.fragment,e),fe(b),fe(s.$$.fragment,e),fe(u.$$.fragment,e),fe(k),fe(I),g=!0)},o(e){pe(n.$$.fragment,e),pe(b),pe(s.$$.fragment,e),pe(u.$$.fragment,e),pe(k),pe(I),g=!1},d(e){e&&S(t),we(n),b&&b.d(),e&&S(o),e&&S(r),we(s),we(u),e&&S(m),e&&S(f),k&&k.d(),I&&I.d(),v=!1,y()}}}function Yi(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Gi(e){let t,n;return t=new e[8]({props:{disabled:!e[33].length,filled:!0,$$slots:{default:[Ui]},$$scope:{ctx:e}}}),t.$on("click",e[17](e[33])),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ui(e){let t;return{c(){t=E("Bestätigen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Ki(e){let t,n,i,o,r;return n=new qe({props:{size:"20"}}),{c(){t=q("th"),ye(n.$$.fragment),A(t,"class","svelte-1m010ne")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[18](e[33])),o=!0)},p(t,n){e=t},i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Ji(e){let t,n,i=e[39]+"";return{c(){t=q("th"),n=E(i),A(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p:g,d(e){e&&S(t)}}}function Zi(e){let t,n,i,o,r,l,s,a=e[0],c=eo(e),d=e[34],u=[];for(let t=0;t<d.length;t+=1)u[t]=to(Pi(e,d,t));return{c(){t=q("tr"),c.c(),n=L();for(let e=0;e<u.length;e+=1)u[e].c();i=L(),A(t,"style",o=e[1]?"cursor: default;":"cursor: zoom-in;"),A(t,"title","übernimmt den Wert direkt"),A(t,"class","svelte-1m010ne"),M(t,"active",e[0].includes(e[36]))},m(o,a){C(o,t,a),c.m(t,null),_(t,n);for(let e=0;e<u.length;e+=1)u[e].m(t,null);_(t,i),r=!0,l||(s=D(t,"click",e[19](e[36])),l=!0)},p(l,s){if(e=l,1&s[0]&&x(a,a=e[0])?(ue(),pe(c,1,1,g),me(),c=eo(e),c.c(),fe(c),c.m(t,n)):c.p(e,s),8200&s[0]){let n;for(d=e[34],n=0;n<d.length;n+=1){const o=Pi(e,d,n);u[n]?u[n].p(o,s):(u[n]=to(o),u[n].c(),u[n].m(t,i))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!r||2&s[0]&&o!==(o=e[1]?"cursor: default;":"cursor: zoom-in;"))&&A(t,"style",o),8193&s[0]&&M(t,"active",e[0].includes(e[36]))},i(e){r||(fe(c),r=!0)},o(e){pe(c),r=!1},d(e){e&&S(t),c.d(e),j(u,e),l=!1,s()}}}function Xi(e){let t,n,i;return n=new e[10]({props:{name:e[12],data:e[38],checked:e[0].includes(e[36]),round:!0}}),{c(){t=q("td"),ye(n.$$.fragment),A(t,"title","Wählt den Wert aus"),A(t,"class","svelte-1m010ne")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p(e,t){const i={};1&t[0]&&(i.checked=e[0].includes(e[36])),n.$set(i)},i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function eo(e){let t,n,i=!e[1]&&Xi(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){e[1]?i&&(ue(),pe(i,1,1,(()=>{i=null})),me()):i?(i.p(e,n),2&n[0]&&fe(i,1)):(i=Xi(e),i.c(),fe(i,1),i.m(t.parentNode,t))},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function to(e){let t,n,i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"";return{c(){t=q("td"),n=E(i),A(t,"class","svelte-1m010ne")},m(e,i){C(e,t,i),_(t,n)},p(e,t){8&t[0]&&i!==(i=(e[3][e[38]]?e[3][e[38]][e[41]]:e[36])+"")&&B(n,i)},d(e){e&&S(t)}}}function no(e){let t,n,i=e[15](e[36],e[2]),o=i&&Zi(e);return{c(){o&&o.c(),t=F()},m(e,i){o&&o.m(e,i),C(e,t,i),n=!0},p(e,n){4&n[0]&&(i=e[15](e[36],e[2])),i?o?(o.p(e,n),4&n[0]&&fe(o,1)):(o=Zi(e),o.c(),fe(o,1),o.m(t.parentNode,t)):o&&(ue(),pe(o,1,1,(()=>{o=null})),me())},i(e){n||(fe(o),n=!0)},o(e){pe(o),n=!1},d(e){o&&o.d(e),e&&S(t)}}}function io(e){let t,n;return t=new e[5]({}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p:g,i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function oo(e){let t,n,i,o;t=new e[9]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:io,then:Qi,catch:Hi,value:35,blocks:[,,,]};return $e(e[13](),r),{c(){ye(t.$$.fragment),n=L(),i=F(),r.block.c()},m(e,l){be(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){he(r,e=t,n)},i(e){o||(fe(t.$$.fragment,e),fe(r.block),o=!0)},o(e){pe(t.$$.fragment,e);for(let e=0;e<3;e+=1){pe(r.blocks[e])}o=!1},d(e){we(t,e),e&&S(n),e&&S(i),r.block.d(e),r.token=null,r=null}}}function ro(e){let t,n;return t=new e[7]({props:{title:"Auswahl",class:"eList",$$slots:{default:[oo]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};15&n[0]|8192&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function lo(e,n,i){const o=Y(),{Loading:r,TextField:l,Dialog:s,Button:a,Divider:d,Checkbox:u}=c;let{classId:m}=n,{id:f}=n,{selection:p}=n,{refDoc:$}=n,{tableName:h}=n,{idName:g}=n,{target:v}=n,{view:y}=n,{unique:b}=n,{uniqueView:w}=n,{status:x}=n,{single:k}=n;p||=[];let I="",_=m+Math.floor(9e3*Math.random()+1e3).toString()+"search",C=[];const S=h+g+v+"checkbox",j=(e,t)=>e>t?1:t>e?-1:0;return e.$$set=e=>{"classId"in e&&i(21,m=e.classId),"id"in e&&i(22,f=e.id),"selection"in e&&i(0,p=e.selection),"refDoc"in e&&i(23,$=e.refDoc),"tableName"in e&&i(24,h=e.tableName),"idName"in e&&i(25,g=e.idName),"target"in e&&i(20,v=e.target),"view"in e&&i(26,y=e.view),"unique"in e&&i(27,b=e.unique),"uniqueView"in e&&i(28,w=e.uniqueView),"status"in e&&i(29,x=e.status),"single"in e&&i(1,k=e.single)},[p,k,I,C,o,r,l,s,a,d,u,_,S,async()=>{let e=[],n=[],o={};if(i(3,C=[]),g)if(y){const n=m.split("-")[1].slice(0,-4),i="input."+m+"[name='_id']",r=document.querySelector(i).value;o={[g]:f},x&&(o.$or=[{status:!0},{[n]:r}]),e=await t.getSectionView(h,o),e=e.sort(((e,t)=>{const i=e=>(e[n]||"z").toString()+e[v];return j(i(e),i(t))}))}else w?(o={[g]:f,status:!0},Object.entries(w).map((([e,t])=>{t?.length&&(o[e]={$in:t}),n.push(e)})),e=await t.getSectionView(h,o),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})),i(3,C=e.map((e=>{const t=[e[v]];return n.map((n=>t.push(e[n]))),t})))):b?(e=await t.getSection(h,g,f,b),e=e.sort(((e,t)=>j(e,t)))):(e=await t.getSection(h,g,f),e=e.sort(((e,t)=>{const n=e=>(p.includes(e[v])?"0-":"1-")+e[v];return j(n(e),n(t))})));else o={},Array.isArray(f)||(o._id=f),e=await t.getSectionView(h,o);const r=await t.getSchemaByClass(h),l=[];if($){const t=r.items[0].name,n=r.items[1].name,o=r.list[0].name,l=e.find((e=>e[t]===$));e=l[o],i(20,v=n)}e.map((e=>{let t=e[v];if(t||h!==v||(i(20,v=r.items[0].name),t=e[v]),Array.isArray(t))for(const e of t){let t=e;"string"!=typeof e&&(t=Array.from(Object.values(e)).filter((e=>!!e&&24!==e?.length)).join(", ")),l.push(t||[])}else l.push(t||[])}));const s=r.items.find((e=>e.name===v))?.designation;return n=n.map((e=>r.items.find((t=>t.name===e))?.designation)),{list:l.flat(),items:[s,...n]}},({detail:{value:e}})=>{i(2,I=e)},(e,t)=>!t||!!e.toLowerCase().includes(t.toLowerCase()),()=>{i(2,I="")},e=>()=>{const t=document.getElementsByName(S),n=[];t.forEach(((t,i)=>{t.checked&&n.push(e[+t.attributes.data.value])})),o("choose",{list:n})},e=>()=>{document.getElementsByName(S).forEach(((e,t)=>{e.checked=!e.checked}))},e=>t=>{"TD"===t.target?.nodeName&&(k?o("choose",{list:[].concat(e)}):(i(0,p=p.includes(e)?p.filter((t=>t!==e)):p.concat(e)),o("choose",{list:p})))},v,m,f,$,h,g,y,b,w,x,()=>o("back"),function(e){I=e,i(2,I)}]}class so extends ke{constructor(e){var t;super(),Oi.getElementById("svelte-1m010ne-style")||((t=q("style")).id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",_(Oi.head,t)),xe(this,e,lo,ro,x,{classId:21,id:22,selection:0,refDoc:23,tableName:24,idName:25,target:20,view:26,unique:27,uniqueView:28,status:29,single:1},[-1,-1])}}const{document:ao}=ge;function co(e){let t,n,i,o,r,l=e[7].length+"";return{c(){t=q("span"),n=E("("),i=E(l),o=E(")"),A(t,"class",r=I(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(e,r){C(e,t,r),_(t,n),_(t,i),_(t,o)},p(e,n){128&n[0]&&l!==(l=e[7].length+"")&&B(i,l),2&n[0]&&r!==(r=I(e[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&A(t,"class",r)},d(e){e&&S(t)}}}function uo(e){let t;return{c(){t=q("div"),A(t,"class","load-more-options"),A(t,"slot","load-more-options-message slot")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function mo(e){let t,n,i,o;const r=[$o,po,fo],l=[];function s(e,t){return!e[16].single&&e[7].length?0:e[17]?1:e[14]&&e[16].view&&e[16].maxItem?2:-1}return~(t=s(e))&&(n=l[t]=r[t](e)),{c(){n&&n.c(),i=F()},m(e,n){~t&&l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?~t&&l[t].p(e,o):(n&&(ue(),pe(l[a],1,1,(()=>{l[a]=null})),me()),~t?(n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),fe(n,1),n.m(i.parentNode,i)):n=null)},i(e){o||(fe(n),o=!0)},o(e){pe(n),o=!1},d(e){~t&&l[t].d(e),e&&S(i)}}}function fo(e){let t,n,i,o,r;return n=new Ce({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"title","Übernehmen"),A(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[26]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function po(e){let t,n,i,o,r;return n=new Le({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"title",e[17].title||"Generieren"),A(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[25]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function $o(e){let t,n,i,o,r;return n=new Be({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"title","Löschen"),A(t,"class","feather pointer svelte-1rbaejz")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[27]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function ho(e){let t,n,i;function o(t){e[37](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[go]},$$scope:{ctx:e}};return void 0!==e[10]&&(r.open=e[10]),t=new e[11]({props:r}),K.push((()=>ve(t,"open",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};53&i[0]|32768&i[1]&&(o.$$scope={dirty:i,ctx:e}),!n&&1024&i[0]&&(n=!0,o.open=e[10],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function go(e){let t,n;return t=new so({props:{classId:e[2],selection:e[0],refDoc:e[19],view:e[15],status:e[18],unique:e[16].unique&&e[4].name,uniqueView:e[16].view&&{[e[16].view]:e[5][e[16].view]},id:e[5][e[21]||e[20]],tableName:e[20],idName:e[21],target:e[4].name,single:e[16].single}}),t.$on("choose",e[24]),t.$on("back",e[23]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};4&n[0]&&(i.classId=e[2]),1&n[0]&&(i.selection=e[0]),16&n[0]&&(i.unique=e[16].unique&&e[4].name),32&n[0]&&(i.uniqueView=e[16].view&&{[e[16].view]:e[5][e[16].view]}),32&n[0]&&(i.id=e[5][e[21]||e[20]]),16&n[0]&&(i.target=e[4].name),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function vo(e){let t,n,i,o,r,l,s,a,c,d=!e[16].single&&e[7].length&&co(e);function u(t){e[35](t)}function m(t){e[36](t)}let f={id:e[3],name:e[3],class:e[3],readonly:e[13],disabled:e[1],required:e[6],placeholder:e[8],getOptions:yo,minSearchLength:"3",$$slots:{"load-more-options-message slot":[uo]},$$scope:{ctx:e}};void 0!==e[7]&&(f.selection=e[7]),void 0!==e[9]&&(f.maxOptions=e[9]),i=new e[12]({props:f}),K.push((()=>ve(i,"selection",u))),K.push((()=>ve(i,"maxOptions",m))),i.$on("change",e[22]);let p=!e[1]&&mo(e),$=e[10]&&ho(e);return{c(){t=q("div"),d&&d.c(),n=L(),ye(i.$$.fragment),l=L(),p&&p.c(),s=L(),$&&$.c(),a=F(),O(t,"position","relative")},m(e,o){C(e,t,o),d&&d.m(t,null),_(t,n),be(i,t,null),_(t,l),p&&p.m(t,null),C(e,s,o),$&&$.m(e,o),C(e,a,o),c=!0},p(e,l){!e[16].single&&e[7].length?d?d.p(e,l):(d=co(e),d.c(),d.m(t,n)):d&&(d.d(1),d=null);const s={};8&l[0]&&(s.id=e[3]),8&l[0]&&(s.name=e[3]),8&l[0]&&(s.class=e[3]),2&l[0]&&(s.disabled=e[1]),64&l[0]&&(s.required=e[6]),256&l[0]&&(s.placeholder=e[8]),32768&l[1]&&(s.$$scope={dirty:l,ctx:e}),!o&&128&l[0]&&(o=!0,s.selection=e[7],oe((()=>o=!1))),!r&&512&l[0]&&(r=!0,s.maxOptions=e[9],oe((()=>r=!1))),i.$set(s),e[1]?p&&(ue(),pe(p,1,1,(()=>{p=null})),me()):p?(p.p(e,l),2&l[0]&&fe(p,1)):(p=mo(e),p.c(),fe(p,1),p.m(t,null)),e[10]?$?($.p(e,l),1024&l[0]&&fe($,1)):($=ho(e),$.c(),fe($,1),$.m(a.parentNode,a)):$&&(ue(),pe($,1,1,(()=>{$=null})),me())},i(e){c||(fe(i.$$.fragment,e),fe(p),fe($),c=!0)},o(e){pe(i.$$.fragment,e),pe(p),pe($),c=!1},d(e){e&&S(t),d&&d.d(),we(i),p&&p.d(),e&&S(s),$&&$.d(e),e&&S(a)}}}async function*yo(e){yield[{name:e}]}function bo(e,n,i){const o=Y(),{Modal:r,Autocomplete:l}=c;let{classId:s}=n,{id:a}=n,{item:d}=n,{record:u}=n,{value:m}=n,{noForm:f=!1}=n,{disabled:p}=n,{formnovalidate:$}=n,{numberInput:h}=n,{praefix:g}=n,{toDelete:v}=n,{reqQuantity:y}=n,{notifyList:b}=n;const{properties:w={}}=d;let{placeholder:x,hint:k,readonly:I,required:_=!1,lookup:C="",view:S=!1,multi:j,max:q=1e3,generate:N=!1,status:E=!0,refDoc:L}=w;const[F,D]=C.split(":");let z=!1,T=m.map&&m.map((e=>({name:e})))||[];p||=I,p&&(x="");H((async()=>{const e=document.getElementById(a);e.classList.add(s),!I&&C&&e.addEventListener("focus",A)}));const A=()=>{if(C){document.getElementById(a).blur();const e=y||q;(j.unique||T.length<e)&&i(10,z=!0)}},B=()=>{i(10,z&&=!1)},V=({detail:e})=>{i(7,T=e.list.map((e=>({name:e})))),o("blur",{value:e.list}),o("multi",{view:j.view,lookup:C,name:d.name,value:e.list}),B()},O=async()=>{const e={[D]:u[D]},n=await t.getSectionView(F,e),i=Array.from({length:n.length},((e,t)=>n[t][d.name]));V({detail:{list:i}})},M=(e=!1)=>{if(p||!j.required)return;const t=j.maxItem;if(!t||j.unique)return;i(9,q=!1!==e?e:y||u[t]||0);const n=T.length!=q,r=document.getElementById(a);r?.classList?.toggle("invalid",n),o("invalid",{idx:g,value:n})};return e.$$set=e=>{"classId"in e&&i(2,s=e.classId),"id"in e&&i(3,a=e.id),"item"in e&&i(4,d=e.item),"record"in e&&i(5,u=e.record),"value"in e&&i(0,m=e.value),"noForm"in e&&i(28,f=e.noForm),"disabled"in e&&i(1,p=e.disabled),"formnovalidate"in e&&i(29,$=e.formnovalidate),"numberInput"in e&&i(30,h=e.numberInput),"praefix"in e&&i(31,g=e.praefix),"toDelete"in e&&i(32,v=e.toDelete),"reqQuantity"in e&&i(33,y=e.reqQuantity),"notifyList"in e&&i(34,b=e.notifyList)},e.$$.update=()=>{48&e.$$.dirty[0]&&u&&""===u[d.name]&&i(7,T=[]),48&e.$$.dirty[0]&&u&&Array.isArray(u[d.name])&&i(7,T=u[d.name].map((e=>({name:e})))),16&e.$$.dirty[0]|2&e.$$.dirty[1]&&v&&v===d.name&&i(7,T=[]),128&e.$$.dirty[0]&&T&&(i(0,m=T.map&&T.map((e=>e.name))||[]),M()),1073741824&e.$$.dirty[0]&&((e={})=>{const{item:t,value:n,idx:i}=e;void 0!==g&&g!==i||t&&t.name===j.maxItem&&M(n)})(h),536870976&e.$$.dirty[0]&&i(6,_=_&&!$),8&e.$$.dirty[1]&&(async e=>{if(void 0===g)return;const{itemName:n,value:r}=e||{};if(!r)return;if(d.refItem?.split(".")[0]!==n)return;const[l,s]=d.refItem.split("."),a=await t.getTask(l,r);if(!a||!a[s])return;const c=a[s];if(!Array.isArray(c)&&!c.length)return;const u=c[g][d.name];o("record",{itemName:"quantity",value:u?.length||0}),i(7,T=u&&u.map((e=>({name:e})))),setTimeout(M,250)})(b)},[m,p,s,a,d,u,_,T,x,q,z,r,l,I,C,S,j,N,E,L,F,D,({detail:e})=>{let t=[];e.value.map((e=>{const n=e.name?.split(",");t=t.concat(n)})),i(7,T=t.map((e=>({name:e.trim()})))),o("blur",{value:T.map((e=>e.name))}),o("multi",{view:j.view,lookup:C,value:T.map((e=>e.name))})},B,V,()=>{const e=u[N.itemQuantity]||y;if(!e)return;const t=N.prefix||"",n=u[N.variable]||"",i=N.len||5,o=Array.from({length:e},((e,o)=>t+n+"-"+o.toString().padStart(i,"0")));V({detail:{list:o}})},async()=>{if(!0===S)return O();const e=y||u[j.maxItem];if(!e)return;const n={[D]:u[D],status:!0},i=[].concat(u[j.view]||[]);i.length&&(n[j.view]={$in:i});const o=await t.getSectionView(F,n),r=Array.from({length:e<o.length?e:o.length},((e,t)=>o[t][d.name]));V({detail:{list:r}})},()=>{V({detail:{list:[]}})},f,$,h,g,v,y,b,function(e){T=e,i(7,T),i(5,u),i(4,d),i(32,v)},function(e){q=e,i(9,q)},function(e){z=e,i(10,z)}]}class wo extends ke{constructor(e){var t;super(),ao.getElementById("svelte-1rbaejz-style")||((t=q("style")).id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",_(ao.head,t)),xe(this,e,bo,vo,x,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}const{document:xo}=ge;function ko(e){e[26]=e[28].list,e[27]=e[28].items}function Io(e,t,n){const i=e.slice();return i[29]=t[n],i}function _o(e,t,n){const i=e.slice();return i[32]=t[n],i}function Co(e,t,n){const i=e.slice();return i[32]=t[n],i}function So(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function jo(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g,v;function y(t){e[23](t)}ko(e),n=new e[7]({props:{outline:!0,$$slots:{default:[qo]},$$scope:{ctx:e}}}),n.$on("click",e[22]);let b={id:e[8]};void 0!==e[1]&&(b.value=e[1]),l=new e[6]({props:b}),K.push((()=>ve(l,"value",y))),l.$on("input",e[12]),d=new Be({props:{size:"18"}});let w=e[27]?.length&&function(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=No(Co(e,i,t));return{c(){t=q("thead"),n=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();A(n,"class","svelte-14hcfjl"),A(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n);for(let e=0;e<o.length;e+=1)o[e].m(n,null)},p(e,t){if(2048&t[0]){let r;for(i=e[27],r=0;r<i.length;r+=1){const l=Co(e,i,r);o[r]?o[r].p(l,t):(o[r]=No(l),o[r].c(),o[r].m(n,null))}for(;r<o.length;r+=1)o[r].d(1);o.length=i.length}},d(e){e&&S(t),j(o,e)}}}(e),x=e[26]?.length&&function(e){let t,n=e[26],i=[];for(let t=0;t<n.length;t+=1)i[t]=Fo(Io(e,n,t));return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=F()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);C(e,t,n)},p(e,o){if(11779&o[0]){let r;for(n=e[26],r=0;r<n.length;r+=1){const l=Io(e,n,r);i[r]?i[r].p(l,o):(i[r]=Fo(l),i[r].c(),i[r].m(t.parentNode,t))}for(;r<i.length;r+=1)i[r].d(1);i.length=n.length}},d(e){j(i,e),e&&S(t)}}}(e);return{c(){t=q("div"),ye(n.$$.fragment),i=L(),o=q("div"),r=E("Suchen: "),ye(l.$$.fragment),a=L(),c=q("span"),ye(d.$$.fragment),u=L(),m=q("div"),f=q("table"),w&&w.c(),p=L(),$=q("tbody"),x&&x.c(),A(t,"class","form--buttons svelte-14hcfjl"),A(c,"class","feather pointer svelte-14hcfjl"),O(o,"margin-bottom","1em"),O(o,"position","relative"),A(f,"striped",""),A(f,"class","svelte-14hcfjl"),A(m,"class","eList svelte-14hcfjl")},m(s,y){C(s,t,y),be(n,t,null),C(s,i,y),C(s,o,y),_(o,r),be(l,o,null),_(o,a),_(o,c),be(d,c,null),C(s,u,y),C(s,m,y),_(m,f),w&&w.m(f,null),_(f,p),_(f,$),x&&x.m($,null),h=!0,g||(v=D(c,"click",e[14]),g=!0)},p(e,t){ko(e);const i={};64&t[1]&&(i.$$scope={dirty:t,ctx:e}),n.$set(i);const o={};!s&&2&t[0]&&(s=!0,o.value=e[1],oe((()=>s=!1))),l.$set(o),e[27]?.length&&w.p(e,t),e[26]?.length&&x.p(e,t)},i(e){h||(fe(n.$$.fragment,e),fe(l.$$.fragment,e),fe(d.$$.fragment,e),h=!0)},o(e){pe(n.$$.fragment,e),pe(l.$$.fragment,e),pe(d.$$.fragment,e),h=!1},d(e){e&&S(t),we(n),e&&S(i),e&&S(o),we(l),we(d),e&&S(u),e&&S(m),w&&w.d(),x&&x.d(),g=!1,v()}}}function qo(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function No(e){let t,n,i=e[32]?.designation+"";return{c(){t=q("th"),n=E(i),A(t,"class","svelte-14hcfjl")},m(e,i){C(e,t,i),_(t,n)},p:g,d(e){e&&S(t)}}}function Eo(e){let t,n,i=e[27],o=[];for(let t=0;t<i.length;t+=1)o[t]=Lo(_o(e,i,t));return{c(){t=q("tr");for(let e=0;e<o.length;e+=1)o[e].c();n=L(),A(t,"class","pointer svelte-14hcfjl"),M(t,"active",e[29]._id===e[0])},m(e,i){C(e,t,i);for(let e=0;e<o.length;e+=1)o[e].m(t,null);_(t,n)},p(e,r){if(3584&r[0]){let l;for(i=e[27],l=0;l<i.length;l+=1){const s=_o(e,i,l);o[l]?o[l].p(s,r):(o[l]=Lo(s),o[l].c(),o[l].m(t,n))}for(;l<o.length;l+=1)o[l].d(1);o.length=i.length}2049&r[0]&&M(t,"active",e[29]._id===e[0])},d(e){e&&S(t),j(o,e)}}}function Lo(e){let t,n,i,o,r=e[9](e[29],e[32])+"";return{c(){t=q("td"),n=E(r),A(t,"class","svelte-14hcfjl")},m(r,l){C(r,t,l),_(t,n),i||(o=D(t,"click",T(e[10](e[29]))),i=!0)},p(t,n){e=t},d(e){e&&S(t),i=!1,o()}}}function Fo(e){let t,n=e[13](e[29],e[27],e[1]),i=n&&Eo(e);return{c(){i&&i.c(),t=F()},m(e,n){i&&i.m(e,n),C(e,t,n)},p(e,o){2&o[0]&&(n=e[13](e[29],e[27],e[1])),n?i?i.p(e,o):(i=Eo(e),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(e){i&&i.d(e),e&&S(t)}}}function Do(e){let t,n;return t=new e[5]({}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p:g,i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function zo(e){let t,n,i,o;t=new e[4]({});let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Do,then:jo,catch:So,value:28,blocks:[,,,]};return $e(e[11](),r),{c(){ye(t.$$.fragment),n=L(),i=F(),r.block.c()},m(e,l){be(t,e,l),C(e,n,l),C(e,i,l),r.block.m(e,r.anchor=l),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(t,n){he(r,e=t,n)},i(e){o||(fe(t.$$.fragment,e),fe(r.block),o=!0)},o(e){pe(t.$$.fragment,e);for(let e=0;e<3;e+=1){pe(r.blocks[e])}o=!1},d(e){we(t,e),e&&S(n),e&&S(i),r.block.d(e),r.token=null,r=null}}}function To(e){let t,n;return t=new e[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[zo]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};3&n[0]|64&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ao(e,i,o){const r=Y(),{Dialog:l,Divider:s,Loading:a,TextField:d,Button:u}=c;let{item:m}=i,{className:p}=i,{classId:h}=i,{rowId:g}=i,{viewName:v}=i,{viewValue:y}=i,{recordId:b}=i,{filter:w}=i,x="",k=h+Math.floor(9e3*Math.random()+1e3).toString()+"search";const I=(e,t)=>{if(!t)return;const n=e[t.name];return"boolean"==typeof n?$(n):f(e[`_${t.name}`]||e[t.name]||"")},_=t.getSchemaByClass(p);H((()=>{window.setTimeout((()=>{const e=document.querySelector("tr.active");e?e.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(k)?.focus()}),200)})),n.subscribe((async e=>{if(!e)return;const t=await _;e.eventId===t.id&&Zs(t.class,e.eventId)}));return e.$$set=e=>{"item"in e&&o(15,m=e.item),"className"in e&&o(16,p=e.className),"classId"in e&&o(17,h=e.classId),"rowId"in e&&o(0,g=e.rowId),"viewName"in e&&o(18,v=e.viewName),"viewValue"in e&&o(19,y=e.viewValue),"recordId"in e&&o(20,b=e.recordId),"filter"in e&&o(21,w=e.filter)},[g,x,r,l,s,a,d,u,k,I,e=>()=>r("choose",{row:e}),async()=>{const e=await _,n="."+h+"#"+v;document.querySelector(n);let i={[v]:y},o=[];i[v]&&(o=await t.getSectionView(e.class,i,!0)),w&&(o=o.filter((e=>e._id!=w)));let r=[],l=e.display;return l&&l.length?l.map((t=>{const[n,i]=t.split(".");let l=e.list?.find((e=>e.name===n))?.item.find((e=>e.name===i));l&&(l={...l},l.name=`${n}_${i}`,o=o.map((e=>(e[n]&&(e[l.name]=e["_"+n]?e["_"+n][i]:e[n][i]),e)))),l||(l=e.items.find((e=>e.name===n))),r.find((e=>e?.name===n))||r.push(l)})):r=e.items,{list:o,items:r}},({detail:{value:e}})=>{o(1,x=e)},(e,t,n)=>{if(!n)return!0;for(const i of t)if(I(e,i)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{o(1,x="")},m,p,h,v,y,b,w,()=>r("back"),function(e){x=e,o(1,x)}]}class Bo extends ke{constructor(e){var t;super(),xo.getElementById("svelte-14hcfjl-style")||((t=q("style")).id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",_(xo.head,t)),xe(this,e,Ao,To,x,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function Vo(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Oo(e){let t,n,i,o,r;function l(t){e[21](t)}let s={id:e[2],name:e[3].name,inputClass:e[5]||e[1],disabled:e[6],formnovalidate:e[7],readonly:e[13],pattern:e[12],required:e[14],style:"padding-left:2em;"};void 0!==e[0]&&(s.value=e[0]),n=new e[10]({props:s}),K.push((()=>ve(n,"value",l)));let a=!e[6]&&Mo(e);return{c(){t=q("div"),ye(n.$$.fragment),o=L(),a&&a.c(),O(t,"position","relative")},m(e,i){C(e,t,i),be(n,t,null),_(t,o),a&&a.m(t,null),r=!0},p(e,o){const r={};4&o&&(r.id=e[2]),8&o&&(r.name=e[3].name),34&o&&(r.inputClass=e[5]||e[1]),64&o&&(r.disabled=e[6]),128&o&&(r.formnovalidate=e[7]),!i&&1&o&&(i=!0,r.value=e[0],oe((()=>i=!1))),n.$set(r),e[6]?a&&(ue(),pe(a,1,1,(()=>{a=null})),me()):a?(a.p(e,o),64&o&&fe(a,1)):(a=Mo(e),a.c(),fe(a,1),a.m(t,null))},i(e){r||(fe(n.$$.fragment,e),fe(a),r=!0)},o(e){pe(n.$$.fragment,e),pe(a),r=!1},d(e){e&&S(t),we(n),a&&a.d()}}}function Mo(e){let t,n,i,o,r;return n=new rt({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-wbrqzu")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[17]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Wo(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Po(e){let t,n,i;function o(t){e[22](t)}let r={class:"tModal",noClickaway:!0,$$slots:{default:[Ro]},$$scope:{ctx:e}};return void 0!==e[8]&&(r.open=e[8]),t=new e[11]({props:r}),K.push((()=>ve(t,"open",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};268435994&i&&(o.$$scope={dirty:i,ctx:e}),!n&&256&i&&(n=!0,o.open=e[8],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function Ro(e){let t,n;return t=new Bo({props:{item:e[3],className:e[3].refClass,classId:e[1],rowId:"",recordId:e[4]._id,viewName:e[15].selection,viewValue:e[9],filter:e[4]._id}}),t.$on("choose",e[18]),t.$on("back",e[19]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};8&n&&(i.item=e[3]),8&n&&(i.className=e[3].refClass),2&n&&(i.classId=e[1]),16&n&&(i.recordId=e[4]._id),512&n&&(i.viewValue=e[9]),16&n&&(i.filter=e[4]._id),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ho(e){let t,n,i,o={ctx:e,current:null,token:null,hasCatch:!1,pending:Wo,then:Oo,catch:Vo,value:27,blocks:[,,,]};$e(e[16](),o);let r=e[8]&&Po(e);return{c(){o.block.c(),t=L(),r&&r.c(),n=F()},m(e,l){o.block.m(e,o.anchor=l),o.mount=()=>t.parentNode,o.anchor=t,C(e,t,l),r&&r.m(e,l),C(e,n,l),i=!0},p(t,[i]){he(o,e=t,i),e[8]?r?(r.p(e,i),256&i&&fe(r,1)):(r=Po(e),r.c(),fe(r,1),r.m(n.parentNode,n)):r&&(ue(),pe(r,1,1,(()=>{r=null})),me())},i(e){i||(fe(o.block),fe(r),i=!0)},o(e){for(let e=0;e<3;e+=1){pe(o.blocks[e])}pe(r),i=!1},d(e){o.block.d(e),o.token=null,o=null,e&&S(t),r&&r.d(e),e&&S(n)}}}function Qo(e,t,n){const{TextField:i,Modal:o}=c;let{classId:r}=t,{id:l}=t,{item:s}=t,{record:a}=t,{value:d}=t,{noForm:u=!1}=t,{disabled:m}=t,{formnovalidate:f}=t,{praefix:p}=t;const{properties:$={}}=s;let h,{pattern:g,placeholder:v,readonly:y,required:b=!1,view:w}=$,x=!1;const k=()=>{n(8,x=!1)};return e.$$set=e=>{"classId"in e&&n(1,r=e.classId),"id"in e&&n(2,l=e.id),"item"in e&&n(3,s=e.item),"record"in e&&n(4,a=e.record),"value"in e&&n(0,d=e.value),"noForm"in e&&n(5,u=e.noForm),"disabled"in e&&n(6,m=e.disabled),"formnovalidate"in e&&n(7,f=e.formnovalidate),"praefix"in e&&n(20,p=e.praefix)},[d,r,l,s,a,u,m,f,x,h,i,o,g,y,b,w,async()=>(n(9,h=a[w.selection]),!0),()=>{n(8,x=!0)},({detail:e})=>{n(0,d=e.row[w.value?w.value:"_id"]),k()},k,p,function(e){d=e,n(0,d)},function(e){x=e,n(8,x)}]}class Yo extends ke{constructor(e){var t;super(),document.getElementById("svelte-wbrqzu-style")||((t=q("style")).id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",_(document.head,t)),xe(this,e,Qo,Ho,x,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function Go(e,t,n){const i=e.slice();return i[12]=t[n][0],i[13]=t[n][1],i}function Uo(e){let t;return{c(){t=q("option"),t.textContent="- ",t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Ko(e){let t;return{c(){t=q("option"),t.textContent="-- Bitte wählen -- ",t.disabled=!0,t.selected=!0,t.__value="",t.value=t.__value},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Jo(e){let t,n,i,o,r=e[12]+"";return{c(){t=q("option"),n=E(r),t.__value=i=e[13],t.value=t.__value,t.selected=o=e[0]==e[13]},m(e,i){C(e,t,i),_(t,n)},p(e,l){64&l&&r!==(r=e[12]+"")&&B(n,r),64&l&&i!==(i=e[13])&&(t.__value=i,t.value=t.__value),65&l&&o!==(o=e[0]==e[13])&&(t.selected=o)},d(e){e&&S(t)}}}function Zo(e){let t,n,i,o,r,l=!e[7]&&function(e){let t;function n(e,t){return e[5]&&!0!==e[8]?Ko:Uo}let i=n(e),o=i(e);return{c(){o.c(),t=F()},m(e,n){o.m(e,n),C(e,t,n)},p(e,r){i!==(i=n(e))&&(o.d(1),o=i(e),o&&(o.c(),o.m(t.parentNode,t)))},d(e){o.d(e),e&&S(t)}}}(e),s=e[6],a=[];for(let t=0;t<s.length;t+=1)a[t]=Jo(Go(e,s,t));return{c(){t=q("select"),l&&l.c(),n=F();for(let e=0;e<a.length;e+=1)a[e].c();A(t,"class",i=I(e[3]||e[4])+" svelte-5xpzvo"),A(t,"id",e[2]),A(t,"name",e[2]),t.disabled=e[1],t.required=e[5]},m(i,s){C(i,t,s),l&&l.m(t,null),_(t,n);for(let e=0;e<a.length;e+=1)a[e].m(t,null);o||(r=D(t,"change",e[9]),o=!0)},p(e,[n]){if(e[7]||l.p(e,n),65&n){let i;for(s=e[6],i=0;i<s.length;i+=1){const o=Go(e,s,i);a[i]?a[i].p(o,n):(a[i]=Jo(o),a[i].c(),a[i].m(t,null))}for(;i<a.length;i+=1)a[i].d(1);a.length=s.length}24&n&&i!==(i=I(e[3]||e[4])+" svelte-5xpzvo")&&A(t,"class",i),4&n&&A(t,"id",e[2]),4&n&&A(t,"name",e[2]),2&n&&(t.disabled=e[1]),32&n&&(t.required=e[5])},i:g,o:g,d(e){e&&S(t),l&&l.d(),j(a,e),o=!1,r()}}}function Xo(e,t,n){const i=Y();let{id:o}=t,{item:r}=t,{value:l}=t,{noForm:s=!1}=t,{classId:a}=t,{disabled:c}=t,{required:d}=t,{enum:u,regulation:m,readonly:f}=r.properties;u&&(u=u.map((e=>[e,e]))),"valueAddedTax"===m&&(l||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),c||=!!f,c||(c=void 0);return e.$$set=e=>{"id"in e&&n(2,o=e.id),"item"in e&&n(10,r=e.item),"value"in e&&n(0,l=e.value),"noForm"in e&&n(3,s=e.noForm),"classId"in e&&n(4,a=e.classId),"disabled"in e&&n(1,c=e.disabled),"required"in e&&n(5,d=e.required)},[l,c,o,s,a,d,u,m,f,e=>i("blur",{value:e.srcElement.value}),r]}class er extends ke{constructor(e){var t;super(),document.getElementById("svelte-5xpzvo-style")||((t=q("style")).id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}",_(document.head,t)),xe(this,e,Xo,Zo,x,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function tr(e){let t;return{c(){t=E("Stunden")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function nr(e){let t,n;return t=new e[4]({props:{slot:"hours-label",$$slots:{default:[tr]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ir(e){let t;return{c(){t=E("Minuten")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function or(e){let t,n;return t=new e[4]({props:{slot:"minutes-label",$$slots:{default:[ir]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function rr(e){let t;return{c(){t=E("Jetzt")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function lr(e){let t,n;return t=new e[4]({props:{slot:"now-label",$$slots:{default:[rr]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};4096&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function sr(e){let t,n,i,o,r,l,s,a,c;return o=new e[5]({props:{value:e[0],closeOnSelection:!0}}),o.$on("change",e[8]),l=new e[6]({props:{value:e[0],$$slots:{"now-label":[lr],"minutes-label":[or],"hours-label":[nr]},$$scope:{ctx:e}}}),l.$on("change",e[7]),{c(){t=q("input"),i=L(),ye(o.$$.fragment),r=L(),ye(l.$$.fragment),A(t,"type","string"),A(t,"class",n=e[2]||e[3]),A(t,"id",e[1]),A(t,"name",e[1]),t.hidden=!0},m(n,d){C(n,t,d),V(t,e[0]),C(n,i,d),be(o,n,d),C(n,r,d),be(l,n,d),s=!0,a||(c=D(t,"input",e[9]),a=!0)},p(e,[i]){(!s||12&i&&n!==(n=e[2]||e[3]))&&A(t,"class",n),(!s||2&i)&&A(t,"id",e[1]),(!s||2&i)&&A(t,"name",e[1]),1&i&&V(t,e[0]);const r={};1&i&&(r.value=e[0]),o.$set(r);const a={};1&i&&(a.value=e[0]),4096&i&&(a.$$scope={dirty:i,ctx:e}),l.$set(a)},i(e){s||(fe(o.$$.fragment,e),fe(l.$$.fragment,e),s=!0)},o(e){pe(o.$$.fragment,e),pe(l.$$.fragment,e),s=!1},d(e){e&&S(t),e&&S(i),we(o,e),e&&S(r),we(l,e),a=!1,c()}}}function ar(e,t,n){const i=Y(),{Label:o,DatePicker:r,TimePicker:l}=c;let{value:s}=t,{id:a}=t,{noForm:d=!1}=t,{classId:u}=t;const m=e=>i("change",{value:e});return e.$$set=e=>{"value"in e&&n(0,s=e.value),"id"in e&&n(1,a=e.id),"noForm"in e&&n(2,d=e.noForm),"classId"in e&&n(3,u=e.classId)},[s,a,d,u,o,r,l,({detail:e})=>{var t,i;n(0,(t=e.value,i=s,s=null==t||null==i?t:(i.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),i))),m(s)},({detail:e})=>{n(0,s=Sn(e.value,s)),m(s)},function(){s=this.value,n(0,s)}]}class cr extends ke{constructor(e){super(),xe(this,e,ar,sr,x,{value:0,id:1,noForm:2,classId:3})}}function dr(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h;return u=new e[9]({props:{format:e[5],required:e[3],disabled:e[4],value:e[7],closeOnSelection:!0}}),u.$on("change",e[10]),f=new e[9]({props:{format:e[6],required:e[3],disabled:e[4],value:e[8],class:"moveLeft",closeOnSelection:!0}}),f.$on("change",e[11]),{c(){t=q("input"),r=L(),l=q("input"),d=L(),ye(u.$$.fragment),m=E(" /\n"),ye(f.$$.fragment),A(t,"type","string"),A(t,"class",n=e[1]||e[2]),A(t,"id",i=e[0]+"_from"),A(t,"name",o=e[0]+"_from"),t.hidden=!0,A(l,"type","string"),A(l,"class",s=e[1]||e[2]),A(l,"id",a=e[0]+"_to"),A(l,"name",c=e[0]+"_to"),l.hidden=!0},m(n,i){C(n,t,i),V(t,e[7]),C(n,r,i),C(n,l,i),V(l,e[8]),C(n,d,i),be(u,n,i),C(n,m,i),be(f,n,i),p=!0,$||(h=[D(t,"input",e[13]),D(l,"input",e[14])],$=!0)},p(e,[r]){(!p||6&r&&n!==(n=e[1]||e[2]))&&A(t,"class",n),(!p||1&r&&i!==(i=e[0]+"_from"))&&A(t,"id",i),(!p||1&r&&o!==(o=e[0]+"_from"))&&A(t,"name",o),128&r&&V(t,e[7]),(!p||6&r&&s!==(s=e[1]||e[2]))&&A(l,"class",s),(!p||1&r&&a!==(a=e[0]+"_to"))&&A(l,"id",a),(!p||1&r&&c!==(c=e[0]+"_to"))&&A(l,"name",c),256&r&&V(l,e[8]);const d={};32&r&&(d.format=e[5]),8&r&&(d.required=e[3]),16&r&&(d.disabled=e[4]),128&r&&(d.value=e[7]),u.$set(d);const m={};64&r&&(m.format=e[6]),8&r&&(m.required=e[3]),16&r&&(m.disabled=e[4]),256&r&&(m.value=e[8]),f.$set(m)},i(e){p||(fe(u.$$.fragment,e),fe(f.$$.fragment,e),p=!0)},o(e){pe(u.$$.fragment,e),pe(f.$$.fragment,e),p=!1},d(e){e&&S(t),e&&S(r),e&&S(l),e&&S(d),we(u,e),e&&S(m),we(f,e),$=!1,b(h)}}}function ur(e,t,n){const i=Y(),{DatePicker:o}=c;let{value:r}=t,{id:l}=t,{noForm:s=!1}=t,{classId:a}=t,{required:d}=t,{disabled:u}=t,m="%d.%m.%Y",f="%d.%m.%Y",p=r?.from,$=r?.to;"Invalid Date"===p?.toString()&&(p=void 0),"Invalid Date"===$?.toString()&&($=void 0),u&&(void 0===p&&(m=""),void 0===$&&(f=""));return e.$$set=e=>{"value"in e&&n(12,r=e.value),"id"in e&&n(0,l=e.id),"noForm"in e&&n(1,s=e.noForm),"classId"in e&&n(2,a=e.classId),"required"in e&&n(3,d=e.required),"disabled"in e&&n(4,u=e.disabled)},[l,s,a,d,u,m,f,p,$,o,({detail:e})=>{n(7,p=Sn(e.value,p)),$&&p&&$.valueOf()-p.valueOf()<0&&n(7,p=void 0),i("change",{value:p,range:"_from"})},({detail:e})=>{n(8,$=Sn(e.value,$)),$&&p&&$.valueOf()-p.valueOf()<0&&n(8,$=void 0),i("change",{value:$,range:"_to"})},r,function(){p=this.value,n(7,p)},function(){$=this.value,n(8,$)}]}class mr extends ke{constructor(e){var t;super(),document.getElementById("svelte-7itxk4-style")||((t=q("style")).id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",_(document.head,t)),xe(this,e,ur,dr,x,{value:12,id:0,noForm:1,classId:2,required:3,disabled:4})}}function fr(e){let t,n,i;return n=new e[5]({props:{type:"string",inputClass:e[2],id:e[0],name:e[0],value:e[1],pattern:pr,placeholder:$r,readonly:e[3],disabled:e[4]}}),n.$on("change",e[6]),{c(){t=q("div"),ye(n.$$.fragment),O(t,"max-width","4em")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p(e,[t]){const i={};4&t&&(i.inputClass=e[2]),1&t&&(i.id=e[0]),1&t&&(i.name=e[0]),2&t&&(i.value=e[1]),8&t&&(i.readonly=e[3]),16&t&&(i.disabled=e[4]),n.$set(i)},i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}const pr="([01][0-9]|2[0-3]):([0-5][0-9])",$r="";function hr(e,t,n){const i=Y(),{TextField:o}=c;let{id:r}=t,{item:l}=t,{value:s}=t,{inputClass:a}=t,{readonly:d}=t,{disabled:u}=t,{praefix:m}=t;const f=e=>{if(!e)return"";const[t,n]=e.split(":");return 4===t.length?`${t.substr(0,2)}:${t.substring(2,4)}`:3===t.length?t.substring(0,2)>23?`0${t.substring(0,1)}:${t.substring(1,3)}`:`${t.substring(0,2)}:${t.substring(2,3)}0`:2===t.length?t>23?`0${t.substring(0,1)}:${t.substring(1,2)}0`:`${t}:${(n||"0").padStart(2,"0")}`:`0${t}:${(n||"0").padStart(2,"0")}`};return e.$$set=e=>{"id"in e&&n(0,r=e.id),"item"in e&&n(7,l=e.item),"value"in e&&n(1,s=e.value),"inputClass"in e&&n(2,a=e.inputClass),"readonly"in e&&n(3,d=e.readonly),"disabled"in e&&n(4,u=e.disabled),"praefix"in e&&n(8,m=e.praefix)},[r,s,a,d,u,o,({detail:e})=>{i("blur",{value:f(e.value)}),i("checkRange",{idx:m,fieldId:r,value:e.value})},l,m]}class gr extends ke{constructor(e){var t;super(),document.getElementById("svelte-vvt0yv-style")||((t=q("style")).id="svelte-vvt0yv-style",t.textContent=".text-field input.invalid{border:1px red solid !important}",_(document.head,t)),xe(this,e,hr,fr,x,{id:0,item:7,value:1,inputClass:2,readonly:3,disabled:4,praefix:8})}}const{document:vr}=ge;function yr(e,t,n){const i=e.slice();return i[0]=t[n],i}function br(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function wr(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function xr(e){let t,n,i=e[14],o=[];for(let t=0;t<i.length;t+=1)o[t]=Ir(yr(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(14&n){let l;for(i=e[14],l=0;l<i.length;l+=1){const r=yr(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=Ir(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}function kr(e){let t,n,i=(e[0]["_"+e[17]]||e[0][e[17]])+"",o=e[19]&&function(e){let t;return{c(){t=E(", ")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}();return{c(){t=q("span"),o&&o.c(),n=E(i),A(t,"class","lookupValue")},m(e,i){C(e,t,i),o&&o.m(t,null),_(t,n)},p(e,t){2&t&&i!==(i=(e[0]["_"+e[17]]||e[0][e[17]])+"")&&B(n,i)},d(e){e&&S(t),o&&o.d()}}}function Ir(e){let t,n,i,o,r,l,s,a,c=e[1],d=[];for(let t=0;t<c.length;t+=1)d[t]=kr(br(e,c,t));return o=new Me({props:{size:"18"}}),{c(){t=q("div");for(let e=0;e<d.length;e+=1)d[e].c();n=L(),i=q("span"),ye(o.$$.fragment),r=L(),A(i,"class","feather pointer svelte-1u646ni"),A(t,"class","lookupItem svelte-1u646ni")},m(c,u){C(c,t,u);for(let e=0;e<d.length;e+=1)d[e].m(t,null);_(t,n),_(t,i),be(o,i,null),_(t,r),l=!0,s||(a=D(i,"click",e[3](e[0]._id)),s=!0)},p(i,o){if(e=i,6&o){let i;for(c=e[1],i=0;i<c.length;i+=1){const r=br(e,c,i);d[i]?d[i].p(r,o):(d[i]=kr(r),d[i].c(),d[i].m(t,n))}for(;i<d.length;i+=1)d[i].d(1);d.length=c.length}},i(e){l||(fe(o.$$.fragment,e),l=!0)},o(e){pe(o.$$.fragment,e),l=!1},d(e){e&&S(t),j(d,e),we(o),s=!1,a()}}}function _r(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Cr(e){let t,n,i={ctx:e,current:null,token:null,hasCatch:!1,pending:_r,then:xr,catch:wr,value:14,blocks:[,,,]};return $e(e[2](),i),{c(){t=q("div"),i.block.c(),A(t,"class","lookup svelte-1u646ni")},m(e,o){C(e,t,o),i.block.m(t,i.anchor=null),i.mount=()=>t,i.anchor=null,n=!0},p(t,[n]){he(i,e=t,n)},i(e){n||(fe(i.block),n=!0)},o(e){for(let e=0;e<3;e+=1){pe(i.blocks[e])}n=!1},d(e){e&&S(t),i.block.d(),i.token=null,i=null}}}function Sr(e,n,i){let{id:o}=n,{item:r}=n,{praefix:l}=n,{record:s}=n;const{refItem:a,view:c}=r.properties;let d=c.split(","),[u,m]=a.split(":");const[f,p]=m.split("."),$=()=>{ne().then((()=>{const e=document.querySelector("div.form-field."+r.name);e&&(e.style.display="none")}))};return e.$$set=e=>{"id"in e&&i(4,o=e.id),"item"in e&&i(0,r=e.item),"praefix"in e&&i(5,l=e.praefix),"record"in e&&i(6,s=e.record)},[r,d,async()=>{let e=[];if(s._id){const n=!d.some((e=>e.includes(":")));p&&(u=p+"."+u);const o={[u]:s[u]||s._id};if(e=await t.getSectionView(f,o,n),!n){const t=d.find((e=>e.includes(":"))).split(":")[0];e=e.map((e=>{const n=e[t].find((e=>e[t]===s._id));return n._id=e._id,n})),i(1,d=d.map((e=>e.split(":")[1])))}}return e.length||$(),e},e=>async()=>{const n=await t.getTaskByDocId(e);if(!n)return;const i=n._id,o=`/task/${n.event}/${i}/task?view=standalone`;window.open(o)},o,l,s]}class jr extends ke{constructor(e){var t;super(),vr.getElementById("svelte-1u646ni-style")||((t=q("style")).id="svelte-1u646ni-style",t.textContent=".feather.svelte-1u646ni{position:absolute;top:0;left:-1.5em;color:#4300b0}div.lookup.svelte-1u646ni{margin-top:0.75em;color:#aaa}div.lookupItem.svelte-1u646ni{position:relative;margin-left:2em}div.form-field:has(div.lookup){margin-bottom:0.5em !important}div.field:has(div.lookupItem){background-color:#f5f5f5 !important}",_(vr.head,t)),xe(this,e,Sr,Cr,x,{id:4,item:0,praefix:5,record:6})}}function qr(e){let t,n,i;return n=new Ke({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function Nr(e){let t,n,i,o,r;return n=new Ke({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[9]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Er(e){let t,n,i,o,r,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[Nr,qr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),ye(n.$$.fragment),i=L(),r.c(),O(t,"position","relative")},m(e,r){C(e,t,r),be(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(ue(),pe(a[d],1,1,(()=>{a[d]=null})),me(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),fe(r,1),r.m(t,null))},i(e){l||(fe(n.$$.fragment,e),fe(r),l=!0)},o(e){pe(n.$$.fragment,e),pe(r),l=!1},d(e){e&&S(t),we(n),a[o].d()}}}function Lr(e,n,i){const{TextField:o}=c;let{inputClass:r}=n,{disabled:l}=n,{formnovalidate:s}=n,{readonly:a}=n,{required:d}=n,{id:u}=n,{name:m}=n,{value:f}=n,{record:p}=n,{item:$}=n;return e.$$set=e=>{"inputClass"in e&&i(0,r=e.inputClass),"disabled"in e&&i(1,l=e.disabled),"formnovalidate"in e&&i(2,s=e.formnovalidate),"readonly"in e&&i(3,a=e.readonly),"required"in e&&i(4,d=e.required),"id"in e&&i(5,u=e.id),"name"in e&&i(6,m=e.name),"value"in e&&i(7,f=e.value),"record"in e&&i(10,p=e.record),"item"in e&&i(11,$=e.item)},[r,l,s,a,d,u,m,f,o,async()=>{if(!f)return;const e=m.includes(".")?p[m.split(".")[0]]:p,{street:n,houseNo:i,postcode:o,location:r,country:l}=e,s=[n&&i?n+" "+i:n,o&&r?o+" "+r:o||r||"",l&&(await t.getTask("country",l)).designation].filter((e=>!!e)).join(", "),a="https://bing.com/maps/default.aspx?where1="+encodeURIComponent(s);window.open(a,"_blank")},p,$,function(t){G(e,t)}]}class Fr extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),xe(this,e,Lr,Er,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}function Dr(e){let t,n,i;return n=new Re({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function zr(e){let t,n,i,o,r;return n=new Re({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[9]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Tr(e){let t,n,i,o,r,l;n=new e[8]({props:{inputClass:e[0],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[10]);const s=[zr,Dr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),ye(n.$$.fragment),i=L(),r.c(),O(t,"position","relative")},m(e,r){C(e,t,r),be(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(ue(),pe(a[d],1,1,(()=>{a[d]=null})),me(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),fe(r,1),r.m(t,null))},i(e){l||(fe(n.$$.fragment,e),fe(r),l=!0)},o(e){pe(n.$$.fragment,e),pe(r),l=!1},d(e){e&&S(t),we(n),a[o].d()}}}function Ar(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value)},[o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e=m;e.includes("//")||(e="//"+e),window.open(e,"_blank")},function(t){G(e,t)}]}class Br extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),xe(this,e,Ar,Tr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7})}}function Vr(e){let t,n,i;return n=new Xe({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function Or(e){let t,n,i,o,r;return n=new Xe({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[11]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Mr(e){let t,n,i,o,r,l;n=new e[10]({props:{inputClass:e[2],pattern:e[0],placeholder:e[1],disabled:e[3],formnovalidate:e[4],readonly:e[5],required:e[6],id:e[7],name:e[8],value:e[9]}}),n.$on("change",e[12]);const s=[Or,Vr],a=[];function c(e,t){return e[9]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),ye(n.$$.fragment),i=L(),r.c(),O(t,"position","relative")},m(e,r){C(e,t,r),be(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};4&i&&(l.inputClass=e[2]),1&i&&(l.pattern=e[0]),2&i&&(l.placeholder=e[1]),8&i&&(l.disabled=e[3]),16&i&&(l.formnovalidate=e[4]),32&i&&(l.readonly=e[5]),64&i&&(l.required=e[6]),128&i&&(l.id=e[7]),256&i&&(l.name=e[8]),512&i&&(l.value=e[9]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(ue(),pe(a[d],1,1,(()=>{a[d]=null})),me(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),fe(r,1),r.m(t,null))},i(e){l||(fe(n.$$.fragment,e),fe(r),l=!0)},o(e){pe(n.$$.fragment,e),pe(r),l=!1},d(e){e&&S(t),we(n),a[o].d()}}}function Wr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;f||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{7,8})",p||="+41 58 234 56 78";return e.$$set=e=>{"inputClass"in e&&n(2,o=e.inputClass),"disabled"in e&&n(3,r=e.disabled),"formnovalidate"in e&&n(4,l=e.formnovalidate),"readonly"in e&&n(5,s=e.readonly),"required"in e&&n(6,a=e.required),"id"in e&&n(7,d=e.id),"name"in e&&n(8,u=e.name),"value"in e&&n(9,m=e.value),"pattern"in e&&n(0,f=e.pattern),"placeholder"in e&&n(1,p=e.placeholder)},[f,p,o,r,l,s,a,d,u,m,i,async()=>{if(!m)return;let e="tel:"+m;window.open(e,"_self")},function(t){G(e,t)}]}class Pr extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),xe(this,e,Wr,Mr,x,{inputClass:2,disabled:3,formnovalidate:4,readonly:5,required:6,id:7,name:8,value:9,pattern:0,placeholder:1})}}function Rr(e){let t,n,i;return n=new Ye({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather2 svelte-9up2nn")},m(e,o){C(e,t,o),be(n,t,null),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n)}}}function Hr(e){let t,n,i,o,r;return n=new Ye({props:{size:"18"}}),{c(){t=q("span"),ye(n.$$.fragment),A(t,"class","feather pointer svelte-9up2nn")},m(l,s){C(l,t,s),be(n,t,null),i=!0,o||(r=D(t,"click",e[11]),o=!0)},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n),o=!1,r()}}}function Qr(e){let t,n,i,o,r,l;n=new e[10]({props:{type:"email",inputClass:e[0],pattern:e[8],placeholder:e[9],disabled:e[1],formnovalidate:e[2],readonly:e[3],required:e[4],id:e[5],name:e[6],value:e[7]}}),n.$on("change",e[12]);const s=[Hr,Rr],a=[];function c(e,t){return e[7]?0:1}return o=c(e),r=a[o]=s[o](e),{c(){t=q("div"),ye(n.$$.fragment),i=L(),r.c(),O(t,"position","relative")},m(e,r){C(e,t,r),be(n,t,null),_(t,i),a[o].m(t,null),l=!0},p(e,[i]){const l={};1&i&&(l.inputClass=e[0]),256&i&&(l.pattern=e[8]),512&i&&(l.placeholder=e[9]),2&i&&(l.disabled=e[1]),4&i&&(l.formnovalidate=e[2]),8&i&&(l.readonly=e[3]),16&i&&(l.required=e[4]),32&i&&(l.id=e[5]),64&i&&(l.name=e[6]),128&i&&(l.value=e[7]),n.$set(l);let d=o;o=c(e),o===d?a[o].p(e,i):(ue(),pe(a[d],1,1,(()=>{a[d]=null})),me(),r=a[o],r?r.p(e,i):(r=a[o]=s[o](e),r.c()),fe(r,1),r.m(t,null))},i(e){l||(fe(n.$$.fragment,e),fe(r),l=!0)},o(e){pe(n.$$.fragment,e),pe(r),l=!1},d(e){e&&S(t),we(n),a[o].d()}}}function Yr(e,t,n){const{TextField:i}=c;let{inputClass:o}=t,{disabled:r}=t,{formnovalidate:l}=t,{readonly:s}=t,{required:a}=t,{id:d}=t,{name:u}=t,{value:m}=t,{pattern:f}=t,{placeholder:p}=t;return e.$$set=e=>{"inputClass"in e&&n(0,o=e.inputClass),"disabled"in e&&n(1,r=e.disabled),"formnovalidate"in e&&n(2,l=e.formnovalidate),"readonly"in e&&n(3,s=e.readonly),"required"in e&&n(4,a=e.required),"id"in e&&n(5,d=e.id),"name"in e&&n(6,u=e.name),"value"in e&&n(7,m=e.value),"pattern"in e&&n(8,f=e.pattern),"placeholder"in e&&n(9,p=e.placeholder)},[o,r,l,s,a,d,u,m,f,p,i,async()=>{if(!m)return;let e="mailto:"+m;window.open(e,"_self")},function(t){G(e,t)}]}class Gr extends ke{constructor(e){var t;super(),document.getElementById("svelte-9up2nn-style")||((t=q("style")).id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",_(document.head,t)),xe(this,e,Yr,Qr,x,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,pattern:8,placeholder:9})}}const Ur=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"];function Kr(e){let t;return{c(){t=q("textarea"),A(t,"id",e[0]),O(t,"visibility","hidden")},m(n,i){C(n,t,i),e[18](t)},p(e,n){1&n&&A(t,"id",e[0])},d(n){n&&S(t),e[18](null)}}}function Jr(e){let t;return{c(){t=q("div"),A(t,"id",e[0])},m(n,i){C(n,t,i),e[17](t)},p(e,n){1&n&&A(t,"id",e[0])},d(n){n&&S(t),e[17](null)}}}function Zr(e){let t;function n(e,t){return e[1]?Jr:Kr}let i=n(e),o=i(e);return{c(){t=q("div"),o.c(),A(t,"class",e[2])},m(n,i){C(n,t,i),o.m(t,null),e[19](t)},p(e,[r]){i===(i=n(e))&&o?o.p(e,r):(o.d(1),o=i(e),o&&(o.c(),o.m(t,null))),4&r&&A(t,"class",e[2])},i:g,o:g,d(n){n&&S(t),o.d(),e[19](null)}}}const Xr=e=>e+"_"+Math.floor(1e9*Math.random())+String(Date.now());let el=(()=>{let e={listeners:[],scriptId:Xr("tiny-script"),scriptLoaded:!1,injected:!1};return{load:(t,n,i)=>{e.scriptLoaded?i():(e.listeners.push(i),e.injected||((t,n,i,o)=>{e.injected=!0;const r=n.createElement("script");r.referrerPolicy="origin",r.type="application/javascript",r.src=i,r.onload=()=>{o()},n.head&&n.head.appendChild(r)})(e.scriptId,t,n,(()=>{e.listeners.forEach((e=>e())),e.scriptLoaded=!0})))}}})();function tl(e,t,n){var i;let o,r,l,{id:s=Xr("tinymce-svelte")}=t,{inline:a}=t,{disabled:c=!1}=t,{apiKey:d="no-api-key"}=t,{channel:u="6"}=t,{scriptSrc:m}=t,{conf:f={}}=t,{modelEvents:p="change input undo redo"}=t,{value:$=""}=t,{text:h=""}=t,{cssClass:g="tinymce-wrapper"}=t,v=$,y=c;const b=Y(),w=()=>{const e="undefined"!=typeof window?window:global;return e&&e.tinymce?e.tinymce:null},x=()=>{const e=Object.assign(Object.assign({},f),{target:r,inline:void 0!==a?a:void 0!==f.inline&&f.inline,readonly:c,setup:e=>{n(14,l=e),e.on("init",(()=>{e.setContent($),e.on(p,(()=>{n(15,v=e.getContent()),v!==$&&(n(5,$=v),n(6,h=e.getContent({format:"text"})))}))})),((e,t)=>{Ur.forEach((n=>{e.on(n,(i=>{t(n.toLowerCase(),{eventName:n,event:i,editor:e})}))}))})(e,b),"function"==typeof f.setup&&f.setup(e)}});n(4,r.style.visibility="",r),w().init(e)};return H((()=>{if(null!==w())x();else{const e=m||`https://cdn.tiny.cloud/1/${d}/tinymce/${u}/tinymce.min.js`;el.load(o.ownerDocument,e,(()=>{x()}))}})),Q((()=>{var e;l&&(null===(e=w())||void 0===e||e.remove(l))})),e.$$set=e=>{"id"in e&&n(0,s=e.id),"inline"in e&&n(1,a=e.inline),"disabled"in e&&n(7,c=e.disabled),"apiKey"in e&&n(8,d=e.apiKey),"channel"in e&&n(9,u=e.channel),"scriptSrc"in e&&n(10,m=e.scriptSrc),"conf"in e&&n(11,f=e.conf),"modelEvents"in e&&n(12,p=e.modelEvents),"value"in e&&n(5,$=e.value),"text"in e&&n(6,h=e.text),"cssClass"in e&&n(2,g=e.cssClass)},e.$$.update=()=>{123040&e.$$.dirty&&(l&&v!==$&&(l.setContent($),n(6,h=l.getContent({format:"text"}))),l&&c!==y&&(n(16,y=c),"function"==typeof(null===n(13,i=l.mode)||void 0===i?void 0:i.set)?l.mode.set(c?"readonly":"design"):l.setMode(c?"readonly":"design")))},[s,a,g,o,r,$,h,c,d,u,m,f,p,i,l,v,y,function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{r=e,n(4,r)}))},function(e){K[e?"unshift":"push"]((()=>{o=e,n(3,o)}))}]}class nl extends ke{constructor(e){super(),xe(this,e,tl,Zr,x,{id:0,inline:1,disabled:7,apiKey:8,channel:9,scriptSrc:10,conf:11,modelEvents:12,value:5,text:6,cssClass:2})}}function il(e){let t,n,i,o,r,l,s;function a(t){e[7](t)}let c={apiKey:"fdzr5donqxlwonl0pkqm8pcogxwbbrjco9jzw0suy9mxu17n",conf:e[6],disabled:e[4],readonly:e[5]};return void 0!==e[0]&&(c.value=e[0]),n=new nl({props:c}),K.push((()=>ve(n,"value",a))),{c(){t=q("div"),ye(n.$$.fragment),o=L(),r=q("input"),A(r,"class",l=e[1]||e[2]),A(r,"id",e[3]),A(r,"name",e[3]),r.value=e[0],r.hidden=!0,O(t,"min-height","10em")},m(e,i){C(e,t,i),be(n,t,null),_(t,o),_(t,r),s=!0},p(e,[t]){const o={};16&t&&(o.disabled=e[4]),32&t&&(o.readonly=e[5]),!i&&1&t&&(i=!0,o.value=e[0],oe((()=>i=!1))),n.$set(o),(!s||6&t&&l!==(l=e[1]||e[2]))&&A(r,"class",l),(!s||8&t)&&A(r,"id",e[3]),(!s||8&t)&&A(r,"name",e[3]),(!s||1&t&&r.value!==e[0])&&(r.value=e[0])},i(e){s||(fe(n.$$.fragment,e),s=!0)},o(e){pe(n.$$.fragment,e),s=!1},d(e){e&&S(t),we(n)}}}function ol(e,t,n){let{value:i}=t,{noForm:o}=t,{classId:r}=t,{id:l}=t,{disabled:s}=t,{readonly:a}=t;return e.$$set=e=>{"value"in e&&n(0,i=e.value),"noForm"in e&&n(1,o=e.noForm),"classId"in e&&n(2,r=e.classId),"id"in e&&n(3,l=e.id),"disabled"in e&&n(4,s=e.disabled),"readonly"in e&&n(5,a=e.readonly)},[i,o,r,l,s,a,{plugins:"advlist numlist link image lists table preview emoticons fullscreen",menu:{file:{title:"File",items:"preview"}},menubar:"edit view insert format table",height:600},function(e){i=e,n(0,i)}]}class rl extends ke{constructor(e){var t;super(),document.getElementById("svelte-1my9uv1-style")||((t=q("style")).id="svelte-1my9uv1-style",t.textContent="div.tox-statusbar{display:none !important}",_(document.head,t)),xe(this,e,ol,il,x,{value:0,noForm:1,classId:2,id:3,disabled:4,readonly:5})}}function ll(e){let t,n;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+(e[20]?" hidden ":""),name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[Sl,({notifyList:e})=>({18:e}),({notifyList:e})=>[e?262144:0]]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};1048578&n[0]&&(i.class=e[1].name+(e[20]?" hidden ":"")),2&n[0]&&(i.name=e[1].designation),2&n[0]&&(i.help=e[1].properties?.hint),57671679&n[0]|33554432&n[1]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function sl(e){let t,n;return t=new e[30]({props:{text:e[1].designation}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};2&n[0]&&(i.text=e[1].designation),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function al(e){let t,n,i,o;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+(e[20]?" hidden ":""),name:e[1].designation,help:e[1].properties?.hint}}),i=new rl({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[1].name,value:e[24](),noForm:e[6]}}),i.$on("blur",e[35]()),{c(){ye(t.$$.fragment),n=L(),ye(i.$$.fragment)},m(e,r){be(t,e,r),C(e,n,r),be(i,e,r),o=!0},p(e,n){const o={};1048578&n[0]&&(o.class=e[1].name+(e[20]?" hidden ":"")),2&n[0]&&(o.name=e[1].designation),2&n[0]&&(o.help=e[1].properties?.hint),t.$set(o);const r={};128&n[0]&&(r.classId=e[7]),8&n[0]&&(r.disabled=e[3]),524288&n[0]&&(r.readonly=e[19]),2&n[0]&&(r.name=e[1].name),16777216&n[0]&&(r.value=e[24]()),64&n[0]&&(r.noForm=e[6]),i.$set(r)},i(e){o||(fe(t.$$.fragment,e),fe(i.$$.fragment,e),o=!0)},o(e){pe(t.$$.fragment,e),pe(i.$$.fragment,e),o=!1},d(e){we(t,e),e&&S(n),we(i,e)}}}function cl(e){let t,n,i,o,r,l;return t=new e[26]({props:{id:e[39](e[32]),class:e[1].name+" hidden",name:e[1].designation,help:e[1].properties?.hint,$$slots:{default:[jl]},$$scope:{ctx:e}}}),i=new e[30]({props:{text:e[25]}}),r=new zi({props:{required:e[4],disabled:e[3],readonly:e[19],id:e[32],item:e[1],value:e[24]()}}),r.$on("setRefValue",e[40]),r.$on("safeReference",e[44]),{c(){ye(t.$$.fragment),n=L(),ye(i.$$.fragment),o=L(),ye(r.$$.fragment)},m(e,s){be(t,e,s),C(e,n,s),be(i,e,s),C(e,o,s),be(r,e,s),l=!0},p(e,n){const o={};2&n[0]&&(o.class=e[1].name+" hidden"),2&n[0]&&(o.name=e[1].designation),2&n[0]&&(o.help=e[1].properties?.hint),25166210&n[0]|33554432&n[1]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o);const l={};33554432&n[0]&&(l.text=e[25]),i.$set(l);const s={};16&n[0]&&(s.required=e[4]),8&n[0]&&(s.disabled=e[3]),524288&n[0]&&(s.readonly=e[19]),2&n[0]&&(s.item=e[1]),16777216&n[0]&&(s.value=e[24]()),r.$set(s)},i(e){l||(fe(t.$$.fragment,e),fe(i.$$.fragment,e),fe(r.$$.fragment,e),l=!0)},o(e){pe(t.$$.fragment,e),pe(i.$$.fragment,e),pe(r.$$.fragment,e),l=!1},d(e){we(t,e),e&&S(n),we(i,e),e&&S(o),we(r,e)}}}function dl(e){let t,n;return t=new e[27]({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],pattern:e[21],required:!0===e[4],placeholder:e[22],id:e[32],name:e[31],value:e[24]()}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),2097152&n[0]&&(i.pattern=e[21]),16&n[0]&&(i.required=!0===e[4]),4194304&n[0]&&(i.placeholder=e[22]),16777216&n[0]&&(i.value=e[24]()),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ul(e){let t,n;return t=new Pr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),2097152&n[0]&&(i.pattern=e[21]),4194304&n[0]&&(i.placeholder=e[22]),16777216&n[0]&&(i.value=e[24]()),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ml(e){let t,n;return t=new Br({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[24]()}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),16777216&n[0]&&(i.value=e[24]()),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function fl(e){let t,n;return t=new Gr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],pattern:e[21],placeholder:e[22],value:e[24]()}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),2097152&n[0]&&(i.pattern=e[21]),4194304&n[0]&&(i.placeholder=e[22]),16777216&n[0]&&(i.value=e[24]()),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function pl(e){let t,n;return t=new gr({props:{inputClass:e[6]||e[7],disabled:e[3],readonly:e[19],required:e[4],id:e[32],item:e[1],value:e[24](),praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("checkRange",e[49]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),2&n[0]&&(i.item=e[1]),16777216&n[0]&&(i.value=e[24]()),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function $l(e){let t,n;return t=new jr({props:{id:e[32],item:e[1],praefix:e[5],record:e[0]}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};2&n[0]&&(i.item=e[1]),32&n[0]&&(i.praefix=e[5]),1&n[0]&&(i.record=e[0]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function hl(e){let t,n;return t=new Fr({props:{inputClass:e[6]||e[7],disabled:e[3],formnovalidate:e[10],readonly:e[19],required:e[4],id:e[32],name:e[31],value:e[24](),record:e[0],item:e[1]}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),16&n[0]&&(i.required=e[4]),16777216&n[0]&&(i.value=e[24]()),1&n[0]&&(i.record=e[0]),2&n[0]&&(i.item=e[1]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function gl(e){let t,n;return t=new cr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[33](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function vl(e){let t,n;return t=new mr({props:{classId:e[7],id:e[32],disabled:e[3],required:e[4],value:e[34](),noForm:e[6]}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function yl(e){let t,n;return t=new e[28]({props:{inputClass:e[6]||e[7],required:e[4],disabled:e[3],id:e[32],name:e[31],value:e[33](),closeOnSelection:!0}}),t.$on("change",e[35](!0)),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function bl(e){let t,n;return t=new e[29]({props:{round:!0,inputClass:e[6]||e[7],disabled:e[3]||e[19],required:e[4],id:e[32],name:e[31],checked:e[24]()}}),t.$on("change",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};192&n[0]&&(i.inputClass=e[6]||e[7]),524296&n[0]&&(i.disabled=e[3]||e[19]),16&n[0]&&(i.required=e[4]),16777216&n[0]&&(i.checked=e[24]()),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function wl(e){let t,n;return t=new Yo({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],view:e[1].properties.view,praefix:e[5]}}),t.$on("blur",e[35]()),t.$on("invalid",e[48]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),2&n[0]&&(i.item=e[1]),1&n[0]&&(i.record=e[0]),16777216&n[0]&&(i.value=e[24]()),64&n[0]&&(i.noForm=e[6]),2&n[0]&&(i.view=e[1].properties.view),32&n[0]&&(i.praefix=e[5]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function xl(e){let t,n;return t=new wo({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],record:e[0],value:e[24](),noForm:e[6],multi:e[1].properties.multi,numberInput:e[12],praefix:e[5],toDelete:e[15],reqQuantity:e[16],notifyList:e[18]}}),t.$on("blur",e[35]()),t.$on("invalid",e[47]),t.$on("record",e[36]),t.$on("multi",e[37]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),2&n[0]&&(i.item=e[1]),1&n[0]&&(i.record=e[0]),16777216&n[0]&&(i.value=e[24]()),64&n[0]&&(i.noForm=e[6]),2&n[0]&&(i.multi=e[1].properties.multi),4096&n[0]&&(i.numberInput=e[12]),32&n[0]&&(i.praefix=e[5]),32768&n[0]&&(i.toDelete=e[15]),65536&n[0]&&(i.reqQuantity=e[16]),262144&n[0]&&(i.notifyList=e[18]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function kl(e){let t,n;return t=new Vi({props:{classId:e[7],disabled:e[3],formnovalidate:e[10],required:e[4],readonly:e[19],id:e[32],item:e[1],currency:e[17],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),16&n[0]&&(i.required=e[4]),524288&n[0]&&(i.readonly=e[19]),2&n[0]&&(i.item=e[1]),131072&n[0]&&(i.currency=e[17]),16777216&n[0]&&(i.value=e[24]()),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Il(e){let t,n;return t=new er({props:{classId:e[7],disabled:e[3],required:e[4],id:e[32],item:e[1],value:e[24](),noForm:e[6]}}),t.$on("blur",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),16&n[0]&&(i.required=e[4]),2&n[0]&&(i.item=e[1]),16777216&n[0]&&(i.value=e[24]()),64&n[0]&&(i.noForm=e[6]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function _l(e){let t,n;return t=new o({props:{classId:e[7],disabled:e[3],readonly:e[19],id:e[32],name:e[1].name,value:e[24](),noForm:e[6],placeholder:e[1].properties?.placeholder}}),t.$on("blur",e[35]()),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),8&n[0]&&(i.disabled=e[3]),524288&n[0]&&(i.readonly=e[19]),2&n[0]&&(i.name=e[1].name),16777216&n[0]&&(i.value=e[24]()),64&n[0]&&(i.noForm=e[6]),2&n[0]&&(i.placeholder=e[1].properties?.placeholder),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Cl(e){let t,n;return t=new kn({props:{classId:e[7],eventId:e[8],required:e[4],disabled:e[3],formnovalidate:e[10],readonly:e[19],id:e[32],item:e[1],desc:e[25],value:e[24](),noForm:e[6],praefix:e[5],selectionFields:e[9],selection:e[11],deList:e[13],recordId:e[2],isTemplate:e[14]}}),t.$on("task",e[45]),t.$on("change",e[35]()),t.$on("initFail",e[38]),t.$on("defPrep",e[46]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),16&n[0]&&(i.required=e[4]),8&n[0]&&(i.disabled=e[3]),1024&n[0]&&(i.formnovalidate=e[10]),524288&n[0]&&(i.readonly=e[19]),2&n[0]&&(i.item=e[1]),33554432&n[0]&&(i.desc=e[25]),16777216&n[0]&&(i.value=e[24]()),64&n[0]&&(i.noForm=e[6]),32&n[0]&&(i.praefix=e[5]),512&n[0]&&(i.selectionFields=e[9]),2048&n[0]&&(i.selection=e[11]),8192&n[0]&&(i.deList=e[13]),4&n[0]&&(i.recordId=e[2]),16384&n[0]&&(i.isTemplate=e[14]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Sl(e){let t,n,i,o;const r=[Cl,_l,Il,kl,xl,wl,bl,yl,vl,gl,hl,$l,pl,fl,ml,ul,dl],l=[];function s(e,t){return"object"===e[1].type?0:"textarea"===e[1].type||e[1].properties&&"textarea"===e[1].properties.format?1:e[1].properties&&(e[1].properties.enum||e[1].properties.regulation)?2:"number"===e[1].type?3:e[1].properties&&e[1].properties.multi?4:e[1].properties&&e[1].properties.view&&"lookup"===!e[1].properties.format?5:"boolean"===e[1].type?6:"date"===e[1].type?7:"dateRange"===e[1].type?8:"datetime"===e[1].type?9:"map"===e[1].properties?.format?10:"lookup"===e[1].properties?.format?11:"time"===e[1].properties?.format?12:"email"===e[1].type||"email"===e[1].properties?.format?13:"url"===e[1].properties?.format?14:"tel"===e[1].properties?.format?15:16}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(ue(),pe(l[a],1,1,(()=>{l[a]=null})),me(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),fe(n,1),n.m(i.parentNode,i))},i(e){o||(fe(n),o=!0)},o(e){pe(n),o=!1},d(e){l[t].d(e),e&&S(i)}}}function jl(e){let t,n;return t=new kn({props:{classId:e[7],eventId:e[8],disabled:!0,readonly:!0,id:e[32],item:e[1],value:e[24](),withRefValue:!0,refValue:e[23]}}),t.$on("setRefDesc",e[41]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[0]&&(i.classId=e[7]),256&n[0]&&(i.eventId=e[8]),2&n[0]&&(i.item=e[1]),16777216&n[0]&&(i.value=e[24]()),8388608&n[0]&&(i.refValue=e[23]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ql(e){let t,n,i,o;const r=[cl,al,sl,ll],l=[];function s(e,t){return e[5]||"reference"!==e[1].saveAs||"object"!==e[1].type?"html"===e[1].properties?.format?1:"divider"===e[1].type?2:3:0}return t=s(e),n=l[t]=r[t](e),{c(){n.c(),i=F()},m(e,n){l[t].m(e,n),C(e,i,n),o=!0},p(e,o){let a=t;t=s(e),t===a?l[t].p(e,o):(ue(),pe(l[a],1,1,(()=>{l[a]=null})),me(),n=l[t],n?n.p(e,o):(n=l[t]=r[t](e),n.c()),fe(n,1),n.m(i.parentNode,i))},i(e){o||(fe(n),o=!0)},o(e){pe(n),o=!1},d(e){l[t].d(e),e&&S(i)}}}function Nl(e,t,n){let i,o,r;const l=Y(),{FormField:s,TextField:a,DatePicker:d,TimePicker:u,Checkbox:m,Divider:p}=c;let{praefix:$=""}=t,{item:h}=t,{listName:g=""}=t,{record:v}=t,{recordId:y}=t,{noForm:b=!1}=t,{classId:w}=t,{eventId:x}=t,{disabled:k}=t,{selectionFields:I}=t,{formnovalidate:_}=t,{selection:C=!1}=t,{notifyList:S}=t,{numberInput:j}=t,{deList:q}=t,{required:N}=t,{isTemplate:E}=t,{toDelete:L}=t,{reqQuantity:F}=t,{currency:D}=t,{changeValue:z}=t;y||=v._id;let{required:T,readonly:A,hidden:B,pattern:V,placeholder:O}=h.properties||{};if("tel"===h.properties?.format&&(V||="(\\+4[1-9]\\s?)([1-9]{2}\\s?\\d{3}\\s?\\d{2}\\s?\\d{2})|(\\d{2,4}\\s?\\d{7,8})",O||="+41 58 234 56 78"),B=!0===B,void 0!==A&&(A=!0===A),void 0===N&&(N=T),k=k||!!A,"string"==typeof h.name){const[e,t]=h.name.split("_");t&&(h.name=t)}const M=(g?g+".":"")+h.name,W=M+(""!==$?"-"+$:""),P=(e,t=M)=>{try{return t.split(".").reduce(((e,t)=>e[t]),e)}catch(e){return""}};let R=P(v);return e.$$set=e=>{"praefix"in e&&n(5,$=e.praefix),"item"in e&&n(1,h=e.item),"listName"in e&&n(42,g=e.listName),"record"in e&&n(0,v=e.record),"recordId"in e&&n(2,y=e.recordId),"noForm"in e&&n(6,b=e.noForm),"classId"in e&&n(7,w=e.classId),"eventId"in e&&n(8,x=e.eventId),"disabled"in e&&n(3,k=e.disabled),"selectionFields"in e&&n(9,I=e.selectionFields),"formnovalidate"in e&&n(10,_=e.formnovalidate),"selection"in e&&n(11,C=e.selection),"notifyList"in e&&n(18,S=e.notifyList),"numberInput"in e&&n(12,j=e.numberInput),"deList"in e&&n(13,q=e.deList),"required"in e&&n(4,N=e.required),"isTemplate"in e&&n(14,E=e.isTemplate),"toDelete"in e&&n(15,L=e.toDelete),"reqQuantity"in e&&n(16,F=e.reqQuantity),"currency"in e&&n(17,D=e.currency),"changeValue"in e&&n(43,z=e.changeValue)},e.$$.update=()=>{if(4096&e.$$.dirty[1])for(const e in z)e===M&&n(0,v[M]=z[e],v);1&e.$$.dirty[0]&&n(24,i=(e=M)=>{let t=P(v);return void 0===t?"":t}),1&e.$$.dirty[0]&&(r=P(v))},n(25,o=((e=M)=>{let t=v["_"+e];return t=f(t),void 0===t?"":t})()),[v,h,y,k,N,$,b,w,x,I,_,C,j,q,E,L,F,D,S,A,B,V,O,R,i,o,s,a,d,m,p,M,W,(e=M)=>{let t=P(v);return t?new Date(t):new Date},(e=M)=>{const t=P(v,e+"_from"),n=P(v,e+"_to");return{from:void 0===t?t:new Date(t),to:void 0===n?n:new Date(n)}},e=>({detail:t})=>{let{value:i,checked:o,range:s}=t;void 0!==o&&(i=o);const a=M+(s||"");n(0,v[a]=e?function(e,t){if(null==e)return null;let n=e.getHours();return/%p/i.test(t)&&(n%=12,0===n&&(n=12)),t.replace("%Y",e.getFullYear()).replace("%y",(e.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(e.getMonth()+1).toString().padStart(2,"0")).replace("%d",e.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",e.getMinutes().toString().padStart(2,"0")).replace("%S",e.getSeconds().toString().padStart(2,"0")).replace("%p",e.getHours()<12?"am":"pm").replace("%P",e.getHours()<12?"AM":"PM").replace("%%","%")}(i,"%d.%m.%Y"):i,v);const c=Object.values(v).every((e=>!e))&&i;l("notify",{oldValue:r,value:i,add:c,itemName:a,desc:t.description})},({detail:e})=>{l("record",e)},({detail:e})=>{l("multi",e)},()=>n(20,B=!0),()=>"object"===h.type?"comment_"+W:W,({detail:e})=>{n(23,R=e)},({detail:e})=>{const{designation:t}=h;n(25,o=t+": "+(e||"(Neu)"))},g,z,function(t){G(e,t)},function(t){G(e,t)},function(t){G(e,t)},function(t){G(e,t)},function(t){G(e,t)},function(t){G(e,t)}]}class El extends ke{constructor(e){var t;super(),document.getElementById("svelte-mea5fj-style")||((t=q("style")).id="svelte-mea5fj-style",t.textContent=".form-field{margin-bottom:1em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em}.form-field div.field > label.checkbox{padding-top:0.5em}",_(document.head,t)),xe(this,e,Nl,ql,x,{praefix:5,item:1,listName:42,record:0,recordId:2,noForm:6,classId:7,eventId:8,disabled:3,selectionFields:9,formnovalidate:10,selection:11,notifyList:18,numberInput:12,deList:13,required:4,isTemplate:14,toDelete:15,reqQuantity:16,currency:17,changeValue:43},[-1,-1])}}const{document:Ll}=ge;function Fl(e,t,n){const i=e.slice();return i[83]=t[n],i[85]=n,i}function Dl(e,t,n){const i=e.slice();return i[92]=t[n],i}function zl(e,t,n){const i=e.slice();return i[87]=t[n].title,i[88]=t[n].toDelete,i[89]=t[n].icon,i}function Tl(e){let t,n;return t=new e[18]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[Al]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};2048&n[0]|4&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Al(e){let t,n,i;function o(t){e[46](t)}let r={item:e[28],disabled:!0};return void 0!==e[11]&&(r.value=e[11]),t=new Vi({props:r}),K.push((()=>ve(t,"value",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};!n&&2048&i[0]&&(n=!0,o.value=e[11],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function Bl(e){let t,n;return t=new e[18]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[Vl]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};16384&n[0]|4&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Vl(e){let t,n,i;function o(t){e[47](t)}let r={item:e[26],disabled:!0};return void 0!==e[14]&&(r.value=e[14]),t=new Vi({props:r}),K.push((()=>ve(t,"value",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};!n&&16384&i[0]&&(n=!0,o.value=e[14],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function Ol(e){let t,n;return t=new e[18]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[Ml]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};1152&n[0]|4&n[3]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ml(e){let t,n,i;function o(t){e[48](t)}let r={item:e[24],disabled:!0,currency:e[7]};return void 0!==e[10]&&(r.value=e[10]),t=new Vi({props:r}),K.push((()=>ve(t,"value",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&1024&i[0]&&(n=!0,o.value=e[10],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function Wl(e){let t,n;return t=new e[21]({props:{class:e[15][e[85]],open:e[9]&&!e[1]&&0===e[85],$$slots:{handle:[Kl,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]],default:[Ql,({toggle:e,open:t})=>({86:e,9:t}),({toggle:e,open:t})=>[t?512:0,0,e?16777216:0]]},$$scope:{ctx:e}}}),t.$on("panel-open",(function(){w(e[42](e[85],e[82]))&&e[42](e[85],e[82]).apply(this,arguments)})),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(n,i){e=n;const o={};32768&i[0]&&(o.class=e[15][e[85]]),514&i[0]&&(o.open=e[9]&&!e[1]&&0===e[85]),209917&i[0]|16777216&i[2]|4&i[3]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Pl(e){let t,n;return t=new El({props:{praefix:e[85],item:e[92],eventId:e[6],record:e[83],recordId:e[4]._id,reqQuantity:e[2],notifyList:e[8],noForm:ts,classId:e[5],disabled:e[0],required:e[22],selectionFields:e[29],numberInput:e[17],currency:e[7],formnovalidate:e[85]===e[12].length-1||e[12][e[85]]._delete}}),t.$on("notify",(function(){w(e[31](e[92],e[85]))&&e[31](e[92],e[85]).apply(this,arguments)})),t.$on("task",e[49]),t.$on("invalid",e[32]),t.$on("defPrep",e[33]),t.$on("checkRange",e[34]),t.$on("record",e[50]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(n,i){e=n;const o={};8&i[0]&&(o.item=e[92]),64&i[0]&&(o.eventId=e[6]),4096&i[0]&&(o.record=e[83]),16&i[0]&&(o.recordId=e[4]._id),4&i[0]&&(o.reqQuantity=e[2]),256&i[0]&&(o.notifyList=e[8]),32&i[0]&&(o.classId=e[5]),1&i[0]&&(o.disabled=e[0]),131072&i[0]&&(o.numberInput=e[17]),128&i[0]&&(o.currency=e[7]),4096&i[0]&&(o.formnovalidate=e[85]===e[12].length-1||e[12][e[85]]._delete),t.$set(o)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Rl(e){let t,n,i=e[3].item,o=[];for(let t=0;t<i.length;t+=1)o[t]=Pl(Dl(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(541200893&n[0]|15&n[1]){let l;for(i=e[3].item,l=0;l<i.length;l+=1){const r=Dl(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=Pl(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}function Hl(e){let t,n,i=e[12][e[85]]._delete,o=Rl(e);return{c(){o.c(),t=F()},m(e,i){o.m(e,i),C(e,t,i),n=!0},p(e,n){4096&n[0]&&x(i,i=e[12][e[85]]._delete)?(ue(),pe(o,1,1,g),me(),o=Rl(e),o.c(),fe(o),o.m(t.parentNode,t)):o.p(e,n)},i(e){n||(fe(o),n=!0)},o(e){pe(o),n=!1},d(e){e&&S(t),o.d(e)}}}function Ql(e){let t,n,i,o,r=e[12].length,l=Hl(e);return{c(){t=q("div"),l.c(),i=L(),A(t,"id",n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`)},m(e,n){C(e,t,n),l.m(t,null),C(e,i,n),o=!0},p(e,i){4096&i[0]&&x(r,r=e[12].length)?(ue(),pe(l,1,1,g),me(),l=Hl(e),l.c(),fe(l),l.m(t,null)):l.p(e,i),(!o||40&i[0]&&n!==(n=`accordion-content-${e[5]}-${e[3].name}-${e[85]}`))&&A(t,"id",n)},i(e){o||(fe(l),o=!0)},o(e){pe(l),o=!1},d(e){e&&S(t),l.d(e),e&&S(i)}}}function Yl(e){let t,n,i,o,r,l=e[30](e[13],e[85])+"";return{c(){t=q("div"),n=E(l),A(t,"class",i=I("draggableListItem "+e[3].name)+" svelte-1es1ap1"),A(t,"draggable",!0),M(t,"delete",e[83]._delete),M(t,"is-active-top",e[16]?.top===e[85]),M(t,"is-active-bottom",e[16]?.bottom===e[85])},m(i,l){C(i,t,l),_(t,n),o||(r=[D(t,"dragover",e[40]),D(t,"dragleave",e[41](e[85])),D(t,"dragstart",e[38](e[85])),D(t,"drop",z(e[37](e[85]))),D(t,"dragenter",e[39](e[85]))],o=!0)},p(o,r){e=o,8192&r[0]&&l!==(l=e[30](e[13],e[85])+"")&&B(n,l),8&r[0]&&i!==(i=I("draggableListItem "+e[3].name)+" svelte-1es1ap1")&&A(t,"class",i),4104&r[0]&&M(t,"delete",e[83]._delete),65544&r[0]&&M(t,"is-active-top",e[16]?.top===e[85]),65544&r[0]&&M(t,"is-active-bottom",e[16]?.bottom===e[85])},d(e){e&&S(t),o=!1,b(r)}}}function Gl(e){let t,n,i;var o=e[89];return o&&(t=new o({props:{size:"20"}})),{c(){t&&ye(t.$$.fragment),n=F()},m(e,o){t&&be(t,e,o),C(e,n,o),i=!0},p(e,i){if(o!==(o=e[89])){if(t){ue();const e=t;pe(e.$$.fragment,1,0,(()=>{we(e,1)})),me()}o?(t=new o({props:{size:"20"}}),ye(t.$$.fragment),fe(t.$$.fragment,1),be(t,n.parentNode,n)):t=null}},i(e){i||(t&&fe(t.$$.fragment,e),i=!0)},o(e){t&&pe(t.$$.fragment,e),i=!1},d(e){e&&S(n),t&&we(t,e)}}}function Ul(e){let t,n,i,o,r,l=!e[0]&&!e[3].readonly&&Gl(e);return{c(){t=q("span"),l&&l.c(),A(t,"class","pointer icon svelte-1es1ap1"),A(t,"title",e[87]),t.hidden=n=e[85]===e[12].length-1||!(e[83]._delete^e[88])},m(n,s){C(n,t,s),l&&l.m(t,null),i=!0,o||(r=D(t,"click",(function(){w(e[36](e[85],e[9],e[86]))&&e[36](e[85],e[9],e[86]).apply(this,arguments)})),o=!0)},p(o,r){(e=o)[0]||e[3].readonly?l&&(ue(),pe(l,1,1,(()=>{l=null})),me()):l?(l.p(e,r),9&r[0]&&fe(l,1)):(l=Gl(e),l.c(),fe(l,1),l.m(t,null)),(!i||4096&r[0]&&n!==(n=e[85]===e[12].length-1||!(e[83]._delete^e[88])))&&(t.hidden=n)},i(e){i||(fe(l),i=!0)},o(e){pe(l),i=!1},d(e){e&&S(t),l&&l.d(),o=!1,r()}}}function Kl(e){let t,n,i,o,r,l;n=new e[19]({props:{$$slots:{default:[Yl]},$$scope:{ctx:e}}}),n.$on("click",(function(){w(e[35](e[86],e[85],e[9]))&&e[35](e[86],e[85],e[9]).apply(this,arguments)}));let s=[{title:"löschen",toDelete:!0,icon:Be},{title:"undo",toDelete:!1,icon:ze}],a=[];for(let t=0;t<2;t+=1)a[t]=Ul(zl(e,s,t));const c=e=>pe(a[e],1,1,(()=>{a[e]=null}));return{c(){t=q("div"),ye(n.$$.fragment),i=L();for(let e=0;e<2;e+=1)a[e].c();o=L(),A(t,"class",r=I("accordion "+e[3].name)+" svelte-1es1ap1"),A(t,"slot","handle")},m(e,r){C(e,t,r),be(n,t,null),_(t,i);for(let e=0;e<2;e+=1)a[e].m(t,null);_(t,o),l=!0},p(i,d){e=i;const u={};if(77832&d[0]|4&d[3]&&(u.$$scope={dirty:d,ctx:e}),n.$set(u),4617&d[0]|32&d[1]|16777216&d[2]){let n;for(s=[{title:"löschen",toDelete:!0,icon:Be},{title:"undo",toDelete:!1,icon:ze}],n=0;n<2;n+=1){const i=zl(e,s,n);a[n]?(a[n].p(i,d),fe(a[n],1)):(a[n]=Ul(i),a[n].c(),fe(a[n],1),a[n].m(t,o))}for(ue(),n=2;n<2;n+=1)c(n);me()}(!l||8&d[0]&&r!==(r=I("accordion "+e[3].name)+" svelte-1es1ap1"))&&A(t,"class",r)},i(e){if(!l){fe(n.$$.fragment,e);for(let e=0;e<2;e+=1)fe(a[e]);l=!0}},o(e){pe(n.$$.fragment,e),a=a.filter(Boolean);for(let e=0;e<2;e+=1)pe(a[e]);l=!1},d(e){e&&S(t),we(n),j(a,e)}}}function Jl(e){let t,n,i=(!e[1]&&!e[0]||e[85]<e[12].length-1)&&Wl(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){!e[1]&&!e[0]||e[85]<e[12].length-1?i?(i.p(e,n),4099&n[0]&&fe(i,1)):(i=Wl(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function Zl(e){let t,n,i=e[12],o=[];for(let t=0;t<i.length;t+=1)o[t]=Jl(Fl(e,i,t));const r=e=>pe(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=F()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);C(e,t,i),n=!0},p(e,n){if(1615049727&n[0]|4095&n[1]|17825792&n[2]){let l;for(i=e[12],l=0;l<i.length;l+=1){const r=Fl(e,i,l);o[l]?(o[l].p(r,n),fe(o[l],1)):(o[l]=Jl(r),o[l].c(),fe(o[l],1),o[l].m(t.parentNode,t))}for(ue(),l=i.length;l<o.length;l+=1)r(l);me()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)fe(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)pe(o[e]);n=!1},d(e){j(o,e),e&&S(t)}}}function Xl(e){let t,n,i,o,r,l,s=e[27]&&e[11]&&0!=e[11]&&Tl(e),a=e[25]&&e[14]&&0!=e[14]&&Bl(e),c=e[23]&&e[10]&&0!=e[10]&&Ol(e);return r=new e[20]({props:{class:e[5]+e[3].name,$$slots:{default:[Zl,({closeOtherPanels:e})=>({82:e}),({closeOtherPanels:e})=>[0,0,e?1048576:0]]},$$scope:{ctx:e}}}),{c(){t=q("div"),s&&s.c(),n=L(),a&&a.c(),i=L(),c&&c.c(),o=L(),ye(r.$$.fragment),A(t,"class","formList")},m(e,d){C(e,t,d),s&&s.m(t,null),_(t,n),a&&a.m(t,null),_(t,i),c&&c.m(t,null),_(t,o),be(r,t,null),l=!0},p(e,l){e[27]&&e[11]&&0!=e[11]?s?(s.p(e,l),2048&l[0]&&fe(s,1)):(s=Tl(e),s.c(),fe(s,1),s.m(t,n)):s&&(ue(),pe(s,1,1,(()=>{s=null})),me()),e[25]&&e[14]&&0!=e[14]?a?(a.p(e,l),16384&l[0]&&fe(a,1)):(a=Bl(e),a.c(),fe(a,1),a.m(t,i)):a&&(ue(),pe(a,1,1,(()=>{a=null})),me()),e[23]&&e[10]&&0!=e[10]?c?(c.p(e,l),1024&l[0]&&fe(c,1)):(c=Ol(e),c.c(),fe(c,1),c.m(t,o)):c&&(ue(),pe(c,1,1,(()=>{c=null})),me());const d={};40&l[0]&&(d.class=e[5]+e[3].name),242687&l[0]|1048576&l[2]|4&l[3]&&(d.$$scope={dirty:l,ctx:e}),r.$set(d)},i(e){l||(fe(s),fe(a),fe(c),fe(r.$$.fragment,e),l=!0)},o(e){pe(s),pe(a),pe(c),pe(r.$$.fragment,e),l=!1},d(e){e&&S(t),s&&s.d(),a&&a.d(),c&&c.d(),we(r)}}}let es=new Map;const ts=!0,ns="pos/target";function is(e,n,i){let o,r;const{FormField:l,TextField:s,Button:a,Accordion:d,AccordionSection:u,Divider:m}=c,h=Y();let{list:g}=n,{schema:v}=n,{record:y}=n,{classId:b}=n,{eventId:w}=n,{disabled:x}=n,{fixed:k}=n,{template:I={}}=n,{reqQuantity:_}=n,{open:C=!1}=n,{currency:S}=n,{notifyList:j}=n;const q=v.find((e=>("price"===e.name||"amount"===e.name)&&!e.properties?.hidden)),N=q&&v.find((e=>"quantity"===e.name));let E=0;const L=v.find((e=>"quantity"===e.name&&"h"===e.properties?.unit?.constant&&!e.properties?.hidden));let F=0;const D=v.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name||"",z=!!D;let T=0;const A={};let B=v.properties?.readonly,V=b.split("form-")[1].slice(0,-4),O=new Map;g.group&&(k=!0);const M={};x||=B;let W,P,R=[],H=[],Q=!1,U={},K=[];v.filter((e=>e.selection)).map((e=>R.push({className:V,parentClass:v,refClass:e.selection,value:""}))),v.filter((e=>e.refClass)).forEach((e=>{}));["readonly","hidden","required"].map((e=>{v.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"";let[i,o]=n.split(".");o||(o=i,i=void 0),K.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));const J=async(e,t,n)=>{const i=y[n];if(!i?.length)return;const o=i[0][n];if(!o)return;const r=await Js(n,o);return r?r[g.name]:void 0},Z=async(e,t)=>{const n=K.filter((e=>(e.refObj||V)===t||e.refName===t));if(n?.length)for(const t of n){const{itemName:n,refObj:o,refName:r,op:l}=t;let s,a,{action:c}=t,d=!1,u=!1;if(o){const t=W[e][o];o===V&&r?d=y:t&&(d=await Js(o,t))}!o&&r&&(d=W[e]),d&&(u=d[r],Array.isArray(u)&&0===u.length&&(u=!1)),"!"===l&&(u=!u),"required"!==c&&"readonly"!==c||(c="required"===c?c:"disabled",setTimeout((()=>{s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field textarea`,a=document.querySelector(s),a||(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n} .field input`,a=document.querySelector(s)),a&&u&&a.setAttribute(c,""),a&&!u&&a.removeAttribute(c)}),0)),"hidden"===c&&(s=`#accordion-content-${b}-${g.name}-${e} .form-field.${n}`,a=document.querySelector(s),a?.classList?.toggle("hidden",u),u&&i(12,W[e][n]="",W))}},X=(e,t)=>{let n=`#accordion-content-${b}-${g.name}-${e} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(n);let r=!1;o.forEach((e=>{e.required&&""===e.value&&(r=!0)})),void 0===t&&(n=`#accordion-content-${b}-${g.name}-${e} :not(.form-field.hidden) .field input.invalid`,document.querySelector(n)&&(t=!0)),i(15,H[e]=r||t?"invalid":"",H)},ee=e=>{if(!e)return 0;const[t,n=0]=e.split(":");return 60*t+parseInt(n)},te=(e,t)=>{if(!t)return;const n=v.find((e=>e.name===t)),o=n.properties.value.formula,{operator:r,argument:l}=o,s=l.map((t=>W[e][t.refItem]));let a=0;"$add"===r&&(a=s.reduce(((e,t)=>e+ +t))),"$subtract"===r&&(a=s.reduce(((e,t)=>{if(!e)return 0;if(!t)return 0;const[n,i]=e.split(":");e=i?(+n+ +i/60).toFixed(2):+n;const[o,r]=t.split(":");return o?e-=r?(+o+ +r/60).toFixed(2):+o:0})));const c=`#accordion-content-${b}-${g.name}-${e} .form-field.${t} .field input`,d=document.querySelector(c),u=d?.disabled;i(12,W[e][t]=(a||0).toFixed(n.properties.decimals||0),W),i(17,U={item:n,value:a,idx:e}),setTimeout((()=>{const e=document.querySelector(c);u&&e&&e.setAttribute("disabled","")}),0)};P=v.filter((e=>e.refClass)).reduce(((e,t)=>{const n=v.filter((e=>e.refItem===t.refClass));if(!n?.length)return e;if(t.selection){const[n,i]=t.selection.split(":"),[o]=i?.split(".")||[];o&&e.push({refClass:o,items:[n],selection:t.selection})}const i={refClass:t.refClass,items:[]};return n.forEach((e=>{i.items.push(e.name)})),e.push(i),e}),[]);const ie=async(e,t,n,o)=>{const r=(await P).find((e=>e.refClass===t.refClass));if(!r)return;const{refClass:l,items:s,selection:a}=r,c=t.name;if(K.find((e=>e.itemName===c))){const t=`#accordion-content-${b}-${g.name}-${e} .form-field.${l}.hidden`;if(document.querySelector(t))return}return n?Promise.all(s.map((async r=>{const c=v.find((e=>e.name===r));if(c.properties?.readonly&&!t.refInput){const n=W[e][t.refClass];return Promise.resolve(Js(t.refClass,n,!0)).then((t=>{let n=t[r];Array.isArray(n)&&(n=n.length?n[0][r]:""),i(12,W[e][r]=n,W)}))}let d="";const{refInput:u}=t;if(u&&W[e]){const[t,n]=u.split(".");d=n?W[e][n]:y[t]}if(a&&n!==o)s.map((t=>{i(12,W[e][t]="",W)}));else if(u&&!d||oe(e,r)||o!==n){const n=v.find((e=>e.refClass===l)),o=W[e][n.name];if(t.selection){const n=Ks(t.selection+o.toString());if(n)return Promise.resolve(n).then((t=>i(12,W[e][r]=t[r],W)))}return Promise.resolve(Js(n.refClass,o)).then((t=>i(12,W[e][r]=t[r],W)))}}))):Promise.resolve(s.map((t=>{i(12,W[e][t]="",W)})))},oe=(e,t)=>{let n=W[e][t];return"number"===v.find((e=>e.name===t)).type&&(n=Number(n||0)),!n},re=e=>{if(!e)return;const{style:t,scrollHeight:n}=e;n&&(t.height=`${n}px`)};let le=!1;const se=e=>!(!k&&e>=W.length-1),ae=(e,t=!1)=>{const[n,i]=e.split(";");return g.name===i&&(!!se(t)&&((!1===t||t!=n)&&parseInt(n)))};v.filter((e=>e.properties?.value?.formula?.argument)).forEach((e=>{e.properties.value.formula.argument.forEach((t=>{const n=v.find((e=>e.name===t.refItem));n&&(n._formulaActor=e.name)}))}));const ce=(e,t=!1)=>{const n=`#accordion-content-${b}-${g.name}-${e} > div.form-field:not(.hidden)`,i=document.querySelectorAll(n);if(!i?.length)return;const o=i[i.length-1];ne().then((()=>{const t=`#accordion-content-${b}-${g.name}-${e} textarea`;Array.from(document.querySelectorAll(t)).forEach(re)})).then((()=>{t&&o.scrollIntoView({behavior:"smooth",block:"end"})}))};return e.$$set=e=>{"list"in e&&i(3,g=e.list),"schema"in e&&i(43,v=e.schema),"record"in e&&i(4,y=e.record),"classId"in e&&i(5,b=e.classId),"eventId"in e&&i(6,w=e.eventId),"disabled"in e&&i(0,x=e.disabled),"fixed"in e&&i(1,k=e.fixed),"template"in e&&i(44,I=e.template),"reqQuantity"in e&&i(2,_=e.reqQuantity),"open"in e&&i(9,C=e.open),"currency"in e&&i(7,S=e.currency),"notifyList"in e&&i(8,j=e.notifyList)},e.$$.update=()=>{24&e.$$.dirty[0]&&y&&(i(2,_=y.quantity),i(12,W=(y[g.name]||[]).concat({}))),4096&e.$$.dirty[0]&&i(13,o=W),15368&e.$$.dirty[0]&&o&&((()=>{if(L)i(14,F=W?.reduce(((e,t)=>e+(t._delete?0:+(t.quantity||0))),0)||0)})(),(()=>{if(z)i(11,T=W?.reduce(((e,t)=>e+(t._delete?0:+(t[D]||0))),0)||0)})(),(()=>{if(q)i(10,E=W?.reduce(((e,t)=>{if(t.amount){const n=t.amount??0;e+=t._delete?0:+n}if(t.price){const n=(N?t.quantity??0:1)*(t.price??0);e+=t._delete?0:n}return e}),0)||0)})(),ne().then((()=>h("save",{listName:g.name,value:W,amountValue:E,weeksValue:T})))),16384&e.$$.dirty[1]&&(r=e=>A[e]?.split(" • ").filter((e=>!!e)).slice(0,2).join(" · "))},[x,k,_,g,y,b,w,S,j,C,E,T,W,o,F,H,Q,U,l,a,d,u,undefined,q,{name:"amountValue",properties:{decimals:2}},L,{name:"hoursValue",properties:{decimals:2}},z,{name:"weeksValue",properties:{decimals:1}},R,(e,t)=>{let n=e[t];return M["pos"+t]&&(n=M["pos"+t]),n&&v.filter((e=>!0!==e.properties?.hidden&&void 0!==n[e.name]&&"textarea"!==e.properties?.format)).map((e=>""===n[e.name]?"":"object"===e.type?r(n[e.name]):Array.isArray(n[e.name])?n[e.name][0]||"":"boolean"===e.type?$(n[e.name]):"date"===e.type?f(n[e.name]):"datetime"===e.type?p(n[e.name]):e.properties?.multi?"":n[e.name])).filter((e=>!!e)).join(" • ")||"+"},(e,t)=>async({detail:n})=>{const{oldValue:r,value:l,add:s,desc:a}=n;if(g.refItem){const n=await J(t,e,g.refItem);n&&i(12,W=n)}te(t,e._formulaActor);const c=R?.find((t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass));c&&(c.value=(c.value||new Map).set(t,l)),l&&W.length===t+1&&i(12,W=W.concat({})),a&&i(45,A[l]=a,A),await ie(t,e,l,r),await Z(t,e.name),i(13,o=W),"number"===e.type&&i(17,U={item:e,value:l,idx:t}),X(t)},({detail:e})=>{const{idx:t,value:n}=e;X(t,n)},async({detail:{className:e,itemName:n,value:i}})=>{if(O.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===V+"."+g.name))),!i)return;const o={[n]:!0},r=await t.getSectionView(e,o);r?.length&&O.set(e,r[0])},({detail:e})=>{const{idx:t,fieldId:n,value:i}=e;if(!i)return;const o=ee(i);let r=!1;W.forEach(((e,n)=>{if(t===n)return;const{start:i,end:l}=W[n];i&&l&&o>ee(i)&&o<ee(l)&&(r=!0)}));const l=document.getElementById(n);l?.classList?.toggle("invalid",r)},(e,t,n)=>n=>{W[t]._delete||(e(n),ce(t,!0))},(e,t,n)=>o=>{if(i(12,W[e]._delete=!W[e]._delete,W),W[e]._delete){M["pos"+e]={...W[e]};for(const t of v)i(12,W[e][t.name]="",W);t&&n(o)}else{if(M["pos"+e]){const t={};for(const n of v)t[n.name]=M["pos"+e][n.name];i(12,W[e]=t,W)}M["pos"+e]=void 0,t||n(o)}},e=>t=>{t.preventDefault(),i(16,Q=!1);const n=ae(t.dataTransfer.getData(ns),e);if(!1===n)return;t.dataTransfer.dropEffect="move";const o=[...W].map(((e,t)=>(e._index=t,e)));n<e?(o.splice(e+1,0,o[n]),o.splice(n,1)):(o.splice(e,0,o[n]),o.splice(n+1,1)),o.map(((e,t)=>{return n=e._index,i=t,void es.set(i,n);var n,i}));let r=[];H.map(((e,t)=>{r[t]=H[(e=>{const t=es.get(e);return void 0===t?e:t})(t)]})),i(15,H=r),i(12,W=o.map(((e,t)=>(delete e._index,e)))),le=!1},e=>t=>{if(!se(e))return!1;t.dataTransfer.effectAllowed="move",t.dataTransfer.dropEffect="move",t.dataTransfer.setData(ns,e+";"+g.name),le=e},e=>t=>{const n=ae(t.dataTransfer.getData(ns),e)||le;return!1===n||n===e?i(16,Q=!1):void i(16,Q={top:n>e&&e,bottom:n<e&&e})},e=>e.preventDefault(),e=>e=>{i(16,Q=!1)},(e,t)=>n=>{setTimeout((()=>{Array.from(O).forEach((([t,n])=>{W[e][t]||i(12,W[e][t]=n._id,W)}))}),500);const o=new Set;for(const e of K)o.add(e.refObj||V);for(const t of Array.from(o))Z(e,t);t(n),ce(e)},v,I,A,function(e){T=e,i(11,T)},function(e){F=e,i(14,F)},function(e){E=e,i(10,E)},function(t){G(e,t)},function(t){G(e,t)}]}class os extends ke{constructor(e){var t;super(),Ll.getElementById("svelte-1es1ap1-style")||((t=q("style")).id="svelte-1es1ap1-style",t.textContent=".accordion.svelte-1es1ap1{display:flex;overflow:hidden}.accordion-content.svelte-1es1ap1{position:relative}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion > .btn{width:95% !important}.sEmbedded .formList .accordion > .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-1es1ap1{padding-top:1em}div.delete.svelte-1es1ap1{text-decoration:line-through}.icon.svelte-1es1ap1{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-1es1ap1{cursor:drag}.draggableListItem.is-active-top.svelte-1es1ap1{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-1es1ap1{border-bottom:3px purple solid;padding-bottom:2em}",_(Ll.head,t)),xe(this,e,is,Xl,x,{list:3,schema:43,record:4,classId:5,eventId:6,disabled:0,fixed:1,template:44,reqQuantity:2,open:9,currency:7,notifyList:8},[-1,-1,-1,-1])}}const{Boolean:rs,document:ls}=ge;function ss(e,t,n){const i=e.slice();return i[125]=t[n],i}function as(e,t,n){const i=e.slice();return i[128]=t[n],i}function cs(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function ds(e){let t,n,i=e[124]&&function(e){let t,n,i,o,r,l,s,a,c,d,u,m,f,p,$,h,g=e[1].items,v=[];for(let t=0;t<g.length;t+=1)v[t]=ms(as(e,g,t));const y=e=>pe(v[e],1,1,(()=>{v[e]=null}));let w=e[1].list&&fs(e),x=!e[2]&&e[39]&&e[3]&&!e[21]&&ks(e);d=new e[24]({props:{outline:!0,$$slots:{default:[_s]},$$scope:{ctx:e}}}),d.$on("click",e[42]);const k=[Ss,Cs],N=[];function E(e,t){return e[5]?0:e[39]?1:-1}~(m=E(e))&&(f=N[m]=k[m](e));return{c(){t=q("section"),n=q("form"),i=q("input"),r=L();for(let e=0;e<v.length;e+=1)v[e].c();l=L(),w&&w.c(),s=L(),x&&x.c(),a=L(),c=q("div"),ye(d.$$.fragment),u=L(),f&&f.c(),A(i,"class",I(e[29])+" svelte-9xiaib"),A(i,"name","_id"),A(i,"type","hidden"),i.value=o=e[4]._id||"",A(n,"class",I(e[30])+" svelte-9xiaib"),A(n,"id",e[29]),A(c,"class","form--buttons svelte-9xiaib"),A(t,"class",I(e[31])+" svelte-9xiaib")},m(o,f){C(o,t,f),_(t,n),_(n,i),_(n,r);for(let e=0;e<v.length;e+=1)v[e].m(n,null);_(n,l),w&&w.m(n,null),_(t,s),x&&x.m(t,null),_(t,a),_(t,c),be(d,c,null),_(c,u),~m&&N[m].m(c,null),p=!0,$||(h=[D(n,"keydown",e[47]),D(n,"submit",z(e[41]))],$=!0)},p(e,r){if((!p||16&r[0]&&o!==(o=e[4]._id||""))&&(i.value=o),539003026&r[0]|14708864&r[1]){let t;for(g=e[1].items,t=0;t<g.length;t+=1){const i=as(e,g,t);v[t]?(v[t].p(i,r),fe(v[t],1)):(v[t]=ms(i),v[t].c(),fe(v[t],1),v[t].m(n,l))}for(ue(),t=g.length;t<v.length;t+=1)y(t);me()}e[1].list?w?(w.p(e,r),2&r[0]&&fe(w,1)):(w=fs(e),w.c(),fe(w,1),w.m(n,null)):w&&(ue(),pe(w,1,1,(()=>{w=null})),me()),!e[2]&&e[39]&&e[3]&&!e[21]?x?(x.p(e,r),2097164&r[0]&&fe(x,1)):(x=ks(e),x.c(),fe(x,1),x.m(t,a)):x&&(ue(),pe(x,1,1,(()=>{x=null})),me());const s={};128&r[4]&&(s.$$scope={dirty:r,ctx:e}),d.$set(s);let u=m;m=E(e),m===u?~m&&N[m].p(e,r):(f&&(ue(),pe(N[u],1,1,(()=>{N[u]=null})),me()),~m?(f=N[m],f?f.p(e,r):(f=N[m]=k[m](e),f.c()),fe(f,1),f.m(c,null)):f=null)},i(e){if(!p){for(let e=0;e<g.length;e+=1)fe(v[e]);fe(w),fe(x),fe(d.$$.fragment,e),fe(f),p=!0}},o(e){v=v.filter(rs);for(let e=0;e<v.length;e+=1)pe(v[e]);pe(w),pe(x),pe(d.$$.fragment,e),pe(f),p=!1},d(e){e&&S(t),j(v,e),w&&w.d(),x&&x.d(),we(d),~m&&N[m].d(),$=!1,b(h)}}}(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,t){e[124]&&i.p(e,t)},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function us(e){let t,n;return t=new El({props:{classId:e[29],item:e[128],selection:e[128].selection,record:e[4],disabled:e[21],eventId:e[38],toDelete:e[11],currency:e[7],changeValue:e[15]}}),t.$on("task",e[43]),t.$on("notify",e[44]),t.$on("safeReference",e[53]),t.$on("multi",e[45]),t.$on("defPrep",e[52]),t.$on("record",e[54]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};2&n[0]&&(i.item=e[128]),2&n[0]&&(i.selection=e[128].selection),16&n[0]&&(i.record=e[4]),2097152&n[0]&&(i.disabled=e[21]),2048&n[0]&&(i.toDelete=e[11]),128&n[0]&&(i.currency=e[7]),32768&n[0]&&(i.changeValue=e[15]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ms(e){let t,n,i="list"!==e[128].type&&us(e);return{c(){i&&i.c(),t=F()},m(e,o){i&&i.m(e,o),C(e,t,o),n=!0},p(e,n){"list"!==e[128].type?i?(i.p(e,n),2&n[0]&&fe(i,1)):(i=us(e),i.c(),fe(i,1),i.m(t.parentNode,t)):i&&(ue(),pe(i,1,1,(()=>{i=null})),me())},i(e){n||(fe(i),n=!0)},o(e){pe(i),n=!1},d(e){i&&i.d(e),e&&S(t)}}}function fs(e){let t,n,i,o,r,l=e[34]&&e[8]&&0!=e[8]&&ps(e),s=e[9]&&hs(e),a=e[35]&&e[14]&&0!=e[14]&&vs(e),c=e[1].list,d=[];for(let t=0;t<c.length;t+=1)d[t]=xs(ss(e,c,t));const u=e=>pe(d[e],1,1,(()=>{d[e]=null}));return{c(){l&&l.c(),t=L(),s&&s.c(),n=L(),a&&a.c(),i=L();for(let e=0;e<d.length;e+=1)d[e].c();o=F()},m(e,c){l&&l.m(e,c),C(e,t,c),s&&s.m(e,c),C(e,n,c),a&&a.m(e,c),C(e,i,c);for(let t=0;t<d.length;t+=1)d[t].m(e,c);C(e,o,c),r=!0},p(e,r){if(e[34]&&e[8]&&0!=e[8]?l?(l.p(e,r),256&r[0]&&fe(l,1)):(l=ps(e),l.c(),fe(l,1),l.m(t.parentNode,t)):l&&(ue(),pe(l,1,1,(()=>{l=null})),me()),e[9]?s?(s.p(e,r),512&r[0]&&fe(s,1)):(s=hs(e),s.c(),fe(s,1),s.m(n.parentNode,n)):s&&(ue(),pe(s,1,1,(()=>{s=null})),me()),e[35]&&e[14]&&0!=e[14]?a?(a.p(e,r),16384&r[0]&&fe(a,1)):(a=vs(e),a.c(),fe(a,1),a.m(i.parentNode,i)):a&&(ue(),pe(a,1,1,(()=>{a=null})),me()),539177174&r[0]|8421504&r[1]){let t;for(c=e[1].list,t=0;t<c.length;t+=1){const n=ss(e,c,t);d[t]?(d[t].p(n,r),fe(d[t],1)):(d[t]=xs(n),d[t].c(),fe(d[t],1),d[t].m(o.parentNode,o))}for(ue(),t=c.length;t<d.length;t+=1)u(t);me()}},i(e){if(!r){fe(l),fe(s),fe(a);for(let e=0;e<c.length;e+=1)fe(d[e]);r=!0}},o(e){pe(l),pe(s),pe(a),d=d.filter(rs);for(let e=0;e<d.length;e+=1)pe(d[e]);r=!1},d(e){l&&l.d(e),e&&S(t),s&&s.d(e),e&&S(n),a&&a.d(e),e&&S(i),j(d,e),e&&S(o)}}}function ps(e){let t,n;return t=new e[25]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[$s]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};384&n[0]|128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function $s(e){let t,n,i;function o(t){e[63](t)}let r={item:e[32],disabled:!0,currency:e[7]};return void 0!==e[8]&&(r.value=e[8]),t=new Vi({props:r}),K.push((()=>ve(t,"value",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&256&i[0]&&(n=!0,o.value=e[8],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function hs(e){let t,n;return t=new e[25]({props:{name:"Total MWSt "+(e[10]?"("+e[10]+"%)":""),nameClass:"formField_italic",$$slots:{default:[gs]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};1024&n[0]&&(i.name="Total MWSt "+(e[10]?"("+e[10]+"%)":"")),640&n[0]|128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function gs(e){let t,n,i;function o(t){e[64](t)}let r={item:e[33],disabled:!0,currency:e[7]};return void 0!==e[9]&&(r.value=e[9]),t=new Vi({props:r}),K.push((()=>ve(t,"value",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};128&i[0]&&(o.currency=e[7]),!n&&512&i[0]&&(n=!0,o.value=e[9],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function vs(e){let t,n;return t=new e[25]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[ys]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};16384&n[0]|128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ys(e){let t,n,i;function o(t){e[65](t)}let r={item:e[36],disabled:!0};return void 0!==e[14]&&(r.value=e[14]),t=new Vi({props:r}),K.push((()=>ve(t,"value",o))),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};!n&&16384&i[0]&&(n=!0,o.value=e[14],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function bs(e){let t,n;return t=new Xn({props:{classId:e[29],open:!e[2]&&1===e[1].list.length,list:e[125],template:e[16],eventId:e[38],schema:e[125].item,record:e[4],disabled:e[21],currency:e[7]}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};6&n[0]&&(i.open=!e[2]&&1===e[1].list.length),2&n[0]&&(i.list=e[125]),65536&n[0]&&(i.template=e[16]),2&n[0]&&(i.schema=e[125].item),16&n[0]&&(i.record=e[4]),2097152&n[0]&&(i.disabled=e[21]),128&n[0]&&(i.currency=e[7]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ws(e){let t,n;return t=new os({props:{classId:e[29],open:e[13],list:e[125],template:e[17],eventId:e[38],schema:e[125].item,record:e[4],disabled:e[21],fixed:e[125].fixed,reqQuantity:e[12],currency:e[7],notifyList:e[6]}}),t.$on("save",e[46]),t.$on("record",e[54]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};8192&n[0]&&(i.open=e[13]),2&n[0]&&(i.list=e[125]),131072&n[0]&&(i.template=e[17]),2&n[0]&&(i.schema=e[125].item),16&n[0]&&(i.record=e[4]),2097152&n[0]&&(i.disabled=e[21]),2&n[0]&&(i.fixed=e[125].fixed),4096&n[0]&&(i.reqQuantity=e[12]),128&n[0]&&(i.currency=e[7]),64&n[0]&&(i.notifyList=e[6]),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function xs(e){let t,n,i,o,r,l;t=new e[23]({props:{text:e[125].designation}});const s=[ws,bs],a=[];function c(e,t){return"array"===e[125].type?0:1}return i=c(e),o=a[i]=s[i](e),{c(){ye(t.$$.fragment),n=L(),o.c(),r=F()},m(e,o){be(t,e,o),C(e,n,o),a[i].m(e,o),C(e,r,o),l=!0},p(e,n){const l={};2&n[0]&&(l.text=e[125].designation),t.$set(l);let d=i;i=c(e),i===d?a[i].p(e,n):(ue(),pe(a[d],1,1,(()=>{a[d]=null})),me(),o=a[i],o?o.p(e,n):(o=a[i]=s[i](e),o.c()),fe(o,1),o.m(r.parentNode,r))},i(e){l||(fe(t.$$.fragment,e),fe(o),l=!0)},o(e){pe(t.$$.fragment,e),pe(o),l=!1},d(e){we(t,e),e&&S(n),a[i].d(e),e&&S(r)}}}function ks(e){let t,n,i,o;function r(t){e[66](t)}let l={title:"",round:!0,$$slots:{default:[Is]},$$scope:{ctx:e}};return void 0!==e[20]&&(l.checked=e[20]),n=new e[26]({props:l}),K.push((()=>ve(n,"checked",r))),{c(){t=q("div"),ye(n.$$.fragment),A(t,"class","askNext"),O(t,"margin-top","1em"),O(t,"margin-left","23em")},m(e,i){C(e,t,i),be(n,t,null),o=!0},p(e,t){const o={};128&t[4]&&(o.$$scope={dirty:t,ctx:e}),!i&&1048576&t[0]&&(i=!0,o.checked=e[20],oe((()=>i=!1))),n.$set(o)},i(e){o||(fe(n.$$.fragment,e),o=!0)},o(e){pe(n.$$.fragment,e),o=!1},d(e){e&&S(t),we(n)}}}function Is(e){let t;return{c(){t=q("span"),t.textContent="Weiter erfassen",O(t,"margin-left","1em")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function _s(e){let t;return{c(){t=E("Abbrechen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Cs(e){let t,n,i,o,r;t=new e[24]({props:{class:"close",disabled:e[21],form:e[29],filled:!0,type:"submit",$$slots:{default:[js]},$$scope:{ctx:e}}});let l=e[3]&&!e[21]&&qs(e),s=e[18]&&Es(e);return{c(){ye(t.$$.fragment),n=L(),l&&l.c(),i=L(),s&&s.c(),o=F()},m(e,a){be(t,e,a),C(e,n,a),l&&l.m(e,a),C(e,i,a),s&&s.m(e,a),C(e,o,a),r=!0},p(e,n){const r={};2097152&n[0]&&(r.disabled=e[21]),128&n[4]&&(r.$$scope={dirty:n,ctx:e}),t.$set(r),e[3]&&!e[21]?l?(l.p(e,n),2097160&n[0]&&fe(l,1)):(l=qs(e),l.c(),fe(l,1),l.m(i.parentNode,i)):l&&(ue(),pe(l,1,1,(()=>{l=null})),me()),e[18]?s?(s.p(e,n),262144&n[0]&&fe(s,1)):(s=Es(e),s.c(),fe(s,1),s.m(o.parentNode,o)):s&&(ue(),pe(s,1,1,(()=>{s=null})),me())},i(e){r||(fe(t.$$.fragment,e),fe(l),fe(s),r=!0)},o(e){pe(t.$$.fragment,e),pe(l),pe(s),r=!1},d(e){we(t,e),e&&S(n),l&&l.d(e),e&&S(i),s&&s.d(e),e&&S(o)}}}function Ss(e){let t,n,i,o;t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Vs]},$$scope:{ctx:e}}}),t.$on("click",e[50]);let r=e[19]&&Os(e);return{c(){ye(t.$$.fragment),n=L(),r&&r.c(),i=F()},m(e,l){be(t,e,l),C(e,n,l),r&&r.m(e,l),C(e,i,l),o=!0},p(e,n){const o={};128&n[4]&&(o.$$scope={dirty:n,ctx:e}),t.$set(o),e[19]?r?(r.p(e,n),524288&n[0]&&fe(r,1)):(r=Os(e),r.c(),fe(r,1),r.m(i.parentNode,i)):r&&(ue(),pe(r,1,1,(()=>{r=null})),me())},i(e){o||(fe(t.$$.fragment,e),fe(r),o=!0)},o(e){pe(t.$$.fragment,e),pe(r),o=!1},d(e){we(t,e),e&&S(n),r&&r.d(e),e&&S(i)}}}function js(e){let t;return{c(){t=E("Speichern und schliessen")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function qs(e){let t,n;return t=new e[24]({props:{form:e[29],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[Ns]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ns(e){let t;return{c(){t=E("Speichern")},m(e,n){C(e,t,n)},d(e){e&&S(t)}}}function Es(e){let t,n,i,o,r;const l=[Fs,Ls],s=[];t=function(e,t){return e[37]?0:1}(e),n=s[t]=l[t](e);let a=e[19]&&As(e);return{c(){n.c(),i=L(),a&&a.c(),o=F()},m(e,n){s[t].m(e,n),C(e,i,n),a&&a.m(e,n),C(e,o,n),r=!0},p(e,t){n.p(e,t),e[19]?a?(a.p(e,t),524288&t[0]&&fe(a,1)):(a=As(e),a.c(),fe(a,1),a.m(o.parentNode,o)):a&&(ue(),pe(a,1,1,(()=>{a=null})),me())},i(e){r||(fe(n),fe(a),r=!0)},o(e){pe(n),pe(a),r=!1},d(e){s[t].d(e),e&&S(i),a&&a.d(e),e&&S(o)}}}function Ls(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[Ds]},$$scope:{ctx:e}}}),t.$on("click",(function(){w(e[48](e[0]))&&e[48](e[0]).apply(this,arguments)})),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(n,i){e=n;const o={};128&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Fs(e){let t,n;return t=new d({props:{text:e[37],extended:!0,$$slots:{default:[Ts]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};1&n[0]|128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ds(e){let t,n,i;return n=new nt({props:{size:"18"}}),{c(){t=q("span"),t.textContent=`${e[55]()}`,ye(n.$$.fragment),O(t,"margin-right",".75em")},m(e,o){C(e,t,o),be(n,e,o),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n,e)}}}function zs(e){let t,n,i;return n=new nt({props:{size:"18"}}),{c(){t=q("span"),t.textContent=`${e[55]()}`,ye(n.$$.fragment),O(t,"margin-right",".75em")},m(e,o){C(e,t,o),be(n,e,o),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n,e)}}}function Ts(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[zs]},$$scope:{ctx:e}}}),t.$on("click",(function(){w(e[48](e[0]))&&e[48](e[0]).apply(this,arguments)})),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(n,i){e=n;const o={};128&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function As(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Bs]},$$scope:{ctx:e}}}),t.$on("click",(function(){w(e[49](e[0]))&&e[49](e[0]).apply(this,arguments)})),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(n,i){e=n;const o={};128&i[4]&&(o.$$scope={dirty:i,ctx:e}),t.$set(o)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Bs(e){let t,n,i;return n=new rt({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Daten",ye(n.$$.fragment),O(t,"margin-right",".75em")},m(e,o){C(e,t,o),be(n,e,o),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n,e)}}}function Vs(e){let t,n,i;return n=new nt({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Erstellen",ye(n.$$.fragment),O(t,"margin-right",".75em")},m(e,o){C(e,t,o),be(n,e,o),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n,e)}}}function Os(e){let t,n;return t=new e[24]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[Ms]},$$scope:{ctx:e}}}),t.$on("click",e[51]),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,n){const i={};128&n[4]&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function Ms(e){let t,n,i;return n=new rt({props:{size:"18"}}),{c(){t=q("span"),t.textContent="Daten",ye(n.$$.fragment),O(t,"margin-right",".75em")},m(e,o){C(e,t,o),be(n,e,o),i=!0},p:g,i(e){i||(fe(n.$$.fragment,e),i=!0)},o(e){pe(n.$$.fragment,e),i=!1},d(e){e&&S(t),we(n,e)}}}function Ws(e){return{c:g,m:g,p:g,i:g,o:g,d:g}}function Ps(e){let t,n,i,o;ls.title=t=e[22];let r={ctx:e,current:null,token:null,hasCatch:!1,pending:Ws,then:ds,catch:cs,value:124,blocks:[,,,]};return $e(e[40](),r),{c(){n=L(),i=F(),r.block.c()},m(e,t){C(e,n,t),C(e,i,t),r.block.m(e,r.anchor=t),r.mount=()=>i.parentNode,r.anchor=i,o=!0},p(n,i){e=n,(!o||4194304&i[0])&&t!==(t=e[22])&&(ls.title=t),he(r,e,i)},i(e){o||(fe(r.block),o=!0)},o(e){for(let e=0;e<3;e+=1){pe(r.blocks[e])}o=!1},d(e){e&&S(n),e&&S(i),r.block.d(e),r.token=null,r=null}}}let Rs=new Map,Hs=new Map,Qs=new Map;const Ys=(e,n)=>{const i=n;return Rs.has(i)||Rs.set(i,t.getTasksList(n).then((({data:e})=>e))),Rs.get(i)},Gs=(e,n,i)=>Hs.get(i)||Ys(e,n).then((n=>n.find((({_id:e})=>e===i))||t.getTaskList(e,i))).then((e=>(Hs.set(i,e),e))),Us=(e,t)=>{Qs.set(e,t)},Ks=e=>Qs.get(e),Js=(e,n,i=!1)=>!i&&Qs.get(n)||t.getTask(e,n).then((e=>(Qs.set(n,e),e))),Zs=(e,n)=>{if(!Rs.get(n))return;const i=n;Rs.set(i,t.getTasksList(n).then((({data:e})=>e)))};function Xs(e,o,a){let d,f,p,$,g,v,y;k(e,m,(e=>a(76,$=e))),k(e,s,(e=>a(77,g=e))),k(e,i,(e=>a(78,v=e)));const{Divider:b,Button:w,FormField:x,Checkbox:I}=c,{loggedIn:_,currentTasks:C}=u;k(e,_,(e=>a(79,y=e))),k(e,C,(e=>a(75,p=e)));const S=JSON.parse(r.getItem("Locale")),j=Y();let q,N,E,L,F,{schema:D}=o,{recID:z}=o,{prevEventID:T=!1}=o,{prev:A=!1}=o,{taskId:B=!1}=o,{description:V=""}=o,{root:O=!1}=o,{readonly:M}=o,{isStandalone:W}=o,P={},R={},G="form-"+D.class+Math.floor(9e3*Math.random()+1e3).toString();const U=O?"fEmbedded":"fTask",K=O?"sEmbedded":"sTask";let J="CHF";let Z,X,ee=0,te=0,ie=0,oe=0,re=1,le=!z&&D.list&&1===D.list.length;const se={},ae=D.items.find((e=>"price"===e.name&&!e.properties?.hidden)),ce=D.items.find((e=>"quantity"===e.name&&!e.properties?.hidden)),de=D.items.find((e=>"amount"===e.name&&!e.properties?.hidden)),ue=!!ae||!!de,me=D.list?.filter((e=>"array"===e.type))?.length>1||ue,fe=D.items.find((e=>"number"===e.type&&"w"===e.properties?.unit?.constant?.toLowerCase()&&!e.properties?.hidden))?.name,pe=!!fe,$e=D.list?.filter((e=>"array"===e.type))?.length>1||pe,he={},ge=D.result?.resultDef[0].button?.description;let ve,ye,be,we,xe=0,ke=0,Ie=[],_e=[],Ce=[],Se={},je=new Map,qe=D.class,Ne=D.id,Ee=!1,Le=-1!==window.location.search.indexOf("next=");const Fe=!p?.length||p.find((e=>e===Ne));["readonly","hidden","required"].map((e=>{D.items.filter((t=>"object"==typeof(t.properties&&t.properties[e]))).map((t=>{const n=t.properties[e].refItem||"",[i,o]=n.split(".");Ie.push({action:e,itemName:t.name,refObj:i,refName:o,op:t.properties[e].invert?"!":""})}))}));D.items.filter((e=>e.selection&&e.constraint)).map((e=>{_e.push({name:e.name,selection:e.selection,constraint:e.constraint})}));D.items.filter((e=>e.lookup)).forEach((e=>{Ce.push({name:e.name,lookup:e.lookup})})),D.items.filter((e=>e.properties?.lookup)).forEach((e=>{Ce.push({name:e.name,lookup:e.properties.lookup.split(":").at(-1)})}));const De=async e=>{if(e?.length)for(const n of e){if(!n.lookup)break;const{name:e}=n;if(P[e])break;const{domain:i,value:o}=n.lookup;if("user"===i&&o){const n=y.user,i={[o]:n},r=await t.getSectionView(e,i);if(r?.length){const[{_id:t}]=r;t&&a(4,P[e]=t,P)}}}},ze=async e=>{if(!D.input)return;if(!D.input.length)return;if(D.input.length<2)return;const n=!e.input.class[0].name&&e.input.class[0].selection;if(!n)return;const i=e.input.class[1].name,o=e.input.class[1].destination?.split(".")[0];if(!i||!o)return;const r=D.list?.find((e=>e.name===i));if(!r)return;const l=await t.getSchemaByClass(n),s=(await t.getTasks(l.id)).data;if(!s?.length)return;const c=[];for(const e of s){const t={};for(const n of r.item)n.name===o?t[n.name]=e._id:e[n.name]&&(t[n.name]=e[n.name]);c.push(t)}c.length&&a(4,P[i]=c,P)},Te=()=>{for(const e of D.items)e.properties?.value?.concatenation&&Ae(e)},Ae=async e=>{const t=e.properties.value.concatenation;let n="";for(const e of t)void 0!==e.constant&&(n+=e.constant),"year"===e.variable&&(n+=(new Date).getFullYear()),e.refItemNext&&(n+=await Ve(e.refItemNext));a(4,P[e.name]=n,P)},Be=async e=>{const t=Ie.filter((t=>t.refObj===e));if(t?.length){a(15,Se={});for(const e of t){const{itemName:t,refObj:n,refName:i,op:o}=e;let{action:r}=e;if(!n)break;let l,s,c=!i&&P[n];const d=P[n];d&&i&&(c=(await Js(n,d))[i]),Array.isArray(c)&&0===c.length&&(c=!1),"!"===o&&(c=!c),"required"!==r&&"readonly"!==r||(r="required"===r?r:"disabled",setTimeout((()=>{l=`#${G} .form-field.${t} .field #${t}`,s=document.querySelector(l),s&&c&&s.setAttribute(r,""),s&&!c&&s.removeAttribute(r)}),0)),"hidden"===r&&(l=`#${G} .form-field.${t}`,s=document.querySelector(l),s?.classList?.toggle("hidden",!!c),c&&a(15,Se[t]="",Se))}}},Ve=async e=>{const[n,i]=e.offset?.split(",")||[0,0],o=+e.base||0,r=+e.step||1;e.type;const l=e.refItem,s=await t.getLastId(D.class,l);if(!s?.length)return(o+r).toString().padStart(i,"0");const a=s[0][l];return((+a?.substring(n,n+i)||o)+r).toString().padStart(i,"0")},Oe=(e,t,n,i=!1)=>{const o=n||t.name,r=o.startsWith("_")?o:o.split("_")[0],l=e.find((e=>e.name===r));let s=t.value;if(!i&&l&&l.properties?.multi&&(s=P[o]),s&&l&&"dateRange"===l.type){let e=new Date(s);return"Invalid Date"==e?"":(e=`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(e).toISOString())}if(s&&l&&l.type.startsWith("date"))try{return Cn(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if(l&&"boolean"===l.type&&(s=!!t.checked),l&&"number"===l.type){const e=Number("1.1").toLocaleString(S.id).substring(1,2);try{s=Number(s.replace(e,".")).toString()}catch{}}return s},Me=()=>W?window.close():O?window.singleSpaNavigate("/"):j("back"),We=async(e,n)=>{if(D.input&&D.input.length>1){if(D.input[0]!==e)return;const{recursive:i}=be.input.class[1];if(n){const o=await t.getTaskOptions(`${e}:${n}`,Ne,i);a(4,P={...P,...o})}else{const e=D.input.slice(1);for(const t of e)a(4,P[t]=[],P)}}},Pe=()=>{let e=0;if(ae){let t=1;ce&&(t=re),e=oe*t}de&&(e=oe);let t=0;for(const e in se)t+=se[e];a(8,ee=t+e)},Re=()=>{let e=0;for(const t in he)e+=he[t];a(14,xe=e+ +ke)};n.subscribe((async e=>{if(!e)return;if(!z)return;const n=await t.getSchema(e.eventId);if(!n)return;const i=D.list?.find((e=>e.name===n.class));if(!i)return;const o=await t.getTaskById(e.taskId);((e,t,n)=>{if(!Rs.get(e))return;const i=t;Hs.set(i,n)})(o.event,o.docId,o.data);const r=await t.getTask(n.class,o.docId),l=P[n.class].filter((e=>e[n.class]==r._id));l?.length&&l.map((e=>{e[n.class]=o.docId})),a(4,P),a(62,N),a(61,q),a(1,D)})),H((()=>{Rs=new Map,Hs=new Map,Qs=new Map,He()}));const He=async()=>{const e=e=>new Promise((t=>setTimeout(t,e)));let t,n=0;for(;!(t=document.getElementById(G))&&++n<20;)await e(50);t&&(()=>{if(z)return;const e=new Set;for(const t of Ie)e.add(t.refObj||qe);Array.from(e).forEach((e=>Be(e)))})(),Qe()},Qe=()=>{setTimeout((()=>{Array.from(je).forEach((([e,t])=>{P[e]||a(4,P[e]=t._id,P)}))}),350)};Q((()=>{z&&function(e,t,n=t){e.set(n)}(m,$={[z]:{record:P,lists:R}},$)}));const Ye=()=>{const e={};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((t=>{if(t.name)if(t.name.includes(".")){const[n,i]=t.name.split("."),o=D.list.find((e=>e.name===n));e[t.name]=Oe(o.item,t)}else e[t.name]=Oe(D.items,t,t.name.split("_")[0])})),D.list&&D.list.map((t=>{"array"===t.type&&R[t.name]&&(e[t.name]=R[t.name].reduce(((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce(((e,[n,i])=>("_delete"!==n&&(e[n]=Oe(t.item,{name:n,value:i,checked:i},"",!0)),e)),{}))),[]))}));let t=!0;return Object.entries(e).map((([e,n])=>{e=e.split("_")[0];const i=D.items.find((t=>t.name===e));i?.properties?.required&&!n&&(t=!1)})),t&&e},Ge=e=>{const t="/api/report/list/"+e;window.open(t,"_self","width=1 height=1")};return e.$$set=e=>{"schema"in e&&a(1,D=e.schema),"recID"in e&&a(2,z=e.recID),"prevEventID"in e&&a(58,T=e.prevEventID),"prev"in e&&a(59,A=e.prev),"taskId"in e&&a(0,B=e.taskId),"description"in e&&a(56,V=e.description),"root"in e&&a(3,O=e.root),"readonly"in e&&a(57,M=e.readonly),"isStandalone"in e&&a(60,W=e.isStandalone)},e.$$.update=()=>{67108864&e.$$.dirty[1]&&a(21,d=M),2&e.$$.dirty[0]|1073741824&e.$$.dirty[1]|1&e.$$.dirty[2]&&N&&q&&D.items.map((({name:e,type:t,refItem:n})=>{if(!1===n)return;const i=q.items.find((t=>t.name===e));if(!i)return;if(t!==i.type)return;const o="_"+e;N[e]?a(4,P[e]=N[e],P):a(4,P[e]="",P),N[o]&&a(4,P[o]=N[o],P),a(13,le=!1)})),8&e.$$.dirty[0]|33554432&e.$$.dirty[1]&&a(22,f=O?V||"enablerr - Form":document.title)},[B,D,z,O,P,E,F,J,ee,te,ie,Z,X,le,xe,Se,ve,ye,Ee,we,Le,d,f,b,w,x,I,_,C,G,U,K,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},me,$e,{name:"weekValue",properties:{decimals:1}},ge,Ne,Fe,async()=>{a(17,ye=await t.getTemplate(D.class));const e=await t.getSectionView("owner",{});if(e?.length&&e[0].currency){const n=await t.getSectionView("currency",{_id:e[0].currency});n?.length&&n[0].designation&&a(7,J=n[0].designation)}if(be=await t.getEvent(Ne),z||(a(16,ve=ye),De(be.input?.class),Te(),ze(be)),z){if($&&$[z]){const e=$[z].record;D.items.map((t=>{e[t.name]=Oe(D.items,{name:t.name,value:e[t.name],checked:e[t.name]})})),a(4,P=e),D.list&&D.list.map((e=>{"array"===e.type&&$[z].lists[e.name]&&a(4,P[e.name]=$[z].lists[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Oe(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]),P)}))}else a(4,P=await t.getTask(D.class,z));a(56,V=h(D,P)),a(18,Ee=!!D.result?.resultDef),a(9,te=P._tax?._amount),a(10,ie=100*P._tax?._rate||"")}if(T){a(57,M=!1),a(61,q=await t.getSchema(T)),"string"==typeof A&&a(62,N=await t.getTask(q.class,A));const e=D.items.find((e=>e.refClass===q.class));a(4,P[e.name]=N._id,P)}if($e&&(ke=P[fe]||0),be.trigger?.startOn&&!be.trigger.startOn.some((e=>e.type.indexOf("Manual")>=0))&&a(57,M=!0),g.role?.length&&D.authorization?.length){const e=D.authorization.some((e=>v?.find((t=>t===e.role&&"edit"===e.activity))));a(57,M||=!e)}if(a(5,E="report"===be.output.type),a(19,we=!!(await t.getUserSettings()).isAdmin),!we){const e=y.tenants.find((e=>e._id===y.tenant));e&&a(19,we=e.admin?.find((e=>e===y.user)))}return!0},async e=>{z||a(21,d=!0);const n=e.submitter?.className?.includes("close"),i={};if(Array.from(document.querySelectorAll("form#"+G+" ."+G)).map((e=>{if(e.name)if(e.name.includes(".")){const[t,n]=e.name.split("."),o=D.list.find((e=>e.name===t));i[e.name]=Oe(o.item,e)}else i[e.name]=Oe(D.items,e)})),D.list&&D.list.map((e=>{"array"===e.type&&R[e.name]&&(i[e.name]=R[e.name].reduce(((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce(((t,[n,i])=>("_delete"!==n&&(t[n]=Oe(e.item,{name:n,value:i,checked:i},"",!0)),t)),{}))),[]))})),i._event=Ne,i._prevEventId=T,i._taskId=B,L){const e=L.record;for(const t in e)t.includes(".")&&delete e[t];e._event=L.event,e._taskId=L.taskId;const{id:n}=await t.saveData(L.class,e);i[L.class]||(i[L.class]=n)}const{id:o,task:r,tax:s,error:c}=await t.saveData(D.class,i);if(c?.text){const e=c.field?" in "+c.field+": "+c.value:"";return l.failed(`${c.text} ${e}`,3e3),void a(21,d=!1)}l.success("Die Daten wurden gespeichert.",2e3),a(9,te=s?._amount||0),a(10,ie=100*(s?._rate||0)||""),i._id=o;const u=await t.getTaskList(D.class,o);if(j("choose",{row:u}),n)return Me();if(!z){if(Le){const e=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Ne}/${Ne}/task?next=${e}`)}return window.singleSpaNavigate(`/task/${Ne}/${r}/task`)}},()=>!E&&T?window.history.back():Me(),async({detail:e})=>{const{row:n}=e;let{eventId:i}=e;if((()=>{if(z)for(const e of Ie)e.refName||Be(e.itemName)})(),z)return;if(await(async()=>{const e={...P};for(const n of D.items)if(n.refItem&&P[n.refItem]){const i=await t.getTask(n.refItem,P[n.refItem]);i&&(e[n.name]=i[n.name])}for(const n of D.list||[])if(n.refItem&&P[n.refItem]){const i=await t.getTask(n.refItem,P[n.refItem]),o=[];for(const e of i[n.name]){const t={};for(const i of n.item)e[i.name]&&(t[i.name]=e[i.name]);o.push(t)}e[n.name]=o}a(4,P=e)})(),i||=n._task?.event,(async(e,t)=>{if(!e)return;const n=be.output.class[0].name,i=Ce.filter((e=>e.lookup===n));if(i?.length)for(const e of i){const{lookup:n,name:i}=e;let o="";if(t){let e=await Js(n,t);e&&e[i]?.length&&(o=e[i][0][i])}a(4,P[i]=o,P)}})(i,n._id),i&&D.items.filter((e=>e.properties?.lookup)).forEach((async e=>{const n=await t.getEvent(i);n.output.class[0]?.name===e.properties.lookup&&a(4,P[e.name]="",P)})),!n._task)return;const o=n._task.event,r=await t.getEvent(o);if(!be.output?.class?.length)return;const l=be.output.class[0]?.item.find((e=>(e.refClass||e.name)===r.output.class[0]?.name));(be.input?.class?.length&&be.input.class[0].name===r.output.class[0]?.name||l?.asInput)&&(a(61,q=await t.getSchema(o)),a(58,T=o),a(0,B=n._task._id),a(62,N=B?await t.getTask(q.class,n._task.docId):{}),We(q.class,n?._task?.docId))},async({detail:e})=>{if(a(6,F=e),"quantity"===e.itemName&&a(12,X=P.quantity),(async(e,t)=>{const n=_e.filter((t=>t.selection===e||t.constraint===e));if(n?.length){a(11,Z=!1);for(const i of n){const{selection:n,constraint:o,name:r}=i;if(t)break;a(4,P[r]="",P),e===n&&a(11,Z=o);const l=P[n];if(l&&e===o){let e=await Js(n,l);const t=P[o];if(t?.length){const n=t[0].split(", ");e=e[o];let i="";for(const t of e)Object.values(t).map((e=>{n.includes(e)&&(i=t[r])}));a(4,P[r]=i,P)}}}}})(e.itemName,e.oldValue===e.value),Be(e.itemName),$e&&fe&&(e.itemName===fe&&(ke=+e.value),Re()),ue&&me){if(e.itemName===ae?.name)oe=e.value;else if(e.itemName===ce?.name)re=e.value;else{if(e.itemName!==de?.name)return;oe=e.value}Pe()}},async({detail:e})=>{if(!(D.input?.length&&D.input.length>1))return;if(q?.class!==D.input[0])return;const{value:n,lookup:i,view:o}=e;if(!i)return;const[r]=i.split(":"),l=(await t.getSectionView(r,{[o]:{$in:n}})).map((e=>e._id));for(const e of D.input.slice(1)){a(4,P[e]=[],P);const n=await t.getSchemaByClass(e);n.id;let i=await t.getTasks(n.id);if(i=i.data.filter((e=>"Ready"===e._task?.status&&l.includes(e[r]))),i?.length){const n=i.map((e=>e._id)),o=await t.getSectionView(e,{_id:{$in:n}});for(const t of o)t[e]=t._id;a(4,P[e]=o,P)}}},({detail:e})=>{R[e.listName]=e.value,me&&(se[e.listName]=e.amountValue,Pe()),$e&&(he[e.listName]=e.weeksValue||0,Re())},e=>{"button"!==e.srcElement?.type&&"textarea"!==e.srcElement?.type&&13==e.which&&e.preventDefault()},e=>async()=>{const n=await t.getReportDoc(e)||{},{userReportId:i,type:o}=n;if(!i)return;const r="/api/userreport/"+i;if("ics"===o)return window.open(r,"_self","width=1 height=1");const l="/viewer/doc/index.html?file="+r+"&type="+o;window.open(l,"","popup=yes toolbar=no width=624 height=900")},e=>async()=>{const e=await t.getDocData(B);(async(e,t)=>{const n=window.screen.height,i=window.open("","_blank","width=800,height="+n+",location=no");await ne(),i?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),i?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+e+"</textarea>")})(JSON.stringify(e,null,4),D.identity.designation)},async()=>{const e=Ye();if(!e)return;const n=be.result?.resultDef[0]?.addToReports;if(n){const i=e[n];if(i){const n={docId:i},o=(await t.getSectionView("_task",n))[0];e._taskId=o._id}}const{reportId:i,type:o}=await t.createReport(Ne,e);Ge(i),setTimeout(Me,2e3)},async()=>{const e=Ye();if(!e)return;const n=await t.getReportData(Ne,e),i=window.screen.height,o=window.open("","_blank","width=800,height="+i+",location=no");await ne(),o?.document.write("<title>Report Daten für '"+D.identity.designation+"'</title>"),o?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(n,null,4)+"</textarea>")},async({detail:{className:e,itemName:n,value:i}})=>{if(qe!==i)return;if(je.has(e))return;if(!0!==i&&(i=(i=[].concat(i)).some((e=>e===qe))),!i)return;const o={[n]:!0},r=await t.getSectionView(e,o);r?.length&&je.set(e,r[0])},({detail:e})=>{L=e},({detail:e})=>{setTimeout((()=>{a(4,P[e.itemName]=e.value,P)}),200)},()=>D.result.resultDef[0].button?.designation||"Dokument erstellen",V,M,T,A,W,q,N,function(e){ee=e,a(8,ee)},function(e){te=e,a(9,te)},function(e){xe=e,a(14,xe)},function(e){Le=e,a(20,Le)}]}class ea extends ke{constructor(e){var t;super(),ls.getElementById("svelte-9xiaib-style")||((t=q("style")).id="svelte-9xiaib-style",t.textContent="form.disabled.svelte-9xiaib input.svelte-9xiaib{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-9xiaib.svelte-9xiaib{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-9xiaib.svelte-9xiaib{min-width:30em}}.fEmbedded.svelte-9xiaib.svelte-9xiaib,.fTask.svelte-9xiaib.svelte-9xiaib{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-9xiaib.svelte-9xiaib{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-9xiaib.svelte-9xiaib{height:fit-content;max-height:70vh}.sTask.svelte-9xiaib.svelte-9xiaib{height:95%;display:inline-grid}.sTask.svelte-9xiaib .btn.svelte-9xiaib{display:initial !important}.form--buttons.svelte-9xiaib.svelte-9xiaib{display:flex;gap:1em;padding-top:0.75em}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}",_(ls.head,t)),xe(this,e,Xs,Ps,x,{schema:1,recID:2,prevEventID:58,prev:59,taskId:0,description:56,root:3,readonly:57,isStandalone:60},[-1,-1,-1,-1,-1])}}function ta(e){let t,n,i;function o(t){e[4](t)}let r={schema:e[5],recID:e[6]};return void 0!==e[0]&&(r.description=e[0]),t=new ea({props:r}),K.push((()=>ve(t,"description",o))),t.$on("back",e[2]),{c(){ye(t.$$.fragment)},m(e,n){be(t,e,n),i=!0},p(e,i){const o={};32&i&&(o.schema=e[5]),64&i&&(o.recID=e[6]),!n&&1&i&&(n=!0,o.description=e[0],oe((()=>n=!1))),t.$set(o)},i(e){i||(fe(t.$$.fragment,e),i=!0)},o(e){pe(t.$$.fragment,e),i=!1},d(e){we(t,e)}}}function na(e){let t,n;return t=new a({props:{update:e[1],description:e[0],$$slots:{default:[ta,({prop:{schema:e,recID:t,eventID:n}})=>({5:e,6:t,7:n}),({prop:e})=>(e?32:0)|(e?64:0)|(e?128:0)]},$$scope:{ctx:e}}}),{c(){ye(t.$$.fragment)},m(e,i){be(t,e,i),n=!0},p(e,[n]){const i={};1&n&&(i.description=e[0]),353&n&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){n||(fe(t.$$.fragment,e),n=!0)},o(e){pe(t.$$.fragment,e),n=!1},d(e){we(t,e)}}}function ia(e,n,i){let o,{refresh:r}=n;return e.$$set=e=>{"refresh"in e&&i(3,r=e.refresh)},[o,(e,n)=>t.getSchema(e).then((t=>({schema:t,recID:n,eventID:e,title:t.identity.designation}))),e=>{},r,function(e){o=e,i(0,o)}]}function oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ra,la,sa=(ra=function(e,t){function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("object"!==r(e))throw new Error("single-spa-svelte requires a configuration object");var t=i(i({},l),e);if(!t.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,t,n),mount:a.bind(null,t,n),unmount:c.bind(null,t,n),update:d.bind(null,t,n)}};var l={component:null,domElementGetter:null,props:{}};function s(e){return Promise.resolve()}function a(e,t,n){var o=Object.keys(l),r=Object.keys(e).reduce((function(t,n){return o.includes(n)||(t[n]=e[n]),t}),{});return Promise.resolve().then((function(){var o=function(e,t){return(t=t&&t.customProps?t.customProps:t).domElement?function(){return t.domElement}:t.domElementGetter?function(){return t.domElementGetter(t)}:e.domElementGetter?function(){return e.domElementGetter(t)}:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)}(e,n),l=o();t.instance=new e.component(i(i({},r),{},{target:l,props:Object.assign({},n,e.props)}))}))}function c(e,t){return Promise.resolve().then((function(){t.instance.$destroy?t.instance.$destroy():t.instance.destroy()}))}function d(e,t,n){return Promise.resolve().then((function(){t.instance.$set?t.instance.$set(n):t.instance.set(n)}))}},ra(la={exports:{}},la.exports),la.exports);const aa=oa(sa)({component:class extends ke{constructor(e){super(),xe(this,e,ia,na,x,{refresh:3})}},domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:ca,mount:da,unmount:ua}=aa;e({bootstrap:ca,mount:da,unmount:ua});e("Form",ea),e("List",_t),e("Template",class extends ke{constructor(e){var t;super(),jn.getElementById("svelte-1phofh5-style")||((t=q("style")).id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",_(jn.head,t)),xe(this,e,Wn,On,x,{schema:0,record:1})}})}}}));