@olympeio/runtime-node 9.0.0 → 9.0.1

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/index.js CHANGED
@@ -211,791 +211,793 @@ ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ha(thi
211
211
  ea('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});ea('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});ea('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});
212
212
  ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
213
213
  ea('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.iterator in b))throw new TypeError(''+b+' is not iterable');b=b[Symbol.iterator].call(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;if(Object(d)!==d)throw new TypeError('iterable for fromEntries should yield objects');c[d[0]]=d[1]}return c}});var ja=this||self;
214
- function z(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={dj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.dj().olympe=olympe;olympe.zC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ia={};olympe.ia.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.U={};olympe.U.zf={};olympe.U.zf.fo=class{process(a){const b=Object.keys(a.Ae);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Sd(b[c]).ij())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.U.zf.fo.ma=[olympe.U.zf.kq];olympe.U.zf.ho=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.Sd(g),c(g.bj(),h),g=g.Ci,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].bj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.U.Bb&&b(n.Z(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Ae);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
215
- !0;for(;void 0!==(e=d());)b(e,[])}};olympe.U.zf.ho.ma=[olympe.U.zf.kq];olympe.U.zf.kq=class{process(){}};const ka=[],la=[];olympe.U.ko=class{constructor(){}static C(a,b){ka.push(new olympe.U.wl(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});la.push(new olympe.U.wl(b,c,a))}};olympe.U.config=olympe.U.ko.C;olympe.U.run=olympe.U.ko.F;olympe.U.ol=class{constructor(){}getValue(){}};olympe.U.wl=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.U.Bb(c[d]))}}bj(){return this.G}};function ma(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.U.ff.C.Jh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.N.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.N.C++,f=b[e],d[e]=f instanceof olympe.U.ol?f.getValue(a):f,oa(a.N);return d}
216
- olympe.U.ff=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.N=new olympe.U.Hp(c);a=olympe.U.O.cg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Za(){return this.N}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.U.ff.C={Ys:'exception',Jh:'null'};function pa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function B(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!1)}function ra(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
- function C(a,b,c,d,e=!1){qa(a.N,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.N,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.N,'Defining abstract service '+b);a.C(b).Ri=!0}function ua(a,b){a.parameters[olympe.H.Config.ao.toLowerCase()]=b}function E(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
- olympe.U.Ls=class{constructor(a){var b=va,c=wa;this.Ae=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.U.zf.fo,new olympe.U.zf.ho];this.F=[];b&&pa(this,b);c&&pa(this,c,'version');a&&pa(this,a);a=this.getParameter(olympe.U.Config.Ut);this.G=void 0!==a?a:3;this.N=new olympe.U.Hp(this.G)}Za(){return this.N}C(a,b,c,d,e){const f=a instanceof olympe.U.Bb?a.Z():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Ae[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
219
- var g=this.Ae[f];g.id=g.id+'!!'+ ++olympe.U.Cl.C;g.F=!0;g=g.id;c[h]=g;this.Ae[g]=this.Ae[f]}}this.Ae[f]=new olympe.U.Cl(b,c,d||!1,f,e||!1);return this.Ae[f]}Sd(a){a=this.Ae[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.N.debug('Calling '+a.length+' configure callbacks');this.N.C++;for(let b=0,c=a.length;b<c;b++)qa(this.N,'Calling callback'),this.N.C++,a[b].call(null,this),oa(this.N);oa(this.N);this.N.debug('Configuration summary: '+
220
- Object.keys(this.Ae).length+' definitions');this.N.debug('Compiling...');this.N.C++;a=this.L;for(let b=0,c=a.length;b<c;b++)this.N.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.N);this.N.debug('Compilation done, returning container');return new olympe.U.ff(this.Ae,this.parameters,this.G)}};olympe.U.Cl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.L=!!c;this.C=[];this.Ri=!1;this.Ci=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.U.Bb(b[f]))}this.id=d||'';this.R=e;this.F=!1}Z(){return this.id}instantiate(a){const b=a.Za();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=na(a,this.C);const e=()=>{if(this.L)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};qa(b,'Instantiating '+this.id);const f=olympe.D?
221
- olympe.D.zg().run(()=>e()):e(),g=this.Ci;let h,k,l;if(null!==g&&0<g.length){b.C++;qa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],qa(b,'Calling additional configuration callback '+h.C),d=na(a,h.bj()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}qa(b,'Done instantiating '+this.id);return f}kj(){return this.R}bj(){return this.C}ij(){return this.Ri}config(a,b,c){null===this.Ci&&(this.Ci=[]);this.Ci.push(new olympe.U.wl(b,c,a))}};olympe.U.Cl.C=0;function oa(a){0<a.C&&a.C--}function qa(a,b){1>=a.F&&xa(a,'log','DI: '+b)}function xa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.U.Hp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&xa(this,'log','DI: '+a)}info(a){3>=this.F&&xa(this,'info','DI: '+a)}warn(a){4>=this.F&&xa(this,'warn','DI: '+a)}error(a){5>=this.F&&xa(this,'error','DI: '+a)}};olympe.U.fa=class extends olympe.U.ol{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.U.Bb=class extends olympe.U.ol{constructor(a,b){super();this.id=a;this.C=b||olympe.U.ff.C.Ys}Z(){return this.id}getValue(a){return ma(a,this.id,this.C)}};olympe.U.O={cg:'di.Container',qA:'di.PublicContainer'};olympe.U.Config={Ut:'logging.di'};olympe.U.run([olympe.U.O.cg],a=>{olympe.U.getParameter=b=>a.getParameter(b)});olympe.W={};function ya(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function za(){var a=Math.random();return ya((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Aa=Math.pow(2,32)-1;olympe.W.hc=function(){return za()};olympe.W.aj=function(){return za()};olympe.W.fn=function(a,b=1){const c=a.substr(12,a.length-12);return ya(parseInt(a.substr(0,12),16)+b)+c};
222
- olympe.W.Rw=function(a){return ya(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ba=0,Ca=0;olympe.W.bw=function(){var a=(new Date).getTime();a<=Ba?4294967295===Ca?(Ca=Math.floor(Math.random()/4*Aa),Ba+=1):Ca=Math.floor(Ca+(4294967295-Ca)/2):(Ca=Math.floor(Math.random()/4*Aa),Ba=a);a='00000000'+Ca.toString(16);return ya(Ba)+a.substr(a.length-8,8)};olympe.W.bD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.bw())};
223
- olympe.W.xg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.EC=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.W.BC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.tp=class{constructor(a){this.id=a||olympe.W.tp.C++}sb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.tp.C=0;olympe.W.cA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.W.Hh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.W.Hh.F=function(a){return new olympe.W.Hh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.W.Hh.C=function(){return new olympe.W.Hh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Hh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Hh.prototype.get=function(a,b){return this.values[5*a+b]};function Da(a){return(new TextEncoder).encode(a).buffer}function Ea(a){return(new TextDecoder('utf8')).decode(a)}olympe.W.rl=class{R(){}C(){}G(){}L(){}F(){}Y(){}};olympe.W.vr=a=>a.replace('+','-').replace('/','_');olympe.W.yv=a=>a.replace('-','+').replace('_','/');function Fa(a){a.F=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Fa(a):a.C&&a.C()},a.L)}function Ga(a,b){a.G=b;return a}
224
- olympe.W.Zq=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.C=this.G=this.F=null}add(a){this.values.set(a,Date.now());null===this.F&&Fa(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.F&&clearTimeout(this.F),this.C&&this.C());return a}};olympe.W.Yq=class{constructor(a){this.F=Ga(new olympe.W.Zq(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a)}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}};function Ha(a,b){return a+b&4294967295}
214
+ function z(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={dj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.dj().olympe=olympe;olympe.DC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ha={};olympe.ha.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.U={};olympe.U.zf={};olympe.U.zf.io=class{process(a){const b=Object.keys(a.Ae);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Rd(b[c]).ij())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.U.zf.io.ma=[olympe.U.zf.oq];olympe.U.zf.jo=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.Rd(g),c(g.bj(),h),g=g.Ci,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].bj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.U.Bb&&b(n.Z(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Ae);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
215
+ !0;for(;void 0!==(e=d());)b(e,[])}};olympe.U.zf.jo.ma=[olympe.U.zf.oq];olympe.U.zf.oq=class{process(){}};const ka=[],la=[];olympe.U.mo=class{constructor(){}static C(a,b){ka.push(new olympe.U.wl(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});la.push(new olympe.U.wl(b,c,a))}};olympe.U.config=olympe.U.mo.C;olympe.U.run=olympe.U.mo.F;olympe.U.ol=class{constructor(){}getValue(){}};olympe.U.wl=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.U.Bb(c[d]))}}bj(){return this.G}};function ma(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.U.ff.C.Jh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.N.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.N.C++,f=b[e],d[e]=f instanceof olympe.U.ol?f.getValue(a):f,oa(a.N);return d}
216
+ olympe.U.ff=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.N=new olympe.U.Kp(c);a=olympe.U.O.cg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Ya(){return this.N}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.U.ff.C={bt:'exception',Jh:'null'};function pa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function B(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!1)}function ra(a,b,c,...d){qa(a.N,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
+ function C(a,b,c,d,e=!1){qa(a.N,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function sa(a,b,c,d=!1){qa(a.N,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ta(a,b){qa(a.N,'Defining abstract service '+b);a.C(b).Ri=!0}function ua(a,b){a.parameters[olympe.H.Config.co.toLowerCase()]=b}function E(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
+ olympe.U.Ps=class{constructor(a){var b=va,c=wa;this.Ae=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.U.zf.io,new olympe.U.zf.jo];this.F=[];b&&pa(this,b);c&&pa(this,c,'version');a&&pa(this,a);a=this.getParameter(olympe.U.Config.Yt);this.G=void 0!==a?a:3;this.N=new olympe.U.Kp(this.G)}Ya(){return this.N}C(a,b,c,d,e){const f=a instanceof olympe.U.Bb?a.Z():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Ae[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
219
+ var g=this.Ae[f];g.id=g.id+'!!'+ ++olympe.U.Cl.C;g.F=!0;g=g.id;c[h]=g;this.Ae[g]=this.Ae[f]}}this.Ae[f]=new olympe.U.Cl(b,c,d||!1,f,e||!1);return this.Ae[f]}Rd(a){a=this.Ae[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.N.debug('Calling '+a.length+' configure callbacks');this.N.C++;for(let b=0,c=a.length;b<c;b++)qa(this.N,'Calling callback'),this.N.C++,a[b].call(null,this),oa(this.N);oa(this.N);this.N.debug('Configuration summary: '+
220
+ Object.keys(this.Ae).length+' definitions');this.N.debug('Compiling...');this.N.C++;a=this.L;for(let b=0,c=a.length;b<c;b++)this.N.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);oa(this.N);this.N.debug('Compilation done, returning container');return new olympe.U.ff(this.Ae,this.parameters,this.G)}};olympe.U.Cl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.L=!!c;this.C=[];this.Ri=!1;this.Ci=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.U.Bb(b[f]))}this.id=d||'';this.R=e;this.F=!1}Z(){return this.id}instantiate(a){const b=a.Ya();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=na(a,this.C);const e=()=>{if(this.L)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};qa(b,'Instantiating '+this.id);const f=olympe.D?
221
+ olympe.D.zg().run(()=>e()):e(),g=this.Ci;let h,k,l;if(null!==g&&0<g.length){b.C++;qa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],qa(b,'Calling additional configuration callback '+h.C),d=na(a,h.bj()),d.push(f),h.F.apply(null,d),oa(b);oa(b)}qa(b,'Done instantiating '+this.id);return f}kj(){return this.R}bj(){return this.C}ij(){return this.Ri}config(a,b,c){null===this.Ci&&(this.Ci=[]);this.Ci.push(new olympe.U.wl(b,c,a))}};olympe.U.Cl.C=0;function oa(a){0<a.C&&a.C--}function qa(a,b){1>=a.F&&xa(a,'log','DI: '+b)}function xa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.U.Kp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&xa(this,'log','DI: '+a)}info(a){3>=this.F&&xa(this,'info','DI: '+a)}warn(a){4>=this.F&&xa(this,'warn','DI: '+a)}error(a){5>=this.F&&xa(this,'error','DI: '+a)}};olympe.U.fa=class extends olympe.U.ol{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.U.Bb=class extends olympe.U.ol{constructor(a,b){super();this.id=a;this.C=b||olympe.U.ff.C.bt}Z(){return this.id}getValue(a){return ma(a,this.id,this.C)}};olympe.U.O={cg:'di.Container',vA:'di.PublicContainer'};olympe.U.Config={Yt:'logging.di'};olympe.U.run([olympe.U.O.cg],a=>{olympe.U.getParameter=b=>a.getParameter(b)});olympe.W={};function ya(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function za(){var a=Math.random();return ya((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let Aa=Math.pow(2,32)-1;olympe.W.fc=function(){return za()};olympe.W.aj=function(){return za()};olympe.W.gn=function(a,b=1){const c=a.substr(12,a.length-12);return ya(parseInt(a.substr(0,12),16)+b)+c};
222
+ olympe.W.Vw=function(a){return ya(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ba=0,Ca=0;olympe.W.fw=function(){var a=(new Date).getTime();a<=Ba?4294967295===Ca?(Ca=Math.floor(Math.random()/4*Aa),Ba+=1):Ca=Math.floor(Ca+(4294967295-Ca)/2):(Ca=Math.floor(Math.random()/4*Aa),Ba=a);a='00000000'+Ca.toString(16);return ya(Ba)+a.substr(a.length-8,8)};olympe.W.fD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.fw())};
223
+ olympe.W.xg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.IC=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.W.FC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.wp=class{constructor(a){this.id=a||olympe.W.wp.C++}sb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.wp.C=0;olympe.W.hA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.W.Hh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.W.Hh.F=function(a){return new olympe.W.Hh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.W.Hh.C=function(){return new olympe.W.Hh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Hh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Hh.prototype.get=function(a,b){return this.values[5*a+b]};function Da(a){return(new TextEncoder).encode(a).buffer}function Ea(a){return(new TextDecoder('utf8')).decode(a)}olympe.W.rl=class{R(){}C(){}G(){}L(){}F(){}Y(){}};olympe.W.yr=a=>a.replace('+','-').replace('/','_');olympe.W.Cv=a=>a.replace('-','+').replace('_','/');function Fa(a){a.F=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Fa(a):a.C&&a.C()},a.L)}function Ga(a,b){a.G=b;return a}
224
+ olympe.W.br=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.C=this.G=this.F=null}add(a){this.values.set(a,Date.now());null===this.F&&Fa(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.F&&clearTimeout(this.F),this.C&&this.C());return a}};olympe.W.ar=class{constructor(a){this.F=Ga(new olympe.W.br(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a)}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}};function Ha(a,b){return a+b&4294967295}
225
225
  function Ia(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=F(c,d,e,f,b[0],7,-680876936);f=F(f,c,d,e,b[1],12,-389564586);e=F(e,f,c,d,b[2],17,606105819);d=F(d,e,f,c,b[3],22,-1044525330);c=F(c,d,e,f,b[4],7,-176418897);f=F(f,c,d,e,b[5],12,1200080426);e=F(e,f,c,d,b[6],17,-1473231341);d=F(d,e,f,c,b[7],22,-45705983);c=F(c,d,e,f,b[8],7,1770035416);f=F(f,c,d,e,b[9],12,-1958414417);e=F(e,f,c,d,b[10],17,-42063);d=F(d,e,f,c,b[11],22,-1990404162);c=F(c,d,e,f,b[12],7,1804603682);f=F(f,c,d,e,b[13],12,-40341101);e=F(e,f,
226
226
  c,d,b[14],17,-1502002290);d=F(d,e,f,c,b[15],22,1236535329);c=G(c,d,e,f,b[1],5,-165796510);f=G(f,c,d,e,b[6],9,-1069501632);e=G(e,f,c,d,b[11],14,643717713);d=G(d,e,f,c,b[0],20,-373897302);c=G(c,d,e,f,b[5],5,-701558691);f=G(f,c,d,e,b[10],9,38016083);e=G(e,f,c,d,b[15],14,-660478335);d=G(d,e,f,c,b[4],20,-405537848);c=G(c,d,e,f,b[9],5,568446438);f=G(f,c,d,e,b[14],9,-1019803690);e=G(e,f,c,d,b[3],14,-187363961);d=G(d,e,f,c,b[8],20,1163531501);c=G(c,d,e,f,b[13],5,-1444681467);f=G(f,c,d,e,b[2],9,-51403784);
227
227
  e=G(e,f,c,d,b[7],14,1735328473);d=G(d,e,f,c,b[12],20,-1926607734);c=H(d^e^f,c,d,b[5],4,-378558);f=H(c^d^e,f,c,b[8],11,-2022574463);e=H(f^c^d,e,f,b[11],16,1839030562);d=H(e^f^c,d,e,b[14],23,-35309556);c=H(d^e^f,c,d,b[1],4,-1530992060);f=H(c^d^e,f,c,b[4],11,1272893353);e=H(f^c^d,e,f,b[7],16,-155497632);d=H(e^f^c,d,e,b[10],23,-1094730640);c=H(d^e^f,c,d,b[13],4,681279174);f=H(c^d^e,f,c,b[0],11,-358537222);e=H(f^c^d,e,f,b[3],16,-722521979);d=H(e^f^c,d,e,b[6],23,76029189);c=H(d^e^f,c,d,b[9],4,-640364487);
228
228
  f=H(c^d^e,f,c,b[12],11,-421815835);e=H(f^c^d,e,f,b[15],16,530742520);d=H(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
229
229
  b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=Ha(c,a[0]);a[1]=Ha(d,a[1]);a[2]=Ha(e,a[2]);a[3]=Ha(f,a[3])}function H(a,b,c,d,e,f){b=Ha(Ha(b,a),Ha(d,f));return Ha(b<<e|b>>>32-e,c)}function F(a,b,c,d,e,f,g){return H(b&c|~b&d,a,b,e,f,g)}function G(a,b,c,d,e,f,g){return H(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return H(c^(b|~d),a,b,e,f,g)}
230
230
  function Ja(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);Ia(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(Ia(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
231
- Ia(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ja('hello')&&(Ha=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.W.ob=Ja;olympe.W.Tx=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||
232
- null,pC:g||null,qs:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,CC:f||null,parameters:b}};olympe.W.XC=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.$C=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};olympe.W.Kr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
233
- olympe.W.tn=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.W.tn(a[c],d):a[c]=d}};olympe.W.Xm=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.tn(d,e);b(`conf.d/${a}`,f=>{olympe.W.tn(d,f);c(d)})})};olympe.W.mC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Ag(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.W.Ny=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.W.Xt=class{constructor(a,b){this.start=a;this.end=b}};olympe.W.Xt.C={Di:'left',Li:'right',Ly:'bottom',HB:'top'};function Ka(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.W.Uh.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.W.Uh.C:new olympe.W.Uh(b,c,d,a[4])}function La(a){return`${a.C}.${a.F}.${a.G}`}
234
- olympe.W.Uh=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=d||null}Rk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}vj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}sb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.W.Uh.C=new olympe.W.Uh(Number.NaN,Number.NaN,Number.NaN);olympe.W.O={xh:'utils.binaryConverter',xs:'utils.base64Converter'};olympe.U.config(a=>{ta(a,olympe.W.O.xh);sa(a,olympe.W.O.xs,olympe.W.O.xh,!0)},'Utils services');olympe.U.run([olympe.W.O.xh],a=>{olympe.W.bi=()=>a});olympe.sa={};olympe.sa.Qb=class{L(){}oa(){}G(){}aa(){}ha(){}Fa(){}R(){}Y(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.sa.Qb.prototype.fatal=olympe.sa.Qb.prototype.fatal;olympe.sa.Qb.prototype.error=olympe.sa.Qb.prototype.error;olympe.sa.Qb.prototype.warn=olympe.sa.Qb.prototype.warn;olympe.sa.Qb.prototype.info=olympe.sa.Qb.prototype.info;olympe.sa.Qb.prototype.log=olympe.sa.Qb.prototype.log;olympe.sa.Qb.prototype.debug=olympe.sa.Qb.prototype.debug;olympe.sa.Qb.prototype.trace=olympe.sa.Qb.prototype.trace;
235
- olympe.sa.Qb.C={Vu:0,dg:1,Tt:2,op:3,bv:4,rc:5,at:6,Zl:7};olympe.sa.Qb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.sa.va=class{Pc(){}};olympe.sa.jd={};function Ma(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.bb?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Ta[b](f,'color: '+e,'color: #444');for(const h of a.td.values())h(g,c,b,...d)}
236
- olympe.sa.jd.Qb=class{constructor(a,b,c){this.name=a;this.C=b;this.bb=c;this.F=a.toUpperCase();this.td=new Map;this.Ta=console}L(){return this.C}oa(){return this.C<=olympe.sa.Qb.C.Vu}G(){return this.C<=olympe.sa.Qb.C.dg}ha(){return this.C<=olympe.sa.Qb.C.Tt}aa(){return this.C<=olympe.sa.Qb.C.op}Fa(){return this.C<=olympe.sa.Qb.C.bv}R(){return this.C<=olympe.sa.Qb.C.rc}Y(){return this.C<=olympe.sa.Qb.C.at}trace(...a){this.oa()&&Ma(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&Ma(this,'log',
237
- this.F,a,'#888','debug')}log(...a){this.ha()&&Ma(this,'log',this.F,a,'#000','log')}info(...a){this.aa()&&Ma(this,'info',this.F,a,'#00f','info')}warn(...a){this.Fa()&&Ma(this,'warn',this.F,a,'#684911','warn')}error(...a){this.R()&&Ma(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Y()&&Ma(this,'error',this.F,a,'#f00','fatal')}};olympe.sa.jd.Qb.ma=[olympe.sa.Qb];olympe.sa.jd.va=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.N=this.Pc('logging');this.N.info('Logging initialized, global log level is '+olympe.sa.Qb.F[b])}Pc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.sa.Config.Cs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.sa.Config.Ju}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
- c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.sa.jd.Qb(a,b,d);this.channels.set(a,b)}return b}};olympe.sa.jd.va.ma=[olympe.sa.va];olympe.sa.O={xa:'logging.Manager'};olympe.sa.Config={Ro:'logging',So:'logging.showLogLevel',Cs:'logging',Ju:'showLogLevel'};olympe.U.config(function(a){E(a,olympe.sa.Config.Ro,olympe.sa.Qb.C.op);E(a,olympe.sa.Config.So,!0);ra(a,olympe.sa.O.xa,olympe.sa.jd.va,olympe.U.O.cg,new olympe.U.fa(olympe.sa.Config.Ro),new olympe.U.fa(olympe.sa.Config.So))},'olympe.logging');olympe.U.run([olympe.sa.O.xa],a=>{olympe.sa.Za=b=>a.Pc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Np:'df.nodeCreationThreshold'};const Na=[];function Oa(){}function Pa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Oa:b;this.F=void 0===c?Na:c;this.aa=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.J.ha:new a(Pa,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Na}R(){return null===this.C&&null===this.F}Y(){return this.C===Pa}};olympe.D.J.aa=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ha=new olympe.D.J(Pa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ea);
239
- olympe.D.J.F=new olympe.D.J(()=>olympe.D.Xa);olympe.D.J.R=new olympe.D.J(()=>olympe.D.ra);olympe.D.J.Y=new olympe.D.J(()=>olympe.D.kc);olympe.D.Bh=class{Z(){return''}Tb(){return''}destroy(){}zb(){return!1}R(){return!1}run(a,...b){return a(...b)}C(a){return a}getParent(){return null}Qd(){}kh(){}uc(){}Oc(){}Kk(){}aa(){}onDestroy(){return''}Ie(){}xc(){return''}$c(){}};olympe.D.Bh.prototype.offDestroy=olympe.D.Bh.prototype.Ie;olympe.D.Bh.prototype.onDestroy=olympe.D.Bh.prototype.onDestroy;let Qa=0;olympe.U.run([new olympe.U.fa(olympe.D.Config.Np)],()=>{});
240
- olympe.D.Zb=class{constructor(a='SimpleContext',b){++Qa;this.children=new Map;this.Fa=new Map;this.oa=new Map;this.Ab=0;this.name=a;this.id=String(Qa);this.cb=this.Ta=!1;(this.parent=void 0===b?olympe.D.Ia():b)&&this.parent.uc(this);this.debug=!1}Z(){return this.id}Tb(){return this.name}run(a,...b){if(!this.Ta){var c=olympe.D.hs(this);a=a(...b);c&&olympe.D.hs(c);return a}}C(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Ta&&!this.cb){this.cb=!0;this.aa();for(const a of this.Fa.keys())this.Fa.has(a)&&
241
- this.Fa.get(a)();this.Fa.clear();this.oa.clear();this.parent&&(this.parent.Oc(this,!1),this.parent=null);this.Ta=!0;this.cb=!1;this.aa()}}zb(){return this.Ta}R(){return this.cb}uc(a){if(!this.Ta){var b;olympe.D.nb(a)?b=a.Na:olympe.D.nn(a)&&(b=a);b&&this.children.set(b.Z(),b)}}Oc(a,b=!0){let c;olympe.D.nb(a)?c=a.Na:olympe.D.nn(a)&&(c=a);c&&this.children.has(c.Z())&&(b&&c.Kk(this),this.children.delete(c.Z()))}Kk(){this.parent=null;this.destroy()}aa(){const a=this.children;for(const b of a.keys())a.has(b)&&
242
- a.get(b).Kk(this);this.children.clear();for(const b of this.oa.keys())this.oa.has(b)&&this.oa.get(b)();this.oa.clear()}onDestroy(a,b){void 0===b&&(++this.Ab,b=String(this.Ab));this.Fa.set(b,a);return b}Ie(a){this.Fa.delete(a)}xc(a){if(void 0===b){++this.Ab;var b=String(this.Ab)}this.oa.set(b,a);return b}$c(a){this.oa.delete(a)}Qd(a){this.parent&&this.parent.Oc(this,!1);(this.parent=a||null)&&this.parent.uc(this)}getParent(){return this.parent}kh(){return this.children}};
243
- olympe.D.Bq=class extends olympe.D.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Ie(){}};olympe.D.Bh.ma=[olympe.D.Bh];let Ra=0;
244
- function Sa(a,b){a.Y||(a.Y=new Map);a.Y.set(b.Z(),b);switch(b.Ud()){case olympe.D.Node.C.Ih:break;case olympe.D.Node.C.Th:break;case olympe.D.Node.C.fk:case olympe.D.Node.C.fg:olympe.D.N.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Ch:Ta(a,olympe.D.Node.C.Ch);break;case olympe.D.Node.C.OBSOLETE:a.cc=!0;a.F!==olympe.D.Node.C.Ch&&Ta(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.eg:olympe.D.N.warn('Adding a destroyed node as upstream => should never happen!');break;
245
- default:olympe.D.N.warn('Unknown state, investigate: ',b.Ud())}Ua(b,a)}
246
- function Va(a){if(a.Ed){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.D.Node)if(Wa(a.Xf))b=a.Xf.Ib;else return;else b=a.Xf;else b=null;if(null!==a.ha){const e=a.tg;for(let f=0,g=a.ha.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ha[f];if(Wa(h))c.push(h.Ib);else return}else c.push(a.ha[f])}if(a.Ed instanceof Function)var d=a.Ed;else b&&(b[a.Ed]||olympe.D.N.warn('looks like you forget a cast somewhere around '+a.Ed),d=b[a.Ed]);a.run(()=>{a.aa();if(void 0!==d){const e=d.apply(b,c);e&&e.nr?
247
- Xa(a,e.Na):e instanceof olympe.D.Node?Xa(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ta(a,olympe.D.Node.C.Th))}else Ya(a)})}}function L(a){void 0===a.Pb&&(a.Pb=a.valueType===olympe.D.Proxy?Za(void 0,a.ud):Za(a.valueType,a.ud),a.Pb.Na=a);return a.Pb}function $a(a){void 0!==a.G&&(ab(a.G,a),a.G=void 0)}function bb(a){if(a.F===olympe.D.Node.C.OBSOLETE&&(a.F=olympe.D.Node.C.Th,null!==a.L))for(const b of a.L.values())cb(b)}function Ta(a,b){b!==a.F&&(a.F=b)}
231
+ Ia(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ja('hello')&&(Ha=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.W.ob=Ja;olympe.W.Xx=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||
232
+ null,tC:g||null,us:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,GC:f||null,parameters:b}};olympe.W.aD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.dD=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};olympe.W.Nr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
233
+ olympe.W.vn=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.W.vn(a[c],d):a[c]=d}};olympe.W.Ym=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.vn(d,e);b(`conf.d/${a}`,f=>{olympe.W.vn(d,f);c(d)})})};olympe.W.qC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Ag(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.W.Sy=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.W.au=class{constructor(a,b){this.start=a;this.end=b}};olympe.W.au.C={Di:'left',Li:'right',Qy:'bottom',LB:'top'};function Ka(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.W.Uh.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.W.Uh.C:new olympe.W.Uh(b,c,d,a[4])}function La(a){return`${a.C}.${a.F}.${a.G}`}
234
+ olympe.W.Uh=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=d||null}Rk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}vj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}sb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.W.Uh.C=new olympe.W.Uh(Number.NaN,Number.NaN,Number.NaN);olympe.W.O={xh:'utils.binaryConverter',Bs:'utils.base64Converter'};olympe.U.config(a=>{ta(a,olympe.W.O.xh);sa(a,olympe.W.O.Bs,olympe.W.O.xh,!0)},'Utils services');olympe.U.run([olympe.W.O.xh],a=>{olympe.W.bi=()=>a});olympe.sa={};olympe.sa.Qb=class{L(){}qa(){}G(){}ea(){}ka(){}Fa(){}R(){}Y(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.sa.Qb.prototype.fatal=olympe.sa.Qb.prototype.fatal;olympe.sa.Qb.prototype.error=olympe.sa.Qb.prototype.error;olympe.sa.Qb.prototype.warn=olympe.sa.Qb.prototype.warn;olympe.sa.Qb.prototype.info=olympe.sa.Qb.prototype.info;olympe.sa.Qb.prototype.log=olympe.sa.Qb.prototype.log;olympe.sa.Qb.prototype.debug=olympe.sa.Qb.prototype.debug;olympe.sa.Qb.prototype.trace=olympe.sa.Qb.prototype.trace;
235
+ olympe.sa.Qb.C={Zu:0,dg:1,Xt:2,sp:3,gv:4,tc:5,et:6,Zl:7};olympe.sa.Qb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.sa.ta=class{Qc(){}};olympe.sa.jd={};function Ma(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.cb?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Ta[b](f,'color: '+e,'color: #444');for(const h of a.sd.values())h(g,c,b,...d)}
236
+ olympe.sa.jd.Qb=class{constructor(a,b,c){this.name=a;this.C=b;this.cb=c;this.F=a.toUpperCase();this.sd=new Map;this.Ta=console}L(){return this.C}qa(){return this.C<=olympe.sa.Qb.C.Zu}G(){return this.C<=olympe.sa.Qb.C.dg}ka(){return this.C<=olympe.sa.Qb.C.Xt}ea(){return this.C<=olympe.sa.Qb.C.sp}Fa(){return this.C<=olympe.sa.Qb.C.gv}R(){return this.C<=olympe.sa.Qb.C.tc}Y(){return this.C<=olympe.sa.Qb.C.et}trace(...a){this.qa()&&Ma(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&Ma(this,'log',
237
+ this.F,a,'#888','debug')}log(...a){this.ka()&&Ma(this,'log',this.F,a,'#000','log')}info(...a){this.ea()&&Ma(this,'info',this.F,a,'#00f','info')}warn(...a){this.Fa()&&Ma(this,'warn',this.F,a,'#684911','warn')}error(...a){this.R()&&Ma(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Y()&&Ma(this,'error',this.F,a,'#f00','fatal')}};olympe.sa.jd.Qb.ma=[olympe.sa.Qb];olympe.sa.jd.ta=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.N=this.Qc('logging');this.N.info('Logging initialized, global log level is '+olympe.sa.Qb.F[b])}Qc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.sa.Config.Gs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.sa.Config.Nu}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
+ c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.sa.jd.Qb(a,b,d);this.channels.set(a,b)}return b}};olympe.sa.jd.ta.ma=[olympe.sa.ta];olympe.sa.O={xa:'logging.Manager'};olympe.sa.Config={To:'logging',Uo:'logging.showLogLevel',Gs:'logging',Nu:'showLogLevel'};olympe.U.config(function(a){E(a,olympe.sa.Config.To,olympe.sa.Qb.C.sp);E(a,olympe.sa.Config.Uo,!0);ra(a,olympe.sa.O.xa,olympe.sa.jd.ta,olympe.U.O.cg,new olympe.U.fa(olympe.sa.Config.To),new olympe.U.fa(olympe.sa.Config.Uo))},'olympe.logging');olympe.U.run([olympe.sa.O.xa],a=>{olympe.sa.Ya=b=>a.Qc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Qp:'df.nodeCreationThreshold'};const Na=[];function Oa(){}function Pa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Oa:b;this.F=void 0===c?Na:c;this.ea=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.J.ka:new a(Pa,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Na}R(){return null===this.C&&null===this.F}Y(){return this.C===Pa}};olympe.D.J.ea=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ka=new olympe.D.J(Pa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.da);
239
+ olympe.D.J.F=new olympe.D.J(()=>olympe.D.Xa);olympe.D.J.R=new olympe.D.J(()=>olympe.D.ra);olympe.D.J.Y=new olympe.D.J(()=>olympe.D.kc);olympe.D.Bh=class{Z(){return''}Tb(){return''}destroy(){}zb(){return!1}R(){return!1}run(a,...b){return a(...b)}C(a){return a}getParent(){return null}ee(){}kh(){}lc(){}Pc(){}Kk(){}ea(){}onDestroy(){return''}Ie(){}xc(){return''}Lc(){}};olympe.D.Bh.prototype.offDestroy=olympe.D.Bh.prototype.Ie;olympe.D.Bh.prototype.onDestroy=olympe.D.Bh.prototype.onDestroy;let Qa=0;olympe.U.run([new olympe.U.fa(olympe.D.Config.Qp)],()=>{});
240
+ olympe.D.Zb=class{constructor(a='SimpleContext',b){++Qa;this.children=new Map;this.Fa=new Map;this.qa=new Map;this.Ab=0;this.name=a;this.id=String(Qa);this.$a=this.Ta=!1;(this.parent=void 0===b?olympe.D.Ia():b)&&this.parent.lc(this);this.debug=!1}Z(){return this.id}Tb(){return this.name}run(a,...b){if(!this.Ta){var c=olympe.D.ms(this);a=a(...b);c&&olympe.D.ms(c);return a}}C(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Ta&&!this.$a){this.$a=!0;this.ea();for(const a of this.Fa.keys())this.Fa.has(a)&&
241
+ this.Fa.get(a)();this.Fa.clear();this.qa.clear();this.parent&&(this.parent.Pc(this,!1),this.parent=null);this.Ta=!0;this.$a=!1;this.ea()}}zb(){return this.Ta}R(){return this.$a}lc(a){if(!this.Ta){var b;olympe.D.nb(a)?b=a.Na:olympe.D.pn(a)&&(b=a);b&&this.children.set(b.Z(),b)}}Pc(a,b=!0){let c;olympe.D.nb(a)?c=a.Na:olympe.D.pn(a)&&(c=a);c&&this.children.has(c.Z())&&(b&&c.Kk(this),this.children.delete(c.Z()))}Kk(){this.parent=null;this.destroy()}ea(){const a=this.children;for(const b of a.keys())a.has(b)&&
242
+ a.get(b).Kk(this);this.children.clear();for(const b of this.qa.keys())this.qa.has(b)&&this.qa.get(b)();this.qa.clear()}onDestroy(a,b){void 0===b&&(++this.Ab,b=String(this.Ab));this.Fa.set(b,a);return b}Ie(a){this.Fa.delete(a)}xc(a){if(void 0===b){++this.Ab;var b=String(this.Ab)}this.qa.set(b,a);return b}Lc(a){this.qa.delete(a)}ee(a){this.parent&&this.parent.Pc(this,!1);(this.parent=a||null)&&this.parent.lc(this)}getParent(){return this.parent}kh(){return this.children}};
243
+ olympe.D.Eq=class extends olympe.D.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Ie(){}};olympe.D.Bh.ma=[olympe.D.Bh];let Ra=0;
244
+ function Sa(a,b){a.Y||(a.Y=new Map);a.Y.set(b.Z(),b);switch(b.Td()){case olympe.D.Node.C.Ih:break;case olympe.D.Node.C.Th:break;case olympe.D.Node.C.fk:case olympe.D.Node.C.fg:olympe.D.N.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Ch:Ta(a,olympe.D.Node.C.Ch);break;case olympe.D.Node.C.OBSOLETE:a.cc=!0;a.F!==olympe.D.Node.C.Ch&&Ta(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.eg:olympe.D.N.warn('Adding a destroyed node as upstream => should never happen!');break;
245
+ default:olympe.D.N.warn('Unknown state, investigate: ',b.Td())}Ua(b,a)}
246
+ function Va(a){if(a.Ed){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.D.Node)if(Wa(a.Xf))b=a.Xf.Ib;else return;else b=a.Xf;else b=null;if(null!==a.ka){const e=a.tg;for(let f=0,g=a.ka.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ka[f];if(Wa(h))c.push(h.Ib);else return}else c.push(a.ka[f])}if(a.Ed instanceof Function)var d=a.Ed;else b&&(b[a.Ed]||olympe.D.N.warn('looks like you forget a cast somewhere around '+a.Ed),d=b[a.Ed]);a.run(()=>{a.ea();if(void 0!==d){const e=d.apply(b,c);e&&e.sr?
247
+ Xa(a,e.Na):e instanceof olympe.D.Node?Xa(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ta(a,olympe.D.Node.C.Th))}else Ya(a)})}}function L(a){void 0===a.Pb&&(a.Pb=a.valueType===olympe.D.Proxy?Za(void 0,a.td):Za(a.valueType,a.td),a.Pb.Na=a);return a.Pb}function $a(a){void 0!==a.G&&(ab(a.G,a),a.G=void 0)}function bb(a){if(a.F===olympe.D.Node.C.OBSOLETE&&(a.F=olympe.D.Node.C.Th,null!==a.L))for(const b of a.L.values())cb(b)}function Ta(a,b){b!==a.F&&(a.F=b)}
248
248
  function db(a){if(a.F!==olympe.D.Node.C.OBSOLETE&&a.F!==olympe.D.Node.C.fk&&a.F!==olympe.D.Node.C.Ih&&a.F!==olympe.D.Node.C.Ch){Ta(a,olympe.D.Node.C.fk);var b=a.L;if(b)for(const c of b.values())b.has(c.Z())&&db(c);Ta(a,olympe.D.Node.C.OBSOLETE)}}function eb(a,b,c){if(a.F!==olympe.D.Node.C.fg)if(b===a.G)K(a,c,!0);else{if(a.F===olympe.D.Node.C.OBSOLETE||a.F===olympe.D.Node.C.fk)a.cc=!0;Va(a)}}
249
- function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.N.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Ib);a.bb||c||void 0===a.G||$a(a);if(void 0!==b){if((a.bb||a.F===olympe.D.Node.C.Th||a.F===olympe.D.Node.C.OBSOLETE)&&!olympe.D.nb(b)&&void 0!==a.Ib){if(null===b&&null===a.Ib){bb(a);return}if(null!==b&&null!==a.Ib&&(b.valueOf()===a.Ib.valueOf()||a.Ib.sb&&a.Ib.sb(b))){bb(a);return}}if(!0===a.bb)olympe.D.N.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
- a.Z()+') value to get updated !');else{a.F===olympe.D.Node.C.eg&&olympe.D.N.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.Cd?', '+a.Cd:''})`);a.F===olympe.D.Node.C.fg&&olympe.D.N.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.Cd?', '+a.Cd:''})`);a.bb=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
251
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Xa?(c=olympe.D.Cb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ea?(c=olympe.D.za(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ra&&(c=olympe.D.Bc(c),d=!1)));a.Ib=c;Ta(a,olympe.D.Node.C.Th);if(b=a.L){d=0;for(const f of b.values())0<d&&db(f),d++;for(const f of b.values())eb(f,a,c)}a.bb=!1}}}
252
- function fb(a,b){if(a.F!==olympe.D.Node.C.fg&&a.F!==olympe.D.Node.C.eg&&(a.F!==olympe.D.Node.C.Ih||a.Ed)){var c=void 0!==a.defaultValue;a.Ed&&b!==a.G&&a.aa();if(c)K(a,a.defaultValue,!0);else if(a.Ib=void 0,Ta(a,olympe.D.Node.C.Ih),b=a.L)for(const d of b.values())fb(d,a)}}function Ya(a){if(a.F!==olympe.D.Node.C.Ch){Ta(a,olympe.D.Node.C.Ch);var b=a.L;if(b)for(const c of b.values())Ya(c);a.aa();void 0!==a.G&&$a(a);a.Ib=a.defaultValue}}function Wa(a){return a.F===olympe.D.Node.C.Th}
249
+ function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.N.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Ib);a.cb||c||void 0===a.G||$a(a);if(void 0!==b){if((a.cb||a.F===olympe.D.Node.C.Th||a.F===olympe.D.Node.C.OBSOLETE)&&!olympe.D.nb(b)&&void 0!==a.Ib){if(null===b&&null===a.Ib){bb(a);return}if(null!==b&&null!==a.Ib&&(b.valueOf()===a.Ib.valueOf()||a.Ib.sb&&a.Ib.sb(b))){bb(a);return}}if(!0===a.cb)olympe.D.N.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
+ a.Z()+') value to get updated !');else{a.F===olympe.D.Node.C.eg&&olympe.D.N.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.Cd?', '+a.Cd:''})`);a.F===olympe.D.Node.C.fg&&olympe.D.N.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.Cd?', '+a.Cd:''})`);a.cb=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
251
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Xa?(c=olympe.D.Cb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.da?(c=olympe.D.za(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ra&&(c=olympe.D.Bc(c),d=!1)));a.Ib=c;Ta(a,olympe.D.Node.C.Th);if(b=a.L){d=0;for(const f of b.values())0<d&&db(f),d++;for(const f of b.values())eb(f,a,c)}a.cb=!1}}}
252
+ function fb(a,b){if(a.F!==olympe.D.Node.C.fg&&a.F!==olympe.D.Node.C.eg&&(a.F!==olympe.D.Node.C.Ih||a.Ed)){var c=void 0!==a.defaultValue;a.Ed&&b!==a.G&&a.ea();if(c)K(a,a.defaultValue,!0);else if(a.Ib=void 0,Ta(a,olympe.D.Node.C.Ih),b=a.L)for(const d of b.values())fb(d,a)}}function Ya(a){if(a.F!==olympe.D.Node.C.Ch){Ta(a,olympe.D.Node.C.Ch);var b=a.L;if(b)for(const c of b.values())Ya(c);a.ea();void 0!==a.G&&$a(a);a.Ib=a.defaultValue}}function Wa(a){return a.F===olympe.D.Node.C.Th}
253
253
  function Xa(a,b){b===a?olympe.D.N.error('Setting a node as provider of itself. Ignoring'):(a.G&&a.G!==b&&$a(a),Ua(b,a),Wa(b)?K(a,b.Ib,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):fb(a),a.G=b)}function gb(a,b){a.Ed&&(a.Ed=void 0);a.Cd='Repeater';Xa(a,b)}function cb(a){a.G?bb(a):null!==a.Y&&0===Array.from(a.Y.values()).filter(b=>!Wa(b)).length&&(a.cc&&(a.cc=!1,Va(a)),bb(a))}
254
254
  function Ua(a,b){a.L||(a.L=new Map);a.L.set(b.Z(),b);a.F===olympe.D.Node.C.eg&&olympe.D.N.warn('adding a downstream node on a deleted one (#'+a.Z()+') !')}function ab(a,b){a.L&&(b=b.Z(),a.L.has(b)&&(a.L.delete(b),hb(a)))}function hb(a){if(null===a.getParent()){var b=a.L;b&&0<b.size||a.destroy()}}
255
- olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,Ed:b,Vx:c=!0,Xf:d,hn:e,debug:f=!1,tg:g=null,Cd:h='Node',Si:k}={}){++Ra;super(String(Ra));this.debug=!!f;this.Cd=h;h&&'string'===typeof h||(b?this.Cd=b.name?b.name:'anon()':this.Cd='Node');this.ha=e&&0<e.length?e:null;this.tg=g&&0<g.length?g:null;this.valueType=a;this.Ib=void 0;this.bb=!1;this.F=olympe.D.Node.C.Ih;this.cc=!1;this.L=this.Y=null;this.Ed=b;this.Xf=d||null;this.defaultValue=this.Pb=this.G=void 0;this.Si=k;d&&d instanceof
256
- olympe.D.Node&&Sa(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Sa(this,a);c&&Va(this)}bf(a){this.defaultValue=a;this.F===olympe.D.Node.C.Ih&&K(this,a,!0);return this}Vi(a){this.valueType=a}$b(){return this.valueType||Object}Ud(){return this.F}zb(){return this.F===olympe.D.Node.C.eg}R(){return this.F===olympe.D.Node.C.fg}ud(...a){if(this.Si instanceof Function)return this.Si(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Ud();a!==olympe.D.Node.C.fg&&
257
- a!==olympe.D.Node.C.eg||olympe.D.N.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.nb(g)&&b.push(g.Na);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.xf&&(e[g]=f.Na,b.push(g));return L(new olympe.D.Node({valueType:d.L(),Ed:c,Xf:this,hn:e,debug:!1,tg:b,Cd:'Proxy.'+c+'()'}))}Kk(a){if(null===this.getParent())olympe.D.N.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.N.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
- a,this.getParent());return}this.Qd(null);hb(this)}destroy(){var a=this.F;if(a!==olympe.D.Node.C.fg&&a!==olympe.D.Node.C.eg){Ta(this,olympe.D.Node.C.fg);if(a=this.L){for(const c of a.values())if(a.has(c.Z())){var b=c;b.Y&&b.Y.delete(this.Z());b.G&&b.G.Z()===this.Z()?b.G=void 0:b.destroy()}a.clear()}this.L=null;super.destroy();if(this.Y){for(const c of this.Y.values())this.Y.has(c.Z())&&ab(c,this);this.Y.clear()}this.Y=null;this.G&&(ab(this.G,this),this.G=void 0);this.Ib=void 0;this.ha&&(this.ha.length=
259
- 0,this.ha=null);this.tg&&(this.tg.length=0,this.tg=null);this.Si=this.Ed=void 0;this.defaultValue=this.Xf=null;this.Cd=`** Destroyed ** ${this.Cd}`;Ta(this,olympe.D.Node.C.eg)}}Tb(){return this.Cd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Ih:0,Th:1,Ch:3,fk:4,OBSOLETE:5,fg:6,eg:7};function Za(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.N.error('investigate');c=Object.create(ib(c,a.prototype));c.Dk=a;c.qr=b;return c}function ib(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.im)||Object.defineProperty(b,olympe.D.Proxy.im,{enumerable:!1,configurable:!1,writable:!1,value:jb(a,b)});return b[olympe.D.Proxy.im]}
255
+ olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,Ed:b,Zx:c=!0,Xf:d,jn:e,debug:f=!1,tg:g=null,Cd:h='Node',Si:k}={}){++Ra;super(String(Ra));this.debug=!!f;this.Cd=h;h&&'string'===typeof h||(b?this.Cd=b.name?b.name:'anon()':this.Cd='Node');this.ka=e&&0<e.length?e:null;this.tg=g&&0<g.length?g:null;this.valueType=a;this.Ib=void 0;this.cb=!1;this.F=olympe.D.Node.C.Ih;this.cc=!1;this.L=this.Y=null;this.Ed=b;this.Xf=d||null;this.defaultValue=this.Pb=this.G=void 0;this.Si=k;d&&d instanceof
256
+ olympe.D.Node&&Sa(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Sa(this,a);c&&Va(this)}bf(a){this.defaultValue=a;this.F===olympe.D.Node.C.Ih&&K(this,a,!0);return this}Vi(a){this.valueType=a}$b(){return this.valueType||Object}Td(){return this.F}zb(){return this.F===olympe.D.Node.C.eg}R(){return this.F===olympe.D.Node.C.fg}td(...a){if(this.Si instanceof Function)return this.Si(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Td();a!==olympe.D.Node.C.fg&&
257
+ a!==olympe.D.Node.C.eg||olympe.D.N.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.nb(g)&&b.push(g.Na);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.xf&&(e[g]=f.Na,b.push(g));return L(new olympe.D.Node({valueType:d.L(),Ed:c,Xf:this,jn:e,debug:!1,tg:b,Cd:'Proxy.'+c+'()'}))}Kk(a){if(null===this.getParent())olympe.D.N.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.N.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
+ a,this.getParent());return}this.ee(null);hb(this)}destroy(){var a=this.F;if(a!==olympe.D.Node.C.fg&&a!==olympe.D.Node.C.eg){Ta(this,olympe.D.Node.C.fg);if(a=this.L){for(const c of a.values())if(a.has(c.Z())){var b=c;b.Y&&b.Y.delete(this.Z());b.G&&b.G.Z()===this.Z()?b.G=void 0:b.destroy()}a.clear()}this.L=null;super.destroy();if(this.Y){for(const c of this.Y.values())this.Y.has(c.Z())&&ab(c,this);this.Y.clear()}this.Y=null;this.G&&(ab(this.G,this),this.G=void 0);this.Ib=void 0;this.ka&&(this.ka.length=
259
+ 0,this.ka=null);this.tg&&(this.tg.length=0,this.tg=null);this.Si=this.Ed=void 0;this.defaultValue=this.Xf=null;this.Cd=`** Destroyed ** ${this.Cd}`;Ta(this,olympe.D.Node.C.eg)}}Tb(){return this.Cd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Ih:0,Th:1,Ch:3,fk:4,OBSOLETE:5,fg:6,eg:7};function Za(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.N.error('investigate');c=Object.create(ib(c,a.prototype));c.Dk=a;c.tr=b;return c}function ib(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.im)||Object.defineProperty(b,olympe.D.Proxy.im,{enumerable:!1,configurable:!1,writable:!1,value:jb(a,b)});return b[olympe.D.Proxy.im]}
260
260
  function kb(a,b){if(a.Dk!==b){a.Dk=b;b.prototype||olympe.D.N.error('Cast not possible, provided type is not a valid type!');var c=ib(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Na&&a.Na.Vi(b)}}
261
- function jb(a,b){let c={};if(b.prototype)olympe.D.N.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ib(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.R()?c[d]=function(...f){var g=this.Na;if(g&&Wa(g)&&(g=g.Ib)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.aa,c[d]=function(...f){f=this.qr.call(this.Na,
262
- ...f,e,d);const g=e.aa;if(g){const h=this.Na.Ib;h&&h[g]&&kb(f,h[g])}return e.Y()?this:f})}});return c}function lb(a,b){K(a.Na,b)}function mb(a){fb(a.Na)}function nb(a){olympe.D.yc([olympe.D.ra.C],b=>{a.Na.bf(b)},'setDefaultValue');return a}function ob(a,b){gb(a.Na,olympe.D.Sf(b)?b:b.Na)}function pb(a,b){olympe.D.nb(b)||olympe.D.Sf(b)?ob(a,b):lb(a,b)}
263
- olympe.D.Proxy=class{constructor(a,b){this.Na=null;this.Dk=a;this.qr=b}static nb(a){return!(!a||!a.xf)}sb(a){return olympe.D.Ga([this,a],(b,c)=>b===c,Boolean)}Wd(a){return olympe.D.Ga([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ra.F:olympe.D.ra.C:b.valueOf()===c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra)}nr(){return this.Na}};olympe.D.Proxy.im='__opp__';olympe.D.Proxy.prototype.xf=!0;function qb(a,b){a.node.bf(b);return a}olympe.D.Rj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.nb(a)?K(this.node,olympe.D.Ya(a)):K(this.node,a);return this}repeat(a){gb(this.node,olympe.D.nb(a)?a.Na:a);return this}clear(){fb(this.node);return this}Eb(){return L(this.node)}};function rb(a,b,c=1E3,d,e){const f=olympe.D.Mc(olympe.D.ea),g=d||olympe.D.ea.xo.Dp;let h,k,l,n;f.update(olympe.D.za(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.zb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.za(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Eb()}
264
- olympe.D.ea=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.za(b.value)}Cn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Bc(!this.Cn())}kd(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Cb(''):olympe.D.Cb(this.value.toString())}toString(a,b){return void 0!==
265
- this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.Cn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.Mc(olympe.D.ea,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.za(c))};a.forEach((f,g)=>{olympe.D.yc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.zb()){var g=b.get(f);b.delete(f);g===c&&
266
- e()}});return d.Eb()}je(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()+c.valueOf()),olympe.D.ea,'ONumber.plus')}vh(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()-c.valueOf()),olympe.D.ea,'ONumber.minus')}round(){return olympe.D.za(Math.round(this.valueOf()))}xj(){return olympe.D.za(-this.valueOf())}Zk(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()*c.valueOf()),olympe.D.ea,'ONumber.mul')}Wi(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()/c.valueOf()),
267
- olympe.D.ea,'ONumber.div')}yx(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()%c.valueOf()),olympe.D.ea,'ONumber.div')}floor(){return olympe.D.za(Math.floor(this.valueOf()))}ceil(){return olympe.D.za(Math.ceil(this.valueOf()))}trunc(){return olympe.D.za(Math.trunc(this.valueOf()))}log(){return olympe.D.za(Math.log(this.valueOf()))}pow(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ea,'ONumber.pow')}exp(){return olympe.D.za(Math.exp(this.valueOf()))}Wd(a){return olympe.D.Ga([this,
268
- a],(b,c)=>olympe.D.Bc(b.sb(c)),olympe.D.ra,'ONumber.oEquals')}sb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Iw(){return this.valueOf()}ln(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'ONumber.isBiggerThan')}Xx(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.za(c),olympe.D.ea,'ONumber.returnsBiggest')}es(a){return olympe.D.Ga([this,
269
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.za(c),olympe.D.ea,'ONumber.returnsSmallest')}ox(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'ONumber.isSmallerThan')}sin(){return olympe.D.za(Math.sin(this.valueOf()))}cos(){return olympe.D.za(Math.cos(this.valueOf()))}atan2(a){return olympe.D.nb(a)?olympe.D.ke([a],b=>olympe.D.za(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ea):olympe.D.za(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.za(Math.abs(this.valueOf()))}mj(a,
270
- b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ea):olympe.D.za(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static ev(a,b,c,d){'number'===typeof a&&(a=olympe.D.ie(a));'number'===typeof b&&(b=olympe.D.ie(b));'number'===typeof c&&(c=olympe.D.ie(c));let e=0;const f=olympe.D.ie(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Tk(b.ln(c),()=>{olympe.sa.Za('df').warn('You have a min bigger than max, cap your inputs')});
271
- const k=(l,n)=>{n=olympe.D.ie(n);const p=olympe.D.ea.animate(n,500);ob(f,p);lb(n,olympe.D.za(l));e=l};olympe.D.ke([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ob(f,olympe.D.ie(e))},olympe.D.ea);void 0!==b&&olympe.D.dl(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ie(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.za(g);K(n.Na,l);e=g;ob(f,p)}});void 0!==c&&olympe.D.dl(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ie(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.za(h);K(n.Na,l);e=h;ob(f,
272
- p)}});return f}static offset(a){let b;return olympe.D.ke([a],c=>{void 0===b&&(b=c);return olympe.D.za(c-b)},olympe.D.ea,'offset')}static Er(a){let b,c,d;return olympe.D.Ga([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.za(0);d=window.performance.now();const f=olympe.D.za((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ea,'derivative')}static jx(a){let b=olympe.D.za(0),c,d,e;return olympe.D.Ga([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.za(0);
273
- e=window.performance.now();b=b.je((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ea,'integrate')}static Mv(a){let b;return olympe.D.Ga([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.za(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ea,'diff')}static Bv(a,b,c){return olympe.D.ke([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.za(d>=e?d<=f?d:f:e)},olympe.D.ea)}static animate(a,b,c,d){let e;
274
- return e=olympe.D.Ga([a],f=>{const g=olympe.D.Ya(b,1E3),h=olympe.D.Ya(e);return void 0===h?olympe.D.za(f):rb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ea)}static rv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ie(),n;olympe.D.yc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);lb(l,olympe.D.za(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static kd(a){return olympe.D.nb(a)?
275
- olympe.D.Ga([a],b=>olympe.D.Cb(b.valueOf().toString()),olympe.D.Xa):olympe.D.Cb(a)}static xj(a){return olympe.D.nb(a)?olympe.D.Ga([a],b=>olympe.D.za(-b.valueOf()),olympe.D.ea):olympe.D.za(-a.valueOf())}static je(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.Ga([a,b],(c,d)=>olympe.D.za(c.valueOf()+d.valueOf()),olympe.D.ea,'plus'):olympe.D.za(a.valueOf()+b.valueOf())}static vh(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(c.valueOf()-d.valueOf()),olympe.D.ea,
276
- 'minus'):olympe.D.za(a.valueOf()-b.valueOf())}static Wi(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(c.valueOf()/d.valueOf()),olympe.D.ea,'div'):olympe.D.za(a.valueOf()/b.valueOf())}static Ux(a,b){if(void 0===b)return a;olympe.D.yc([b],c=>{c=olympe.D.za(a.Na.Ib.valueOf()+c.valueOf());K(a.Na,c)},'plusEqual');return a}};olympe.D.ea.ZERO=new olympe.D.ea(0);olympe.D.ea.ONE=new olympe.D.ea(1);olympe.D.ea.Xu=new olympe.D.ea(2);olympe.D.ea.PI=new olympe.D.ea(Math.PI);
277
- olympe.D.ea.rt=new olympe.D.ea(Infinity);olympe.D.ea.du=new olympe.D.ea(-Infinity);olympe.D.ea.Mp=new olympe.D.ea(NaN);olympe.D.ea.tA=olympe.D.ea.Ux;olympe.D.ea.By=olympe.D.ea.ev;olympe.D.ea.iA=olympe.D.ea.offset;olympe.D.ea.az=olympe.D.ea.Er;olympe.D.ea.wC=olympe.D.ea.Er;olympe.D.ea.Uz=olympe.D.ea.jx;olympe.D.ea.bz=olympe.D.ea.Mv;olympe.D.ea.Qy=olympe.D.ea.Bv;olympe.D.ea.Cy=olympe.D.ea.animate;olympe.D.ea.Dy=olympe.D.ea.rv;olympe.D.ea.IB=olympe.D.ea.kd;olympe.D.ea.JB=olympe.D.ea.xj;
278
- olympe.D.ea.sA=olympe.D.ea.je;olympe.D.ea.dA=olympe.D.ea.vh;olympe.D.ea.cz=olympe.D.ea.Wi;
279
- olympe.D.ea.xo={Dp:function(a,b,c,d){return c*a/d+b},xz:function(a,b,c,d){a/=d;return c*a*a+b},Hz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},sz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},lz:function(a,b,c,d){a/=d;return c*a*a*a+b},Dz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},qz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},yz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Iz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
- uz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},zz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Jz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},vz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},Az:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Kz:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},wz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},oz:function(a,b,c,d){return c*Math.pow(2,
281
- 10*(a/d-1))+b},Gz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},rz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},kz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Cz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},pz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},fz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},gz:function(a,b,c,d){d=(a/=d)*a;return b+
282
- c*(2*d*d+2*d*a+-3*d)},hz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},iz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Fz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},Ez:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},nz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},mz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Bz:function(a,
283
- b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},jz:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ea.prototype;m.toJSON.K=olympe.D.J.C;m.Cn.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.R;m.kd.K=olympe.D.J.F;
284
- m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.je.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.vh.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.round.K=olympe.D.J.G;m.xj.K=olympe.D.J.G;m.Zk.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Wi.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.yx.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.exp.K=olympe.D.J.G;
285
- m.Wd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Iw.K=olympe.D.J.C;m.ln.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.Xx.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.es.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.ox.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.abs.K=olympe.D.J.G;m.mj.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);olympe.D.Xa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Cb(b.value)}Ar(a){return olympe.D.Xa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Ga([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Cb(d)},olympe.D.Xa,'OString.concat')}kd(){return this}ty(a){return olympe.D.za(parseInt(this.value,
286
- a))}ns(){return olympe.D.za(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}sb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Wd(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Bc(c&&b.valueOf()===c.valueOf()),olympe.D.ra,'OString.oEquals')}Qf(){return olympe.D.Bc(!this.value||0===this.value.length)}contains(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Bc((c instanceof olympe.D.Xa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
261
+ function jb(a,b){let c={};if(b.prototype)olympe.D.N.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ib(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.R()?c[d]=function(...f){var g=this.Na;if(g&&Wa(g)&&(g=g.Ib)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.ea,c[d]=function(...f){f=this.tr.call(this.Na,
262
+ ...f,e,d);const g=e.ea;if(g){const h=this.Na.Ib;h&&h[g]&&kb(f,h[g])}return e.Y()?this:f})}});return c}function lb(a,b){K(a.Na,b)}function mb(a){fb(a.Na)}function nb(a){olympe.D.yc([olympe.D.ra.C],b=>{a.Na.bf(b)},'setDefaultValue');return a}function ob(a,b){gb(a.Na,olympe.D.Sf(b)?b:b.Na)}function pb(a,b){olympe.D.nb(b)||olympe.D.Sf(b)?ob(a,b):lb(a,b)}
263
+ olympe.D.Proxy=class{constructor(a,b){this.Na=null;this.Dk=a;this.tr=b}static nb(a){return!(!a||!a.xf)}sb(a){return olympe.D.Ga([this,a],(b,c)=>b===c,Boolean)}Vd(a){return olympe.D.Ga([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ra.F:olympe.D.ra.C:b.valueOf()===c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra)}sr(){return this.Na}};olympe.D.Proxy.im='__opp__';olympe.D.Proxy.prototype.xf=!0;function qb(a,b){a.node.bf(b);return a}olympe.D.Rj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.nb(a)?K(this.node,olympe.D.Za(a)):K(this.node,a);return this}repeat(a){gb(this.node,olympe.D.nb(a)?a.Na:a);return this}clear(){fb(this.node);return this}Eb(){return L(this.node)}};function rb(a,b,c=1E3,d,e){const f=olympe.D.Nc(olympe.D.da),g=d||olympe.D.da.zo.Gp;let h,k,l,n;f.update(olympe.D.za(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.zb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.za(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Eb()}
264
+ olympe.D.da=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.za(b.value)}En(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Bc(!this.En())}kd(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Cb(''):olympe.D.Cb(this.value.toString())}toString(a,b){return void 0!==
265
+ this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.En()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.Nc(olympe.D.da,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.za(c))};a.forEach((f,g)=>{olympe.D.yc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.zb()){var g=b.get(f);b.delete(f);g===c&&
266
+ e()}});return d.Eb()}je(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()+c.valueOf()),olympe.D.da,'ONumber.plus')}vh(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()-c.valueOf()),olympe.D.da,'ONumber.minus')}round(){return olympe.D.za(Math.round(this.valueOf()))}xj(){return olympe.D.za(-this.valueOf())}Zk(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()*c.valueOf()),olympe.D.da,'ONumber.mul')}Wi(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()/c.valueOf()),
267
+ olympe.D.da,'ONumber.div')}Cx(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(b.valueOf()%c.valueOf()),olympe.D.da,'ONumber.div')}floor(){return olympe.D.za(Math.floor(this.valueOf()))}ceil(){return olympe.D.za(Math.ceil(this.valueOf()))}trunc(){return olympe.D.za(Math.trunc(this.valueOf()))}log(){return olympe.D.za(Math.log(this.valueOf()))}pow(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.za(Math.pow(b.valueOf(),c.valueOf())),olympe.D.da,'ONumber.pow')}exp(){return olympe.D.za(Math.exp(this.valueOf()))}Vd(a){return olympe.D.Ga([this,
268
+ a],(b,c)=>olympe.D.Bc(b.sb(c)),olympe.D.ra,'ONumber.oEquals')}sb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Mw(){return this.valueOf()}mn(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'ONumber.isBiggerThan')}$x(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.za(c),olympe.D.da,'ONumber.returnsBiggest')}js(a){return olympe.D.Ga([this,
269
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.za(c),olympe.D.da,'ONumber.returnsSmallest')}sx(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'ONumber.isSmallerThan')}sin(){return olympe.D.za(Math.sin(this.valueOf()))}cos(){return olympe.D.za(Math.cos(this.valueOf()))}atan2(a){return olympe.D.nb(a)?olympe.D.ke([a],b=>olympe.D.za(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.da):olympe.D.za(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.za(Math.abs(this.valueOf()))}mj(a,
270
+ b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.da):olympe.D.za(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static jv(a,b,c,d){'number'===typeof a&&(a=olympe.D.ie(a));'number'===typeof b&&(b=olympe.D.ie(b));'number'===typeof c&&(c=olympe.D.ie(c));let e=0;const f=olympe.D.ie(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Tk(b.mn(c),()=>{olympe.sa.Ya('df').warn('You have a min bigger than max, cap your inputs')});
271
+ const k=(l,n)=>{n=olympe.D.ie(n);const p=olympe.D.da.animate(n,500);ob(f,p);lb(n,olympe.D.za(l));e=l};olympe.D.ke([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ob(f,olympe.D.ie(e))},olympe.D.da);void 0!==b&&olympe.D.dl(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ie(e),p=olympe.D.da.animate(n,400,d);l=olympe.D.za(g);K(n.Na,l);e=g;ob(f,p)}});void 0!==c&&olympe.D.dl(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ie(e),p=olympe.D.da.animate(n,400,d);l=olympe.D.za(h);K(n.Na,l);e=h;ob(f,
272
+ p)}});return f}static offset(a){let b;return olympe.D.ke([a],c=>{void 0===b&&(b=c);return olympe.D.za(c-b)},olympe.D.da,'offset')}static Hr(a){let b,c,d;return olympe.D.Ga([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.za(0);d=window.performance.now();const f=olympe.D.za((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.da,'derivative')}static nx(a){let b=olympe.D.za(0),c,d,e;return olympe.D.Ga([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.za(0);
273
+ e=window.performance.now();b=b.je((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.da,'integrate')}static Qv(a){let b;return olympe.D.Ga([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.za(c.valueOf()-b.valueOf());b=c;return d},olympe.D.da,'diff')}static Fv(a,b,c){return olympe.D.ke([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.za(d>=e?d<=f?d:f:e)},olympe.D.da)}static animate(a,b,c,d){let e;
274
+ return e=olympe.D.Ga([a],f=>{const g=olympe.D.Za(b,1E3),h=olympe.D.Za(e);return void 0===h?olympe.D.za(f):rb(h,f,g,c,k=>{d&&d(k)})},olympe.D.da)}static wv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ie(),n;olympe.D.yc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);lb(l,olympe.D.za(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static kd(a){return olympe.D.nb(a)?
275
+ olympe.D.Ga([a],b=>olympe.D.Cb(b.valueOf().toString()),olympe.D.Xa):olympe.D.Cb(a)}static xj(a){return olympe.D.nb(a)?olympe.D.Ga([a],b=>olympe.D.za(-b.valueOf()),olympe.D.da):olympe.D.za(-a.valueOf())}static je(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.Ga([a,b],(c,d)=>olympe.D.za(c.valueOf()+d.valueOf()),olympe.D.da,'plus'):olympe.D.za(a.valueOf()+b.valueOf())}static vh(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(c.valueOf()-d.valueOf()),olympe.D.da,
276
+ 'minus'):olympe.D.za(a.valueOf()-b.valueOf())}static Wi(a,b){return olympe.D.nb(a)||olympe.D.nb(b)?olympe.D.ke([a,b],(c,d)=>olympe.D.za(c.valueOf()/d.valueOf()),olympe.D.da,'div'):olympe.D.za(a.valueOf()/b.valueOf())}static Yx(a,b){if(void 0===b)return a;olympe.D.yc([b],c=>{c=olympe.D.za(a.Na.Ib.valueOf()+c.valueOf());K(a.Na,c)},'plusEqual');return a}};olympe.D.da.ZERO=new olympe.D.da(0);olympe.D.da.ONE=new olympe.D.da(1);olympe.D.da.av=new olympe.D.da(2);olympe.D.da.PI=new olympe.D.da(Math.PI);
277
+ olympe.D.da.vt=new olympe.D.da(Infinity);olympe.D.da.hu=new olympe.D.da(-Infinity);olympe.D.da.Pp=new olympe.D.da(NaN);olympe.D.da.xA=olympe.D.da.Yx;olympe.D.da.Gy=olympe.D.da.jv;olympe.D.da.nA=olympe.D.da.offset;olympe.D.da.fz=olympe.D.da.Hr;olympe.D.da.AC=olympe.D.da.Hr;olympe.D.da.Zz=olympe.D.da.nx;olympe.D.da.gz=olympe.D.da.Qv;olympe.D.da.Vy=olympe.D.da.Fv;olympe.D.da.Hy=olympe.D.da.animate;olympe.D.da.Iy=olympe.D.da.wv;olympe.D.da.MB=olympe.D.da.kd;olympe.D.da.NB=olympe.D.da.xj;
278
+ olympe.D.da.wA=olympe.D.da.je;olympe.D.da.iA=olympe.D.da.vh;olympe.D.da.hz=olympe.D.da.Wi;
279
+ olympe.D.da.zo={Gp:function(a,b,c,d){return c*a/d+b},Cz:function(a,b,c,d){a/=d;return c*a*a+b},Mz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},yz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},qz:function(a,b,c,d){a/=d;return c*a*a*a+b},Iz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},wz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},Dz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Nz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
+ zz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},Ez:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Oz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Az:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},Fz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},Pz:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Bz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},uz:function(a,b,c,d){return c*Math.pow(2,
281
+ 10*(a/d-1))+b},Lz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},xz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},pz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Hz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},vz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},kz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},lz:function(a,b,c,d){d=(a/=d)*a;return b+
282
+ c*(2*d*d+2*d*a+-3*d)},mz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},nz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Kz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},Jz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},sz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},rz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Gz:function(a,
283
+ b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},oz:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.da.prototype;m.toJSON.K=olympe.D.J.C;m.En.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.R;m.kd.K=olympe.D.J.F;
284
+ m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.je.K=new olympe.D.J(()=>olympe.D.da,[0]);m.vh.K=new olympe.D.J(()=>olympe.D.da,[0]);m.round.K=olympe.D.J.G;m.xj.K=olympe.D.J.G;m.Zk.K=new olympe.D.J(()=>olympe.D.da,[0]);m.Wi.K=new olympe.D.J(()=>olympe.D.da,[0]);m.Cx.K=new olympe.D.J(()=>olympe.D.da,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.da,[0]);m.exp.K=olympe.D.J.G;
285
+ m.Vd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Mw.K=olympe.D.J.C;m.mn.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.$x.K=new olympe.D.J(()=>olympe.D.da,[0]);m.js.K=new olympe.D.J(()=>olympe.D.da,[0]);m.sx.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.da,[0]);m.abs.K=olympe.D.J.G;m.mj.K=new olympe.D.J(()=>olympe.D.da,[0,1]);olympe.D.Xa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Cb(b.value)}Dr(a){return olympe.D.Xa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Ga([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Cb(d)},olympe.D.Xa,'OString.concat')}kd(){return this}vy(a){return olympe.D.za(parseInt(this.value,
286
+ a))}ss(){return olympe.D.za(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}sb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Vd(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Bc(c&&b.valueOf()===c.valueOf()),olympe.D.ra,'OString.oEquals')}Qf(){return olympe.D.Bc(!this.value||0===this.value.length)}contains(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Bc((c instanceof olympe.D.Xa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
287
  olympe.D.ra,'OString.contains')}startsWith(a,b){return olympe.D.Ga([this,a,b||0],(c,d,e)=>olympe.D.Bc(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ra,'OString.startsWith')}endsWith(a,b){return olympe.D.Ga([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Ag().valueOf()+e.valueOf()+1;return olympe.D.Bc(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.ra,'OString.endsWith')}indexOf(a,b){return olympe.D.Ga([this,a,b||0],(c,d,e)=>olympe.D.za(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
- olympe.D.ea,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Ga([this,a,b||Infinity],(c,d,e)=>olympe.D.za(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.lastIndexOf')}slice(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Xa,'OString.slice')}Ag(){return olympe.D.za(this.value.length)}threshold(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Xa.EMPTY,olympe.D.Xa,'OString.threshold')}toLowerCase(){return olympe.D.Cb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Cb(this.value.toUpperCase())}trim(){return olympe.D.Cb(this.value.trim())}padStart(a,
289
- b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.padStart')}padEnd(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.padEnd')}replace(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.replace')}py(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().substr(d.valueOf(),
290
- e.valueOf())),olympe.D.Xa,'OString.subOStr')}static concat(...a){return olympe.D.Cb('').concat(...a)}};olympe.D.Xa.EMPTY=new olympe.D.Xa('');olympe.D.Xa.Ku=new olympe.D.Xa(' ');m=olympe.D.Xa.prototype;m.toJSON.K=olympe.D.J.C;m.Ar.K=new olympe.D.J(()=>olympe.D.Xa,[0,1]);m.concat.K=olympe.D.J.F;m.kd.K=olympe.D.J.F;m.ty.K=olympe.D.J.G;m.ns.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;m.Wd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.Qf.K=olympe.D.J.R;
291
- m.contains.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Xa,[0,1]);m.Ag.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Xa,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
292
- m.replace.K=olympe.D.J.F;m.py.K=olympe.D.J.F;olympe.D.ra=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ra.F:olympe.D.ra.C}and(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()&&b.valueOf()),olympe.D.ra,'and'):this.value&&a.valueOf()?olympe.D.ra.F:olympe.D.ra.C}sb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Wd(a){if(void 0!==a)return olympe.D.nb(a)?
293
- olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()===b.valueOf()),olympe.D.ra,'oEquals'):this.sb(a)?olympe.D.ra.F:olympe.D.ra.C}not(){return this.value?olympe.D.ra.C:olympe.D.ra.F}qv(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(!(this.valueOf()&&b.valueOf())),olympe.D.ra,'andNot'):this.value&&!a.valueOf()?olympe.D.ra.F:olympe.D.ra.C}or(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()||b.valueOf()),olympe.D.ra,'or'):this.value||a.valueOf()?
294
- olympe.D.ra.F:olympe.D.ra.C}xor(a){return olympe.D.Ga([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Bc(b&&!c||!b&&c)},olympe.D.ra,'OBoolean.xor')}dw(){return this.value}Lr(){return!0===this.value?olympe.D.ea.ONE:olympe.D.ea.ZERO}kd(){return olympe.D.Cb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ra.F=new olympe.D.ra(!0);olympe.D.ra.C=new olympe.D.ra(!1);m=olympe.D.ra.prototype;m.toJSON.K=olympe.D.J.C;
295
- m.and.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sb.K=olympe.D.J.C;m.Wd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.not.K=olympe.D.J.R;m.qv.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.or.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.dw.K=new olympe.D.J(()=>Boolean,[]);m.Lr.K=olympe.D.J.G;m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function sb(a){return new olympe.D.kb(new Date(a))}
296
- olympe.D.kb=class{constructor(a){this.yb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.yb.toJSON()+'" }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kb(new Date(b.value.valueOf()))}static now(){return new olympe.D.kb(new Date)}lj(){return this.yb&&!isNaN(this.yb.getTime())?olympe.D.ra.F:olympe.D.ra.C}yt(){return olympe.D.za(this.yb.getMilliseconds())}At(){return olympe.D.za(this.yb.getSeconds())}zt(){return olympe.D.za(this.yb.getMinutes())}xt(){return olympe.D.za(this.yb.getHours())}mw(){return olympe.D.za(this.yb.getDate())}getMonth(){return olympe.D.za(this.yb.getMonth()+1)}Bt(){return olympe.D.za(this.yb.getFullYear())}getTime(){return this.yb.getTime()}my(){var a=
288
+ olympe.D.da,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Ga([this,a,b||Infinity],(c,d,e)=>olympe.D.za(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.da,'OString.lastIndexOf')}slice(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Xa,'OString.slice')}Ag(){return olympe.D.za(this.value.length)}threshold(a){return olympe.D.Ga([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Xa.EMPTY,olympe.D.Xa,'OString.threshold')}toLowerCase(){return olympe.D.Cb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Cb(this.value.toUpperCase())}trim(){return olympe.D.Cb(this.value.trim())}padStart(a,
289
+ b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.padStart')}padEnd(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.padEnd')}replace(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Xa,'OString.replace')}ry(a,b){return olympe.D.Ga([this,a,b],(c,d,e)=>olympe.D.Cb(c.valueOf().substr(d.valueOf(),
290
+ e.valueOf())),olympe.D.Xa,'OString.subOStr')}static concat(...a){return olympe.D.Cb('').concat(...a)}};olympe.D.Xa.EMPTY=new olympe.D.Xa('');olympe.D.Xa.Ou=new olympe.D.Xa(' ');m=olympe.D.Xa.prototype;m.toJSON.K=olympe.D.J.C;m.Dr.K=new olympe.D.J(()=>olympe.D.Xa,[0,1]);m.concat.K=olympe.D.J.F;m.kd.K=olympe.D.J.F;m.vy.K=olympe.D.J.G;m.ss.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;m.Vd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.Qf.K=olympe.D.J.R;
291
+ m.contains.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.da,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.da,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Xa,[0,1]);m.Ag.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Xa,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
292
+ m.replace.K=olympe.D.J.F;m.ry.K=olympe.D.J.F;olympe.D.ra=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ra.F:olympe.D.ra.C}and(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()&&b.valueOf()),olympe.D.ra,'and'):this.value&&a.valueOf()?olympe.D.ra.F:olympe.D.ra.C}sb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Vd(a){if(void 0!==a)return olympe.D.nb(a)?
293
+ olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()===b.valueOf()),olympe.D.ra,'oEquals'):this.sb(a)?olympe.D.ra.F:olympe.D.ra.C}not(){return this.value?olympe.D.ra.C:olympe.D.ra.F}vv(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(!(this.valueOf()&&b.valueOf())),olympe.D.ra,'andNot'):this.value&&!a.valueOf()?olympe.D.ra.F:olympe.D.ra.C}or(a){if(void 0!==a)return olympe.D.nb(a)?olympe.D.ke([a],b=>new olympe.D.ra(this.valueOf()||b.valueOf()),olympe.D.ra,'or'):this.value||a.valueOf()?
294
+ olympe.D.ra.F:olympe.D.ra.C}xor(a){return olympe.D.Ga([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Bc(b&&!c||!b&&c)},olympe.D.ra,'OBoolean.xor')}hw(){return this.value}Pr(){return!0===this.value?olympe.D.da.ONE:olympe.D.da.ZERO}kd(){return olympe.D.Cb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ra.F=new olympe.D.ra(!0);olympe.D.ra.C=new olympe.D.ra(!1);m=olympe.D.ra.prototype;m.toJSON.K=olympe.D.J.C;
295
+ m.and.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.sb.K=olympe.D.J.C;m.Vd.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.not.K=olympe.D.J.R;m.vv.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.or.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.hw.K=new olympe.D.J(()=>Boolean,[]);m.Pr.K=olympe.D.J.G;m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function sb(a){return new olympe.D.kb(new Date(a))}
296
+ olympe.D.kb=class{constructor(a){this.yb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.yb.toJSON()+'" }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kb(new Date(b.value.valueOf()))}static now(){return new olympe.D.kb(new Date)}lj(){return this.yb&&!isNaN(this.yb.getTime())?olympe.D.ra.F:olympe.D.ra.C}Ct(){return olympe.D.za(this.yb.getMilliseconds())}Et(){return olympe.D.za(this.yb.getSeconds())}Dt(){return olympe.D.za(this.yb.getMinutes())}Bt(){return olympe.D.za(this.yb.getHours())}qw(){return olympe.D.za(this.yb.getDate())}getMonth(){return olympe.D.za(this.yb.getMonth()+1)}Ft(){return olympe.D.za(this.yb.getFullYear())}getTime(){return this.yb.getTime()}oy(){var a=
297
297
  olympe.D,b=a.Cb;var c=this.yb.getDate();c=10>c?'0'+c:c;var d=this.yb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.yb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleString(c.valueOf())),olympe.D.Xa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleDateString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleDateString(c.valueOf())),
298
- olympe.D.Xa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleTimeString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleTimeString(c.valueOf())),olympe.D.Xa)}kd(){return olympe.D.Cb(this.yb.toISOString())}ms(){return new Date(this.getTime())}sy(){return this}uy(){return this}lg(a,b){return olympe.D.Ga([b],c=>{const d=new olympe.D.kb(new Date(this.yb.getTime()));d.yb['set'+a](this.yb['get'+a]()+c.valueOf());return d},olympe.D.kb)}gv(a){return this.lg('Milliseconds',
299
- a)}nv(a){return this.lg('Seconds',a)}hv(a){return this.lg('Minutes',a)}fv(a){return this.lg('Hours',a)}Em(a){return this.lg('Date',a)}ov(a){return'number'===typeof a?this.Em(7*a):this.Em(a.Zk(7))}jv(a){return this.lg('Month',a)}pv(a){return this.lg('FullYear',a)}ny(){let a=this.yb.getDay();a=0===a?6:a-1;return new olympe.D.kb(new Date(this.yb.getFullYear(),this.yb.getMonth(),this.yb.getDate()-a))}oy(){return new olympe.D.kb(new Date(this.yb.getFullYear(),this.yb.getMonth()))}Wd(a){return olympe.D.Ga([a],
300
- b=>olympe.D.Bc(this.sb(b)),olympe.D.ra)}sb(a){return a instanceof olympe.D.kb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Bw(){let a=this.yb.getDay();0===a&&(a=7);return olympe.D.za(a)}qw(a,b){return olympe.D.Ga([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.yb.getFullYear()-c.yb.getFullYear():'months'===d?c=12*(this.yb.getFullYear()-c.yb.getFullYear())+(this.yb.getMonth()-c.yb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
- void 0===d&&(olympe.sa.Za('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.yb.getTime()-c.yb.getTime())/d));return olympe.D.za(c)},olympe.D.ea)}mx(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.getTime()<b.getTime()),olympe.D.ra)}kx(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.getTime()>b.getTime()),olympe.D.ra)}nx(a,b){return olympe.D.Ga([a,b],(c,d)=>olympe.D.Bc(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ra)}valueOf(){return this.lj().valueOf()?
302
- new Date(this.getTime()):new Date(0)}};olympe.D.kb.C=sb(0);olympe.D.kb.F=sb(Number.NaN);m=olympe.D.kb.prototype;m.lj.K=olympe.D.J.R;m.yt.K=olympe.D.J.G;m.At.K=olympe.D.J.G;m.zt.K=olympe.D.J.G;m.xt.K=olympe.D.J.G;m.mw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.Bt.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.my.K=new olympe.D.J(()=>olympe.D.Xa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.kd.K=olympe.D.J.F;m.ms.K=olympe.D.J.C;
303
- m.sy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.uy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.lg.K=new olympe.D.J(()=>olympe.D.kb,[]);m.gv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.nv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.hv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.fv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Em.K=new olympe.D.J(()=>olympe.D.kb,[0]);m.ov.K=new olympe.D.J(()=>olympe.D.kb,[]);m.jv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.pv.K=new olympe.D.J(()=>olympe.D.kb,[0]);
304
- m.ny.K=new olympe.D.J(()=>olympe.D.kb,[]);m.oy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Wd.K=olympe.D.J.R;m.sb.K=olympe.D.J.C;m.Bw.K=olympe.D.J.G;m.qw.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.mx.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.kx.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.nx.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.valueOf.K=olympe.D.J.C;const tb=new Map,ub=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,vb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function wb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=vb.exec(c)):(d=1,c=ub.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.Tf(a)?olympe.D.ke([a],b,olympe.D.Color):b(a)}
305
- olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.za(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.za(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.za(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.za(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static lc(a){let b;'string'===typeof a?b=
298
+ olympe.D.Xa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Cb(this.yb.toLocaleTimeString(a)):olympe.D.Ga([this,a],(b,c)=>olympe.D.Cb(b.yb.toLocaleTimeString(c.valueOf())),olympe.D.Xa)}kd(){return olympe.D.Cb(this.yb.toISOString())}rs(){return new Date(this.getTime())}uy(){return this}wy(){return this}lg(a,b){return olympe.D.Ga([b],c=>{const d=new olympe.D.kb(new Date(this.yb.getTime()));d.yb['set'+a](this.yb['get'+a]()+c.valueOf());return d},olympe.D.kb)}mv(a){return this.lg('Milliseconds',
299
+ a)}rv(a){return this.lg('Seconds',a)}nv(a){return this.lg('Minutes',a)}kv(a){return this.lg('Hours',a)}Fm(a){return this.lg('Date',a)}tv(a){return'number'===typeof a?this.Fm(7*a):this.Fm(a.Zk(7))}ov(a){return this.lg('Month',a)}uv(a){return this.lg('FullYear',a)}py(){let a=this.yb.getDay();a=0===a?6:a-1;return new olympe.D.kb(new Date(this.yb.getFullYear(),this.yb.getMonth(),this.yb.getDate()-a))}qy(){return new olympe.D.kb(new Date(this.yb.getFullYear(),this.yb.getMonth()))}Vd(a){return olympe.D.Ga([a],
300
+ b=>olympe.D.Bc(this.sb(b)),olympe.D.ra)}sb(a){return a instanceof olympe.D.kb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Fw(){let a=this.yb.getDay();0===a&&(a=7);return olympe.D.za(a)}uw(a,b){return olympe.D.Ga([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.yb.getFullYear()-c.yb.getFullYear():'months'===d?c=12*(this.yb.getFullYear()-c.yb.getFullYear())+(this.yb.getMonth()-c.yb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
+ void 0===d&&(olympe.sa.Ya('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.yb.getTime()-c.yb.getTime())/d));return olympe.D.za(c)},olympe.D.da)}qx(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.getTime()<b.getTime()),olympe.D.ra)}ox(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.getTime()>b.getTime()),olympe.D.ra)}rx(a,b){return olympe.D.Ga([a,b],(c,d)=>olympe.D.Bc(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ra)}valueOf(){return this.lj().valueOf()?
302
+ new Date(this.getTime()):new Date(0)}};olympe.D.kb.C=sb(0);olympe.D.kb.F=sb(Number.NaN);m=olympe.D.kb.prototype;m.lj.K=olympe.D.J.R;m.Ct.K=olympe.D.J.G;m.Et.K=olympe.D.J.G;m.Dt.K=olympe.D.J.G;m.Bt.K=olympe.D.J.G;m.qw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.Ft.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.oy.K=new olympe.D.J(()=>olympe.D.Xa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.kd.K=olympe.D.J.F;m.rs.K=olympe.D.J.C;
303
+ m.uy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.wy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.lg.K=new olympe.D.J(()=>olympe.D.kb,[]);m.mv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.rv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.nv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.kv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Fm.K=new olympe.D.J(()=>olympe.D.kb,[0]);m.tv.K=new olympe.D.J(()=>olympe.D.kb,[]);m.ov.K=new olympe.D.J(()=>olympe.D.kb,[]);m.uv.K=new olympe.D.J(()=>olympe.D.kb,[0]);
304
+ m.py.K=new olympe.D.J(()=>olympe.D.kb,[]);m.qy.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Vd.K=olympe.D.J.R;m.sb.K=olympe.D.J.C;m.Fw.K=olympe.D.J.G;m.uw.K=new olympe.D.J(()=>olympe.D.da,[0,1]);m.qx.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.ox.K=new olympe.D.J(()=>olympe.D.ra,[0]);m.rx.K=new olympe.D.J(()=>olympe.D.ra,[0,1]);m.valueOf.K=olympe.D.J.C;const tb=new Map,ub=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,vb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function wb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=vb.exec(c)):(d=1,c=ub.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.Tf(a)?olympe.D.ke([a],b,olympe.D.Color):b(a)}
305
+ olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.za(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.za(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.za(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.za(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static mc(a){let b;'string'===typeof a?b=
306
306
  JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.Ga([a,b,c,d],(e,f,g,h)=>{e=olympe.D.za(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.za(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.za(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.za(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of tb.values())if(k&&k.C.sb(e)&&k.F.sb(f)&&k.b.sb(g)&&k.a.sb(h))return k;
307
- return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Nf(){return this.C}Cf(){return this.b}Hf(){return this.F}Bf(){return this.a}zv(a,b){return olympe.D.Color.create(this.C.mj(a.Nf(),b),this.F.mj(a.Hf(),b),this.b.mj(a.Cf(),b),this.a.mj(a.Bf(),b))}Uv(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ps(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}Bn(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
- return'#'+(a+b).toUpperCase()}toString(){return this.Bn()}sb(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.sb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.Bn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ps;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Bf;
309
- olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Hf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Cf;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Nf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Nf.K=olympe.D.J.G;m.Cf.K=olympe.D.J.G;m.Hf.K=olympe.D.J.G;m.Bf.K=olympe.D.J.G;m.zv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Uv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.ps.K=new olympe.D.J(()=>String,[]);
310
- m.Bn.K=new olympe.D.J(()=>String,[]);m.sb.K=olympe.D.J.C;olympe.D.File=class{pa(){}up(){}Ql(){}dn(){}Ok(){}Ym(){}Pk(){}rename(){}};olympe.D.kc=class{constructor(a,b){this.x=olympe.D.ie(a);this.y=olympe.D.ie(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ya(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ya(this.y).valueOf())+' }'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kc(b.x,b.y)}gx(){return this.x}ky(a){pb(this.x,a)}hx(){return this.y}ly(a){pb(this.y,a)}Xw(){return this.x.es(this.y)}je(a){return olympe.D.Ga([this,a],(b,c)=>new olympe.D.kc(b.x.je(c.x),b.y.je(c.y)),
311
- olympe.D.kc,'Vector2.plus')}vh(a){return olympe.D.Ga([this,a],(b,c)=>new olympe.D.kc(b.x.vh(c.x),b.y.vh(c.y)),olympe.D.kc,'Vector2.minus')}Bx(a){return new olympe.D.kc(this.x.Zk(a),this.y.Zk(a))}Pv(a){return new olympe.D.kc(this.x.Wi(a),this.y.Wi(a))}Dx(){return new olympe.D.kc(this.x.xj(),this.y.xj())}Qv(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Ga([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.za(d*f+e*g),olympe.D.ea),olympe.D.ea)}length(){return olympe.D.Ga([this.x,this.y],(a,b)=>olympe.D.za(Math.sqrt(a*
312
- a+b*b)),olympe.D.ea)}normalize(){return olympe.D.Ga([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.kc(a/c,b/c)},olympe.D.kc)}floor(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.floor(a),Math.floor(b)),olympe.D.kc)}ceil(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.ceil(a),Math.ceil(b)),olympe.D.kc)}round(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.round(a),Math.round(b)),olympe.D.kc)}kv(a){return new olympe.D.kc(this.x.je(a),
313
- this.y.je(a))}mv(a,b){return new olympe.D.kc(this.x.je(a),this.y.je(b))}kd(){return olympe.D.Ga([this.x,this.y],(a,b)=>olympe.D.Cb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Xa)}toString(){return`Vector2[${this.x.Na.Ib}, ${this.y.Na.Ib}]`}sb(a){return this===a?!0:!1}};m=olympe.D.kc.prototype;m.toJSON.K=olympe.D.J.C;m.gx.K=olympe.D.J.G;m.ky.K=olympe.D.J.C;m.hx.K=olympe.D.J.G;m.ly.K=olympe.D.J.C;m.Xw.K=olympe.D.J.G;m.je.K=new olympe.D.J(()=>olympe.D.kc,[0]);
314
- m.vh.K=new olympe.D.J(()=>olympe.D.kc,[0]);m.Bx.K=olympe.D.J.Y;m.Pv.K=olympe.D.J.Y;m.Dx.K=olympe.D.J.Y;m.Qv.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.Y;m.floor.K=olympe.D.J.Y;m.ceil.K=olympe.D.J.Y;m.round.K=olympe.D.J.Y;m.kv.K=olympe.D.J.Y;m.mv.K=olympe.D.J.Y;m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;olympe.D.Pg=class{constructor(){}$b(){}Jd(){}get(){}lh(){}has(){}Dg(){}Qc(){}Ff(){}lf(){}yg(){}forEach(){}fe(){}};olympe.D.Pg.prototype.forEachCurrentValue=olympe.D.Pg.prototype.fe;olympe.D.Pg.prototype.forEach=olympe.D.Pg.prototype.forEach;m=olympe.D.Pg.prototype;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.Qc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.fe.K=olympe.D.J.C;olympe.D.qd=class extends olympe.D.Pg{constructor(){super()}he(){}Ef(){}Xe(){}Df(){}se(){}We(){}Zi(){}di(){}};olympe.D.qd.prototype.getCurrentAt=olympe.D.qd.prototype.We;olympe.D.qd.prototype.getAt=olympe.D.qd.prototype.se;olympe.D.qd.prototype.getCurrentKeyAt=olympe.D.qd.prototype.Df;olympe.D.qd.prototype.getKeyAt=olympe.D.qd.prototype.Xe;olympe.D.qd.prototype.getCurrentRank=olympe.D.qd.prototype.Ef;olympe.D.qd.prototype.getRank=olympe.D.qd.prototype.he;m=olympe.D.qd.prototype;m.he.K=olympe.D.J.G;
315
- m.Ef.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.Zi.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);olympe.D.oi=class{constructor(a,b){this.R=b||olympe.D.Ia();this.valueType=a||Object;this.values={};this.Ab=this.Ta=null;this.Wf=0;this.aa=Object.create(null);this.Pb=Object.create(null);this.size=0;this.L=null;this.R.onDestroy(()=>{const c=this.aa;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){let g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Gh(){return this.R}$b(){return this.valueType}Jd(a){this.valueType=a;let b=this.Ta;if(null!==b)for(let c in b)Object.prototype.hasOwnProperty.call(b,
316
- c)&&kb(b[c],a)}get(a){let b=c=>{null===this.Ta&&(this.Ta={});return this.cj(this.Ta,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Ga([a],c=>b(c),this.valueType)}lh(a){a=this.values[a];return olympe.D.nb(a)?Wa(a.Na)?a.Na.Ib:void 0:a}has(a){let b=c=>{null===this.Ab&&(this.Ab={});return this.cj(this.Ab,c,c in this.values?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'Map.has('+c+')')};return olympe.D.Ga([a],c=>b(c),olympe.D.ra)}Dg(a){return a in this.values}cj(a,b,c,d,e){let f=a[b];f||
317
- this.R.run(()=>{f=olympe.D.Pd(d,void 0,e);a[b]=f;f.Na.onDestroy(()=>delete a[b]);olympe.D.nb(c)?ob(f,c):lb(f,c)});return f}Qc(){throw Error('Abstract method getFirstKey needs to be overridden');}Ff(){throw Error('Abstract method getFirstKey needs to be overridden');}lf(){null===this.L&&this.R.run(()=>{this.L=olympe.D.Pd(olympe.D.ea,olympe.D.za(this.size));this.L.Na.onDestroy(()=>{this.L=null})});return this.L}yg(){return this.size}forEach(a,b){let c=this.Am();a=this.rr(c,a,b);this.zm(c,a)}Am(){return String(++this.Wf)}zm(a,
318
- b){this.Pb[a]=b;olympe.D.Ia().xc(()=>{let c=this.aa;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Pb[a]});this.fe(b)}rr(a,b,c){let d=olympe.D.Ia();return(e,f)=>{d.run(()=>{let g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Dm(a,f,g)})}}Dm(a,b,c){void 0===this.aa[b]&&(this.aa[b]={});this.aa[b][a]=c}fe(a){let b=this.values;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],
319
- c,this))break}Fk(a,b){void 0!==this.values[a]&&this.Qi(a,!0);this.values[a]=b;var c=this.Ta;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?ob(c[a],b):lb(c[a],b));c=this.Ab;null!==c&&void 0!==c[a]&&pb(c[a],!0);this.size++;c=this.Pb;for(let d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Qi(a,b){let c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.xf?d.Na.Ib:d;var e=this.Ta;null!==e&&void 0!==e[a]&&mb(e[a]);e=this.Ab;null!==e&&void 0!==e[a]&&
320
- pb(e[a],!1);delete c[a];this.size--;b||this.yf()}a=this.aa[a];if(void 0!==a)for(let f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}yf(){null!==this.L&&pb(this.L,this.size)}Wh(){let a,b;var c=this.Ta;if(null!==c)for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&mb(c[a]);c=this.Ab;if(null!==c)for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&pb(c[a],!1);for(a in this.values)Object.prototype.hasOwnProperty.call(this.values,a)&&delete this.values[a];for(a in this.aa)if(Object.prototype.hasOwnProperty.call(this.aa,
321
- a))for(b in c=this.aa[a],c)Object.prototype.hasOwnProperty.call(c,b)&&c[b].destroy();this.size=0;null!==this.L&&pb(this.L,this.size)}Ug(){const a=this.values;let b='\n';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.oi.ma=[olympe.D.Pg];m=olympe.D.oi.prototype;m.Gh.K=olympe.D.J.C;m.$b.K=olympe.D.J.C;m.Jd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.cj.K=olympe.D.J.C;
322
- m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Am.K=olympe.D.J.C;m.zm.K=olympe.D.J.C;m.rr.K=olympe.D.J.C;m.Dm.K=olympe.D.J.C;m.fe.K=olympe.D.J.C;m.Fk.K=olympe.D.J.C;m.Qi.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Bj=class extends olympe.D.oi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Fa=this.bb=this.cb=this.oa=null}Jd(a){super.Jd(a);if(null!==this.Fa)for(let b of this.Fa.values())kb(b,a)}Qc(){return this.se(0)}Ff(){return this.Xe(0)}he(a){const b=c=>{null===this.cb&&(this.cb=Object.create(null));let d=this.Ef(a);d=void 0!==d?olympe.D.za(d):void 0;return this.cj(this.cb,c,d,olympe.D.ea,`List.getRank(${c})`)};return olympe.D.nb(a)?L(olympe.D.createNode(olympe.D.ea,b,null,
323
- [a.Na],[0],'onResolved('+(b.name||'')+')')):b(a)}Ef(a){return this.F[a]}Xe(a){const b=c=>{const d=c.valueOf(),e=this.Df(d);null===this.bb&&(this.bb=Object.create(null));return this.cj(this.bb,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Ga([a],c=>b(c),String)}Df(a){return this.C[a.valueOf()]}se(a){if(olympe.D.nb(a))return this.get(olympe.D.Ga([a],c=>{c=this.Xe(c);if(!Wa(c.Na)){const d=olympe.D.Ia();olympe.D.Sf(d)&&fb(d)}return c},String));null===this.Fa&&(this.Fa=new Map);let b=this.Fa.get(a);
324
- b||this.R.run(()=>{b=this.get(this.Xe(a));this.Fa.set(a,b);b.Na.onDestroy(()=>this.Fa.delete(a))});return b}We(a){return this.lh(this.Df(a))}Zi(a,b,c,d){let e=this.Am();a=this.Vr(e,a,b,c,d);this.zm(e,a)}Vr(a,b,c,d,e){return olympe.D.Ia().C((f,g)=>{let h=!1,k=olympe.D.cf([b,c,this.he(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Dm(a,g,k)})}di(){null===this.oa&&this.R.run(()=>{this.oa=olympe.D.Pd(Array,this.C.filter(a=>void 0!==a));
325
- this.oa.Na.onDestroy(()=>{this.L=null})});return this.oa}fe(a){if(this.C.length!==this.size)super.fe(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Cm(a,b){const c=this.cb,d=this.bb,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&mb(c[g]),void 0!==
326
- c[a]&&lb(c[a],olympe.D.za(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&mb(d[e]),void 0!==d[b]&&lb(d[b],a))}}Bm(a){var b=this.bb,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Na.Ib===a&&mb(b));delete this.F[a];this.C.splice(c,1);c=this.cb;null!==c&&void 0!==c[a]&&mb(c[a])}sr(){if(null!==this.oa){const a=this.C,b=this.oa.Na.Ib;b&&a.join(',')!==b.join(',')&&lb(this.oa,a)}}yf(){this.sr();super.yf()}Wh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.cb;if(null!==
327
- a)for(b in a)mb(a[b]);a=this.bb;if(null!==a)for(b in a)mb(a[parseInt(b,10)]);var b=this.oa;null!==b&&(db(b.Na),lb(b,this.C));return olympe.D.oi.prototype.Wh.call(this)}Ug(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Bj.ma=[olympe.D.qd];m=olympe.D.Bj.prototype;m.Jd.K=olympe.D.J.C;m.Qc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.he.K=olympe.D.J.G;m.Ef.K=olympe.D.J.C;
328
- m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.Zi.K=new olympe.D.J(()=>{},[]);m.Vr.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);m.fe.K=olympe.D.J.C;m.Cm.K=olympe.D.J.C;m.Bm.K=olympe.D.J.C;m.sr.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.oi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Jd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&kb(this.F,a);super.Jd(a)}Qc(){null===this.F&&this.Pm();return this.F}Ff(){null===this.C&&this.Pm();return this.C}Pm(){this.Gh().run(()=>{this.F=olympe.D.Pd(this.$b());this.C=olympe.D.Pd(String);this.uj(this.Um())})}Um(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}uj(a){if(void 0!==
329
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?ob(this.F,b):lb(this.F,b);lb(this.C,a)}else void 0!==this.F.Na.Ib&&(mb(this.F),mb(this.C))}set(a,b){this.Fk(a,b);1===this.size&&null!==this.C&&this.uj(a);this.yf()}remove(a){const b=this.Qi(a);null!==this.C&&this.C.Na.Ib===a&&this.uj(this.Um());return b}clear(){this.Wh();null!==this.C&&this.uj(void 0)}};m=olympe.D.Map.prototype;m.Jd.K=olympe.D.J.C;m.Qc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.Pm.K=olympe.D.J.C;
330
- m.Um.K=olympe.D.J.C;m.uj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Vg=class extends olympe.D.Bj{constructor(a){super(a)}set(a,b,c){this.Fk(a,b);void 0!==c&&olympe.D.yc([c],d=>{this.Cm(a,d)});this.yf()}remove(a){this.Bm(a);return this.Qi(a)}clear(){this.Wh()}};olympe.D.Vg.prototype.remove.K=olympe.D.J.C;olympe.D.Vg.prototype.clear.K=olympe.D.J.C;olympe.D.vs=class extends olympe.D.Rj{constructor(a,b){super(olympe.D.ea,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ea.xo.Dp}Eb(){return olympe.D.Hx(this.node,this.duration,this.C,void 0)}};let xb=null;olympe.D.N=void 0;olympe.D.wn=void 0;olympe.D.Zh=void 0;olympe.D.Vh=new Map;olympe.D.Vh.set(0,olympe.D.ea.ZERO);olympe.D.Vh.set(1,olympe.D.ea.ONE);olympe.D.Vh.set(2,olympe.D.ea.Xu);olympe.D.Ek=new Map;olympe.D.Ek.set('',olympe.D.Xa.EMPTY);olympe.D.Ek.set(' ',olympe.D.Xa.Ku);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Ed:b,Xf:c,hn:d,debug:g,tg:e,Cd:f,Si:h})};olympe.D.Sf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
- olympe.D.Pd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Sf(b)?gb(a,b):olympe.D.nb(b)?gb(a,b.Na):K(a,b);return L(a)};olympe.D.nb=function(a){return!(!a||!a.xf)};olympe.D.Tf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.xf))};olympe.D.nn=function(a){return olympe.D.Sf(a)||a instanceof olympe.D.Zb||a instanceof olympe.D.Bq};olympe.D.hi=function(a){return a instanceof olympe.D.Rj};
332
- olympe.D.dl=function(a,b){if(void 0!==a){olympe.D.hi(a)&&(a=a.Eb().Na);if(!olympe.D.Tf(a))return b(a);var c=[];olympe.D.nb(a)?c.push(a.Na):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ya=function(a,b){let c=a;olympe.D.nb(a)?c=a.Na.Ib:olympe.D.Sf(a)?c=a.Ib:olympe.D.hi(a)&&(c=a.Eb().Na.Ib);return void 0===c?b:c};
333
- olympe.D.bf=function(a,b){let c;olympe.D.nb(a)?c=a.Na:olympe.D.Sf(a)?c=a:olympe.D.hi(a)&&(c=a.Eb().Na);c&&olympe.D.yc([b],d=>{c.bf(d)},'setDefaultValue');return a};olympe.D.cf=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.nr?(h=h.Na,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.hi(h)&&(h=h.Eb().Na,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
307
+ return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Nf(){return this.C}Cf(){return this.b}Hf(){return this.F}Bf(){return this.a}Dv(a,b){return olympe.D.Color.create(this.C.mj(a.Nf(),b),this.F.mj(a.Hf(),b),this.b.mj(a.Cf(),b),this.a.mj(a.Bf(),b))}Yv(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ts(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}Dn(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
+ return'#'+(a+b).toUpperCase()}toString(){return this.Dn()}sb(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.sb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.Dn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ts;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Bf;
309
+ olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Hf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Cf;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Nf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Nf.K=olympe.D.J.G;m.Cf.K=olympe.D.J.G;m.Hf.K=olympe.D.J.G;m.Bf.K=olympe.D.J.G;m.Dv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Yv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.ts.K=new olympe.D.J(()=>String,[]);
310
+ m.Dn.K=new olympe.D.J(()=>String,[]);m.sb.K=olympe.D.J.C;olympe.D.File=class{na(){}xp(){}Ql(){}en(){}Ok(){}Zm(){}Pk(){}rename(){}};olympe.D.kc=class{constructor(a,b){this.x=olympe.D.ie(a);this.y=olympe.D.ie(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Za(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Za(this.y).valueOf())+' }'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.kc(b.x,b.y)}kx(){return this.x}my(a){pb(this.x,a)}lx(){return this.y}ny(a){pb(this.y,a)}ax(){return this.x.js(this.y)}je(a){return olympe.D.Ga([this,a],(b,c)=>new olympe.D.kc(b.x.je(c.x),b.y.je(c.y)),
311
+ olympe.D.kc,'Vector2.plus')}vh(a){return olympe.D.Ga([this,a],(b,c)=>new olympe.D.kc(b.x.vh(c.x),b.y.vh(c.y)),olympe.D.kc,'Vector2.minus')}Fx(a){return new olympe.D.kc(this.x.Zk(a),this.y.Zk(a))}Tv(a){return new olympe.D.kc(this.x.Wi(a),this.y.Wi(a))}Hx(){return new olympe.D.kc(this.x.xj(),this.y.xj())}Uv(a){return olympe.D.Ga([this,a],(b,c)=>olympe.D.Ga([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.za(d*f+e*g),olympe.D.da),olympe.D.da)}length(){return olympe.D.Ga([this.x,this.y],(a,b)=>olympe.D.za(Math.sqrt(a*
312
+ a+b*b)),olympe.D.da)}normalize(){return olympe.D.Ga([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.kc(a/c,b/c)},olympe.D.kc)}floor(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.floor(a),Math.floor(b)),olympe.D.kc)}ceil(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.ceil(a),Math.ceil(b)),olympe.D.kc)}round(){return olympe.D.Ga([this.x,this.y],(a,b)=>new olympe.D.kc(Math.round(a),Math.round(b)),olympe.D.kc)}pv(a){return new olympe.D.kc(this.x.je(a),
313
+ this.y.je(a))}qv(a,b){return new olympe.D.kc(this.x.je(a),this.y.je(b))}kd(){return olympe.D.Ga([this.x,this.y],(a,b)=>olympe.D.Cb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Xa)}toString(){return`Vector2[${this.x.Na.Ib}, ${this.y.Na.Ib}]`}sb(a){return this===a?!0:!1}};m=olympe.D.kc.prototype;m.toJSON.K=olympe.D.J.C;m.kx.K=olympe.D.J.G;m.my.K=olympe.D.J.C;m.lx.K=olympe.D.J.G;m.ny.K=olympe.D.J.C;m.ax.K=olympe.D.J.G;m.je.K=new olympe.D.J(()=>olympe.D.kc,[0]);
314
+ m.vh.K=new olympe.D.J(()=>olympe.D.kc,[0]);m.Fx.K=olympe.D.J.Y;m.Tv.K=olympe.D.J.Y;m.Hx.K=olympe.D.J.Y;m.Uv.K=new olympe.D.J(()=>olympe.D.da,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.Y;m.floor.K=olympe.D.J.Y;m.ceil.K=olympe.D.J.Y;m.round.K=olympe.D.J.Y;m.pv.K=olympe.D.J.Y;m.qv.K=olympe.D.J.Y;m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;olympe.D.Pg=class{constructor(){}$b(){}Jd(){}get(){}lh(){}has(){}Dg(){}Rc(){}Ff(){}lf(){}yg(){}forEach(){}fe(){}};olympe.D.Pg.prototype.forEachCurrentValue=olympe.D.Pg.prototype.fe;olympe.D.Pg.prototype.forEach=olympe.D.Pg.prototype.forEach;m=olympe.D.Pg.prototype;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.fe.K=olympe.D.J.C;olympe.D.pd=class extends olympe.D.Pg{constructor(){super()}he(){}Ef(){}Xe(){}Df(){}se(){}We(){}Zi(){}di(){}};olympe.D.pd.prototype.getCurrentAt=olympe.D.pd.prototype.We;olympe.D.pd.prototype.getAt=olympe.D.pd.prototype.se;olympe.D.pd.prototype.getCurrentKeyAt=olympe.D.pd.prototype.Df;olympe.D.pd.prototype.getKeyAt=olympe.D.pd.prototype.Xe;olympe.D.pd.prototype.getCurrentRank=olympe.D.pd.prototype.Ef;olympe.D.pd.prototype.getRank=olympe.D.pd.prototype.he;m=olympe.D.pd.prototype;m.he.K=olympe.D.J.G;
315
+ m.Ef.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.Zi.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);olympe.D.oi=class{constructor(a,b){this.R=b||olympe.D.Ia();this.valueType=a||Object;this.values={};this.Ab=this.Ta=null;this.Wf=0;this.ea=Object.create(null);this.Pb=Object.create(null);this.size=0;this.L=null;this.R.onDestroy(()=>{const c=this.ea;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Gh(){return this.R}$b(){return this.valueType}Jd(a){this.valueType=a;const b=this.Ta;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
+ c)&&kb(b[c],a)}get(a){const b=c=>{null===this.Ta&&(this.Ta={});return this.cj(this.Ta,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Ga([a],c=>b(c),this.valueType)}lh(a){a=this.values[a];return olympe.D.nb(a)?Wa(a.Na)?a.Na.Ib:void 0:a}has(a){const b=c=>{null===this.Ab&&(this.Ab={});return this.cj(this.Ab,c,c in this.values?olympe.D.ra.F:olympe.D.ra.C,olympe.D.ra,'Map.has('+c+')')};return olympe.D.Ga([a],c=>b(c),olympe.D.ra)}Dg(a){return a in this.values}cj(a,b,c,d,e){let f=a[b];
317
+ f||this.R.run(()=>{f=olympe.D.Pd(d,void 0,e);a[b]=f;f.Na.onDestroy(()=>delete a[b]);olympe.D.nb(c)?ob(f,c):lb(f,c)});return f}Rc(){throw Error('Abstract method getFirstKey needs to be overridden');}Ff(){throw Error('Abstract method getFirstKey needs to be overridden');}lf(){null===this.L&&this.R.run(()=>{this.L=olympe.D.Pd(olympe.D.da,olympe.D.za(this.size));this.L.Na.onDestroy(()=>{this.L=null})});return this.L}yg(){return this.size}forEach(a,b){const c=this.Bm();a=this.ur(c,a,b);this.Am(c,a)}Bm(){return String(++this.Wf)}Am(a,
318
+ b){this.Pb[a]=b;olympe.D.Ia().xc(()=>{const c=this.ea;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Pb[a]});this.fe(b)}ur(a,b,c){const d=olympe.D.Ia();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Em(a,f,g)})}}Em(a,b,c){void 0===this.ea[b]&&(this.ea[b]={});this.ea[b][a]=c}fe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&
319
+ !1===a(b[c],c,this))break}Fk(a,b){void 0!==this.values[a]&&this.Qi(a,!0);this.values[a]=b;var c=this.Ta;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?ob(c[a],b):lb(c[a],b));c=this.Ab;null!==c&&void 0!==c[a]&&pb(c[a],!0);this.size++;c=this.Pb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Qi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.xf?d.Na.Ib:d;var e=this.Ta;null!==e&&void 0!==e[a]&&mb(e[a]);e=this.Ab;null!==e&&
320
+ void 0!==e[a]&&pb(e[a],!1);delete c[a];this.size--;b||this.yf()}a=this.ea[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}yf(){null!==this.L&&pb(this.L,this.size)}Wh(){var a=this.Ta;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&mb(a[c]);a=this.Ab;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&pb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];
321
+ for(const c in this.ea)if(Object.prototype.hasOwnProperty.call(this.ea,c)){b=this.ea[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&pb(this.L,this.size)}Ug(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.oi.ma=[olympe.D.Pg];m=olympe.D.oi.prototype;m.Gh.K=olympe.D.J.C;m.$b.K=olympe.D.J.C;m.Jd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');
322
+ m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.cj.K=olympe.D.J.C;m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Bm.K=olympe.D.J.C;m.Am.K=olympe.D.J.C;m.ur.K=olympe.D.J.C;m.Em.K=olympe.D.J.C;m.fe.K=olympe.D.J.C;m.Fk.K=olympe.D.J.C;m.Qi.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Bj=class extends olympe.D.oi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Fa=this.cb=this.$a=this.qa=null}Jd(a){super.Jd(a);if(null!==this.Fa)for(let b of this.Fa.values())kb(b,a)}Rc(){return this.se(0)}Ff(){return this.Xe(0)}he(a){const b=c=>{null===this.$a&&(this.$a=Object.create(null));let d=this.Ef(a);d=void 0!==d?olympe.D.za(d):void 0;return this.cj(this.$a,c,d,olympe.D.da,`List.getRank(${c})`)};return olympe.D.nb(a)?L(olympe.D.createNode(olympe.D.da,b,null,
323
+ [a.Na],[0],'onResolved('+(b.name||'')+')')):b(a)}Ef(a){return this.F[a]}Xe(a){const b=c=>{const d=c.valueOf(),e=this.Df(d);null===this.cb&&(this.cb=Object.create(null));return this.cj(this.cb,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Ga([a],c=>b(c),String)}Df(a){return this.C[a.valueOf()]}se(a){if(olympe.D.nb(a))return this.get(olympe.D.Ga([a],c=>{c=this.Xe(c);if(!Wa(c.Na)){const d=olympe.D.Ia();olympe.D.Sf(d)&&fb(d)}return c},String));null===this.Fa&&(this.Fa=new Map);let b=this.Fa.get(a);
324
+ b||this.R.run(()=>{b=this.get(this.Xe(a));this.Fa.set(a,b);b.Na.onDestroy(()=>this.Fa.delete(a))});return b}We(a){return this.lh(this.Df(a))}Zi(a,b,c,d){let e=this.Bm();a=this.Yr(e,a,b,c,d);this.Am(e,a)}Yr(a,b,c,d,e){return olympe.D.Ia().C((f,g)=>{let h=!1,k=olympe.D.cf([b,c,this.he(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Em(a,g,k)})}di(){null===this.qa&&this.R.run(()=>{this.qa=olympe.D.Pd(Array,this.C.filter(a=>void 0!==a));
325
+ this.qa.Na.onDestroy(()=>{this.L=null})});return this.qa}fe(a){if(this.C.length!==this.size)super.fe(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Dm(a,b){const c=this.$a,d=this.cb,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&mb(c[g]),void 0!==
326
+ c[a]&&lb(c[a],olympe.D.za(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&mb(d[e]),void 0!==d[b]&&lb(d[b],a))}}Cm(a){var b=this.cb,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Na.Ib===a&&mb(b));delete this.F[a];this.C.splice(c,1);c=this.$a;null!==c&&void 0!==c[a]&&mb(c[a])}vr(){if(null!==this.qa){const a=this.C,b=this.qa.Na.Ib;b&&a.join(',')!==b.join(',')&&lb(this.qa,a)}}yf(){this.vr();super.yf()}Wh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.$a;if(null!==
327
+ a)for(b in a)mb(a[b]);a=this.cb;if(null!==a)for(b in a)mb(a[parseInt(b,10)]);var b=this.qa;null!==b&&(db(b.Na),lb(b,this.C));return olympe.D.oi.prototype.Wh.call(this)}Ug(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Bj.ma=[olympe.D.pd];m=olympe.D.Bj.prototype;m.Jd.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.he.K=olympe.D.J.G;m.Ef.K=olympe.D.J.C;
328
+ m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.Zi.K=new olympe.D.J(()=>{},[]);m.Yr.K=olympe.D.J.C;m.di.K=new olympe.D.J(()=>Array,[]);m.fe.K=olympe.D.J.C;m.Dm.K=olympe.D.J.C;m.Cm.K=olympe.D.J.C;m.vr.K=olympe.D.J.C;m.yf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Ug.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.oi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Jd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&kb(this.F,a);super.Jd(a)}Rc(){null===this.F&&this.Qm();return this.F}Ff(){null===this.C&&this.Qm();return this.C}Qm(){this.Gh().run(()=>{this.F=olympe.D.Pd(this.$b());this.C=olympe.D.Pd(String);this.uj(this.Vm())})}Vm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}uj(a){if(void 0!==
329
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?ob(this.F,b):lb(this.F,b);lb(this.C,a)}else void 0!==this.F.Na.Ib&&(mb(this.F),mb(this.C))}set(a,b){this.Fk(a,b);1===this.size&&null!==this.C&&this.uj(a);this.yf()}remove(a){const b=this.Qi(a);null!==this.C&&this.C.Na.Ib===a&&this.uj(this.Vm());return b}clear(){this.Wh();null!==this.C&&this.uj(void 0)}};m=olympe.D.Map.prototype;m.Jd.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>Object,[]);m.Ff.K=new olympe.D.J(()=>String,[]);m.Qm.K=olympe.D.J.C;
330
+ m.Vm.K=olympe.D.J.C;m.uj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Vg=class extends olympe.D.Bj{constructor(a){super(a)}set(a,b,c){this.Fk(a,b);void 0!==c&&olympe.D.yc([c],d=>{this.Dm(a,d)});this.yf()}remove(a){this.Cm(a);return this.Qi(a)}clear(){this.Wh()}};olympe.D.Vg.prototype.remove.K=olympe.D.J.C;olympe.D.Vg.prototype.clear.K=olympe.D.J.C;olympe.D.zs=class extends olympe.D.Rj{constructor(a,b){super(olympe.D.da,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.da.zo.Gp}Eb(){return olympe.D.Lx(this.node,this.duration,this.C,void 0)}};let xb=null;olympe.D.N=void 0;olympe.D.yn=void 0;olympe.D.Zh=void 0;olympe.D.Vh=new Map;olympe.D.Vh.set(0,olympe.D.da.ZERO);olympe.D.Vh.set(1,olympe.D.da.ONE);olympe.D.Vh.set(2,olympe.D.da.av);olympe.D.Ek=new Map;olympe.D.Ek.set('',olympe.D.Xa.EMPTY);olympe.D.Ek.set(' ',olympe.D.Xa.Ou);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Ed:b,Xf:c,jn:d,debug:g,tg:e,Cd:f,Si:h})};olympe.D.Sf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
+ olympe.D.Pd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Sf(b)?gb(a,b):olympe.D.nb(b)?gb(a,b.Na):K(a,b);return L(a)};olympe.D.nb=function(a){return!(!a||!a.xf)};olympe.D.Tf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.xf))};olympe.D.pn=function(a){return olympe.D.Sf(a)||a instanceof olympe.D.Zb||a instanceof olympe.D.Eq};olympe.D.hi=function(a){return a instanceof olympe.D.Rj};
332
+ olympe.D.dl=function(a,b){if(void 0!==a){olympe.D.hi(a)&&(a=a.Eb().Na);if(!olympe.D.Tf(a))return b(a);var c=[];olympe.D.nb(a)?c.push(a.Na):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Za=function(a,b){let c=a;olympe.D.nb(a)?c=a.Na.Ib:olympe.D.Sf(a)?c=a.Ib:olympe.D.hi(a)&&(c=a.Eb().Na.Ib);return void 0===c?b:c};
333
+ olympe.D.bf=function(a,b){let c;olympe.D.nb(a)?c=a.Na:olympe.D.Sf(a)?c=a:olympe.D.hi(a)&&(c=a.Eb().Na);c&&olympe.D.yc([b],d=>{c.bf(d)},'setDefaultValue');return a};olympe.D.cf=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.sr?(h=h.Na,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.hi(h)&&(h=h.Eb().Na,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
334
  olympe.D.ke=function(a,b,c,d){return L(olympe.D.cf(a,b,c,d||'syncProxies'))};const yb=a=>{for(const b of a)if(olympe.D.Tf(b)||olympe.D.hi(b))return!1;return!0};olympe.D.Ga=function(a,b,c,d,e){if(yb(a))return b(...a);const f=olympe.D.cf(a,b,c,d||'TransformFlows');e&&olympe.D.yc([e],g=>{f.bf(g)},'setDefaultValue');return L(f)};olympe.D.yc=function(a,b,c){yb(a)?b(...a):olympe.D.cf(a,b,void 0,c||'processFlows')};
335
- olympe.D.bs=function(a,b){if(yb(a))b(...a);else{const c=olympe.D.Ia();olympe.D.cf(a,(...d)=>{olympe.D.Ia().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.vn=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.nb(g)?(g=g.Na,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.hi(g)&&(g=g.Eb().Na,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Ed:b,hn:e,tg:f,Vx:!1,Cd:c})};
336
- olympe.D.YC=function(a,b,c){const d=olympe.D.Ia();olympe.D.vn(a,(...e)=>{olympe.D.Ia().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.vC=function(a,b,c){a=new olympe.D.Rj(a,c);b(a);return a.Eb()};olympe.D.Mc=function(a,b='flowSource'){return new olympe.D.Rj(a,b)};olympe.D.aD=function(a,b,c,d){const e=olympe.D.Ia();olympe.D.cf(a,(...f)=>{olympe.D.Ia().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
- olympe.D.Tk=function(a,b,c){olympe.D.Ga([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.AC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.iD=function(a){return olympe.D.Ia().C(a)};olympe.D.yC=function(a,b,c){olympe.D.Rv(a?a.Na:a,b,c)};
338
- olympe.D.Rv=function(a,b,c){if(a){var d=a.Z();null===xb&&(xb={});if(xb[d])olympe.D.N.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{xb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.N.warn(e):olympe.D.N.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.N.log(f,'undefined'):null===g?olympe.D.N.log(f,'null'):olympe.D.N.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.N.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
- ''))});c.onDestroy(()=>{delete xb[d]})}}else olympe.D.N.log('NOT starting node dump, node is '+String(a))};olympe.D.xC=function(){let a='',b=olympe.D.Ia();for(;null!==b;)a+=b.Tb()+' --\x3e ',b=b.getParent();olympe.D.N.log(a)};
340
- olympe.D.za=function(a){if(void 0===a)return olympe.D.ea.ZERO;if(a instanceof olympe.D.ea)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ea.Mp;if(a===Math.PI)return olympe.D.ea.PI;if(Infinity===a)return olympe.D.ea.rt;if(-Infinity===a)return olympe.D.ea.du;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Vh.has(a)||olympe.D.Vh.set(a,new olympe.D.ea(a)),olympe.D.Vh.get(a)):new olympe.D.ea(a)}return null};
341
- olympe.D.ie=function(a){return void 0===a?olympe.D.Pd(olympe.D.ea):olympe.D.Pd(olympe.D.ea,olympe.D.Tf(a)?a:olympe.D.za(a))};olympe.D.Hx=olympe.D.ea.animate;olympe.D.SC=function(a,b){return new olympe.D.vs(a,b)};olympe.D.Cb=function(a){if(a instanceof olympe.D.Xa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Ek.has(a)?olympe.D.Ek.get(a):new olympe.D.Xa(a)};
342
- olympe.D.VC=function(a){return void 0===a?olympe.D.Pd(olympe.D.Xa):olympe.D.Pd(olympe.D.Xa,olympe.D.Tf(a)?a:olympe.D.Cb(a))};olympe.D.Bc=function(a){return a instanceof olympe.D.ra?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ra.F:olympe.D.ra.C};olympe.D.Sx=function(a){return void 0===a?olympe.D.Pd(olympe.D.ra):olympe.D.Pd(olympe.D.ra,olympe.D.Tf(a)?a:olympe.D.Bc(a))};olympe.D.Ix=function(a){if(a instanceof Date)return new olympe.D.kb(a)};
343
- olympe.D.UC=function(a){return olympe.D.Pd(olympe.D.kb,void 0!==a?new olympe.D.kb(a):null)};olympe.D.Ur=a=>a instanceof olympe.D.ra||a instanceof olympe.D.ea||a instanceof olympe.D.Xa||a instanceof olympe.D.kb;olympe.D.WC=function(a,b){return olympe.D.Pd(olympe.D.kc,void 0===a&&void 0===b?void 0:new olympe.D.kc(a,b))};olympe.D.Rx=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Pd(olympe.D.Color,e)};olympe.D.TC=olympe.D.Rx;
344
- olympe.D.Hv=function(a){olympe.D.N=a;olympe.D.Zh=olympe.D.zg()};olympe.D.zg=function(){olympe.D.wn||(olympe.D.wn=new olympe.D.Bq);return olympe.D.wn};olympe.D.Ia=function(){olympe.D.Zh||(olympe.D.Zh=olympe.D.zg());return olympe.D.Zh};olympe.D.hs=function(a){const b=olympe.D.Zh;olympe.D.nn(a)&&(olympe.D.Zh=a);return b||null};
345
- olympe.D.lc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.kb.lc(a);break;case 'number':b=olympe.D.ea.lc(a);break;case 'string':b=olympe.D.Xa.lc(a);break;case 'vector2':b=olympe.D.kc.lc(a);break;case 'color':b=olympe.D.Color.lc(a);break;case 'boolean':b=olympe.D.ra.lc(a)}return b}return null};function zb(a){a.C.zb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.R.clear(),a.Y.length=0,a.L.length=0)}
346
- olympe.D.XA=class{constructor(){this.C=new olympe.D.Zb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Mc(Ab,'Last slot manager entry');this.size=qb(olympe.D.Mc(olympe.D.ea,'SlotManager size').repeat(this.F.Eb().$m()),olympe.D.ea.ZERO);this.R=qb(olympe.D.Mc(olympe.D.ea,'last valid slots'),olympe.D.za(-1))});this.Y=[];this.L=[];this.C.onDestroy(()=>{zb(this)})}};
347
- class Ab{constructor(a,b,c,d){this.id=a;this.vc=new olympe.D.Zb('Slot manager entry');this.G=c;this.L=d;this.vc.run(()=>{const e=qb(olympe.D.Mc(olympe.D.ea),olympe.D.ea.ZERO);olympe.D.nb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Mc(olympe.D.ea);this.F=this.C.Eb().je(e.Eb())});this.next=null}Z(){return this.id}ax(){return this.C.Eb()}$m(){return this.F}he(){return this.G}lx(){return this.L}yy(a){this.G=a}fy(a){null===a?this.C.update(olympe.D.ea.ZERO):(this.C.repeat(a.$m()),a.next=this)}Ct(){this.C.clear();
348
- this.next=null}destroy(){this.vc.destroy();this.F=this.C=this.next=null}}m=Ab.prototype;m.Z.K=olympe.D.J.C;m.ax.K=new olympe.D.J(()=>olympe.D.ea);m.$m.K=new olympe.D.J(()=>olympe.D.ea);m.he.K=olympe.D.J.C;m.lx.K=olympe.D.J.C;m.yy.K=olympe.D.J.C;m.fy.K=olympe.D.J.C;m.Ct.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.O={Ea:'df.Logger'};olympe.U.config(a=>{E(a,olympe.D.Config.Np,Number.POSITIVE_INFINITY);C(a,olympe.D.O.Ea,[olympe.sa.O.xa],b=>b.Pc('df'))},'olympe.df');olympe.U.run([olympe.D.O.Ea],a=>{olympe.D.Hv(a)},'olympe.df');olympe.host={};const Bb=new Map,Cb=new Map;olympe.host.Rp=class{static register(a,b,...c){Bb.set(a,b);0<c.length&&Cb.set(a,c)}static create(a,b,c,d){const e=Bb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Cb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ma(d,f))):new e(b,c)}};function Db(a,b,c){a.N.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Rp.create(c,b,a.N,a.L))}function Eb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.N.L()<=olympe.sa.Qb.C.dg&&a.N.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.nb(f))b.push(a.C.get(f.dv)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ia();b.push((...k)=>{h.zb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
- function Fb(a){var b=olympe.host.da.Xc,c=olympe.host.da.Qp.ir;++a.G;const d=a.G;Db(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.nb(p)?(h.push(n),p=p.Na):olympe.D.Sf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Eb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
- {Eb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.xc(a.R.bind(a,d));a=L(e);a.dv=d;K(e,a);return a}olympe.host.va=class{constructor(a,b){this.N=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Za(){return this.N}R(a){this.N.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Kd=class{constructor(a){this.C=a;this.F=olympe.D.Ia()}G(){return this.C}R(){return this.C.Na.R()||this.F.R()}zb(){return this.C.Na.zb()}};olympe.host.Kd.prototype.G.K=new olympe.D.J(()=>olympe.host.da.Kd,[]);olympe.host.uk=class{};olympe.host.Bi=class{constructor(){}C(){}F(){}lj(){}};function Gb(a){return(a=a.find(b=>'authToken'===b.pa()))?a.getValue():null}olympe.host.Bi.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}pa(){return this.name}getValue(){return this.value}sb(a){return this.pa()===a.pa()&&this.getValue()===a.getValue()&&this.C===a.C}};function Hb(){const a={}.parameters;return new olympe.host.Bi.C(a?a.map(b=>new olympe.host.Bi.F(b.name,b.value,b.hidden)):[])}
351
- olympe.host.Bi.C=class{constructor(a){this.parameters=a}};function Ib(a,b,c){var d=olympe.host.Le;const e=c||olympe.W.hc(),f=new olympe.D.Zb('onTimeout context');d.C.aa(b,e,()=>{f.zb()||f.run(a);d.C.G(e)});return new olympe.host.Xc.G(d.C,e)}function Jb(a){var b=olympe.host.Le;a=a instanceof olympe.host.Xc.G?a.Z():a;b.C.G(a)}function Kb(a,b,c){var d=olympe.host.Le;const e=c||olympe.W.hc(),f=new olympe.D.Zb('onInterval context');d.C.Y(b,e,()=>{f.zb()?d.C.F(e):f.run(a)});return new olympe.host.Xc.F(d.C,e)}
352
- function Lb(a){var b=olympe.host.Le;a=a instanceof olympe.host.Xc.F?a.Z():a;b.C.F(a)}olympe.host.Xc=class{constructor(a){this.C=Fb(a)}};olympe.host.Xc.C=class{constructor(a,b){this.Le=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.Xc.L=class extends olympe.host.Xc.C{cancel(){this.Le.R(this.id)}};olympe.host.Xc.G=class extends olympe.host.Xc.C{cancel(){this.Le.G(this.id)}};olympe.host.Xc.F=class extends olympe.host.Xc.C{cancel(){this.Le.F(this.id)}};olympe.host.da={};olympe.host.da.Kd=class{destroy(){}};olympe.host.da.Kd.prototype.destroy=olympe.host.da.Kd.prototype.destroy;olympe.host.da.Qp={Gy:100,Iy:101,Hy:102,Ky:103,Jy:104,Fy:105,KA:201,IA:202,FA:204,NA:205,EA:206,HA:207,LA:208,OA:209,PA:210,QA:211,GA:212,MA:218,JA:219,RA:220,DA:221,CA:222,$A:300,aB:301,bB:302,fB:303,gB:304,hB:305,cB:310,dB:311,eB:312,jA:400,kA:401,lA:402,fA:450,Yz:500,Wz:501,aA:502,$z:503,Xz:504,Zz:505,AB:600,rB:601,vB:602,nB:603,oB:604,lB:605,qB:606,GB:607,yB:608,iB:609,mB:610,pB:611,xB:612,CB:613,jB:614,BB:615,wB:616,FB:617,sB:618,tB:619,uB:620,zB:630,kB:631,DB:632,EB:633,iC:700,MB:701,NB:702,
353
- OB:703,QB:704,RB:705,SB:706,PB:707,UB:708,TB:709,VB:710,ZB:711,gC:712,WB:713,XB:714,$B:715,aC:716,cC:717,dC:718,fC:719,bC:720,eC:721,hC:722,YB:723,jC:724,kC:725,ir:800};olympe.host.da.Xc=class{R(){}aa(){}G(){}Y(){}F(){}};olympe.host.O={Pq:'host.System',Il:'host.HistoryManager',Dq:'host.Scheduler',Ea:'host.platform.Logger',xa:'host.Manager'};olympe.host.Le=null;olympe.U.config(function(a){ta(a,olympe.host.O.Pq);ta(a,olympe.host.O.Il);C(a,olympe.host.O.Ea,[olympe.sa.O.xa],function(b){return b.Pc('host')});B(a,olympe.host.O.xa,olympe.host.va,olympe.host.O.Ea,olympe.U.O.cg);C(a,olympe.host.O.Dq,[olympe.host.O.xa],b=>{null===olympe.host.Le&&(olympe.host.Le=new olympe.host.Xc(b));return olympe.host.Le},!0)},'olympe.host');
354
- olympe.U.run([olympe.host.O.Dq],a=>a,'olympe.host.scheduler');olympe.U.run([olympe.host.O.xa],a=>a,'olympe.host');olympe.la={};olympe.la.fb={};olympe.la.fb.de={hm:'POST',GET:'GET',ot:'HEAD',ik:'PUT',Hc:'DELETE',bm:'OPTIONS',nA:'PATCH'};olympe.la.fb.ResponseType={vk:'text',pl:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.la.fb.Headers={Hj:'content-type',Ry:'content-length',pi:'authorization',us:'access-control-allow-origin'};olympe.la.fb.Sy={Oz:'text/html',JSON:'application/json',nC:'application/zip'};olympe.la.fb.rd={Bs:0,Kh:200,vl:201,zj:202,Ey:400,KB:401,et:403,hA:404,bA:405,Eq:500,Iu:503};function Mb(a){return a.host&&encodeURI(a.host)}function Nb(a){return encodeURI(a.path).replace(olympe.la.Ck.C,(b,c)=>'%'+c)}function Ob(a){return void 0===a.G?443===a.port:a.G}olympe.la.Ck=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Ob(this)?'wss':'ws'}://${Mb(this)}:${this.port}/${Nb(this)}`}toString(){return`${Mb(this)}:${this.port}/${Nb(this)}`}};
355
- olympe.la.Ck.C=/%25([0-9a-f]{2})/i;olympe.la.WebSocket=class{constructor(){}send(){}close(){}oa(){}ha(){}aa(){}};function Pb(a,b,c,d){a=olympe.W.Tx(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.la.Vj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.qs&&(c=a.qs.split(':'),2===c.length&&(c=olympe.W.bi().C(Da(`${c[0]}:${c[1]}`)),Qb(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
335
+ olympe.D.ds=function(a,b){if(yb(a))b(...a);else{const c=olympe.D.Ia();olympe.D.cf(a,(...d)=>{olympe.D.Ia().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.xn=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.nb(g)?(g=g.Na,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.hi(g)&&(g=g.Eb().Na,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Ed:b,jn:e,tg:f,Zx:!1,Cd:c})};
336
+ olympe.D.bD=function(a,b,c){const d=olympe.D.Ia();olympe.D.xn(a,(...e)=>{olympe.D.Ia().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.zC=function(a,b,c){a=new olympe.D.Rj(a,c);b(a);return a.Eb()};olympe.D.Nc=function(a,b='flowSource'){return new olympe.D.Rj(a,b)};olympe.D.eD=function(a,b,c,d){const e=olympe.D.Ia();olympe.D.cf(a,(...f)=>{olympe.D.Ia().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
+ olympe.D.Tk=function(a,b,c){olympe.D.Ga([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.EC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.mD=function(a){return olympe.D.Ia().C(a)};olympe.D.CC=function(a,b,c){olympe.D.Vv(a?a.Na:a,b,c)};
338
+ olympe.D.Vv=function(a,b,c){if(a){var d=a.Z();null===xb&&(xb={});if(xb[d])olympe.D.N.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{xb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.N.warn(e):olympe.D.N.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.N.log(f,'undefined'):null===g?olympe.D.N.log(f,'null'):olympe.D.N.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.N.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
+ ''))});c.onDestroy(()=>{delete xb[d]})}}else olympe.D.N.log('NOT starting node dump, node is '+String(a))};olympe.D.BC=function(){let a='',b=olympe.D.Ia();for(;null!==b;)a+=b.Tb()+' --\x3e ',b=b.getParent();olympe.D.N.log(a)};
340
+ olympe.D.za=function(a){if(void 0===a)return olympe.D.da.ZERO;if(a instanceof olympe.D.da)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.da.Pp;if(a===Math.PI)return olympe.D.da.PI;if(Infinity===a)return olympe.D.da.vt;if(-Infinity===a)return olympe.D.da.hu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Vh.has(a)||olympe.D.Vh.set(a,new olympe.D.da(a)),olympe.D.Vh.get(a)):new olympe.D.da(a)}return null};
341
+ olympe.D.ie=function(a){return void 0===a?olympe.D.Pd(olympe.D.da):olympe.D.Pd(olympe.D.da,olympe.D.Tf(a)?a:olympe.D.za(a))};olympe.D.Lx=olympe.D.da.animate;olympe.D.WC=function(a,b){return new olympe.D.zs(a,b)};olympe.D.Cb=function(a){if(a instanceof olympe.D.Xa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Ek.has(a)?olympe.D.Ek.get(a):new olympe.D.Xa(a)};
342
+ olympe.D.ZC=function(a){return void 0===a?olympe.D.Pd(olympe.D.Xa):olympe.D.Pd(olympe.D.Xa,olympe.D.Tf(a)?a:olympe.D.Cb(a))};olympe.D.Bc=function(a){return a instanceof olympe.D.ra?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ra.F:olympe.D.ra.C};olympe.D.Wx=function(a){return void 0===a?olympe.D.Pd(olympe.D.ra):olympe.D.Pd(olympe.D.ra,olympe.D.Tf(a)?a:olympe.D.Bc(a))};olympe.D.Mx=function(a){if(a instanceof Date)return new olympe.D.kb(a)};
343
+ olympe.D.YC=function(a){return olympe.D.Pd(olympe.D.kb,void 0!==a?new olympe.D.kb(a):null)};olympe.D.Xr=a=>a instanceof olympe.D.ra||a instanceof olympe.D.da||a instanceof olympe.D.Xa||a instanceof olympe.D.kb;olympe.D.$C=function(a,b){return olympe.D.Pd(olympe.D.kc,void 0===a&&void 0===b?void 0:new olympe.D.kc(a,b))};olympe.D.Vx=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Pd(olympe.D.Color,e)};olympe.D.XC=olympe.D.Vx;
344
+ olympe.D.Lv=function(a){olympe.D.N=a;olympe.D.Zh=olympe.D.zg()};olympe.D.zg=function(){olympe.D.yn||(olympe.D.yn=new olympe.D.Eq);return olympe.D.yn};olympe.D.Ia=function(){olympe.D.Zh||(olympe.D.Zh=olympe.D.zg());return olympe.D.Zh};olympe.D.ms=function(a){const b=olympe.D.Zh;olympe.D.pn(a)&&(olympe.D.Zh=a);return b||null};
345
+ olympe.D.mc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.kb.mc(a);break;case 'number':b=olympe.D.da.mc(a);break;case 'string':b=olympe.D.Xa.mc(a);break;case 'vector2':b=olympe.D.kc.mc(a);break;case 'color':b=olympe.D.Color.mc(a);break;case 'boolean':b=olympe.D.ra.mc(a)}return b}return null};function zb(a){a.C.zb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.R.clear(),a.Y.length=0,a.L.length=0)}
346
+ olympe.D.aB=class{constructor(){this.C=new olympe.D.Zb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Nc(Ab,'Last slot manager entry');this.size=qb(olympe.D.Nc(olympe.D.da,'SlotManager size').repeat(this.F.Eb().an()),olympe.D.da.ZERO);this.R=qb(olympe.D.Nc(olympe.D.da,'last valid slots'),olympe.D.za(-1))});this.Y=[];this.L=[];this.C.onDestroy(()=>{zb(this)})}};
347
+ class Ab{constructor(a,b,c,d){this.id=a;this.vc=new olympe.D.Zb('Slot manager entry');this.G=c;this.L=d;this.vc.run(()=>{const e=qb(olympe.D.Nc(olympe.D.da),olympe.D.da.ZERO);olympe.D.nb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Nc(olympe.D.da);this.F=this.C.Eb().je(e.Eb())});this.next=null}Z(){return this.id}ex(){return this.C.Eb()}an(){return this.F}he(){return this.G}px(){return this.L}Ay(a){this.G=a}hy(a){null===a?this.C.update(olympe.D.da.ZERO):(this.C.repeat(a.an()),a.next=this)}Gt(){this.C.clear();
348
+ this.next=null}destroy(){this.vc.destroy();this.F=this.C=this.next=null}}m=Ab.prototype;m.Z.K=olympe.D.J.C;m.ex.K=new olympe.D.J(()=>olympe.D.da);m.an.K=new olympe.D.J(()=>olympe.D.da);m.he.K=olympe.D.J.C;m.px.K=olympe.D.J.C;m.Ay.K=olympe.D.J.C;m.hy.K=olympe.D.J.C;m.Gt.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.O={Ea:'df.Logger'};olympe.U.config(a=>{E(a,olympe.D.Config.Qp,Number.POSITIVE_INFINITY);C(a,olympe.D.O.Ea,[olympe.sa.O.xa],b=>b.Qc('df'))},'olympe.df');olympe.U.run([olympe.D.O.Ea],a=>{olympe.D.Lv(a)},'olympe.df');olympe.host={};const Bb=new Map,Cb=new Map;olympe.host.Up=class{static register(a,b,...c){Bb.set(a,b);0<c.length&&Cb.set(a,c)}static create(a,b,c,d){const e=Bb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Cb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ma(d,f))):new e(b,c)}};function Db(a,b,c){a.N.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Up.create(c,b,a.N,a.L))}function Eb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.N.L()<=olympe.sa.Qb.C.dg&&a.N.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.nb(f))b.push(a.C.get(f.hv)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ia();b.push((...k)=>{h.zb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
+ function Fb(a){var b=olympe.host.ba.Yc,c=olympe.host.ba.Tp.lr;++a.G;const d=a.G;Db(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.nb(p)?(h.push(n),p=p.Na):olympe.D.Sf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Eb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
+ {Eb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.xc(a.R.bind(a,d));a=L(e);a.hv=d;K(e,a);return a}olympe.host.ta=class{constructor(a,b){this.N=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Ya(){return this.N}R(a){this.N.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Kd=class{constructor(a){this.C=a;this.F=olympe.D.Ia()}G(){return this.C}R(){return this.C.Na.R()||this.F.R()}zb(){return this.C.Na.zb()}};olympe.host.Kd.prototype.G.K=new olympe.D.J(()=>olympe.host.ba.Kd,[]);olympe.host.uk=class{};olympe.host.Bi=class{constructor(){}C(){}F(){}lj(){}};function Gb(a){return(a=a.find(b=>'authToken'===b.na()))?a.getValue():null}olympe.host.Bi.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}na(){return this.name}getValue(){return this.value}sb(a){return this.na()===a.na()&&this.getValue()===a.getValue()&&this.C===a.C}};function Hb(){const a={}.parameters;return new olympe.host.Bi.C(a?a.map(b=>new olympe.host.Bi.F(b.name,b.value,b.hidden)):[])}
351
+ olympe.host.Bi.C=class{constructor(a){this.parameters=a}un(a){const b=new Map(this.parameters.map((c,d)=>[c.na(),d]));a.parameters.forEach(c=>{b.has(c.na())?this.parameters[b.get(c.na())]=c:this.parameters.push(c)})}};function Ib(a,b,c){var d=olympe.host.Le;const e=c||olympe.W.fc(),f=new olympe.D.Zb('onTimeout context');d.C.ea(b,e,()=>{f.zb()||f.run(a);d.C.G(e)});return new olympe.host.Yc.G(d.C,e)}function Jb(a){var b=olympe.host.Le;a=a instanceof olympe.host.Yc.G?a.Z():a;b.C.G(a)}function Kb(a,b,c){var d=olympe.host.Le;const e=c||olympe.W.fc(),f=new olympe.D.Zb('onInterval context');d.C.Y(b,e,()=>{f.zb()?d.C.F(e):f.run(a)});return new olympe.host.Yc.F(d.C,e)}
352
+ function Lb(a){var b=olympe.host.Le;a=a instanceof olympe.host.Yc.F?a.Z():a;b.C.F(a)}olympe.host.Yc=class{constructor(a){this.C=Fb(a)}};olympe.host.Yc.C=class{constructor(a,b){this.Le=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.Yc.L=class extends olympe.host.Yc.C{cancel(){this.Le.R(this.id)}};olympe.host.Yc.G=class extends olympe.host.Yc.C{cancel(){this.Le.G(this.id)}};olympe.host.Yc.F=class extends olympe.host.Yc.C{cancel(){this.Le.F(this.id)}};olympe.host.ba={};olympe.host.ba.Kd=class{destroy(){}};olympe.host.ba.Kd.prototype.destroy=olympe.host.ba.Kd.prototype.destroy;olympe.host.ba.Tp={Ly:100,Ny:101,My:102,Py:103,Oy:104,Ky:105,OA:201,MA:202,JA:204,RA:205,IA:206,LA:207,PA:208,SA:209,TA:210,UA:211,KA:212,QA:218,NA:219,VA:220,HA:221,GA:222,dB:300,eB:301,fB:302,jB:303,kB:304,lB:305,gB:310,hB:311,iB:312,oA:400,pA:401,qA:402,kA:450,cA:500,aA:501,fA:502,eA:503,bA:504,dA:505,EB:600,vB:601,zB:602,rB:603,sB:604,pB:605,uB:606,KB:607,CB:608,mB:609,qB:610,tB:611,BB:612,GB:613,nB:614,FB:615,AB:616,JB:617,wB:618,xB:619,yB:620,DB:630,oB:631,HB:632,IB:633,mC:700,QB:701,RB:702,
353
+ SB:703,UB:704,VB:705,WB:706,TB:707,YB:708,XB:709,ZB:710,cC:711,kC:712,$B:713,aC:714,dC:715,eC:716,gC:717,hC:718,jC:719,fC:720,iC:721,lC:722,bC:723,nC:724,oC:725,lr:800};olympe.host.ba.Yc=class{R(){}ea(){}G(){}Y(){}F(){}};olympe.host.O={Sq:'host.System',Il:'host.HistoryManager',Gq:'host.Scheduler',Ea:'host.platform.Logger',xa:'host.Manager'};olympe.host.Le=null;olympe.U.config(function(a){ta(a,olympe.host.O.Sq);ta(a,olympe.host.O.Il);C(a,olympe.host.O.Ea,[olympe.sa.O.xa],function(b){return b.Qc('host')});B(a,olympe.host.O.xa,olympe.host.ta,olympe.host.O.Ea,olympe.U.O.cg);C(a,olympe.host.O.Gq,[olympe.host.O.xa],b=>{null===olympe.host.Le&&(olympe.host.Le=new olympe.host.Yc(b));return olympe.host.Le},!0)},'olympe.host');
354
+ olympe.U.run([olympe.host.O.Gq],a=>a,'olympe.host.scheduler');olympe.U.run([olympe.host.O.xa],a=>a,'olympe.host');olympe.la={};olympe.la.fb={};olympe.la.fb.ce={hm:'POST',GET:'GET',st:'HEAD',ik:'PUT',Hc:'DELETE',bm:'OPTIONS',sA:'PATCH'};olympe.la.fb.ResponseType={vk:'text',pl:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.la.fb.Headers={Hj:'content-type',Wy:'content-length',pi:'authorization',ys:'access-control-allow-origin'};olympe.la.fb.Xy={Tz:'text/html',JSON:'application/json',rC:'application/zip'};olympe.la.fb.qd={Fs:0,Kh:200,vl:201,zj:202,Jy:400,OB:401,it:403,mA:404,gA:405,Hq:500,Mu:503};function Mb(a){return a.host&&encodeURI(a.host)}function Nb(a){return encodeURI(a.path).replace(olympe.la.Ck.C,(b,c)=>'%'+c)}function Ob(a){return void 0===a.G?443===a.port:a.G}olympe.la.Ck=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Ob(this)?'wss':'ws'}://${Mb(this)}:${this.port}/${Nb(this)}`}toString(){return`${Mb(this)}:${this.port}/${Nb(this)}`}};
355
+ olympe.la.Ck.C=/%25([0-9a-f]{2})/i;olympe.la.WebSocket=class{send(){}close(){}qa(){}ka(){}ea(){}};function Pb(a,b,c,d){a=olympe.W.Xx(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.la.Vj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.us&&(c=a.us.split(':'),2===c.length&&(c=olympe.W.bi().C(Da(`${c[0]}:${c[1]}`)),Qb(b,{Authorization:`Basic ${c}`})));return b}function Rb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
356
356
  function Qb(a,b){for(let c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a.headers[c]=b[c])}
357
- olympe.la.Vj=class extends olympe.la.Ck{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.la.fb.de.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.la.fb.ResponseType.vk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}ej(){return this.headers}setHeader(a,b){this.headers[a]=b}C(){let a=Rb(this);a=a?`?${a}`:'';return Mb(this)?`${Ob(this)?'https':'http'}://${Mb(this)}:${this.port}/${Nb(this)}${a}`:`${Nb(this)}${a}`}toString(){return this.C()}};
358
- olympe.la.Vj.de={hm:'POST',GET:'GET',ot:'HEAD',ik:'PUT',Hc:'DELETE',bm:'OPTIONS'};olympe.la.Sg=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Ud(){return this.status}ej(){return this.headers}getHeader(a){return this.headers[a]}};function Sb(a,b,c){const d=olympe.D.Ia(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.C(f=>{d.Ie(e);a.F().C.delete(b);c(f)})}olympe.la.va=class{constructor(a){this.N=a;this.G=1;a='Initializing NET layer';this.N.G()&&(a+=' (implementation: '+this.Y()+')');this.N.info(a);this.N.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}ha(){}C(){}L(){}R(){}Y(){}};function Tb(a){return!(!a.client||!a.client.connected)}function Ub(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.N.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Vb(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}
359
- olympe.la.dk=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.N=olympe.sa.Za('MQTT')}connect(a){if(Tb(this))return a&&a(),this;a&&this.F.push(a);null===this.client&&(this.client=mqtt.connect(this.url,this.G),this.client.on(olympe.la.dk.C.cu,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.N.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.la.dk.C.Gs,()=>this.F.forEach(b=>b())));return this}publish(a,b,c,d){this.connect();
360
- this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.N.error('Failed to publish a message '+b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.la.dk.C={Gs:'connect',cu:'message',Oy:'close',dz:'end'};olympe.la.Bk=class{constructor(a){this.N=a}aa(){this.N.error('Try to set cors policies on a web server with the browser implementation.');return this}L(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.la.O={xa:'net.Manager',Ea:'net.Logger',ym:'net.WebServer'};olympe.la.Config={Jl:'net.httpHost',Kl:'net.httpPort'};olympe.U.config(function(a){E(a,olympe.la.Config.Jl,'localhost');E(a,olympe.la.Config.Kl,3141);ta(a,olympe.la.O.xa);C(a,olympe.la.O.Ea,[olympe.sa.O.xa],function(b){return b.Pc('net')});B(a,olympe.la.O.ym,olympe.la.Bk,olympe.la.O.Ea)},'olympe.net');olympe.async={};function Wb(a,b){0<=b&&(a.timeout=b)}function Xb(a,b){a.L||a.td.push(a.G.C(b))}
361
- olympe.async.Fo=class{constructor(a,b=void 0===a){this.C=[];this.td=[];this.G=a||new olympe.D.Zb('Async executor context');this.oa=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.L=this.R=!1;this.N=null;this.Y=this.timeout=0}Za(){return this.N}add(a){this.L||this.C.push(this.G.C(a));return this}start(){this.R||(this.N&&this.N.log('Executor started.'),this.R=!0,0<this.timeout&&(this.Y=setTimeout(()=>{this.F='Timeout expired.';this.Y=0;this.complete(!1)},this.timeout)))}clear(){this.C=
362
- [];this.td=[];this.env.clear();this.oa&&this.G.destroy()}complete(a){if(!this.L){this.L=!0;this.Y&&(clearTimeout(this.Y),this.Y=0);this.N&&this.N.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.td)b(a,a?null:this.F,this.env);this.clear()}}};
363
- function Yb(a){if(0<a.C.length){const b=a.C.shift();a.N&&a.N.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{Yb(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.sk=class extends olympe.async.Fo{static create(){return new olympe.async.sk(new olympe.D.Zb('SequencedExecutor'),!0)}start(){this.R||(super.start(),Yb(this))}};
364
- olympe.async.ng=class extends olympe.async.Fo{constructor(a,b){super(a,b);this.aa=0;this.ha=!0}static create(){return new olympe.async.ng(new olympe.D.Zb('ParallelExecutor'),!0)}run(a){this.N&&this.N.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ha=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.R&&!this.L&&(this.aa++,this.run(a));return this}done(){this.aa--;0>=this.aa&&this.complete(this.ha)}start(){if(!this.R)if(super.start(),0<
365
- this.C.length){this.aa=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.ic={};olympe.ic.St=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.ic.Rt=class{constructor(){}C(){}};olympe.ic.Storage=class{open(){}F(){}R(){}write(){}G(){}L(){}C(){}close(){}};function Zb(a,b,c){a.storage.F(c)}function $b(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function ac(a,b){a.storage.G(b)}function bc(a,b){a.storage.C(b)}function cc(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function dc(a,b){a.storage.R(b)}olympe.ic.Ts=class{constructor(a){this.storage=a}};olympe.ic.O={$j:'localStorage.KeyValueManager',Ni:'localStorage.Storage',oo:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.U.config(function(a){ta(a,olympe.ic.O.$j);C(a,olympe.ic.O.Ea,[olympe.sa.O.xa],function(b){return b.Pc('localstorage')});B(a,olympe.ic.O.oo,olympe.ic.Ts,olympe.ic.O.Ni)},'olympe.localstorage');olympe.auth={};olympe.auth.Qu=class{R(){}L(){}Ta(){}aa(){}ii(){}oh(){}Mr(){}};function ec(a){a.N.info('Initializing AUTH layer');let b=a.cc;if(a.ha){const c=a.ha.C(),d=Gb(c.parameters);b=d||b;d&&a.ha.F(c.parameters.filter(e=>'authToken'!==e.pa()))}b&&a.storage&&fc(a.storage,b,c=>{!c&&a.N.error('Could not store authToken')});a.N.debug('Asking to be notified when auth connector gets online');a.F.R(()=>{if(a.bb)if(a.L=olympe.auth.va.G.ss,a.N.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Y){const c=new olympe.auth.Request;c.set('username',
366
- a.Y);c.yn(a.cb);a.N.log('Autologin with user "'+a.Y+'"');gc(a,c)}else a.N.error('autoLogin: auto user not specified.'),hc(a);else a.L=olympe.auth.va.G.wk,a.N.log('Connector online, attempting to log with token'),ic(a)});a.F.L(()=>{switch(olympe.D.Ya(a.G)){case olympe.auth.va.C.Lg:a.N.warn('Disconnected from server - session of user '+olympe.D.Ya(a.C.Eb()).Vd()+' lost');break;case olympe.auth.va.C.Dh:a.N.warn('Disconnected from server - guest session lost');break;case olympe.auth.va.C.ni:a.N.warn('Disconnected from server - authentication aborted');
367
- break;case olympe.auth.va.C.INIT:a.N.warn('Cannot open auth session - no server connection');break;default:a.N.error('Should not get there, investigate')}jc(a,olympe.auth.va.C.gf)});a.F.Ta((c,d)=>{if(c===olympe.auth.va.F.zj)a.N.info('Authentication revoked'),hc(a),a.storage&&kc(a.storage),a.oa.forEach(e=>{e(c,d)});else if(c===olympe.auth.va.F.gp)a.N.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&kc(a.storage),a.Ta.F();else throw Error(`Unknown logout step coming from server : ${c}`);
368
- });a.N.log('DONE initializing AUTH layer (waiting for connector to be online)')}
369
- function ic(a){null!==a.storage?(a.N.debug('Retrieving token from local storage'),a.storage.hd(b=>{if(b){const d=new olympe.auth.Request;var c=b.Vd();d.set('username',c);b=b.Jf();d.set('nonce',b);a.N.debug('Token found, trying login with',d);gc(a,d,a.Tb)}else a.N.debug('No token found, cannot perform auto login. Falling back in GUEST state'),hc(a)})):(a.N.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),hc(a))}
370
- function jc(a,b){a.N.log('State change: ',lc(a),'--\x3e',b);a.G.update(b)}function hc(a){a.C.update(a.Fa);jc(a,olympe.auth.va.C.Dh);a.N.info('Authenticated as guest')}function lc(a){return olympe.D.Ya(a.G.Eb())}function mc(a){const b=olympe.auth.va.C.Lg,c=olympe.auth.va.C.Dh,d=olympe.auth.va.C.ni,e=olympe.D.Mc(olympe.D.ra,'auth.isOnline');olympe.D.yc([a.G],f=>{e.update(olympe.D.Bc(f===b||f===c||f===d))},'Router is online');return e.Eb()}
371
- function nc(a){var b=olympe.public.Ua.get(),c='logoutCallback';void 0===c&&(c=olympe.W.xg());b.oa.set(c,a)}function oc(a){return a.C.Eb().Jf()}function pc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.N.error(b);a.error.update(olympe.D.Cb(b));jc(a,olympe.auth.va.C.rc);if(d)throw Error(b);}
372
- function gc(a,b,c,d){void 0===c&&(c=a.Ab);void 0===c&&pc(a,'No authentication provider specified',null,!0);const e=a.Hb.get(c);e||pc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.R.set('login',d);a.N.log('Sending authentication request using "'+c+'" for '+b);e.hd(b,a.Pb.bind(a));jc(a,olympe.auth.va.C.ni)}function qc(a,b,c){a.R.forEach(d=>{d(b,c)})}
373
- olympe.auth.va=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.N=a;this.F=b;this.storage=c;this.Ta=d;this.ha=e;this.Ab=g;this.Tb=h;this.bb=void 0===k?!0:k;this.Y=l;this.cb=n;this.cc=p;this.Hb=new Map;this.G=olympe.D.Mc(String).update(olympe.auth.va.C.INIT);this.error=olympe.D.Mc(olympe.D.Xa);this.L=null;this.Fa=new olympe.auth.tf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Mc(olympe.auth.tf).update(this.Fa);this.R=new Map;this.oa=new Map;f.forEach(q=>{const r=
374
- q.pa();if(this.Hb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Hb.set(r,q)});ec(this)}getState(){return this.G.Eb()}aa(){return this.error.Eb()}Vd(){return this.C.Eb().Vd()}Cg(){return this.C.Eb().Cg()}ci(){return this.C.Eb().ci()}oh(a,b){this.F.oh(a,olympe.D.Ya(oc(this)),b)}sn(){this.N.debug('Sending logout');kc(this.storage);this.F.aa(a=>{a?pc(this,'Logout request rejected:',a):this.N.debug('Logout request acknowledged')})}ii(){lc(this)===olympe.auth.va.C.Lg&&this.F.ii(a=>
375
- {a&&this.N.error('Was not able to send the auth keep alive message:',a.message)})}Pb(a,b){const c=null===this.L?olympe.auth.va.G.$t:this.L;this.L=null;a?(this.N.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),kc(this.storage),this.error.update(olympe.D.Cb(a.message)),hc(this),qc(this,a,c)):(this.N.info('User '+b.Vd()+' (#'+b.Cg()+') successfully authenticated'),this.C.update(b),jc(this,olympe.auth.va.C.Lg),qc(this,a,c),this.storage&&fc(this.storage,b));this.R.has('login')&&
376
- this.R.delete('login')}};olympe.auth.va.C={INIT:'init',gf:'disconnected',Dh:'guest',ni:'authenticating',rc:'error',Lg:'authenticated'};olympe.auth.va.G={$t:'manual',ss:'auto',wk:'tokenOnFirstConnection'};olympe.auth.va.F={zj:'accepted',gp:'redirect'};olympe.auth.Ki=class{pa(){}hd(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.yc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.xf&&(a=a.Na.Ib);return a?a.valueOf():a}Vd(){return this.get('username')}yn(a){this.set('password',a)}Jf(){return this.get('nonce')}toString(){return this.Vd()+(this.Jf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.tf=class{constructor(a,b,c,d={}){this.user=a;this.yj=b;this.F=c;this.G=d}Vd(){return this.user}Cg(){return this.yj}Jf(){return this.F}Yj(){return this.G}ci(){return null}ja(){var a=olympe.W,b=a.vr;var c=JSON.stringify({user:this.user,userTag:this.yj,nonce:this.F,payload:this.G});c=olympe.W.bi().C(Da(c));return b.call(a,c)}};m=olympe.auth.tf.prototype;m.Vd.K=new olympe.D.J(()=>String,[]);m.Cg.K=new olympe.D.J(()=>String,[]);m.Jf.K=new olympe.D.J(()=>String,[]);
377
- m.Yj.K=new olympe.D.J(()=>Object,[]);m.ci.K=new olympe.D.J(()=>String,[]);m.ja.K=new olympe.D.J(()=>String,[]);olympe.auth.fm=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d)}ci(){return this.Yj().access_token||null}};olympe.auth.Cq=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}ci(){return this.C}ja(){var a=olympe.W.bi(),b={user:this.Vd(),userTag:this.Cg(),nonce:this.Jf(),payload:this.Yj(),fullToken:this.C},c=olympe.W,d=c.vr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};function fc(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ja(),e=>{d.close();c&&c(e)})}function kc(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
378
- olympe.auth.um=class{constructor(a,b,c){this.C=a;this.N=b;this.key='OlympeToken-'+c.C}hd(a){const b=this.C.C('AUTH');this.N.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.N.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Ea(olympe.W.bi().R(olympe.W.yv(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Cq(h.user,h.userTag,h.nonce,h.payload);k.C=h.fullToken;d=k}else d=h.payload&&
379
- h.payload.id_token?new olympe.auth.fm(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.tf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.N.error('Error while unserializing token: ',h.message)}else this.N.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.um.F='OlympeToken';olympe.auth.um.C='AUTH';olympe.auth.pk=class{redirect(){}F(){}C(){}};olympe.auth.pk.C={GET:'GET',hm:'POST'};olympe.auth.nl=class{constructor(a){this.C=a||'default'}};olympe.auth.Hb={};olympe.auth.Hb.qa={};olympe.auth.Hb.qa.Fi=class{Y(){}};olympe.auth.Hb.qa.Re=class{ha(){}};olympe.auth.Hb.qa.Ee=class{oa(){}Fa(){}};function rc(a,b){return olympe.W.ob(b+'-olympe-'+a.C[b])}olympe.auth.Hb.Ei=class{constructor(a){this.C=a}pa(){return'local'}hd(a,b){const c=a.Vd();if(c){const d=a.get('password'),e=a.Jf();a.C.delete('password');if(void 0!==e&&rc(this,c)===e){b(null,new olympe.auth.tf(c,'',rc(this,c)));return}a=olympe.W.ob(d||'');if(this.C[c]===a){b(null,new olympe.auth.tf(c,'',rc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Hb.Ei.C='local';olympe.auth.Hb.Ei.ma=[olympe.auth.Ki];olympe.auth.Hb.Fi=class{constructor(a,b){this.C=a;this.storage=b}pa(){return'localToken'}hd(a,b){this.storage.hd(c=>{this.C.Y(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Hb.Fi.C='localToken';olympe.auth.Hb.Fi.ma=[olympe.auth.Ki];olympe.auth.Hb.em=class{constructor(a,b){this.C=a;this.F=b}pa(){return'openID'}hd(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.pk.C.GET)}};olympe.auth.Hb.em.C='openID';olympe.auth.Hb.em.ma=[olympe.auth.Ki];olympe.auth.Hb.Re=class{constructor(a,b){this.F=a;this.C=b}pa(){return'saml'}hd(a,b){this.F.ha(c=>{c?b(c):this.C.F()})}};olympe.auth.Hb.Re.C='saml';olympe.auth.Hb.Re.ma=[olympe.auth.Ki];olympe.auth.Hb.Ee=class{static $i(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.N=olympe.sa.Za('auth')}pa(){return'srp'}hd(a,b){const c=a.get('password');a.C.delete('password');this.N.debug('Sending SRP request');this.C.oa(a,(d,e,f)=>{this.N.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Vd(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
380
- return}this.N.debug('Sending SRP A+M (proof) message');this.C.Fa(a,b)}})}};olympe.auth.Hb.Ee.C='srp';olympe.auth.Hb.Ee.ma=[olympe.auth.Ki];olympe.auth.O={xa:'auth.Manager',Ea:'auth.Logger',Ni:'auth.Storage',Aj:'auth.appNameToken',kk:'auth.Redirector'};olympe.auth.xd={xa:'auth.ManagerConnector',Bp:'auth.LocalTokenConnector',Ee:'auth.SRPConnector',Re:'auth.SAMLConnector'};olympe.auth.Config={zl:'auth.defaultProvider',Cp:'auth.localTokenProvider',Hn:'auth.autoLogin',Ln:'auth.autoUser',In:'auth.autoPassword',wk:'auth.token',Fn:'auth.appToken'};
381
- olympe.U.config(function(a){E(a,olympe.auth.Config.zl,'srp');E(a,olympe.auth.Config.Cp,'localToken');E(a,olympe.auth.Config.Hn,!1);E(a,olympe.auth.Config.Ln,'');E(a,olympe.auth.Config.In,'');E(a,olympe.auth.Config.wk,'');E(a,olympe.auth.Config.Fn,'default');C(a,olympe.auth.O.Ea,[olympe.sa.O.xa],b=>b.Pc('auth'));B(a,olympe.auth.O.Aj,olympe.auth.nl,new olympe.U.fa(olympe.auth.Config.Fn));B(a,olympe.auth.O.Ni,olympe.auth.um,olympe.ic.O.$j,olympe.auth.O.Ea,olympe.auth.O.Aj);ta(a,olympe.auth.xd.xa);ta(a,
382
- olympe.auth.O.kk);C(a,olympe.auth.O.xa,[olympe.auth.O.Ea,olympe.auth.xd.xa,olympe.host.O.Il,new olympe.U.Bb(olympe.auth.O.Ni,olympe.U.ff.C.Jh),new olympe.U.fa(olympe.auth.Config.zl),new olympe.U.fa(olympe.auth.Config.Cp),new olympe.U.fa(olympe.auth.Config.Hn),new olympe.U.fa(olympe.auth.Config.Ln),new olympe.U.fa(olympe.auth.Config.In),new olympe.U.fa(olympe.auth.Config.wk),new olympe.U.Bb(olympe.auth.O.kk,olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.xd.Bp,olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.xd.Ee,
383
- olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.xd.Re,olympe.U.ff.C.Jh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const v=[];q&&v.push(new olympe.auth.Hb.Fi(q,e));r&&v.push(new olympe.auth.Hb.Ee(r));t&&p&&v.push(new olympe.auth.Hb.Re(t,p));p&&c&&v.push(new olympe.auth.Hb.em(p,c.Mr()));if(0===v.length)throw Error('At least one provider is needed for auth to start');if(!v.map(u=>u.pa()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.zl+'cannot be found');return new olympe.auth.va(b,
384
- c,e,p,d.lj()?d:null,v,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.U.run([olympe.auth.O.xa],a=>{olympe.auth.Sc=()=>a});olympe.dc={};olympe.dc.Aa={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.Aa);olympe.dc.jc={Vc:'ff022000000000000000',ui:'ff02200000000000000e',bo:'ff02200000000000000f'};olympe.dc.bc={VERSION:'@v',Nd:'@s'};olympe.dc.Tg={qc:'?'};olympe.dc.tk={Vp:'online',$l:'offline',ut:'invalidate'};olympe.dc.Ka={rb:'self',Wc:'server',eq:'peer',qc:'server'};olympe.dc.wa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Ya(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.T?b=a.T():'function'===typeof a&&(b=olympe.dc.Ca.Wb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.wa);olympe.dc.Pa=function(){return olympe.dc.Dd().view};olympe.dc.register=function(a,b){olympe.dc.Ca.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.ua.Property(a)};
385
- olympe.dc.ih=function(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Aa.DESTINATION){const e=olympe.dc.Aa.DESTINATION;return b===olympe.dc.Aa.ORIGIN||b===e?new olympe.dc.ua.Relation(a,b):new olympe.dc.ua.Relation(a,d,b,c)};olympe.dc.Kv=function(a){return a.Rc()};olympe.dc.eh=class{F(){}pc(){}Lc(){}Oa(){}Jb(){}};olympe.dc.jm=class{Zc(){}Z(){}G(){}};function sc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ka.Sh,{file:b,url:null,content:c,Ze:e?h=>{tc(a,b,c);f(h)}:f,mimeType:d,ue:g||null},[olympe.dc.Pa().source(b)||olympe.dc.Ka.Wc]);a.F.send(d)}function uc(a,b,c,d,e,f){c=c instanceof olympe.D.Xa?c.valueOf():c;'string'===typeof c?c=new Blob([Da(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));sc(a,b,c,d,a.G,e,f)}
386
- function tc(a,b,c){const d=olympe.dc.wa(b);a.C.set(d,c);const e=olympe.W.xg();vc(olympe.dc.Pa(),d,f=>{f||(a.C.delete(d),wc(olympe.dc.Pa(),d,e))},e)}function xc(a,b,c,d){olympe.D.bs([b.Tr(),b.T(),b.Ql(),b.dn()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ka.Ah,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ze:a.G?k=>{tc(a,f,k);c(k)}:c,ue:d},[olympe.dc.Pa().source(f)||olympe.dc.Ka.Wc]),a.F.send(e))})}
387
- olympe.dc.ht=class{constructor(a,b,c,d,e){this.N=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.va=class{constructor(a){this.N=a}};function yc(a,b){a.F=b;return a}function M(a,b){a.G.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.G=[];this.F=olympe.D.Ia()}validate(a=null){this.G.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Kr(olympe.dc.ga.ka,this.type);return a?a:'UNKNOWN_MESSAGE'}};
388
- olympe.dc.ga.ka={rc:1,nf:2,Rg:10,Mz:11,Lu:20,VA:21,WA:22,Nu:23,xi:24,wi:25,Nz:26,To:28,mm:30,om:31,uu:32,bh:40,xk:41,Og:45,Fj:46,Pj:47,Sh:50,Ah:51,ti:52,$u:60,Au:61,jt:62,kt:63,Es:64,Sn:65,Lz:90,yl:91,Hl:92,Uo:93,xp:94,ek:95,Mu:96,QUERY_RESULT:97,nm:98};olympe.dc.og=class{process(){}};olympe.dc.km=class{constructor(...a){this.Xb=a}process(a,b,c){const d=this.Xb.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Xb[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.km.ma=[olympe.dc.og];olympe.dc.Ec=class{constructor(a){this.tag='string'===typeof a?a:a.T()}T(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}sb(a){return a instanceof olympe.dc.Ec&&this.tag===a.tag}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Ec(b.tag)}};olympe.dc.Ec.ma=[olympe.dc.ze];olympe.dc.Ec.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Ec.prototype.sb.K=olympe.D.J.C;olympe.dc.pg=class{send(){}C(){}oa(){}};const zc=olympe.dc.Aa.ORIGIN,Ac=olympe.dc.Aa.DESTINATION,Bc=new Map,Cc=new Map,Dc=new Map,Ec=new Map;function Fc(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.An||[])];return olympe.dc.Ca.C(a,b,...c)}function Gc(a,b){Ec.set(a,b);return a}function Hc(a){return(a=Bc.get(a))&&a.C||olympe.dc.CloudObject}function Ic(a,b,c){const d=a+'@'+(b===Ac?zc:Ac);if(Cc.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Cc.set(d,c)}
389
- function Jc(a){a=a.T()+'@'+a.Qa();return Cc.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Dc.set(a,b)}function O(a){return a.NAME||null}
390
- olympe.dc.Ca=class{constructor(){}static C(a,b,...c){if(Bc.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${Bc.get(a).C.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.U.Bb(g):g}}b=new olympe.dc.ua.Entry(a,b,d);Bc.set(a,b);return b.C.entry=b}static Wb(a){return(a=a.entry)&&a.T()||null}};olympe.dc.ua={};function P(a,b){b=b.Rc();Ic(b.T(),b.Qa(),a.C);return b}function Kc(a){a.F=!0;return a}
391
- olympe.dc.ua.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.An=c||null;this.F=!1}T(){return this.tag}instantiate(a,b){const c=this.C;if(this.ij()&&b.getParameter(olympe.dc.Config.Ao)){var d=olympe.dc.Pa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.T()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.sa.Za('dc').error(d)}return this.An?(a=[void 0,a].concat(na(b,this.An)),new c(...a)):new c(void 0,
392
- a)}Da(a){return new olympe.dc.ua.Property(a)}Ra(a,b=olympe.dc.Aa.DESTINATION){Ic(a,b,this.C);return new olympe.dc.X.Sb(a,b)}ij(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.ua.Entry);olympe.dc.ua.Entry.prototype.addRelation=olympe.dc.ua.Entry.prototype.Ra;olympe.dc.ua.Entry.prototype.addProperty=olympe.dc.ua.Entry.prototype.Da;olympe.dc.ua.Entry.ma=[olympe.dc.ze];olympe.dc.ua.Property=class{constructor(a){this.tag=a}T(){return this.tag}};olympe.dc.ua.Property.ma=[olympe.dc.ze];olympe.dc.ua.Relation=class{constructor(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.wa(a);this.direction=b;this.origin=c;this.destination=d}T(){return this.tag}Qa(){return this.direction}type(){return this.destination}Rc(){return new olympe.dc.ua.Relation(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION,this.destination,this.origin)}sb(a){return a instanceof olympe.dc.ua.Relation?a.T()===this.T()&&
393
- a.Qa()===this.Qa():!1}toString(){return this.direction+this.tag}};olympe.dc.ua.Relation.prototype.getInverse=olympe.dc.ua.Relation.prototype.Rc;olympe.dc.ua.Relation.prototype.getDirection=olympe.dc.ua.Relation.prototype.Qa;olympe.dc.ua.Relation.prototype.getTag=olympe.dc.ua.Relation.prototype.T;olympe.dc.ua.Relation.ma=[olympe.dc.ze];olympe.dc.db={};function Lc(a,b,c,d,e,f=olympe.dc.Ka.rb){const g=c.Z();Mc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Nc(h,Oc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Pc(a,b){a.Ja.Ta(b)}function Qc(a,b,c){b&&a.Ja.uc(b);c&&a.Ja.$c(c)}
394
- olympe.dc.db.Vs=class{constructor(a,b,c,d,e){this.N=a;this.Ja=b;this.C=new olympe.dc.db.Ks(a,b,d);this.view=new olympe.dc.jb(a,b);this.zx=new olympe.dc.db.fu(this.N,this.view,b,e)}Za(){return this.N}persist(a){this.Ja.Fa();this.Ja.Ab(a,olympe.dc.db.Instance.C.hq);this.Ja.oa()}af(a,b){this.C.af(a,b)}};const Rc=olympe.dc.bc.VERSION,Sc=olympe.dc.bc.Nd,Tc=olympe.dc.jc.Vc,Uc=olympe.dc.jc.ui;
395
- olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.hc();this.N=b;this.Tb=olympe.D.Ia();this.Ge=c.get('defaultSource')||olympe.dc.Ka.rb;this.R=olympe.dc.db.Database.F.IDLE;this.ha=new Map;this.Pb=[];this.G=[];this.cb=new Map;b=c.get('garbageCollector')||olympe.dc.db.yi.C.Bl;new olympe.dc.db.yi(this,b,this.Tb);c.get('debug')&&this.Vf()}Z(){return this.id}getState(){return this.R}Za(){return this.N}create(b,c){const d=this.L(b,!0);d.cc(c&&parseInt(c.get(Rc),10)||1);d.ki(c&&
396
- c.get(Sc)||this.Ge);c&&(c.delete(Rc),c.delete(Sc),this.ud(d,c));this.C(a.C.pp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.L(b,!0);var e=c&&parseInt(c.get(Rc),10);0>e||!d&&b.version()>=e||(c.delete(Rc),b.cc(isNaN(e)?b.version()+1:e),this.ud(b,c))}}Lc(b){const c=this.get(b);void 0!==c&&(this.bb(c,!1),this.C(a.C.rp,b))}link(b,c,d){c=this.L(c,!0);d=this.L(d,!0);switch(b){case Tc:c.Of(d);break;case Uc:c.Ge(d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
397
- d)switch(b){case Tc:c.$k(d);break;case Uc:c.uh(d);break;default:c.unlink(b,d)}}uc(b){for(const c of b)this.L(c).aa()}$c(b){for(const c of b)(b=this.get(c))&&b.ha()}Ab(b,c){b.forEach(d=>{this.L(d).Wf(c)})}cc(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.zo,b))}L(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.C.yo,b),c&&this.C(a.C.zk,b));return d}Y(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.yk,
398
- h=olympe.dm.Relation.C.mk,k=olympe.dc.Aa.ORIGIN,l=olympe.dc.Aa.DESTINATION,n=a.fc.Nh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(u,w)=>(u=this.get(u))&&0!==(u.get(n)&w),v=([u,w])=>!r.has(u)&&(e?e(w):!0);for(const u of r.keys())r.get(u)||(r.set(u,!0),yield u),f=this.get(u),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(v).forEach(([A])=>{r.set(A,!1)})})}.bind(this,b)}}Oc(b){this.G[0].Te(olympe.W.xg(),b)}aa(b){if(0===this.G.length)debugger;
399
- this.G[0].C.delete(b)}C(b,c,...d){this.ha.has(b)&&this.ha.get(b).forEach(e=>{e(c,...d)})}bb(b,c){this.cb.set(b,c)}Of(b,c,d,e){0<this.G.length&&Vc(this.G[0],b).Da(e?Wc+c:c,d)}Pf(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===Xc?f?Vc(g,b).link(c,e):Vc(g,b).unlink(c,e):f?Vc(g,b).cb(c,e):Vc(g,b).Ab(c,e)}}F(b,c){let d=this.ha.get(b);void 0===d&&(d=[],this.ha.set(b,d));d.push(c)}Ta(b){this.Pb.push(b)}Qd(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Fa(){this.R===a.F.IDLE&&(this.R=a.F.ys);this.G.unshift(new olympe.dc.db.$s(this,
400
- this.Tb))}oa(){this.R=a.F.bg;this.Wf();Yc(this.G[0]);this.G.shift();0===this.G.length&&(this.R=a.F.IDLE,this.Pb.forEach(b=>{b()}))}ud(b,c){const d=a.fc.qc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.bl(e.substr(1),f):b.update(e,f))}Wf(){const b=a.fc.ORIGIN,c=this.cb,d=new Map,e=(g,h)=>{const k=g.get(b+Tc);k&&k.forEach((l,n)=>{g!==l&&(d.set(l,h),c.delete(n),e(l,h))})};c.forEach((g,h)=>{d.set(h,g);e(h,g)});const f=this.G[0];d.forEach((g,h)=>{h.ud(g)&&(h=h.tag(),g?Vc(f,h).create():Vc(f,h).delete())});
401
- this.cb.clear()}Vf(){const b=a.fc.DESTINATION,c=a.C.Dl,d=a.C.lk,e=new Set,f=new Map;this.F(a.C.pp,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===Uc&&h[1]===b){const k=h[2];this.get(k).Gb()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Ta(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.N.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
402
- this.N.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.fc={Nh:'$',st:'~',qc:'?',ll:'=',Yn:'@',ORIGIN:olympe.dc.Aa.ORIGIN,DESTINATION:olympe.dc.Aa.DESTINATION};olympe.dc.db.Database.C={yo:0,zo:1,ar:2,zk:3,Zn:4,$n:5,Dl:6,Hc:7,lk:8,pm:9,pp:10,rp:11,tq:12};olympe.dc.db.Database.F={IDLE:0,ys:1,bg:2};const Q=olympe.dc.db.Database.C,Zc=olympe.dc.db.Database.fc.Nh,$c=olympe.dc.db.Database.fc.st,ad=olympe.dc.db.Database.fc.qc,bd=olympe.dc.db.Database.fc.ll,cd=olympe.dc.db.Database.fc.Yn,R=olympe.dc.Aa.ORIGIN,S=olympe.dc.Aa.DESTINATION,dd=olympe.dc.jc.Vc,ed=olympe.dc.jc.ui;
403
- olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.$c=olympe.dc.Ka.rb;this.e=!1;this.Tb=0;this.F=void 0;this.c=0;this.Fa=a.C.hq;this.db=c}tag(){return this.C}Gb(){return this.e}Pb(){return this.db.Qd(this.C)}source(){return this.$c}version(){return this.Tb}model(){const b=this.get(S+dd);return b&&b.values().next().value||null}Af(){const b=this.get(S+ed);return b&&b.values().next().value||null}persisted(){return this.Fa!==a.C.jr}toString(){var b=this.gb(olympe.dc.CloudObject.nameProp.T());
404
- b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.gb(olympe.dc.CloudObject.nameProp.T())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Af())?(d=c.gb(olympe.dc.CloudObject.nameProp.T())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}gb(b,c=!1){const d=this.get(Zc+b);return c||void 0!==d?d:this.get(bd+b)}Ta(b,c=!1){const d=this.get(ad+
405
- b);return c||void 0!==d?d:this.get($c+b)}update(b,c){const d=Zc+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.sb?f.sb(c):f===c)||(e instanceof olympe.dc.Ec&&(this.db.get(e.T()).Oc(),this.db.Lc(e.T())),c instanceof olympe.dc.Ec&&(e=this.db.L(c.T(),!0),e.F&&e.F.tag!==this.C&&this.db.Za().fatal('Instance',c.T(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.mb+')','and is assigned as a property of',this.C,'(for the property '+
406
- b+')'),e.th(this.C,b)),e=bd+b,null===c?(this.delete(d),c=(c=this.model())&&c.Ta(b),void 0!==c?(this.set(e,c),this.L(b,c,!0)):this.L(b,null,!1)):(this.set(d,c),this.delete(e),this.L(b,c,!1)))}bl(b,c){const d=ad+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=$c+b,null===c?(this.delete(d),c=(c=this.Af())&&c.Ta(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.Y((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.Y((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.Ab(S+
407
- b);d=c.Ab(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.lk,this.C,b,S,c.C),this.db.C(Q.lk,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.cb(S+b,c.C)&&(c.cb(d,this.C),this.db.C(Q.pm,this.C,b,S,c.C),this.db.C(Q.pm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!1),c.G(b,R,this,!1)))}Of(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(dd,c)}this.link(dd,b);b.forEach((d,e)=>{e[0]!==ad&&e[0]!==$c||this.bb(e.substr(1),d)});
408
- (b.e||b===this)&&this.db.bb(this,!0)}$k(b){this.unlink(dd,b);this.forEach((c,d)=>{this.bb(d.substr(1),null)});this.db.bb(this,!1)}Ge(b){const c=this.Af();if(null!==c){if(c===b)return;this.unlink(ed,c)}this.link(ed,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===ad||f[0]===$c)f=f.substr(1),this.has(ad+f)||(this.set($c+f,e),d.set(f,e))});this.Y(d)}uh(b){this.unlink(ed,b);const c=new Map;this.forEach((d,e)=>{e[0]===$c&&(this.delete(e),c.set(e.substr(1),null))});this.Y(c)}uc(b,c,d){const e=(...f)=>{var g=
409
- f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.aa():g.ha());d(...f)};this.Te(b,c,e);return e}Te(b,c,d){const e=this.Ab(cd+b);e.has(c)||(e.set(c,d),this.aa(),this.db.C(Q.Zn,this.C,b,c))}R(b,c){const d=this.cb(cd+b,c);void 0!==d&&(this.ha(),this.db.C(Q.$n,this.C,b,c));return d}ki(b){this.$c=b}cc(b){this.Tb=b}Wf(b){this.Fa=b;this.oa()||this.db.C(Q.zk,this.C)}ud(b){const c=this.e!==b;c&&(b?(this.e=b,this.Vf()):(this.Pf(),this.e=b),this.Qd(b));return c}aa(){this.c++;1===this.c&&this.db.C(Q.ar,this.C)}ha(){0<
410
- this.c?--this.c:this.db.C(Q.tq,this.C,`Try to decrease references on instance ${this.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.C(Q.zk,this.C)}oa(){return 0<this.c||this.Fa===olympe.dc.db.Instance.C.iq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;b.forEach(g=>{const h=
411
- g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===Zc&&b instanceof olympe.dc.Ec&&this.db.get(b.T()).Oc()});void 0!==this.F&&this.db.get(this.F.tag).delete(Zc+this.F.mb)}th(b,c){void 0===this.F&&this.aa();this.F={tag:b,mb:c}}Oc(){void 0!==this.F&&(this.ha(),this.F=void 0)}Vf(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else d!==Zc&&d!==bd||this.L(c.substr(1),b,d===bd)})}Pf(){this.forEach((b,c)=>
412
- {const d=c[0];if(d!==cd){var e=c.substr(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===S?b.forEach(f=>{this.unlink(e,f)}):d===Zc&&this.update(d,null);this.delete(c)}});this.Tb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(Zc+this.F.mb);c&&c.T&&c.T()===this.C&&b.update(this.F.mb,null)}}Qd(b){this.db.C(b?Q.Dl:Q.Hc,this.C)}L(b,c,d){this.e&&this.db.Of(this.C,b,c,d)}G(b,c,d,e){this.db.Pf(this.C,b,c,d.C,e)}Y(b,c=[]){var d=this.get(R+dd);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>e.bb(g,f))});
413
- d=this.get(R+ed);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(ad+k)||(g.set(k,h),null!==h?e.set($c+k,h):e.delete($c+k))});e.Y(g,[...c,f])}})}bb(b,c){if(!this.has(Zc+b)){const d=bd+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.L(b,c,null!==c))}}Ab(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}cb(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&this.delete(b);
414
- return e}}};olympe.dc.db.Instance.C={jr:0,iq:1,hq:2};const Xc=olympe.dc.db.Database.fc.DESTINATION,Wc=olympe.dc.db.Database.fc.ll,fd=olympe.dc.db.Database.fc.Nh,gd=olympe.dc.db.Database.fc.Yn,hd=olympe.dc.db.Database.fc.ORIGIN+Xc,id=fd+fd;
415
- function Yc(a){const b=a.Ja;a.F.forEach((c,d)=>{const e=b.get(d);if(c.te()||c.L()){var f=e.get(gd);f&&jd(a,f,c.te(),d);c.L()&&a.G.add(d)}for(const [l,n]of c.wd()){var g=l[0]===Wc;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(gd+fd+f);p&&jd(d,p,k,g);(h=h.get(gd+id))&&jd(d,h,f,k,g)}for(const l of c.Ta())kd(a,e,...l)});a.F.clear();ld(a)}function Vc(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.F.set(b,c));return c}
416
- function jd(a,b,...c){b.forEach((d,e)=>{a.Te(e,d.bind(null,...c))})}function kd(a,b,c,d,e,f){const g=b.get(gd+d+c);g&&jd(a,g,f,e);(b=b.get(gd+hd))&&jd(a,b,c,d,f,e)}function ld(a){a.L.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}
417
- olympe.dc.db.$s=class{constructor(a,b){this.Ja=a;this.L=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}Te(a,b){let c=this.C.get(a);void 0===c&&(c=[],this.C.set(a,c));this.buffer.push([a,c.length]);c.push(b)}};function md(a){const b=olympe.dc.db.Database.C.zo,c=olympe.dc.db.Database.C.Dl,d=olympe.dc.db.Database.C.Hc,e=olympe.dc.db.Database.C.lk,f=olympe.dc.db.Database.C.pm,g=olympe.dc.db.Database.C.Zn,h=olympe.dc.db.Database.C.$n,k=()=>{};a.Ja.F(olympe.dc.db.Database.C.yo,()=>{});a.Ja.F(b,()=>{});a.Ja.F(c,l=>{a.Ja.Oc(()=>{nd(a.view,l,k,`monitorRelations${l}`)})});a.Ja.F(d,l=>{a.Ja.Oc(()=>{od(a.view,l,`monitorRelations${l}`)})});a.Ja.F(e,()=>{});a.Ja.F(f,()=>{});a.Ja.F(g,()=>{});a.Ja.F(h,()=>{})}
418
- olympe.dc.db.fu=class{constructor(a,b,c,d){this.N=a;this.view=b;this.Ja=c;d&&md(this)}debug(a){const b=olympe.dc.wa(a);if(this.Ja.has(b)){var c=this.Ja.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Gb()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Ja.get(d[d.length-1]);const e=olympe.dc.db.Database.fc.Nh+olympe.dc.CloudObject.nameProp.T();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
419
- d.join(' --M--\x3e ')}this.N.info(a)}else this.N.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.yi=class a{constructor(b,c,d){this.N=b.Za();this.Ja=b;this.F=new Set;this.mode=c;this.L=d;this.C=!1;c!==a.C.Bl&&this.R()}run(){if(!this.C)switch(this.mode){case a.C.rs:this.C=!0;this.L.run(()=>{Ib(()=>{this.G();this.C=!1},0)});break;case a.C.Nq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ja,c=olympe.dc.Ub.rf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.oa());for(var g of d){const h=b.get(g);if(h&&!h.oa()){if(!h.persisted())continue;Array.from(b.Y(g,c,!1,f)).forEach(k=>{d.add(k)});
420
- b.cc(g)}d.delete(g)}for(const h of d)f=Array.from(b.Y(h,c,!0)).map(e),g=Array.from(b.Y(h,c)).map(e),f.some(k=>k.oa())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.cc(k)});d.clear()}R(){this.Ja.Ta(this.run.bind(this));const b=olympe.dc.db.Database.C.ar,c=olympe.dc.db.Database.C.rp,d=olympe.dc.db.Database.C.tq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ja.getState()===e&&this.run()};this.Ja.F(olympe.dc.db.Database.C.zk,
421
- f.bind(this));this.Ja.F(c,f.bind(this));this.Ja.F(b,g=>{this.F.delete(g)});this.Ja.F(d,(g,...h)=>{this.N.error(h[0])})}};olympe.dc.db.yi.C={Bl:0,Nq:1,rs:2};const pd=olympe.dc.db.Database.fc.ORIGIN,qd=olympe.dc.db.Database.fc.DESTINATION,rd=olympe.dc.db.Database.fc.Nh,sd=olympe.dc.db.Database.fc.ll,td=pd+qd,ud=rd+rd,vd=olympe.dc.db.Database.F;function vc(a,b,c,d){const e=a.Ja.L(olympe.dc.wa(b));d=d||wd(a);e.Te('',d,c);e.Gb()&&a.G.run(()=>{c(!0,b)});return d}function wc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.R('',c);void 0!==f&&(a.Ja.getState()===vd.bg&&a.Ja.aa(c),!d&&e.Gb()&&a.G.run(()=>{f(!1,b)}))}}
422
- function nd(a,b,c,d){const e=a.Ja.L(olympe.dc.wa(b));b=d||wd(a);const f=e.uc(td,b,c);e.Gb()&&e.forEach((g,h)=>{g=h[0];g!==pd&&g!==qd||xd(a,e,h,!0,f,!0)})}function od(a,b,c){const d=U(a,b);if(null!==d){const e=d.R(td,c);void 0!==e&&(a.Ja.getState()!==vd.bg||d.Pb()||a.Ja.aa(c),d.Gb()&&d.forEach((f,g)=>{f=g[0];(f===pd||f===qd)&&e&&xd(a,d,g,!1,e,!0)}))}}function wd(a){++a.L;return String(a.L)}
423
- function yd(a,b,c,d,e){b=a.Ja.L(olympe.dc.wa(b));c=olympe.dc.wa(c);const f=rd+c;e=e||wd(a);b.Te(f,e,d);if(b.Gb()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(sd+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Ja.get(olympe.dc.wa(b));return!a||c&&!a.Gb()?null:a}
424
- function zd(a,b,c){b=a.Ja.L(olympe.dc.wa(b));const d=wd(a);b.Te(ud,d,c);b.Gb()&&b.forEach((e,f)=>{const g=f[0];g!==rd&&g!==sd||a.G.run(()=>{c(f.substr(1),e,g===sd)})});return d}function xd(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Gb()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}function V(a,b,c,d,e){b=a.Ja.L(olympe.dc.wa(b));c=c.Qa()+c.T();e=e||wd(a);d=b.uc(c,e,d);b.Gb()&&xd(a,b,c,!0,d,!1);return e}function Ad(a,b,c){return c===olympe.dc.Ub.NONE?0:a.gb(b,c,!0)||0}
425
- function Bd(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===pd||c===qd){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}function Cd(a,b,c){if(!a.Gb(b))return a.N.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.wa(b)];for(const f of e){const g=a.tb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.N.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.wa(b)}`);return d}
426
- function Dd(a,b,c){return null!==a.Vm(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Pa().Xk(d,olympe.dc.CloudObject.propertyRel,b))}function Ed(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Gb()).length:0}
427
- olympe.dc.jb=class{constructor(a,b){this.N=a;this.G=new olympe.D.Zb('DB View context');this.Ja=b;this.L=0}Z(){return this.Ja.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.wa(b),a.R(rd+b,c),this.Ja.getState()===vd.bg&&this.Ja.aa(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Qa()+b.T();const e=a.R(b,c);void 0!==e&&(this.Ja.getState()!==vd.bg||a.Pb()&&!d||this.Ja.aa(c),!d&&a.Gb()&&xd(this,a,b,!1,e,!1))}}Gb(a){a=U(this,a);return!(!a||!a.Gb())}name(a){return(a=U(this,a))?a.gb(olympe.dc.CloudObject.nameProp.T()):
428
- ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Af(a){return(a=(a=U(this,a,!0))&&a.Af())?a.tag():null}jj(a){a=U(this,a,!0);return!(!a||!a.Af())}qh(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Rf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Uf(a){return(a=U(this,a,!1))?!!a.persisted():!0}gb(a,b,c){b=(a=U(this,a,!0))?a.gb(olympe.dc.wa(b),c):null;return void 0!==b?b:null}wd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,
429
- e]of c)c=d[0],(c===rd||!b&&c===sd)&&a.set(d.substring(1),e);return a}tb(a,b){return this.fj(a,[b])}Xk(a,b,c){return this.tb(a,b).includes(olympe.dc.wa(c))}fj(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Qa()+c.T()),void 0!==a)for(const e of a.values())e.Gb()&&b.push(e.tag());a=b}return a}nc(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Qa()+b.T()))&&1<c.size?(this.N.warn(`Relation ${b.T()} to instance ${a} is not unique: found ${c.size} related items`),
430
- null):(a=c?c.values().next().value:null)&&a.Gb()?a.tag():null:null}Mf(a,b,c){a=olympe.dc.wa(a);const d=Cd(this,a,b);d.delete(a);return c?(c=olympe.dc.wa(c),d.has(c)?Array.from(Cd(this,c,b.Rc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Vm(a,b,c){if(!this.Gb(a))return null;b=Cd(this,a,b);const d=[olympe.dc.wa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Wm(a,b,c){return this.fj(a,b).find(c)||null}Vv(a,b,c){return this.fj(a,
431
- b).filter(c)}bn(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Af();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Gb())throw a=`Try to get all extensions of the model ${olympe.dc.wa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
432
- return e.map(f=>f.tag())}Rf(a,b){const c=olympe.dc.wa(b);return!!this.Vm(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ge(a){return this.tb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.jb.prototype.getInstances=olympe.dc.jb.prototype.ge;olympe.dc.jb.prototype.isExtending=olympe.dc.jb.prototype.Rf;olympe.dc.jb.prototype.getExtendedModels=olympe.dc.jb.prototype.bn;olympe.dc.jb.prototype.findAllRelated=olympe.dc.jb.prototype.Vv;olympe.dc.jb.prototype.findRelated=olympe.dc.jb.prototype.Wm;
433
- olympe.dc.jb.prototype.findRecursive=olympe.dc.jb.prototype.Vm;olympe.dc.jb.prototype.getRecursiveRelated=olympe.dc.jb.prototype.Mf;olympe.dc.jb.prototype.getUniqueRelated=olympe.dc.jb.prototype.nc;olympe.dc.jb.prototype.getMultiRelated=olympe.dc.jb.prototype.fj;olympe.dc.jb.prototype.isRelated=olympe.dc.jb.prototype.Xk;olympe.dc.jb.prototype.getRelated=olympe.dc.jb.prototype.tb;olympe.dc.jb.prototype.getProperties=olympe.dc.jb.prototype.wd;olympe.dc.jb.prototype.getProperty=olympe.dc.jb.prototype.gb;
434
- olympe.dc.jb.prototype.isPersisted=olympe.dc.jb.prototype.Uf;olympe.dc.jb.prototype.instanceOf=olympe.dc.jb.prototype.qh;olympe.dc.jb.prototype.isModel=olympe.dc.jb.prototype.jj;olympe.dc.jb.prototype.extension=olympe.dc.jb.prototype.Af;olympe.dc.jb.prototype.model=olympe.dc.jb.prototype.model;olympe.dc.jb.prototype.name=olympe.dc.jb.prototype.name;olympe.dc.jb.prototype.exist=olympe.dc.jb.prototype.Gb;function Fd(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.C.set(b,c));return c}function Gd(a,b,c=olympe.dc.Ub.NONE){b=Hd(a,b,c);for(const d of b)Id(a,d,!1),a.C.delete(d)}
435
- function Hd(a,b,c){const d=olympe.dm.Relation.C.mk,e=olympe.dm.Relation.C.yk,f=olympe.dc.Aa.ORIGIN,g=olympe.dc.Pa();b=new Set([b]);for(const k of b){var h=a.C.get(k);if(void 0!==h){for(const [l,n]of h.gd())Ad(g,l,c)&e&&b.add(n);for(const [l,n]of h.bb())Ad(g,l,c)&d&&b.add(n)}for(const [l,n,p]of Bd(g,k))h=n===f?d:e,Ad(g,l,c)&h&&b.add(p)}return Array.from(b).filter(k=>a.C.has(k))}
436
- function Id(a,b,c){var d=olympe.dc.Aa.ORIGIN;const e=olympe.dc.Aa.DESTINATION,f=a.C.get(b);for(const [g,h,k]of f.gd()){if(!k&&c)continue;const l=a.C.get(h);l&&l.R(g,d,b)}for(const [g,h,k]of f.bb())(k||!c)&&(d=a.C.get(h))&&d.R(g,e,b)}function*Jd(a,b,c,d,e=[]){e.push(b);b=a.If(b);for(const [f,g]of b.tb(c))e.includes(f)||(yield*Jd(a,f,c,d,e),yield d(f,g))}function Kd(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.R(b,olympe.dc.Aa.DESTINATION,d);a&&a.R(b,olympe.dc.Aa.ORIGIN,c)}
437
- olympe.dc.db.zc=class{constructor(a){this.id=a||olympe.W.aj();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substr(0,a.length-2));return a+'}}'}static lc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.zc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.kg.lc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}Zc(a){const b=
438
- olympe.dc.db.kg.C.Yl,c=olympe.dc.db.kg.C.Hc,d=olympe.dc.db.kg.C.Ak;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.Y()?e.wd():void 0);break;case d:e.Y()&&a.pc(f,e.wd(),g.Yi);break;case c:a.Lc(f,g.Yi)}for(const [h,k,l]of e.gd())l?a.Oa(h,f,k):a.Jb(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.Tb()});return a}F(a,b){a=Fd(this,a).create();b&&a.oa(b)}pc(a,b,c){b&&(a=Fd(this,a).oa(b),c&&a.Pb())}Lc(a,b=olympe.dc.Ub.NONE){const c=this.C.get(a);if(c&&c.te())Gd(this,a,b);else{Fd(this,
439
- a).delete(b);for(const d of Hd(this,a,b))this.C.get(d).wd().clear(),Id(this,d,!0)}}Oa(a,b,c){Fd(this,b).link(a,c);Fd(this,c).cb(a,b)}Jb(a,b,c){Fd(this,b).unlink(a,c);Fd(this,c).Ab(a,b)}ge(){return function*(a){for(const b of a.values())if(b.te()||b.L()||b.Y())yield b}(this.C)}If(a){return this.C.get(olympe.dc.wa(a))||null}gd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.gd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Mf(a,b,c=(d,e)=>[d,e]){return Jd(this,
440
- a,b,c)}};olympe.dc.db.zc.ma=[olympe.dc.eh,olympe.dc.jm];const Ld=new Map;
441
- olympe.dc.db.kg=class a{constructor(b){this.ha=b;this.F=a.F(a.C.Ak,!1);this.G=this.Ma=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ha)+', "state": '+JSON.stringify(this.F);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.Ma){b+=', "relations": {';for(const d of this.Ma.keys()){c=this.Ma.get(d);b+=JSON.stringify(d)+
442
- ': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static lc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.kg(c.tag);b.F=c.state;const d=c.properties;if(d){b.C=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.Ec.lc(f):h=olympe.D.lc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
443
- c.relations){b.Ma=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.Ma.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Ld.get(d);void 0===e&&(e={id:b,Yi:c},Ld.set(d,e));return e}tag(){return this.ha}getState(){return this.F}create(){this.F=a.F(a.C.Yl);return this}delete(b=olympe.dc.Ub.NONE){this.F=a.F(a.C.Hc,b);this.C=null;return this}Pb(){this.F.id===a.C.Ak&&(this.F=a.F(a.C.Ak,!0))}Da(b,c){if(this.F.type===a.C.Hc)return this;
444
- this.C||(this.C=new Map);this.C.set(b,c);return this}oa(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}Fa(b){this.C&&this.C.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.Ma&&(this.Ma=new Map);this.Ra(this.Ma,b,c,!0);return this}unlink(b,c){null===this.Ma&&(this.Ma=new Map);this.Ra(this.Ma,b,c,!1);return this}cb(b,c){this.G||(this.G=new Map);this.Ra(this.G,b,c,!0)}Ab(b,c){this.G||(this.G=new Map);this.Ra(this.G,b,c,!1)}cc(b,c,d){if(c=c===olympe.dc.Aa.ORIGIN?
445
- this.G:this.Ma)return(b=c.get(b))&&b.get(d)}R(b,c,d){const e=(c=c===olympe.dc.Aa.ORIGIN?this.G:this.Ma)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}te(){return this.F.id===a.C.Yl}L(){return this.F.id===a.C.Hc}Tb(){let b=this.C?this.C.size:0;this.Ma&&this.Ma.forEach(c=>{b+=c.size});return b}Y(){return null!==this.C}wd(){return this.C||new Map}gb(b){if(this.C)return this.C.get(b)}tb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.T()))for(const [e,f]of d)yield c(e,f)}(b.Qa()===olympe.dc.Aa.ORIGIN?
446
- this.G:this.Ma)}gd(b=(c,d,e)=>[c,d,e]){return this.aa(this.Ma,b)}bb(b=(c,d,e)=>[c,d,e]){return this.aa(this.G,b)}Ta(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.Aa.ORIGIN,d=olympe.dc.Aa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.aa.bind(this),this.Ma,this.G)}Ra(b,c,d,e){if(this.F.id!==a.C.Hc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*aa(b,c){if(null!==b)for(const [d,
447
- e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.kg.C={Yl:0,Ak:1,Hc:2};function Mc(a,b,c,d,e,f=olympe.dc.Ka.rb){const g=olympe.dc.db.Instance.C.iq,h=olympe.dc.db.Instance.C.jr,k=c.Z();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Md(c,Nd(a,c),f);a.C.push(k);a.F.set(k,l);a.Ja.Fa();a.Ja.Ab(d,g);a.Ja.Ab(e,h);Nc(a,c,f);const n=Array.from(c.ge()).filter(p=>p.te()).map(p=>p.tag());a.Ja.uc(n);a.Ja.oa();0<n.length&&b.xc(()=>{a.Ja.Fa();a.Ja.$c(n);a.Ja.oa()})}
448
- function Nc(a,b,c){a.G.process(c,b,d=>{d||a.N.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Oc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.af(d):d,b)}
449
- function Nd(a,b){const c=a.Ja,d=olympe.dc.db.Database.fc.Nh,e=olympe.dc.db.Database.fc.qc,f=olympe.dc.db.Database.fc.ORIGIN,g=olympe.dc.db.Database.fc.DESTINATION,h=olympe.dc.bc.VERSION,k=olympe.dc.bc.Nd,l=new olympe.dc.db.zc('rev-'+b.Z());a.N.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.te()){l.Lc(p,olympe.dc.Ub.NONE);for(const [t,v]of n.gd())l.Jb(t,p,v)}else{var q=c.get(p);if(void 0!==q)if(n.L()){n=n.getState().Yi;for(const t of c.Y(p,n)){p=c.get(t);const v=(new Map).set(h,
450
- q.version()).set(k,q.source());p.forEach((u,w)=>{const y=w[0],A=w.substr(1);y===d?v.set(A,u):y===e?v.set(w,u):y===f?u.forEach((D,T)=>{l.Oa(A,T,t,0)}):y===g&&u.forEach((D,T)=>{l.Oa(A,t,T,0)})});l.F(t,v,0)}}else{const t=(new Map).set(h,q.version());for(const v of n.wd().keys()){var r=v[0]===e;const u=r?v.substr(1):v;r=r?q.Ta(u,!0):q.gb(u,!0);t.set(v,void 0===r?null:r)}1<t.size&&l.pc(p,t,!0,0);for(const [v,u,w]of n.gd())w?l.Jb(v,p,u):l.Oa(v,p,u)}}});return l}
451
- olympe.dc.db.Ks=class{constructor(a,b,c){this.N=a;this.Ja=b;this.G=c;this.C=[];this.F=new Map}af(a,b){Nc(this,Oc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Oc(this,c.F,b);this.F.delete(a)}}};function Od(a,b,c,d){const e=olympe.dc.Aa.DESTINATION;c=c.tag();const f=a.C.If(c);b.wd().forEach((g,h)=>{f.Da(h,g);b.Fa(h)});for(const [g,h,k,l]of b.Ta()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Oa(g,n,p);Kd(d,g,n,p)}}
452
- function Pd(a,b,c,d){const e=olympe.dc.Aa.DESTINATION,f=c.tag(),g=a.C.If(f);b.wd().forEach((h,k)=>{void 0!==c.gb(k)&&(g.Da(k,h),b.Fa(k))});for(const [h,k,l]of b.gd()){const n=c.cc(h,e,k);void 0!==n&&(Kd(d,h,f,k),n===l&&Kd(a.C,h,f,k))}}
453
- class Md{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Pa()}Z(){return this.F.Z()}af(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.L()?c.te()||Gd(this.C,b,f.getState().Yi):c.L()?(Od(this,f,c,a),Gd(a,b,c.getState().Yi)):Pd(this,f,c,a))}return a}};olympe.dc.db.O={Ea:'dc.db.Logger',xa:'dc.db.DatabaseManager',Jj:'dc.db.Database',jb:'dc.db.Driver',lt:'dc.db.Graph',mo:'dc.db.DataProcessor',qo:'dc.db.DebugProcessor',oA:'dc.db.PermissionProcessor',Gi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Oo:'db.garbageCollector',Gi:'db.monitor',po:'db.debug'};
454
- olympe.U.config(function(a){E(a,olympe.dc.db.Config.Oo,olympe.dc.db.yi.C.Nq);E(a,olympe.dc.db.Config.Gi,!1);E(a,olympe.dc.db.Config.po,!1);C(a,olympe.dc.db.O.Ea,[olympe.sa.O.xa],b=>b.Pc('dc.db'));C(a,olympe.dc.db.O.Jj,[olympe.dc.db.O.Ea,new olympe.U.fa(olympe.dc.Config.ro),new olympe.U.fa(olympe.dc.db.Config.Oo),new olympe.U.fa(olympe.dc.Config.Yg),new olympe.U.fa(olympe.dc.db.Config.po)],(b,c,d,e,f)=>{d=e?olympe.dc.db.yi.C.Bl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
455
- f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.O.jb,[olympe.dc.db.O.xa],b=>b.view);C(a,olympe.dc.db.O.Gi,[olympe.dc.db.O.xa],b=>b.zx);B(a,olympe.dc.db.O.qo,olympe.dc.db.Xb.wo,olympe.dc.O.Ea);C(a,olympe.dc.db.O.mo,[olympe.dc.db.O.Ea,olympe.dc.db.O.Jj,olympe.U.O.cg,new olympe.U.fa(olympe.dc.Config.dg)],(b,c,d,e)=>{b=new olympe.dc.db.Xb.mr(b,c);e&&(b=new olympe.dc.km(ma(d,olympe.dc.db.O.qo),b));return b});B(a,olympe.dc.db.O.xa,olympe.dc.db.Vs,olympe.dc.db.O.Ea,olympe.dc.db.O.Jj,olympe.dc.O.oe,
456
- olympe.dc.db.O.mo,new olympe.U.fa(olympe.dc.db.Config.Gi))},'olympe.dc.db');olympe.U.run([olympe.dc.db.O.Jj,olympe.dc.db.O.Gi],(a,b)=>{olympe.dj().db=a;olympe.dj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Xb={};olympe.dc.db.Xb.mr=class{constructor(a,b){this.N=a;this.Ja=b;this.buffer=[]}process(a,b,c){this.Ja.Fa();b.Zc(this);this.Ja.oa();c(null,b)}F(a,b){this.Ja.create(a,b)}pc(a,b,c){this.Ja.update(a,b,c)}Lc(a,b=olympe.dc.Ub.NONE){for(const c of this.Ja.Y(a,b))this.Ja.Lc(c)}Oa(a,b,c){this.Ja.link(a,b,c)}Jb(a,b,c){this.Ja.unlink(a,b,c)}};olympe.dc.db.Xb.mr.ma=[olympe.dc.og,olympe.dc.eh];function Qd(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Ec||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.T()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Nf()+','+f.Hf()+','+f.Cf()+','+f.Bf()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Qd(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
357
+ olympe.la.Vj=class extends olympe.la.Ck{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.la.fb.ce.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.la.fb.ResponseType.vk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}ej(){return this.headers}setHeader(a,b){this.headers[a]=b}C(){let a=Rb(this);a=a?`?${a}`:'';return Mb(this)?`${Ob(this)?'https':'http'}://${Mb(this)}:${this.port}/${Nb(this)}${a}`:`${Nb(this)}${a}`}toString(){return this.C()}};
358
+ olympe.la.Vj.ce={hm:'POST',GET:'GET',st:'HEAD',ik:'PUT',Hc:'DELETE',bm:'OPTIONS'};olympe.la.Sg=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Td(){return this.status}ej(){return this.headers}getHeader(a){return this.headers[a]}};function Sb(a,b,c){const d=olympe.D.Ia(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.C(f=>{d.Ie(e);a.F().C.delete(b);c(f)})}olympe.la.ta=class{constructor(a){this.N=a;this.G=1;a='Initializing NET layer';this.N.G()&&(a+=' (implementation: '+this.Y()+')');this.N.info(a);this.N.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}ka(){}C(){}L(){}R(){}Y(){}};function Tb(a){return!(!a.client||!a.client.connected)}function Ub(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.N.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Vb(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}
359
+ olympe.la.dk=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.N=olympe.sa.Ya('MQTT')}connect(a){if(Tb(this))return a&&a(),this;a&&this.F.push(a);null===this.client&&(this.client=mqtt.connect(this.url,this.G),this.client.on(olympe.la.dk.C.gu,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.N.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.la.dk.C.Ks,()=>this.F.forEach(b=>b())));return this}publish(a,b,c,d){this.connect();
360
+ this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.N.error('Failed to publish a message '+b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.la.dk.C={Ks:'connect',gu:'message',Ty:'close',iz:'end'};olympe.la.Bk=class{constructor(a){this.N=a}ea(){this.N.error('Try to set cors policies on a web server with the browser implementation.');return this}L(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.la.O={xa:'net.Manager',Ea:'net.Logger',zm:'net.WebServer'};olympe.la.Config={Jl:'net.httpHost',Kl:'net.httpPort',gp:'net.httpSSL'};
361
+ olympe.U.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;E(a,olympe.la.Config.Jl,b);E(a,olympe.la.Config.Kl,c?3141:443);E(a,olympe.la.Config.gp,!c);ta(a,olympe.la.O.xa);C(a,olympe.la.O.Ea,[olympe.sa.O.xa],function(d){return d.Qc('net')});B(a,olympe.la.O.zm,olympe.la.Bk,olympe.la.O.Ea)},'olympe.net');olympe.async={};function Wb(a,b){0<=b&&(a.timeout=b)}function Xb(a,b){a.L||a.sd.push(a.G.C(b))}
362
+ olympe.async.Ho=class{constructor(a,b=void 0===a){this.C=[];this.sd=[];this.G=a||new olympe.D.Zb('Async executor context');this.qa=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.L=this.R=!1;this.N=null;this.Y=this.timeout=0}Ya(){return this.N}add(a){this.L||this.C.push(this.G.C(a));return this}start(){this.R||(this.N&&this.N.log('Executor started.'),this.R=!0,0<this.timeout&&(this.Y=setTimeout(()=>{this.F='Timeout expired.';this.Y=0;this.complete(!1)},this.timeout)))}clear(){this.C=
363
+ [];this.sd=[];this.env.clear();this.qa&&this.G.destroy()}complete(a){if(!this.L){this.L=!0;this.Y&&(clearTimeout(this.Y),this.Y=0);this.N&&this.N.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.sd)b(a,a?null:this.F,this.env);this.clear()}}};
364
+ function Yb(a){if(0<a.C.length){const b=a.C.shift();a.N&&a.N.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{Yb(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.sk=class extends olympe.async.Ho{static create(){return new olympe.async.sk(new olympe.D.Zb('SequencedExecutor'),!0)}insert(a){this.L||this.C.unshift(a);return this}start(){this.R||(super.start(),Yb(this))}};
365
+ olympe.async.ng=class extends olympe.async.Ho{constructor(a,b){super(a,b);this.ea=0;this.ka=!0}static create(){return new olympe.async.ng(new olympe.D.Zb('ParallelExecutor'),!0)}run(a){this.N&&this.N.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ka=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.R&&!this.L&&(this.ea++,this.run(a));return this}done(){this.ea--;0>=this.ea&&this.complete(this.ka)}start(){if(!this.R)if(super.start(),0<
366
+ this.C.length){this.ea=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.ic={};olympe.ic.Wt=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.ic.Vt=class{constructor(){}C(){}};olympe.ic.Storage=class{open(){}F(){}R(){}write(){}G(){}L(){}C(){}close(){}};function Zb(a,b,c){a.storage.F(c)}function $b(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function ac(a,b){a.storage.G(b)}function bc(a,b){a.storage.C(b)}function cc(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function dc(a,b){a.storage.R(b)}olympe.ic.Xs=class{constructor(a){this.storage=a}};olympe.ic.O={$j:'localStorage.KeyValueManager',Ni:'localStorage.Storage',qo:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.U.config(function(a){ta(a,olympe.ic.O.$j);C(a,olympe.ic.O.Ea,[olympe.sa.O.xa],function(b){return b.Qc('localstorage')});B(a,olympe.ic.O.qo,olympe.ic.Xs,olympe.ic.O.Ni)},'olympe.localstorage');olympe.auth={};olympe.auth.Uu=class{R(){}L(){}Y(){}cb(){}ka(){}ii(){}oh(){}Qr(){}};function ec(a){a.N.info('Initializing AUTH layer');let b=a.lc;if(a.ka){const c=a.ka.C(),d=Gb(c.parameters);b=d||b;d&&a.ka.F(c.parameters.filter(e=>'authToken'!==e.na()))}b&&a.storage&&fc(a.storage,b,c=>{!c&&a.N.error('Could not store authToken')});a.N.debug('Asking to be notified when auth connector gets online');a.F.R(()=>{if(a.$a)if(a.L=olympe.auth.ta.G.ws,a.N.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Y){const c=new olympe.auth.Request;c.set('username',
367
+ a.Y);c.An(a.Ab);a.N.log('Autologin with user "'+a.Y+'"');gc(a,c)}else a.N.error('autoLogin: auto user not specified.'),hc(a);else a.L=olympe.auth.ta.G.wk,a.N.log('Connector online, attempting to log with token'),a.Ta()});a.F.L(()=>{switch(olympe.D.Za(a.G)){case olympe.auth.ta.C.Lg:a.N.warn('Disconnected from server - session of user '+olympe.D.Za(a.C.Eb()).Ud()+' lost');break;case olympe.auth.ta.C.Dh:a.N.warn('Disconnected from server - guest session lost');break;case olympe.auth.ta.C.ni:a.N.warn('Disconnected from server - authentication aborted');
368
+ break;case olympe.auth.ta.C.INIT:a.N.warn('Cannot open auth session - no server connection');break;default:a.N.error('Should not get there, investigate')}ic(a,olympe.auth.ta.C.gf)});a.F.Y(a.Ta.bind(a));a.F.cb((c,d)=>{if(c===olympe.auth.ta.F.zj)a.N.info('Authentication revoked'),hc(a),a.storage&&jc(a.storage),a.qa.forEach(e=>{e(c,d)});else if(c===olympe.auth.ta.F.jp)a.N.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&jc(a.storage),a.cb.F();else throw Error(`Unknown logout step coming from server : ${c}`);
369
+ });a.N.log('DONE initializing AUTH layer (waiting for connector to be online)')}function ic(a,b){a.N.log('State change: ',kc(a),'--\x3e',b);a.G.update(b)}function hc(a){a.C.update(a.Fa);ic(a,olympe.auth.ta.C.Dh);a.N.info('Authenticated as guest')}function kc(a){return olympe.D.Za(a.G.Eb())}
370
+ function lc(a){const b=olympe.auth.ta.C.Lg,c=olympe.auth.ta.C.Dh,d=olympe.auth.ta.C.ni,e=olympe.D.Nc(olympe.D.ra,'auth.isOnline');olympe.D.yc([a.G],f=>{e.update(olympe.D.Bc(f===b||f===c||f===d))},'Router is online');return e.Eb()}function mc(a){var b=olympe.public.Ua.get(),c='logoutCallback';void 0===c&&(c=olympe.W.xg());b.qa.set(c,a)}function nc(a){return a.C.Eb().Jf()}
371
+ function oc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.N.error(b);a.error.update(olympe.D.Cb(b));ic(a,olympe.auth.ta.C.tc);if(d)throw Error(b);}function gc(a,b,c,d){void 0===c&&(c=a.Tb);void 0===c&&oc(a,'No authentication provider specified',null,!0);const e=a.Hb.get(c);e||oc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.R.set('login',d);a.N.log('Sending authentication request using "'+c+'" for '+b);e.hd(b,a.cc.bind(a));ic(a,olympe.auth.ta.C.ni)}
372
+ function pc(a,b,c){a.R.forEach(d=>{d(b,c)})}
373
+ olympe.auth.ta=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.N=a;this.F=b;this.storage=c;this.cb=d;this.ka=e;this.Tb=g;this.Pb=h;this.$a=void 0===k?!0:k;this.Y=l;this.Ab=n;this.lc=p;this.Hb=new Map;this.G=olympe.D.Nc(String).update(olympe.auth.ta.C.INIT);this.error=olympe.D.Nc(olympe.D.Xa);this.L=null;this.Fa=new olympe.auth.tf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Nc(olympe.auth.tf).update(this.Fa);this.R=new Map;this.qa=new Map;f.forEach(q=>{const r=
374
+ q.na();if(this.Hb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Hb.set(r,q)});ec(this)}getState(){return this.G.Eb()}ea(){return this.error.Eb()}Ud(){return this.C.Eb().Ud()}Cg(){return this.C.Eb().Cg()}ci(){return this.C.Eb().ci()}oh(a,b){this.F.oh(a,olympe.D.Za(nc(this)),b)}tn(){this.N.debug('Sending logout');jc(this.storage);this.F.ka(a=>{a?oc(this,'Logout request rejected:',a):this.N.debug('Logout request acknowledged')})}ii(){kc(this)===olympe.auth.ta.C.Lg&&this.F.ii(a=>
375
+ {a&&this.N.error('Was not able to send the auth keep alive message:',a.message)})}Ta(){null!==this.storage?(this.N.debug('Retrieving token from local storage'),this.storage.hd(a=>{if(a){const c=new olympe.auth.Request;var b=a.Ud();c.set('username',b);a=a.Jf();c.set('nonce',a);this.N.debug('Token found, trying login with',c);gc(this,c,this.Pb)}else this.N.debug('No token found, cannot perform auto login. Falling back in GUEST state'),hc(this)})):(this.N.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),
376
+ hc(this))}cc(a,b){const c=null===this.L?olympe.auth.ta.G.du:this.L;this.L=null;a?(this.N.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),jc(this.storage),this.error.update(olympe.D.Cb(a.message)),hc(this),pc(this,a,c)):(this.N.info('User '+b.Ud()+' (#'+b.Cg()+') successfully authenticated'),this.C.update(b),ic(this,olympe.auth.ta.C.Lg),pc(this,a,c),this.storage&&fc(this.storage,b));this.R.has('login')&&this.R.delete('login')}};
377
+ olympe.auth.ta.C={INIT:'init',gf:'disconnected',Dh:'guest',ni:'authenticating',tc:'error',Lg:'authenticated'};olympe.auth.ta.G={du:'manual',ws:'auto',wk:'tokenOnFirstConnection'};olympe.auth.ta.F={zj:'accepted',jp:'redirect'};olympe.auth.Ki=class{na(){}hd(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.yc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.xf&&(a=a.Na.Ib);return a?a.valueOf():a}Ud(){return this.get('username')}An(a){this.set('password',a)}Jf(){return this.get('nonce')}toString(){return this.Ud()+(this.Jf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.tf=class{constructor(a,b,c,d={}){this.user=a;this.yj=b;this.F=c;this.G=d}Ud(){return this.user}Cg(){return this.yj}Jf(){return this.F}Yj(){return this.G}ci(){return null}ia(){var a=olympe.W,b=a.yr;var c=JSON.stringify({user:this.user,userTag:this.yj,nonce:this.F,payload:this.G});c=olympe.W.bi().C(Da(c));return b.call(a,c)}};m=olympe.auth.tf.prototype;m.Ud.K=new olympe.D.J(()=>String,[]);m.Cg.K=new olympe.D.J(()=>String,[]);m.Jf.K=new olympe.D.J(()=>String,[]);
378
+ m.Yj.K=new olympe.D.J(()=>Object,[]);m.ci.K=new olympe.D.J(()=>String,[]);m.ia.K=new olympe.D.J(()=>String,[]);olympe.auth.fm=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d)}ci(){return this.Yj().access_token||null}};olympe.auth.Fq=class extends olympe.auth.tf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}ci(){return this.C}ia(){var a=olympe.W.bi(),b={user:this.Ud(),userTag:this.Cg(),nonce:this.Jf(),payload:this.Yj(),fullToken:this.C},c=olympe.W,d=c.yr;b=JSON.stringify(b);a=a.C(Da(b));return d.call(c,a)}};function fc(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ia(),e=>{d.close();c&&c(e)})}function jc(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
379
+ olympe.auth.vm=class{constructor(a,b,c){this.C=a;this.N=b;this.key='OlympeToken-'+c.C}hd(a){const b=this.C.C('AUTH');this.N.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.N.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Ea(olympe.W.bi().R(olympe.W.Cv(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Fq(h.user,h.userTag,h.nonce,h.payload);k.C=h.fullToken;d=k}else d=h.payload&&
380
+ h.payload.id_token?new olympe.auth.fm(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.tf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.N.error('Error while unserializing token: ',h.message)}else this.N.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.vm.F='OlympeToken';olympe.auth.vm.C='AUTH';olympe.auth.pk=class{redirect(){}F(){}C(){}};olympe.auth.pk.C={GET:'GET',hm:'POST'};olympe.auth.nl=class{constructor(a){this.C=a||'default'}};olympe.auth.Hb={};olympe.auth.Hb.pa={};olympe.auth.Hb.pa.Fi=class{ea(){}};olympe.auth.Hb.pa.Re=class{qa(){}};olympe.auth.Hb.pa.Ee=class{Fa(){}Ta(){}};function qc(a,b){return olympe.W.ob(b+'-olympe-'+a.C[b])}olympe.auth.Hb.Ei=class{constructor(a){this.C=a}na(){return'local'}hd(a,b){const c=a.Ud();if(c){const d=a.get('password'),e=a.Jf();a.C.delete('password');if(void 0!==e&&qc(this,c)===e){b(null,new olympe.auth.tf(c,'',qc(this,c)));return}a=olympe.W.ob(d||'');if(this.C[c]===a){b(null,new olympe.auth.tf(c,'',qc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Hb.Ei.C='local';olympe.auth.Hb.Ei.ma=[olympe.auth.Ki];olympe.auth.Hb.Fi=class{constructor(a,b){this.C=a;this.storage=b}na(){return'localToken'}hd(a,b){this.storage.hd(c=>{this.C.ea(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Hb.Fi.C='localToken';olympe.auth.Hb.Fi.ma=[olympe.auth.Ki];olympe.auth.Hb.em=class{constructor(a,b){this.C=a;this.F=b}na(){return'openID'}hd(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.pk.C.GET)}};olympe.auth.Hb.em.C='openID';olympe.auth.Hb.em.ma=[olympe.auth.Ki];olympe.auth.Hb.Re=class{constructor(a,b){this.F=a;this.C=b}na(){return'saml'}hd(a,b){this.F.qa(c=>{c?b(c):this.C.F()})}};olympe.auth.Hb.Re.C='saml';olympe.auth.Hb.Re.ma=[olympe.auth.Ki];olympe.auth.Hb.Ee=class{static $i(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.N=olympe.sa.Ya('auth')}na(){return'srp'}hd(a,b){const c=a.get('password');a.C.delete('password');this.N.debug('Sending SRP request');this.C.Fa(a,(d,e,f)=>{this.N.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Ud(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
381
+ return}this.N.debug('Sending SRP A+M (proof) message');this.C.Ta(a,b)}})}};olympe.auth.Hb.Ee.C='srp';olympe.auth.Hb.Ee.ma=[olympe.auth.Ki];olympe.auth.O={xa:'auth.Manager',Ea:'auth.Logger',Ni:'auth.Storage',Aj:'auth.appNameToken',kk:'auth.Redirector'};olympe.auth.wd={xa:'auth.ManagerConnector',Ep:'auth.LocalTokenConnector',Ee:'auth.SRPConnector',Re:'auth.SAMLConnector'};olympe.auth.Config={zl:'auth.defaultProvider',Fp:'auth.localTokenProvider',Jn:'auth.autoLogin',Nn:'auth.autoUser',Kn:'auth.autoPassword',wk:'auth.token',Hn:'auth.appToken'};
382
+ olympe.U.config(function(a){E(a,olympe.auth.Config.zl,'srp');E(a,olympe.auth.Config.Fp,'localToken');E(a,olympe.auth.Config.Jn,!1);E(a,olympe.auth.Config.Nn,'');E(a,olympe.auth.Config.Kn,'');E(a,olympe.auth.Config.wk,'');E(a,olympe.auth.Config.Hn,'default');C(a,olympe.auth.O.Ea,[olympe.sa.O.xa],b=>b.Qc('auth'));B(a,olympe.auth.O.Aj,olympe.auth.nl,new olympe.U.fa(olympe.auth.Config.Hn));B(a,olympe.auth.O.Ni,olympe.auth.vm,olympe.ic.O.$j,olympe.auth.O.Ea,olympe.auth.O.Aj);ta(a,olympe.auth.wd.xa);ta(a,
383
+ olympe.auth.O.kk);C(a,olympe.auth.O.xa,[olympe.auth.O.Ea,olympe.auth.wd.xa,olympe.host.O.Il,new olympe.U.Bb(olympe.auth.O.Ni,olympe.U.ff.C.Jh),new olympe.U.fa(olympe.auth.Config.zl),new olympe.U.fa(olympe.auth.Config.Fp),new olympe.U.fa(olympe.auth.Config.Jn),new olympe.U.fa(olympe.auth.Config.Nn),new olympe.U.fa(olympe.auth.Config.Kn),new olympe.U.fa(olympe.auth.Config.wk),new olympe.U.Bb(olympe.auth.O.kk,olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.wd.Ep,olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.wd.Ee,
384
+ olympe.U.ff.C.Jh),new olympe.U.Bb(olympe.auth.wd.Re,olympe.U.ff.C.Jh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Hb.Fi(q,e));r&&u.push(new olympe.auth.Hb.Ee(r));t&&p&&u.push(new olympe.auth.Hb.Re(t,p));p&&c&&u.push(new olympe.auth.Hb.em(p,c.Qr()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.na()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.zl+'cannot be found');return new olympe.auth.ta(b,
385
+ c,e,p,d.lj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.U.run([olympe.auth.O.xa],a=>{olympe.auth.Tc=()=>a});olympe.dc={};olympe.dc.Aa={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.Aa);olympe.dc.jc={Wc:'ff022000000000000000',ui:'ff02200000000000000e',eo:'ff02200000000000000f'};olympe.dc.bc={VERSION:'@v',Nd:'@s'};olympe.dc.Tg={rc:'?'};olympe.dc.tk={Yp:'online',$l:'offline',yt:'invalidate'};olympe.dc.Ka={rb:'self',Xc:'server',hq:'peer',rc:'server'};olympe.dc.wa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.Za(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.T?b=a.T():'function'===typeof a&&(b=olympe.dc.Ca.Wb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.wa);olympe.dc.Pa=function(){return olympe.dc.Dd().view};olympe.dc.register=function(a,b){olympe.dc.Ca.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.va.Property(a)};
386
+ olympe.dc.ih=function(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Aa.DESTINATION){const e=olympe.dc.Aa.DESTINATION;return b===olympe.dc.Aa.ORIGIN||b===e?new olympe.dc.va.Relation(a,b):new olympe.dc.va.Relation(a,d,b,c)};olympe.dc.Ov=function(a){return a.Sc()};olympe.dc.eh=class{F(){}qc(){}Mc(){}Oa(){}Jb(){}};olympe.dc.jm=class{$c(){}Z(){}G(){}};function rc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ja.Sh,{file:b,url:null,content:c,Ze:e?h=>{sc(a,b,c);f(h)}:f,mimeType:d,ue:g||null},[olympe.dc.Pa().source(b)||olympe.dc.Ka.Xc]);a.F.send(d)}function tc(a,b,c,d,e,f){c=c instanceof olympe.D.Xa?c.valueOf():c;'string'===typeof c?c=new Blob([Da(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));rc(a,b,c,d,a.G,e,f)}
387
+ function sc(a,b,c){const d=olympe.dc.wa(b);a.C.set(d,c);const e=olympe.W.xg();uc(olympe.dc.Pa(),d,f=>{f||(a.C.delete(d),vc(olympe.dc.Pa(),d,e))},e)}function wc(a,b,c,d){olympe.D.ds([b.Wr(),b.T(),b.Ql(),b.en()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ja.Ah,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ze:a.G?k=>{sc(a,f,k);c(k)}:c,ue:d},[olympe.dc.Pa().source(f)||olympe.dc.Ka.Xc]),a.F.send(e))})}
388
+ olympe.dc.lt=class{constructor(a,b,c,d,e){this.N=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.ta=class{constructor(a){this.N=a}};function xc(a,b){a.F=b;return a}function M(a,b){a.G.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.G=[];this.F=olympe.D.Ia()}validate(a=null){this.G.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Nr(olympe.dc.ga.ja,this.type);return a?a:'UNKNOWN_MESSAGE'}};
389
+ olympe.dc.ga.ja={tc:1,nf:2,Rg:10,Rz:11,Pu:20,ZA:21,$A:22,Ru:23,xi:24,wi:25,Sz:26,Vo:28,mm:30,om:31,yu:32,bh:40,xk:41,Og:45,Fj:46,Pj:47,Sh:50,Ah:51,ti:52,ev:60,Eu:61,nt:62,ot:63,Is:64,Un:65,Qz:90,yl:91,Hl:92,Wo:93,Ap:94,ek:95,Qu:96,QUERY_RESULT:97,nm:98};olympe.dc.og=class{process(){}};olympe.dc.km=class{constructor(...a){this.Xb=a}process(a,b,c){const d=this.Xb.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Xb[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.km.ma=[olympe.dc.og];olympe.dc.Ec=class{constructor(a){this.tag='string'===typeof a?a:a.T()}T(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}sb(a){return a instanceof olympe.dc.Ec&&this.tag===a.tag}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Ec(b.tag)}};olympe.dc.Ec.ma=[olympe.dc.ze];olympe.dc.Ec.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Ec.prototype.sb.K=olympe.D.J.C;olympe.dc.pg=class{send(){}C(){}qa(){}};const yc=olympe.dc.Aa.ORIGIN,zc=olympe.dc.Aa.DESTINATION,Ac=new Map,Bc=new Map,Cc=new Map,Dc=new Map;function Ec(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.Cn||[])];return olympe.dc.Ca.C(a,b,...c)}function Fc(a,b){Dc.set(a,b);return a}function Gc(a){return(a=Ac.get(a))&&a.C||olympe.dc.CloudObject}function Hc(a,b,c){const d=a+'@'+(b===zc?yc:zc);if(Bc.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Bc.set(d,c)}
390
+ function Ic(a){a=a.T()+'@'+a.Qa();return Bc.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Cc.set(a,b)}function O(a){return a.NAME||null}
391
+ olympe.dc.Ca=class{constructor(){}static C(a,b,...c){if(Ac.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${Ac.get(a).C.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.U.Bb(g):g}}b=new olympe.dc.va.Entry(a,b,d);Ac.set(a,b);return b.C.entry=b}static Wb(a){return(a=a.entry)&&a.T()||null}};olympe.dc.va={};function P(a,b){b=b.Sc();Hc(b.T(),b.Qa(),a.C);return b}function Jc(a){a.F=!0;return a}
392
+ olympe.dc.va.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.Cn=c||null;this.F=!1}T(){return this.tag}instantiate(a,b){const c=this.C;if(this.ij()&&b.getParameter(olympe.dc.Config.Co)){var d=olympe.dc.Pa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.T()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.sa.Ya('dc').error(d)}return this.Cn?(a=[void 0,a].concat(na(b,this.Cn)),new c(...a)):new c(void 0,
393
+ a)}Da(a){return new olympe.dc.va.Property(a)}Ra(a,b=olympe.dc.Aa.DESTINATION){Hc(a,b,this.C);return new olympe.dc.X.Sb(a,b)}ij(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.va.Entry);olympe.dc.va.Entry.prototype.addRelation=olympe.dc.va.Entry.prototype.Ra;olympe.dc.va.Entry.prototype.addProperty=olympe.dc.va.Entry.prototype.Da;olympe.dc.va.Entry.ma=[olympe.dc.ze];olympe.dc.va.Property=class{constructor(a){this.tag=a}T(){return this.tag}};olympe.dc.va.Property.ma=[olympe.dc.ze];olympe.dc.va.Relation=class{constructor(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.wa(a);this.direction=b;this.origin=c;this.destination=d}T(){return this.tag}Qa(){return this.direction}type(){return this.destination}Sc(){return new olympe.dc.va.Relation(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION,this.destination,this.origin)}sb(a){return a instanceof olympe.dc.va.Relation?a.T()===this.T()&&
394
+ a.Qa()===this.Qa():!1}toString(){return this.direction+this.tag}};olympe.dc.va.Relation.prototype.getInverse=olympe.dc.va.Relation.prototype.Sc;olympe.dc.va.Relation.prototype.getDirection=olympe.dc.va.Relation.prototype.Qa;olympe.dc.va.Relation.prototype.getTag=olympe.dc.va.Relation.prototype.T;olympe.dc.va.Relation.ma=[olympe.dc.ze];olympe.dc.db={};function Kc(a,b,c,d,e,f=olympe.dc.Ka.rb){const g=c.Z();Lc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Mc(h,Nc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Oc(a,b){a.Ja.Ta(b)}function Pc(a,b,c){b&&a.Ja.lc(b);c&&a.Ja.Lc(c)}
395
+ olympe.dc.db.Zs=class{constructor(a,b,c,d,e){this.N=a;this.Ja=b;this.C=new olympe.dc.db.Os(a,b,d);this.view=new olympe.dc.jb(a,b);this.Dx=new olympe.dc.db.ju(this.N,this.view,b,e)}Ya(){return this.N}persist(a){this.Ja.Fa();this.Ja.Ab(a,olympe.dc.db.Instance.C.kq);this.Ja.qa()}af(a,b){this.C.af(a,b)}};const Qc=olympe.dc.bc.VERSION,Rc=olympe.dc.bc.Nd,Sc=olympe.dc.jc.Wc,Tc=olympe.dc.jc.ui;
396
+ olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.fc();this.N=b;this.Tb=olympe.D.Ia();this.Ge=c.get('defaultSource')||olympe.dc.Ka.rb;this.R=olympe.dc.db.Database.F.IDLE;this.ka=new Map;this.Pb=[];this.G=[];this.$a=new Map;b=c.get('garbageCollector')||olympe.dc.db.yi.C.Bl;new olympe.dc.db.yi(this,b,this.Tb);c.get('debug')&&this.Vf()}Z(){return this.id}getState(){return this.R}Ya(){return this.N}create(b,c){const d=this.L(b,!0);d.cc(c&&parseInt(c.get(Qc),10)||1);d.ki(c&&
397
+ c.get(Rc)||this.Ge);c&&(c.delete(Qc),c.delete(Rc),this.td(d,c));this.C(a.C.tp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.L(b,!0);var e=c&&parseInt(c.get(Qc),10);0>e||!d&&b.version()>=e||(c.delete(Qc),b.cc(isNaN(e)?b.version()+1:e),this.td(b,c))}}Mc(b){const c=this.get(b);void 0!==c&&(this.cb(c,!1),this.C(a.C.up,b))}link(b,c,d){c=this.L(c,!0);d=this.L(d,!0);switch(b){case Sc:c.Of(d);break;case Tc:c.Ge(d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
398
+ d)switch(b){case Sc:c.$k(d);break;case Tc:c.uh(d);break;default:c.unlink(b,d)}}lc(b){for(const c of b)this.L(c).ea()}Lc(b){for(const c of b)(b=this.get(c))&&b.ka()}Ab(b,c){b.forEach(d=>{this.L(d).Wf(c)})}cc(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.Bo,b))}L(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.C.Ao,b),c&&this.C(a.C.zk,b));return d}Y(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.yk,
399
+ h=olympe.dm.Relation.C.mk,k=olympe.dc.Aa.ORIGIN,l=olympe.dc.Aa.DESTINATION,n=a.hc.Nh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(v,w)=>(v=this.get(v))&&0!==(v.get(n)&w),u=([v,w])=>!r.has(v)&&(e?e(w):!0);for(const v of r.keys())r.get(v)||(r.set(v,!0),yield v),f=this.get(v),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(u).forEach(([A])=>{r.set(A,!1)})})}.bind(this,b)}}Pc(b){this.G[0].Te(olympe.W.xg(),b)}ea(b){if(0===this.G.length)debugger;
400
+ this.G[0].C.delete(b)}C(b,c,...d){this.ka.has(b)&&this.ka.get(b).forEach(e=>{e(c,...d)})}cb(b,c){this.$a.set(b,c)}Of(b,c,d,e){0<this.G.length&&Uc(this.G[0],b).Da(e?Vc+c:c,d)}Pf(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===Wc?f?Uc(g,b).link(c,e):Uc(g,b).unlink(c,e):f?Uc(g,b).$a(c,e):Uc(g,b).Ab(c,e)}}F(b,c){let d=this.ka.get(b);void 0===d&&(d=[],this.ka.set(b,d));d.push(c)}Ta(b){this.Pb.push(b)}ee(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Fa(){this.R===a.F.IDLE&&(this.R=a.F.Cs);this.G.unshift(new olympe.dc.db.dt(this,
401
+ this.Tb))}qa(){this.R=a.F.bg;this.Wf();Xc(this.G[0]);this.G.shift();0===this.G.length&&(this.R=a.F.IDLE,this.Pb.forEach(b=>{b()}))}td(b,c){const d=a.hc.rc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.bl(e.substr(1),f):b.update(e,f))}Wf(){const b=a.hc.ORIGIN,c=this.$a,d=new Map,e=(g,h)=>{const k=g.get(b+Sc);k&&k.forEach((l,n)=>{g!==l&&(d.set(l,h),c.delete(n),e(l,h))})};c.forEach((g,h)=>{d.set(h,g);e(h,g)});const f=this.G[0];d.forEach((g,h)=>{h.td(g)&&(h=h.tag(),g?Uc(f,h).create():Uc(f,h).delete())});
402
+ this.$a.clear()}Vf(){const b=a.hc.DESTINATION,c=a.C.Dl,d=a.C.lk,e=new Set,f=new Map;this.F(a.C.tp,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===Tc&&h[1]===b){const k=h[2];this.get(k).Gb()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Ta(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.N.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
403
+ this.N.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.hc={Nh:'$',wt:'~',rc:'?',ll:'=',$n:'@',ORIGIN:olympe.dc.Aa.ORIGIN,DESTINATION:olympe.dc.Aa.DESTINATION};olympe.dc.db.Database.C={Ao:0,Bo:1,dr:2,zk:3,ao:4,bo:5,Dl:6,Hc:7,lk:8,qm:9,tp:10,up:11,wq:12};olympe.dc.db.Database.F={IDLE:0,Cs:1,bg:2};const Q=olympe.dc.db.Database.C,Yc=olympe.dc.db.Database.hc.Nh,Zc=olympe.dc.db.Database.hc.wt,$c=olympe.dc.db.Database.hc.rc,ad=olympe.dc.db.Database.hc.ll,bd=olympe.dc.db.Database.hc.$n,R=olympe.dc.Aa.ORIGIN,S=olympe.dc.Aa.DESTINATION,cd=olympe.dc.jc.Wc,dd=olympe.dc.jc.ui;
404
+ olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Lc=olympe.dc.Ka.rb;this.e=!1;this.Tb=0;this.F=void 0;this.c=0;this.Fa=a.C.kq;this.db=c}tag(){return this.C}Gb(){return this.e}Pb(){return this.db.ee(this.C)}source(){return this.Lc}version(){return this.Tb}model(){const b=this.get(S+cd);return b&&b.values().next().value||null}Af(){const b=this.get(S+dd);return b&&b.values().next().value||null}persisted(){return this.Fa!==a.C.mr}toString(){var b=this.gb(olympe.dc.CloudObject.nameProp.T());
405
+ b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.gb(olympe.dc.CloudObject.nameProp.T())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Af())?(d=c.gb(olympe.dc.CloudObject.nameProp.T())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}gb(b,c=!1){const d=this.get(Yc+b);return c||void 0!==d?d:this.get(ad+b)}Ta(b,c=!1){const d=this.get($c+
406
+ b);return c||void 0!==d?d:this.get(Zc+b)}update(b,c){const d=Yc+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.sb?f.sb(c):f===c)||(e instanceof olympe.dc.Ec&&(this.db.get(e.T()).Pc(),this.db.Mc(e.T())),c instanceof olympe.dc.Ec&&(e=this.db.L(c.T(),!0),e.F&&e.F.tag!==this.C&&this.db.Ya().fatal('Instance',c.T(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.mb+')','and is assigned as a property of',this.C,'(for the property '+
407
+ b+')'),e.th(this.C,b)),e=ad+b,null===c?(this.delete(d),c=(c=this.model())&&c.Ta(b),void 0!==c?(this.set(e,c),this.L(b,c,!0)):this.L(b,null,!1)):(this.set(d,c),this.delete(e),this.L(b,c,!1)))}bl(b,c){const d=$c+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=Zc+b,null===c?(this.delete(d),c=(c=this.Af())&&c.Ta(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.Y((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.Y((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.Ab(S+
408
+ b);d=c.Ab(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.lk,this.C,b,S,c.C),this.db.C(Q.lk,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.$a(S+b,c.C)&&(c.$a(d,this.C),this.db.C(Q.qm,this.C,b,S,c.C),this.db.C(Q.qm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,S,c,!1),c.G(b,R,this,!1)))}Of(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(cd,c)}this.link(cd,b);b.forEach((d,e)=>{e[0]!==$c&&e[0]!==Zc||this.cb(e.substr(1),d)});
409
+ (b.e||b===this)&&this.db.cb(this,!0)}$k(b){this.unlink(cd,b);this.forEach((c,d)=>{this.cb(d.substr(1),null)});this.db.cb(this,!1)}Ge(b){const c=this.Af();if(null!==c){if(c===b)return;this.unlink(dd,c)}this.link(dd,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===$c||f[0]===Zc)f=f.substr(1),this.has($c+f)||(this.set(Zc+f,e),d.set(f,e))});this.Y(d)}uh(b){this.unlink(dd,b);const c=new Map;this.forEach((d,e)=>{e[0]===Zc&&(this.delete(e),c.set(e.substr(1),null))});this.Y(c)}lc(b,c,d){const e=(...f)=>{var g=
410
+ f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.ea():g.ka());d(...f)};this.Te(b,c,e);return e}Te(b,c,d){const e=this.Ab(bd+b);e.has(c)||(e.set(c,d),this.ea(),this.db.C(Q.ao,this.C,b,c))}R(b,c){const d=this.$a(bd+b,c);void 0!==d&&(this.ka(),this.db.C(Q.bo,this.C,b,c));return d}ki(b){this.Lc=b}cc(b){this.Tb=b}Wf(b){this.Fa=b;this.qa()||this.db.C(Q.zk,this.C)}td(b){const c=this.e!==b;c&&(b?(this.e=b,this.Vf()):(this.Pf(),this.e=b),this.ee(b));return c}ea(){this.c++;1===this.c&&this.db.C(Q.dr,this.C)}ka(){0<
411
+ this.c?--this.c:this.db.C(Q.wq,this.C,`Try to decrease references on instance ${this.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.C(Q.zk,this.C)}qa(){return 0<this.c||this.Fa===olympe.dc.db.Instance.C.lq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;b.forEach(g=>{const h=
412
+ g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===Yc&&b instanceof olympe.dc.Ec&&this.db.get(b.T()).Pc()});void 0!==this.F&&this.db.get(this.F.tag).delete(Yc+this.F.mb)}th(b,c){void 0===this.F&&this.ea();this.F={tag:b,mb:c}}Pc(){void 0!==this.F&&(this.ka(),this.F=void 0)}Vf(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===S){const e=c.substr(1),f=d===R?S:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else d!==Yc&&d!==ad||this.L(c.substr(1),b,d===ad)})}Pf(){this.forEach((b,c)=>
413
+ {const d=c[0];if(d!==bd){var e=c.substr(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===S?b.forEach(f=>{this.unlink(e,f)}):d===Yc&&this.update(d,null);this.delete(c)}});this.Tb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(Yc+this.F.mb);c&&c.T&&c.T()===this.C&&b.update(this.F.mb,null)}}ee(b){this.db.C(b?Q.Dl:Q.Hc,this.C)}L(b,c,d){this.e&&this.db.Of(this.C,b,c,d)}G(b,c,d,e){this.db.Pf(this.C,b,c,d.C,e)}Y(b,c=[]){var d=this.get(R+cd);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>e.cb(g,f))});
414
+ d=this.get(R+dd);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has($c+k)||(g.set(k,h),null!==h?e.set(Zc+k,h):e.delete(Zc+k))});e.Y(g,[...c,f])}})}cb(b,c){if(!this.has(Yc+b)){const d=ad+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.L(b,c,null!==c))}}Ab(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}$a(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&this.delete(b);
415
+ return e}}};olympe.dc.db.Instance.C={mr:0,lq:1,kq:2};const Wc=olympe.dc.db.Database.hc.DESTINATION,Vc=olympe.dc.db.Database.hc.ll,ed=olympe.dc.db.Database.hc.Nh,fd=olympe.dc.db.Database.hc.$n,gd=olympe.dc.db.Database.hc.ORIGIN+Wc,hd=ed+ed;
416
+ function Xc(a){const b=a.Ja;a.F.forEach((c,d)=>{const e=b.get(d);if(c.te()||c.L()){var f=e.get(fd);f&&id(a,f,c.te(),d);c.L()&&a.G.add(d)}for(const [l,n]of c.vd()){var g=l[0]===Vc;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(fd+ed+f);p&&id(d,p,k,g);(h=h.get(fd+hd))&&id(d,h,f,k,g)}for(const l of c.Ta())jd(a,e,...l)});a.F.clear();kd(a)}function Uc(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.F.set(b,c));return c}
417
+ function id(a,b,...c){b.forEach((d,e)=>{a.Te(e,d.bind(null,...c))})}function jd(a,b,c,d,e,f){const g=b.get(fd+d+c);g&&id(a,g,f,e);(b=b.get(fd+gd))&&id(a,b,c,d,f,e)}function kd(a){a.L.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}
418
+ olympe.dc.db.dt=class{constructor(a,b){this.Ja=a;this.L=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}Te(a,b){let c=this.C.get(a);void 0===c&&(c=[],this.C.set(a,c));this.buffer.push([a,c.length]);c.push(b)}};function ld(a){const b=olympe.dc.db.Database.C.Bo,c=olympe.dc.db.Database.C.Dl,d=olympe.dc.db.Database.C.Hc,e=olympe.dc.db.Database.C.lk,f=olympe.dc.db.Database.C.qm,g=olympe.dc.db.Database.C.ao,h=olympe.dc.db.Database.C.bo,k=()=>{};a.Ja.F(olympe.dc.db.Database.C.Ao,()=>{});a.Ja.F(b,()=>{});a.Ja.F(c,l=>{a.Ja.Pc(()=>{md(a.view,l,k,`monitorRelations${l}`)})});a.Ja.F(d,l=>{a.Ja.Pc(()=>{nd(a.view,l,`monitorRelations${l}`)})});a.Ja.F(e,()=>{});a.Ja.F(f,()=>{});a.Ja.F(g,()=>{});a.Ja.F(h,()=>{})}
419
+ olympe.dc.db.ju=class{constructor(a,b,c,d){this.N=a;this.view=b;this.Ja=c;d&&ld(this)}debug(a){const b=olympe.dc.wa(a);if(this.Ja.has(b)){var c=this.Ja.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Gb()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Ja.get(d[d.length-1]);const e=olympe.dc.db.Database.hc.Nh+olympe.dc.CloudObject.nameProp.T();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
420
+ d.join(' --M--\x3e ')}this.N.info(a)}else this.N.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.yi=class a{constructor(b,c,d){this.N=b.Ya();this.Ja=b;this.F=new Set;this.mode=c;this.L=d;this.C=!1;c!==a.C.Bl&&this.R()}run(){if(!this.C)switch(this.mode){case a.C.vs:this.C=!0;this.L.run(()=>{Ib(()=>{this.G();this.C=!1},0)});break;case a.C.Qq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ja,c=olympe.dc.Ub.rf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.qa());for(var g of d){const h=b.get(g);if(h&&!h.qa()){if(!h.persisted())continue;Array.from(b.Y(g,c,!1,f)).forEach(k=>{d.add(k)});
421
+ b.cc(g)}d.delete(g)}for(const h of d)f=Array.from(b.Y(h,c,!0)).map(e),g=Array.from(b.Y(h,c)).map(e),f.some(k=>k.qa())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.cc(k)});d.clear()}R(){this.Ja.Ta(this.run.bind(this));const b=olympe.dc.db.Database.C.dr,c=olympe.dc.db.Database.C.up,d=olympe.dc.db.Database.C.wq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ja.getState()===e&&this.run()};this.Ja.F(olympe.dc.db.Database.C.zk,
422
+ f.bind(this));this.Ja.F(c,f.bind(this));this.Ja.F(b,g=>{this.F.delete(g)});this.Ja.F(d,(g,...h)=>{this.N.error(h[0])})}};olympe.dc.db.yi.C={Bl:0,Qq:1,vs:2};const od=olympe.dc.db.Database.hc.ORIGIN,pd=olympe.dc.db.Database.hc.DESTINATION,qd=olympe.dc.db.Database.hc.Nh,rd=olympe.dc.db.Database.hc.ll,sd=od+pd,td=qd+qd,ud=olympe.dc.db.Database.F;function uc(a,b,c,d){const e=a.Ja.L(olympe.dc.wa(b));d=d||vd(a);e.Te('',d,c);e.Gb()&&a.G.run(()=>{c(!0,b)});return d}function vc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.R('',c);void 0!==f&&(a.Ja.getState()===ud.bg&&a.Ja.ea(c),!d&&e.Gb()&&a.G.run(()=>{f(!1,b)}))}}
423
+ function md(a,b,c,d){const e=a.Ja.L(olympe.dc.wa(b));b=d||vd(a);const f=e.lc(sd,b,c);e.Gb()&&e.forEach((g,h)=>{g=h[0];g!==od&&g!==pd||wd(a,e,h,!0,f,!0)})}function nd(a,b,c){const d=U(a,b);if(null!==d){const e=d.R(sd,c);void 0!==e&&(a.Ja.getState()!==ud.bg||d.Pb()||a.Ja.ea(c),d.Gb()&&d.forEach((f,g)=>{f=g[0];(f===od||f===pd)&&e&&wd(a,d,g,!1,e,!0)}))}}function vd(a){++a.L;return String(a.L)}
424
+ function xd(a,b,c,d,e){b=a.Ja.L(olympe.dc.wa(b));c=olympe.dc.wa(c);const f=qd+c;e=e||vd(a);b.Te(f,e,d);if(b.Gb()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(rd+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Ja.get(olympe.dc.wa(b));return!a||c&&!a.Gb()?null:a}
425
+ function yd(a,b,c){b=a.Ja.L(olympe.dc.wa(b));const d=vd(a);b.Te(td,d,c);b.Gb()&&b.forEach((e,f)=>{const g=f[0];g!==qd&&g!==rd||a.G.run(()=>{c(f.substr(1),e,g===rd)})});return d}function wd(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Gb()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}function V(a,b,c,d,e){b=a.Ja.L(olympe.dc.wa(b));c=c.Qa()+c.T();e=e||vd(a);d=b.lc(c,e,d);b.Gb()&&wd(a,b,c,!0,d,!1);return e}function zd(a,b,c){return c===olympe.dc.Ub.NONE?0:a.gb(b,c,!0)||0}
426
+ function Ad(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===od||c===pd){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}function Bd(a,b,c){if(!a.Gb(b))return a.N.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.wa(b)];for(const f of e){const g=a.tb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.N.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.wa(b)}`);return d}
427
+ function Cd(a,b,c){return null!==a.Wm(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Pa().Xk(d,olympe.dc.CloudObject.propertyRel,b))}function Dd(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Gb()).length:0}
428
+ olympe.dc.jb=class{constructor(a,b){this.N=a;this.G=new olympe.D.Zb('DB View context');this.Ja=b;this.L=0}Z(){return this.Ja.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.wa(b),a.R(qd+b,c),this.Ja.getState()===ud.bg&&this.Ja.ea(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Qa()+b.T();const e=a.R(b,c);void 0!==e&&(this.Ja.getState()!==ud.bg||a.Pb()&&!d||this.Ja.ea(c),!d&&a.Gb()&&wd(this,a,b,!1,e,!1))}}Gb(a){a=U(this,a);return!(!a||!a.Gb())}name(a){return(a=U(this,a))?a.gb(olympe.dc.CloudObject.nameProp.T()):
429
+ ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Af(a){return(a=(a=U(this,a,!0))&&a.Af())?a.tag():null}jj(a){a=U(this,a,!0);return!(!a||!a.Af())}qh(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Rf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Uf(a){return(a=U(this,a,!1))?!!a.persisted():!0}gb(a,b,c){b=(a=U(this,a,!0))?a.gb(olympe.dc.wa(b),c):null;return void 0!==b?b:null}vd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,
430
+ e]of c)c=d[0],(c===qd||!b&&c===rd)&&a.set(d.substring(1),e);return a}tb(a,b){return this.fj(a,[b])}Xk(a,b,c){return this.tb(a,b).includes(olympe.dc.wa(c))}fj(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Qa()+c.T()),void 0!==a)for(const e of a.values())e.Gb()&&b.push(e.tag());a=b}return a}oc(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Qa()+b.T()))&&1<c.size?(this.N.warn(`Relation ${b.T()} to instance ${a} is not unique: found ${c.size} related items`),
431
+ null):(a=c?c.values().next().value:null)&&a.Gb()?a.tag():null:null}Mf(a,b,c){a=olympe.dc.wa(a);const d=Bd(this,a,b);d.delete(a);return c?(c=olympe.dc.wa(c),d.has(c)?Array.from(Bd(this,c,b.Sc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Wm(a,b,c){if(!this.Gb(a))return null;b=Bd(this,a,b);const d=[olympe.dc.wa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}Xm(a,b,c){return this.fj(a,b).find(c)||null}Zv(a,b,c){return this.fj(a,
432
+ b).filter(c)}cn(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Af();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Gb())throw a=`Try to get all extensions of the model ${olympe.dc.wa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
433
+ return e.map(f=>f.tag())}Rf(a,b){const c=olympe.dc.wa(b);return!!this.Wm(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ge(a){return this.tb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.jb.prototype.getInstances=olympe.dc.jb.prototype.ge;olympe.dc.jb.prototype.isExtending=olympe.dc.jb.prototype.Rf;olympe.dc.jb.prototype.getExtendedModels=olympe.dc.jb.prototype.cn;olympe.dc.jb.prototype.findAllRelated=olympe.dc.jb.prototype.Zv;olympe.dc.jb.prototype.findRelated=olympe.dc.jb.prototype.Xm;
434
+ olympe.dc.jb.prototype.findRecursive=olympe.dc.jb.prototype.Wm;olympe.dc.jb.prototype.getRecursiveRelated=olympe.dc.jb.prototype.Mf;olympe.dc.jb.prototype.getUniqueRelated=olympe.dc.jb.prototype.oc;olympe.dc.jb.prototype.getMultiRelated=olympe.dc.jb.prototype.fj;olympe.dc.jb.prototype.isRelated=olympe.dc.jb.prototype.Xk;olympe.dc.jb.prototype.getRelated=olympe.dc.jb.prototype.tb;olympe.dc.jb.prototype.getProperties=olympe.dc.jb.prototype.vd;olympe.dc.jb.prototype.getProperty=olympe.dc.jb.prototype.gb;
435
+ olympe.dc.jb.prototype.isPersisted=olympe.dc.jb.prototype.Uf;olympe.dc.jb.prototype.instanceOf=olympe.dc.jb.prototype.qh;olympe.dc.jb.prototype.isModel=olympe.dc.jb.prototype.jj;olympe.dc.jb.prototype.extension=olympe.dc.jb.prototype.Af;olympe.dc.jb.prototype.model=olympe.dc.jb.prototype.model;olympe.dc.jb.prototype.name=olympe.dc.jb.prototype.name;olympe.dc.jb.prototype.exist=olympe.dc.jb.prototype.Gb;function Ed(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.C.set(b,c));return c}function Fd(a,b,c=olympe.dc.Ub.NONE){b=Gd(a,b,c);for(const d of b)Hd(a,d,!1),a.C.delete(d)}
436
+ function Gd(a,b,c,d=!0){const e=olympe.dm.Relation.C.mk,f=olympe.dm.Relation.C.yk,g=olympe.dc.Aa.ORIGIN,h=olympe.dc.Pa();b=new Set([b]);const k=new Set;for(const n of b){var l=a.C.get(n);if(void 0!==l){for(const [p,q,r]of l.gd())r&&zd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.cb())r&&zd(h,p,c)&e?b.add(q):d||r||k.add(`${q}.${p}.${n}`)}for(const [p,q,r]of Ad(h,n))l=q===g?e:f,!k.has(q===g?`${r}.${p}.${n}`:`${n}.${p}.${r}`)&&zd(h,p,c)&l&&b.add(r)}return Array.from(b).filter(n=>
437
+ a.C.has(n))}function Hd(a,b,c){const d=olympe.dc.Aa.ORIGIN,e=olympe.dc.Aa.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.gd())if(l||!c){f.R(h,e,k);var g=a.C.get(k);g&&g.R(h,d,b)}for(const [h,k,l]of f.cb())if(l||!c)f.R(h,d,k),(g=a.C.get(k))&&g.R(h,e,b)}function*Id(a,b,c,d,e=[]){e.push(b);b=a.If(b);for(const [f,g]of b.tb(c))e.includes(f)||(yield*Id(a,f,c,d,e),yield d(f,g))}function Jd(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.R(b,olympe.dc.Aa.DESTINATION,d);a&&a.R(b,olympe.dc.Aa.ORIGIN,c)}
438
+ olympe.dc.db.zc=class{constructor(a){this.id=a||olympe.W.aj();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substr(0,a.length-2));return a+'}}'}static mc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.zc(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.kg.mc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}$c(a){const b=
439
+ olympe.dc.db.kg.C.Yl,c=olympe.dc.db.kg.C.Hc,d=olympe.dc.db.kg.C.Ak;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.Y()?e.vd():void 0);break;case d:e.Y()&&a.qc(f,e.vd(),g.Yi);break;case c:a.Mc(f,g.Yi)}for(const [h,k,l]of e.gd())l?a.Oa(h,f,k):a.Jb(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.Tb()});return a}F(a,b){a=Ed(this,a).create();b&&a.qa(b)}qc(a,b,c){b&&(a=Ed(this,a).qa(b),c&&a.Pb())}Mc(a,b=olympe.dc.Ub.NONE){const c=this.C.get(a);if(c&&c.te())Fd(this,a,b);else{Ed(this,
440
+ a).delete(b);for(const d of Gd(this,a,b,!1))this.C.get(d).vd().clear(),Hd(this,d,!0)}}Oa(a,b,c){Ed(this,b).link(a,c);Ed(this,c).$a(a,b)}Jb(a,b,c){Ed(this,b).unlink(a,c);Ed(this,c).Ab(a,b)}ge(){return function*(a){for(const b of a.values())if(b.te()||b.L()||b.Y())yield b}(this.C)}If(a){return this.C.get(olympe.dc.wa(a))||null}gd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.gd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Mf(a,b,c=(d,e)=>[d,e]){return Id(this,
441
+ a,b,c)}};olympe.dc.db.zc.ma=[olympe.dc.eh,olympe.dc.jm];const Kd=new Map;
442
+ olympe.dc.db.kg=class a{constructor(b){this.ka=b;this.F=a.F(a.C.Ak,!1);this.G=this.Ma=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ka)+', "state": '+JSON.stringify(this.F);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.Ma){b+=', "relations": {';for(const d of this.Ma.keys()){c=this.Ma.get(d);b+=JSON.stringify(d)+
443
+ ': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static mc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.kg(c.tag);b.F=c.state;const d=c.properties;if(d){b.C=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.Ec.mc(f):h=olympe.D.mc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
444
+ c.relations){b.Ma=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.Ma.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Kd.get(d);void 0===e&&(e={id:b,Yi:c},Kd.set(d,e));return e}tag(){return this.ka}getState(){return this.F}create(){this.F=a.F(a.C.Yl);return this}delete(b=olympe.dc.Ub.NONE){this.F=a.F(a.C.Hc,b);this.C=null;return this}Pb(){this.F.id===a.C.Ak&&(this.F=a.F(a.C.Ak,!0))}Da(b,c){if(this.F.type===a.C.Hc)return this;
445
+ this.C||(this.C=new Map);this.C.set(b,c);return this}qa(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}Fa(b){this.C&&this.C.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.Ma&&(this.Ma=new Map);this.Ra(this.Ma,b,c,!0);return this}unlink(b,c){null===this.Ma&&(this.Ma=new Map);this.Ra(this.Ma,b,c,!1);return this}$a(b,c){this.G||(this.G=new Map);this.Ra(this.G,b,c,!0)}Ab(b,c){this.G||(this.G=new Map);this.Ra(this.G,b,c,!1)}cc(b,c,d){if(c=c===olympe.dc.Aa.ORIGIN?
446
+ this.G:this.Ma)return(b=c.get(b))&&b.get(d)}R(b,c,d){const e=(c=c===olympe.dc.Aa.ORIGIN?this.G:this.Ma)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}te(){return this.F.id===a.C.Yl}L(){return this.F.id===a.C.Hc}Tb(){let b=this.C?this.C.size:0;this.Ma&&this.Ma.forEach(c=>{b+=c.size});return b}Y(){return null!==this.C}vd(){return this.C||new Map}gb(b){if(this.C)return this.C.get(b)}tb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.T()))for(const [e,f]of d)yield c(e,f)}(b.Qa()===olympe.dc.Aa.ORIGIN?
447
+ this.G:this.Ma)}gd(b=(c,d,e)=>[c,d,e]){return this.ea(this.Ma,b)}cb(b=(c,d,e)=>[c,d,e]){return this.ea(this.G,b)}Ta(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.Aa.ORIGIN,d=olympe.dc.Aa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.ea.bind(this),this.Ma,this.G)}Ra(b,c,d,e){if(this.F.id!==a.C.Hc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*ea(b,c){if(null!==b)for(const [d,
448
+ e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.kg.C={Yl:0,Ak:1,Hc:2};function Lc(a,b,c,d,e,f=olympe.dc.Ka.rb){const g=olympe.dc.db.Instance.C.lq,h=olympe.dc.db.Instance.C.mr,k=c.Z();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Ld(c,Md(a,c),f);a.C.push(k);a.F.set(k,l);a.Ja.Fa();a.Ja.Ab(d,g);a.Ja.Ab(e,h);Mc(a,c,f);const n=Array.from(c.ge()).filter(p=>p.te()).map(p=>p.tag());a.Ja.lc(n);a.Ja.qa();0<n.length&&b.xc(()=>{a.Ja.Fa();a.Ja.Lc(n);a.Ja.qa()})}
449
+ function Mc(a,b,c){a.G.process(c,b,d=>{d||a.N.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Nc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.af(d):d,b)}
450
+ function Md(a,b){const c=a.Ja,d=olympe.dc.db.Database.hc.Nh,e=olympe.dc.db.Database.hc.rc,f=olympe.dc.db.Database.hc.ORIGIN,g=olympe.dc.db.Database.hc.DESTINATION,h=olympe.dc.bc.VERSION,k=olympe.dc.bc.Nd,l=new olympe.dc.db.zc('rev-'+b.Z());a.N.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.te()){l.Mc(p,olympe.dc.Ub.NONE);for(const [t,u]of n.gd())l.Jb(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.L()){n=n.getState().Yi;for(const t of c.Y(p,n)){p=c.get(t);const u=(new Map).set(h,
451
+ q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],A=w.substr(1);y===d?u.set(A,v):y===e?u.set(w,v):y===f?v.forEach((D,T)=>{l.Oa(A,T,t,0)}):y===g&&v.forEach((D,T)=>{l.Oa(A,t,T,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.vd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.Ta(v,!0):q.gb(v,!0);t.set(u,void 0===r?null:r)}1<t.size&&l.qc(p,t,!0,0);for(const [u,v,w]of n.gd())w?l.Jb(u,p,v):l.Oa(u,p,v)}}});return l}
452
+ olympe.dc.db.Os=class{constructor(a,b,c){this.N=a;this.Ja=b;this.G=c;this.C=[];this.F=new Map}af(a,b){Mc(this,Nc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Nc(this,c.F,b);this.F.delete(a)}}};function Nd(a,b,c,d){const e=olympe.dc.Aa.DESTINATION;c=c.tag();const f=a.C.If(c);b.vd().forEach((g,h)=>{f.Da(h,g);b.Fa(h)});for(const [g,h,k,l]of b.Ta()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Oa(g,n,p);Jd(d,g,n,p)}}
453
+ function Od(a,b,c,d){const e=olympe.dc.Aa.DESTINATION,f=c.tag(),g=a.C.If(f);b.vd().forEach((h,k)=>{void 0!==c.gb(k)&&(g.Da(k,h),b.Fa(k))});for(const [h,k,l]of b.gd()){const n=c.cc(h,e,k);void 0!==n&&(Jd(d,h,f,k),n===l&&Jd(a.C,h,f,k))}}
454
+ class Ld{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Pa()}Z(){return this.F.Z()}af(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.L()?c.te()||Fd(this.C,b,f.getState().Yi):c.L()?(Nd(this,f,c,a),Fd(a,b,c.getState().Yi)):Od(this,f,c,a))}return a}};olympe.dc.db.O={Ea:'dc.db.Logger',xa:'dc.db.DatabaseManager',Jj:'dc.db.Database',jb:'dc.db.Driver',pt:'dc.db.Graph',oo:'dc.db.DataProcessor',so:'dc.db.DebugProcessor',tA:'dc.db.PermissionProcessor',Gi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Qo:'db.garbageCollector',Gi:'db.monitor',ro:'db.debug'};
455
+ olympe.U.config(function(a){E(a,olympe.dc.db.Config.Qo,olympe.dc.db.yi.C.Qq);E(a,olympe.dc.db.Config.Gi,!1);E(a,olympe.dc.db.Config.ro,!1);C(a,olympe.dc.db.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc.db'));C(a,olympe.dc.db.O.Jj,[olympe.dc.db.O.Ea,new olympe.U.fa(olympe.dc.Config.to),new olympe.U.fa(olympe.dc.db.Config.Qo),new olympe.U.fa(olympe.dc.Config.Yg),new olympe.U.fa(olympe.dc.db.Config.ro)],(b,c,d,e,f)=>{d=e?olympe.dc.db.yi.C.Bl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
456
+ f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.O.jb,[olympe.dc.db.O.xa],b=>b.view);C(a,olympe.dc.db.O.Gi,[olympe.dc.db.O.xa],b=>b.Dx);B(a,olympe.dc.db.O.so,olympe.dc.db.Xb.yo,olympe.dc.O.Ea);C(a,olympe.dc.db.O.oo,[olympe.dc.db.O.Ea,olympe.dc.db.O.Jj,olympe.U.O.cg,new olympe.U.fa(olympe.dc.Config.dg)],(b,c,d,e)=>{b=new olympe.dc.db.Xb.rr(b,c);e&&(b=new olympe.dc.km(ma(d,olympe.dc.db.O.so),b));return b});B(a,olympe.dc.db.O.xa,olympe.dc.db.Zs,olympe.dc.db.O.Ea,olympe.dc.db.O.Jj,olympe.dc.O.oe,
457
+ olympe.dc.db.O.oo,new olympe.U.fa(olympe.dc.db.Config.Gi))},'olympe.dc.db');olympe.U.run([olympe.dc.db.O.Jj,olympe.dc.db.O.Gi],(a,b)=>{olympe.dj().db=a;olympe.dj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Xb={};olympe.dc.db.Xb.rr=class{constructor(a,b){this.N=a;this.Ja=b;this.buffer=[]}process(a,b,c){this.Ja.Fa();b.$c(this);this.Ja.qa();c(null,b)}F(a,b){this.Ja.create(a,b)}qc(a,b,c){this.Ja.update(a,b,c)}Mc(a,b=olympe.dc.Ub.NONE){for(const c of this.Ja.Y(a,b))this.Ja.Mc(c)}Oa(a,b,c){this.Ja.link(a,b,c)}Jb(a,b,c){this.Ja.unlink(a,b,c)}};olympe.dc.db.Xb.rr.ma=[olympe.dc.og,olympe.dc.eh];function Pd(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Ec||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.T()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Nf()+','+f.Hf()+','+f.Cf()+','+f.Bf()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Pd(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
457
458
  (d?d:'')+'}'}
458
- olympe.dc.db.Xb.wo=class{constructor(a){this.N=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.Zc(this);this.N.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Qd(this,b)+')')}pc(a,b){this.log('updateInstance("'+a+'", '+Qd(this,b)+')')}Lc(a,b){var c=olympe.dc.Pa();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Oa(a,b,c){this.log('createRelation("'+
459
- a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Vc?'Model':'')}Jb(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Vc?'Model':'')}};olympe.dc.db.Xb.wo.ma=[olympe.dc.eh,olympe.dc.og];olympe.dc.transaction={};function Rd(a){a&&a(!0,null)}function Sd(a,b,c,d){const e=b+' , '+c;a.L.set(e,d);a.R.add(e);a.oa(b,c,d);null===a.F&&(a.F=setTimeout(a.G.bind(a),a.ha))}
460
- olympe.dc.ri=class{constructor(a,b){this.id=a||olympe.W.hc();this.C=new olympe.D.Zb('BurstTransaction#'+this.id,b);this.oa=Td(this);this.C.onDestroy(()=>Rd());this.aa=new Set;this.L=new Map;this.R=new Set;this.F=null;this.ha=olympe.U.getParameter(olympe.dc.transaction.Config.Rn)||30;this.Y=[]}G(){null!==this.F&&(clearTimeout(this.F),this.F=null);const a=new Map;this.R.forEach(b=>{const c=b.split(' , ');let d=a.get(c[0]);void 0===d&&(d=new Map,a.set(c[0],d));d.set(c[1],this.L.get(b))});0<a.size&&Ud(this,
461
- a);this.R.clear()}push(a,b){const c=olympe.dc.wa(a);a=b.subscribe(d=>{for(const [e,f]of d)d=olympe.dc.wa(e),this.L.get(c+' , '+d)!==f&&Sd(this,c,d,f.valueOf())});this.aa.add(a)}complete(){return new Promise((a,b)=>{this.G();Rd((c,d)=>{for(const e of this.aa)e.unsubscribe();c?a():b(d)})})}update(a,b,c){const d=olympe.dc.wa(a),e=olympe.dc.wa(b);void 0===d||void 0===e?olympe.dc.gi().Za().error('Burst transaction: instance tag or property tag is undefined'):(this.C.run(()=>{olympe.D.vn([c],f=>{f instanceof
462
- olympe.dc.Ec?olympe.dc.gi().Za().error('Cannot send complex property values in burst transactions'):Sd(this,d,e,f.valueOf())})}),this.C.xc(this.G.bind(this)))}stop(){this.C.destroy();this.Y.length=0}Z(){return this.id}rh(){return!1}toString(){return'Burst transaction #'+this.id}};olympe.dc.ri.prototype.complete=olympe.dc.ri.prototype.complete;olympe.dc.ri.prototype.push=olympe.dc.ri.prototype.push;olympe.dc.$p=class{C(){}toString(){}};olympe.dc.transaction.mg=class{constructor(a){this.id=a||olympe.W.aj();this.ta=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.ta.push(...a.ta)}Zc(a){const b=olympe.dc.transaction.mg.C,c=this.ta.length;let d=0;for(;d<c;)switch(this.ta[d]){case b.co:a.F(this.ta[d+1],this.ta[d+2],this.ta[d+3]);d+=4;break;case b.$q:a.pc(this.ta[d+1],this.ta[d+2],this.ta[d+3],this.ta[d+4]);d+=5;break;case b.so:a.Lc(this.ta[d+1],this.ta[d+2],this.ta[d+3]);d+=4;break;case b.eo:a.Oa(this.ta[d+1],this.ta[d+
463
- 2],this.ta[d+3],this.ta[d+4]);d+=5;break;case b.to:a.Jb(this.ta[d+1],this.ta[d+2],this.ta[d+3],this.ta[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.ta[d]+'"');}}F(a,b,c){this.ta.push(olympe.dc.transaction.mg.C.co,a,b,c);this.size++}pc(a,b,c,d){this.ta.push(olympe.dc.transaction.mg.C.$q,a,b,c,d);this.size++}Lc(a,b=olympe.dc.Ub.NONE,c){this.ta.push(olympe.dc.transaction.mg.C.so,a,b,c);this.size++}Oa(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
464
- this.ta.push(olympe.dc.transaction.mg.C.eo,a,b,c,d);this.size++}Jb(a,b,c,d){this.ta.push(olympe.dc.transaction.mg.C.to,a,b,c,d);this.size++}};olympe.dc.transaction.mg.C={co:1,$q:2,so:3,eo:4,to:5};olympe.dc.transaction.mg.ma=[olympe.dc.eh,olympe.dc.jm];function Vd(a,b){return a.R.get(b)||a.db.source(b)||olympe.dc.Ka.qc}function Wd(a,b){return a.L.has(b)?a.L.get(b):a.db.Uf(b)}function Xd(a,b,c,d){var e=d&&d.get(olympe.dc.bc.VERSION);a.versions.set(b,Number(e)||1);d&&a.R.set(b,d.get(olympe.dc.bc.Nd));e=Vd(a,b);a.L.set(b,c&&a.F);a.Gc(e,c,f=>{f.F(b,d,0)})}
465
- olympe.dc.transaction.su=class{constructor(a,b){this.id=b||olympe.W.hc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.zc(b);this.versions=new Map;this.R=new Map;this.Y={};this.L=new Map;this.F=!0}Qf(){return 0===this.G.C.size}persist(a){this.F=a}pc(a,b,c=!1){var d=b&&b.get(olympe.dc.bc.VERSION);this.versions.set(a,Number(d)||1);d=Vd(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Gc(d,Wd(this,a),e=>{e.pc(a,b,c,0)})}Lc(a,b){const c=Vd(this,a),d=Wd(this,
466
- a);this.Gc(c,d,e=>{e.Lc(a,b)})}Oa(a,b,c){const d=Vd(this,b),e=Vd(this,c);let f=Wd(this,b)&&Wd(this,c);f&&d!==e&&a!==olympe.dc.jc.Vc&&(olympe.sa.Za('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Gc(d,f,g=>{g.Oa(a,b,c,0)})}Jb(a,b,c){const d=Vd(this,b),e=Vd(this,c);let f=Wd(this,b)&&Wd(this,c);f&&d!==e&&a!==olympe.dc.jc.Vc&&(olympe.sa.Za('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
467
- f=!1);this.Gc(d,f,g=>{g.Jb(a,b,c,0)})}Gc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.zc(this.id),this.C.set(a,b)),c(b))}};function Yd(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.bc.Nd)if(e===olympe.dc.Ka.rb)d[g]=olympe.dc.Pa().Z();else{if(e===olympe.dc.Ka.Wc)continue}else g.startsWith(olympe.dc.bc.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Tg.qc)&&(g='fd'+g.substr(1));e=a.aa(e);c&&e instanceof Object&&8===e.c?a.Y.set(g,e):d[g]=e}return d}
468
- function Zd(a){if(0===a.Y.size)return null;const b=Object.create(null);a.Y.forEach((c,d)=>{b[d]=c});a.Y.clear();return b}
469
- class $d{constructor(){this.Y=new Map}aa(a){return a instanceof olympe.D.Xa||a instanceof olympe.D.ra||a instanceof olympe.D.ea?a.valueOf():a instanceof Date||a instanceof olympe.D.kb?(a=a instanceof olympe.D.kb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Nf().valueOf(),g:a.Hf().valueOf(),b:a.Cf().valueOf(),a:a.Bf().valueOf()}:a&&'function'===
470
- typeof a.T?{c:8,t:a.T()}:a}}function ae(a){a.Fg=[];a.Ue=[];a.Zf=[];a.Gg=[];a.vg=[]}function be(a){const b={};0<a.vg.length&&(b.vg=a.vg);0<a.Ue.length&&(b.Ue=a.Ue);0<a.Fg.length&&(b.Fg=a.Fg);0<a.Zf.length&&(b.Zf=a.Zf);0<a.Gg.length&&(b.Gg=a.Gg);ae(a);return b}function ce(a){const b=[...a.vg,...a.Ue,...a.Fg,...a.Zf,...a.Gg];ae(a);return b}
471
- olympe.dc.transaction.Md=class{constructor(a=!1){this.Fg=[];this.Ue=[];this.Zf=[];this.Gg=[];this.vg=[];this.G=a;this.C=olympe.D?new $d:new class extends $d{aa(b){return b&&'function'===typeof b.T?{c:8,t:b.T()}:b}}}flush(){return JSON.stringify(ce(this))}F(a,b,c=-1){this.Fg.push({o:1,t:a,p:Yd(this.C,b||null,this.G),i:c});this.G&&(b=Zd(this.C))&&this.Zf.push({o:2,t:a,p:b,i:c})}pc(a,b,c,d=-1){this.Zf.push({o:2,t:a,p:Yd(this.C,b||null,!1),i:d})}Lc(a,b,c=-1){this.Ue.push({o:3,t:a,f:b,i:c})}Oa(a,b,c,d=
459
+ olympe.dc.db.Xb.yo=class{constructor(a){this.N=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.$c(this);this.N.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Pd(this,b)+')')}qc(a,b){this.log('updateInstance("'+a+'", '+Pd(this,b)+')')}Mc(a,b){var c=olympe.dc.Pa();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Oa(a,b,c){this.log('createRelation("'+
460
+ a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Wc?'Model':'')}Jb(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.jc.Wc?'Model':'')}};olympe.dc.db.Xb.yo.ma=[olympe.dc.eh,olympe.dc.og];olympe.dc.transaction={};function Qd(a){a&&a(!0,null)}function Rd(a,b,c,d){const e=b+' , '+c;a.L.set(e,d);a.R.add(e);a.qa(b,c,d);null===a.F&&(a.F=setTimeout(a.G.bind(a),a.ka))}
461
+ olympe.dc.ri=class{constructor(a,b){this.id=a||olympe.W.fc();this.C=new olympe.D.Zb('BurstTransaction#'+this.id,b);this.qa=Sd(this);this.C.onDestroy(()=>Qd());this.ea=new Set;this.L=new Map;this.R=new Set;this.F=null;this.ka=olympe.U.getParameter(olympe.dc.transaction.Config.Tn)||30;this.Y=[]}G(){null!==this.F&&(clearTimeout(this.F),this.F=null);const a=new Map;this.R.forEach(b=>{const c=b.split(' , ');let d=a.get(c[0]);void 0===d&&(d=new Map,a.set(c[0],d));d.set(c[1],this.L.get(b))});0<a.size&&Td(this,
462
+ a);this.R.clear()}push(a,b){const c=olympe.dc.wa(a);a=b.subscribe(d=>{for(const [e,f]of d)d=olympe.dc.wa(e),this.L.get(c+' , '+d)!==f&&Rd(this,c,d,f.valueOf())});this.ea.add(a)}complete(){return new Promise((a,b)=>{this.G();Qd((c,d)=>{for(const e of this.ea)e.unsubscribe();c?a():b(d)})})}update(a,b,c){const d=olympe.dc.wa(a),e=olympe.dc.wa(b);void 0===d||void 0===e?olympe.dc.gi().Ya().error('Burst transaction: instance tag or property tag is undefined'):(this.C.run(()=>{olympe.D.xn([c],f=>{f instanceof
463
+ olympe.dc.Ec?olympe.dc.gi().Ya().error('Cannot send complex property values in burst transactions'):Rd(this,d,e,f.valueOf())})}),this.C.xc(this.G.bind(this)))}stop(){this.C.destroy();this.Y.length=0}Z(){return this.id}rh(){return!1}toString(){return'Burst transaction #'+this.id}};olympe.dc.ri.prototype.complete=olympe.dc.ri.prototype.complete;olympe.dc.ri.prototype.push=olympe.dc.ri.prototype.push;olympe.dc.cq=class{C(){}toString(){}};olympe.dc.transaction.mg=class{constructor(a){this.id=a||olympe.W.aj();this.ua=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.ua.push(...a.ua)}$c(a){const b=olympe.dc.transaction.mg.C,c=this.ua.length;let d=0;for(;d<c;)switch(this.ua[d]){case b.fo:a.F(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.cr:a.qc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.uo:a.Mc(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.ho:a.Oa(this.ua[d+1],this.ua[d+
464
+ 2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.vo:a.Jb(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.ua[d]+'"');}}F(a,b,c){this.ua.push(olympe.dc.transaction.mg.C.fo,a,b,c);this.size++}qc(a,b,c,d){this.ua.push(olympe.dc.transaction.mg.C.cr,a,b,c,d);this.size++}Mc(a,b=olympe.dc.Ub.NONE,c){this.ua.push(olympe.dc.transaction.mg.C.uo,a,b,c);this.size++}Oa(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
465
+ this.ua.push(olympe.dc.transaction.mg.C.ho,a,b,c,d);this.size++}Jb(a,b,c,d){this.ua.push(olympe.dc.transaction.mg.C.vo,a,b,c,d);this.size++}};olympe.dc.transaction.mg.C={fo:1,cr:2,uo:3,ho:4,vo:5};olympe.dc.transaction.mg.ma=[olympe.dc.eh,olympe.dc.jm];function Ud(a,b){return a.R.get(b)||a.db.source(b)||olympe.dc.Ka.rc}function Vd(a,b){return a.L.has(b)?a.L.get(b):a.db.Uf(b)}function Wd(a,b,c,d){var e=d&&d.get(olympe.dc.bc.VERSION);a.versions.set(b,Number(e)||1);d&&a.R.set(b,d.get(olympe.dc.bc.Nd));e=Ud(a,b);a.L.set(b,c&&a.F);a.Gc(e,c,f=>{f.F(b,d,0)})}
466
+ olympe.dc.transaction.wu=class{constructor(a,b){this.id=b||olympe.W.fc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.zc(b);this.versions=new Map;this.R=new Map;this.Y={};this.L=new Map;this.F=!0}Qf(){return 0===this.G.C.size}persist(a){this.F=a}qc(a,b,c=!1){var d=b&&b.get(olympe.dc.bc.VERSION);this.versions.set(a,Number(d)||1);d=Ud(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Gc(d,Vd(this,a),e=>{e.qc(a,b,c,0)})}Mc(a,b){const c=Ud(this,a),d=Vd(this,
467
+ a);this.Gc(c,d,e=>{e.Mc(a,b)})}Oa(a,b,c){const d=Ud(this,b),e=Ud(this,c);let f=Vd(this,b)&&Vd(this,c);f&&d!==e&&a!==olympe.dc.jc.Wc&&(olympe.sa.Ya('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Gc(d,f,g=>{g.Oa(a,b,c,0)})}Jb(a,b,c){const d=Ud(this,b),e=Ud(this,c);let f=Vd(this,b)&&Vd(this,c);f&&d!==e&&a!==olympe.dc.jc.Wc&&(olympe.sa.Ya('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
468
+ f=!1);this.Gc(d,f,g=>{g.Jb(a,b,c,0)})}Gc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.zc(this.id),this.C.set(a,b)),c(b))}};function Xd(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.bc.Nd)if(e===olympe.dc.Ka.rb)d[g]=olympe.dc.Pa().Z();else{if(e===olympe.dc.Ka.Xc)continue}else g.startsWith(olympe.dc.bc.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Tg.rc)&&(g='fd'+g.substr(1));e=a.ea(e);c&&e instanceof Object&&8===e.c?a.Y.set(g,e):d[g]=e}return d}
469
+ function Yd(a){if(0===a.Y.size)return null;const b=Object.create(null);a.Y.forEach((c,d)=>{b[d]=c});a.Y.clear();return b}
470
+ class Zd{constructor(){this.Y=new Map}ea(a){return a instanceof olympe.D.Xa||a instanceof olympe.D.ra||a instanceof olympe.D.da?a.valueOf():a instanceof Date||a instanceof olympe.D.kb?(a=a instanceof olympe.D.kb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Nf().valueOf(),g:a.Hf().valueOf(),b:a.Cf().valueOf(),a:a.Bf().valueOf()}:a&&'function'===
471
+ typeof a.T?{c:8,t:a.T()}:a}}function $d(a){a.Fg=[];a.Ue=[];a.Zf=[];a.Gg=[];a.vg=[]}function ae(a){const b={};0<a.vg.length&&(b.vg=a.vg);0<a.Ue.length&&(b.Ue=a.Ue);0<a.Fg.length&&(b.Fg=a.Fg);0<a.Zf.length&&(b.Zf=a.Zf);0<a.Gg.length&&(b.Gg=a.Gg);$d(a);return b}function be(a){const b=[...a.vg,...a.Ue,...a.Fg,...a.Zf,...a.Gg];$d(a);return b}
472
+ olympe.dc.transaction.Md=class{constructor(a=!1){this.Fg=[];this.Ue=[];this.Zf=[];this.Gg=[];this.vg=[];this.G=a;this.C=olympe.D?new Zd:new class extends Zd{ea(b){return b&&'function'===typeof b.T?{c:8,t:b.T()}:b}}}flush(){return JSON.stringify(be(this))}F(a,b,c=-1){this.Fg.push({o:1,t:a,p:Xd(this.C,b||null,this.G),i:c});this.G&&(b=Yd(this.C))&&this.Zf.push({o:2,t:a,p:b,i:c})}qc(a,b,c,d=-1){this.Zf.push({o:2,t:a,p:Xd(this.C,b||null,!1),i:d})}Mc(a,b,c=-1){this.Ue.push({o:3,t:a,f:b,i:c})}Oa(a,b,c,d=
472
473
  -1){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);this.Gg.push({o:4,m:a,l:b,r:c,i:d})}Jb(a,b,c,d=-1){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');this.vg.push({o:5,m:a,
473
- l:b,r:c,i:d})}};olympe.dc.transaction.Md.ma=[olympe.dc.eh];olympe.dc.transaction.Rh=class{constructor(a){this.id=a||olympe.W.hc();this.C=new Map;this.Ma=new Map}Z(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Rh.Instance(a);if(b)for(const [d,e]of b)c.Da(d,e);this.C.set(a,c)}pc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Lc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
474
- }Oa(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ma.set(a.toString(),a)}Jb(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ma.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.Ma.size+this.C.size}ge(){return this.C}Zc(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;de(c,(f,g)=>{if(g instanceof olympe.dc.Ec){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.pc(d,c)});this.Ma.forEach(c=>{a.Oa(c.C,c.F,c.G)})}};
475
- function de(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Rh.Instance=class{constructor(a){this.tag=a;this.C=new Map}T(){return this.tag}Da(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Rh.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.wa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Rh.ma=[olympe.dc.eh,olympe.dc.jm];function ee(a,b){b&&a.ta.push(b);return b}function fe(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
476
- olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.hc();this.ta=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.ta;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return ee(this,new olympe.dc.transaction.ta.$d(a,b))}qj(a,b=!0){const c=olympe.dc.wa(a);var d=this.ta.find(g=>g instanceof olympe.dc.transaction.ta.$d&&g.T()===c);if(d)return d.persist(b);d=olympe.dc.Pa();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
477
- a);if(d.Uf(a))return null;const f=d.source(a)||olympe.dc.Ka.qc;a=this.create(e,a).persist(b).ki(f);for(const [g,h,k]of Bd(d,a))g!==olympe.dc.jc.Vc&&d.Uf(k)&&this.Oa(g,h===olympe.dc.Aa.DESTINATION?a:k,h===olympe.dc.Aa.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Ub.Hc){ee(this,new olympe.dc.transaction.ta.Mj(a,b))}update(a,b,c){return ee(this,new olympe.dc.transaction.ta.Pi(a,b,c))}Oa(a,b,c){ee(this,new olympe.dc.transaction.ta.lo(a,b,c))}Jb(a,b,c,d){ee(this,new olympe.dc.transaction.ta.Xs(a,b,c,
478
- d))}Qm(a,b,c,d){ee(this,new olympe.dc.transaction.ta.Ws(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Tg.qc+d.T(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}ih(a,b,c='',{Ui:d=olympe.dm.Relation.F.am,pj:e=olympe.dm.Relation.L,Fr:f=olympe.dm.Relation.C.uq,Dr:g=olympe.dm.Relation.C.ql,
479
- sj:h=olympe.dm.Relation.C.hp}={},k=olympe.W.hc()){k=this.create(olympe.dm.Relation,k);k.setProperty(olympe.dc.CloudObject.nameProp,c||'');k.setProperty(olympe.dm.Relation.Im,d);k.setProperty(olympe.dm.Relation.un,e);k.setProperty(olympe.dm.Relation.Sm,f);k.setProperty(olympe.dm.Relation.Rm,g);k.setProperty(olympe.dm.Relation.fl,h);k.setProperty(olympe.dm.Relation.fl,h);this.Oa(olympe.dc.CloudObject.G,a,k);this.Oa(olympe.dm.Relation.destinationModelRel,k,b);this.Oa(olympe.dc.CloudObject.containsRel,
480
- a,k);return k}rh(){return!1}Gm(a){this.F.push(olympe.D.Ia().C(a))}ib(a,b){a=fe([...this.F,a]);ge(this,a,b)}Tm(a){a=fe([...this.F,a]);he(olympe.dc.gi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.ma=[olympe.dc.$p];function Td(a){var b=olympe.dc.gi();const c=a.Z();b.L.set(c,a);a.C.onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.zc(c);e=(new Map).set(olympe.dc.bc.VERSION,b.db.version(d)+1).set(e,f);g.pc(d,e,!1,0);olympe.dc.Dd().af(g,olympe.dc.Ka.rb)}}
481
- function Ud(a,b){var c=olympe.dc.gi();const d=olympe.dc.bc.VERSION,e=olympe.dc.ga.ka.Og,f=a.Z(),g=a.rh(),h=new Map;for(const l of b.keys()){var k=c.db.source(l);if(k===olympe.dc.Ka.rb)continue;let n=h.get(k);n||(n=new olympe.dc.db.zc(f),h.set(k,n));k=b.get(l);k.set(d,c.db.version(l)+1);n.pc(l,k,!1,0)}for(const [l,n]of h)b=yc(new olympe.dc.ga(e,{Gc:n,rh:g},[l]),a.C),c.G.send(b)}
482
- function ge(a,b,c){var d=olympe.dc.gi();if(c&&b){const e=a.Z();d.F.set(e,b);he(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else he(d,a,b,!1)}
483
- function ie(a){const b=olympe.dc.ga.ka.Pj;a.G.C(olympe.dc.ga.ka.Fj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);if(void 0!==f){a.L.delete(c);for(const g of f.Y)g(d);f.stop()}olympe.dc.Dd().af(e,olympe.dc.Ka.rb);a.N.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
484
- function he(a,b,c,d=!1){const e=olympe.D.Ia(),f=c?e.C(c):void 0;c=olympe.dc.Dd();const g=b.Z(),h=new olympe.dc.transaction.su(a.db,g);b.C(h);if(h.Qf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Wd(h,p)?k.push(p):l.push(p);const n=Lc(c,e,h.G,k,l);je(a,h,(p,q,r)=>{q?(ke(a,g,k,h.C.size),le(a,h,d,b.rh(),(t,v)=>{!t&&a.C.has(g)&&(a.C.get(g).forEach(u=>u(olympe.dc.transaction.rg.C.ek,v)),me(a,g));n(t);p&&p(t);f&&f(t,v)})):(a.N.error(r),n(!1),f&&f(!1,r))})}}
485
- function je(a,b,c){const d=[];for(const p of b.versions.keys())a.db.qh(p,olympe.dm.File)&&Wd(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.T(),f=olympe.dm.File.C.T(),g=olympe.dm.File.modificationDateProp.T(),h=Array.from(b.C.values()),k=[],l=new olympe.async.ng(olympe.D.zg()),n=olympe.W.bi();d.forEach(p=>{l.add((q,r)=>{const t=a.db.gb(p,e,!0),v=a.db.gb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,u=>{n.Y(t);null===u?q():uc(a.Y,
486
- p,u,v,w=>{const y=h.reduce((A,D)=>A||D.If(p),null);null!==y&&(y.Da(e,w).Da(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.N.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',p),q())})});Xb(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.zc;k.forEach(([v,u])=>{const w=new Map;w.set(e,u).set(f,!0).set(g,olympe.D.kb.now());t.pc(v,w,!0,0)});r=Lc(olympe.dc.Dd(),olympe.D.zg(),t,[],[])}c(r,p,q)});l.start()}}
487
- function ke(a,b,c,d){const e=olympe.D.zg(),f=new olympe.async.ng(e);0<a.timeout&&Wb(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.C((p,q)=>{n.set('final',p);q?l(q):k()}))});Xb(f,(h,k,l)=>{h||a.N.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.rg.C.Pp&&olympe.dc.Dd().persist(c);me(a,b)});f.start()}
488
- function le(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ga.ka.xk:olympe.dc.ga.ka.bh;c=(h,k,l,n)=>{h=M(new olympe.dc.ga(f,{Gc:h,rh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.ng(olympe.D.zg());for(const [h,k]of b)g.add(c.bind(null,k,h));Xb(g,e);g.start()}}function me(a,b){a.C.delete(b);if(0===a.C.size){for(var c of a.R)c();a.R=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0,null))}
489
- function ne(a,b){0<a.C.size?a.R.push(olympe.D.Ia().C(b)):b()}olympe.dc.transaction.rg=class{constructor(a,b,c,d,e){this.N=a;this.db=b;this.G=c;this.Y=d;this.timeout=e;this.L=new Map;this.C=new Map;this.R=[];this.F=new Map;ie(this)}Za(){return this.N}};olympe.dc.transaction.rg.C={ek:0,Op:1,Pp:2};olympe.dc.transaction.O={Ea:'dc.transaction.Logger',xa:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Rn:'dc.transaction.burstInterval'};
490
- olympe.U.config(function(a){E(a,olympe.dc.transaction.Config.TIMEOUT,6E4);E(a,olympe.dc.transaction.Config.Rn,30);C(a,olympe.dc.transaction.O.Ea,[olympe.sa.O.xa],b=>b.Pc('dc'));B(a,olympe.dc.transaction.O.xa,olympe.dc.transaction.rg,olympe.dc.transaction.O.Ea,olympe.dc.O.si,olympe.dc.O.oe,olympe.dc.O.vi,new olympe.U.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ta={};function W(a){return olympe.dc.wa(a)}function oe(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ya(e));return c}olympe.dc.transaction.ta.Ng=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ya(a){a=olympe.D.Ya(a);return void 0===a||null===a?null:olympe.D.Ur(a)?a.valueOf():a}};olympe.dc.transaction.ta.Ng.ma=[olympe.dc.$p];olympe.dc.transaction.ta.$d=class extends olympe.dc.transaction.ta.Ng{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.hc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.bc.VERSION,1)}T(){return W(this.tag)}Wb(){return W(this.model)}persist(a){this.G=a;return this}ki(a){this.F.set(olympe.dc.bc.Nd,a);return this}rx(){this.F.set(olympe.dc.bc.Nd,olympe.dc.Ka.rb)}setProperty(a,b){this.F.set(olympe.dc.wa(a),b);return this}gl(a){this.setProperty(olympe.dc.CloudObject.nameProp.T(),a);
491
- return this}C(a){const b=olympe.dc.Pa(),c=this.Wb(),d=this.T();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.bc.Nd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ka.qc)}if(b.Gb(d)&&!b.Uf(d)&&this.G){e=new Map([...b.wd(d,!0),...oe(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Ec&&!Wd(a,g.T())&&(f=new olympe.dc.Transaction,f.qj(g.T()),f.C(a));Xd(a,d,this.G,e);a.Oa(olympe.dc.CloudObject.modelRel.T(),
492
- d,c);for(const [g,h,k]of Bd(b,d))Wd(a,k)&&(h===olympe.dc.Aa.ORIGIN?a.Oa(g,k,d):a.Oa(g,d,k))}else b.Gb(d)||(Xd(a,d,this.G,oe(this,this.F)),a.Oa(olympe.dc.CloudObject.modelRel.T(),d,c))}toString(){return`CreateInstance(${this.Wb()}, ${this.T()})`}};olympe.dc.transaction.ta.$d.prototype.setProperty=olympe.dc.transaction.ta.$d.prototype.setProperty;olympe.dc.transaction.ta.$d.prototype.localSource=olympe.dc.transaction.ta.$d.prototype.rx;olympe.dc.transaction.ta.$d.prototype.persist=olympe.dc.transaction.ta.$d.prototype.persist;
493
- olympe.dc.transaction.ta.$d.prototype.getModelTag=olympe.dc.transaction.ta.$d.prototype.Wb;olympe.dc.transaction.ta.$d.prototype.getTag=olympe.dc.transaction.ta.$d.prototype.T;olympe.dc.transaction.ta.$d.ma=[olympe.dc.ze];olympe.dc.transaction.ta.lo=class extends olympe.dc.transaction.ta.Ng{constructor(a,b,c){super();this.type=a.Qa?a:new olympe.dc.X.Sb(W(a));this.F=b;this.G=c}Qa(){return this.Ya(this.type).Qa()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.jc.Vc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
494
- const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Qa()===olympe.dc.Aa.DESTINATION?a.Oa(b,c,d):a.Oa(b,d,c)}toString(){return`CreateRelation('${this.Qa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ta.$y=class extends olympe.dc.transaction.ta.Ng{constructor(a,b=olympe.dc.Ub.Hc){super();this.model=a;this.F=b}Wb(){return W(this.model)}C(a){const b=this.Wb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Pa();for(const d of c.ge(b))d!==b&&(new olympe.dc.transaction.ta.Mj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Wb()}, ${this.F})`}};olympe.dc.transaction.ta.Ws=class extends olympe.dc.transaction.ta.Ng{constructor(a,b,c,d){super();this.F=a.Qa?a:new olympe.dc.X.Sb(W(a));this.G=b;this.L=c||!1;this.R=d instanceof Array?d.map(e=>W(e)):null}Qa(){return this.Ya(this.F).Qa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Vc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
495
- var d=olympe.dc.Pa();const e=this.Qa(),f=this.R;d=d.tb(c,this.F);for(const g of d)e===olympe.dc.Aa.DESTINATION?a.Jb(b,c,g):a.Jb(b,g,c),null!==f&&0<=f.indexOf(g)||this.L&&(new olympe.dc.transaction.ta.Mj(g,olympe.dc.Ub.Hc)).C(a)}toString(){return`DeleteAllRelations(${this.Qa()}${W(this.F)}, ${W(this.G)}, ${this.L})`}};olympe.dc.transaction.ta.Mj=class extends olympe.dc.transaction.ta.Ng{constructor(a,b=olympe.dc.Ub.Hc){super();this.tag=a;this.F=b}T(){return W(this.tag)}C(a){const b=olympe.dc.Pa(),c=this.T();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Lc(c,this.F)}toString(){return'DeleteInstance('+this.T()+', '+this.F+')'}};olympe.dc.transaction.ta.Xs=class extends olympe.dc.transaction.ta.lo{constructor(a,b,c,d=!1){super(a,b,c);this.L=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Vc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
496
- this.Qa()===olympe.dc.Aa.DESTINATION?a.Jb(b,c,d):a.Jb(b,d,c);this.L&&(new olympe.dc.transaction.ta.Mj(d,olympe.dc.Ub.Hc)).C(a)}toString(){return'DeleteRelation('+this.Qa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.L+')'}};olympe.dc.transaction.ta.Pi=class extends olympe.dc.transaction.ta.Ng{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.bc.VERSION,-1);void 0!==b&&this.setProperty(b,c)}T(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.T();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Pa();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
497
- b+' not found so it cannot be updated');d=oe(this,this.F);0>=d.get(olympe.dc.bc.VERSION)&&d.set(olympe.dc.bc.VERSION,e+1);for(const [f,g]of d)e=c.gb(b,f),e instanceof olympe.dc.Ec&&(e=e.T(),a.Y[e]=!0),g instanceof olympe.dc.Ec&&!Wd(a,g.T())&&(e=new olympe.dc.Transaction,e.qj(g.T()),e.C(a));a.pc(b,d)}toString(){return'UpdateInstance('+this.T()+', '+oe(this,this.F)+')'}};olympe.dc.transaction.ta.Pi.prototype.setProperty=olympe.dc.transaction.ta.Pi.prototype.setProperty;
498
- olympe.dc.transaction.ta.Pi.prototype.getTag=olympe.dc.transaction.ta.Pi.prototype.T;olympe.dc.da={};olympe.dc.ze=class{T(){}};olympe.dc.ze.prototype.getTag=olympe.dc.ze.prototype.T;olympe.dc.Pz=olympe.dc.ze;olympe.dc.da.aq={ASC:'ASC',DESC:'DESC'};function pe(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.da.V.Ic(a.p,b,olympe.dc.Pa());case 2:return new olympe.dc.da.V.Uc(a.p,a.s,olympe.dc.Pa(),a.c);case 3:return new olympe.dc.da.V.Fh(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.da.V.md(pe(a.v));case 5:return new olympe.dc.da.V.Ad(a.p,new RegExp(a.r),olympe.dc.Pa(),a.c);case 6:b=new olympe.dc.da.V.De(a.d);
499
- for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Lk(a):b.vb(a);return b;case 7:return new olympe.dc.da.V.ee(...a.p.map(d=>pe(d)));case 8:return new olympe.dc.da.V.Yd(...a.p.map(d=>pe(d)));default:return null}}
500
- olympe.dc.da.ab=class{observe(){}ib(){}clear(){}ja(){}toString(){}static sb(a,b){return new olympe.dc.da.V.Ic(a,b,olympe.dc.Pa())}static contains(a,b,c=!1){return new olympe.dc.da.V.Uc(a,b,olympe.dc.Pa(),c)}static ds(a,b,c=!0){return new olympe.dc.da.V.Ad(a,b,olympe.dc.Pa(),c)}static Rk(a,b,c=!0){return new olympe.dc.da.V.Fh(a,b,!1,c)}static vj(a,b,c=!0){return new olympe.dc.da.V.Fh(a,b,!0,c)}static and(...a){return new olympe.dc.da.V.Yd(...a)}static or(...a){return new olympe.dc.da.V.ee(...a)}static not(a){return new olympe.dc.da.V.md(a)}};
501
- olympe.dc.da.ab.not=olympe.dc.da.ab.not;olympe.dc.da.ab.or=olympe.dc.da.ab.or;olympe.dc.da.ab.and=olympe.dc.da.ab.and;olympe.dc.da.ab.smallerThan=olympe.dc.da.ab.vj;olympe.dc.da.ab.greaterThan=olympe.dc.da.ab.Rk;olympe.dc.da.ab.regex=olympe.dc.da.ab.ds;olympe.dc.da.ab.contains=olympe.dc.da.ab.contains;olympe.dc.da.ab.equals=olympe.dc.da.ab.sb;function qe(a,b){return new olympe.dc.hb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function re(a){return a.C.filter(b=>b instanceof olympe.dc.da.Lb.hg||b instanceof olympe.dc.da.Lb.ig).length}function se(a){const b=a.C.findIndex(c=>c instanceof olympe.dc.da.Lb.Qh);a=0===a.F.size?a.Ti():a;if(0<=b&&!a.F.has(b))throw Error('AndReturn was not called for the current level before sortBy operator');return a}
502
- function te(a,b){const c=olympe.dc.Hd.SUBSCRIBE,d=olympe.dc.Hd.Ii,e=new olympe.dc.hf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.da.Lb.hg?e.vb(f.Td()):f instanceof olympe.dc.da.Lb.ig?e.vb(f.Td(),!0):f instanceof olympe.dc.da.Lb.tc&&(a=f.G(),a instanceof olympe.dc.da.V.De&&(a=a.gd(),a.forEach(g=>e.vb(g)),ue(e,a.length)));return e}function ve(a){return new olympe.dc.hb(a.r,a.s,a.qp.map(b=>we(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
503
- olympe.dc.hb=class{constructor(a,b=olympe.dc.Ka.qc,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Pa();this.G=olympe.dc.wa(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a){return new olympe.dc.hb(a)}static Uk(a,b){return(new olympe.dc.hb(a,b)).vb(olympe.dc.CloudObject.instancesRel)}vb(a){const b=Array.from(this.C);b.push(new olympe.dc.da.Lb.hg(this.db,a));return qe(this,b)}Yv(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.da.Lb.ig(this.db,
504
- a,b));return qe(this,c)}Ti(){this.F.add(re(this));return new olympe.dc.hb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.da.Lb.tc(a));return qe(this,b)}Vi(){return this}limit(a,b=0){return new olympe.dc.hb(this.G,this.source,this.C,this.F,{max:a,offset:b})}zn(a,b){const c=Array.from(this.C);c.push(new olympe.dc.da.Lb.Qh(this.db,a,b));return qe(this,c)}ib(a){return xe(olympe.dc.Kf(),se(this),'function'===typeof a.Fc?a.Fc():
505
- a)}observe(a){return ye(olympe.dc.Kf(),se(this),'function'===typeof a.Fc?a.Fc():a)}vd(){var a=se(this);return olympe.dc.Kf().R.vd(a)}Z(){null===this.id&&(this.id=olympe.W.ob(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}ja(){return{r:this.G,qp:this.C.map(a=>a.ja()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.hb.prototype.executeFromCache=olympe.dc.hb.prototype.vd;
506
- olympe.dc.hb.prototype.observe=olympe.dc.hb.prototype.observe;olympe.dc.hb.prototype.execute=olympe.dc.hb.prototype.ib;olympe.dc.hb.prototype.sortBy=olympe.dc.hb.prototype.zn;olympe.dc.hb.prototype.limit=olympe.dc.hb.prototype.limit;olympe.dc.hb.prototype.cast=olympe.dc.hb.prototype.Vi;olympe.dc.hb.prototype.filter=olympe.dc.hb.prototype.filter;olympe.dc.hb.prototype.andReturn=olympe.dc.hb.prototype.Ti;olympe.dc.hb.prototype.followRecursively=olympe.dc.hb.prototype.Yv;
507
- olympe.dc.hb.prototype.follow=olympe.dc.hb.prototype.vb;olympe.dc.hb.instancesOf=olympe.dc.hb.Uk;olympe.dc.hb.from=olympe.dc.hb.from;function we(a){const b=olympe.dc.Pa();switch(a.t){case 1:return(a=pe(a.p))?new olympe.dc.da.Lb.tc(a):null;case 2:return new olympe.dc.da.Lb.hg(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.da.Lb.ig(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.da.Lb.Qh(b,new olympe.dc.ua.Property(a.p),c);default:return null}}olympe.dc.da.jk=class{ja(){}F(){}ib(){}observe(){}toString(){}};function ze(a){return a.G.map(b=>a.F.get(a.C[b]))}function Ae(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Be(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.T()))}function Ce(a){return new Set(a.L.flatMap(b=>b.split('.')))}
508
- function De(a,b){var c=olympe.dc.Pa();if(c.Gb(a)){b.F(a,c.wd(a,!0),0);b.Oa(olympe.dc.jc.Vc,a,c.model(a),0);for(const [d,e,f]of Bd(c,a))(c=b.If(f))&&c.te()&&(e===olympe.dc.Aa.DESTINATION?b.Oa(d,a,f,0):b.Oa(d,f,a,0))}else olympe.sa.Za('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
509
- function Ee(a,b,c=olympe.dc.Ka.Wc){b&&b((new olympe.dc.W.Hi(c)).C(a.p||[]));const d=olympe.dc.Pa();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Gb(h)?olympe.dc.CloudObject.get(h):(olympe.sa.Za('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Wa.create(b,a.a,a.r)}
474
+ l:b,r:c,i:d})}};olympe.dc.transaction.Md.ma=[olympe.dc.eh];olympe.dc.transaction.Rh=class{constructor(a){this.id=a||olympe.W.fc();this.C=new Map;this.Ma=new Map}Z(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Rh.Instance(a);if(b)for(const [d,e]of b)c.Da(d,e);this.C.set(a,c)}qc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Mc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
475
+ }Oa(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ma.set(a.toString(),a)}Jb(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.Ma.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.Ma.size+this.C.size}ge(){return this.C}$c(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ce(c,(f,g)=>{if(g instanceof olympe.dc.Ec){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.qc(d,c)});this.Ma.forEach(c=>{a.Oa(c.C,c.F,c.G)})}};
476
+ function ce(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Rh.Instance=class{constructor(a){this.tag=a;this.C=new Map}T(){return this.tag}Da(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Rh.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.wa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Rh.ma=[olympe.dc.eh,olympe.dc.jm];function de(a,b){b&&a.ua.push(b);return b}function ee(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
477
+ olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.fc();this.ua=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.ua;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return de(this,new olympe.dc.transaction.ua.Zd(a,b))}qj(a,b=!0){const c=olympe.dc.wa(a);var d=this.ua.find(g=>g instanceof olympe.dc.transaction.ua.Zd&&g.T()===c);if(d)return d.persist(b);d=olympe.dc.Pa();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
478
+ a);if(d.Uf(a))return null;const f=d.source(a)||olympe.dc.Ka.rc;a=this.create(e,a).persist(b).ki(f);for(const [g,h,k]of Ad(d,a))g!==olympe.dc.jc.Wc&&d.Uf(k)&&this.Oa(g,h===olympe.dc.Aa.DESTINATION?a:k,h===olympe.dc.Aa.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Ub.Hc){de(this,new olympe.dc.transaction.ua.Mj(a,b))}update(a,b,c){return de(this,new olympe.dc.transaction.ua.Pi(a,b,c))}Oa(a,b,c){de(this,new olympe.dc.transaction.ua.no(a,b,c))}Jb(a,b,c,d){de(this,new olympe.dc.transaction.ua.at(a,b,c,
479
+ d))}Rm(a,b,c,d){de(this,new olympe.dc.transaction.ua.$s(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Tg.rc+d.T(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}ih(a,b,c='',{Ui:d=olympe.dm.Relation.F.am,pj:e=olympe.dm.Relation.L,Ir:f=olympe.dm.Relation.C.xq,Gr:g=olympe.dm.Relation.C.ql,
480
+ sj:h=olympe.dm.Relation.C.kp}={},k=olympe.W.fc()){k=this.create(olympe.dm.Relation,k);k.setProperty(olympe.dc.CloudObject.nameProp,c||'');k.setProperty(olympe.dm.Relation.Jm,d);k.setProperty(olympe.dm.Relation.wn,e);k.setProperty(olympe.dm.Relation.Tm,f);k.setProperty(olympe.dm.Relation.Sm,g);k.setProperty(olympe.dm.Relation.fl,h);k.setProperty(olympe.dm.Relation.fl,h);this.Oa(olympe.dc.CloudObject.G,a,k);this.Oa(olympe.dm.Relation.destinationModelRel,k,b);this.Oa(olympe.dc.CloudObject.containsRel,
481
+ a,k);return k}rh(){return!1}Hm(a){this.F.push(olympe.D.Ia().C(a))}ib(a,b){a=ee([...this.F,a]);fe(this,a,b)}Um(a){a=ee([...this.F,a]);ge(olympe.dc.gi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.ma=[olympe.dc.cq];function Sd(a){var b=olympe.dc.gi();const c=a.Z();b.L.set(c,a);a.C.onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.zc(c);e=(new Map).set(olympe.dc.bc.VERSION,b.db.version(d)+1).set(e,f);g.qc(d,e,!1,0);olympe.dc.Dd().af(g,olympe.dc.Ka.rb)}}
482
+ function Td(a,b){var c=olympe.dc.gi();const d=olympe.dc.bc.VERSION,e=olympe.dc.ga.ja.Og,f=a.Z(),g=a.rh(),h=new Map;for(const l of b.keys()){var k=c.db.source(l);if(k===olympe.dc.Ka.rb)continue;let n=h.get(k);n||(n=new olympe.dc.db.zc(f),h.set(k,n));k=b.get(l);k.set(d,c.db.version(l)+1);n.qc(l,k,!1,0)}for(const [l,n]of h)b=xc(new olympe.dc.ga(e,{Gc:n,rh:g},[l]),a.C),c.G.send(b)}
483
+ function fe(a,b,c){var d=olympe.dc.gi();if(c&&b){const e=a.Z();d.F.set(e,b);ge(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else ge(d,a,b,!1)}
484
+ function he(a){const b=olympe.dc.ga.ja.Pj;a.G.C(olympe.dc.ga.ja.Fj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);if(void 0!==f){a.L.delete(c);for(const g of f.Y)g(d);f.stop()}olympe.dc.Dd().af(e,olympe.dc.Ka.rb);a.N.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
485
+ function ge(a,b,c,d=!1){const e=olympe.D.Ia(),f=c?e.C(c):void 0;c=olympe.dc.Dd();const g=b.Z(),h=new olympe.dc.transaction.wu(a.db,g);b.C(h);if(h.Qf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Vd(h,p)?k.push(p):l.push(p);const n=Kc(c,e,h.G,k,l);ie(a,h,(p,q,r)=>{q?(je(a,g,k,h.C.size),ke(a,h,d,b.rh(),(t,u)=>{!t&&a.C.has(g)&&(a.C.get(g).forEach(v=>v(olympe.dc.transaction.rg.C.ek,u)),le(a,g));n(t);p&&p(t);f&&f(t,u)})):(a.N.error(r),n(!1),f&&f(!1,r))})}}
486
+ function ie(a,b,c){const d=[];for(const p of b.versions.keys())a.db.qh(p,olympe.dm.File)&&Vd(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.T(),f=olympe.dm.File.C.T(),g=olympe.dm.File.modificationDateProp.T(),h=Array.from(b.C.values()),k=[],l=new olympe.async.ng(olympe.D.zg()),n=olympe.W.bi();d.forEach(p=>{l.add((q,r)=>{const t=a.db.gb(p,e,!0),u=a.db.gb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.Y(t);null===v?q():tc(a.Y,
487
+ p,v,u,w=>{const y=h.reduce((A,D)=>A||D.If(p),null);null!==y&&(y.Da(e,w).Da(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.N.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',p),q())})});Xb(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.zc;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.kb.now());t.qc(u,w,!0,0)});r=Kc(olympe.dc.Dd(),olympe.D.zg(),t,[],[])}c(r,p,q)});l.start()}}
488
+ function je(a,b,c,d){const e=olympe.D.zg(),f=new olympe.async.ng(e);0<a.timeout&&Wb(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.C((p,q)=>{n.set('final',p);q?l(q):k()}))});Xb(f,(h,k,l)=>{h||a.N.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.rg.C.Sp&&olympe.dc.Dd().persist(c);le(a,b)});f.start()}
489
+ function ke(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ga.ja.xk:olympe.dc.ga.ja.bh;c=(h,k,l,n)=>{h=M(new olympe.dc.ga(f,{Gc:h,rh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.ng(olympe.D.zg());for(const [h,k]of b)g.add(c.bind(null,k,h));Xb(g,e);g.start()}}function le(a,b){a.C.delete(b);if(0===a.C.size){for(var c of a.R)c();a.R=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0,null))}
490
+ function me(a,b){0<a.C.size?a.R.push(olympe.D.Ia().C(b)):b()}olympe.dc.transaction.rg=class{constructor(a,b,c,d,e){this.N=a;this.db=b;this.G=c;this.Y=d;this.timeout=e;this.L=new Map;this.C=new Map;this.R=[];this.F=new Map;he(this)}Ya(){return this.N}};olympe.dc.transaction.rg.C={ek:0,Rp:1,Sp:2};olympe.dc.transaction.O={Ea:'dc.transaction.Logger',xa:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Tn:'dc.transaction.burstInterval'};
491
+ olympe.U.config(function(a){E(a,olympe.dc.transaction.Config.TIMEOUT,6E4);E(a,olympe.dc.transaction.Config.Tn,30);C(a,olympe.dc.transaction.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc'));B(a,olympe.dc.transaction.O.xa,olympe.dc.transaction.rg,olympe.dc.transaction.O.Ea,olympe.dc.O.si,olympe.dc.O.oe,olympe.dc.O.vi,new olympe.U.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ua={};function W(a){return olympe.dc.wa(a)}function ne(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Za(e));return c}olympe.dc.transaction.ua.Ng=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Za(a){a=olympe.D.Za(a);return void 0===a||null===a?null:olympe.D.Xr(a)?a.valueOf():a}};olympe.dc.transaction.ua.Ng.ma=[olympe.dc.cq];olympe.dc.transaction.ua.Zd=class extends olympe.dc.transaction.ua.Ng{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.fc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.bc.VERSION,1)}T(){return W(this.tag)}Wb(){return W(this.model)}persist(a){this.G=a;return this}ki(a){this.F.set(olympe.dc.bc.Nd,a);return this}vx(){this.F.set(olympe.dc.bc.Nd,olympe.dc.Ka.rb)}setProperty(a,b){this.F.set(olympe.dc.wa(a),b);return this}gl(a){this.setProperty(olympe.dc.CloudObject.nameProp.T(),a);
492
+ return this}C(a){const b=olympe.dc.Pa(),c=this.Wb(),d=this.T();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.bc.Nd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ka.rc)}if(b.Gb(d)&&!b.Uf(d)&&this.G){e=new Map([...b.vd(d,!0),...ne(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Ec&&!Vd(a,g.T())&&(f=new olympe.dc.Transaction,f.qj(g.T()),f.C(a));Wd(a,d,this.G,e);a.Oa(olympe.dc.CloudObject.modelRel.T(),
493
+ d,c);for(const [g,h,k]of Ad(b,d))Vd(a,k)&&(h===olympe.dc.Aa.ORIGIN?a.Oa(g,k,d):a.Oa(g,d,k))}else b.Gb(d)||(Wd(a,d,this.G,ne(this,this.F)),a.Oa(olympe.dc.CloudObject.modelRel.T(),d,c))}toString(){return`CreateInstance(${this.Wb()}, ${this.T()})`}};olympe.dc.transaction.ua.Zd.prototype.setProperty=olympe.dc.transaction.ua.Zd.prototype.setProperty;olympe.dc.transaction.ua.Zd.prototype.localSource=olympe.dc.transaction.ua.Zd.prototype.vx;olympe.dc.transaction.ua.Zd.prototype.persist=olympe.dc.transaction.ua.Zd.prototype.persist;
494
+ olympe.dc.transaction.ua.Zd.prototype.getModelTag=olympe.dc.transaction.ua.Zd.prototype.Wb;olympe.dc.transaction.ua.Zd.prototype.getTag=olympe.dc.transaction.ua.Zd.prototype.T;olympe.dc.transaction.ua.Zd.ma=[olympe.dc.ze];olympe.dc.transaction.ua.no=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c){super();this.type=a.Qa?a:new olympe.dc.X.Sb(W(a));this.F=b;this.G=c}Qa(){return this.Za(this.type).Qa()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.jc.Wc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
495
+ const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Qa()===olympe.dc.Aa.DESTINATION?a.Oa(b,c,d):a.Oa(b,d,c)}toString(){return`CreateRelation('${this.Qa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ua.ez=class extends olympe.dc.transaction.ua.Ng{constructor(a,b=olympe.dc.Ub.Hc){super();this.model=a;this.F=b}Wb(){return W(this.model)}C(a){const b=this.Wb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Pa();for(const d of c.ge(b))d!==b&&(new olympe.dc.transaction.ua.Mj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Wb()}, ${this.F})`}};olympe.dc.transaction.ua.$s=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c,d){super();this.F=a.Qa?a:new olympe.dc.X.Sb(W(a));this.G=b;this.L=c||!1;this.R=d instanceof Array?d.map(e=>W(e)):null}Qa(){return this.Za(this.F).Qa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Wc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
496
+ var d=olympe.dc.Pa();const e=this.Qa(),f=this.R;d=d.tb(c,this.F);for(const g of d)e===olympe.dc.Aa.DESTINATION?a.Jb(b,c,g):a.Jb(b,g,c),null!==f&&0<=f.indexOf(g)||this.L&&(new olympe.dc.transaction.ua.Mj(g,olympe.dc.Ub.Hc)).C(a)}toString(){return`DeleteAllRelations(${this.Qa()}${W(this.F)}, ${W(this.G)}, ${this.L})`}};olympe.dc.transaction.ua.Mj=class extends olympe.dc.transaction.ua.Ng{constructor(a,b=olympe.dc.Ub.Hc){super();this.tag=a;this.F=b}T(){return W(this.tag)}C(a){const b=olympe.dc.Pa(),c=this.T();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Mc(c,this.F)}toString(){return'DeleteInstance('+this.T()+', '+this.F+')'}};olympe.dc.transaction.ua.at=class extends olympe.dc.transaction.ua.no{constructor(a,b,c,d=!1){super(a,b,c);this.L=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.jc.Wc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
497
+ this.Qa()===olympe.dc.Aa.DESTINATION?a.Jb(b,c,d):a.Jb(b,d,c);this.L&&(new olympe.dc.transaction.ua.Mj(d,olympe.dc.Ub.Hc)).C(a)}toString(){return'DeleteRelation('+this.Qa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.L+')'}};olympe.dc.transaction.ua.Pi=class extends olympe.dc.transaction.ua.Ng{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.bc.VERSION,-1);void 0!==b&&this.setProperty(b,c)}T(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.T();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Pa();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
498
+ b+' not found so it cannot be updated');d=ne(this,this.F);0>=d.get(olympe.dc.bc.VERSION)&&d.set(olympe.dc.bc.VERSION,e+1);for(const [f,g]of d)e=c.gb(b,f),e instanceof olympe.dc.Ec&&(e=e.T(),a.Y[e]=!0),g instanceof olympe.dc.Ec&&!Vd(a,g.T())&&(e=new olympe.dc.Transaction,e.qj(g.T()),e.C(a));a.qc(b,d)}toString(){return'UpdateInstance('+this.T()+', '+ne(this,this.F)+')'}};olympe.dc.transaction.ua.Pi.prototype.setProperty=olympe.dc.transaction.ua.Pi.prototype.setProperty;
499
+ olympe.dc.transaction.ua.Pi.prototype.getTag=olympe.dc.transaction.ua.Pi.prototype.T;olympe.dc.ba={};olympe.dc.ze=class{T(){}};olympe.dc.ze.prototype.getTag=olympe.dc.ze.prototype.T;olympe.dc.Uz=olympe.dc.ze;olympe.dc.ba.eq={ASC:'ASC',DESC:'DESC'};function oe(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.ba.V.Ic(a.p,b,olympe.dc.Pa());case 2:return new olympe.dc.ba.V.Vc(a.p,a.s,olympe.dc.Pa(),a.c);case 3:return new olympe.dc.ba.V.Fh(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.ba.V.md(oe(a.v));case 5:return new olympe.dc.ba.V.zd(a.p,new RegExp(a.r),olympe.dc.Pa(),a.c);case 6:b=new olympe.dc.ba.V.De(a.d);
500
+ for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Lk(a):b.vb(a);return b;case 7:return new olympe.dc.ba.V.de(...a.p.map(d=>oe(d)));case 8:return new olympe.dc.ba.V.Xd(...a.p.map(d=>oe(d)));default:return null}}
501
+ olympe.dc.ba.bb=class{observe(){}ib(){}clear(){}ia(){}toString(){}static sb(a,b){return new olympe.dc.ba.V.Ic(a,b,olympe.dc.Pa())}static contains(a,b,c=!1){return new olympe.dc.ba.V.Vc(a,b,olympe.dc.Pa(),c)}static hs(a,b,c=!0){return new olympe.dc.ba.V.zd(a,b,olympe.dc.Pa(),c)}static Rk(a,b,c=!0){return new olympe.dc.ba.V.Fh(a,b,!1,c)}static vj(a,b,c=!0){return new olympe.dc.ba.V.Fh(a,b,!0,c)}static and(...a){return new olympe.dc.ba.V.Xd(...a)}static or(...a){return new olympe.dc.ba.V.de(...a)}static not(a){return new olympe.dc.ba.V.md(a)}};
502
+ olympe.dc.ba.bb.not=olympe.dc.ba.bb.not;olympe.dc.ba.bb.or=olympe.dc.ba.bb.or;olympe.dc.ba.bb.and=olympe.dc.ba.bb.and;olympe.dc.ba.bb.smallerThan=olympe.dc.ba.bb.vj;olympe.dc.ba.bb.greaterThan=olympe.dc.ba.bb.Rk;olympe.dc.ba.bb.regex=olympe.dc.ba.bb.hs;olympe.dc.ba.bb.contains=olympe.dc.ba.bb.contains;olympe.dc.ba.bb.equals=olympe.dc.ba.bb.sb;function pe(a,b){return new olympe.dc.hb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function qe(a){return a.C.filter(b=>b instanceof olympe.dc.ba.Lb.hg||b instanceof olympe.dc.ba.Lb.ig).length}function re(a){const b=a.C.findIndex(c=>c instanceof olympe.dc.ba.Lb.Qh);a=0===a.F.size?a.Ti():a;if(0<=b&&!a.F.has(b))throw Error('AndReturn was not called for the current level before sortBy operator');return a}
503
+ function se(a,b){const c=olympe.dc.Hd.SUBSCRIBE,d=olympe.dc.Hd.Ii,e=new olympe.dc.hf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.ba.Lb.hg?e.vb(f.Sd()):f instanceof olympe.dc.ba.Lb.ig?e.vb(f.Sd(),!0):f instanceof olympe.dc.ba.Lb.uc&&(a=f.C,a instanceof olympe.dc.ba.V.De&&(a=a.gd(),a.forEach(g=>e.vb(g)),te(e,a.length)));return e}function ue(a){return new olympe.dc.hb(a.r,a.s,a.qp.map(b=>ve(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
504
+ olympe.dc.hb=class{constructor(a,b=olympe.dc.Ka.rc,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Pa();this.G=olympe.dc.wa(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a){return new olympe.dc.hb(a)}static Uk(a,b){return(new olympe.dc.hb(a,b)).vb(olympe.dc.CloudObject.instancesRel)}vb(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Lb.hg(this.db,a));return pe(this,b)}bw(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.ba.Lb.ig(this.db,
505
+ a,b));return pe(this,c)}Ti(){this.F.add(qe(this));return new olympe.dc.hb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Lb.uc(a));return pe(this,b)}Vi(){return this}limit(a,b=0){return new olympe.dc.hb(this.G,this.source,this.C,this.F,{max:a,offset:b})}Bn(a,b){const c=Array.from(this.C);c.push(new olympe.dc.ba.Lb.Qh(this.db,a,b));return pe(this,c)}ib(a){return we(olympe.dc.Kf(),re(this),'function'===typeof a.Fc?a.Fc():
506
+ a)}observe(a){return xe(olympe.dc.Kf(),re(this),'function'===typeof a.Fc?a.Fc():a)}ud(){var a=re(this);return olympe.dc.Kf().R.ud(a)}Z(){null===this.id&&(this.id=olympe.W.ob(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}ia(){return{r:this.G,qp:this.C.map(a=>a.ia()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.hb.prototype.executeFromCache=olympe.dc.hb.prototype.ud;
507
+ olympe.dc.hb.prototype.observe=olympe.dc.hb.prototype.observe;olympe.dc.hb.prototype.execute=olympe.dc.hb.prototype.ib;olympe.dc.hb.prototype.sortBy=olympe.dc.hb.prototype.Bn;olympe.dc.hb.prototype.limit=olympe.dc.hb.prototype.limit;olympe.dc.hb.prototype.cast=olympe.dc.hb.prototype.Vi;olympe.dc.hb.prototype.filter=olympe.dc.hb.prototype.filter;olympe.dc.hb.prototype.andReturn=olympe.dc.hb.prototype.Ti;olympe.dc.hb.prototype.followRecursively=olympe.dc.hb.prototype.bw;
508
+ olympe.dc.hb.prototype.follow=olympe.dc.hb.prototype.vb;olympe.dc.hb.instancesOf=olympe.dc.hb.Uk;olympe.dc.hb.from=olympe.dc.hb.from;function ve(a){const b=olympe.dc.Pa();switch(a.t){case 1:return(a=oe(a.p))?new olympe.dc.ba.Lb.uc(a):null;case 2:return new olympe.dc.ba.Lb.hg(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.ba.Lb.ig(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.ba.Lb.Qh(b,new olympe.dc.va.Property(a.p),c);default:return null}}olympe.dc.ba.jk=class{ia(){}F(){}ib(){}observe(){}toString(){}};function ye(a){return a.G.map(b=>a.F.get(a.C[b]))}function ze(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Ae(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.T()))}function Be(a){return new Set(a.L.flatMap(b=>b.split('.')))}
509
+ function Ce(a,b){var c=olympe.dc.Pa();if(c.Gb(a)){b.F(a,c.vd(a,!0),0);b.Oa(olympe.dc.jc.Wc,a,c.model(a),0);for(const [d,e,f]of Ad(c,a))(c=b.If(f))&&c.te()&&(e===olympe.dc.Aa.DESTINATION?b.Oa(d,a,f,0):b.Oa(d,f,a,0))}else olympe.sa.Ya('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
510
+ function De(a,b,c=olympe.dc.Ka.Xc){b&&b((new olympe.dc.W.Hi(c)).C(a.p||[]));const d=olympe.dc.Pa();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Gb(h)?olympe.dc.CloudObject.get(h):(olympe.sa.Ya('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Wa.create(b,a.a,a.r)}
510
511
  olympe.dc.Wa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.L=[];this.hash=''}static empty(){return new olympe.dc.Wa}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a+=1);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}df(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.df().includes(a)}indexOf(a){return null===
511
- a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.df().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Qc(){return this.se(0)}se(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){let b=this.df();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.df();a.pop();return a}shift(){if(0<this.C.length){const a=this.df();a.shift();return a}return[]}filter(a){return this.df().filter(a)}find(a){return(a=this.df().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>a(this.F.get(b),
512
- c))}map(a){return this.df().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Wa.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.df().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.Wa.create(b,c,a)}static from(a,b){const c=olympe.dc.Pa();var d=Fe(b);if(b.Bd){const {mb:l,order:n,Bd:p,
513
- Cv:q}=b.Bd,r=Array.from(b.G).sort().indexOf(q),t=n===olympe.dc.da.aq.ASC?1:-1;d=d.sort((v,u)=>{u=u[r];v=c.gb(v[r],l);u=c.gb(u,l);return null===v?-t:null===u?t:t*p(v,u)})}else d=d.sort((l,n)=>l.reduce((p,q,r)=>p||q.localeCompare(n[r]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));const e=olympe.W.ob(d.flat().join(''));if(e===a.hash)return b.F=!1,a;d=d.map(l=>[l.join('.'),1===l.length?olympe.dc.CloudObject.get(l[0]):l.map(n=>olympe.dc.CloudObject.get(n))]);b.Bd||(d=d.sort((l,
514
- n)=>l[0].localeCompare(n[0])));const f=new Set(d.map(l=>l[0])),g=new Set(a.keys()),h=[],k=[];d.forEach(([l],n)=>{!g.has(l)&&h.push(n)});g.forEach(l=>{!f.has(l)&&k.push(l)});a=olympe.dc.Wa.create(d,h,k,e);b.F=!1;return a}static create(a,b,c,d){const e=new olympe.dc.Wa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.ob(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}ja(){const a=new olympe.dc.db.zc;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)De(c,a);b=new olympe.dc.transaction.Md;
515
- a.Zc(b);return{k:this.C,p:ce(b),a:this.G,r:this.L}}};olympe.dc.Wa.prototype.concat=olympe.dc.Wa.prototype.concat;olympe.dc.Wa.prototype.reduce=olympe.dc.Wa.prototype.reduce;olympe.dc.Wa.prototype.sort=olympe.dc.Wa.prototype.sort;olympe.dc.Wa.prototype.map=olympe.dc.Wa.prototype.map;olympe.dc.Wa.prototype.forEach=olympe.dc.Wa.prototype.forEach;olympe.dc.Wa.prototype.find=olympe.dc.Wa.prototype.find;olympe.dc.Wa.prototype.filter=olympe.dc.Wa.prototype.filter;olympe.dc.Wa.prototype.shift=olympe.dc.Wa.prototype.shift;
516
- olympe.dc.Wa.prototype.pop=olympe.dc.Wa.prototype.pop;olympe.dc.Wa.prototype.push=olympe.dc.Wa.prototype.push;olympe.dc.Wa.prototype.getAt=olympe.dc.Wa.prototype.se;olympe.dc.Wa.prototype.getFirst=olympe.dc.Wa.prototype.Qc;olympe.dc.Wa.prototype.get=olympe.dc.Wa.prototype.get;olympe.dc.Wa.prototype.indexOf=olympe.dc.Wa.prototype.indexOf;olympe.dc.Wa.prototype.has=olympe.dc.Wa.prototype.has;olympe.dc.Wa.prototype.size=olympe.dc.Wa.prototype.size;olympe.dc.Wa.prototype.toArray=olympe.dc.Wa.prototype.df;
517
- olympe.dc.Wa.prototype.keys=olympe.dc.Wa.prototype.keys;olympe.dc.Wa.prototype.values=olympe.dc.Wa.prototype.values;olympe.dc.Wa.prototype.entries=olympe.dc.Wa.prototype.entries;olympe.dc.Wa.empty=olympe.dc.Wa.empty;function Fe(a){var b=new Set(X(a,a.Ag()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of Ge(a,'sink',a.Ag()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function He(a,b,c,d,e){a.Bd={Bd:b,Cv:c,order:d,mb:e}}function Ie(a,b){a.L=b}function Je(a){a.L?a.F||(a.F=!0,a.L()):olympe.sa.Za('dc').error('Trying to notify update for partial result but callback has not been previously set')}function X(a,b){return b>=a.Ag()?new Map:a.C[b]}
518
- function Ge(a,b,c,d){if(0===c)return a.G.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=Ke(a,b,c),f=a.G.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of Ge(a,h,c-1,f))g.add(k);return g},new Set)}function Ke(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}
519
- function Le(a,b,c,d){var e=X(a,c);if(0<c&&(null===d||!X(a,c-1).has(d)))return olympe.sa.Za('dc').error('Try to insert result entry linked to a non existing parent'),null;if(e.has(b)&&null!==d)return b=e.get(b),e=b.size,b.add(d),b.size>e&&Je(a),!1;if(c>=a.Ag())return olympe.sa.Za('dc').error('Try to insert result entry to a higher level than possible'),null;c=new Set;null!==d&&c.add(d);e.set(b,c);Je(a);return!0}
520
- function Me(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Je(a)}
521
- olympe.dc.da.jq=class{constructor(a){this.C=Array.from({length:re(a)+1},()=>new Map);this.G=new Set(Array.from(a.F));this.Bd=null;this.F=!1;this.L=null;this.max=a.max;this.offset=a.offset}Ag(){return this.C.length}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.sa.Za('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Je(this),Me(this,a,b,a),!0;Je(this);return!1}};olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.hb.from(a))}vb(a){return new olympe.dc.nd(this.query.vb(a))}Vi(){return this}ib(a){return this.query.ib(a).then(b=>{const c=b.size();return 1<c?(olympe.sa.Za('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Qc()||null})}vd(){const a=this.query.vd(),b=a.size();return 1<b?(olympe.sa.Za('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
522
- null):a.Qc()||null}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.vd;olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.ib;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.Vi;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.vb;olympe.dc.da.V={};olympe.dc.da.V.Yd=class{constructor(...a){this.V=a}R(){return Array.from(this.V)}ib(a){return this.V.reduce((b,c)=>b&&c.ib(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1);let e=this.V.map(()=>null);const f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.ob('AND-'+b+a+h),k=>f(k,h))})}ja(){return{pr:8,p:this.V.map(a=>a.ja())}}toString(){return'And-'+this.V.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.ob('AND-'+
523
- b+a+d))})}};olympe.dc.da.V.Yd.C=8;olympe.dc.da.V.Yd.ma=[olympe.dc.da.ab];olympe.dc.da.V.Uc=class{constructor(a,b,c,d=!1){this.mb=olympe.dc.wa(a);this.substring=b;this.db=c;this.aa=d}gb(){return this.mb}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){yd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}apply(a){return'string'===typeof a?this.aa?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.mb+'-'+this.substring+'-'+this.aa}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+
524
- a+this.toString()))}ja(){return{pr:2,p:this.mb,s:this.substring,c:this.aa}}};olympe.dc.da.V.Uc.C=2;olympe.dc.da.V.Uc.ma=[olympe.dc.da.ab];olympe.dc.da.V.Ic=class{constructor(a,b,c){this.mb=olympe.dc.wa(a);this.C=b;this.db=c}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){yd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.sb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.sb(this.C):!1:a===
525
- this.C}toString(){return'Equals-'+this.mb+'-'+this.C.toString()}gb(){return this.mb}ja(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.T();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Nf().valueOf(),g:this.C.Hf().valueOf(),b:this.C.Cf().valueOf(),a:this.C.Bf().valueOf()}}return{pr:1,p:this.mb,t:a,v:b}}};olympe.dc.da.V.Ic.C=1;olympe.dc.da.V.Ic.ma=[olympe.dc.da.ab];function Ne(a,b,c){return null===b?!1:null===c?!0:a.oa?a.ha?b<c:b>c:a.ha?b<=c:b>=c}function Oe(a,b){return'number'===typeof a.F?a.F:a.db.gb(b,a.F)}function Pe(a,b,c){return olympe.W.ob(c+b+a.F+a.mb)}
526
- olympe.dc.da.V.Fh=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Pa();this.mb=olympe.dc.wa(a);this.F='number'===typeof b?b:olympe.dc.wa(b);this.ha=c;this.oa=d}gb(){return this.mb}ib(a){return Ne(this,this.db.gb(a,this.mb),Oe(this,a))}observe(a,b,c){'string'===typeof this.F&&yd(this.db,a,this.F,d=>{const e=this.db.gb(a,this.mb);null!==e&&c(Ne(this,e,d))},Pe(this,a,b));yd(this.db,a,this.mb,d=>{const e=Oe(this,a);c(null!==e?Ne(this,d,e):!0)},Pe(this,a,b))}clear(a,b){this.db.F(a,this.mb,Pe(this,a,
527
- b));'string'===typeof this.F&&this.db.F(a,this.F,Pe(this,a,b))}ja(){return{pr:3,p:this.mb,b:this.F,l:this.ha,s:this.oa}}toString(){return'GreaterThan-'+this.mb+'-'+this.oa+'-'+this.F}};olympe.dc.da.V.Fh.C=3;olympe.dc.da.V.Fh.ma=[olympe.dc.da.ab];olympe.dc.da.V.md=class{constructor(a){this.aa=a}G(){return this.aa}ib(a){return!this.aa.ib(a)}observe(a,b,c){let d=null;this.aa.observe(a,olympe.W.ob('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}ja(){return{pr:4,v:this.aa.ja()}}toString(){return`NOT-${this.aa.toString()}`}clear(a,b){this.aa.clear(a,olympe.W.ob('NOT'+b+a))}};olympe.dc.da.V.md.C=4;olympe.dc.da.V.md.ma=[olympe.dc.da.ab];olympe.dc.da.V.ee=class{constructor(...a){this.V=a}R(){return Array.from(this.V)}ib(a){return this.V.reduce((b,c)=>b||c.ib(a),!1)}observe(a,b,c){let d=this.V.map(()=>!1),e=this.V.map(()=>null);const f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.ob('OR-'+b+a+h),k=>f(k,h))})}ja(){return{pr:7,p:this.V.map(a=>a.ja())}}toString(){return'And-'+this.V.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.ob('OR-'+
528
- b+a+d))})}};olympe.dc.da.V.ee.C=7;olympe.dc.da.V.ee.ma=[olympe.dc.da.ab];olympe.dc.da.V.Ad=class{constructor(a,b,c,d=!0){this.mb=olympe.dc.wa(a);this.Y=RegExp('');try{this.Y=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.aa=d}gb(){return this.mb}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){yd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}apply(a){return'string'===typeof a?this.aa?this.Y.test(a):this.Y.test(a.toLowerCase()):!1}toString(){return'Regex'+this.mb+'-'+this.Y.toString()+'-'+this.aa}ja(){return{pr:5,
529
- p:this.mb,r:this.Y.source,c:this.aa}}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+a+this.toString()))}};olympe.dc.da.V.Ad.C=5;olympe.dc.da.V.Ad.ma=[olympe.dc.da.ab];olympe.dc.da.V.De=class{constructor(a){this.db=olympe.dc.Pa();this.Ma=[];this.recursive=[];this.destination=a?olympe.dc.wa(a):null}gd(){return Array.from(this.Ma)}L(){return this.destination}clear(a,b){0<this.Ma.length&&this.db.C(a,this.Ma[0],olympe.W.ob(b+0+a))}vb(a){this.Ma.push(a);this.recursive.push(!1);return this}Lk(a){this.Ma.push(a);this.recursive.push(!0);return this}ib(a){if(1>this.Ma.length)return olympe.sa.Za('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=
530
- this.destination||'';let d=(e,f,g,h)=>e?f?this.db.Mf(g,h,c):this.db.Mf(g,h):this.db.tb(g,h);for(let e=0;e<this.Ma.length;++e){const f=this.Ma[e],g=this.recursive[e],h=e===this.Ma.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.Ma.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.Ma[k],r=this.recursive[k-1]?this.Ma[k-
531
- 1]:null;l=olympe.W.ob(l+k+p);const t=olympe.W.ob(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}ja(){return{pr:6,r:this.Ma.map((a,b)=>[a.T(),a.Qa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.Ma.reduce((b,c,d)=>b+c.T()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.da.V.De.prototype.followRecursive=olympe.dc.da.V.De.prototype.Lk;
532
- olympe.dc.da.V.De.prototype.follow=olympe.dc.da.V.De.prototype.vb;olympe.dc.da.V.De.C=6;olympe.dc.da.V.De.ma=[olympe.dc.da.ab];olympe.dc.da.Lb={};olympe.dc.da.Lb.tc=class{constructor(a){this.C=a}F(a){return a}ib(a,b){for(const c of X(a,b).keys())this.C.ib(c)||(0===b?a.remove(c,b,null):Ke(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.W.ob(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?Le(a,f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}ja(){return{t:1,p:this.C.ja()}}toString(){return'filterQueryPart-'+this.C.toString()}G(){return this.C}};
533
- olympe.dc.da.Lb.tc.C=1;olympe.dc.da.Lb.tc.ma=[olympe.dc.da.jk];olympe.dc.da.Lb.hg=class{constructor(a,b){this.db=a;this.C=b}Td(){return this.C}F(a){return a+1}ib(a,b){for(const c of X(a,b).keys())this.db.tb(c,this.C).forEach(d=>{Le(a,d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.ob(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?Le(a,l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}ja(){return{t:2,r:{t:this.C.T(),d:this.C.Qa()}}}toString(){return'followQueryPart-'+this.C.Qa()+this.C.T()}};olympe.dc.da.Lb.hg.C=2;
534
- olympe.dc.da.Lb.hg.ma=[olympe.dc.da.jk];olympe.dc.da.Lb.ig=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Td(){return this.C}F(a){return a+1}ib(a,b){for(const c of X(a,b).keys())this.G&&Le(a,c,b+1,c),this.db.Mf(c,this.C).forEach(d=>{Le(a,d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.ob(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?Le(a,n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,h))};return(g,
535
- h,k,l)=>f(h,l,0,g,h)}ja(){return{t:3,s:this.G,r:{t:this.C.T(),d:this.C.Qa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Qa()+this.C.T()}};olympe.dc.da.Lb.ig.C=3;olympe.dc.da.Lb.ig.ma=[olympe.dc.da.jk];function Qe(a){a=a.db.nc(a.mb,olympe.dm.Property.typeRel);if(a===olympe.dc.wa(olympe.dm.String))return Re((b,c)=>b.localeCompare(c));if(a===olympe.dc.wa(olympe.dm.Number)||a===olympe.dc.wa(olympe.dm.Boolean))return Re((b,c)=>b-c);if(a===olympe.dc.wa(olympe.dm.DateTime))return Re((b,c)=>b.getTime()-c.getTime());olympe.sa.Za('dc').warn(`No comparator found for type with tag ${a}`);return Re(()=>-1)}function Re(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
536
- olympe.dc.da.Lb.Qh=class{constructor(a,b,c){this.db=a;this.mb=b;this.order=c}F(a){return a}ib(a,b){He(a,Qe(this),b,this.order,this.mb)}observe(a,b,c){He(a,Qe(this),b,this.order,this.mb);return(d,e,f,g)=>{g=olympe.W.ob(g+this.toString());d?yd(this.db,e,this.mb,()=>{Je(a)},g):this.db.F(e,this.mb,g);c(d,e,f,g)}}ja(){return{t:4,p:this.mb.T(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.mb.T()}gb(){return this.mb}};olympe.dc.da.Lb.Qh.C=4;olympe.dc.da.Lb.Qh.ma=[olympe.dc.da.jk];olympe.dc.query={};function Se(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.hc();e.add(a);d.set(a,c)}function Te(a,b,c){Se(a,b,c,a.F)}function Ue(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Ve(a,b,c,d,e){if(a.C.has(b)){if(!a.L.has(b)){a.L.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.Xi.Uj?e(Error(c.aa()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.L.delete(b)}}else a.N.warn(e)}
537
- function We(a,b,c){Ve(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Xe(a,b,c){Se(a,b,c,a.G)}olympe.dc.query.Js=class{constructor(a){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.L=new Set}};olympe.dc.Ne=class{pa(){}L(){}G(){}R(){}ja(){}toString(){}};olympe.dc.Hd={SUBSCRIBE:0,Ii:1,lm:2,TA:0,GET:1};olympe.dc.Hd.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Hd))if(c===a)return b;return null};function ue(a,b=1){a.validate(olympe.dc.Ub.NONE,'back');let c=a.Y;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.F)||null;a.Y=c}function Ye(a){return'not_defined'===a.C?olympe.dc.Ub.NONE:a.C}function Ze(a,b){a.validate(b,'activateFollowRules');return a}function $e(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Ub.NONE}
538
- function af(a){if($e(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
539
- function bf(a,b,c){c=new olympe.dc.query.Relation(b.T(),b.Qa(),c||b instanceof olympe.dc.X.Dc);b=[];var d;for(var e of cf(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Tj(c,d.id);d.children.has(f.Z())?d=d.children.get(f.Z()):(d.children.set(f.Z(),f),d=f)}else{d=a;var g=c;const h=olympe.W.ob(d.G);f=olympe.W.ob(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Tj(g,h);d.R.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.oa.set(e,b);return a.F.get(e)}
540
- function df(a,b){if($e(a))a.aa.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function ef(a,b){a.ha=b;return a}function ff(a){const b=new olympe.dc.hf(a.G,a.L);b.C=a.C;for(const [c,d]of a.R)b.R.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ha=a.ha;b.aa=[...a.aa];return b}function gf(a,b){return $e(a)?new olympe.dc.query.Ol(ff(a),b||olympe.D.Ia()):new olympe.dc.query.Sj(ff(a),b||olympe.D.Ia())}
541
- function cf(a){let b=a.Y;const c=[];for(;b&&b.Td().recursive;)c.push(b.Z()),b=a.F.get(b.F)||null;c.push(b&&b.Z()||olympe.W.ob(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.oa.get(e))});return d}
542
- olympe.dc.hf=class{constructor(a,b=olympe.dc.Hd.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.wa(a);this.L=b;this.C='not_defined';this.aa=[];this.Y=null;this.R=new Map;this.F=new Map;this.ha=null;this.oa=(new Map).set(olympe.W.ob(this.G),[olympe.W.ob(this.G)])}static Lc(a,b){olympe.dc.hf.Ue([a],b)}static Ue(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Ub.Hc));c.ib(b)}toJSON(){const a=Object.create(null),
543
- b=c=>{const d=Object.create(null),e=c.Td();d.t=e.T();d.d=e.Qa();d.r=e.recursive;d.c=c.kh().map(b);return d};a.t=this.G;a.o=this.L;a.f=Ye(this);a.b=Array.from(this.R.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static lc(a){a='string'===typeof a?JSON.parse(a):a;const b=Ze(new olympe.dc.hf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.ua.Relation(d.t,d.d);b.vb(e,d.r);for(const f of d.c)c(f);ue(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.W.ob,b=d=>d.Z()+d.kh().map(e=>b(e)).sort().join(''),
544
- c=Array.from(this.R,([,d])=>b(d)).sort().join('');return a(`${this.L}-${this.G}${c}-${Ye(this)}`)}add(a,b=!1){this.validate(olympe.dc.Ub.NONE,'add');bf(this,a,b);return this}vb(a,b=!1){this.validate(olympe.dc.Ub.NONE,'follow');this.Y=bf(this,a,b);return this}ib(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Ub.NONE);const b=olympe.dc.Kf();a=olympe.D.Ia().C(a);switch(this.L){case olympe.dc.Hd.SUBSCRIBE:case olympe.dc.Hd.Ii:const c=hf(b,this,a);olympe.D.Ia().xc(()=>{jf(olympe.dc.Kf(),c.Z())});break;
545
- case olympe.dc.Hd.lm:kf(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Ub.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function lf(a,b){a.data.Zc(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new mf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function nf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.nt=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Z(){return this.id}};class mf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function of(a){return Array.from(a.Ta,b=>a.F.get(b))}function pf(a){if(!a.R){for(const b of a.Y.values())b();a.Y.clear();a.R=!0}}
546
- olympe.dc.query.Sj=class{constructor(a,b){this.ph=a;this.C=a.G;this.id=a.Z();this.ha=new olympe.D.Zb(`GraphSubscription ${this.id}`,b);this.N=olympe.sa.Za('dc.query');this.Ta=[];this.F=new Map;this.R=!1;this.Y=new Map;b=olympe.W.ob(this.C);if(!$e(a))for(const c of af(a))this.F.set(c.Z(),c),c.F===b&&this.Ta.push(c.Z())}Z(){return this.id}L(){const a=this.C;return a&&olympe.dc.Pa().source(a)||olympe.dc.Ka.Wc}Je(a,b){b=b||olympe.W.hc();this.R?a():this.Y.set(b,olympe.D.Ia().C(a));return b}nj(a){return this.Y.delete(a)}onDestroy(a){this.ha.onDestroy(a)}release(){this.ha.destroy()}aa(){return function*(a,
547
- b){yield a;for(const c of b)yield*c.ge()}(this.C,this.F.values())}oa(a){const b=olympe.W.ob(this.C);qf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.N.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}Fa(a){let b=[],c=[];const d=olympe.W.ob(this.C);nf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
548
- k.C.delete(l)))):this.N.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Qc(olympe.dc.Dd(),b,c)}Br(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.ob(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.ob,f=this.F,g=(k,l)=>{const n=l.Td(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.kh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=of(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
512
+ a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.df().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Rc(){return this.se(0)}se(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){let b=this.df();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.df();a.pop();return a}shift(){if(0<this.C.length){const a=this.df();a.shift();return a}return[]}filter(a){return this.df().filter(a)}find(a){return(a=this.df().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>a(this.F.get(b),
513
+ c))}map(a){return this.df().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Wa.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.df().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.Wa.create(b,c,a)}static from(a,b){const c=olympe.dc.Pa();var d=Ee(b);if(b.Bd){const {mb:l,order:n,Bd:p,
514
+ Gv:q}=b.Bd,r=Array.from(b.G).sort().indexOf(q),t=n===olympe.dc.ba.eq.ASC?1:-1;d=d.sort((u,v)=>{v=v[r];u=c.gb(u[r],l);v=c.gb(v,l);return null===u?-t:null===v?t:t*p(u,v)})}else d=d.sort((l,n)=>l.reduce((p,q,r)=>p||q.localeCompare(n[r]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));const e=olympe.W.ob(d.flat().join(''));if(e===a.hash)return b.F=!1,a;d=d.map(l=>[l.join('.'),1===l.length?olympe.dc.CloudObject.get(l[0]):l.map(n=>olympe.dc.CloudObject.get(n))]);b.Bd||(d=d.sort((l,
515
+ n)=>l[0].localeCompare(n[0])));const f=new Set(d.map(l=>l[0])),g=new Set(a.keys()),h=[],k=[];d.forEach(([l],n)=>{!g.has(l)&&h.push(n)});g.forEach(l=>{!f.has(l)&&k.push(l)});a=olympe.dc.Wa.create(d,h,k,e);b.F=!1;return a}static create(a,b,c,d){const e=new olympe.dc.Wa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.ob(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}ia(){const a=new olympe.dc.db.zc;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Ce(c,a);b=new olympe.dc.transaction.Md;
516
+ a.$c(b);return{k:this.C,p:be(b),a:this.G,r:this.L}}};olympe.dc.Wa.prototype.concat=olympe.dc.Wa.prototype.concat;olympe.dc.Wa.prototype.reduce=olympe.dc.Wa.prototype.reduce;olympe.dc.Wa.prototype.sort=olympe.dc.Wa.prototype.sort;olympe.dc.Wa.prototype.map=olympe.dc.Wa.prototype.map;olympe.dc.Wa.prototype.forEach=olympe.dc.Wa.prototype.forEach;olympe.dc.Wa.prototype.find=olympe.dc.Wa.prototype.find;olympe.dc.Wa.prototype.filter=olympe.dc.Wa.prototype.filter;olympe.dc.Wa.prototype.shift=olympe.dc.Wa.prototype.shift;
517
+ olympe.dc.Wa.prototype.pop=olympe.dc.Wa.prototype.pop;olympe.dc.Wa.prototype.push=olympe.dc.Wa.prototype.push;olympe.dc.Wa.prototype.getAt=olympe.dc.Wa.prototype.se;olympe.dc.Wa.prototype.getFirst=olympe.dc.Wa.prototype.Rc;olympe.dc.Wa.prototype.get=olympe.dc.Wa.prototype.get;olympe.dc.Wa.prototype.indexOf=olympe.dc.Wa.prototype.indexOf;olympe.dc.Wa.prototype.has=olympe.dc.Wa.prototype.has;olympe.dc.Wa.prototype.size=olympe.dc.Wa.prototype.size;olympe.dc.Wa.prototype.toArray=olympe.dc.Wa.prototype.df;
518
+ olympe.dc.Wa.prototype.keys=olympe.dc.Wa.prototype.keys;olympe.dc.Wa.prototype.values=olympe.dc.Wa.prototype.values;olympe.dc.Wa.prototype.entries=olympe.dc.Wa.prototype.entries;olympe.dc.Wa.empty=olympe.dc.Wa.empty;function Ee(a){var b=new Set(X(a,a.Ag()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of Fe(a,'sink',a.Ag()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Ge(a,b,c,d,e){a.Bd={Bd:b,Gv:c,order:d,mb:e}}function He(a,b){a.L=b}function Ie(a){a.L?a.F||(a.F=!0,a.L()):olympe.sa.Ya('dc').error('Trying to notify update for partial result but callback has not been previously set')}function X(a,b){return b>=a.Ag()?new Map:a.C[b]}
519
+ function Fe(a,b,c,d){if(0===c)return a.G.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=Je(a,b,c),f=a.G.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of Fe(a,h,c-1,f))g.add(k);return g},new Set)}function Je(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Ke(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Ie(a)}
520
+ olympe.dc.ba.nq=class{constructor(a){this.C=Array.from({length:qe(a)+1},()=>new Map);this.G=new Set(Array.from(a.F));this.Bd=null;this.F=!1;this.L=null;this.max=a.max;this.offset=a.offset}Ag(){return this.C.length}insert(a,b,c){var d=X(this,b);if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.sa.Ya('dc').error('Try to insert result entry linked to a non existing parent'),null;if(d.has(a)&&null!==c)return a=d.get(a),d=a.size,a.add(c),a.size>d&&Ie(this),!1;if(b>=this.Ag())return olympe.sa.Ya('dc').error('Try to insert result entry to a higher level than possible'),
521
+ null;b=new Set;null!==c&&b.add(c);d.set(a,b);Ie(this);return!0}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.sa.Ya('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Ie(this),Ke(this,a,b,a),!0;Ie(this);return!1}};olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.hb.from(a))}vb(a){return new olympe.dc.nd(this.query.vb(a))}Vi(){return this}ib(a){return this.query.ib(a).then(b=>{const c=b.size();return 1<c?(olympe.sa.Ya('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Rc()||null})}ud(){const a=this.query.ud(),b=a.size();return 1<b?(olympe.sa.Ya('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
522
+ null):a.Rc()||null}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.ud;olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.ib;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.Vi;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.vb;olympe.dc.ba.V={};olympe.dc.ba.V.Xd=class{constructor(...a){this.V=a}ib(a){return this.V.reduce((b,c)=>b&&c.ib(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1);let e=this.V.map(()=>null);const f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.ob('AND-'+b+a+h),k=>f(k,h))})}ia(){return{pr:8,p:this.V.map(a=>a.ia())}}toString(){return'And-'+this.V.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.ob('AND-'+b+a+d))})}};
523
+ olympe.dc.ba.V.Xd.C=8;olympe.dc.ba.V.Xd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Vc=class{constructor(a,b,c,d=!1){this.mb=olympe.dc.wa(a);this.substring=b;this.db=c;this.C=d}gb(){return this.mb}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){xd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.mb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+
524
+ a+this.toString()))}ia(){return{pr:2,p:this.mb,s:this.substring,c:this.C}}};olympe.dc.ba.V.Vc.C=2;olympe.dc.ba.V.Vc.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.Ic=class{constructor(a,b,c){this.mb=olympe.dc.wa(a);this.C=b;this.db=c}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){xd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.sb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.sb(this.C):!1:a===
525
+ this.C}toString(){return'Equals-'+this.mb+'-'+this.C.toString()}gb(){return this.mb}ia(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.T();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Nf().valueOf(),g:this.C.Hf().valueOf(),b:this.C.Cf().valueOf(),a:this.C.Bf().valueOf()}}return{pr:1,p:this.mb,t:a,v:b}}};olympe.dc.ba.V.Ic.C=1;olympe.dc.ba.V.Ic.ma=[olympe.dc.ba.bb];function Le(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function Me(a,b){return'number'===typeof a.C?a.C:a.db.gb(b,a.C)}function Ne(a,b,c){return olympe.W.ob(c+b+a.C+a.mb)}
526
+ olympe.dc.ba.V.Fh=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Pa();this.mb=olympe.dc.wa(a);this.C='number'===typeof b?b:olympe.dc.wa(b);this.F=c;this.G=d}gb(){return this.mb}ib(a){return Le(this,this.db.gb(a,this.mb),Me(this,a))}observe(a,b,c){'string'===typeof this.C&&xd(this.db,a,this.C,d=>{const e=this.db.gb(a,this.mb);null!==e&&c(Le(this,e,d))},Ne(this,a,b));xd(this.db,a,this.mb,d=>{const e=Me(this,a);c(null!==e?Le(this,d,e):!0)},Ne(this,a,b))}clear(a,b){this.db.F(a,this.mb,Ne(this,a,b));
527
+ 'string'===typeof this.C&&this.db.F(a,this.C,Ne(this,a,b))}ia(){return{pr:3,p:this.mb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.mb+'-'+this.G+'-'+this.C}};olympe.dc.ba.V.Fh.C=3;olympe.dc.ba.V.Fh.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.md=class{constructor(a){this.C=a}ib(a){return!this.C.ib(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.W.ob('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}ia(){return{pr:4,v:this.C.ia()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.W.ob('NOT'+b+a))}};olympe.dc.ba.V.md.C=4;olympe.dc.ba.V.md.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.de=class{constructor(...a){this.V=a}ib(a){return this.V.reduce((b,c)=>b||c.ib(a),!1)}observe(a,b,c){let d=this.V.map(()=>!1),e=this.V.map(()=>null);const f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.ob('OR-'+b+a+h),k=>f(k,h))})}ia(){return{pr:7,p:this.V.map(a=>a.ia())}}toString(){return'And-'+this.V.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.ob('OR-'+b+a+d))})}};
528
+ olympe.dc.ba.V.de.C=7;olympe.dc.ba.V.de.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.zd=class{constructor(a,b,c,d=!0){this.mb=olympe.dc.wa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}gb(){return this.mb}ib(a){return this.apply(this.db.gb(a,this.mb))}observe(a,b,c){xd(this.db,a,this.mb,d=>{c(this.apply(d))},olympe.W.ob(b+a+this.toString()))}apply(a){return'string'===typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.mb+'-'+this.C.toString()+'-'+this.F}ia(){return{pr:5,
529
+ p:this.mb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.mb,olympe.W.ob(b+a+this.toString()))}};olympe.dc.ba.V.zd.C=5;olympe.dc.ba.V.zd.ma=[olympe.dc.ba.bb];olympe.dc.ba.V.De=class{constructor(a){this.db=olympe.dc.Pa();this.Ma=[];this.recursive=[];this.destination=a?olympe.dc.wa(a):null}gd(){return Array.from(this.Ma)}clear(a,b){0<this.Ma.length&&this.db.C(a,this.Ma[0],olympe.W.ob(b+0+a))}vb(a){this.Ma.push(a);this.recursive.push(!1);return this}Lk(a){this.Ma.push(a);this.recursive.push(!0);return this}ib(a){if(1>this.Ma.length)return olympe.sa.Ya('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'';let d=
530
+ (e,f,g,h)=>e?f?this.db.Mf(g,h,c):this.db.Mf(g,h):this.db.tb(g,h);for(let e=0;e<this.Ma.length;++e){const f=this.Ma[e],g=this.recursive[e],h=e===this.Ma.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.Ma.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.Ma[k],r=this.recursive[k-1]?this.Ma[k-1]:null;l=olympe.W.ob(l+k+
531
+ p);const t=olympe.W.ob(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}ia(){return{pr:6,r:this.Ma.map((a,b)=>[a.T(),a.Qa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.Ma.reduce((b,c,d)=>b+c.T()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.ba.V.De.prototype.followRecursive=olympe.dc.ba.V.De.prototype.Lk;
532
+ olympe.dc.ba.V.De.prototype.follow=olympe.dc.ba.V.De.prototype.vb;olympe.dc.ba.V.De.C=6;olympe.dc.ba.V.De.ma=[olympe.dc.ba.bb];olympe.dc.ba.Lb={};olympe.dc.ba.Lb.uc=class{constructor(a){this.C=a}F(a){return a}ib(a,b){for(const c of X(a,b).keys())this.C.ib(c)||(0===b?a.remove(c,b,null):Je(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.W.ob(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?a.insert(f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}ia(){return{t:1,p:this.C.ia()}}toString(){return'filterQueryPart-'+this.C.toString()}};olympe.dc.ba.Lb.uc.C=1;
533
+ olympe.dc.ba.Lb.uc.ma=[olympe.dc.ba.jk];olympe.dc.ba.Lb.hg=class{constructor(a,b){this.db=a;this.C=b}Sd(){return this.C}F(a){return a+1}ib(a,b){for(const c of X(a,b).keys())this.db.tb(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.ob(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?a.insert(l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}ia(){return{t:2,r:{t:this.C.T(),d:this.C.Qa()}}}toString(){return'followQueryPart-'+this.C.Qa()+this.C.T()}};olympe.dc.ba.Lb.hg.C=2;
534
+ olympe.dc.ba.Lb.hg.ma=[olympe.dc.ba.jk];olympe.dc.ba.Lb.ig=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Sd(){return this.C}F(a){return a+1}ib(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Mf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.ob(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?a.insert(n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,
535
+ h))};return(g,h,k,l)=>f(h,l,0,g,h)}ia(){return{t:3,s:this.G,r:{t:this.C.T(),d:this.C.Qa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Qa()+this.C.T()}};olympe.dc.ba.Lb.ig.C=3;olympe.dc.ba.Lb.ig.ma=[olympe.dc.ba.jk];function Oe(a){a=a.db.oc(a.mb,olympe.dm.Property.typeRel);if(a===olympe.dc.wa(olympe.dm.String))return Pe((b,c)=>b.localeCompare(c));if(a===olympe.dc.wa(olympe.dm.Number)||a===olympe.dc.wa(olympe.dm.Boolean))return Pe((b,c)=>b-c);if(a===olympe.dc.wa(olympe.dm.DateTime))return Pe((b,c)=>b.getTime()-c.getTime());olympe.sa.Ya('dc').warn(`No comparator found for type with tag ${a}`);return Pe(()=>-1)}function Pe(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
536
+ olympe.dc.ba.Lb.Qh=class{constructor(a,b,c){this.db=a;this.mb=b;this.order=c}F(a){return a}ib(a,b){Ge(a,Oe(this),b,this.order,this.mb)}observe(a,b,c){Ge(a,Oe(this),b,this.order,this.mb);return(d,e,f,g)=>{g=olympe.W.ob(g+this.toString());d?xd(this.db,e,this.mb,()=>{Ie(a)},g):this.db.F(e,this.mb,g);c(d,e,f,g)}}ia(){return{t:4,p:this.mb.T(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.mb.T()}gb(){return this.mb}};olympe.dc.ba.Lb.Qh.C=4;olympe.dc.ba.Lb.Qh.ma=[olympe.dc.ba.jk];olympe.dc.query={};function Qe(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.fc();e.add(a);d.set(a,c)}function Re(a,b,c){Qe(a,b,c,a.F)}function Se(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Te(a,b,c,d,e){if(a.C.has(b)){if(!a.L.has(b)){a.L.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.Xi.Uj?e(Error(c.ea()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.L.delete(b)}}else a.N.warn(e)}
537
+ function Ue(a,b,c){Te(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Ve(a,b,c){Qe(a,b,c,a.G)}olympe.dc.query.Ns=class{constructor(a){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.L=new Set}};olympe.dc.Ne=class{na(){}L(){}G(){}R(){}ia(){}toString(){}};olympe.dc.Hd={SUBSCRIBE:0,Ii:1,lm:2,XA:0,GET:1};olympe.dc.Hd.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Hd))if(c===a)return b;return null};function te(a,b=1){a.validate(olympe.dc.Ub.NONE,'back');let c=a.Y;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.F)||null;a.Y=c}function We(a){return'not_defined'===a.C?olympe.dc.Ub.NONE:a.C}function Xe(a,b){a.validate(b,'activateFollowRules');return a}function Ye(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Ub.NONE}
538
+ function Ze(a){if(Ye(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
539
+ function $e(a,b,c){c=new olympe.dc.query.Relation(b.T(),b.Qa(),c||b instanceof olympe.dc.X.Dc);b=[];var d;for(var e of af(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Tj(c,d.id);d.children.has(f.Z())?d=d.children.get(f.Z()):(d.children.set(f.Z(),f),d=f)}else{d=a;var g=c;const h=olympe.W.ob(d.G);f=olympe.W.ob(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Tj(g,h);d.R.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.qa.set(e,b);return a.F.get(e)}
540
+ function bf(a,b){if(Ye(a))a.ea.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function cf(a,b){a.ka=b;return a}function df(a){const b=new olympe.dc.hf(a.G,a.L);b.C=a.C;for(const [c,d]of a.R)b.R.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ka=a.ka;b.ea=[...a.ea];return b}function ef(a,b){return Ye(a)?new olympe.dc.query.Ol(df(a),b||olympe.D.Ia()):new olympe.dc.query.Sj(df(a),b||olympe.D.Ia())}
541
+ function af(a){let b=a.Y;const c=[];for(;b&&b.Sd().recursive;)c.push(b.Z()),b=a.F.get(b.F)||null;c.push(b&&b.Z()||olympe.W.ob(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.qa.get(e))});return d}
542
+ olympe.dc.hf=class{constructor(a,b=olympe.dc.Hd.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.wa(a);this.L=b;this.C='not_defined';this.ea=[];this.Y=null;this.R=new Map;this.F=new Map;this.ka=null;this.qa=(new Map).set(olympe.W.ob(this.G),[olympe.W.ob(this.G)])}static Mc(a,b){olympe.dc.hf.Ue([a],b)}static Ue(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Ub.Hc));c.ib(b)}toJSON(){const a=Object.create(null),
543
+ b=c=>{const d=Object.create(null),e=c.Sd();d.t=e.T();d.d=e.Qa();d.r=e.recursive;d.c=c.kh().map(b);return d};a.t=this.G;a.o=this.L;a.f=We(this);a.b=Array.from(this.R.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static mc(a){a='string'===typeof a?JSON.parse(a):a;const b=Xe(new olympe.dc.hf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.va.Relation(d.t,d.d);b.vb(e,d.r);for(const f of d.c)c(f);te(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.W.ob,b=d=>d.Z()+d.kh().map(e=>b(e)).sort().join(''),
544
+ c=Array.from(this.R,([,d])=>b(d)).sort().join('');return a(`${this.L}-${this.G}${c}-${We(this)}`)}add(a,b=!1){this.validate(olympe.dc.Ub.NONE,'add');$e(this,a,b);return this}vb(a,b=!1){this.validate(olympe.dc.Ub.NONE,'follow');this.Y=$e(this,a,b);return this}ib(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Ub.NONE);const b=olympe.dc.Kf();a=olympe.D.Ia().C(a);switch(this.L){case olympe.dc.Hd.SUBSCRIBE:case olympe.dc.Hd.Ii:const c=ff(b,this,a);olympe.D.Ia().xc(()=>{gf(olympe.dc.Kf(),c.Z())});break;
545
+ case olympe.dc.Hd.lm:hf(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Ub.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function jf(a,b){a.data.$c(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new kf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function lf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.rt=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Z(){return this.id}};class kf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function mf(a){return(a=a.C)&&olympe.dc.Pa().source(a)||olympe.dc.Ka.Xc}function nf(a){return Array.from(a.Fa,b=>a.F.get(b))}function of(a){if(!a.L){for(const b of a.R.values())b();a.R.clear();a.L=!0}}
546
+ olympe.dc.query.Sj=class{constructor(a,b){this.ph=a;this.C=a.G;this.id=a.Z();this.ea=new olympe.D.Zb(`GraphSubscription ${this.id}`,b);this.N=olympe.sa.Ya('dc.query');this.Fa=[];this.F=new Map;this.L=!1;this.R=new Map;b=olympe.W.ob(this.C);if(!Ye(a))for(const c of Ze(a))this.F.set(c.Z(),c),c.F===b&&this.Fa.push(c.Z())}Z(){return this.id}Je(a,b){b=b||olympe.W.fc();this.L?a():this.R.set(b,olympe.D.Ia().C(a));return b}nj(a){return this.R.delete(a)}onDestroy(a){this.ea.onDestroy(a)}release(){this.ea.destroy()}Y(){return function*(a,
547
+ b){yield a;for(const c of b)yield*c.ge()}(this.C,this.F.values())}ka(a){const b=olympe.W.ob(this.C);pf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.N.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}qa(a){let b=[],c=[];const d=olympe.W.ob(this.C);lf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
548
+ k.C.delete(l)))):this.N.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Pc(olympe.dc.Dd(),b,c)}Er(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.ob(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.ob,f=this.F,g=(k,l)=>{const n=l.Sd(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.kh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=nf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
549
549
  l))return!1;return!0})}};olympe.dc.query.Tj=class{constructor(a,b){this.G=a;this.children=new Map;this.C=new Set;this.F=b;this.id=olympe.W.ob(b+a.toString());this.apply=!0}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "parentId": '+JSON.stringify(this.F)+', "apply": '+JSON.stringify(this.apply)+', ';a+='"relation": '+this.G.toJSON();if(0<this.children.size){a+=', "children": [';for(const b of this.children.values())a+=b.toJSON()+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}if(0<this.C.size){a+=', "instances": [';
550
- for(const b of this.C)a+=JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static lc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.lc(b.relation);a=new olympe.dc.query.Tj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Tj.lc(c),a.children.set(b.id,b);return a}Z(){return this.id}Td(){return this.G}kh(){return Array.from(this.children.values())}ge(){return this.C.values()}toString(){return this.F+
551
- this.G.toString()}};function qf(a,b){a.C.forEach((c,d)=>b(d,c))}
552
- olympe.dc.query.zi=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Gc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.Gc.toJSON()}`;return a+'}'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):
553
- b=a;a=olympe.dc.db.zc.lc(b.patch);a=new olympe.dc.query.zi(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Z(){return this.id}L(){return this.destination}};const rf=olympe.dc.jc.Vc,sf=olympe.dc.jc.ui,tf=olympe.dc.Aa.ORIGIN,uf=olympe.dc.Aa.DESTINATION;function vf(a,b,c){const d=a.ph.aa;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Td()),!0))}
554
- olympe.dc.query.Ol=class extends olympe.dc.query.Sj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}aa(){return this.G.values()}oa(a){a=a.Gc;for(const b of a.ge())b.L()?this.G.delete(b.tag()):b.te()&&this.G.add(b.tag())}Fa(a){let b=[],c=[];nf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Qc(olympe.dc.Dd(),b,c)}Br(a){var b=a.C,c=Array.from(a.F.values()),d=vf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
555
- b=olympe.dm.Relation.C.yk;c=olympe.dm.Relation.C.mk;const e=olympe.dc.Pa();for(const h of d){var f=h.Td(),g=f.T();d=f.Qa();if(d!==uf||g!==rf&&g!==sf){if(!e.Gb(f))return this.N.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=Ad(e,f,Ye(this.ph));g=0===h.kh().length;if(!(f&(d===tf?g?12:c:g?3:b)))return!1}}return!0}};function wf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().$b();return b}function xf(a,b){a.Y()||(a=`Calling "${b}" on subscription with id ${a.Z()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.sa.Za('dc').warn(a))}
556
- function yf(a,b){const c=new olympe.D.Zb('listDef toObservable',a.mc().Gh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.yc([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
557
- olympe.dc.Ba=class{constructor(a,b,c){void 0===a||null===a?olympe.sa.Za('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Ga([a],olympe.dc.wa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||wf(this),this.C=null)}Sc(){return olympe.dc.Sc()}ib(){if(null===this.C){const a=olympe.dc.Kf();this.C=zf(a,this);null!==this.valueType&&this.C.Jd(this.valueType);olympe.D.Ia().xc(()=>{Af(a,this.C.Z());this.C=
558
- null})}return this}mc(){null===this.C&&this.ib();return this.C}Jd(a){this.valueType=a;null!==this.C&&this.C.Jd(this.valueType)}$b(){return null!==this.C?this.C.$b():null===this.valueType?olympe.dc.CloudObject:this.valueType}Rd(){return this.F}Rl(){return this.X}Je(a,b){return this.mc().Je(a,b)}nj(a){this.mc().nj(a)}Ft(){return this.mc().Pf()}Et(){return this.mc().Y()}get(a){return this.mc().get(a)}di(){return this.mc().di()}lh(a){const b=this.mc();xf(b,'getCurrent');return b.lh(a)}has(a){return this.mc().has(a)}Dg(a){const b=
559
- this.mc();xf(b,'hasCurrent');return b.Dg(a)}se(a){return this.mc().se(a)}Jx(a){return yf(this,this.se(a))}We(a){const b=this.mc();xf(b,'getCurrentAt');return b.We(a)}Xe(a){return this.mc().Xe(a)}Df(a){const b=this.mc();xf(b,'getCurrentKeyAt');return b.Df(a)}he(a){return this.mc().he(a)}Nx(a){return yf(this,this.he(a))}Ef(a){const b=this.mc();xf(b,'getCurrentRank');return b.Ef(a)}Qc(){return this.mc().Qc()}Kx(){return yf(this,this.Qc())}Ff(){return this.mc().Ff()}lf(){return this.mc().lf()}Ox(){return yf(this,
560
- this.lf())}yg(){const a=this.mc();xf(a,'getCurrentSize');return a.yg()}forEach(a,b){this.mc().forEach(a,b)}fe(a){const b=this.mc();xf(b,'forEachCurrentValue');return b.fe(a)}Zi(a,b,c,d){a=new olympe.dc.X.ce(a,b);(new olympe.dc.Ba(this.F,[...this.X,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.X];for(const c of b){if(void 0===
561
- c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ua.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Ba(this.F,a);b.Jd(wf(b)||this.valueType||Object);return b}kl(a){return this.transform(new olympe.dc.X.uf(a))}filter(a){return this.transform(new olympe.dc.X.tc(a))}ug(){const a=new olympe.dc.bk(this.F,null===this.valueType?
562
- void 0:this.valueType);let b=this.X;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.X;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Ya(this.F)+a+')'}Dt(){return this.mc().Ug()}kd(){return olympe.D.Ga([this.lf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.We(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Cb(b+']')},olympe.D.Xa)}};olympe.dc.Ba.prototype.filter=olympe.dc.Ba.prototype.filter;olympe.dc.Ba.prototype.union=olympe.dc.Ba.prototype.kl;
563
- olympe.dc.Ba.prototype.transform=olympe.dc.Ba.prototype.transform;olympe.dc.Ba.prototype.forEachCurrentValue=olympe.dc.Ba.prototype.fe;olympe.dc.Ba.prototype.forEach=olympe.dc.Ba.prototype.forEach;olympe.dc.Ba.prototype.getCurrentSize=olympe.dc.Ba.prototype.yg;olympe.dc.Ba.prototype.observeSize=olympe.dc.Ba.prototype.Ox;olympe.dc.Ba.prototype.observeFirst=olympe.dc.Ba.prototype.Kx;olympe.dc.Ba.prototype.getCurrentRank=olympe.dc.Ba.prototype.Ef;olympe.dc.Ba.prototype.observeRank=olympe.dc.Ba.prototype.Nx;
564
- olympe.dc.Ba.prototype.getCurrentAt=olympe.dc.Ba.prototype.We;olympe.dc.Ba.prototype.observeAt=olympe.dc.Ba.prototype.Jx;olympe.dc.Ba.prototype.offReady=olympe.dc.Ba.prototype.nj;olympe.dc.Ba.prototype.onReady=olympe.dc.Ba.prototype.Je;olympe.dc.Ba.prototype.getBaseTag=olympe.dc.Ba.prototype.Rd;olympe.dc.Ba.ma=[olympe.D.qd];m=olympe.dc.Ba.prototype;m.Sc.K=olympe.D.J.C;m.ib.K=olympe.D.J.L();m.mc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Jd.K=new olympe.D.J(()=>{},[]);
565
- m.Rd.K=new olympe.D.J(()=>String,[]);m.Rl.K=new olympe.D.J(()=>Array,[]);m.Je.K=new olympe.D.J(()=>String,[]);m.nj.K=new olympe.D.J(()=>{},[]);m.Ft.K=olympe.D.J.R;m.Et.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.di.K=new olympe.D.J(()=>Array,[]);m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.We.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.he.K=olympe.D.J.G;
566
- m.Ef.K=olympe.D.J.C;m.Qc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Ff.K=new olympe.D.J(()=>String,[]);m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.fe.K=olympe.D.J.C;m.Zi.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.kl.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.ug.K=new olympe.D.J(()=>olympe.dc.bk,[]);m.toString.K=olympe.D.J.C;m.Dt.K=olympe.D.J.C;m.kd.K=olympe.D.J.F;const Bf={zy:'append',El:'filter_not',Jo:'filter_and',Ko:'filter_or'};function Cf(a,b){a=Df(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.na.Mn(a,b)).F}
567
- olympe.dc.bk=class{constructor(a,b){this.C=Df(a);this.N=olympe.dc.Kf().Za();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ta=[]}mf(){return new olympe.dc.Ba(this.C,this.X,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ef('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.ua.Property)throw new Ef('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Ef('transform',
568
- 'one of the argument is not a Transformer '+d);const e=d.$b();null!==e&&(this.valueType=e);this.X.push(d)}return this}kl(a){this.X.push(new olympe.dc.X.uf(a));return this}wy(a){this.X.push(new olympe.dc.X.uf(Df(a)));return this}Ht(a){this.valueType=a;return this}vb(a){this.X.push(a);this.valueType=a.$b()||olympe.dc.CloudObject;return this}$v(a){for(const b of a)this.X.push(b),this.valueType=b.$b()||olympe.dc.CloudObject;return this}Lk(a,b,c){a=new olympe.dc.X.Dc(a,a.Qa(),b,c);this.X.push(a);this.valueType=
569
- a.$b()||olympe.dc.CloudObject;return this}Xv(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.T());void 0===c&&(c=e.Qa())}a=new olympe.dc.X.Be(b,c);this.X.push(a);this.valueType=a.$b()||olympe.dc.CloudObject;return this}Gt(){this.vb(olympe.dc.CloudObject.instancesRel);return this}Ve(a){var b=this.ta.pop();b===Bf.El&&(a=new olympe.dc.V.md(a),b=this.ta.pop());switch(b){case Bf.Jo:b=this.X.pop().G();b instanceof olympe.dc.V.Yd?(b=b.R(),b.push(a),a=new olympe.dc.V.Yd(...b)):a=new olympe.dc.V.Yd(b,
570
- a);b=this.ta.pop();break;case Bf.Ko:b=this.X.pop().G(),b instanceof olympe.dc.V.ee?(b=b.R(),b.push(a),a=new olympe.dc.V.ee(...b)):a=new olympe.dc.V.ee(b,a),b=this.ta.pop()}b===Bf.El&&(a=new olympe.dc.V.md(a),this.ta.pop());this.X.push(new olympe.dc.X.tc(a));return this}Sv(a,b,c){return this.Ve(new olympe.dc.V.Ic(Cf(a,c),new olympe.dc.na.bd(b)))}contains(a,b,c=!1,d){return this.Ve(new olympe.dc.V.Uc(Cf(a,d),new olympe.dc.na.bd(b),c))}qh(a){if(!(a instanceof Array))throw new Ef('instanceOf','Provided argument "models" must be an array.');
571
- const b=[];for(let c=0;c<a.length;c++)b.push(Df(a[c]));return this.Ve(new olympe.dc.V.kf(b))}Sk(a){return this.Ve(new olympe.dc.V.Ic(new olympe.dc.na.sf,new olympe.dc.na.bd(Df(a))))}Tv(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Sk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Sk(a[b])}return this}hj(a,b){if(!(a instanceof Array))throw new Ef('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
572
- a.forEach(e=>{c.push(e);d.push(e.Qa())});return this.Ve(new olympe.dc.V.jf(c,d,b))}Rk(a,b,c){a=Cf(a,c);return this.Ve(new olympe.dc.V.ye(a,new olympe.dc.na.bd(b)))}vj(a,b,c){a=Cf(a,c);return this.Ve(new olympe.dc.V.Fe(a,new olympe.dc.na.bd(b)))}xx(a,b,c,d){a=Cf(a,d);return this.Ve(new olympe.dc.V.Ad(a,b,c))}filter(a){const b=new class extends olympe.dc.V.Mg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Ve(b)}not(){this.ta.push(Bf.El);return this}and(){this.X[this.X.length-1]instanceof
573
- olympe.dc.X.tc&&this.ta.push(Bf.Jo);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.tc&&this.ta.push(Bf.Ko);return this}zn(a,b,c){a=Df(a);let d=null;switch(olympe.dc.Pa().nc(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.T():d=new olympe.dc.Db.String(new olympe.dc.na.qe(a,c));break;case olympe.dm.Number.P.T():d=new olympe.dc.Db.Number(new olympe.dc.na.me(a,c));break;case olympe.dm.DateTime.P.T():d=new olympe.dc.Db.DateTime(new olympe.dc.na.le(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Od(c,
574
- b));return this}sort(a,b,c){const d=new class extends olympe.dc.Db.Mg{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Od(d,c));return this}Ov(){this.X.push(new olympe.dc.X.Gd);return this}limit(a,b){this.X.push(new olympe.dc.X.ce(a,b));return this}};class Ef extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
575
- function Df(a){return'string'===typeof a||a instanceof olympe.D.Xa?a:'function'===typeof a?olympe.dc.Ca.Wb(a):olympe.D.nb(a)?a.Dk===olympe.D.Xa?a:olympe.D.Ga([a],b=>olympe.D.Cb(olympe.dc.wa(b)),olympe.D.Xa):a.T()}m=olympe.dc.bk.prototype;m.mf.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.transform.K=olympe.D.J.L();m.kl.K=olympe.D.J.L();m.wy.K=olympe.D.J.L();m.Ht.K=olympe.D.J.L();m.vb.K=olympe.D.J.L();m.$v.K=olympe.D.J.L();m.Lk.K=olympe.D.J.L();m.Xv.K=olympe.D.J.L();m.Gt.K=olympe.D.J.L();m.Ve.K=olympe.D.J.L();
576
- m.Sv.K=olympe.D.J.L();m.contains.K=olympe.D.J.L();m.qh.K=olympe.D.J.L();m.Sk.K=olympe.D.J.L();m.Tv.K=olympe.D.J.L();m.hj.K=olympe.D.J.L();m.Rk.K=olympe.D.J.L();m.vj.K=olympe.D.J.L();m.xx.K=olympe.D.J.L();m.filter.K=olympe.D.J.L();m.not.K=olympe.D.J.L();m.and.K=olympe.D.J.L();m.or.K=olympe.D.J.L();m.zn.K=olympe.D.J.L();m.sort.K=olympe.D.J.L();m.Ov.K=olympe.D.J.L();m.limit.K=olympe.D.J.L();olympe.dc.query.Ep=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.zc}F(a){this.C.push(olympe.dc.wa(a))}Z(){return this.id}getData(){return this.data}};function Ff(a){return olympe.D.nb(a)?'Node#'+a.Na.Z():String(a)}function Gf(a,b){return olympe.D.nb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
577
- olympe.dc.query.qu=class{constructor(){this.uid=0;this.values=null}add(a){let b;b=olympe.D.nb(a)?'n'+a.Na.Z():'p'+ ++this.uid;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.ab=class{pa(){}C(){}F(){}ja(){}toString(){}};function xe(a,b,c){return c.run(()=>a.R.ib(b,c))}function ye(a,b,c){return c.run(()=>Hf(a.R,b,c))}
578
- function hf(a,b,c){var d=olympe.dc.Ka.rb;const e=b.Z();let f=If(a.ua,e),g=olympe.dc.Ka.rb;null===f&&(f=gf(b,a.G),a.L||(g=f.L()));Jf(a.ua,f,d,g);c&&Te(a.F,e,c);b=olympe.dc.ga.ka.xi;const h=olympe.dc.ga.ka.wi,k=l=>{if(null!==l){a.N.error(`graph subscription "${e}" failed to subscribe ${l}`);Kf(a.ua,e,d);var n=a.F;Ue(n,e,n.F);c(l,null)}};g===olympe.dc.Ka.rb?(a.N.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Y.process(d,f,k)):(b=M(new olympe.dc.ga(f.ph.L===olympe.dc.Hd.Ii?h:b,f,[g]),
579
- k),a.N.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function jf(a,b){var c=olympe.dc.Ka.rb;const d=olympe.dc.Ka.rb;if(c===d){const e=If(a.ua,b).ph.L,f=Lf(a.ua,b);Kf(a.ua,b,c)&&f!==d&&e===olympe.dc.Hd.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ka.To,String(b),[f]),g=>{g&&a.N.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Kf(a.ua,b,c)}
580
- function kf(a,b,c){var d=olympe.dc.Ka.rb;b=gf(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Te(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Ue(k,e,k.F);c(h,null)}};var g=b.L();g===olympe.dc.Ka.rb?a.Y.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ka.wi,b,[g]),f),a.C.send(d))}}
581
- function zf(a,b){var c=olympe.dc.Ka.rb;const d=b.Rd();var e=new olympe.dc.query.qu;let f;f=d;olympe.D.nb(f)&&(f=e.add(d));b=(b=b.Rl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Mf(a.ua,g);null===e&&(a.N.debug('QueryMGR: new',a.L?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.L||e.ud());a.Ta.process(c,e,h=>{h&&(Nf(a.ua,g,c||olympe.dc.Ka.rb),a.N.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
582
- function Af(a,b){var c=olympe.dc.Ka.rb;if(c===olympe.dc.Ka.rb){const d=Lf(a.ua,b);a.N.debug('QueryMGR: [ID:',b,'] - Unregistered');Nf(a.ua,b,c)&&d!==olympe.dc.Ka.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ka.Nu,String(b),[d]),e=>{e&&a.N.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Nf(a.ua,b,c)}
583
- function Of(a){const b=olympe.dc.ga.ka.Uo,c=olympe.dc.ga.ka.yl,d=olympe.dc.ga.ka.xp;a.C.C(olympe.dc.ga.ka.Hl,(e,f)=>{Pf(a,f,e)});a.C.C(b,(e,f)=>{Qf(a,f,e)});a.C.C(c,(e,f)=>{a.aa.af(f,e)});a.C.C(d,(e,f)=>{Rf(a,f,e)});a.C.oa((e,f)=>{Sf(a,f,e)})}function Tf(a,b){a.N.log('Received subscribeToAll command');b=b?olympe.D.Ia().C(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ka.Rg,null,[olympe.dc.Ka.Wc]);b&&M(c,b);a.C.send(c)}
584
- function Pf(a,b,c=olympe.dc.Ka.rb){b.L()!==olympe.dc.Ka.rb?a.N.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.oa.process(c,b,d=>{d&&a.N.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
585
- function Qf(a,b,c=olympe.dc.Ka.rb){const d=Uf(a.ua,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ka.rb?a.N.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.ha.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
586
- function Rf(a,b,c=olympe.dc.Ka.rb){const d=Vf(a.ua,b.Z());1<d.length||d[0]!==olympe.dc.Ka.rb?a.N.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.Fa.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
587
- function Sf(a,b,c){a.N.debug('Source event',b,'received for source',c);if(b===olympe.dc.tk.Vp){const d=(e,f)=>{f&&a.N.error(`Error after trying to resubscribe to ${e}: ${f}`)};Wf(a.ua,c).forEach(e=>{Te(a.F,e.Z(),d.bind(a,e.Z()));a.N.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ka.xi,e,[c]),d.bind(a,e.Z()));a.C.send(e)});Xf(a.ua,c).forEach(e=>{a.N.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ka.Lu,
588
- e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.wu=class{constructor(a,b,c,d,e,f,g,h){this.N=a;this.L=b;this.C=c;this.aa=d;this.ua=e;this.F=f;this.G=new olympe.D.Zb('Query Manager context');this.Ta=g[0];this.Y=g[1];this.oa=g[2];this.ha=g[3];this.Fa=g[4];this.R=h;Of(this)}Za(){return this.N}};olympe.dc.query.Relation=class extends olympe.dc.ua.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.T())+', ';a+='"direction": '+JSON.stringify(this.Qa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static lc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a){return new olympe.dc.query.Relation(a.T(),a.Qa(),a instanceof olympe.dc.X.Dc)}Rc(){const a=
589
- olympe.dc.Aa.DESTINATION,b=olympe.dc.Aa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.Subscription=class a extends olympe.D.Bj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Zb('context subscription '+b,e));this.id=b;this.Of=c;this.X=d||null;this.G=this.R.run(()=>olympe.D.ie(olympe.dc.query.Subscription.C.INIT));this.Ge=!1;this.ha=this.Qd=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ja(d);else e+='|null';e=olympe.W.ob(e)}catch(f){e=olympe.W.hc()}return e}Z(){return this.id}Rd(){return this.Of}Bg(){return this.X}ud(){const b=
590
- olympe.dc.Pa(),c=olympe.D.Ya(this.Rd());return c?b.Uf(c)?b.source(c)||olympe.dc.Ka.Wc:olympe.dc.Ka.rb:olympe.dc.Ka.Wc}th(){const b=this.G.Na.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Kq}uh(){if(this.G.Na.zb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Qd;this.Qd=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);pb(this.G,olympe.D.ie(olympe.dc.query.Subscription.C.Kq))}Pf(){return olympe.D.Ga([this.G],()=>{},olympe.D.ra)}Y(){const b=
591
- this.G.Na.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.qq}Je(b,c){this.Y()?b(this):(null===this.ha&&(this.ha=new Map),void 0===c&&(c=olympe.W.hc()),this.ha.set(c,olympe.D.Ia().C(b)));return c||''}nj(b){null!==this.ha&&b&&this.ha.delete(b)}Oc(){const b=olympe.dc.query.Subscription.C.qq;if(!this.G.Na.zb()&&olympe.D.Ya(this.G)!==b&&(this.yf(),pb(this.G,b),null!==this.ha)){for(const c of this.ha.values())c(this);this.ha=null}}onDestroy(b){this.R.onDestroy(b)}release(){this.R.destroy()}Tb(b){if(!this.G.Na.zb()){for(let c=
592
- 0,d=b.length;c<d;c++)this.Cm(b[c],c);if(this.Y())this.yf();else{this.Ge=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Oc()}}}$c(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}cc(b,c){if(!this.G.Na.zb()&&(this.Fk(b,olympe.dc.CloudObject.get(c)),b=this.Y(),this.Ge&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
593
- d)){b=!1;break}b&&this.Oc()}}uc(b){this.G.Na.zb()||(this.Bm(b),this.Qi(b,!this.Y()))}Ug(){return this.Y()?super.Ug():'Subscription is not ready!'}Vf(){const b=olympe.D.Ya(this.Rd());return olympe.dc.query.Subscription.F(b,this.Bg())}static F(b,c){var d=new olympe.dc.hf(b,olympe.dc.Hd.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.X.Sb||g instanceof olympe.dc.X.Dc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.vb(k,k.recursive)});
594
- else if(g instanceof olympe.dc.X.uf)d=a.F(olympe.D.Ya(g.Rd()),g.Bg()),b.push(...d);else if(g instanceof olympe.dc.X.tc||g instanceof olympe.dc.X.Od){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.vb(n,n.recursive);ue(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Kq:1,qq:2};olympe.dc.query.Subscription.prototype.Ug.K=olympe.D.J.C;function Mf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Nf(a,b,c){return Yf(a,a.F,b,c)}function Lf(a,b){for(const [c,d]of a.L)if(d.has(b))return c;return null}function If(a,b){return a.C.has(b)?a.C.get(b).F():null}function Jf(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.ua.mt(b,a.Y,a),a.C.set(e,f));f.L(c);Zf(a,e,d)}function Kf(a,b,c){return Yf(a,a.C,b,c)}function Uf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
595
- function Vf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Wf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Xf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function $f(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
596
- function Zf(a,b,c){let d=a.L.get(c);d?d.add(b):(d=(new Set).add(b),a.L.set(c,d))}function ag(a,b,c){var d=olympe.dc.Ka.rb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.ua.Zt(b,a.Y),a.F.set(e,f));f.L(c);Zf(a,e,d)}function Yf(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=Lf(a,c))&&a.L.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
597
- function bg(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.ua.xu(b),a.G.set(c,d));d.counter++;return d}function cg(a,b){(a=a.G.get(b))&&a.update()}function dg(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?eg(d,c):fg(d,c):a.N.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}
598
- olympe.dc.query.Su=class{constructor(a,b){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.R=new Set;this.L=new Map;this.Y=b}};olympe.dc.Yc=class{pa(){}$b(){}getTransform(){}ja(){}toString(){}};olympe.dc.lq=class{F(){}};olympe.dc.wf=class{pa(){}getValue(){}C(){}ja(){}toString(){}};olympe.dc.query.O={Ea:'olympe.dc.query.Logger',xa:'olympe.dc.query.QueryManager'};olympe.dc.query.Nb={Se:'olympe.dc.query.SubscriptionRegistry',Gj:'olympe.dc.query.CallbackRegistry',Wo:'olympe.dc.query.GraphProcessor',Vo:'olympe.dc.query.GraphNotificationProcessor',Xo:'olympe.dc.query.GraphResultProcessor',yp:'olympe.dc.query.ListProcessor',ak:'olympe.dc.query.ListNotificationProcessor',nq:'olympe.dc.query.QueryProcessor',ul:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Lq:'subscription.debug'};
599
- olympe.U.config(function(a){E(a,olympe.dc.query.Config.Lq,!1);C(a,olympe.dc.query.O.Ea,[olympe.sa.O.xa],b=>b.Pc('dc.query'));B(a,olympe.dc.query.Nb.Se,olympe.dc.query.Su,olympe.dc.query.O.Ea,new olympe.U.fa(olympe.dc.query.Config.Lq));B(a,olympe.dc.query.Nb.Gj,olympe.dc.query.Js,olympe.dc.query.O.Ea);B(a,olympe.dc.query.Nb.yp,olympe.dc.query.Xb.Gp,olympe.dc.query.O.Ea,olympe.dc.O.si,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.ul,olympe.dc.transaction.O.xa,new olympe.U.fa(olympe.dc.Config.Yg));B(a,olympe.dc.query.Nb.Wo,
600
- olympe.dc.query.Xb.bp,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,new olympe.U.fa(olympe.dc.Config.Yg));B(a,olympe.dc.query.Nb.Xo,olympe.dc.query.Xb.cp,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.Gj);B(a,olympe.dc.query.Nb.Vo,olympe.dc.query.Xb.ap,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se);B(a,olympe.dc.query.Nb.ak,olympe.dc.query.Xb.Fp,olympe.dc.query.O.Ea,olympe.dc.O.si,olympe.dc.query.Nb.Se);B(a,olympe.dc.query.Nb.nq,olympe.dc.query.Xb.yu,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,
601
- olympe.dc.query.Nb.ul,olympe.dc.query.Nb.Gj,olympe.dc.O.oe,olympe.dc.db.O.xa);B(a,olympe.dc.query.Nb.ul,olympe.dc.query.Xb.Ms,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,olympe.dc.transaction.O.xa);C(a,olympe.dc.query.O.xa,[olympe.dc.query.O.Ea,new olympe.U.fa(olympe.dc.Config.Yg),olympe.dc.O.oe,olympe.dc.db.O.xa,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.Gj,olympe.dc.query.Nb.yp,olympe.dc.query.Nb.Wo,olympe.dc.query.Nb.Xo,olympe.dc.query.Nb.Vo,olympe.dc.query.Nb.ak,olympe.dc.query.Nb.nq],(b,c,d,e,f,
602
- g,h,k,l,n,p,q)=>new olympe.dc.query.wu(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.U.run([olympe.dc.query.Nb.Se],a=>{olympe.dj().subscriptions=a});olympe.dc.query.ua={};function gg(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
603
- olympe.dc.query.ua.Uq=class{constructor(a,b){this.C=new Map;this.G=new Map;this.R=a;this.ha=b}F(){}L(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function eg(a,b){const c=b.Z();a.Y.set(c,b);olympe.D.Ia().onDestroy(()=>{a.Y.delete(c)})}function fg(a,b){const c=b.Z();a.aa.set(c,b);olympe.D.Ia().onDestroy(()=>{a.aa.delete(c)})}olympe.dc.query.ua.mt=class extends olympe.dc.query.ua.Uq{constructor(a,b,c){super(a,b);this.ua=c;this.Y=new Map;this.aa=new Map;b&&gg()}F(){return this.R}};olympe.dc.query.ua.Zt=class extends olympe.dc.query.ua.Uq{constructor(a,b){super(a,b);this.Y=new Map}F(){return this.R}L(a){super.L(a);if(this.ha){const b='md_'+olympe.W.hc();this.Y.set(b,gg());olympe.D.Ia().onDestroy(()=>{this.Y.delete(b)})}}};olympe.dc.query.ua.xu=class{constructor(a){this.query=a;this.F=olympe.dc.Dd();this.id=a.Z();this.C=olympe.D.Mc(olympe.dc.Wa);this.G=null;this.counter=0}update(){const a=olympe.D.Ya(this.C)||olympe.dc.Wa.empty(),b=olympe.dc.Wa.from(a,this.G);b!==a&&(Qc(this.F,null,Ce(b)),this.C.update(b))}destroy(){const a=olympe.D.Ya(this.C)||olympe.dc.Wa.empty();Qc(this.F,null,Be(a))}};olympe.dc.query.Xb={};function hg(a,b,c,d,e){a.N.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.ng(olympe.D.Ia()),g=k=>{f.add((l,n)=>{k.ib(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Z()} has encountered an error: ${p}`):l()});dg(a.ua,k.Z(),c)})},h=Array.from(Wf(a.ua,olympe.dc.Ka.Wc));b.forEach(k=>{const l=gf(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Br(l)){g(r.ph,!1);
604
- n=!0;break}}n?a.N.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});Xb(f,(k,l)=>e(l));f.start()}function ig(a,b,c){const d=[b.Rd()],e=g=>g instanceof olympe.dc.X.uf,f=(b.Bg()||[]).filter(e);for(const g of f)d.push(g.Rd()),f.push(...(g.Bg()||[]).filter(e));ne(a.C,()=>{olympe.D.yc(d,()=>{const g=b.Vf();hg(a,g,b,b.Z(),c)})})}function jg(a,b,c,d){const e=b.Z(),f=[te(b,c)];ne(a.C,()=>hg(a,f,b,e,d))}olympe.dc.query.Xb.Ms=class{constructor(a,b,c){this.N=a;this.ua=b;this.C=c}};olympe.dc.query.Xb.ap=class{constructor(a,b){this.N=a;this.ua=b}process(a,b,c){const d=b.Z();this.ua.C.has(d)?(If(this.ua,d).Fa(b),olympe.dc.Dd().af(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Xb.ap.ma=[olympe.dc.og];olympe.dc.query.Xb.bp=class{constructor(a,b,c){this.N=a;this.ua=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ka.rb||this.ua.C.has(d)){if(c(null,b),a=If(this.ua,d),this.C||a&&a.R)a=olympe.dc.Ka.rb,d=new olympe.dc.query.zi(d,a,a,new olympe.dc.db.zc),Pf(olympe.dc.Kf(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Xb.bp.ma=[olympe.dc.og];olympe.dc.query.Xb.cp=class{constructor(a,b,c){this.N=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=If(this.C,d);if(b instanceof olympe.dc.query.Xi.Uj)Kf(this.C,d,a);else if(!f.R){f.oa(b);const g=olympe.dc.Dd();Qc(g,f.aa());g.af(b.Gc,b.L());f.onDestroy(()=>{Qc(g,null,f.aa())});pf(f)}}let e;b instanceof olympe.dc.query.Xi.Uj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.aa()}`,this.N.error(e));We(this.F,b.Z(),b);c(e?Error(e):null,b)}};
605
- olympe.dc.query.Xb.cp.ma=[olympe.dc.og];const kg=[],lg=new Map;function mg(a,b,c,d){vc(a.db,d,e=>{e?b.Dg(c)?a.N.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.cc(c,d):ng(a,b,c,d)},c)}function ng(a,b,c,d){wc(a.db,d,c,!0);b.uc(c);kg.length=0;b.$c(function(e,f){kg[e]=f});c=a=0;for(d=kg.length;a<d;a++)'string'===typeof kg[a]&&(kg[c++]=kg[a]);kg.length=c;b.Tb(kg)}
606
- olympe.dc.query.Xb.Fp=class{constructor(a,b,c){this.N=a;this.db=b;this.ua=c}process(a,b,c){const d=b.Z();a=b.C;const e=Mf(this.ua,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{kg.length=a.length;e.$c((f,g)=>{if(f=e.lh(g)){f=f.T();var h=lg.get(f);void 0===h?lg.set(f,g):'string'===typeof h?lg.set(f,[h,g]):h.push(g)}else this.N.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
607
- for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=lg.get(h);void 0===k?(k=olympe.W.hc(),mg(this,e,k,h)):'string'===typeof k?lg.delete(h):(k=k.pop(),0===k.length&&lg.delete(h));kg[f]=k}for(const [f,g]of lg){if('string'===typeof g)ng(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)ng(this,e,g[h],f);lg.delete(f)}e.Tb(kg);c(null,b)}}};olympe.dc.query.Xb.Fp.ma=[olympe.dc.og];function og(a,b,c,d){const e=c.Z();a.N.debug('ListProcessor: [ID:',e,'] - processing with source ',b);ag(a.ua,c,b);if($f(a.ua,e,olympe.dc.Ka.rb))a.N.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.N.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.ud();a.F||f===olympe.dc.Ka.rb?(a.N.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),pg(a,c)):c.Gh().run(()=>{ig(a.C,c,g=>{g?a.N.error(g):pg(a,c)})})}b===olympe.dc.Ka.rb||
608
- $f(a.ua,e,b)||a.notify(b,c);d(null,c)}
609
- function pg(a,b){if(b.Y())a.N.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.oc.Tq(a.db,a.N),d=qg(a,b,c),e=b.Z();b.Gh().run(()=>{olympe.D.yc([b.Rd()],f=>{const g=olympe.dc.wa(f);a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.th()||b.uh();vc(a.db,g,h=>d(h,g),e);olympe.D.Ia().xc(()=>wc(a.db,g,e));a.db.Gb(g.valueOf())||rg(c);b.Y()||(rg(c),b.Tb([]))})})}}
610
- function qg(a,b,c){const d=new olympe.dc.oc.Ej;let e=!1;const f=b.Gh(),g=b.Bg(),h=[];h[g?g.length:0]=f.C((k,l,n,p)=>{f.R()||f.zb()||(k?b.Dg(n)?a.N.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.cc(n,l)):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.uc(n)),e||(sg(c,()=>{p.sg();rg(c)}),p.Sc().Jg(b.Tb.bind(b)),e=!0),
611
- tg(c,n))});if(null!==g){const k=olympe.dc.Sc();for(let l=g.length-1;0<=l;l--)h[l]=f.C(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Z();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,ug(p,k,l,n))}}
612
- olympe.dc.query.Xb.Gp=class{constructor(a,b,c,d,e,f){this.N=a;this.db=b;this.ua=c;this.C=d;this.F=f}process(a,b,c){og(this,a,b,c)}notify(a,b){const c=b.Z();this.N.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Ep(c);b.fe(g=>f.F(g));Rf(olympe.dc.Kf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Je(()=>{e=!0;d()})}};olympe.dc.query.Xb.Gp.ma=[olympe.dc.og];function Hf(a,b,c){const d=b.Z(),e=b.source,f=a.ua.G.has(d),g=bg(a.ua,b);return new rxjs.Observable(h=>{c.run(()=>{olympe.D.yc([g.C.Eb()],h.next.bind(h))});const k=()=>{l&&c.$c(l);{var n=a.ua;const q=n.G.get(d);var p;if(p=q)p=q,0<p.counter?p.counter--:olympe.sa.Za('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),p=0===p.counter;p&&(q.destroy(),n.G.delete(d),n.R.delete(d))}},l=c.xc(k);if(e===olympe.dc.Ka.Wc)jg(a.L,b,!0,n=>{n?(h.error(n),k()):vg(a,d,b,g,c)});else if(e===
613
- olympe.dc.Ka.rb)vg(a,d,b,g,c);else if(!f){const n=M(yc(new olympe.dc.ga(olympe.dc.ga.ka.om,b,[e]),c),p=>{p&&(h.error(p.message),k())});a.G.send(n)}return k})}
614
- function wg(a){const b=olympe.dc.ga.ka.nm,c=(d,e)=>Ee(d,f=>{Qc(a.F,Array.from(f.ge()).filter(g=>g.te()).map(g=>g.tag()));a.F.af(f,e)},e);a.G.C(olympe.dc.ga.ka.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,Ve(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,Ve(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g))if(e=
615
- a.ua.G.get(e))f=olympe.D.Ya(e.C),f&&f.hash===d.hash||(Qc(e.F,null,Ce(d)),e.C.update(d))});Pc(a.F,()=>{var d=a.ua;for(const e of d.R)cg(d,e);d.R.clear()})}
616
- function vg(a,b,c,d,e){const f=new olympe.dc.da.jq(c);Ie(f,()=>{var p=a.ua;p.G.has(b)&&p.R.add(b)});d.G=f;let g=(p,q)=>{p?a.N.debug(`New result tuple for query ${b}, ${q}`):a.N.debug(`Removed result tuple for query ${b}, ${q}`)};d=c.C;const h=d.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]);for(let p=d.length-1;0<=p;p--)g=d[p].observe(f,h[p],g);const k=a.F.view,l=c.G,n=vc(k,l,(p,q)=>{p?Le(f,q,0,null):f.remove(q,0,null);g(p,q,null,b)});e.xc(()=>wc(k,l,n));cg(a.ua,b)}
617
- olympe.dc.query.Xb.yu=class{constructor(a,b,c,d,e,f){this.N=a;this.ua=b;this.L=c;this.C=d;this.G=e;this.F=f;wg(this)}ib(a,b){return new Promise((c,d)=>{var e=a.source;if(e===olympe.dc.Ka.Wc)jg(this.L,a,!1,f=>{f?d(f):c(this.vd(a))});else if(e===olympe.dc.Ka.rb)c(this.vd(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;Ue(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.xc(h);Xe(this.C,f,(l,n)=>{b.$c(k);l?d(l.message):(b.xc(()=>{Qc(this.F,null,Be(n))}),c(n))});g||
618
- (e=M(yc(new olympe.dc.ga(olympe.dc.ga.ka.mm,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}vd(a){const b=new olympe.dc.da.jq(a);Ie(b,()=>{});Le(b,a.G,0,null);let c=0;for(const d of a.C)d.ib(b,c),c=d.F(c);return olympe.dc.Wa.from(olympe.dc.Wa.empty(),b)}};olympe.dc.query.Xi={};olympe.dc.query.Xi.Uj=class extends olympe.dc.query.zi{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.zc);this.error=d}aa(){return this.error}};olympe.dc.oc={};function ug(a,b,c,d){b?a.R[d]=c:delete a.R[d];null===a.F&&(a.F=new olympe.dc.oc.Lj(a.C,a));return a.F}function xg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function yg(a,b){a=a.R;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.oc.Lj=class{constructor(a,b){this.C=a;this.parent=b||null;this.aa=b?b.aa+1:0;this.R=Object.create(null);this.F=null}Sc(){return this.C}sg(){this.C.R()?this.C.G():this.C.aa(this.aa-1)}};olympe.dc.oc.va=class{constructor(){}C(){}R(){}aa(){}G(){}Jg(){}};olympe.dc.oc.Ej=class{constructor(){this.Y=this.L=this.index=this.F=null}R(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.oc.Lj(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Y){const a=
619
- [];null!==this.L&&(0<=this.F?yg(xg(this.L,this.F),a):a.push(this.index));this.Y(a)}}Jg(a){this.Y=a}};olympe.dc.oc.Ej.ma=[olympe.dc.oc.va];function zg(a,b){olympe.D.Tf(a.value)?(a.node=olympe.D.dl(a.value,b),Wa(a.node)||b()):b()}function Ag(a,b){if(olympe.D.Tf(a.value)){const c=olympe.D.Ia(),d=a.L;olympe.D.yc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>zg(a,b)),olympe.D.Ia().destroy())})}}
620
- class Bg extends olympe.dc.oc.Lj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.Ya();this.position=this.node=null;this.Y=!1;this.G=null}Ya(){const a=olympe.D.Ya(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}zb(){return null===this.value}}
621
- function Cg(a,b){if(!b.zb()){var c=a.F;var d=a.Fa,e=b.Ya(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Ya();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.Y&&a.G()}}}
622
- function Dg(a){const b=a.Fa;a.F.sort((c,d)=>b(c.Ya(),d.Ya()))}
623
- olympe.dc.oc.Sq=class{constructor(a){this.Fa=a;this.L=null;this.F=[];this.Y=[];this.ha=null;this.oa=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Bg(this,c,d),this.oa.set(b,f),this.R()?zg(f,()=>Cg(this,f)):(f.position=e.length,e.push(f));else{f=this.oa.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.oa.delete(b);null!==f.position&&(this.R()?this.remove(f):delete e[f.position]);f.destroy()}return f}R(){return null!==this.L}aa(a){if(null!==this.L)throw Error('Manager already activated (depth='+
624
- this.L+')');this.L=a;Dg(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Ag(d,()=>Cg(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Y.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Y){var b=e,c=this.L;b.Y=!0;b.G=xg(b,c)}0>this.L?this.Y.push(e.index):e.G&&yg(e.G,this.Y)}this.ha&&this.ha(this.Y)}Jg(a){this.ha=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
625
- a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.oc.Sq.ma=[olympe.dc.oc.va];class Eg extends olympe.dc.oc.Lj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ha=this.Y=this.L=!1;this.G=null}}
626
- function Fg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.L;let k,l,n;a.oa=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.Y&&(c.G=null,delete h[k]),delete f[k]);a.oa=!1;null!==a.F&&a.G()}
627
- olympe.dc.oc.Xl=class{constructor(){this.L={};this.order=[];this.F=null;this.oa=!1;this.Y=[];this.ha=null}R(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.oa){var a=this.order,b=a.length,c=this.L,d;for(d=this.Y.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.Y.push(e.index);else{if(!e.ha){var f=e,g=this.F;f.ha=!0;
628
- f.G=xg(f,g)}null!==e.G&&yg(e.G,this.Y)}}this.ha&&this.ha(this.Y)}}Jg(a){this.ha=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new Eg(this,c,b),this.L[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.oc.Xl.ma=[olympe.dc.oc.va];function rg(a){if(!a.F){for(let b in a.G)Gg(a.G[b]);a.F=!0}a.L=null;a.R=null}function sg(a,b,c){a.G[c||'root'].L=b}function tg(a,b,c){a.G[c||'root'].sg(b)}function Hg(a,b,c,d){const e=a.R,f=b+d+c;let g=e[f];void 0===g&&(g=Ed(a.db,b,c,d),e[f]=g);return g}function Ig(a,b){a.F||a.C.sg(b)}function Jg(a,b,c,d,e){if(!a.F){let f=Hg(a,c,d,e||olympe.dc.Aa.DESTINATION);e||(f+=Hg(a,c,d,olympe.dc.Aa.ORIGIN));0===f&&Ig(a,b)}}
629
- function Kg(a,b){const c=a.G[b];void 0!==c?(a.N&&a.N.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Z():''),a.C=c):a.N&&a.N.error('Try to set a block that does not exists:',b)}function Lg(a){const b=String(++a.Y),c=a.C;a.G[b]=new Mg(b,c);Ng(c,b);c.F||(c.F=()=>Kg(a,c.Z()));return b}function Og(a,b){const c=a.C;a.C.F=()=>{Kg(a,c.Z());b()}}function Pg(a,b){Gg(b?a.G[b]:a.C)}
630
- olympe.dc.oc.Tq=class{constructor(a,b){this.db=a;this.N=b||null;this.L=Object.create(null);this.R=Object.create(null);this.F=!1;this.Y=0;this.C=new Mg('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=Hg(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Ng(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Gg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
631
- class Mg{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.L=this.F=this.children=null;this.G=!1}Z(){return this.id}sg(a){const b=this.L;if(this.G||this.C===a||null===a)b&&b(),!b&&Gg(this)}notify(a){const b=this.F,c=this.children;if(this.G)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.na={};olympe.dc.na.sf=class{pa(){return O(olympe.dc.na.sf)}C(){return[]}getValue(a,b){return b}ja(){return'{"c":"'+this.pa()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.na.sf);olympe.dc.na.sf.ma=[olympe.dc.wf];olympe.dc.na.bd=class{constructor(a){this.value=a}pa(){return O(olympe.dc.na.bd)}C(){return[]}getValue(){return this.value}ja(a){a=Gf(a,this.value);return`{"c":"${this.pa()}","a":[${a}]}`}toString(){return`Constant(${Ff(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.na.bd);olympe.dc.na.bd.ma=[olympe.dc.wf];function Qg(a,b,c,d){const e=olympe.dc.Pa(),f=new olympe.dc.oc.Ej,g=new olympe.dc.oc.Tq(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,v,u)=>{const w=olympe.D.Ia();w.R()||w.zb()||(h||(sg(g,()=>{u.sg();rg(g)}),u.Sc().Jg(l),h=!0),r?k[v]=t:delete k[v],tg(g,v))};const p=olympe.D.Ia();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.C(n));n=p.C(n);const q=olympe.W.hc();vc(e,b,(r,t)=>{g.register(q,null);const v=f.C(r,b,q,null);
632
- n(r,t,q,ug(v,r,b,q))},q);p.onDestroy(()=>{wc(e,b,q)});e.Gb(b)||rg(g)}function Rg(a,b,c){const d=c.node,e=olympe.dc.Pa(),f=a.G(),g=yd(e,b,a.$e,d.C(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.$e,g))}
633
- olympe.dc.na.Nc=class{constructor(a,b,c){this.$e=a&&a.T?a.T():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Sb||d instanceof olympe.dc.X.Dc)||null;this.F=c||null;this.defaultValue=null}pa(){}$b(){}G(){}C(){return(this.X||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}bf(a){this.defaultValue=a;return this}Bg(){return this.X}Rd(){return this.F}getValue(a,b){const c=olympe.D.Mc(this.$b()||Object,'AbstractProperty valueType');null!==this.defaultValue&&qb(c,this.defaultValue);b=this.F||
634
- b;null!==this.X?Qg(a,b,this.X,d=>{Rg(this,d,c)}):Rg(this,b,c);return c.Eb()}ja(a){const b=Gf(a,this.$e),c=Gf(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ja(a)}).join(','));return`{"c":"${this.pa()}","a":["${b}",${d},${c}]}`}toString(){const a=Ff(this.$e),b=this.F?','+Ff(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.pa().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.na.Nc.ma=[olympe.dc.wf];olympe.dc.na.me=class extends olympe.dc.na.Nc{constructor(a,b,c){super(a,b,c)}pa(){return O(olympe.dc.na.me)}G(){return olympe.dc.W.Vb.Lm}$b(){return olympe.D.ea}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.na.me);olympe.dc.na.qe=class extends olympe.dc.na.Nc{constructor(a,b,c){super(a,b,c)}pa(){return O(olympe.dc.na.qe)}G(){return olympe.dc.W.Vb.Mm}$b(){return olympe.D.Xa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.na.qe);olympe.dc.na.ve=class extends olympe.dc.na.Nc{constructor(a,b,c){super(a,b,c)}pa(){return O(olympe.dc.na.ve)}G(){return olympe.dc.W.Vb.Jm}$b(){return olympe.D.ra}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.na.ve);olympe.dc.na.le=class extends olympe.dc.na.Nc{constructor(a,b,c){super(a,b,c)}pa(){return O(olympe.dc.na.le)}G(){return olympe.dc.W.Vb.Km}$b(){return olympe.D.kb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.na.le);olympe.dc.na.Mn=class{constructor(a,b){if(olympe.D.Tf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.T();var d=olympe.dc.Pa();const e=d.nc(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Mf(e,olympe.dc.CloudObject.extendRel,olympe.dm.qf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.T():d=new olympe.dc.na.qe(c,b);break;case olympe.dm.Number.P.T():d=new olympe.dc.na.me(c,
635
- b);break;case olympe.dm.Boolean.P.T():d=new olympe.dc.na.ve(c,b);break;case olympe.dm.DateTime.P.T():d=new olympe.dc.na.le(c,b)}this.F=d}pa(){return this.F.pa()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ja(a){return this.F.ja(a)}toString(){return this.F.toString()}};olympe.dc.na.Mn.ma=[olympe.dc.wf];olympe.dc.Db={};olympe.dc.Db.Number=class{constructor(a){this.C=a}pa(){return O(olympe.dc.Db.Number)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ja(a){return`{"c":"${this.pa()}",a:[${this.C.ja(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Db.Number);olympe.dc.Db.Number.ma=[olympe.dc.Ne];olympe.dc.Db.String=class{constructor(a){this.C=a}pa(){return O(olympe.dc.Db.String)}R(){return this.C.C()}L(a,b){return olympe.D.Ga([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Xa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ja(a){return`{"c":"${this.pa()}",a:[${this.C.ja(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Db.String);olympe.dc.Db.String.ma=[olympe.dc.Ne];olympe.dc.Db.DateTime=class{constructor(a){this.C=a}pa(){return O(olympe.dc.Db.DateTime)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ja(a){return'{"c":"'+this.pa()+'",a:['+this.C.ja(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Db.DateTime);olympe.dc.Db.DateTime.ma=[olympe.dc.Ne];let Sg=0;olympe.dc.Db.Mg=class{constructor(){this.id=Sg++}pa(){return'CustomLocalComparator#'+Sg}R(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ja(){return`{"c":"${this.pa()}"}`}toString(){return this.pa()+'()'}};olympe.dc.Db.Mg.ma=[olympe.dc.Ne];olympe.dc.V={};olympe.dc.V.md=class{constructor(a){this.L=a}pa(){return O(olympe.dc.V.md)}F(){return this.L.F()}G(){return this.L}C(a,b){return olympe.D.dl(this.L.C(a,b),c=>!c.valueOf())}ja(a){return`{"c":"${this.pa()}","a":[${this.L.ja(a)}]}`}toString(){return'Not('+this.L.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.md);olympe.dc.V.md.ma=[olympe.dc.ab];olympe.dc.V.Yd=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}pa(){return O(olympe.dc.V.Yd)}R(){return this.V}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}ja(a){const b=this.V.map(c=>c.ja(a));return'{"c":"'+this.pa()+'","a":['+b.join(',')+
636
- ']}'}toString(){return'And('+this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Yd);olympe.dc.V.Yd.ma=[olympe.dc.ab];olympe.dc.V.ee=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}pa(){return O(olympe.dc.V.ee)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}R(){return this.V}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}ja(a){const b=this.V.map(c=>c.ja(a));return'{"c":"'+this.pa()+'","a":['+b.join(',')+
637
- ']}'}toString(){return'Or('+this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.ee);olympe.dc.V.ee.ma=[olympe.dc.ab];olympe.dc.V.ml=class{constructor(a,b){this.G=a;this.L=b}pa(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Ga([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.R('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}R(){}ja(a){return'{"c":"'+this.pa()+'","a":['+this.G.ja(a)+','+this.L.ja(a)+']}'}toString(){return this.pa().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};olympe.dc.V.ml.ma=[olympe.dc.ab];olympe.dc.V.Ic=class{constructor(a,b){this.G=a;this.L=b}pa(){return O(olympe.dc.V.Ic)}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Ga([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Wd?c.Wd(d):'object'===typeof d&&void 0!==d.Wd?d.Wd(c):olympe.D.Bc(c.valueOf()===d.valueOf()),olympe.D.ra,'Test equal predicate')}ja(a){return'{"c":"'+this.pa()+'","a":['+this.G.ja(a)+','+this.L.ja(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
638
- ')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Ic);olympe.dc.V.Ic.ma=[olympe.dc.ab];olympe.dc.V.Zs=class extends olympe.dc.V.Ic{constructor(a,b){super(a,new olympe.dc.na.bd(b))}};olympe.dc.V.Zs.ma=[olympe.dc.ab];olympe.dc.V.ye=class extends olympe.dc.V.ml{constructor(a,b){super(a,b)}pa(){return O(olympe.dc.V.ye)}R(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ye);olympe.dc.V.Fe=class extends olympe.dc.V.ml{constructor(a,b){super(a,b)}pa(){return O(olympe.dc.V.Fe)}R(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Fe);olympe.dc.V.Uc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}pa(){return O(olympe.dc.V.Uc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Ga([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Bc(c.includes(d))},olympe.D.ra)}ja(a){const b=this.source.ja(a),c=this.value.ja(a);a=Gf(a,this.G);return'{"c":"'+this.pa()+'","a":['+
639
- b+','+c+','+a+']}'}toString(){const a=Ff(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Uc);olympe.dc.V.Uc.ma=[olympe.dc.ab];olympe.dc.V.Ad=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}pa(){return O(olympe.dc.V.Ad)}F(){return[this.source.C()]}C(a,b){return olympe.D.cf([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ja(a){const b=this.source.ja(a),c=Gf(a,this.L);a=Gf(a,this.G);return'{"c":"'+this.pa()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Ff(this.G);return'Regex('+this.source.toString()+
640
- ','+this.L+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.Ad);olympe.dc.V.Ad.ma=[olympe.dc.ab];olympe.dc.V.kf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.wa(b))}):this.G.add(olympe.dc.wa(a))}pa(){return O(olympe.dc.V.kf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Pa();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.wa(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
641
- (K(c,!0),f()):(h=new Tg(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Tg(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Wa(c)||K(c,!1);return c}ja(){return'{"c":"'+this.pa()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Tg{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.xg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.kf);olympe.dc.V.kf.ma=[olympe.dc.ab];function Ug(a){return a.Ma.map(b=>b.T())}function Vg(a){return a.Ma.map(b=>b.Qa())}
642
- olympe.dc.V.jf=class{constructor(a,b,c){this.Ma=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.wa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ma.push(new Wg(c.T(),c.Qa(),c.F,c.C)):this.Ma.push(new Wg(olympe.dc.wa(c),b[d],1,1))}pa(){return O(olympe.dc.V.jf)}F(){return[this.Ma.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.hc(),e=olympe.dc.Pa();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
643
- c.zb()||(f+=h?1:-1,K(c,0<f))};const g=this.Ma;for(let h=g.length-1;0<=h;h--)a=Xg(g[h],e,a,d+h);vc(e,b,a,d);olympe.D.Ia().onDestroy(()=>{wc(e,b,d)});c.bf(!1);return c}ja(){return'{"c":"'+this.pa()+'","a":['+JSON.stringify(this.Ma.map(a=>a.ja()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.Ma.map(a=>a.ja())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.jf);
644
- function Xg(a,b,c,d){const e=Object.create(null);d+=olympe.W.xg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class Wg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ja(){return`${this.T()}, ${this.Qa()}, ${this.F}, ${this.C}`}}olympe.dc.V.jf.ma=[olympe.dc.ab];olympe.dc.V.sl=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.cf([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}pa(){return O(olympe.dc.V.sl)}F(){return[this.value.C()]}ja(a){const b=olympe.D.nb(this.G)?this.G.Na.Ib.valueOf():this.G.valueOf();return'{"c":"'+this.pa()+'","a":['+b+','+this.value.ja(a)+']}'}toString(){const a=olympe.D.nb(this.G)?this.G.Na.Ib.valueOf():this.G.valueOf();return this.pa().replace(/^.+\./,'')+
645
- '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.sl);olympe.dc.V.sl.ma=[olympe.dc.ab];let Yg=0;olympe.dc.V.Mg=class{constructor(){this.id=Yg++}pa(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ja(){return`{"c":"${this.pa()}"}`}toString(){return this.pa()+'()'}};olympe.dc.V.Mg.ma=[olympe.dc.ab];olympe.dc.V.Ll=class{constructor(a,b,c){this.Ma=[];this.G=void 0!==c?c.map(olympe.dc.wa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ma.push(new Zg(c.T(),c.Qa(),c.F,c.C)):this.Ma.push(new Zg(olympe.dc.wa(c),b[d],1,1))}pa(){return O(olympe.dc.V.Ll)}F(){return[this.Ma.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Pa(),e=olympe.W.xg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.Ma;
646
- for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;vc(d,b,a.bind(null,h=>{c.R()||c.zb()||(g+=h,K(c,0<g))}),e);olympe.D.Ia().onDestroy(()=>wc(d,b,e));c.bf(!1);return c}ja(){return'{"c":"'+this.pa()+'","a":['+JSON.stringify(this.Ma.map(a=>a.ja()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.Ma.map(a=>a.ja())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Ll);
647
- class Zg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.L=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.L,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.W.xg();if(p){const t=n+q,v=u=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
648
- null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+u),Array.from(w.values()).forEach(y=>y(u)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(u=>{d.set(q,(d.get(q)||0)+u);k(u)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,v,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}ja(){return`${this.T()}, ${this.Qa()}, ${this.F}, ${this.C}`}}olympe.dc.V.Ll.ma=[olympe.dc.ab];olympe.dc.X={};olympe.dc.X.nk={dt:1,qt:-1,np:0};olympe.dc.X.YA={Ay:!0,Xy:!1};olympe.dc.X.Sb=class extends olympe.dc.ua.Relation{constructor(a,b){super(a,b||olympe.dc.Aa.DESTINATION)}$b(){return Jc(this)}pa(){return O(olympe.dc.X.Sb)}Rc(){return new olympe.dc.X.Sb(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Pa(),e=this.T(),f=this.Qa();return(g,h,k,l)=>{Jg(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.ob(k+f+e+p,20),r=ug(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}ja(){return'{"c":"'+
649
- this.pa()+'","a":["'+this.T()+'","'+this.Qa()+'"]}'}toString(){return'Related('+this.Qa()+this.T()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Sb);olympe.dc.X.Sb.ma=[olympe.dc.Yc];olympe.dc.X.Dc=class extends olympe.dc.ua.Relation{constructor(a,b=olympe.dc.Aa.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}$b(){return Jc(this)}pa(){return O(olympe.dc.X.Dc)}getTransform(a,b,c){const d=olympe.dc.Pa(),e=Object.create(null),f=olympe.dc.Aa.ORIGIN,g=olympe.dc.Aa.DESTINATION,h=this.T(),k=this.Qa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.tb(r,this);p+=1;for(let v=0,u=t.length;v<u;v++){if(void 0!==e[t[v]]||r===t[v])continue;const w=olympe.W.ob(q+k+(h+'_'+p)+t[v],20);b.register(w,
650
- q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,v,u)=>{v&&!b.F&&l(p,t,u);p>=this.F?c(v,u,t,ug(r,v,u,t)):Jg(b,t,u,h,k);0<=this.C&&p>=this.C||(v?e[u]||(e[u]=!0,V(d,u,this,(w,y)=>{const A=p+1,D=olympe.W.ob(t+k+(h+'_'+A)+y,20);n(A,u,r,D,w,y)},t)):(d.C(u,this,t),delete e[u]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ja(){return'{"c":"'+this.pa()+'","a":["'+this.T()+'","'+this.Qa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Qa()+this.T()+'['+this.F+'..'+this.C+'])'}};
651
- N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Dc);olympe.dc.X.Dc.ma=[olympe.dc.Yc];function $g(a){return a.Ma.map(b=>b.T())}
652
- olympe.dc.X.Be=class{constructor(a,b){this.direction=b||olympe.dc.Aa.DESTINATION;this.Ma=a.map(c=>new olympe.dc.ua.Relation(c,this.direction))}$b(){return olympe.dc.CloudObject}pa(){return O(olympe.dc.X.Be)}Qa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Pa(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Qa();var q=k.T();p=olympe.W.ob(g+p+q+n,20);q=ug(h,l,n,p);l&&b.register(p,g,f,k.T(),k.Qa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.Ma.forEach(l=>{Jg(b,h,g,l.T(),l.Qa());e(g,h,k,l)}):this.Ma.forEach(l=>
653
- {d.C(g,l,h)})}}ja(){return'{"c":"'+this.pa()+'","a":['+JSON.stringify($g(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Qa()+'['+$g(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Be);olympe.dc.X.Be.ma=[olympe.dc.Yc];olympe.dc.X.Fl=class{constructor(a,b,c,d){this.C=new olympe.dc.ua.Relation(olympe.dc.wa(a),c||olympe.dc.Aa.DESTINATION);this.F=new olympe.dc.ua.Relation(olympe.dc.wa(b),d||olympe.dc.Aa.DESTINATION)}$b(){return Jc(this.C)}pa(){return O(olympe.dc.X.Fl)}getTransform(a,b,c){const d=olympe.dc.Pa(),e={},f=this.C.T(),g=this.C.Qa(),h=this.F.T(),k=this.F.Qa();let l=null,n=null;const p=(r,t,v,u,w,y)=>{if(w){if(w=()=>{const A=olympe.W.ob(v+g+(f+'_'+r)+y,20),D=ug(t,!0,y,A);l=r;n=()=>{c(!1,y,A,ug(t,!1,y,A))};
654
- b.register(A,v,u,f,g);c(!0,y,A,D)},w.Sr=r,e[u]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[u]=!0;w=Infinity;let A=null;for(let D=Object.keys(e),T=D.length,I=0;I<T;I++){let aa=e[D[I]];aa.Sr<w&&(w=aa.Sr,A=aa)}A&&A()}},q=(r,t,v,u,w)=>{u?e[w]||(e[w]=!0,Jg(b,v,w,f,g),Jg(b,v,w,h,k),V(d,w,this.C,p.bind(this,r,t,v,w),v+'_val'),V(d,w,this.F,q.bind(this,r+1,t,v),v+'_follow')):(d.C(w,this.F,v+'_follow'),d.C(w,this.C,v+'_val'),delete e[w])};return(r,t,v,u)=>q(0,u,v,r,t)}ja(){return'{"c":"'+this.pa()+'","a":["'+
655
- this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.X.Fl);olympe.dc.X.Fl.ma=[olympe.dc.Yc];olympe.dc.X.Gd=class{$b(){return null}pa(){return O(olympe.dc.X.Gd)}getTransform(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,ug(h,!0,f,f))):(d[f]++,Ig(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,ug(h,!1,f,f)))}}ja(){return'{"c":"'+this.pa()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.Gd);olympe.dc.X.Gd.ma=[olympe.dc.Yc];olympe.dc.X.Od=class{constructor(a,b){this.Bd=a;this.C=void 0===b?!0:!!b}$b(){return null}pa(){return O(olympe.dc.X.Od)}F(){return[this.Bd.R()]}getTransform(a,b,c){const d=new olympe.dc.oc.Sq(this.C?this.Bd.G.bind(this.Bd):(e,f)=>this.Bd.G(f,e));return(e,f,g)=>{var h=e?this.Bd.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ja(a){return'{"c":"'+this.pa()+'","a":['+this.Bd.ja(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Bd.toString()+','+JSON.stringify(this.C)+')'}};
656
- N('olympe.dc.transformers.Sort',olympe.dc.X.Od);olympe.dc.X.Od.ma=[olympe.dc.Yc,olympe.dc.lq];olympe.dc.X.tc=class{constructor(a){this.C=a}$b(){return null}pa(){return O(olympe.dc.X.tc)}G(){return this.C}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Ig(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,ug(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.nb(f)&&(f=f.Na),olympe.D.Sf(f)?(b.F||void 0!==olympe.D.Ya(f)||Ig(b,h),e[l]=f,olympe.D.yc([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),
657
- d(g,h,k,!1),delete e[h])}}ja(a){return'{"c":"'+this.pa()+'","a":['+this.C.ja(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.tc);olympe.dc.X.tc.ma=[olympe.dc.Yc,olympe.dc.lq];olympe.dc.X.ce=class{constructor(a,b){this.start=a;this.C=b}$b(){return null}pa(){return O(olympe.dc.X.ce)}getTransform(a,b,c){const d=new olympe.dc.oc.Xl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);Fg(d,e,f,n,c)}};olympe.D.ke([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Og(b,k);const l=Lg(b);Kg(b,l);return(n,p,q,r)=>{h||(r.Sc().Jg(t=>{e=t;Pg(b,l)}),sg(b,()=>r.sg(),l),h=!0);d.C(n,p,q,null);tg(b,q,l)}}ja(a){return'{"c":"'+
658
- this.pa()+'","a":['+Gf(a,this.start)+','+Gf(a,this.C)+']}'}toString(){return`Limit(${olympe.D.Ya(this.start)},${olympe.D.Ya(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.ce);olympe.dc.X.ce.ma=[olympe.dc.Yc];function ah(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.C(f));f=n.C(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,ug(r,p,q,h))}const h=olympe.W.hc(),k=olympe.dc.Pa(),l=a.X,n=olympe.D.Ia();olympe.D.yc([a.C],p=>{bh(k,p,g,h);void 0===k.model(p)&&rg(e)})}function bh(a,b,c,d){const e=b&&b.valueOf();e&&(vc(a,e,c,d),olympe.D.Ia().xc(()=>wc(a,e,d)))}
659
- olympe.dc.X.uf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Ba?(this.C=a.Rd(),this.X=a.Rl()):(this.C=a,b&&(this.X=b))}$b(){return null}pa(){return O(olympe.dc.X.uf)||''}Bg(){return this.X}Rd(){return this.C}getTransform(a,b,c){const d=new olympe.dc.oc.Xl,e=new olympe.dc.oc.Ej;let f=[],g=[],h=!1,k=!1;const l=Lg(b),n=Lg(b);Og(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Pg(b);Fg(d,p,0,p.length,c)});Kg(b,n);ah(this,a,this.C,e,b,(p,q,r,t)=>{const v=olympe.D.Ia();
660
- v.R()||v.zb()||(k||(t.Sc().Jg(u=>{g=u;Pg(b,n)}),sg(b,()=>t.sg(),n),k=!0),d.C(p,q,r),tg(b,r,n))});Kg(b,l);return(p,q,r,t)=>{h||(t.Sc().Jg(v=>{f=v;Pg(b,l)}),sg(b,()=>t.sg(),l),h=!0);d.C(p,q,r,l);tg(b,r,l)}}ja(a){const b=this.X?'['+this.X.map(c=>c.ja(a)).join(',')+']':'null';return'{"c":"'+this.pa()+'","a":['+Gf(a,this.C)+','+b+']}'}toString(){const a=olympe.D.nb(this.C)?'N:'+this.C.Na.Z():this.C.valueOf(),b=this.X?','+this.X.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
661
- N('olympe.dc.transformers.Union',olympe.dc.X.uf);olympe.dc.X.uf.ma=[olympe.dc.Yc];olympe.dc.Kg={};function ch(a,b){let c=Bc.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Af(b);if(null===b)break;c=Bc.get(b)||null}return c||null}olympe.dc.Kg.SyncManager=class{constructor(a,b,c){this.N=a;this.db=b;this.C=c}};olympe.dc.Kg.O={Ea:'dc.syncs.Logger',xa:'dc.syncs.SyncManager'};olympe.U.config(function(a){C(a,olympe.dc.Kg.O.Ea,[olympe.sa.O.xa],b=>b.Pc('dc'));B(a,olympe.dc.Kg.O.xa,olympe.dc.Kg.SyncManager,olympe.dc.Kg.O.Ea,olympe.dc.O.si,olympe.U.O.cg)});olympe.dc.W={};olympe.dc.W.IC=function(a){a=olympe.dc.wa(a);const b=olympe.D.Mc(olympe.D.Xa,'getInstanceName'),c=olympe.dc.Pa(),d=yd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ia().xc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Eb()};olympe.dc.W.LC=function(a){return olympe.D.Ga([a],b=>olympe.D.Sx(olympe.dc.Pa().jj(b)),olympe.D.ra)};olympe.dc.W.MC=function(a){return(a=olympe.D.Ya(a))?olympe.dc.Pa().jj(a):!1};olympe.dc.W.Hi=class a{constructor(b=olympe.dc.Ka.Wc){this.G=b}C(b){const c=new olympe.dc.db.zc;this.F(b,c);return c}R(b,c,d){const e=new olympe.dc.db.zc(b),f=new olympe.dc.query.zi(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}L(b,c){const d=new olympe.dc.db.zc(b),e=new olympe.dc.query.nt(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new mf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.bc.Nd;for(const f of b)switch(b=
662
- f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.pc(f.t,a.C(f.p),!0,b);break;case 3:c.Lc(f.t,f.f,b);break;case 4:c.Oa(f.m,f.l,f.r,b);break;case 5:c.Jb(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.bc.Nd||b===olympe.dc.bc.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.bc.VERSION,e);continue}let f=
663
- typeof e;b.startsWith('fd')&&(b=olympe.dc.Tg.qc+b.substr(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
664
- e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.Ec(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.W.Vb={};olympe.dc.W.Vb.Mm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Cb(a):a instanceof olympe.D.Xa?a:null;olympe.dc.W.Vb.Jm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Bc(a):a instanceof olympe.D.ra?a:null;olympe.dc.W.Vb.Lm=a=>'number'===typeof a||a instanceof Number?olympe.D.za(a):'string'===typeof a||a instanceof String?olympe.D.za(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ea?a:null;
665
- olympe.dc.W.Vb.Km=function(a){return'number'===typeof a||a instanceof Number?sb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.kb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.kb(a):a instanceof olympe.D.kb?a:null};olympe.dc.W.Vb.xr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?wb(a.valueOf()):null};olympe.dc.W.Vb.yr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Ec?olympe.dc.CloudObject.get(a.tag):null;
666
- olympe.dc.W.Vb.hh=a=>a instanceof olympe.dc.Ec?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Vb.sC=a=>{switch(typeof a){case 'boolean':return olympe.D.Bc(a);case 'number':return olympe.D.za(a);case 'string':return olympe.D.Cb(a);case 'object':if(a instanceof Date)return olympe.D.Ix(a)}return a};
667
- olympe.dc.W.Vb.FC=a=>{switch(a){case olympe.D.ra:return olympe.dc.W.Vb.Jm;case olympe.D.Xa:return olympe.dc.W.Vb.Mm;case olympe.D.ea:return olympe.dc.W.Vb.Lm;case olympe.D.kb:return olympe.dc.W.Vb.Km;case olympe.D.Color:return olympe.dc.W.Vb.xr;case olympe.dc.CloudObject:return olympe.dc.W.Vb.yr;default:return olympe.dc.W.Vb.hh}};olympe.dc.O={xa:'dc.Manager',lt:'dc.Graph',si:'dc.DBView',Ea:'dc.Logger',Wu:'dc.TransactionLogger',vi:'dc.FileServiceManager',oe:'dc.Router'};olympe.dc.Config={dg:'dc.debug',Yg:'dc.subscribeAll',ro:'dc.defaultSource',Ho:'dc.fileCache',Ao:'dc.errorOnAbstractInstantiation'};
668
- olympe.U.config(function(a){E(a,olympe.dc.Config.dg,!1);E(a,olympe.dc.Config.Yg,!1);E(a,olympe.dc.Config.ro,olympe.dc.Ka.Wc);E(a,olympe.dc.Config.Ho,!0);E(a,olympe.dc.Config.Ao,!0);C(a,olympe.dc.O.Ea,[olympe.sa.O.xa],b=>b.Pc('dc'));sa(a,olympe.dc.O.Wu,olympe.dc.transaction.O.Ea);sa(a,olympe.dc.O.si,olympe.dc.db.O.jb);B(a,olympe.dc.O.vi,olympe.dc.ht,olympe.dc.O.Ea,olympe.la.O.xa,olympe.dc.O.oe,olympe.W.O.xh,new olympe.U.fa(olympe.dc.Config.Ho));ta(a,olympe.dc.O.oe);B(a,olympe.dc.O.xa,olympe.dc.va,
669
- olympe.dc.O.Ea,olympe.dc.db.O.xa,olympe.dc.query.O.xa,olympe.dc.transaction.O.xa,olympe.dc.Kg.O.xa,olympe.dc.O.vi)},'olympe.dc');olympe.U.run([olympe.dc.db.O.xa,olympe.dc.query.O.xa,olympe.dc.transaction.O.xa,olympe.dc.Kg.O.xa,olympe.dc.O.xa,olympe.dc.O.vi],(a,b,c,d,e,f)=>{olympe.dc.Dd=()=>a;olympe.dc.Kf=()=>b;olympe.dc.gi=()=>c;olympe.dc.Qr=()=>d;olympe.dc.Sc=()=>e;olympe.dc.vw=()=>f},'DC singleton getter initialization');olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Pa();this.model=null}static get(a){{var b=olympe.dc.Qr();a=olympe.dc.wa(a);const c=ch(b,b.db.model(a));null===c?(b.N.error(`Instantiation of a Sync (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
550
+ for(const b of this.C)a+=JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static mc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.mc(b.relation);a=new olympe.dc.query.Tj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Tj.mc(c),a.children.set(b.id,b);return a}Z(){return this.id}Sd(){return this.G}kh(){return Array.from(this.children.values())}ge(){return this.C.values()}toString(){return this.F+
551
+ this.G.toString()}};function pf(a,b){a.C.forEach((c,d)=>b(d,c))}
552
+ olympe.dc.query.zi=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Gc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.Gc.toJSON()}`;return a+'}'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):
553
+ b=a;a=olympe.dc.db.zc.mc(b.patch);a=new olympe.dc.query.zi(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Z(){return this.id}};const qf=olympe.dc.jc.Wc,rf=olympe.dc.jc.ui,sf=olympe.dc.Aa.ORIGIN,tf=olympe.dc.Aa.DESTINATION;function uf(a,b,c){const d=a.ph.ea;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Sd()),!0))}
554
+ olympe.dc.query.Ol=class extends olympe.dc.query.Sj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}Y(){return this.G.values()}ka(a){a=a.Gc;for(const b of a.ge())b.L()?this.G.delete(b.tag()):b.te()&&this.G.add(b.tag())}qa(a){let b=[],c=[];lf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Pc(olympe.dc.Dd(),b,c)}Er(a){var b=a.C,c=Array.from(a.F.values()),d=uf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
555
+ b=olympe.dm.Relation.C.yk;c=olympe.dm.Relation.C.mk;const e=olympe.dc.Pa();for(const h of d){var f=h.Sd(),g=f.T();d=f.Qa();if(d!==tf||g!==qf&&g!==rf){if(!e.Gb(f))return this.N.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=zd(e,f,We(this.ph));g=0===h.kh().length;if(!(f&(d===sf?g?12:c:g?3:b)))return!1}}return!0}};function vf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().$b();return b}function wf(a,b){a.Y()||(a=`Calling "${b}" on subscription with id ${a.Z()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.sa.Ya('dc').warn(a))}
556
+ function xf(a,b){const c=new olympe.D.Zb('listDef toObservable',a.nc().Gh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.yc([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
557
+ olympe.dc.Ba=class{constructor(a,b,c){void 0===a||null===a?olympe.sa.Ya('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Ga([a],olympe.dc.wa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||vf(this),this.C=null)}Tc(){return olympe.dc.Tc()}ib(){if(null===this.C){const a=olympe.dc.Kf();this.C=yf(a,this);null!==this.valueType&&this.C.Jd(this.valueType);olympe.D.Ia().xc(()=>{zf(a,this.C.Z());this.C=
558
+ null})}return this}nc(){null===this.C&&this.ib();return this.C}Jd(a){this.valueType=a;null!==this.C&&this.C.Jd(this.valueType)}$b(){return null!==this.C?this.C.$b():null===this.valueType?olympe.dc.CloudObject:this.valueType}Qd(){return this.F}Rl(){return this.X}Je(a,b){return this.nc().Je(a,b)}nj(a){this.nc().nj(a)}Jt(){return this.nc().Pf()}It(){return this.nc().Y()}get(a){return this.nc().get(a)}di(){return this.nc().di()}lh(a){const b=this.nc();wf(b,'getCurrent');return b.lh(a)}has(a){return this.nc().has(a)}Dg(a){const b=
559
+ this.nc();wf(b,'hasCurrent');return b.Dg(a)}se(a){return this.nc().se(a)}Nx(a){return xf(this,this.se(a))}We(a){const b=this.nc();wf(b,'getCurrentAt');return b.We(a)}Xe(a){return this.nc().Xe(a)}Df(a){const b=this.nc();wf(b,'getCurrentKeyAt');return b.Df(a)}he(a){return this.nc().he(a)}Rx(a){return xf(this,this.he(a))}Ef(a){const b=this.nc();wf(b,'getCurrentRank');return b.Ef(a)}Rc(){return this.nc().Rc()}Ox(){return xf(this,this.Rc())}Ff(){return this.nc().Ff()}lf(){return this.nc().lf()}Sx(){return xf(this,
560
+ this.lf())}yg(){const a=this.nc();wf(a,'getCurrentSize');return a.yg()}forEach(a,b){this.nc().forEach(a,b)}fe(a){const b=this.nc();wf(b,'forEachCurrentValue');return b.fe(a)}Zi(a,b,c,d){a=new olympe.dc.X.be(a,b);(new olympe.dc.Ba(this.F,[...this.X,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.X];for(const c of b){if(void 0===
561
+ c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.va.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Ba(this.F,a);b.Jd(vf(b)||this.valueType||Object);return b}kl(a){return this.transform(new olympe.dc.X.uf(a))}filter(a){return this.transform(new olympe.dc.X.uc(a))}ug(){const a=new olympe.dc.bk(this.F,null===this.valueType?
562
+ void 0:this.valueType);let b=this.X;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.X;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Za(this.F)+a+')'}Ht(){return this.nc().Ug()}kd(){return olympe.D.Ga([this.lf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.We(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Cb(b+']')},olympe.D.Xa)}};olympe.dc.Ba.prototype.filter=olympe.dc.Ba.prototype.filter;olympe.dc.Ba.prototype.union=olympe.dc.Ba.prototype.kl;
563
+ olympe.dc.Ba.prototype.transform=olympe.dc.Ba.prototype.transform;olympe.dc.Ba.prototype.forEachCurrentValue=olympe.dc.Ba.prototype.fe;olympe.dc.Ba.prototype.forEach=olympe.dc.Ba.prototype.forEach;olympe.dc.Ba.prototype.getCurrentSize=olympe.dc.Ba.prototype.yg;olympe.dc.Ba.prototype.observeSize=olympe.dc.Ba.prototype.Sx;olympe.dc.Ba.prototype.observeFirst=olympe.dc.Ba.prototype.Ox;olympe.dc.Ba.prototype.getCurrentRank=olympe.dc.Ba.prototype.Ef;olympe.dc.Ba.prototype.observeRank=olympe.dc.Ba.prototype.Rx;
564
+ olympe.dc.Ba.prototype.getCurrentAt=olympe.dc.Ba.prototype.We;olympe.dc.Ba.prototype.observeAt=olympe.dc.Ba.prototype.Nx;olympe.dc.Ba.prototype.offReady=olympe.dc.Ba.prototype.nj;olympe.dc.Ba.prototype.onReady=olympe.dc.Ba.prototype.Je;olympe.dc.Ba.prototype.getBaseTag=olympe.dc.Ba.prototype.Qd;olympe.dc.Ba.ma=[olympe.D.pd];m=olympe.dc.Ba.prototype;m.Tc.K=olympe.D.J.C;m.ib.K=olympe.D.J.L();m.nc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Jd.K=new olympe.D.J(()=>{},[]);
565
+ m.Qd.K=new olympe.D.J(()=>String,[]);m.Rl.K=new olympe.D.J(()=>Array,[]);m.Je.K=new olympe.D.J(()=>String,[]);m.nj.K=new olympe.D.J(()=>{},[]);m.Jt.K=olympe.D.J.R;m.It.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.di.K=new olympe.D.J(()=>Array,[]);m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.R;m.Dg.K=olympe.D.J.C;m.se.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.We.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Df.K=olympe.D.J.C;m.he.K=olympe.D.J.G;
566
+ m.Ef.K=olympe.D.J.C;m.Rc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Ff.K=new olympe.D.J(()=>String,[]);m.lf.K=olympe.D.J.G;m.yg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.fe.K=olympe.D.J.C;m.Zi.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.kl.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.ug.K=new olympe.D.J(()=>olympe.dc.bk,[]);m.toString.K=olympe.D.J.C;m.Ht.K=olympe.D.J.C;m.kd.K=olympe.D.J.F;const Af={Ey:'append',El:'filter_not',Lo:'filter_and',Mo:'filter_or'};function Bf(a,b){a=Cf(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.oa.On(a,b)).F}
567
+ olympe.dc.bk=class{constructor(a,b){this.C=Cf(a);this.N=olympe.dc.Kf().Ya();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ua=[]}mf(){return new olympe.dc.Ba(this.C,this.X,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Df('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.va.Property)throw new Df('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Df('transform',
568
+ 'one of the argument is not a Transformer '+d);const e=d.$b();null!==e&&(this.valueType=e);this.X.push(d)}return this}kl(a){this.X.push(new olympe.dc.X.uf(a));return this}yy(a){this.X.push(new olympe.dc.X.uf(Cf(a)));return this}Lt(a){this.valueType=a;return this}vb(a){this.X.push(a);this.valueType=a.$b()||olympe.dc.CloudObject;return this}dw(a){for(const b of a)this.X.push(b),this.valueType=b.$b()||olympe.dc.CloudObject;return this}Lk(a,b,c){a=new olympe.dc.X.Dc(a,a.Qa(),b,c);this.X.push(a);this.valueType=
569
+ a.$b()||olympe.dc.CloudObject;return this}aw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.T());void 0===c&&(c=e.Qa())}a=new olympe.dc.X.Be(b,c);this.X.push(a);this.valueType=a.$b()||olympe.dc.CloudObject;return this}Kt(){this.vb(olympe.dc.CloudObject.instancesRel);return this}Ve(a){var b=this.ua.pop();b===Af.El&&(a=new olympe.dc.V.md(a),b=this.ua.pop());switch(b){case Af.Lo:b=this.X.pop().C;b instanceof olympe.dc.V.Xd?(b=b.V,b.push(a),a=new olympe.dc.V.Xd(...b)):a=new olympe.dc.V.Xd(b,
570
+ a);b=this.ua.pop();break;case Af.Mo:b=this.X.pop().C,b instanceof olympe.dc.V.de?(b=b.V,b.push(a),a=new olympe.dc.V.de(...b)):a=new olympe.dc.V.de(b,a),b=this.ua.pop()}b===Af.El&&(a=new olympe.dc.V.md(a),this.ua.pop());this.X.push(new olympe.dc.X.uc(a));return this}Wv(a,b,c){return this.Ve(new olympe.dc.V.Ic(Bf(a,c),new olympe.dc.oa.bd(b)))}contains(a,b,c=!1,d){return this.Ve(new olympe.dc.V.Vc(Bf(a,d),new olympe.dc.oa.bd(b),c))}qh(a){if(!(a instanceof Array))throw new Df('instanceOf','Provided argument "models" must be an array.');
571
+ const b=[];for(let c=0;c<a.length;c++)b.push(Cf(a[c]));return this.Ve(new olympe.dc.V.kf(b))}Sk(a){return this.Ve(new olympe.dc.V.Ic(new olympe.dc.oa.sf,new olympe.dc.oa.bd(Cf(a))))}Xv(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Sk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Sk(a[b])}return this}hj(a,b){if(!(a instanceof Array))throw new Df('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
572
+ a.forEach(e=>{c.push(e);d.push(e.Qa())});return this.Ve(new olympe.dc.V.jf(c,d,b))}Rk(a,b,c){a=Bf(a,c);return this.Ve(new olympe.dc.V.ye(a,new olympe.dc.oa.bd(b)))}vj(a,b,c){a=Bf(a,c);return this.Ve(new olympe.dc.V.Fe(a,new olympe.dc.oa.bd(b)))}Bx(a,b,c,d){a=Bf(a,d);return this.Ve(new olympe.dc.V.zd(a,b,c))}filter(a){const b=new class extends olympe.dc.V.Mg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Ve(b)}not(){this.ua.push(Af.El);return this}and(){this.X[this.X.length-1]instanceof
573
+ olympe.dc.X.uc&&this.ua.push(Af.Lo);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.uc&&this.ua.push(Af.Mo);return this}Bn(a,b,c){a=Cf(a);let d=null;switch(olympe.dc.Pa().oc(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.T():d=new olympe.dc.Db.String(new olympe.dc.oa.qe(a,c));break;case olympe.dm.Number.P.T():d=new olympe.dc.Db.Number(new olympe.dc.oa.me(a,c));break;case olympe.dm.DateTime.P.T():d=new olympe.dc.Db.DateTime(new olympe.dc.oa.le(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Od(c,
574
+ b));return this}sort(a,b,c){const d=new class extends olympe.dc.Db.Mg{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Od(d,c));return this}Sv(){this.X.push(new olympe.dc.X.Gd);return this}limit(a,b){this.X.push(new olympe.dc.X.be(a,b));return this}};class Df extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
575
+ function Cf(a){return'string'===typeof a||a instanceof olympe.D.Xa?a:'function'===typeof a?olympe.dc.Ca.Wb(a):olympe.D.nb(a)?a.Dk===olympe.D.Xa?a:olympe.D.Ga([a],b=>olympe.D.Cb(olympe.dc.wa(b)),olympe.D.Xa):a.T()}m=olympe.dc.bk.prototype;m.mf.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.transform.K=olympe.D.J.L();m.kl.K=olympe.D.J.L();m.yy.K=olympe.D.J.L();m.Lt.K=olympe.D.J.L();m.vb.K=olympe.D.J.L();m.dw.K=olympe.D.J.L();m.Lk.K=olympe.D.J.L();m.aw.K=olympe.D.J.L();m.Kt.K=olympe.D.J.L();m.Ve.K=olympe.D.J.L();
576
+ m.Wv.K=olympe.D.J.L();m.contains.K=olympe.D.J.L();m.qh.K=olympe.D.J.L();m.Sk.K=olympe.D.J.L();m.Xv.K=olympe.D.J.L();m.hj.K=olympe.D.J.L();m.Rk.K=olympe.D.J.L();m.vj.K=olympe.D.J.L();m.Bx.K=olympe.D.J.L();m.filter.K=olympe.D.J.L();m.not.K=olympe.D.J.L();m.and.K=olympe.D.J.L();m.or.K=olympe.D.J.L();m.Bn.K=olympe.D.J.L();m.sort.K=olympe.D.J.L();m.Sv.K=olympe.D.J.L();m.limit.K=olympe.D.J.L();olympe.dc.query.Hp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.zc}F(a){this.C.push(olympe.dc.wa(a))}Z(){return this.id}getData(){return this.data}};function Ef(a){return olympe.D.nb(a)?'Node#'+a.Na.Z():String(a)}function Ff(a,b){return olympe.D.nb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
577
+ olympe.dc.query.uu=class{constructor(){this.uid=0;this.values=null}add(a){let b;b=olympe.D.nb(a)?'n'+a.Na.Z():'p'+ ++this.uid;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.bb=class{na(){}C(){}F(){}ia(){}toString(){}};function we(a,b,c){return c.run(()=>a.R.ib(b,c))}function xe(a,b,c){return c.run(()=>Gf(a.R,b,c))}
578
+ function ff(a,b,c){var d=olympe.dc.Ka.rb;const e=b.Z();let f=Hf(a.va,e),g=olympe.dc.Ka.rb;null===f&&(f=ef(b,a.G),a.L||(g=mf(f)));If(a.va,f,d,g);c&&Re(a.F,e,c);b=olympe.dc.ga.ja.xi;const h=olympe.dc.ga.ja.wi,k=l=>{if(null!==l){a.N.error(`graph subscription "${e}" failed to subscribe ${l}`);Jf(a.va,e,d);var n=a.F;Se(n,e,n.F);c(l,null)}};g===olympe.dc.Ka.rb?(a.N.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Y.process(d,f,k)):(b=M(new olympe.dc.ga(f.ph.L===olympe.dc.Hd.Ii?h:b,f,[g]),
579
+ k),a.N.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function gf(a,b){var c=olympe.dc.Ka.rb;const d=olympe.dc.Ka.rb;if(c===d){const e=Hf(a.va,b).ph.L,f=Kf(a.va,b);Jf(a.va,b,c)&&f!==d&&e===olympe.dc.Hd.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Vo,String(b),[f]),g=>{g&&a.N.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Jf(a.va,b,c)}
580
+ function hf(a,b,c){var d=olympe.dc.Ka.rb;b=ef(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Re(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Se(k,e,k.F);c(h,null)}};var g=mf(b);g===olympe.dc.Ka.rb?a.Y.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ja.wi,b,[g]),f),a.C.send(d))}}
581
+ function yf(a,b){var c=olympe.dc.Ka.rb;const d=b.Qd();var e=new olympe.dc.query.uu;let f;f=d;olympe.D.nb(f)&&(f=e.add(d));b=(b=b.Rl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Lf(a.va,g);null===e&&(a.N.debug('QueryMGR: new',a.L?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.L||e.td());a.Ta.process(c,e,h=>{h&&(Mf(a.va,g,c||olympe.dc.Ka.rb),a.N.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
582
+ function zf(a,b){var c=olympe.dc.Ka.rb;if(c===olympe.dc.Ka.rb){const d=Kf(a.va,b);a.N.debug('QueryMGR: [ID:',b,'] - Unregistered');Mf(a.va,b,c)&&d!==olympe.dc.Ka.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ja.Ru,String(b),[d]),e=>{e&&a.N.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Mf(a.va,b,c)}
583
+ function Nf(a){const b=olympe.dc.ga.ja.Wo,c=olympe.dc.ga.ja.yl,d=olympe.dc.ga.ja.Ap;a.C.C(olympe.dc.ga.ja.Hl,(e,f)=>{Of(a,f,e)});a.C.C(b,(e,f)=>{Pf(a,f,e)});a.C.C(c,(e,f)=>{a.ea.af(f,e)});a.C.C(d,(e,f)=>{Qf(a,f,e)});a.C.qa((e,f)=>{Rf(a,f,e)})}function Sf(a,b){a.N.log('Received subscribeToAll command');b=b?olympe.D.Ia().C(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ja.Rg,null,[olympe.dc.Ka.Xc]);b&&M(c,b);a.C.send(c)}
584
+ function Of(a,b,c=olympe.dc.Ka.rb){b.destination!==olympe.dc.Ka.rb?a.N.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.qa.process(c,b,d=>{d&&a.N.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
585
+ function Pf(a,b,c=olympe.dc.Ka.rb){const d=Tf(a.va,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ka.rb?a.N.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.ka.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
586
+ function Qf(a,b,c=olympe.dc.Ka.rb){const d=Uf(a.va,b.Z());1<d.length||d[0]!==olympe.dc.Ka.rb?a.N.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.Fa.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
587
+ function Rf(a,b,c){a.N.debug('Source event',b,'received for source',c);if(b===olympe.dc.tk.Yp){const d=(e,f)=>{f&&a.N.error(`Error after trying to resubscribe to ${e}: ${f}`)};Vf(a.va,c).forEach(e=>{Re(a.F,e.Z(),d.bind(a,e.Z()));a.N.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.xi,e,[c]),d.bind(a,e.Z()));a.C.send(e)});Wf(a.va,c).forEach(e=>{a.N.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ja.Pu,
588
+ e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.Au=class{constructor(a,b,c,d,e,f,g,h){this.N=a;this.L=b;this.C=c;this.ea=d;this.va=e;this.F=f;this.G=new olympe.D.Zb('Query Manager context');this.Ta=g[0];this.Y=g[1];this.qa=g[2];this.ka=g[3];this.Fa=g[4];this.R=h;Nf(this)}Ya(){return this.N}};olympe.dc.query.Relation=class extends olympe.dc.va.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.T())+', ';a+='"direction": '+JSON.stringify(this.Qa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static mc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a){return new olympe.dc.query.Relation(a.T(),a.Qa(),a instanceof olympe.dc.X.Dc)}Sc(){const a=
589
+ olympe.dc.Aa.DESTINATION,b=olympe.dc.Aa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.Subscription=class a extends olympe.D.Bj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Zb('context subscription '+b,e));this.id=b;this.Of=c;this.X=d||null;this.G=this.R.run(()=>olympe.D.ie(olympe.dc.query.Subscription.C.INIT));this.Ge=!1;this.ka=this.ee=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ia(d);else e+='|null';e=olympe.W.ob(e)}catch(f){e=olympe.W.fc()}return e}Z(){return this.id}Qd(){return this.Of}Bg(){return this.X}td(){const b=
590
+ olympe.dc.Pa(),c=olympe.D.Za(this.Qd());return c?b.Uf(c)?b.source(c)||olympe.dc.Ka.Xc:olympe.dc.Ka.rb:olympe.dc.Ka.Xc}th(){const b=this.G.Na.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Nq}uh(){if(this.G.Na.zb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.ee;this.ee=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);pb(this.G,olympe.D.ie(olympe.dc.query.Subscription.C.Nq))}Pf(){return olympe.D.Ga([this.G],()=>{},olympe.D.ra)}Y(){const b=
591
+ this.G.Na.Ib;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.uq}Je(b,c){this.Y()?b(this):(null===this.ka&&(this.ka=new Map),void 0===c&&(c=olympe.W.fc()),this.ka.set(c,olympe.D.Ia().C(b)));return c||''}nj(b){null!==this.ka&&b&&this.ka.delete(b)}Pc(){const b=olympe.dc.query.Subscription.C.uq;if(!this.G.Na.zb()&&olympe.D.Za(this.G)!==b&&(this.yf(),pb(this.G,b),null!==this.ka)){for(const c of this.ka.values())c(this);this.ka=null}}onDestroy(b){this.R.onDestroy(b)}release(){this.R.destroy()}Tb(b){if(!this.G.Na.zb()){for(let c=
592
+ 0,d=b.length;c<d;c++)this.Dm(b[c],c);if(this.Y())this.yf();else{this.Ge=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Pc()}}}Lc(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}cc(b,c){if(!this.G.Na.zb()&&(this.Fk(b,olympe.dc.CloudObject.get(c)),b=this.Y(),this.Ge&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
593
+ d)){b=!1;break}b&&this.Pc()}}lc(b){this.G.Na.zb()||(this.Cm(b),this.Qi(b,!this.Y()))}Ug(){return this.Y()?super.Ug():'Subscription is not ready!'}Vf(){const b=olympe.D.Za(this.Qd());return olympe.dc.query.Subscription.F(b,this.Bg())}static F(b,c){var d=new olympe.dc.hf(b,olympe.dc.Hd.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.X.Sb||g instanceof olympe.dc.X.Dc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.vb(k,k.recursive)});
594
+ else if(g instanceof olympe.dc.X.uf)d=a.F(olympe.D.Za(g.Qd()),g.Bg()),b.push(...d);else if(g instanceof olympe.dc.X.uc||g instanceof olympe.dc.X.Od){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.vb(n,n.recursive);te(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Nq:1,uq:2};olympe.dc.query.Subscription.prototype.Ug.K=olympe.D.J.C;function Lf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Mf(a,b,c){return Xf(a,a.F,b,c)}function Kf(a,b){for(const [c,d]of a.L)if(d.has(b))return c;return null}function Hf(a,b){return a.C.has(b)?a.C.get(b).F():null}function If(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.va.qt(b,a.Y,a),a.C.set(e,f));f.L(c);Yf(a,e,d)}function Jf(a,b,c){return Xf(a,a.C,b,c)}function Tf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
595
+ function Uf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Vf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Wf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function Zf(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
596
+ function Yf(a,b,c){let d=a.L.get(c);d?d.add(b):(d=(new Set).add(b),a.L.set(c,d))}function $f(a,b,c){var d=olympe.dc.Ka.rb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.va.cu(b,a.Y),a.F.set(e,f));f.L(c);Yf(a,e,d)}function Xf(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=Kf(a,c))&&a.L.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
597
+ function ag(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.va.Bu(b),a.G.set(c,d));d.counter++;return d}function bg(a,b){(a=a.G.get(b))&&a.update()}function cg(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?dg(d,c):eg(d,c):a.N.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}
598
+ olympe.dc.query.Wu=class{constructor(a,b){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.R=new Set;this.L=new Map;this.Y=b}};olympe.dc.Zc=class{na(){}$b(){}getTransform(){}ia(){}toString(){}};olympe.dc.pq=class{F(){}};olympe.dc.wf=class{na(){}getValue(){}C(){}ia(){}toString(){}};olympe.dc.query.O={Ea:'olympe.dc.query.Logger',xa:'olympe.dc.query.QueryManager'};olympe.dc.query.Nb={Se:'olympe.dc.query.SubscriptionRegistry',Gj:'olympe.dc.query.CallbackRegistry',Yo:'olympe.dc.query.GraphProcessor',Xo:'olympe.dc.query.GraphNotificationProcessor',Zo:'olympe.dc.query.GraphResultProcessor',Bp:'olympe.dc.query.ListProcessor',ak:'olympe.dc.query.ListNotificationProcessor',rq:'olympe.dc.query.QueryProcessor',ul:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Oq:'subscription.debug'};
599
+ olympe.U.config(function(a){E(a,olympe.dc.query.Config.Oq,!1);C(a,olympe.dc.query.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc.query'));B(a,olympe.dc.query.Nb.Se,olympe.dc.query.Wu,olympe.dc.query.O.Ea,new olympe.U.fa(olympe.dc.query.Config.Oq));B(a,olympe.dc.query.Nb.Gj,olympe.dc.query.Ns,olympe.dc.query.O.Ea);B(a,olympe.dc.query.Nb.Bp,olympe.dc.query.Xb.Jp,olympe.dc.query.O.Ea,olympe.dc.O.si,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.ul,olympe.dc.transaction.O.xa,new olympe.U.fa(olympe.dc.Config.Yg));B(a,olympe.dc.query.Nb.Yo,
600
+ olympe.dc.query.Xb.ep,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,new olympe.U.fa(olympe.dc.Config.Yg));B(a,olympe.dc.query.Nb.Zo,olympe.dc.query.Xb.fp,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.Gj);B(a,olympe.dc.query.Nb.Xo,olympe.dc.query.Xb.cp,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se);B(a,olympe.dc.query.Nb.ak,olympe.dc.query.Xb.Ip,olympe.dc.query.O.Ea,olympe.dc.O.si,olympe.dc.query.Nb.Se);B(a,olympe.dc.query.Nb.rq,olympe.dc.query.Xb.Cu,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,
601
+ olympe.dc.query.Nb.ul,olympe.dc.query.Nb.Gj,olympe.dc.O.oe,olympe.dc.db.O.xa);B(a,olympe.dc.query.Nb.ul,olympe.dc.query.Xb.Qs,olympe.dc.query.O.Ea,olympe.dc.query.Nb.Se,olympe.dc.transaction.O.xa);C(a,olympe.dc.query.O.xa,[olympe.dc.query.O.Ea,new olympe.U.fa(olympe.dc.Config.Yg),olympe.dc.O.oe,olympe.dc.db.O.xa,olympe.dc.query.Nb.Se,olympe.dc.query.Nb.Gj,olympe.dc.query.Nb.Bp,olympe.dc.query.Nb.Yo,olympe.dc.query.Nb.Zo,olympe.dc.query.Nb.Xo,olympe.dc.query.Nb.ak,olympe.dc.query.Nb.rq],(b,c,d,e,f,
602
+ g,h,k,l,n,p,q)=>new olympe.dc.query.Au(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.U.run([olympe.dc.query.Nb.Se],a=>{olympe.dj().subscriptions=a});olympe.dc.query.va={};function fg(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
603
+ olympe.dc.query.va.Xq=class{constructor(a,b){this.C=new Map;this.G=new Map;this.R=a;this.ka=b}F(){}L(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function dg(a,b){const c=b.Z();a.Y.set(c,b);olympe.D.Ia().onDestroy(()=>{a.Y.delete(c)})}function eg(a,b){const c=b.Z();a.ea.set(c,b);olympe.D.Ia().onDestroy(()=>{a.ea.delete(c)})}olympe.dc.query.va.qt=class extends olympe.dc.query.va.Xq{constructor(a,b,c){super(a,b);this.va=c;this.Y=new Map;this.ea=new Map;b&&fg()}F(){return this.R}};olympe.dc.query.va.cu=class extends olympe.dc.query.va.Xq{constructor(a,b){super(a,b);this.Y=new Map}F(){return this.R}L(a){super.L(a);if(this.ka){const b='md_'+olympe.W.fc();this.Y.set(b,fg());olympe.D.Ia().onDestroy(()=>{this.Y.delete(b)})}}};olympe.dc.query.va.Bu=class{constructor(a){this.query=a;this.F=olympe.dc.Dd();this.id=a.Z();this.C=olympe.D.Nc(olympe.dc.Wa);this.G=null;this.counter=0}update(){const a=olympe.D.Za(this.C)||olympe.dc.Wa.empty(),b=olympe.dc.Wa.from(a,this.G);b!==a&&(Pc(this.F,null,Be(b)),this.C.update(b))}destroy(){const a=olympe.D.Za(this.C)||olympe.dc.Wa.empty();Pc(this.F,null,Ae(a))}};olympe.dc.query.Xb={};function gg(a,b,c,d,e){a.N.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.ng(olympe.D.Ia()),g=k=>{f.add((l,n)=>{k.ib(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Z()} has encountered an error: ${p}`):l()});cg(a.va,k.Z(),c)})},h=Array.from(Vf(a.va,olympe.dc.Ka.Xc));b.forEach(k=>{const l=ef(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Er(l)){g(r.ph,!1);
604
+ n=!0;break}}n?a.N.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});Xb(f,(k,l)=>e(l));f.start()}function hg(a,b,c){const d=[b.Qd()],e=g=>g instanceof olympe.dc.X.uf,f=(b.Bg()||[]).filter(e);for(const g of f)d.push(g.Qd()),f.push(...(g.Bg()||[]).filter(e));me(a.C,()=>{olympe.D.yc(d,()=>{const g=b.Vf();gg(a,g,b,b.Z(),c)})})}function ig(a,b,c,d){const e=b.Z(),f=[se(b,c)];me(a.C,()=>gg(a,f,b,e,d))}olympe.dc.query.Xb.Qs=class{constructor(a,b,c){this.N=a;this.va=b;this.C=c}};olympe.dc.query.Xb.cp=class{constructor(a,b){this.N=a;this.va=b}process(a,b,c){const d=b.Z();this.va.C.has(d)?(Hf(this.va,d).qa(b),olympe.dc.Dd().af(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Xb.cp.ma=[olympe.dc.og];olympe.dc.query.Xb.ep=class{constructor(a,b,c){this.N=a;this.va=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ka.rb||this.va.C.has(d)){if(c(null,b),a=Hf(this.va,d),this.C||a&&a.L)a=olympe.dc.Ka.rb,d=new olympe.dc.query.zi(d,a,a,new olympe.dc.db.zc),Of(olympe.dc.Kf(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Xb.ep.ma=[olympe.dc.og];olympe.dc.query.Xb.fp=class{constructor(a,b,c){this.N=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=Hf(this.C,d);if(b instanceof olympe.dc.query.Xi.Uj)Jf(this.C,d,a);else if(!f.L){f.ka(b);const g=olympe.dc.Dd();Pc(g,f.Y());g.af(b.Gc,b.destination);f.onDestroy(()=>{Pc(g,null,f.Y())});of(f)}}let e;b instanceof olympe.dc.query.Xi.Uj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.ea()}`,this.N.error(e));Ue(this.F,b.Z(),b);c(e?Error(e):null,b)}};
605
+ olympe.dc.query.Xb.fp.ma=[olympe.dc.og];const jg=[],kg=new Map;function lg(a,b,c,d){uc(a.db,d,e=>{e?b.Dg(c)?a.N.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.cc(c,d):mg(a,b,c,d)},c)}function mg(a,b,c,d){vc(a.db,d,c,!0);b.lc(c);jg.length=0;b.Lc(function(e,f){jg[e]=f});c=a=0;for(d=jg.length;a<d;a++)'string'===typeof jg[a]&&(jg[c++]=jg[a]);jg.length=c;b.Tb(jg)}
606
+ olympe.dc.query.Xb.Ip=class{constructor(a,b,c){this.N=a;this.db=b;this.va=c}process(a,b,c){const d=b.Z();a=b.C;const e=Lf(this.va,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{jg.length=a.length;e.Lc((f,g)=>{if(f=e.lh(g)){f=f.T();var h=kg.get(f);void 0===h?kg.set(f,g):'string'===typeof h?kg.set(f,[h,g]):h.push(g)}else this.N.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
607
+ for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=kg.get(h);void 0===k?(k=olympe.W.fc(),lg(this,e,k,h)):'string'===typeof k?kg.delete(h):(k=k.pop(),0===k.length&&kg.delete(h));jg[f]=k}for(const [f,g]of kg){if('string'===typeof g)mg(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)mg(this,e,g[h],f);kg.delete(f)}e.Tb(jg);c(null,b)}}};olympe.dc.query.Xb.Ip.ma=[olympe.dc.og];function ng(a,b,c,d){const e=c.Z();a.N.debug('ListProcessor: [ID:',e,'] - processing with source ',b);$f(a.va,c,b);if(Zf(a.va,e,olympe.dc.Ka.rb))a.N.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.N.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.td();a.F||f===olympe.dc.Ka.rb?(a.N.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),og(a,c)):c.Gh().run(()=>{hg(a.C,c,g=>{g?a.N.error(g):og(a,c)})})}b===olympe.dc.Ka.rb||
608
+ Zf(a.va,e,b)||a.notify(b,c);d(null,c)}
609
+ function og(a,b){if(b.Y())a.N.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.pc.Wq(a.db,a.N),d=pg(a,b,c),e=b.Z();b.Gh().run(()=>{olympe.D.yc([b.Qd()],f=>{const g=olympe.dc.wa(f);a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.th()||b.uh();uc(a.db,g,h=>d(h,g),e);olympe.D.Ia().xc(()=>vc(a.db,g,e));a.db.Gb(g.valueOf())||qg(c);b.Y()||(qg(c),b.Tb([]))})})}}
610
+ function pg(a,b,c){const d=new olympe.dc.pc.Ej;let e=!1;const f=b.Gh(),g=b.Bg(),h=[];h[g?g.length:0]=f.C((k,l,n,p)=>{f.R()||f.zb()||(k?b.Dg(n)?a.N.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.cc(n,l)):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.lc(n)),e||(rg(c,()=>{p.sg();qg(c)}),p.Tc().Jg(b.Tb.bind(b)),e=!0),
611
+ sg(c,n))});if(null!==g){const k=olympe.dc.Tc();for(let l=g.length-1;0<=l;l--)h[l]=f.C(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Z();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,tg(p,k,l,n))}}
612
+ olympe.dc.query.Xb.Jp=class{constructor(a,b,c,d,e,f){this.N=a;this.db=b;this.va=c;this.C=d;this.F=f}process(a,b,c){ng(this,a,b,c)}notify(a,b){const c=b.Z();this.N.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Hp(c);b.fe(g=>f.F(g));Qf(olympe.dc.Kf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Je(()=>{e=!0;d()})}};olympe.dc.query.Xb.Jp.ma=[olympe.dc.og];function Gf(a,b,c){const d=b.Z(),e=b.source,f=a.va.G.has(d),g=ag(a.va,b);return new rxjs.Observable(h=>{c.run(()=>{olympe.D.yc([g.C.Eb()],h.next.bind(h))});const k=()=>{l&&c.Lc(l);{var n=a.va;const q=n.G.get(d);var p;if(p=q)p=q,0<p.counter?p.counter--:olympe.sa.Ya('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),p=0===p.counter;p&&(q.destroy(),n.G.delete(d),n.R.delete(d))}},l=c.xc(k);if(e===olympe.dc.Ka.Xc)ig(a.L,b,!0,n=>{n?(h.error(n),k()):ug(a,d,b,g,c)});else if(e===
613
+ olympe.dc.Ka.rb)ug(a,d,b,g,c);else if(!f){const n=M(xc(new olympe.dc.ga(olympe.dc.ga.ja.om,b,[e]),c),p=>{p&&(h.error(p.message),k())});a.G.send(n)}return k})}
614
+ function vg(a){const b=olympe.dc.ga.ja.nm,c=(d,e)=>De(d,f=>{Pc(a.F,Array.from(f.ge()).filter(g=>g.te()).map(g=>g.tag()));a.F.af(f,e)},e);a.G.C(olympe.dc.ga.ja.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,Te(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,Te(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g))if(e=
615
+ a.va.G.get(e))f=olympe.D.Za(e.C),f&&f.hash===d.hash||(Pc(e.F,null,Be(d)),e.C.update(d))});Oc(a.F,()=>{var d=a.va;for(const e of d.R)bg(d,e);d.R.clear()})}
616
+ function ug(a,b,c,d,e){const f=new olympe.dc.ba.nq(c);He(f,()=>{var p=a.va;p.G.has(b)&&p.R.add(b)});d.G=f;let g=(p,q)=>{p?a.N.debug(`New result tuple for query ${b}, ${q}`):a.N.debug(`Removed result tuple for query ${b}, ${q}`)};d=c.C;const h=d.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]);for(let p=d.length-1;0<=p;p--)g=d[p].observe(f,h[p],g);const k=a.F.view,l=c.G,n=uc(k,l,(p,q)=>{p?f.insert(q,0,null):f.remove(q,0,null);g(p,q,null,b)});e.xc(()=>vc(k,l,n));bg(a.va,b)}
617
+ olympe.dc.query.Xb.Cu=class{constructor(a,b,c,d,e,f){this.N=a;this.va=b;this.L=c;this.C=d;this.G=e;this.F=f;vg(this)}ib(a,b){return new Promise((c,d)=>{var e=a.source;if(e===olympe.dc.Ka.Xc)ig(this.L,a,!1,f=>{f?d(f):c(this.ud(a))});else if(e===olympe.dc.Ka.rb)c(this.ud(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;Se(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.xc(h);Ve(this.C,f,(l,n)=>{b.Lc(k);l?d(l.message):(b.xc(()=>{Pc(this.F,null,Ae(n))}),c(n))});g||
618
+ (e=M(xc(new olympe.dc.ga(olympe.dc.ga.ja.mm,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}ud(a){const b=new olympe.dc.ba.nq(a);He(b,()=>{});b.insert(a.G,0,null);let c=0;for(const d of a.C)d.ib(b,c),c=d.F(c);return olympe.dc.Wa.from(olympe.dc.Wa.empty(),b)}};olympe.dc.query.Xi={};olympe.dc.query.Xi.Uj=class extends olympe.dc.query.zi{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.zc);this.error=d}ea(){return this.error}};olympe.dc.pc={};function tg(a,b,c,d){b?a.R[d]=c:delete a.R[d];null===a.F&&(a.F=new olympe.dc.pc.Lj(a.C,a));return a.F}function wg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function xg(a,b){a=a.R;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.pc.Lj=class{constructor(a,b){this.C=a;this.parent=b||null;this.ea=b?b.ea+1:0;this.R=Object.create(null);this.F=null}Tc(){return this.C}sg(){this.C.R()?this.C.G():this.C.ea(this.ea-1)}};olympe.dc.pc.ta=class{constructor(){}C(){}R(){}ea(){}G(){}Jg(){}};olympe.dc.pc.Ej=class{constructor(){this.Y=this.L=this.index=this.F=null}R(){return null!==this.F}ea(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.pc.Lj(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Y){const a=
619
+ [];null!==this.L&&(0<=this.F?xg(wg(this.L,this.F),a):a.push(this.index));this.Y(a)}}Jg(a){this.Y=a}};olympe.dc.pc.Ej.ma=[olympe.dc.pc.ta];function yg(a,b){olympe.D.Tf(a.value)?(a.node=olympe.D.dl(a.value,b),Wa(a.node)||b()):b()}function zg(a,b){if(olympe.D.Tf(a.value)){const c=olympe.D.Ia(),d=a.L;olympe.D.yc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>yg(a,b)),olympe.D.Ia().destroy())})}}
620
+ class Ag extends olympe.dc.pc.Lj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.Za();this.position=this.node=null;this.Y=!1;this.G=null}Za(){const a=olympe.D.Za(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}zb(){return null===this.value}}
621
+ function Bg(a,b){if(!b.zb()){var c=a.F;const d=a.Fa,e=b.Za();let f=0,g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.Za();c!==b.position&&(a.insert(b,c),b.Y&&a.G())}}function Cg(a){const b=a.Fa;a.F.sort((c,d)=>b(c.Za(),d.Za()))}
622
+ olympe.dc.pc.Vq=class{constructor(a){this.Fa=a;this.L=null;this.F=[];this.Y=[];this.ka=null;this.qa=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Ag(this,c,d),this.qa.set(b,f),this.R()?yg(f,()=>Bg(this,f)):(f.position=e.length,e.push(f));else{f=this.qa.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.qa.delete(b);null!==f.position&&(this.R()?this.remove(f):delete e[f.position]);f.destroy()}return f}R(){return null!==this.L}ea(a){if(null!==this.L)throw Error('Manager already activated (depth='+
623
+ this.L+')');this.L=a;Cg(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;zg(d,()=>Bg(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Y.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Y){var b=e,c=this.L;b.Y=!0;b.G=wg(b,c)}0>this.L?this.Y.push(e.index):e.G&&xg(e.G,this.Y)}this.ka&&this.ka(this.Y)}Jg(a){this.ka=a}insert(a,b){const c=this.F;var d=c.length;let e=a.position;null===
624
+ e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.pc.Vq.ma=[olympe.dc.pc.ta];class Dg extends olympe.dc.pc.Lj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ka=this.Y=this.L=!1;this.G=null}}
625
+ function Eg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.L;let k,l,n;a.qa=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.Y&&(c.G=null,delete h[k]),delete f[k]);a.qa=!1;null!==a.F&&a.G()}
626
+ olympe.dc.pc.Xl=class{constructor(){this.L={};this.order=[];this.F=null;this.qa=!1;this.Y=[];this.ka=null}R(){return null!==this.F}ea(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.qa){var a=this.order,b=a.length,c=this.L,d;for(d=this.Y.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.Y.push(e.index);else{if(!e.ka){var f=e,g=this.F;f.ka=!0;
627
+ f.G=wg(f,g)}null!==e.G&&xg(e.G,this.Y)}}this.ka&&this.ka(this.Y)}}Jg(a){this.ka=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new Dg(this,c,b),this.L[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.pc.Xl.ma=[olympe.dc.pc.ta];function qg(a){if(!a.F){for(let b in a.G)Fg(a.G[b]);a.F=!0}a.L=null;a.R=null}function rg(a,b,c){a.G[c||'root'].L=b}function sg(a,b,c){a.G[c||'root'].sg(b)}function Gg(a,b,c,d){const e=a.R,f=b+d+c;let g=e[f];void 0===g&&(g=Dd(a.db,b,c,d),e[f]=g);return g}function Hg(a,b){a.F||a.C.sg(b)}function Ig(a,b,c,d,e){if(!a.F){let f=Gg(a,c,d,e||olympe.dc.Aa.DESTINATION);e||(f+=Gg(a,c,d,olympe.dc.Aa.ORIGIN));0===f&&Hg(a,b)}}
628
+ function Jg(a,b){const c=a.G[b];void 0!==c?(a.N&&a.N.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Z():''),a.C=c):a.N&&a.N.error('Try to set a block that does not exists:',b)}function Kg(a){const b=String(++a.Y),c=a.C;a.G[b]=new Lg(b,c);Mg(c,b);c.F||(c.F=()=>Jg(a,c.Z()));return b}function Ng(a,b){const c=a.C;a.C.F=()=>{Jg(a,c.Z());b()}}function Og(a,b){Fg(b?a.G[b]:a.C)}
629
+ olympe.dc.pc.Wq=class{constructor(a,b){this.db=a;this.N=b||null;this.L=Object.create(null);this.R=Object.create(null);this.F=!1;this.Y=0;this.C=new Lg('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=Gg(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Mg(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Fg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
630
+ class Lg{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.L=this.F=this.children=null;this.G=!1}Z(){return this.id}sg(a){const b=this.L;if(this.G||this.C===a||null===a)b&&b(),!b&&Fg(this)}notify(a){const b=this.F,c=this.children;if(this.G)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.oa={};olympe.dc.oa.sf=class{na(){return O(olympe.dc.oa.sf)}C(){return[]}getValue(a,b){return b}ia(){return'{"c":"'+this.na()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.oa.sf);olympe.dc.oa.sf.ma=[olympe.dc.wf];olympe.dc.oa.bd=class{constructor(a){this.value=a}na(){return O(olympe.dc.oa.bd)}C(){return[]}getValue(){return this.value}ia(a){a=Ff(a,this.value);return`{"c":"${this.na()}","a":[${a}]}`}toString(){return`Constant(${Ef(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.oa.bd);olympe.dc.oa.bd.ma=[olympe.dc.wf];function Pg(a,b,c,d){const e=olympe.dc.Pa(),f=new olympe.dc.pc.Ej,g=new olympe.dc.pc.Wq(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,u,v)=>{const w=olympe.D.Ia();w.R()||w.zb()||(h||(rg(g,()=>{v.sg();qg(g)}),v.Tc().Jg(l),h=!0),r?k[u]=t:delete k[u],sg(g,u))};const p=olympe.D.Ia();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.C(n));n=p.C(n);const q=olympe.W.fc();uc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,null);
631
+ n(r,t,q,tg(u,r,b,q))},q);p.onDestroy(()=>{vc(e,b,q)});e.Gb(b)||qg(g)}function Qg(a,b,c){const d=c.node,e=olympe.dc.Pa(),f=a.G(),g=xd(e,b,a.$e,d.C(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.$e,g))}
632
+ olympe.dc.oa.Oc=class{constructor(a,b,c){this.$e=a&&a.T?a.T():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Sb||d instanceof olympe.dc.X.Dc)||null;this.F=c||null;this.defaultValue=null}na(){}$b(){}G(){}C(){return(this.X||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}bf(a){this.defaultValue=a;return this}Bg(){return this.X}Qd(){return this.F}getValue(a,b){const c=olympe.D.Nc(this.$b()||Object,'AbstractProperty valueType');null!==this.defaultValue&&qb(c,this.defaultValue);b=this.F||
633
+ b;null!==this.X?Pg(a,b,this.X,d=>{Qg(this,d,c)}):Qg(this,b,c);return c.Eb()}ia(a){const b=Ff(a,this.$e),c=Ff(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ia(a)}).join(','));return`{"c":"${this.na()}","a":["${b}",${d},${c}]}`}toString(){const a=Ef(this.$e),b=this.F?','+Ef(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.na().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.oa.Oc.ma=[olympe.dc.wf];olympe.dc.oa.me=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.me)}G(){return olympe.dc.W.Vb.Mm}$b(){return olympe.D.da}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.oa.me);olympe.dc.oa.qe=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.qe)}G(){return olympe.dc.W.Vb.Nm}$b(){return olympe.D.Xa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.oa.qe);olympe.dc.oa.ve=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.ve)}G(){return olympe.dc.W.Vb.Km}$b(){return olympe.D.ra}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.oa.ve);olympe.dc.oa.le=class extends olympe.dc.oa.Oc{constructor(a,b,c){super(a,b,c)}na(){return O(olympe.dc.oa.le)}G(){return olympe.dc.W.Vb.Lm}$b(){return olympe.D.kb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.oa.le);olympe.dc.oa.On=class{constructor(a,b){if(olympe.D.Tf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.T();var d=olympe.dc.Pa();const e=d.oc(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Mf(e,olympe.dc.CloudObject.extendRel,olympe.dm.qf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.T():d=new olympe.dc.oa.qe(c,b);break;case olympe.dm.Number.P.T():d=new olympe.dc.oa.me(c,
634
+ b);break;case olympe.dm.Boolean.P.T():d=new olympe.dc.oa.ve(c,b);break;case olympe.dm.DateTime.P.T():d=new olympe.dc.oa.le(c,b)}this.F=d}na(){return this.F.na()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ia(a){return this.F.ia(a)}toString(){return this.F.toString()}};olympe.dc.oa.On.ma=[olympe.dc.wf];olympe.dc.Db={};olympe.dc.Db.Number=class{constructor(a){this.C=a}na(){return O(olympe.dc.Db.Number)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.na()}",a:[${this.C.ia(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Db.Number);olympe.dc.Db.Number.ma=[olympe.dc.Ne];olympe.dc.Db.String=class{constructor(a){this.C=a}na(){return O(olympe.dc.Db.String)}R(){return this.C.C()}L(a,b){return olympe.D.Ga([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Xa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.na()}",a:[${this.C.ia(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Db.String);olympe.dc.Db.String.ma=[olympe.dc.Ne];olympe.dc.Db.DateTime=class{constructor(a){this.C=a}na(){return O(olympe.dc.Db.DateTime)}R(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ia(a){return'{"c":"'+this.na()+'",a:['+this.C.ia(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Db.DateTime);olympe.dc.Db.DateTime.ma=[olympe.dc.Ne];let Rg=0;olympe.dc.Db.Mg=class{constructor(){this.id=Rg++}na(){return'CustomLocalComparator#'+Rg}R(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ia(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.Db.Mg.ma=[olympe.dc.Ne];olympe.dc.V={};olympe.dc.V.md=class{constructor(a){this.G=a}na(){return O(olympe.dc.V.md)}F(){return this.G.F()}C(a,b){return olympe.D.dl(this.G.C(a,b),c=>!c.valueOf())}ia(a){return`{"c":"${this.na()}","a":[${this.G.ia(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.md);olympe.dc.V.md.ma=[olympe.dc.bb];olympe.dc.V.Xd=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}na(){return O(olympe.dc.V.Xd)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}ia(a){const b=this.V.map(c=>c.ia(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'And('+
635
+ this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Xd);olympe.dc.V.Xd.ma=[olympe.dc.bb];olympe.dc.V.de=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}na(){return O(olympe.dc.V.de)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.cf(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}ia(a){const b=this.V.map(c=>c.ia(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
636
+ this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.de);olympe.dc.V.de.ma=[olympe.dc.bb];olympe.dc.V.ml=class{constructor(a,b){this.G=a;this.L=b}na(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Ga([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.R('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}R(){}ia(a){return'{"c":"'+this.na()+'","a":['+this.G.ia(a)+','+this.L.ia(a)+']}'}toString(){return this.na().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};olympe.dc.V.ml.ma=[olympe.dc.bb];olympe.dc.V.Ic=class{constructor(a,b){this.G=a;this.L=b}na(){return O(olympe.dc.V.Ic)}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Ga([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Vd?c.Vd(d):'object'===typeof d&&void 0!==d.Vd?d.Vd(c):olympe.D.Bc(c.valueOf()===d.valueOf()),olympe.D.ra,'Test equal predicate')}ia(a){return'{"c":"'+this.na()+'","a":['+this.G.ia(a)+','+this.L.ia(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
637
+ ')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Ic);olympe.dc.V.Ic.ma=[olympe.dc.bb];olympe.dc.V.ct=class extends olympe.dc.V.Ic{constructor(a,b){super(a,new olympe.dc.oa.bd(b))}};olympe.dc.V.ct.ma=[olympe.dc.bb];olympe.dc.V.ye=class extends olympe.dc.V.ml{constructor(a,b){super(a,b)}na(){return O(olympe.dc.V.ye)}R(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ye);olympe.dc.V.Fe=class extends olympe.dc.V.ml{constructor(a,b){super(a,b)}na(){return O(olympe.dc.V.Fe)}R(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Fe);olympe.dc.V.Vc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}na(){return O(olympe.dc.V.Vc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Ga([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Bc(c.includes(d))},olympe.D.ra)}ia(a){const b=this.source.ia(a),c=this.value.ia(a);a=Ff(a,this.G);return'{"c":"'+this.na()+'","a":['+
638
+ b+','+c+','+a+']}'}toString(){const a=Ef(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Vc);olympe.dc.V.Vc.ma=[olympe.dc.bb];olympe.dc.V.zd=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}na(){return O(olympe.dc.V.zd)}F(){return[this.source.C()]}C(a,b){return olympe.D.cf([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ia(a){const b=this.source.ia(a),c=Ff(a,this.L);a=Ff(a,this.G);return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Ef(this.G);return'Regex('+this.source.toString()+
639
+ ','+this.L+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.zd);olympe.dc.V.zd.ma=[olympe.dc.bb];olympe.dc.V.kf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.wa(b))}):this.G.add(olympe.dc.wa(a))}na(){return O(olympe.dc.V.kf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Pa();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.wa(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
640
+ (K(c,!0),f()):(h=new Sg(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Sg(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Wa(c)||K(c,!1);return c}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Sg{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.xg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.kf);olympe.dc.V.kf.ma=[olympe.dc.bb];function Tg(a){return a.Ma.map(b=>b.T())}function Ug(a){return a.Ma.map(b=>b.Qa())}
641
+ olympe.dc.V.jf=class{constructor(a,b,c){this.Ma=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.wa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ma.push(new Vg(c.T(),c.Qa(),c.F,c.C)):this.Ma.push(new Vg(olympe.dc.wa(c),b[d],1,1))}na(){return O(olympe.dc.V.jf)}F(){return[this.Ma.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.fc(),e=olympe.dc.Pa();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
642
+ c.zb()||(f+=h?1:-1,K(c,0<f))};const g=this.Ma;for(let h=g.length-1;0<=h;h--)a=Wg(g[h],e,a,d+h);uc(e,b,a,d);olympe.D.Ia().onDestroy(()=>{vc(e,b,d)});c.bf(!1);return c}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.Ma.map(a=>a.ia()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.Ma.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.jf);
643
+ function Wg(a,b,c,d){const e=Object.create(null);d+=olympe.W.xg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class Vg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ia(){return`${this.T()}, ${this.Qa()}, ${this.F}, ${this.C}`}}olympe.dc.V.jf.ma=[olympe.dc.bb];olympe.dc.V.sl=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.cf([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}na(){return O(olympe.dc.V.sl)}F(){return[this.value.C()]}ia(a){const b=olympe.D.nb(this.G)?this.G.Na.Ib.valueOf():this.G.valueOf();return'{"c":"'+this.na()+'","a":['+b+','+this.value.ia(a)+']}'}toString(){const a=olympe.D.nb(this.G)?this.G.Na.Ib.valueOf():this.G.valueOf();return this.na().replace(/^.+\./,'')+
644
+ '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.sl);olympe.dc.V.sl.ma=[olympe.dc.bb];let Xg=0;olympe.dc.V.Mg=class{constructor(){this.id=Xg++}na(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ia(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.V.Mg.ma=[olympe.dc.bb];olympe.dc.V.Ll=class{constructor(a,b,c){this.Ma=[];this.G=void 0!==c?c.map(olympe.dc.wa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Dc?this.Ma.push(new Yg(c.T(),c.Qa(),c.F,c.C)):this.Ma.push(new Yg(olympe.dc.wa(c),b[d],1,1))}na(){return O(olympe.dc.V.Ll)}F(){return[this.Ma.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Pa(),e=olympe.W.xg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.Ma;
645
+ for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;uc(d,b,a.bind(null,h=>{c.R()||c.zb()||(g+=h,K(c,0<g))}),e);olympe.D.Ia().onDestroy(()=>vc(d,b,e));c.bf(!1);return c}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.Ma.map(a=>a.ia()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.Ma.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Ll);
646
+ class Yg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.L=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.L,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.W.xg();if(p){const t=n+q,u=v=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
647
+ null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}ia(){return`${this.T()}, ${this.Qa()}, ${this.F}, ${this.C}`}}olympe.dc.V.Ll.ma=[olympe.dc.bb];olympe.dc.X={};olympe.dc.X.nk={ht:1,ut:-1,rp:0};olympe.dc.X.bB={Fy:!0,bz:!1};olympe.dc.X.Sb=class extends olympe.dc.va.Relation{constructor(a,b){super(a,b||olympe.dc.Aa.DESTINATION)}$b(){return Ic(this)}na(){return O(olympe.dc.X.Sb)}Sc(){return new olympe.dc.X.Sb(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Pa(),e=this.T(),f=this.Qa();return(g,h,k,l)=>{Ig(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.ob(k+f+e+p,20),r=tg(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}ia(){return'{"c":"'+
648
+ this.na()+'","a":["'+this.T()+'","'+this.Qa()+'"]}'}toString(){return'Related('+this.Qa()+this.T()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Sb);olympe.dc.X.Sb.ma=[olympe.dc.Zc];olympe.dc.X.Dc=class extends olympe.dc.va.Relation{constructor(a,b=olympe.dc.Aa.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}$b(){return Ic(this)}na(){return O(olympe.dc.X.Dc)}getTransform(a,b,c){const d=olympe.dc.Pa(),e=Object.create(null),f=olympe.dc.Aa.ORIGIN,g=olympe.dc.Aa.DESTINATION,h=this.T(),k=this.Qa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.tb(r,this);p+=1;for(let u=0,v=t.length;u<v;u++){if(void 0!==e[t[u]]||r===t[u])continue;const w=olympe.W.ob(q+k+(h+'_'+p)+t[u],20);b.register(w,
649
+ q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,tg(r,u,v,t)):Ig(b,t,v,h,k);0<=this.C&&p>=this.C||(u?e[v]||(e[v]=!0,V(d,v,this,(w,y)=>{const A=p+1,D=olympe.W.ob(t+k+(h+'_'+A)+y,20);n(A,v,r,D,w,y)},t)):(d.C(v,this,t),delete e[v]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ia(){return'{"c":"'+this.na()+'","a":["'+this.T()+'","'+this.Qa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Qa()+this.T()+'['+this.F+'..'+this.C+'])'}};
650
+ N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Dc);olympe.dc.X.Dc.ma=[olympe.dc.Zc];function Zg(a){return a.Ma.map(b=>b.T())}
651
+ olympe.dc.X.Be=class{constructor(a,b){this.direction=b||olympe.dc.Aa.DESTINATION;this.Ma=a.map(c=>new olympe.dc.va.Relation(c,this.direction))}$b(){return olympe.dc.CloudObject}na(){return O(olympe.dc.X.Be)}Qa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Pa(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Qa();var q=k.T();p=olympe.W.ob(g+p+q+n,20);q=tg(h,l,n,p);l&&b.register(p,g,f,k.T(),k.Qa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.Ma.forEach(l=>{Ig(b,h,g,l.T(),l.Qa());e(g,h,k,l)}):this.Ma.forEach(l=>
652
+ {d.C(g,l,h)})}}ia(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(Zg(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Qa()+'['+Zg(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Be);olympe.dc.X.Be.ma=[olympe.dc.Zc];olympe.dc.X.Fl=class{constructor(a,b,c,d){this.C=new olympe.dc.va.Relation(olympe.dc.wa(a),c||olympe.dc.Aa.DESTINATION);this.F=new olympe.dc.va.Relation(olympe.dc.wa(b),d||olympe.dc.Aa.DESTINATION)}$b(){return Ic(this.C)}na(){return O(olympe.dc.X.Fl)}getTransform(a,b,c){const d=olympe.dc.Pa(),e={},f=this.C.T(),g=this.C.Qa(),h=this.F.T(),k=this.F.Qa();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const A=olympe.W.ob(u+g+(f+'_'+r)+y,20),D=tg(t,!0,y,A);l=r;n=()=>{c(!1,y,A,tg(t,!1,y,A))};
653
+ b.register(A,u,v,f,g);c(!0,y,A,D)},w.Vr=r,e[v]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[v]=!0;w=Infinity;let A=null;for(let D=Object.keys(e),T=D.length,I=0;I<T;I++){let aa=e[D[I]];aa.Vr<w&&(w=aa.Vr,A=aa)}A&&A()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Ig(b,u,w,f,g),Ig(b,u,w,h,k),V(d,w,this.C,p.bind(this,r,t,u,w),u+'_val'),V(d,w,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.C(w,this.F,u+'_follow'),d.C(w,this.C,u+'_val'),delete e[w])};return(r,t,u,v)=>q(0,v,u,r,t)}ia(){return'{"c":"'+this.na()+'","a":["'+
654
+ this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.X.Fl);olympe.dc.X.Fl.ma=[olympe.dc.Zc];olympe.dc.X.Gd=class{$b(){return null}na(){return O(olympe.dc.X.Gd)}getTransform(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,tg(h,!0,f,f))):(d[f]++,Hg(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,tg(h,!1,f,f)))}}ia(){return'{"c":"'+this.na()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.Gd);olympe.dc.X.Gd.ma=[olympe.dc.Zc];olympe.dc.X.Od=class{constructor(a,b){this.Bd=a;this.C=void 0===b?!0:!!b}$b(){return null}na(){return O(olympe.dc.X.Od)}F(){return[this.Bd.R()]}getTransform(a,b,c){const d=new olympe.dc.pc.Vq(this.C?this.Bd.G.bind(this.Bd):(e,f)=>this.Bd.G(f,e));return(e,f,g)=>{var h=e?this.Bd.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ia(a){return'{"c":"'+this.na()+'","a":['+this.Bd.ia(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Bd.toString()+','+JSON.stringify(this.C)+')'}};
655
+ N('olympe.dc.transformers.Sort',olympe.dc.X.Od);olympe.dc.X.Od.ma=[olympe.dc.Zc,olympe.dc.pq];olympe.dc.X.uc=class{constructor(a){this.C=a}$b(){return null}na(){return O(olympe.dc.X.uc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Hg(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,tg(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.nb(f)&&(f=f.Na),olympe.D.Sf(f)?(b.F||void 0!==olympe.D.Za(f)||Hg(b,h),e[l]=f,olympe.D.yc([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),d(g,h,k,!1),delete e[h])}}ia(a){return'{"c":"'+
656
+ this.na()+'","a":['+this.C.ia(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.uc);olympe.dc.X.uc.ma=[olympe.dc.Zc,olympe.dc.pq];olympe.dc.X.be=class{constructor(a,b){this.start=a;this.C=b}$b(){return null}na(){return O(olympe.dc.X.be)}getTransform(a,b,c){const d=new olympe.dc.pc.Xl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);Eg(d,e,f,n,c)}};olympe.D.ke([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Ng(b,k);const l=Kg(b);Jg(b,l);return(n,p,q,r)=>{h||(r.Tc().Jg(t=>{e=t;Og(b,l)}),rg(b,()=>r.sg(),l),h=!0);d.C(n,p,q,null);sg(b,q,l)}}ia(a){return'{"c":"'+
657
+ this.na()+'","a":['+Ff(a,this.start)+','+Ff(a,this.C)+']}'}toString(){return`Limit(${olympe.D.Za(this.start)},${olympe.D.Za(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.be);olympe.dc.X.be.ma=[olympe.dc.Zc];function $g(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.C(f));f=n.C(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,tg(r,p,q,h))}const h=olympe.W.fc(),k=olympe.dc.Pa(),l=a.X,n=olympe.D.Ia();olympe.D.yc([a.C],p=>{ah(k,p,g,h);void 0===k.model(p)&&qg(e)})}function ah(a,b,c,d){const e=b&&b.valueOf();e&&(uc(a,e,c,d),olympe.D.Ia().xc(()=>vc(a,e,d)))}
658
+ olympe.dc.X.uf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Ba?(this.C=a.Qd(),this.X=a.Rl()):(this.C=a,b&&(this.X=b))}$b(){return null}na(){return O(olympe.dc.X.uf)||''}Bg(){return this.X}Qd(){return this.C}getTransform(a,b,c){const d=new olympe.dc.pc.Xl,e=new olympe.dc.pc.Ej;let f=[],g=[],h=!1,k=!1;const l=Kg(b),n=Kg(b);Ng(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Og(b);Eg(d,p,0,p.length,c)});Jg(b,n);$g(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.Ia();
659
+ u.R()||u.zb()||(k||(t.Tc().Jg(v=>{g=v;Og(b,n)}),rg(b,()=>t.sg(),n),k=!0),d.C(p,q,r),sg(b,r,n))});Jg(b,l);return(p,q,r,t)=>{h||(t.Tc().Jg(u=>{f=u;Og(b,l)}),rg(b,()=>t.sg(),l),h=!0);d.C(p,q,r,l);sg(b,r,l)}}ia(a){const b=this.X?'['+this.X.map(c=>c.ia(a)).join(',')+']':'null';return'{"c":"'+this.na()+'","a":['+Ff(a,this.C)+','+b+']}'}toString(){const a=olympe.D.nb(this.C)?'N:'+this.C.Na.Z():this.C.valueOf(),b=this.X?','+this.X.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
660
+ N('olympe.dc.transformers.Union',olympe.dc.X.uf);olympe.dc.X.uf.ma=[olympe.dc.Zc];olympe.dc.Kg={};function bh(a,b){let c=Ac.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Af(b);if(null===b)break;c=Ac.get(b)||null}return c||null}olympe.dc.Kg.SyncManager=class{constructor(a,b,c){this.N=a;this.db=b;this.C=c}};olympe.dc.Kg.O={Ea:'dc.syncs.Logger',xa:'dc.syncs.SyncManager'};olympe.U.config(function(a){C(a,olympe.dc.Kg.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc'));B(a,olympe.dc.Kg.O.xa,olympe.dc.Kg.SyncManager,olympe.dc.Kg.O.Ea,olympe.dc.O.si,olympe.U.O.cg)});olympe.dc.W={};olympe.dc.W.MC=function(a){a=olympe.dc.wa(a);const b=olympe.D.Nc(olympe.D.Xa,'getInstanceName'),c=olympe.dc.Pa(),d=xd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ia().xc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Eb()};olympe.dc.W.PC=function(a){return olympe.D.Ga([a],b=>olympe.D.Wx(olympe.dc.Pa().jj(b)),olympe.D.ra)};olympe.dc.W.QC=function(a){return(a=olympe.D.Za(a))?olympe.dc.Pa().jj(a):!1};olympe.dc.W.Hi=class a{constructor(b=olympe.dc.Ka.Xc){this.G=b}C(b){const c=new olympe.dc.db.zc;this.F(b,c);return c}R(b,c,d){const e=new olympe.dc.db.zc(b),f=new olympe.dc.query.zi(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}L(b,c){const d=new olympe.dc.db.zc(b),e=new olympe.dc.query.rt(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new kf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.bc.Nd;for(const f of b)switch(b=
661
+ f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.qc(f.t,a.C(f.p),!0,b);break;case 3:c.Mc(f.t,f.f,b);break;case 4:c.Oa(f.m,f.l,f.r,b);break;case 5:c.Jb(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.bc.Nd||b===olympe.dc.bc.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.bc.VERSION,e);continue}let f=
662
+ typeof e;b.startsWith('fd')&&(b=olympe.dc.Tg.rc+b.substr(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
663
+ e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.Ec(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.W.Vb={};olympe.dc.W.Vb.Nm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Cb(a):a instanceof olympe.D.Xa?a:null;olympe.dc.W.Vb.Km=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Bc(a):a instanceof olympe.D.ra?a:null;olympe.dc.W.Vb.Mm=a=>'number'===typeof a||a instanceof Number?olympe.D.za(a):'string'===typeof a||a instanceof String?olympe.D.za(Number.parseFloat(a.valueOf())):a instanceof olympe.D.da?a:null;
664
+ olympe.dc.W.Vb.Lm=function(a){return'number'===typeof a||a instanceof Number?sb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.kb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.kb(a):a instanceof olympe.D.kb?a:null};olympe.dc.W.Vb.Ar=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?wb(a.valueOf()):null};olympe.dc.W.Vb.Br=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Ec?olympe.dc.CloudObject.get(a.tag):null;
665
+ olympe.dc.W.Vb.hh=a=>a instanceof olympe.dc.Ec?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Vb.wC=a=>{switch(typeof a){case 'boolean':return olympe.D.Bc(a);case 'number':return olympe.D.za(a);case 'string':return olympe.D.Cb(a);case 'object':if(a instanceof Date)return olympe.D.Mx(a)}return a};
666
+ olympe.dc.W.Vb.JC=a=>{switch(a){case olympe.D.ra:return olympe.dc.W.Vb.Km;case olympe.D.Xa:return olympe.dc.W.Vb.Nm;case olympe.D.da:return olympe.dc.W.Vb.Mm;case olympe.D.kb:return olympe.dc.W.Vb.Lm;case olympe.D.Color:return olympe.dc.W.Vb.Ar;case olympe.dc.CloudObject:return olympe.dc.W.Vb.Br;default:return olympe.dc.W.Vb.hh}};olympe.dc.O={xa:'dc.Manager',pt:'dc.Graph',si:'dc.DBView',Ea:'dc.Logger',$u:'dc.TransactionLogger',vi:'dc.FileServiceManager',oe:'dc.Router'};olympe.dc.Config={dg:'dc.debug',Yg:'dc.subscribeAll',to:'dc.defaultSource',Jo:'dc.fileCache',Co:'dc.errorOnAbstractInstantiation'};
667
+ olympe.U.config(function(a){E(a,olympe.dc.Config.dg,!1);E(a,olympe.dc.Config.Yg,!1);E(a,olympe.dc.Config.to,olympe.dc.Ka.Xc);E(a,olympe.dc.Config.Jo,!0);E(a,olympe.dc.Config.Co,!0);C(a,olympe.dc.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dc'));sa(a,olympe.dc.O.$u,olympe.dc.transaction.O.Ea);sa(a,olympe.dc.O.si,olympe.dc.db.O.jb);B(a,olympe.dc.O.vi,olympe.dc.lt,olympe.dc.O.Ea,olympe.la.O.xa,olympe.dc.O.oe,olympe.W.O.xh,new olympe.U.fa(olympe.dc.Config.Jo));ta(a,olympe.dc.O.oe);B(a,olympe.dc.O.xa,olympe.dc.ta,
668
+ olympe.dc.O.Ea,olympe.dc.db.O.xa,olympe.dc.query.O.xa,olympe.dc.transaction.O.xa,olympe.dc.Kg.O.xa,olympe.dc.O.vi)},'olympe.dc');olympe.U.run([olympe.dc.db.O.xa,olympe.dc.query.O.xa,olympe.dc.transaction.O.xa,olympe.dc.Kg.O.xa,olympe.dc.O.xa,olympe.dc.O.vi],(a,b,c,d,e,f)=>{olympe.dc.Dd=()=>a;olympe.dc.Kf=()=>b;olympe.dc.gi=()=>c;olympe.dc.Tr=()=>d;olympe.dc.Tc=()=>e;olympe.dc.zw=()=>f},'DC singleton getter initialization');olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Pa();this.model=null}static get(a){{var b=olympe.dc.Tr();a=olympe.dc.wa(a);const c=bh(b,b.db.model(a));null===c?(b.N.error(`Instantiation of a Sync (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
670
669
  This could lead to unwanted behaviour and must be fixed.
671
- For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static Jv(a,b){const c=(new olympe.dc.Transaction).persist(!1),d=c.create(b||this);a.forEach((e,f)=>{d.setProperty(f,e instanceof olympe.dc.CloudObject?new olympe.dc.Ec(e.T()):e)});c.ib();return this.get(d)}static tv(){return this.get(this)}static Uk(a){return olympe.dc.hb.Uk(a)}static wd(){return olympe.dc.Pa().tb(this,
672
- olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.ua.Property(a))}static gd(){const a=olympe.dc.Pa();return a.tb(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.ua.Relation(b)).concat(a.tb(this,olympe.dc.CloudObject.Y).map(b=>new olympe.dc.ua.Relation(b,olympe.dc.Aa.ORIGIN)))}static If(a){return olympe.dc.CloudObject.get(a)}static Aw(a){var b=ch(olympe.dc.Qr(),olympe.dc.wa(a));b=b&&b.C;return new olympe.dc.Ba(olympe.dc.wa(a),olympe.dc.CloudObject.instancesRel,b)}T(){return this.tag}name(){return this.db.name(this)}pa(){return this.Fb(olympe.dc.CloudObject.nameProp)}ei(){this.model||
673
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.hb.from(this)}Uf(){return this.db.Uf(this)}fx(){return this.db.version(this)}It(){return this.db.source(this)}Jr(){return olympe.D.Ga([this.pa()],a=>olympe.D.Cb(a),olympe.D.Xa,'getDisplayName',olympe.D.Cb('('+this.toString()+')'))}Wb(){return this.model?this.model.T():this.db.model(this)}observe(a,b){const c='function'===typeof a.Fc?a.Fc():a;return new rxjs.Observable(d=>{const e=yd(this.db,this.tag,
674
- b,f=>{null===f||void 0===f?d.next(null):d.next(f)});c.xc(()=>{d.complete();this.db.F(this.tag,b,e)});return()=>this.db.F(this.tag,b,e)})}Mx(a){return this.observe(olympe.D.Ia(),a)}get(a){return this.db.gb(this.tag,a,!0)}gb(a){return this.get(a)}vb(a){return olympe.dc.hb.from(this).vb(a)}Zv(a){return olympe.dc.nd.from(this).vb(a)}jw(){return this.ed(olympe.dc.CloudObject.Tb,olympe.dc.CloudObject)}Zm(){return this.tb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Lf(a,b,c){const d=olympe.D.Mc(c,
675
- 'Sync valueType'),e=yd(this.db,this.tag,a,olympe.D.Ia().C(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Fb(a){return L(this.Lf(a,olympe.dc.W.Vb.Mm,olympe.D.Xa))}He(a){return L(this.Lf(a,olympe.dc.W.Vb.Lm,olympe.D.ea))}nh(a){return L(this.Lf(a,olympe.dc.W.Vb.Jm,olympe.D.ra))}gj(a){return L(this.Lf(a,olympe.dc.W.Vb.Km,olympe.D.kb))}Pr(){return L(this.Lf(olympe.dm.Color.valueProp,olympe.dc.W.Vb.xr,olympe.D.Color))}Qw(a){return L(this.Lf(a,
676
- olympe.dc.W.Vb.yr,olympe.dc.CloudObject))}tb(a,b){a=a instanceof olympe.dc.X.Sb?a:new olympe.dc.X.Sb(a.T(),a.Qa());return new olympe.dc.Ba(this.T(),a,b)}ed(a,b){return this.tb(a,b).Qc()}Gr(a,b){const c=this.db,d=olympe.W.hc(),e=olympe.D.Ia(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Zb(`forEachRelated: (${this.tag})-[:${a.T()}]-(${h})`,e),f.set(h,g),g.run(b,olympe.dc.CloudObject.get(h))):f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.xc(()=>{c.C(this.tag,a,d)})}ry(){return new olympe.dc.Ba(this.T(),
677
- [],Hc(this.T()))}transform(...a){return(new olympe.dc.Ba(this.T(),[],this.constructor)).transform(...a)}kd(){return this.Jr()}toString(){if(!this.db.Gb(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Gb(this.tag))return{CloudObject:'Unknown tag'};const a=this.db.model(this.tag),b=this.db.name(a),
678
- c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}sb(a){return a instanceof olympe.dc.CloudObject?this.T()===a.T():!1}Wd(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.sb(b)),olympe.D.ra)}Lv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.Aa.ORIGIN;for(const [e,f,g]of Bd(b,this))f===d?a.Jb(e,g,this):e!==olympe.dc.CloudObject.modelRel.T()&&a.Jb(e,this,g);a.delete(this,olympe.dc.Ub.NONE);c&&a.ib()}};
679
- olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.Zv;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.vb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.gb;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Mx;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;
680
- olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Wb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Uf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.ei;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.T;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Aw;
681
- olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.If;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.gd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.wd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Uk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.tv;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Jv;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.Ca.C('ff021000000000000001',olympe.dc.CloudObject);
682
- olympe.dc.CloudObject.uh=olympe.dc.CloudObject.P.Da(olympe.dc.bc.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.Da('ff023000000000000011');z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.aa=olympe.dc.CloudObject.P.Da('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.P.Ra('ff02200000000000000a');olympe.dc.CloudObject.Y=olympe.dc.CloudObject.P.Ra('ff02200000000000000b',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.Of=olympe.dc.CloudObject.P.Ra('017e9c4ba4c847d71cbf');
683
- olympe.dc.CloudObject.Qd=olympe.dc.CloudObject.P.Ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.Ra('ff02200000000000000c');z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.Ra('ff02200000000000000d',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.Vc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
670
+ For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static Nv(a,b){const c=(new olympe.dc.Transaction).persist(!1),d=c.create(b||this);a.forEach((e,f)=>{d.setProperty(f,e instanceof olympe.dc.CloudObject?new olympe.dc.Ec(e.T()):e)});c.ib();return this.get(d)}static xv(){return this.get(this)}static Uk(a){return olympe.dc.hb.Uk(a)}static vd(){return olympe.dc.Pa().tb(this,
671
+ olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.va.Property(a))}static gd(){const a=olympe.dc.Pa();return a.tb(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.va.Relation(b)).concat(a.tb(this,olympe.dc.CloudObject.Y).map(b=>new olympe.dc.va.Relation(b,olympe.dc.Aa.ORIGIN)))}static If(a){return olympe.dc.CloudObject.get(a)}static Ew(a){var b=bh(olympe.dc.Tr(),olympe.dc.wa(a));b=b&&b.C;return new olympe.dc.Ba(olympe.dc.wa(a),olympe.dc.CloudObject.instancesRel,b)}T(){return this.tag}name(){return this.db.name(this)}na(){return this.Fb(olympe.dc.CloudObject.nameProp)}ei(){this.model||
672
+ (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.hb.from(this)}Uf(){return this.db.Uf(this)}jx(){return this.db.version(this)}Mt(){return this.db.source(this)}Mr(){return olympe.D.Ga([this.na()],a=>olympe.D.Cb(a),olympe.D.Xa,'getDisplayName',olympe.D.Cb('('+this.toString()+')'))}Wb(){return this.model?this.model.T():this.db.model(this)}observe(a,b){const c='function'===typeof a.Fc?a.Fc():a;return new rxjs.Observable(d=>{const e=xd(this.db,this.tag,
673
+ b,f=>{null===f||void 0===f?d.next(null):d.next(f)});c.xc(()=>{d.complete();this.db.F(this.tag,b,e)});return()=>this.db.F(this.tag,b,e)})}Qx(a){return this.observe(olympe.D.Ia(),a)}get(a){return this.db.gb(this.tag,a,!0)}gb(a){return this.get(a)}vb(a){return olympe.dc.hb.from(this).vb(a)}cw(a){return olympe.dc.nd.from(this).vb(a)}nw(){return this.ed(olympe.dc.CloudObject.Tb,olympe.dc.CloudObject)}$m(){return this.tb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Lf(a,b,c){const d=olympe.D.Nc(c,
674
+ 'Sync valueType'),e=xd(this.db,this.tag,a,olympe.D.Ia().C(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Fb(a){return L(this.Lf(a,olympe.dc.W.Vb.Nm,olympe.D.Xa))}He(a){return L(this.Lf(a,olympe.dc.W.Vb.Mm,olympe.D.da))}nh(a){return L(this.Lf(a,olympe.dc.W.Vb.Km,olympe.D.ra))}gj(a){return L(this.Lf(a,olympe.dc.W.Vb.Lm,olympe.D.kb))}Sr(){return L(this.Lf(olympe.dm.Color.valueProp,olympe.dc.W.Vb.Ar,olympe.D.Color))}Uw(a){return L(this.Lf(a,
675
+ olympe.dc.W.Vb.Br,olympe.dc.CloudObject))}tb(a,b){a=a instanceof olympe.dc.X.Sb?a:new olympe.dc.X.Sb(a.T(),a.Qa());return new olympe.dc.Ba(this.T(),a,b)}ed(a,b){return this.tb(a,b).Rc()}Jr(a,b){const c=this.db,d=olympe.W.fc(),e=olympe.D.Ia(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Zb(`forEachRelated: (${this.tag})-[:${a.T()}]-(${h})`,e),f.set(h,g),g.run(b,olympe.dc.CloudObject.get(h))):f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.xc(()=>{c.C(this.tag,a,d)})}ty(){return new olympe.dc.Ba(this.T(),
676
+ [],Gc(this.T()))}transform(...a){return(new olympe.dc.Ba(this.T(),[],this.constructor)).transform(...a)}kd(){return this.Mr()}toString(){if(!this.db.Gb(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Gb(this.tag))return{CloudObject:'Unknown tag'};const a=this.db.model(this.tag),b=this.db.name(a),
677
+ c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}sb(a){return a instanceof olympe.dc.CloudObject?this.T()===a.T():!1}Vd(a){return olympe.D.Ga([a],b=>olympe.D.Bc(this.sb(b)),olympe.D.ra)}Pv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.Aa.ORIGIN;for(const [e,f,g]of Ad(b,this))f===d?a.Jb(e,g,this):e!==olympe.dc.CloudObject.modelRel.T()&&a.Jb(e,this,g);a.delete(this,olympe.dc.Ub.NONE);c&&a.ib()}};
678
+ olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.cw;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.vb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.gb;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Qx;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;
679
+ olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Wb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Uf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.ei;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.T;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Ew;
680
+ olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.If;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.gd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.vd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Uk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.xv;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Nv;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.Ca.C('ff021000000000000001',olympe.dc.CloudObject);
681
+ olympe.dc.CloudObject.uh=olympe.dc.CloudObject.P.Da(olympe.dc.bc.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.Da('ff023000000000000011');z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.ea=olympe.dc.CloudObject.P.Da('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.P.Ra('ff02200000000000000a');olympe.dc.CloudObject.Y=olympe.dc.CloudObject.P.Ra('ff02200000000000000b',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.Of=olympe.dc.CloudObject.P.Ra('017e9c4ba4c847d71cbf');
682
+ olympe.dc.CloudObject.ee=olympe.dc.CloudObject.P.Ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.Ra('ff02200000000000000c');z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.Ra('ff02200000000000000d',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.Wc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
684
683
  olympe.dc.CloudObject.instancesRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);z('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.ui);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
685
- olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.bo);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Tb=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.ZA=olympe.dc.CloudObject;olympe.dc.CloudObject.ma=[olympe.dc.ze];m=olympe.dc.CloudObject.prototype;m.T.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.pa.K=olympe.D.J.F;m.ei.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
686
- m.fx.K=new olympe.D.J(()=>Number,[]);m.It.K=new olympe.D.J(()=>String,[]);m.Jr.K=olympe.D.J.F;m.Wb.K=new olympe.D.J(()=>String,[]);m.jw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Zm.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Lf.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Fb.K=olympe.D.J.F;m.He.K=olympe.D.J.G;m.nh.K=olympe.D.J.R;m.gj.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Pr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Qw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
687
- m.tb.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.ed.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Gr.K=new olympe.D.J(()=>{},[]);m.ry.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;m.Wd.K=olympe.D.J.R;m.Lv.K=new olympe.D.J(()=>{},[]);olympe.dc.ck=class{constructor(a){this.instance=a}T(){return this.instance.T()}ij(){return nb(this.instance.nh(olympe.dc.CloudObject.aa))}tw(){return this.instance.ed(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}bn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.dt))}en(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.np))}wd(){return this.en().transform(olympe.dc.CloudObject.propertyRel,
688
- new olympe.dc.X.Gd)}Jw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}gd(){return this.en().transform(olympe.dc.CloudObject.G,new olympe.dc.X.Gd)}Kw(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Ga([a],b=>{const c=b.T(),d=olympe.dc.Pa();if(!d.jj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.ck(b)},olympe.dc.ck,'transformToModelInfo')}static ij(){return nb((void 0).nh(olympe.dc.CloudObject.aa))}};
689
- olympe.dc.ck.ma=[olympe.dc.ze];m=olympe.dc.ck.prototype;m.tw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.bn.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.en.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.wd.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Jw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.gd.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Kw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dc.eA=class{};olympe.dc.ba={};olympe.dc.ba.sp=class{constructor(a){this.N=a}};olympe.dc.ba.sp.rd={Oi:0,xA:1,yA:3,gA:4};olympe.dc.ba.Wj=class{};function Y(a){if(a.Y)throw Error('Cannot modify definition after definition is written');}
690
- olympe.dc.ba.ac=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.pa(),a=a.C.T(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.aa=olympe.dc.CloudObject.P.T();this.Fa=new Map;this.oa=new Map;this.Y=this.ha=!1;this.R=null}xn(a){Y(this);this.aa=a;return this}Wb(){return this.aa}tj(a){Y(this);
691
- this.R=a;return this}ey(){this.ha=!0;return this}dy(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.T();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}ji(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}gl(a){Y(this);const b=olympe.dc.CloudObject.nameProp.T();this.F.set(b,a);return this}tr(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
692
- if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Fa.set(a+'.'+b,[a,b]);return this}Fm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.oa.set(a+'.'+b,[a,b]);return this}done(){if(this.Y)return this;const a=dh(this.C,this.ha);a.F(this.tag,this.F,
693
- -1);eh(this.C,this);a.Oa(olympe.dc.jc.Vc,this.tag,this.aa,-1);this.R&&a.Oa(olympe.dc.jc.bo,this.R,this.tag,-1);this.G(-1);this.Fa.forEach(b=>{a.Oa(b[0],this.tag,b[1],-1)});this.oa.forEach(b=>{a.Oa(b[0],b[1],this.tag,-1)});this.Y=!0;this.C.C=void 0;return this}G(){}T(){return this.tag}pa(){return this.F.get('ff023000000000000011')}};olympe.dc.ba.ac.prototype.getName=olympe.dc.ba.ac.prototype.pa;olympe.dc.ba.ac.prototype.getTag=olympe.dc.ba.ac.prototype.T;olympe.dc.ba.ac.prototype.done=olympe.dc.ba.ac.prototype.done;
694
- olympe.dc.ba.ac.prototype.addRelationFrom=olympe.dc.ba.ac.prototype.Fm;olympe.dc.ba.ac.prototype.addRelationTo=olympe.dc.ba.ac.prototype.tr;olympe.dc.ba.ac.prototype.setName=olympe.dc.ba.ac.prototype.gl;olympe.dc.ba.ac.prototype.setProperty=olympe.dc.ba.ac.prototype.setProperty;olympe.dc.ba.ac.prototype.setProperties=olympe.dc.ba.ac.prototype.ji;olympe.dc.ba.ac.prototype.setNameOrProperties=olympe.dc.ba.ac.prototype.dy;olympe.dc.ba.ac.prototype.setOptional=olympe.dc.ba.ac.prototype.ey;
695
- olympe.dc.ba.ac.prototype.setContainedIn=olympe.dc.ba.ac.prototype.tj;olympe.dc.ba.ac.prototype.setModelTag=olympe.dc.ba.ac.prototype.xn;olympe.dc.ba.cd=class extends olympe.dc.ba.ac{constructor(a,b){super(a,b);this.Ta=this.C.OBJECT;this.bb=new Map;this.cb=new Map}js(a){Y(this);this.Ta=a;return this}extends(a){return this.js(a)}Ri(){Y(this);this.setProperty(olympe.dc.CloudObject.aa.T(),!0);return this}defineProperty(a,b,c,d){Y(this);this.bb.set(a,new olympe.dc.ba.cd.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Tg.qc+a,d);return this}ih(a,b,c,d,e,{Ui:f=0,pj:g=olympe.dm.Relation.L,sj:h=0,il:k=d,Jk:l=olympe.dm.Tc.NONE}=
696
- {}){Y(this);b=new olympe.dc.ba.cd.Relation(a,this.T(),b,c||'',d,e,h,k,f,g,l);this.cb.set(a,b);return this}G(a){super.G(a);dh(this.C).Oa(olympe.dc.CloudObject.extendRel.T(),this.tag,this.Ta,a);this.bb.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.T()]:b.name||''},d=olympe.dc.wa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.T(),f=b.tag;this.C.push();this.C.wh(f,d).ji(c).done();this.C.pop();b=b.type;dh(this.C).Oa(e,this.T(),f,a);dh(this.C).Oa(olympe.dm.Property.typeRel.T(),f,b,a)});
697
- this.cb.forEach(b=>{this.C.ih(b.C,b.G,b.F,b.name,b.Fr,b.Dr,{sj:b.sj,il:b.il,Ui:b.Ui,pj:b.pj,Jk:b.Jk},a)})}};olympe.dc.ba.cd.prototype.defineRelation=olympe.dc.ba.cd.prototype.ih;olympe.dc.ba.cd.prototype.defineProperty=olympe.dc.ba.cd.prototype.defineProperty;olympe.dc.ba.cd.prototype['abstract']=olympe.dc.ba.cd.prototype.Ri;olympe.dc.ba.cd.prototype['extends']=olympe.dc.ba.cd.prototype.extends;olympe.dc.ba.cd.prototype.setParentTag=olympe.dc.ba.cd.prototype.js;
698
- olympe.dc.ba.cd.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.ba.cd.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Fr=e;this.Dr=f;this.sj=g;this.il=h;this.Ui=k;this.pj=l;this.Jk=n}};function dh(a,b){return b?a.Y:a.F}function eh(a,b){0<a.L.length&&(b.R||a.F.Oa(olympe.dc.CloudObject.containsRel.T(),a.L[a.L.length-1].T(),b.T(),-1))}
699
- olympe.dc.ba.Sa=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.Md(!0);this.Y=new olympe.dc.transaction.Md(!0);this.N=a||null;this.Fa=!1;this.G=null;this.oa=new Map;this.aa=null;this.ha=Object.create(null);this.C=void 0;this.L=[];this.R=!0;this.ds=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Tg.qc;this.OBJECT=olympe.dc.CloudObject.P.T();
700
- this.PROPERTY=olympe.dm.Property.P.T();this.RELATION=olympe.dm.Relation.P.T();this.STRING=olympe.dm.String.P.T();this.BOOLEAN=olympe.dm.Boolean.P.T();this.NUMBER=olympe.dm.Number.P.T();this.DATETIME=olympe.dm.DateTime.P.T();this.COLOR=olympe.dm.Color.P.T();this.FILE=olympe.dm.File.P.T();this.ROLE=olympe.dm.dd.P.T();this.USER=olympe.dm.User.P.T();this.ONE_ONE=olympe.dm.Relation.F.iu;this.ONE_MANY=olympe.dm.Relation.F.am;this.MANY_ONE=olympe.dm.Relation.F.au;this.MANY_MANY=olympe.dm.Relation.F.Wl;this.NONE=
701
- olympe.dm.Tc.NONE;this.DESTINATION_READ=olympe.dm.Tc.Qs;this.DESTINATION_CREATE=olympe.dm.Tc.uo;this.DESTINATION_WRITE=olympe.dm.Tc.Rs;this.DESTINATION_DELETE=olympe.dm.Tc.Ns;this.DESTINATION_LINK=olympe.dm.Tc.Ps;this.DESTINATION_FULL=olympe.dm.Tc.Os;this.ORIGIN_READ=olympe.dm.Tc.mu;this.ORIGIN_CREATE=olympe.dm.Tc.ju;this.ORIGIN_WRITE=olympe.dm.Tc.nu;this.ORIGIN_DELETE=olympe.dm.Tc.ku;this.ORIGIN_LINK=olympe.dm.Tc.Zp;this.ORIGIN_FULL=olympe.dm.Tc.lu;this.FULL=olympe.dm.Tc.ft;this.DUMP_IGNORE=olympe.dm.Relation.C.hp;
702
- this.DUMP_REF=olympe.dm.Relation.C.uq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Fu;this.DUMP_UNILATERAL=olympe.dm.Relation.C.yk;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.mk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Bo;this.DUMP_DEFAULT=olympe.dm.Relation.C.qc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Eu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.ql;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Bu;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Cu;this.DELETE_EVERYTHING=
703
- olympe.dm.Relation.C.Bo;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.dd.F}push(){this.L.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.L.pop()}Wv(){const a=new Map,b=olympe.dc.ba.Pu.C(this.aa,this.F,this.Y);for(const [c,d]of b.entries())a.set(c,d.wj());return a}Tw(){return this.aa}cy(a){this.R=a}log(...a){this.R&&this.N&&this.N.log(...a)}rn(...a){this.R&&this.N&&this.N.debug(...a)}sx(...a){this.R&&this.N&&this.N.warn(...a)}Yk(...a){this.R&&
704
- this.N&&this.N.error(...a)}vv(a){if(a&&20===a.length&&!this.Fa){if(this.ha[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.ha[a]=a}this.G=null===this.G?olympe.W.aj():olympe.W.Rw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}fn(a){const b=this.oa.get(a)||1,c=olympe.W.fn(a,b);this.oa.set(a,b+1);return c}iy(a){this.Fa=a}Nv(){}gy(a){this.aa=a}wh(a,b){return(new olympe.dc.ba.ac(this,a)).xn(b)}Fx(a,b){return(new olympe.dc.ba.cd(this,
705
- a)).gl(b)}Ex(a,b){return(new olympe.dc.ba.cd(this,a)).gl(b).Ri()}Gx(a){return new olympe.dc.ba.vf(this,a)}al(a,b,c){this.F.Oa(a,b,c,-1)}defineProperty(a,b,c,d,e){this.rn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.T()]:d||''};void 0!==e&&this.pc(a,{[olympe.dc.Tg.qc+c]:e});this.C?(this.push(),this.wh(c,olympe.dm.Property.P.T()).ji(d).done(),this.pop()):this.wh(c,olympe.dm.Property.P.T()).ji(d).tj(a).done();this.al(olympe.dc.CloudObject.propertyRel.T(),a,c);this.al(olympe.dm.Property.typeRel.T(),
706
- c,b)}ih(a,b,c,d,e,f,{Ui:g=olympe.dm.Relation.F.am,pj:h=olympe.dm.Relation.L,sj:k=0,il:l=e,Jk:n=olympe.dm.Tc.NONE}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.T()]:d||
707
- '',[q.Im.T()]:g,[q.un.T()]:h,[q.Sm.T()]:e,[q.Rm.T()]:f,[q.fl.T()]:k,[q.ks.T()]:l,[q.wv.T()]:n};this.C?(this.push(),this.wh(a,q.P.T()).ji(d).done(),this.pop()):this.wh(a,q.P.T()).ji(d).tj(b).done();this.F.Oa(q.originModelRel.T(),b,a,p);this.F.Oa(q.destinationModelRel.T(),a,c,p)}px(a,b){this.F.Oa(olympe.dm.dd.C.T(),a,b,-1)}pc(a,b,c=!1){this.rn('Updating instance ',a);delete b[olympe.dc.bc.Nd];delete b[olympe.dc.bc.VERSION];const d=new Map;Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.pc(a,d,c,-1)}assign(a,
708
- b,c){this.al(b,a,c)}uv(a,b,c){this.Y.Oa(b,a,c,-1)}Iv(a){return new olympe.dc.Ec(a)}Dv(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Ev({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,RC:g=0,cD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}aw(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();
709
- return b}Fv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}$i(a,b,c){return olympe.auth.Hb.Ee.$i(a,c)}Hr(a,b){return olympe.auth.Hb.Ee.$i(a,b)}Jb(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Lc(){throw Error('DeleteInstance method on OSaveFile is deprecated');}};
710
- olympe.dc.ba.Sa.prototype.deleteInstance=olympe.dc.ba.Sa.prototype.Lc;olympe.dc.ba.Sa.prototype.deleteRelation=olympe.dc.ba.Sa.prototype.Jb;olympe.dc.ba.Sa.prototype.generateAuthenticationData=olympe.dc.ba.Sa.prototype.Hr;olympe.dc.ba.Sa.prototype.generateAuthData=olympe.dc.ba.Sa.prototype.$i;olympe.dc.ba.Sa.prototype.createDateTimeLegacy=olympe.dc.ba.Sa.prototype.Fv;olympe.dc.ba.Sa.prototype.fromISODate=olympe.dc.ba.Sa.prototype.aw;olympe.dc.ba.Sa.prototype.createDateTime=olympe.dc.ba.Sa.prototype.Ev;
711
- olympe.dc.ba.Sa.prototype.createColor=olympe.dc.ba.Sa.prototype.Dv;olympe.dc.ba.Sa.prototype.createReference=olympe.dc.ba.Sa.prototype.Iv;olympe.dc.ba.Sa.prototype.assignOptional=olympe.dc.ba.Sa.prototype.uv;olympe.dc.ba.Sa.prototype.assign=olympe.dc.ba.Sa.prototype.assign;olympe.dc.ba.Sa.prototype.updateInstance=olympe.dc.ba.Sa.prototype.pc;olympe.dc.ba.Sa.prototype.linkRoleToUser=olympe.dc.ba.Sa.prototype.px;olympe.dc.ba.Sa.prototype.defineRelation=olympe.dc.ba.Sa.prototype.ih;
712
- olympe.dc.ba.Sa.prototype.defineProperty=olympe.dc.ba.Sa.prototype.defineProperty;olympe.dc.ba.Sa.prototype.newRelation=olympe.dc.ba.Sa.prototype.al;olympe.dc.ba.Sa.prototype.newUser=olympe.dc.ba.Sa.prototype.Gx;olympe.dc.ba.Sa.prototype.newAbstractModel=olympe.dc.ba.Sa.prototype.Ex;olympe.dc.ba.Sa.prototype.newModel=olympe.dc.ba.Sa.prototype.Fx;olympe.dc.ba.Sa.prototype.newInstance=olympe.dc.ba.Sa.prototype.wh;olympe.dc.ba.Sa.prototype.setRootInstanceTag=olympe.dc.ba.Sa.prototype.gy;
713
- olympe.dc.ba.Sa.prototype.disableChecks=olympe.dc.ba.Sa.prototype.Nv;olympe.dc.ba.Sa.prototype.setUseNewTags=olympe.dc.ba.Sa.prototype.iy;olympe.dc.ba.Sa.prototype.assignTag=olympe.dc.ba.Sa.prototype.vv;olympe.dc.ba.Sa.prototype.logError=olympe.dc.ba.Sa.prototype.Yk;olympe.dc.ba.Sa.prototype.logWarn=olympe.dc.ba.Sa.prototype.sx;olympe.dc.ba.Sa.prototype.logDebug=olympe.dc.ba.Sa.prototype.rn;olympe.dc.ba.Sa.prototype.log=olympe.dc.ba.Sa.prototype.log;olympe.dc.ba.Sa.prototype.setLoggingEnabled=olympe.dc.ba.Sa.prototype.cy;
714
- olympe.dc.ba.Sa.prototype.getRootInstanceTag=olympe.dc.ba.Sa.prototype.Tw;olympe.dc.ba.Sa.prototype.flushContents=olympe.dc.ba.Sa.prototype.Wv;olympe.dc.ba.qg=class extends olympe.dc.ba.cd{constructor(a,b,c){super(a,b);this.L=this.description=null;this.setProperty(olympe.dm.BrickMetadata.bb.T(),olympe.dm.BrickMetadata.Ab.pu);null!==c&&this.ur(c)}ur(a){this.tj(a);this.Fm(olympe.dm.Rb.C.T(),a);return this}by(a){this.F.set(olympe.dm.xe.Ta.T(),a);return this}$x(a){Y(this);this.description=a;return this}hy(a){Y(this);this.L=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.L)this.C.push(),a=this.C.wh(this.C.fn(this.tag),olympe.sc.Cc.P.T()),
715
- this.description&&a.setProperty(olympe.sc.Cc.C.T(),this.description),this.L&&a.setProperty(olympe.sc.Cc.L.T(),this.L),a.tj(this.tag).tr(olympe.sc.Cc.F.T(),this.tag).done(),this.C.pop()}};olympe.dc.ba.qg.prototype.setSummary=olympe.dc.ba.qg.prototype.hy;olympe.dc.ba.qg.prototype.setDescription=olympe.dc.ba.qg.prototype.$x;olympe.dc.ba.qg.prototype.setIcon=olympe.dc.ba.qg.prototype.by;olympe.dc.ba.qg.prototype.addToFolder=olympe.dc.ba.qg.prototype.ur;olympe.dc.ba.Pu=class a{constructor(b,c,d){this.F=b;this.ta=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.Md&&d instanceof olympe.dc.transaction.Md){c=be(c);var e=be(d)}else e=new olympe.dc.transaction.Md(!0),c.Zc(e),c=be(e),d.Zc(e),e=be(e);d=new Map;var f=new a(b,c.vg,e.vg);f.Qf()||d.set('delRel',f);f=new a(b,c.Ue,e.Ue);f.Qf()||d.set('detInst',f);f=new a(b,c.Fg,e.Fg);f.Qf()||d.set('newInst',f);f=new a(b,c.Zf,e.Zf);f.Qf()||d.set('updateInst',f);b=new a(b,c.Gg,e.Gg);b.Qf()||
716
- d.set('newRel',b);return d}Qf(){return 0===this.ta.length+this.C.length}static Wr(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}wj(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
717
- 1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);c.rootTag=this.F;c.operations=this.ta.sort(b);c.optionalOperations=this.C.sort(b);return c}};olympe.dc.ba.vf=class extends olympe.dc.ba.ac{constructor(a,b){super(a,b);this.password=this.L=null;this.xn(olympe.dc.wa(olympe.dm.User))}jy(a){Y(this);this.L=a;return this}yn(a){Y(this);this.password=a;return this}ay(){return this}xv(a){Y(this);this.Fm(olympe.dm.User.C.T(),a);return this}G(a){super.G(a);if(null==this.L||''===this.L)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
718
- this.C.Hr(this.L,this.password),c=new Map;c.set(olympe.dm.User.loginProp.T(),b.login);c.set(olympe.dm.User.saltProp.T(),b.salt);c.set(olympe.dm.User.verifierProp.T(),b.verifier);dh(this.C).pc(this.T(),c,!1,a)}};olympe.dc.ba.vf.prototype.awardRole=olympe.dc.ba.vf.prototype.xv;olympe.dc.ba.vf.prototype.setDomain=olympe.dc.ba.vf.prototype.ay;olympe.dc.ba.vf.prototype.setPassword=olympe.dc.ba.vf.prototype.yn;olympe.dc.ba.vf.prototype.setUsername=olympe.dc.ba.vf.prototype.jy;olympe.dc.ba.O={wt:'dc.io.IOService',Eh:'dc.io.IOUrlsProvider'};olympe.U.config(function(a){ta(a,olympe.dc.ba.O.Eh);C(a,olympe.dc.ba.O.wt,[olympe.sa.O.xa,olympe.la.O.xa,olympe.auth.O.xa,olympe.dc.ba.O.Eh],b=>new olympe.dc.ba.sp(b.Pc('dc.io')))},'olympe.dc.io');olympe.dc.ba.NC=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Tg.qc)&&(a=a.substring(1));const d=olympe.dc.Pa();return b?c?Dd(d,a,b):Dd(d,a,d.model(b)):d.Gb(a)};olympe.dm={};olympe.dm.Tc={NONE:0,Qs:1,uo:2,Rs:4,Ns:8,Ps:16,Os:31,mu:32,ju:64,nu:128,ku:256,Zp:512,lu:992,ft:1023};olympe.dm.dd=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}pa(){return this.Fb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Xa.EMPTY}F(){return olympe.D.ra.C}};olympe.dm.dd.P=olympe.dc.Ca.C('ff021000000000000002',olympe.dm.dd);olympe.dm.dd.ha=olympe.dm.dd.P.Da('ff023000000000000035');olympe.dm.dd.C=olympe.dm.dd.P.Ra('ff022000000000000005');olympe.dm.dd.F=Gc('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.dd.R=Gc('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
719
- olympe.dm.dd.L=Gc('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.dd.prototype.pa.K=olympe.D.J.F;olympe.dm.dd.prototype.C.K=olympe.D.J.F;olympe.dm.dd.prototype.F.K=olympe.D.J.R;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}ww(){return this.cn()}pa(){return this.cn()}cn(){return this.Fb(olympe.dm.User.loginProp)}Kt(){return this.Fb(olympe.dm.User.F)}Jt(){return olympe.D.Xa.EMPTY}Vw(){return this.Fb(olympe.dm.User.saltProp)}ex(){return this.Fb(olympe.dm.User.verifierProp)}Sw(){return this.tb(olympe.dm.User.C,olympe.dm.dd)}};olympe.dm.User.P=olympe.dc.Ca.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.Da('ff023000000000000001');
684
+ olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.Ra(olympe.dc.jc.eo);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Tb=P(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.cB=olympe.dc.CloudObject;olympe.dc.CloudObject.ma=[olympe.dc.ze];m=olympe.dc.CloudObject.prototype;m.T.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.na.K=olympe.D.J.F;m.ei.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
685
+ m.jx.K=new olympe.D.J(()=>Number,[]);m.Mt.K=new olympe.D.J(()=>String,[]);m.Mr.K=olympe.D.J.F;m.Wb.K=new olympe.D.J(()=>String,[]);m.nw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.$m.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Lf.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Fb.K=olympe.D.J.F;m.He.K=olympe.D.J.G;m.nh.K=olympe.D.J.R;m.gj.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Sr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Uw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
686
+ m.tb.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.ed.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Jr.K=new olympe.D.J(()=>{},[]);m.ty.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.kd.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.sb.K=olympe.D.J.C;m.Vd.K=olympe.D.J.R;m.Pv.K=new olympe.D.J(()=>{},[]);olympe.dc.ck=class{constructor(a){this.instance=a}T(){return this.instance.T()}ij(){return nb(this.instance.nh(olympe.dc.CloudObject.ea))}xw(){return this.instance.ed(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}cn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.ht))}fn(){return this.instance.transform(new olympe.dc.X.Dc(olympe.dc.CloudObject.extendRel.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.rp))}vd(){return this.fn().transform(olympe.dc.CloudObject.propertyRel,
687
+ new olympe.dc.X.Gd)}Nw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}gd(){return this.fn().transform(olympe.dc.CloudObject.G,new olympe.dc.X.Gd)}Ow(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Ga([a],b=>{const c=b.T(),d=olympe.dc.Pa();if(!d.jj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.ck(b)},olympe.dc.ck,'transformToModelInfo')}static ij(){return nb((void 0).nh(olympe.dc.CloudObject.ea))}};
688
+ olympe.dc.ck.ma=[olympe.dc.ze];m=olympe.dc.ck.prototype;m.xw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.cn.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.fn.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.vd.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Nw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.gd.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Ow.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dc.jA=class{};olympe.dc.aa={};olympe.dc.aa.vp=class{constructor(a){this.N=a}};olympe.dc.aa.vp.qd={Oi:0,BA:1,CA:3,lA:4};olympe.dc.aa.Wj=class{};function Y(a){if(a.Y)throw Error('Cannot modify definition after definition is written');}
689
+ olympe.dc.aa.ac=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.na(),a=a.C.T(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.ea=olympe.dc.CloudObject.P.T();this.Fa=new Map;this.qa=new Map;this.Y=this.ka=!1;this.R=null}zn(a){Y(this);this.ea=a;return this}Wb(){return this.ea}tj(a){Y(this);
690
+ this.R=a;return this}gy(){this.ka=!0;return this}fy(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.T();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}ji(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}gl(a){Y(this);const b=olympe.dc.CloudObject.nameProp.T();this.F.set(b,a);return this}wr(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
691
+ if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Fa.set(a+'.'+b,[a,b]);return this}Gm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.T())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.qa.set(a+'.'+b,[a,b]);return this}done(){if(this.Y)return this;const a=ch(this.C,this.ka);a.F(this.tag,this.F,
692
+ -1);dh(this.C,this);a.Oa(olympe.dc.jc.Wc,this.tag,this.ea,-1);this.R&&a.Oa(olympe.dc.jc.eo,this.R,this.tag,-1);this.G(-1);this.Fa.forEach(b=>{a.Oa(b[0],this.tag,b[1],-1)});this.qa.forEach(b=>{a.Oa(b[0],b[1],this.tag,-1)});this.Y=!0;this.C.C=void 0;return this}G(){}T(){return this.tag}na(){return this.F.get('ff023000000000000011')}};olympe.dc.aa.ac.prototype.getName=olympe.dc.aa.ac.prototype.na;olympe.dc.aa.ac.prototype.getTag=olympe.dc.aa.ac.prototype.T;olympe.dc.aa.ac.prototype.done=olympe.dc.aa.ac.prototype.done;
693
+ olympe.dc.aa.ac.prototype.addRelationFrom=olympe.dc.aa.ac.prototype.Gm;olympe.dc.aa.ac.prototype.addRelationTo=olympe.dc.aa.ac.prototype.wr;olympe.dc.aa.ac.prototype.setName=olympe.dc.aa.ac.prototype.gl;olympe.dc.aa.ac.prototype.setProperty=olympe.dc.aa.ac.prototype.setProperty;olympe.dc.aa.ac.prototype.setProperties=olympe.dc.aa.ac.prototype.ji;olympe.dc.aa.ac.prototype.setNameOrProperties=olympe.dc.aa.ac.prototype.fy;olympe.dc.aa.ac.prototype.setOptional=olympe.dc.aa.ac.prototype.gy;
694
+ olympe.dc.aa.ac.prototype.setContainedIn=olympe.dc.aa.ac.prototype.tj;olympe.dc.aa.ac.prototype.setModelTag=olympe.dc.aa.ac.prototype.zn;olympe.dc.aa.cd=class extends olympe.dc.aa.ac{constructor(a,b){super(a,b);this.Ta=this.C.OBJECT;this.cb=new Map;this.$a=new Map}ns(a){Y(this);this.Ta=a;return this}extends(a){return this.ns(a)}Ri(){Y(this);this.setProperty(olympe.dc.CloudObject.ea.T(),!0);return this}defineProperty(a,b,c,d){Y(this);this.cb.set(a,new olympe.dc.aa.cd.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Tg.rc+a,d);return this}ih(a,b,c,d,e,{Ui:f=0,pj:g=olympe.dm.Relation.L,sj:h=0,il:k=d,Jk:l=olympe.dm.Uc.NONE}=
695
+ {}){Y(this);b=new olympe.dc.aa.cd.Relation(a,this.T(),b,c||'',d,e,h,k,f,g,l);this.$a.set(a,b);return this}G(a){super.G(a);ch(this.C).Oa(olympe.dc.CloudObject.extendRel.T(),this.tag,this.Ta,a);this.cb.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.T()]:b.name||''},d=olympe.dc.wa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.T(),f=b.tag;this.C.push();this.C.wh(f,d).ji(c).done();this.C.pop();b=b.type;ch(this.C).Oa(e,this.T(),f,a);ch(this.C).Oa(olympe.dm.Property.typeRel.T(),f,b,a)});
696
+ this.$a.forEach(b=>{this.C.ih(b.C,b.G,b.F,b.name,b.Ir,b.Gr,{sj:b.sj,il:b.il,Ui:b.Ui,pj:b.pj,Jk:b.Jk},a)})}};olympe.dc.aa.cd.prototype.defineRelation=olympe.dc.aa.cd.prototype.ih;olympe.dc.aa.cd.prototype.defineProperty=olympe.dc.aa.cd.prototype.defineProperty;olympe.dc.aa.cd.prototype['abstract']=olympe.dc.aa.cd.prototype.Ri;olympe.dc.aa.cd.prototype['extends']=olympe.dc.aa.cd.prototype.extends;olympe.dc.aa.cd.prototype.setParentTag=olympe.dc.aa.cd.prototype.ns;
697
+ olympe.dc.aa.cd.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.aa.cd.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Ir=e;this.Gr=f;this.sj=g;this.il=h;this.Ui=k;this.pj=l;this.Jk=n}};function ch(a,b){return b?a.Y:a.F}function dh(a,b){0<a.L.length&&(b.R||a.F.Oa(olympe.dc.CloudObject.containsRel.T(),a.L[a.L.length-1].T(),b.T(),-1))}
698
+ olympe.dc.aa.Sa=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.Md(!0);this.Y=new olympe.dc.transaction.Md(!0);this.N=a||null;this.Fa=!1;this.G=null;this.qa=new Map;this.ea=null;this.ka=Object.create(null);this.C=void 0;this.L=[];this.R=!0;this.hs=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Tg.rc;this.OBJECT=olympe.dc.CloudObject.P.T();
699
+ this.PROPERTY=olympe.dm.Property.P.T();this.RELATION=olympe.dm.Relation.P.T();this.STRING=olympe.dm.String.P.T();this.BOOLEAN=olympe.dm.Boolean.P.T();this.NUMBER=olympe.dm.Number.P.T();this.DATETIME=olympe.dm.DateTime.P.T();this.COLOR=olympe.dm.Color.P.T();this.FILE=olympe.dm.File.P.T();this.ROLE=olympe.dm.dd.P.T();this.USER=olympe.dm.User.P.T();this.ONE_ONE=olympe.dm.Relation.F.mu;this.ONE_MANY=olympe.dm.Relation.F.am;this.MANY_ONE=olympe.dm.Relation.F.eu;this.MANY_MANY=olympe.dm.Relation.F.Wl;this.NONE=
700
+ olympe.dm.Uc.NONE;this.DESTINATION_READ=olympe.dm.Uc.Us;this.DESTINATION_CREATE=olympe.dm.Uc.wo;this.DESTINATION_WRITE=olympe.dm.Uc.Vs;this.DESTINATION_DELETE=olympe.dm.Uc.Rs;this.DESTINATION_LINK=olympe.dm.Uc.Ts;this.DESTINATION_FULL=olympe.dm.Uc.Ss;this.ORIGIN_READ=olympe.dm.Uc.qu;this.ORIGIN_CREATE=olympe.dm.Uc.nu;this.ORIGIN_WRITE=olympe.dm.Uc.ru;this.ORIGIN_DELETE=olympe.dm.Uc.ou;this.ORIGIN_LINK=olympe.dm.Uc.bq;this.ORIGIN_FULL=olympe.dm.Uc.pu;this.FULL=olympe.dm.Uc.jt;this.DUMP_IGNORE=olympe.dm.Relation.C.kp;
701
+ this.DUMP_REF=olympe.dm.Relation.C.xq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Ju;this.DUMP_UNILATERAL=olympe.dm.Relation.C.yk;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.mk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Do;this.DUMP_DEFAULT=olympe.dm.Relation.C.rc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Iu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.ql;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Fu;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Gu;this.DELETE_EVERYTHING=
702
+ olympe.dm.Relation.C.Do;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.dd.F}push(){this.L.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.L.pop()}$v(){const a=new Map,b=olympe.dc.aa.Tu.C(this.ea,this.F,this.Y);for(const [c,d]of b.entries())a.set(c,d.wj());return a}Xw(){return this.ea}ey(a){this.R=a}log(...a){this.R&&this.N&&this.N.log(...a)}sn(...a){this.R&&this.N&&this.N.debug(...a)}wx(...a){this.R&&this.N&&this.N.warn(...a)}Yk(...a){this.R&&
703
+ this.N&&this.N.error(...a)}zv(a){if(a&&20===a.length&&!this.Fa){if(this.ka[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.ka[a]=a}this.G=null===this.G?olympe.W.aj():olympe.W.Vw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}gn(a){const b=this.qa.get(a)||1,c=olympe.W.gn(a,b);this.qa.set(a,b+1);return c}ky(a){this.Fa=a}Rv(){}iy(a){this.ea=a}wh(a,b){return(new olympe.dc.aa.ac(this,a)).zn(b)}Jx(a,b){return(new olympe.dc.aa.cd(this,
704
+ a)).gl(b)}Ix(a,b){return(new olympe.dc.aa.cd(this,a)).gl(b).Ri()}Kx(a){return new olympe.dc.aa.vf(this,a)}al(a,b,c){this.F.Oa(a,b,c,-1)}defineProperty(a,b,c,d,e){this.sn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.T()]:d||''};void 0!==e&&this.qc(a,{[olympe.dc.Tg.rc+c]:e});this.C?(this.push(),this.wh(c,olympe.dm.Property.P.T()).ji(d).done(),this.pop()):this.wh(c,olympe.dm.Property.P.T()).ji(d).tj(a).done();this.al(olympe.dc.CloudObject.propertyRel.T(),a,c);this.al(olympe.dm.Property.typeRel.T(),
705
+ c,b)}ih(a,b,c,d,e,f,{Ui:g=olympe.dm.Relation.F.am,pj:h=olympe.dm.Relation.L,sj:k=0,il:l=e,Jk:n=olympe.dm.Uc.NONE}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.T()]:d||
706
+ '',[q.Jm.T()]:g,[q.wn.T()]:h,[q.Tm.T()]:e,[q.Sm.T()]:f,[q.fl.T()]:k,[q.ps.T()]:l,[q.Av.T()]:n};this.C?(this.push(),this.wh(a,q.P.T()).ji(d).done(),this.pop()):this.wh(a,q.P.T()).ji(d).tj(b).done();this.F.Oa(q.originModelRel.T(),b,a,p);this.F.Oa(q.destinationModelRel.T(),a,c,p)}tx(a,b){this.F.Oa(olympe.dm.dd.C.T(),a,b,-1)}qc(a,b,c=!1){this.sn('Updating instance ',a);delete b[olympe.dc.bc.Nd];delete b[olympe.dc.bc.VERSION];const d=new Map;Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.qc(a,d,c,-1)}assign(a,
707
+ b,c){this.al(b,a,c)}yv(a,b,c){this.Y.Oa(b,a,c,-1)}Mv(a){return new olympe.dc.Ec(a)}Hv(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Iv({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,VC:g=0,gD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}ew(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();
708
+ return b}Jv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}$i(a,b,c){return olympe.auth.Hb.Ee.$i(a,c)}Kr(a,b){return olympe.auth.Hb.Ee.$i(a,b)}Jb(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Mc(){throw Error('DeleteInstance method on OSaveFile is deprecated');}};
709
+ olympe.dc.aa.Sa.prototype.deleteInstance=olympe.dc.aa.Sa.prototype.Mc;olympe.dc.aa.Sa.prototype.deleteRelation=olympe.dc.aa.Sa.prototype.Jb;olympe.dc.aa.Sa.prototype.generateAuthenticationData=olympe.dc.aa.Sa.prototype.Kr;olympe.dc.aa.Sa.prototype.generateAuthData=olympe.dc.aa.Sa.prototype.$i;olympe.dc.aa.Sa.prototype.createDateTimeLegacy=olympe.dc.aa.Sa.prototype.Jv;olympe.dc.aa.Sa.prototype.fromISODate=olympe.dc.aa.Sa.prototype.ew;olympe.dc.aa.Sa.prototype.createDateTime=olympe.dc.aa.Sa.prototype.Iv;
710
+ olympe.dc.aa.Sa.prototype.createColor=olympe.dc.aa.Sa.prototype.Hv;olympe.dc.aa.Sa.prototype.createReference=olympe.dc.aa.Sa.prototype.Mv;olympe.dc.aa.Sa.prototype.assignOptional=olympe.dc.aa.Sa.prototype.yv;olympe.dc.aa.Sa.prototype.assign=olympe.dc.aa.Sa.prototype.assign;olympe.dc.aa.Sa.prototype.updateInstance=olympe.dc.aa.Sa.prototype.qc;olympe.dc.aa.Sa.prototype.linkRoleToUser=olympe.dc.aa.Sa.prototype.tx;olympe.dc.aa.Sa.prototype.defineRelation=olympe.dc.aa.Sa.prototype.ih;
711
+ olympe.dc.aa.Sa.prototype.defineProperty=olympe.dc.aa.Sa.prototype.defineProperty;olympe.dc.aa.Sa.prototype.newRelation=olympe.dc.aa.Sa.prototype.al;olympe.dc.aa.Sa.prototype.newUser=olympe.dc.aa.Sa.prototype.Kx;olympe.dc.aa.Sa.prototype.newAbstractModel=olympe.dc.aa.Sa.prototype.Ix;olympe.dc.aa.Sa.prototype.newModel=olympe.dc.aa.Sa.prototype.Jx;olympe.dc.aa.Sa.prototype.newInstance=olympe.dc.aa.Sa.prototype.wh;olympe.dc.aa.Sa.prototype.setRootInstanceTag=olympe.dc.aa.Sa.prototype.iy;
712
+ olympe.dc.aa.Sa.prototype.disableChecks=olympe.dc.aa.Sa.prototype.Rv;olympe.dc.aa.Sa.prototype.setUseNewTags=olympe.dc.aa.Sa.prototype.ky;olympe.dc.aa.Sa.prototype.assignTag=olympe.dc.aa.Sa.prototype.zv;olympe.dc.aa.Sa.prototype.logError=olympe.dc.aa.Sa.prototype.Yk;olympe.dc.aa.Sa.prototype.logWarn=olympe.dc.aa.Sa.prototype.wx;olympe.dc.aa.Sa.prototype.logDebug=olympe.dc.aa.Sa.prototype.sn;olympe.dc.aa.Sa.prototype.log=olympe.dc.aa.Sa.prototype.log;olympe.dc.aa.Sa.prototype.setLoggingEnabled=olympe.dc.aa.Sa.prototype.ey;
713
+ olympe.dc.aa.Sa.prototype.getRootInstanceTag=olympe.dc.aa.Sa.prototype.Xw;olympe.dc.aa.Sa.prototype.flushContents=olympe.dc.aa.Sa.prototype.$v;olympe.dc.aa.qg=class extends olympe.dc.aa.cd{constructor(a,b,c){super(a,b);this.L=this.description=null;this.setProperty(olympe.dm.BrickMetadata.cb.T(),olympe.dm.BrickMetadata.Ab.tu);null!==c&&this.xr(c)}xr(a){this.tj(a);this.Gm(olympe.dm.Rb.C.T(),a);return this}dy(a){this.F.set(olympe.dm.xe.Ta.T(),a);return this}by(a){Y(this);this.description=a;return this}jy(a){Y(this);this.L=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.L)this.C.push(),a=this.C.wh(this.C.gn(this.tag),olympe.sc.Cc.P.T()),
714
+ this.description&&a.setProperty(olympe.sc.Cc.C.T(),this.description),this.L&&a.setProperty(olympe.sc.Cc.L.T(),this.L),a.tj(this.tag).wr(olympe.sc.Cc.F.T(),this.tag).done(),this.C.pop()}};olympe.dc.aa.qg.prototype.setSummary=olympe.dc.aa.qg.prototype.jy;olympe.dc.aa.qg.prototype.setDescription=olympe.dc.aa.qg.prototype.by;olympe.dc.aa.qg.prototype.setIcon=olympe.dc.aa.qg.prototype.dy;olympe.dc.aa.qg.prototype.addToFolder=olympe.dc.aa.qg.prototype.xr;olympe.dc.aa.Tu=class a{constructor(b,c,d){this.F=b;this.ua=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.Md&&d instanceof olympe.dc.transaction.Md){c=ae(c);var e=ae(d)}else e=new olympe.dc.transaction.Md(!0),c.$c(e),c=ae(e),d.$c(e),e=ae(e);d=new Map;var f=new a(b,c.vg,e.vg);f.Qf()||d.set('delRel',f);f=new a(b,c.Ue,e.Ue);f.Qf()||d.set('detInst',f);f=new a(b,c.Fg,e.Fg);f.Qf()||d.set('newInst',f);f=new a(b,c.Zf,e.Zf);f.Qf()||d.set('updateInst',f);b=new a(b,c.Gg,e.Gg);b.Qf()||
715
+ d.set('newRel',b);return d}Qf(){return 0===this.ua.length+this.C.length}static un(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}wj(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
716
+ 1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);c.rootTag=this.F;c.operations=this.ua.sort(b);c.optionalOperations=this.C.sort(b);return c}};olympe.dc.aa.vf=class extends olympe.dc.aa.ac{constructor(a,b){super(a,b);this.password=this.L=null;this.zn(olympe.dc.wa(olympe.dm.User))}ly(a){Y(this);this.L=a;return this}An(a){Y(this);this.password=a;return this}cy(){return this}Bv(a){Y(this);this.Gm(olympe.dm.User.C.T(),a);return this}G(a){super.G(a);if(null==this.L||''===this.L)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
717
+ this.C.Kr(this.L,this.password),c=new Map;c.set(olympe.dm.User.loginProp.T(),b.login);c.set(olympe.dm.User.saltProp.T(),b.salt);c.set(olympe.dm.User.verifierProp.T(),b.verifier);ch(this.C).qc(this.T(),c,!1,a)}};olympe.dc.aa.vf.prototype.awardRole=olympe.dc.aa.vf.prototype.Bv;olympe.dc.aa.vf.prototype.setDomain=olympe.dc.aa.vf.prototype.cy;olympe.dc.aa.vf.prototype.setPassword=olympe.dc.aa.vf.prototype.An;olympe.dc.aa.vf.prototype.setUsername=olympe.dc.aa.vf.prototype.ly;olympe.dc.aa.O={At:'dc.io.IOService',Eh:'dc.io.IOUrlsProvider'};olympe.U.config(function(a){ta(a,olympe.dc.aa.O.Eh);C(a,olympe.dc.aa.O.At,[olympe.sa.O.xa,olympe.la.O.xa,olympe.auth.O.xa,olympe.dc.aa.O.Eh],b=>new olympe.dc.aa.vp(b.Qc('dc.io')))},'olympe.dc.io');olympe.dc.aa.RC=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Tg.rc)&&(a=a.substring(1));const d=olympe.dc.Pa();return b?c?Cd(d,a,b):Cd(d,a,d.model(b)):d.Gb(a)};olympe.dm={};olympe.dm.Uc={NONE:0,Us:1,wo:2,Vs:4,Rs:8,Ts:16,Ss:31,qu:32,nu:64,ru:128,ou:256,bq:512,pu:992,jt:1023};olympe.dm.dd=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}na(){return this.Fb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Xa.EMPTY}F(){return olympe.D.ra.C}};olympe.dm.dd.P=olympe.dc.Ca.C('ff021000000000000002',olympe.dm.dd);olympe.dm.dd.ka=olympe.dm.dd.P.Da('ff023000000000000035');olympe.dm.dd.C=olympe.dm.dd.P.Ra('ff022000000000000005');olympe.dm.dd.F=Fc('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.dd.R=Fc('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
718
+ olympe.dm.dd.L=Fc('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.dd.prototype.na.K=olympe.D.J.F;olympe.dm.dd.prototype.C.K=olympe.D.J.F;olympe.dm.dd.prototype.F.K=olympe.D.J.R;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Aw(){return this.dn()}na(){return this.dn()}dn(){return this.Fb(olympe.dm.User.loginProp)}Ot(){return this.Fb(olympe.dm.User.F)}Nt(){return olympe.D.Xa.EMPTY}Zw(){return this.Fb(olympe.dm.User.saltProp)}ix(){return this.Fb(olympe.dm.User.verifierProp)}Ww(){return this.tb(olympe.dm.User.C,olympe.dm.dd)}};olympe.dm.User.P=olympe.dc.Ca.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.Da('ff023000000000000001');
720
719
  z('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.Da('ff023000000000000002');olympe.dm.User.saltProp=olympe.dm.User.P.Da('ff023000000000000004');z('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.Da('ff023000000000000005');z('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.R=olympe.dm.User.P.Da('ff023000000000000020');olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.Da('ff023000000000000036');
721
- z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.P,olympe.dm.dd.C);olympe.dm.User.ha=olympe.dm.User.P.Ra('ff022000000000000002');olympe.dm.User.L=Gc('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.ww.K=olympe.D.J.F;m.pa.K=olympe.D.J.F;m.cn.K=olympe.D.J.F;m.Kt.K=olympe.D.J.F;m.Jt.K=olympe.D.J.F;m.Vw.K=olympe.D.J.F;m.ex.K=olympe.D.J.F;m.Sw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.xe=class extends olympe.dc.CloudObject{ha(){return this.Zm()}Ab(){return this.Fb(olympe.dm.xe.Ta)}};olympe.dm.xe.P=olympe.dc.Ca.C('01621fb84e3300000000',olympe.dm.xe);olympe.dm.xe.Ta=olympe.dm.xe.P.Da('01609de3f292e3c2c6ff');olympe.dm.xe.prototype.ha.K=new olympe.D.J(()=>olympe.D.qd,[]);olympe.dm.xe.prototype.Ab.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.xe{Pb(){return this.Fb(olympe.dm.BrickMetadata.bb)}Ud(){return this.Fb(olympe.dm.BrickMetadata.cb)}C(){return null}};olympe.dm.BrickMetadata.P=Kc(olympe.dc.Ca.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.bb=olympe.dm.BrickMetadata.P.Da('01621fb84e320000f001');olympe.dm.BrickMetadata.cb=olympe.dm.BrickMetadata.P.Da('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Vf=olympe.dm.BrickMetadata.P.Ra('0161ae97622bb21f335b');
722
- olympe.dm.BrickMetadata.Ab={pA:'private',pu:'public'};olympe.dm.BrickMetadata.Oc=Gc('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.rd={ez:'experimental',BA:'stable',Wy:'deprecated'};olympe.dm.BrickMetadata.prototype.Pb.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Ud.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Rb=class extends olympe.dm.BrickMetadata{R(){return new olympe.dc.Ba(this.T(),[new olympe.dc.X.Dc(olympe.dm.Rb.F.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.np,olympe.dc.X.nk.qt),olympe.dm.Rb.C])}C(){return null}F(){return this.tb(olympe.dm.Rb.F,olympe.dm.Rb)}Y(){return this.tb(olympe.dm.Rb.C)}};olympe.dm.Rb.P=olympe.dc.Ca.C('01612df1db9749227626',olympe.dm.Rb);olympe.dm.Rb.F=olympe.dm.Rb.P.Ra('016a697ef00ce7554691');olympe.dm.Rb.Pb=P(olympe.dm.Rb.P,olympe.dm.Rb.F);olympe.dm.Rb.C=olympe.dm.Rb.P.Ra('016a697ef00ce7554692');
723
- P(olympe.dc.CloudObject.P,olympe.dm.Rb.C);olympe.dm.Rb.prototype.R.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Rb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Rb.prototype.Y.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.od=class extends olympe.dm.Rb{F(){return this.T()===olympe.dm.od.Fa?this.tb(olympe.dm.od.R,olympe.dm.Rb):this.tb(olympe.dm.od.ha,olympe.dm.Rb)}};olympe.dm.od.P=olympe.dc.Ca.C('ff021000000000000020',olympe.dm.od);olympe.dm.od.ha=olympe.dm.od.P.Ra('017e9c34cf48bd6965c1');olympe.dm.od.R=olympe.dm.od.P.Ra('017e9c2e013e06bfffd9');olympe.dm.od.Fa=Gc('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.od.$c=Gc('10000000000000000001','OLYMPE_FOLDER');
724
- olympe.dm.od.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{uw(){return this.Fb(olympe.dm.Module.ha)}Gw(){return this.He(olympe.dm.Module.oa)}Lt(){return this.Fb(olympe.dm.Module.F)}Lw(){return this.Fb(olympe.dm.Module.Fa)}hw(){return this.Fb(olympe.dm.Module.L)}Hw(){return this.tb(olympe.dm.Module.R,olympe.dm.Module)}Ww(){return this.tb(olympe.dm.Module.C,olympe.dm.Id)}};olympe.dm.Module.P=olympe.dc.Ca.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ha=olympe.dm.Module.P.Da('ff023000000000000042');
725
- olympe.dm.Module.oa=olympe.dm.Module.P.Da('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.Da('ff023000000000000044');olympe.dm.Module.Fa=olympe.dm.Module.P.Da('ff023000000000000045');olympe.dm.Module.L=olympe.dm.Module.P.Da('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.Da('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.Ra('ff022000000000000013');olympe.dm.Module.R=olympe.dm.Module.P.Ra('ff022000000000000014');
726
- olympe.dm.Module.Ta=Gc('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.uw.K=olympe.D.J.F;m.Gw.K=olympe.D.J.G;m.Lt.K=olympe.D.J.F;m.Lw.K=olympe.D.J.F;m.hw.K=olympe.D.J.F;m.Hw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Ww.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}dn(){return this.Fb(olympe.dm.File.mimeTypeProp)}Ok(a,b){const c=olympe.D.Ia().C(a),d=b&&olympe.D.Ia().C(b);(a=this.db.gb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):xc(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}Ym(a,b){this.Ok(c=>{a(Ea(c))},b)}Pk(a,b){const c=olympe.D.Ia().C(a);b=b&&olympe.D.Ia().C(b);const d=this.db.gb(this,olympe.dm.File.C),
727
- e=this.db.gb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.gb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?xc(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Ia().C(b);olympe.D.bs([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.ib(f=>{c&&c(f)})})}Zx(){this.G.L(this.db.gb(this,olympe.dm.File.mimeTypeProp))}Ql(){return this.Fb(olympe.dm.File.urlProp)}up(){return this.Fb(olympe.dm.File.nameProp)}kw(){return this.gj(olympe.dm.File.creationDateProp)}Fw(){return this.gj(olympe.dm.File.modificationDateProp)}Tr(){return this.nh(olympe.dm.File.C)}static Gv(a,
728
- b,c,d,e,f){d=d||'application/data';c=olympe.W.bi().L(new Blob([c],{type:d}));return olympe.dm.File.Cr(a,b,c,d,e,f)}static Cr(a,b,c,d,e,f){const g=olympe.D.kb.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ka.qc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Cr;
729
- olympe.dm.File.createFromContent=olympe.dm.File.Gv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Zx;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Ym;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.P=olympe.dc.Ca.C('ff021000000000000030',olympe.dm.File,olympe.dc.O.vi,olympe.la.O.xa,olympe.W.O.xh);olympe.dm.File.nameProp=olympe.dm.File.P.Da('ff023000000000000050');
720
+ z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.P,olympe.dm.dd.C);olympe.dm.User.ka=olympe.dm.User.P.Ra('ff022000000000000002');olympe.dm.User.L=Fc('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Aw.K=olympe.D.J.F;m.na.K=olympe.D.J.F;m.dn.K=olympe.D.J.F;m.Ot.K=olympe.D.J.F;m.Nt.K=olympe.D.J.F;m.Zw.K=olympe.D.J.F;m.ix.K=olympe.D.J.F;m.Ww.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.xe=class extends olympe.dc.CloudObject{ka(){return this.$m()}Ab(){return this.Fb(olympe.dm.xe.Ta)}};olympe.dm.xe.P=olympe.dc.Ca.C('01621fb84e3300000000',olympe.dm.xe);olympe.dm.xe.Ta=olympe.dm.xe.P.Da('01609de3f292e3c2c6ff');olympe.dm.xe.prototype.ka.K=new olympe.D.J(()=>olympe.D.pd,[]);olympe.dm.xe.prototype.Ab.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.xe{Pb(){return this.Fb(olympe.dm.BrickMetadata.cb)}Td(){return this.Fb(olympe.dm.BrickMetadata.$a)}C(){return null}};olympe.dm.BrickMetadata.P=Jc(olympe.dc.Ca.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.cb=olympe.dm.BrickMetadata.P.Da('01621fb84e320000f001');olympe.dm.BrickMetadata.$a=olympe.dm.BrickMetadata.P.Da('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Vf=olympe.dm.BrickMetadata.P.Ra('0161ae97622bb21f335b');
721
+ olympe.dm.BrickMetadata.Ab={uA:'private',tu:'public'};olympe.dm.BrickMetadata.Pc=Fc('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.qd={jz:'experimental',FA:'stable',az:'deprecated'};olympe.dm.BrickMetadata.prototype.Pb.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Td.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Rb=class extends olympe.dm.BrickMetadata{R(){return new olympe.dc.Ba(this.T(),[new olympe.dc.X.Dc(olympe.dm.Rb.F.T(),olympe.dc.Aa.DESTINATION,olympe.dc.X.nk.rp,olympe.dc.X.nk.ut),olympe.dm.Rb.C])}C(){return null}F(){return this.tb(olympe.dm.Rb.F,olympe.dm.Rb)}Y(){return this.tb(olympe.dm.Rb.C)}};olympe.dm.Rb.P=olympe.dc.Ca.C('01612df1db9749227626',olympe.dm.Rb);olympe.dm.Rb.F=olympe.dm.Rb.P.Ra('016a697ef00ce7554691');olympe.dm.Rb.Pb=P(olympe.dm.Rb.P,olympe.dm.Rb.F);olympe.dm.Rb.C=olympe.dm.Rb.P.Ra('016a697ef00ce7554692');
722
+ P(olympe.dc.CloudObject.P,olympe.dm.Rb.C);olympe.dm.Rb.prototype.R.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Rb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Rb.prototype.Y.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.od=class extends olympe.dm.Rb{F(){return this.T()===olympe.dm.od.Fa?this.tb(olympe.dm.od.R,olympe.dm.Rb):this.tb(olympe.dm.od.ka,olympe.dm.Rb)}};olympe.dm.od.P=olympe.dc.Ca.C('ff021000000000000020',olympe.dm.od);olympe.dm.od.ka=olympe.dm.od.P.Ra('017e9c34cf48bd6965c1');olympe.dm.od.R=olympe.dm.od.P.Ra('017e9c2e013e06bfffd9');olympe.dm.od.Fa=Fc('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.od.Lc=Fc('10000000000000000001','OLYMPE_FOLDER');
723
+ olympe.dm.od.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{yw(){return this.Fb(olympe.dm.Module.ka)}Kw(){return this.He(olympe.dm.Module.qa)}Pt(){return this.Fb(olympe.dm.Module.F)}Pw(){return this.Fb(olympe.dm.Module.Fa)}lw(){return this.Fb(olympe.dm.Module.L)}Lw(){return this.tb(olympe.dm.Module.R,olympe.dm.Module)}$w(){return this.tb(olympe.dm.Module.C,olympe.dm.Id)}};olympe.dm.Module.P=olympe.dc.Ca.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ka=olympe.dm.Module.P.Da('ff023000000000000042');
724
+ olympe.dm.Module.qa=olympe.dm.Module.P.Da('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.Da('ff023000000000000044');olympe.dm.Module.Fa=olympe.dm.Module.P.Da('ff023000000000000045');olympe.dm.Module.L=olympe.dm.Module.P.Da('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.Da('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.Ra('ff022000000000000013');olympe.dm.Module.R=olympe.dm.Module.P.Ra('ff022000000000000014');
725
+ olympe.dm.Module.Ta=Fc('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.yw.K=olympe.D.J.F;m.Kw.K=olympe.D.J.G;m.Pt.K=olympe.D.J.F;m.Pw.K=olympe.D.J.F;m.lw.K=olympe.D.J.F;m.Lw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.$w.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}en(){return this.Fb(olympe.dm.File.mimeTypeProp)}Ok(a,b){const c=olympe.D.Ia().C(a),d=b&&olympe.D.Ia().C(b);(a=this.db.gb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):wc(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}Zm(a,b){this.Ok(c=>{a(Ea(c))},b)}Pk(a,b){const c=olympe.D.Ia().C(a);b=b&&olympe.D.Ia().C(b);const d=this.db.gb(this,olympe.dm.File.C),
726
+ e=this.db.gb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.gb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?wc(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Ia().C(b);olympe.D.ds([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.ib(f=>{c&&c(f)})})}ay(){this.G.L(this.db.gb(this,olympe.dm.File.mimeTypeProp))}Ql(){return this.Fb(olympe.dm.File.urlProp)}xp(){return this.Fb(olympe.dm.File.nameProp)}ow(){return this.gj(olympe.dm.File.creationDateProp)}Jw(){return this.gj(olympe.dm.File.modificationDateProp)}Wr(){return this.nh(olympe.dm.File.C)}static Kv(a,
727
+ b,c,d,e,f){d=d||'application/data';c=olympe.W.bi().L(new Blob([c],{type:d}));return olympe.dm.File.Fr(a,b,c,d,e,f)}static Fr(a,b,c,d,e,f){const g=olympe.D.kb.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ka.rc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Fr;
728
+ olympe.dm.File.createFromContent=olympe.dm.File.Kv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.ay;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Zm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.P=olympe.dc.Ca.C('ff021000000000000030',olympe.dm.File,olympe.dc.O.vi,olympe.la.O.xa,olympe.W.O.xh);olympe.dm.File.nameProp=olympe.dm.File.P.Da('ff023000000000000050');
730
729
  z('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.creationDateProp=olympe.dm.File.P.Da('ff023000000000000051');z('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.Da('ff023000000000000055');z('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.Da('ff023000000000000052');z('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);
731
- olympe.dm.File.urlProp=olympe.dm.File.P.Da('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.Da('ff023000000000000054');olympe.dm.File.ma=[olympe.D.File];m=olympe.dm.File.prototype;m.dn.K=olympe.D.J.F;m.Ok.K=new olympe.D.J(()=>{},[]);m.Ym.K=new olympe.D.J(()=>{},[]);m.Pk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Ql.K=olympe.D.J.F;m.up.K=olympe.D.J.F;m.kw.K=new olympe.D.J(()=>olympe.D.kb,[]);
732
- m.Fw.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Tr.K=olympe.D.J.R;olympe.dm.Id=class extends olympe.dc.CloudObject{C(){return this.Fb(olympe.dm.Id.F)}G(){return this.He(olympe.dm.Id.L)}F(){return this.tb(olympe.dm.Id.C,olympe.dm.Module)}};olympe.dm.Id.P=olympe.dc.Ca.C('ff021000000000000041',olympe.dm.Id);olympe.dm.Id.F=olympe.dm.Id.P.Da('ff023000000000000047');olympe.dm.Id.L=olympe.dm.Id.P.Da('ff023000000000000048');olympe.dm.Id.C=olympe.dm.Module.C.Rc();olympe.dm.Id.prototype.C.K=olympe.D.J.F;olympe.dm.Id.prototype.G.K=olympe.D.J.G;
733
- olympe.dm.Id.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Ob=class extends olympe.dm.od{F(){return this.tb(olympe.dm.Rb.F,olympe.dm.Rb)}L(){return this.Fb(olympe.dm.Ob.oa)}aa(){return this.Fb(olympe.dm.Ob.uc)}G(){return this.tb(olympe.dm.Ob.L,olympe.dm.Ob)}};olympe.dm.Ob.P=olympe.dc.Ca.C('0163d9594700fcf61e54',olympe.dm.Ob);olympe.dm.Ob.oa=olympe.dm.Ob.P.Da('017869c7d2833c9492c1');olympe.dm.Ob.uc=olympe.dm.Ob.P.Da('017869c80bb9929c76d0');olympe.dm.Ob.L=olympe.dm.Ob.P.Ra('ff02200000000000002b');olympe.dm.Ob.Pf=P(olympe.dm.Ob.P,olympe.dm.Ob.L);
734
- olympe.dm.Ob.cc=olympe.dm.Ob.P.Ra('ff02200000000000002a');olympe.dm.Ob.Ge=olympe.dm.Ob.P.Ra('017e9c412e2b944bd590');olympe.dm.Ob.th=olympe.dm.Ob.P.Ra('017e9c416872a89d3415');olympe.dm.Ob.Wf=olympe.dm.Ob.P.Ra('017ebf8fe5c506662098');P(olympe.dc.CloudObject.P,olympe.dm.Ob.cc);olympe.dm.Ob.ud=Gc('100000000000000000dd','PRIMORDIAL');olympe.dm.Ob.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Ob.prototype.L.K=olympe.D.J.F;olympe.dm.Ob.prototype.aa.K=olympe.D.J.F;
735
- olympe.dm.Ob.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.ed(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.ed(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}kd(){return this.F().pa().Ar(this.pa())}};olympe.dm.Property.P=olympe.dc.Ca.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
736
- olympe.dm.Property.typeRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Cw(){return olympe.D.Xa.EMPTY}fw(){return this.He(olympe.dm.Relation.Im)}Mw(){return this.He(olympe.dm.Relation.un)}Ir(){return this.tb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Qc()}Nr(){return this.tb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Qc()}kd(){return this.Nr().pa().concat(['-',this.pa(),'->',this.Ir().pa()])}};olympe.dm.Relation.P=olympe.dc.Ca.C('ff021000000000000006',olympe.dm.Relation);
737
- olympe.dm.Relation.un=olympe.dm.Relation.P.Da('ff023000000000000030');olympe.dm.Relation.Im=olympe.dm.Relation.P.Da('ff023000000000000034');olympe.dm.Relation.Sm=olympe.dm.Relation.P.Da('ff023000000000000037');olympe.dm.Relation.Rm=olympe.dm.Relation.P.Da('ff023000000000000137');olympe.dm.Relation.fl=olympe.dm.Relation.P.Da('ff023000000000000237');olympe.dm.Relation.ks=olympe.dm.Relation.P.Da('ff023000000000000337');olympe.dm.Relation.wv=olympe.dm.Relation.P.Da('ff023000000000000031');
738
- olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.Y);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Ub={NONE:null,Zy:olympe.dm.Relation.Sm.T(),Hc:olympe.dm.Relation.Rm.T(),rf:olympe.dm.Relation.fl.T(),AA:olympe.dm.Relation.ks.T()};
739
- olympe.dc.Ub.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ub))if(c===a)return b;return null};olympe.dm.Relation.C={hp:0,ql:5,uq:1,Fu:4,yk:2,mk:8,Bo:10,Bu:6,Cu:9,qc:6,Eu:9};olympe.dm.Relation.F={iu:3,am:4,au:5,Wl:6};olympe.dm.Relation.L=olympe.dm.Tc.Zp+olympe.dm.Tc.uo;m=olympe.dm.Relation.prototype;m.Cw.K=olympe.D.J.F;m.fw.K=olympe.D.J.G;m.Mw.K=olympe.D.J.G;m.Ir.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Nr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.qf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.qf.P=olympe.dc.Ca.C('ff021000000000000019',olympe.dm.qf);olympe.dm.String=class extends olympe.dm.qf{getValue(){return this.Fb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.P=olympe.dc.Ca.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.Da('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.qf{getValue(){return this.nh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.Ca.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.Da('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.R;olympe.dm.Color=class extends olympe.dm.qf{getValue(){return this.Pr()}};olympe.dm.Color.P=olympe.dc.Ca.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.Da('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.qf{getValue(){return this.gj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.Ca.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.Da('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.kb,[]);olympe.dm.Enum=class extends olympe.dm.String{pa(){return olympe.D.Ga([super.pa(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Xa)}he(){return this.He(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Pa();e=void 0!==e?e:f.Gb(b)&&f.ge(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
740
- olympe.dm.Enum.P=olympe.dc.Ca.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.Da('017a7690c915975ea995');olympe.dm.Enum.prototype.he.K=olympe.D.J.G;olympe.dm.gg=class extends olympe.dm.BrickMetadata{dx(){return this.tb(olympe.dc.CloudObject.instancesRel,olympe.dm.Enum)}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.gg.create=olympe.dm.gg.create;olympe.dm.gg.prototype.getValues=olympe.dm.gg.prototype.dx;olympe.dm.gg.P=olympe.dc.Ca.C('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.qf{getValue(){return this.He(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.Ca.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.Da('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.$a={};olympe.$a.$g=class{constructor(a){this.N=a;this.Y=new olympe.D.Zb(`${this.Z()} source context`);this.R=this.C=null}Z(){}L(){}close(){this.R&&this.R(this.Z(),olympe.dc.tk.ut);this.Y.destroy()}};function fh(a){olympe.D.yc([mc(a.oa)],b=>{if(b.valueOf()){const c=a.G.keys();gh(a,d=>{if(d)a.N.error('An error occurred while auto synchronising:\n'+d.message);else if(a.N.debug('Auto synchronise transactions successfully'),a.aa)for(const e of c)bc(a.F,f=>{a.N.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
741
- function hh(a){let b;olympe.D.yc([mc(a.oa)],c=>{c.valueOf()?(a.aa=!1,b&&(Lb(b),b=null)):(a.aa=!0,b=Kb(()=>{if(a.ha){a.ha=!1;for(const d of a.G.keys())$b(a.F,d,a.G.get(d),()=>{},e=>{a.N.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
742
- function gh(a,b){const c=olympe.async.sk.create(),d=c.G;c.add((e,f)=>{a.F.storage.L(f)});c.add((e,f,g)=>{const h=olympe.dc.Ka.rb,k=g.get('files'),l=new olympe.async.ng(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Fa.Y(p);null!==q?(l.add(a.Ta.bind(a,n,q,k)),a.F.storage.C(void 0)):f(`The source: ${p} is not reachable.`)}});Xb(l,(n,p)=>{n?e():f(p||void 0)});l.start()});Xb(c,(e,f)=>{b(e?null:Error(f));e&&(a.ha=!1,a.G.clear())});c.start()}
743
- function ih(a,b){const c=new olympe.async.sk(olympe.D.Ia());c.add((d,e)=>{ac(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Dd();a.G.forEach((f,g)=>{const h=Array.from(f.ge()).map(k=>k.tag());Lc(e,olympe.D.Ia(),f,h,[],g)(!0)});d()});Xb(c,(d,e)=>{b(e?Error(e):null)});c.start()}
744
- olympe.$a.Ei=class extends olympe.$a.$g{constructor(a,b,c,d,e){super(a);this.G=new Map;this.oa=c;this.F=d;this.Fa=b;this.ha=this.aa=!1;e.get('syncTimeout');e.get('autoSync')&&fh(this);e.get('autoPersist')&&hh(this)}Ta(a,b,c,d,e){const f=olympe.dc.ga.ka.xk,g=olympe.dc.ga.ka.yl,h=new olympe.dc.db.zc,k=new olympe.async.ng(olympe.D.Ia()),l=(n,p,q)=>{const r=n.tag(),t=n.gb(olympe.dm.File.mimeTypeProp.T());dc(this.F,v=>{uc(olympe.dc.vw(),r,v,t,u=>{n.Da(olympe.dm.File.urlProp.T(),u);const w=new Map;w.set(olympe.dm.File.urlProp.T(),
745
- u);h.pc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.If(n))&&c.te()&&k.add(l.bind(this,c));Xb(k,(n,p)=>{n?(n=M(new olympe.dc.ga(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.ge()).map(r=>r.tag()),olympe.dc.Dd().persist(q),d())}),b.L(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ka.rb}L(a){var b=olympe.dc.ga.ka.bh,c=olympe.dc.ga.ka.Og;const d=olympe.dc.ga.ka.xi,e=olympe.dc.ga.ka.wi,f=olympe.dc.ga.ka.Rg,g=olympe.dc.ga.ka.Hl,h=olympe.dc.ga.ka.Sh,
746
- k=olympe.dc.ga.ka.ti,l=olympe.dc.ga.ka.Ah;var n=olympe.dc.ga.ka.Pj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F(void 0);ih(this,u=>{null!==u&&this.N.error(`Could not load transactions: ${u.message}`)});break;case b:case c:const q=a.content;a.C.forEach(u=>{let w=this.G.get(u);void 0===w&&(w=new olympe.dc.db.zc,this.G.set(u,w));q.Zc(w);this.aa&&(this.ha=!0)});a.validate(null);a=olympe.dc.transaction.rg.C.Pp;this.C(olympe.dc.Ka.rb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=
747
- a.C[0],t=a.content;a.validate(null);Zb(this.F,t.Z(),u=>{this.N.warn('No graphresult for subscription : '+t.Z(),u,'\n',t.ph.toJSON());this.N.warn();this.C(r,g,new olympe.dc.query.zi(t.Z(),r,olympe.dc.Ka.rb,new olympe.dc.db.zc))});break;case h:case l:case k:n=a.content;b=n.file;const v=n.Ze;c=n.ue;p===h?cc(this.F,b,n.content,n.mimeType,v,c):p===l?dc(this.F,u=>{v(u)}):this.F.storage.C(c);a.validate(null)}}};olympe.$a.Ei.C='context';const jh=olympe.dc.ga.ka.mm,kh=olympe.dc.ga.ka.om,lh=olympe.dc.ga.ka.QUERY_RESULT,mh=olympe.dc.ga.ka.nm,nh=olympe.dc.ga.ka.bh,oh=olympe.dc.ga.ka.xk,ph=olympe.dc.ga.ka.Pj,qh=olympe.dc.ga.ka.Og,rh=olympe.dc.ga.ka.Fj,sh=olympe.dc.ga.ka.Sn,th=olympe.dc.ga.ka.Sh,uh=olympe.dc.ga.ka.Ah,vh=olympe.dc.ga.ka.ti,wh=olympe.dc.ga.ka.nf;
748
- function xh(a,b,c,d,e){const f=c.Z();c={t:jh,q:c.ja()};olympe.H.ya.pb.Bb.get(b,c).then(g=>{g.t===lh?(d(null),a.C(b,e||lh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function yh(a,b,c,d,e){const f=c.Z();xh(a,b,c,g=>{if(g)e(g);else{zh(a,b,f);g={t:kh,q:c.ja()};var h=olympe.H.ya.pb.Bb.observe(b,d,g).subscribe(k=>{const l=k.t;l===mh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.xc(()=>h.unsubscribe())}},mh)}
749
- function Ah(a,b,c,d){const e=c.Gc;c=new olympe.dc.transaction.Md;e.Zc(c);c={t:nh,i:e.Z(),p:ce(c)};olympe.H.ya.pb.Bb.send(b,c).then(()=>{d(null);a.C(b,ph,{id:e.Z(),finalize:olympe.dc.transaction.rg.C.Op})}).catch(f=>d(Error(f)))}function Bh(a,b,c,d,e){var f=c.Gc;c=f.Z();const g=new olympe.dc.transaction.Md;f.Zc(g);f={t:qh,i:c,p:ce(g)};olympe.H.ya.pb.Bb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Ch(a,c,b,d)}
750
- function zh(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.ya.pb.Bb.send(h,{t:wh,s:Array.from(g)}).catch(k=>a.N.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.aa)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
751
- function Ch(a,b,c,d){const e=new olympe.H.ya.pb.Bb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===rh){a.N.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.zc;a.C(c,rh,{id:b,rollback:g,error:f.r})}});d.xc(()=>e.stop())}
752
- olympe.$a.tu=class extends olympe.$a.$g{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.aa=c}Z(){return olympe.dc.Ka.eq}L(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case jh:xh(this,b,e,d);break;case kh:yh(this,b,e,a,d);break;case nh:case oh:Ah(this,b,e,d);break;case qh:Bh(this,b,e,a,d);break;case sh:e.t=c;olympe.H.ya.pb.Bb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case th:case uh:case vh:olympe.H.ya.pb.Bb.get(b,{t:c,f:e.file}).then(f=>{this.G.ha(e.file,
753
- b,f);c===th?this.G.Y(e.file,e.content,e.mimeType,e.Ze,e.ue):c===uh?this.G.R(e.file,e.url,e.mimeType,e.Ze,e.ue):this.G.L(e.file,e.Ze,e.ue)}).catch(e.ue);break;default:this.N.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.$a.Buffer=class{constructor(){this.counter=0;this.Kb=new Map}buffer(a){const b=this.counter++;this.Kb.set(b,a);return this.clear.bind(this,b)}clear(a){this.Kb.delete(a)}};olympe.$a.pg=class a{constructor(b,c,d){this.N=b;this.aa=c;this.R=new olympe.$a.Buffer(this);this.L=new Map;this.G=this.Pb(d);new olympe.D.Zb('Data Router context');this.F=new Map;this.ha=new Map;this.bb()}bb(){this.N.info('Initializing DR layer');olympe.D.Tk(mc(this.aa),()=>{this.N.info('Router: ONLINE')},()=>{this.N.log('Router: OFFLINE (no auth layer not online)');for(const b of this.R.Kb.values())this.Fa(b)});this.N.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
754
- this.R.buffer(b));this.Fa(b)}C(b,c){const d=olympe.W.hc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}oa(b){this.ha.set(olympe.W.xg(),b)}Ab(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Tb(b,c){this.L.set(b,c);c.C=this.Ab.bind(this);c.R=this.Ta.bind(this)}Y(b){return this.L.get(b)||this.L.get(olympe.dc.Ka.eq)}Ta(b,c){this.ha.forEach(d=>{d(b,c)})}Fa(b){this.N.debug('Processing message',b.toString());this.cb(b).forEach(c=>{(c=this.Y(c))&&c.L(b)})}cb(b){var c=olympe.dc.ga.ka.Rg,
755
- d=olympe.dc.ga.ka.wi,e=olympe.dc.ga.ka.xi,f=olympe.dc.ga.ka.bh,g=olympe.dc.ga.ka.Og;const h=olympe.dc.ga.ka.Sh,k=olympe.dc.ga.ka.ti,l=olympe.dc.ga.ka.Ah;switch(b.type){case c:d=this.G.get(a.C.Rg)||[];break;case d:case e:d=this.G.get(a.C.lm)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.ct)||[];break;default:d=[]}c=b.content;e=olympe.auth.va.C.Lg;f=olympe.auth.va.C.Dh;g=lc(this.aa);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
756
- g===a.F.$l&&e||g===a.F.fp&&d.get('id')===f||g===a.F.qc)return n=n.get('destinations'),this.N.debug('Message',b.toString(),'is redirect to',n),n;this.N.debug('Message',b.toString(),'not redirect');return b.C}Pb(b){const c=Object.values(olympe.$a.pg.C),d=Object.values(olympe.$a.pg.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
757
- l).set('destinations',n),h.push(n),l===a.F.fp&&n.set('id',k.id)):this.N.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.N.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.N.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.N.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.$a.pg.C={Rg:'getContext',lm:'query',TRANSACTION:'transaction',ct:'file'};
758
- olympe.$a.pg.F={qc:'default',$l:'offline',fp:'id'};olympe.$a.pg.ma=[olympe.dc.pg];olympe.$a.Qj=class{ha(){}Y(){}R(){}L(){}};olympe.$a.O={xa:'dr.Manager',Ea:'dr.Logger',oe:'dr.sources.Router',Ap:'dr.sources.Local',sm:'dr.sources.Server',gq:'dr.sources.Peer',Qg:'dr.sources.FileSource'};olympe.$a.Config={Vl:'dr.keepAliveTimeout',Kn:'dr.autoSync',Jn:'dr.autoPersist',Oq:'dr.syncTimeout',Aq:'dr.routing'};
759
- olympe.U.config(function(a){E(a,olympe.$a.Config.Aq,{});E(a,olympe.$a.Config.Vl,3E5);E(a,olympe.$a.Config.Kn,!1);E(a,olympe.$a.Config.Jn,!1);E(a,olympe.$a.Config.Oq,3E4);C(a,olympe.$a.O.Ea,[olympe.sa.O.xa],b=>b.Pc('dr'));C(a,olympe.$a.O.Ap,[olympe.$a.O.Ea,olympe.$a.O.oe,olympe.auth.O.xa,olympe.ic.O.oo,new olympe.U.fa(olympe.$a.Config.Kn),new olympe.U.fa(olympe.$a.Config.Jn),new olympe.U.fa(olympe.$a.Config.Oq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
760
- h);return new olympe.$a.Ei(b,c,d,e,f)});ta(a,olympe.$a.O.sm);B(a,olympe.$a.O.gq,olympe.$a.tu,olympe.$a.O.Ea,olympe.$a.O.Qg,new olympe.U.fa(olympe.$a.Config.Vl));ta(a,olympe.$a.O.Qg);B(a,olympe.$a.O.oe,olympe.$a.pg,olympe.$a.O.Ea,olympe.auth.O.xa,new olympe.U.fa(olympe.$a.Config.Aq));sa(a,olympe.dc.O.oe,olympe.$a.O.oe);C(a,olympe.dc.query.Nb.ak,[olympe.dc.query.Nb.ak],b=>new olympe.dc.km(b))},'olympe.dr');
761
- olympe.U.run([olympe.$a.O.oe,olympe.$a.O.Ap,olympe.$a.O.sm,olympe.$a.O.gq],(a,...b)=>{b.forEach(c=>a.Tb(c.Z(),c))});olympe.H={};olympe.H.Jc={zh:1,dg:2,rc:3,pf:4,Hs:5,Ai:6,mA:7};olympe.H.ka={Ai:1,av:2,bt:3,nf:5};olympe.H.va=class{Fa(){}connect(){}disconnect(){}th(){}uh(){}G(){}Qd(){}ud(){}Ta(){}Of(){}Zr(){}cs(){}};olympe.H.va.C={INIT:'initialize',CONNECTING:'connecting',gf:'disconnected',yh:'connected',rc:'error'};olympe.H.va.G={Kh:1,it:-1,vt:-2,Uu:-3};function Dh(a,b){const c=a.G.get(b)||a.Ta;a.G.delete(b);return`${c}/${b}`}
762
- olympe.H.Qj=class{constructor(a,b,c,d,e){this.N=a;this.F=b;this.oa=c;this.Ta=d;this.bb=e;this.C=new Map;this.G=new Map;this.aa=new Map;this.Fa=new olympe.D.Zb('File manager context')}ha(a,b,c){b&&this.G.set(a,`${this.bb}/${b}`);c&&this.aa.set(a,c)}Y(a,b,c,d,e){const f=Pb(Dh(this,a),olympe.la.fb.de.ik,b,olympe.la.fb.ResponseType.pl);Qb(f,{[olympe.la.fb.Headers.pi]:this.hd(a),[olympe.la.fb.Headers.Hj]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Ud();g===olympe.la.fb.rd.Kh||g===olympe.la.fb.rd.vl?
763
- (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.N.error(g),e(g))})}R(a,b,c,d,e){const f=olympe.D.Ia();d={Ze:f.C(d),ue:e&&f.C(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Pb(Dh(this,a));Qb(g,{[olympe.la.fb.Headers.pi]:this.hd(a)})}else g=Pb(b);g.F=olympe.la.fb.ResponseType.pl;Qb(g,{[olympe.la.fb.Headers.Hj]:c||'application/octet-stream'});this.Fa.run(()=>{this.F.C(g,h=>{const k=h.Ud(),l=this.C.get(a);if(200<=k&&300>
764
- k){const n=h.getData();l&&l.forEach(p=>{if(f.zb()){const q=f.Tb(),r=f.Z();this.N.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ze(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.ue&&p.ue(n)})}this.C.delete(a)})})}}L(a,b,c){const d=Pb(Dh(this,a),olympe.la.fb.de.Hc);Qb(d,{[olympe.la.fb.Headers.pi]:this.hd(a)});this.F.C(d,e=>{e=e.Ud();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.N.error(e),
765
- c&&c(e))})}hd(a){const b=this.aa.get(a);b&&this.aa.delete(a);return b||olympe.D.Ya(oc(this.oa))}};olympe.H.Qj.ma=[olympe.$a.Qj];const Eh=olympe.dc.ga.ka.Rg,Fh=olympe.dc.ga.ka.bh,Gh=olympe.dc.ga.ka.xk,Hh=olympe.dc.ga.ka.Og,Ih=olympe.dc.ga.ka.wi,Jh=olympe.dc.ga.ka.xi,Kh=olympe.dc.ga.ka.To,Lh=olympe.dc.ga.ka.Uo,Mh=olympe.dc.ga.ka.Hl,Nh=olympe.dc.ga.ka.ti,Oh=olympe.dc.ga.ka.Ah,Ph=olympe.dc.ga.ka.Sh,Qh=olympe.dc.ga.ka.Pj,Rh=olympe.dc.ga.ka.$u,Sh=olympe.dc.ga.ka.Au,Th=olympe.dc.ga.ka.jt,Uh=olympe.dc.ga.ka.Sn,Vh=olympe.dc.ga.ka.Es;
766
- function Wh(a){a.F.Ta(olympe.H.Jc.zh,a.bb.bind(a));olympe.D.yc([mc(a.oa)],b=>{b=b.valueOf()?olympe.dc.tk.Vp:olympe.dc.tk.$l;a.R&&a.R(a.Z(),b)},'Server source is online')}function Xh(a,b,c){const d=b.Gc;b=new olympe.dc.transaction.Md(!0);d.Zc(b);Yh(a,a.Ab,Fh,!0,ce(b),e=>{c&&c(e);a.C(a.Z(),Qh,{id:d.Z(),finalize:olympe.dc.transaction.rg.C.Op})})}
767
- function Zh(a,b,c,d){const e=c.Z();a.N.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Ol?a.cb:a.Fa,g=(new olympe.H.$.Sj).ja(c);c=new olympe.async.ng(a.Y);b===Jh&&c.add((k,l)=>{a.G.set(e,{notification:null,Qx:a.Y.C(n=>n?l(n):k())});$h(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ia();c.add((k,l)=>{h.run(()=>{Yh(a,f,Ih,!1,g,a.Y.C(n=>n?l(n.message):k()))})});Xb(c,(k,l)=>{const n=a.G.get(e);k&&n&&n.notification?a.C(a.Z(),Lh,n.notification):!k&&n&&ai(a,Kh,e,p=>p&&a.N.warn(p));
768
- a.G.delete(e);k&&b===Jh&&a.F.Zr(e);d(l?Error(l):null)});c.start()}function ai(a,b,c,d){a.N.log('Unsubscribe to: ',c);a.F.cs(c);$h(a,b,{i:c},d)}function $h(a,b,c,d){b={c:b};Object.assign(b,c);a.F.G(olympe.H.Jc.zh,b,d&&(e=>{d(e)}))}function Yh(a,b,c,d,e,f){if(a.F.Fa()){const g=olympe.H.Jc.zh;!d&&e&&Object.assign(e,{c});c=olympe.D.Ya(oc(a.oa)).valueOf();a.F.Qd(b,g,c,d,e,f)}else a.N.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
769
- olympe.H.$g=class extends olympe.$a.$g{constructor(a,b,c,d,e){super(a);this.F=b;this.oa=c;new olympe.H.$.hb;this.aa=new olympe.dc.W.Hi(this.Z());this.ha=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Ta=e[0];this.cb=e[1];this.Fa=e[2];this.Ab=e[3];this.G=new Map;Wh(this)}Z(){return olympe.dc.Ka.Wc}L(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Eh:Yh(this,
770
- this.Ta,olympe.dc.ga.ka.Rg,!1,null,c);break;case Hh:b=new olympe.dc.transaction.Md;var d=a.Gc;a=a.rh;d.Zc(b);$h(this,olympe.dc.ga.ka.Og,{i:d.Z(),r:a,p:ce(b)});c(null);break;case Fh:b=new olympe.dc.transaction.Md;d=a.Gc;a=a.rh;d.Zc(b);$h(this,olympe.dc.ga.ka.bh,{i:d.Z(),r:a,p:ce(b)},c);break;case Gh:Xh(this,a,c);break;case Ih:case Jh:Zh(this,b,a,c);break;case Kh:ai(this,b,a,c);break;case Rh:$h(this,Rh,{},c);break;case Sh:$h(this,Sh,{},c);break;case Th:$h(this,Th,{},c);break;case Uh:$h(this,Uh,a,c);
771
- break;case Vh:$h(this,Vh,{},c);break;case Oh:this.ha.R(a.file,a.url,a.mimeType,a.Ze,a.ue);break;case Nh:this.ha.L(a.file,a.Ze,a.ue);break;case Ph:this.ha.Y(a.file,a.content,a.mimeType,a.Ze,a.ue);break;default:this.N.info(`Message of type ${b} not supported yet`)}}bb(a){var b=olympe.dc.ga.ka.yl,c=olympe.dc.ga.ka.Fj;const d=olympe.dc.ga.ka.ek,e=olympe.dc.ga.ka.Mu,f=olympe.dc.ga.ka.xp;var g=olympe.dc.ga.ka.kt;const h=a.c;h===b?(a=this.aa.C(a.p),this.C(this.Z(),b,a)):h===c?(g=a.error.reason,b=this.aa.C(a.p),
772
- this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Mh?(g=olympe.dc.Ka.rb,c=olympe.dc.Ka.Wc,b=a.i,0<a.s?g=new olympe.dc.query.Xi.Uj(b,c,g,a.info.error.reason):(g=this.aa.R(b,g,a.p),this.N.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.N.log('< Graphdef Result (ID ',g.Z(),') with',g.Gc.G(),'operations')),this.C(this.Z(),Mh,g)):h===Lh?(g=a.i,a=this.aa.L(g,a.p),this.G.has(g)?(g=this.G.get(g),g.notification?lf(a,g.notification):g.notification=a):this.C(this.Z(),Lh,a)):h===f?(g=new olympe.dc.query.Ep(a.i),
773
- a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.rg.C.ek,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),Qh,{id:a.i,finalize:g,error:c})):h===e?(g=this.G.get(a.i))&&g.Qx(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Z(),g,{KC:c,dD:b,ZC:a}))}};olympe.H.$g.F={Sz:1,UA:2};olympe.H.$g.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.Wj=class{constructor(){}};olympe.H.Wj.ma=[olympe.dc.ba.Wj];olympe.H.ya={};function bi(a,b,c){Ub(a.C,b,d=>{d=new olympe.H.ya.Kb.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);return c(d)})}function ci(a,b,c){a.L.set(b,c)}function di(a,b){return new Promise((c,d)=>{Vb(a.C,b,e=>e?d(e):c())})}function ei(a,b){return new Promise((c,d)=>{a.R.oh(b.hd(),(e,f)=>e?d(e):c(f))})}
774
- olympe.H.ya.va=class{constructor(a,b,c,d){this.N=a;this.R=c;a=new olympe.W.Yq(d.get('messageTimeout'));a.C=this.Y.bind(this);this.L=a;a=d.get('url');d=d.get('connectionOptions');this.C=new olympe.la.dk(a,d);this.G=1;this.F=olympe.W.hc()}connect(){return new Promise(a=>{Tb(this.C)?a():this.C.connect(()=>{Ub(this.C,this.F,b=>{b=new olympe.H.ya.Kb.Response(b.dest,b.src,b.seq,b.type,b.content);const c=this.L.get(b.G);c&&(this.L.delete(b.G),c(b))});a()})})}disconnect(){return new Promise(a=>this.C.end(!1,
775
- ()=>a()))}Ke(a,b,c){return new Promise((d,e)=>{const f=a.source,g=new olympe.H.ya.Kb.Response(f,this.F,a.G,b,c);this.C.publish(f,g.ja(),void 0,h=>h?e(h):d())})}request(a,b,c){return new Promise((d,e)=>{const f=this.G;this.G++;var g=olympe.D.Ya(oc(this.R));g=new olympe.H.ya.Kb.Request(a,this.F,g,f,b,c);this.C.publish(a,g.ja(),void 0,h=>h?e(h):d(f))})}notify(a,b,c){return new Promise((d,e)=>{var f=this.G;this.G++;f=new olympe.H.ya.Kb.Response(b,a,f,olympe.H.ya.Kb.Response.ka.vm,c);this.C.publish(b,
776
- f.ja(),void 0,g=>g?e(g):d())})}Y(a,b){b(new olympe.H.ya.Kb.Response(this.F,this.F,a,olympe.H.ya.Kb.Response.ka.rc,{reason:'Timeout'}))}};olympe.H.ya.Kb={};olympe.H.ya.Kb.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.L=c;this.C=e;this.F=f||null}hd(){return this.L}ja(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.L,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.ya.Kb.Request.ka={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.ya.Kb.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}ja(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};olympe.H.ya.Kb.Response.ka={vm:0,En:1,Vq:2,rc:3};olympe.H.ya.pb={};const fi=olympe.H.ya.Kb.Response.ka.En,gi=olympe.H.ya.Kb.Response.ka.rc,hi=olympe.H.ya.Kb.Response.ka.vm,ii=olympe.H.ya.Kb.Response.ka.Vq,ji=olympe.H.ya.Kb.Request.ka.SEND,ki=olympe.H.ya.Kb.Request.ka.GET,li=olympe.H.ya.Kb.Request.ka.PUBLISH,mi=olympe.H.ya.Kb.Request.ka.SUBSCRIBE;
777
- olympe.H.ya.pb.Bb=class{constructor(a,b){this.C=olympe.H.ya.Sc();this.F=a;this.G=new olympe.D.Zb(`Service ${a}`,'function'===typeof b.Fc?b.Fc():b);this.N=olympe.sa.Za(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();di(this.C,this.F).catch(c=>this.N.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{bi(this.C,this.F,c=>a.next(new olympe.H.ya.pb.ga(c,this.C)))}).catch(c=>this.N.error('Failed to connect to the bus: '+
778
- c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.ya.Sc();return c.connect().then(()=>c.request(a,li,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.ya.Sc();e.connect().then(()=>e.request(a,ji,b)).then(f=>{ci(e,f,g=>{switch(g.F){case fi:c();break;case gi:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.ya.Sc();e.connect().then(()=>
779
- e.request(a,ki,b)).then(f=>{ci(e,f,g=>{switch(g.F){case hi:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case gi:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.Fc?b.Fc():b;return new rxjs.Observable(e=>{const f=olympe.H.ya.Sc();let g=null;const h=()=>{e.complete();g&&di(f,g).catch(k=>olympe.sa.Za('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.xc(h);f.connect().then(()=>
780
- f.request(a,mi,c)).then(k=>{ci(f,k,l=>{switch(l.F){case ii:g=l.C.topic;bi(f,g,n=>{switch(n.C){case li:e.next(n.F);break;default:e.error('Unsupported notification message. It should be a publish'),h()}});break;case gi:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.ya.pb.Bb.observe=olympe.H.ya.pb.Bb.observe;olympe.H.ya.pb.Bb.get=olympe.H.ya.pb.Bb.get;olympe.H.ya.pb.Bb.send=olympe.H.ya.pb.Bb.send;
781
- olympe.H.ya.pb.Bb.publish=olympe.H.ya.pb.Bb.publish;olympe.H.ya.pb.Bb.prototype.stop=olympe.H.ya.pb.Bb.prototype.stop;olympe.H.ya.pb.Bb.prototype.listen=olympe.H.ya.pb.Bb.prototype.listen;const ni=olympe.H.ya.Kb.Response.ka.En,oi=olympe.H.ya.Kb.Response.ka.rc,pi=olympe.H.ya.Kb.Response.ka.vm,qi=olympe.H.ya.Kb.Response.ka.Vq,ri=olympe.H.ya.Kb.Request.ka.SEND,si=olympe.H.ya.Kb.Request.ka.GET,ti=olympe.H.ya.Kb.Request.ka.SUBSCRIBE;
782
- olympe.H.ya.pb.ga=class{constructor(a,b){this.request=a;this.C=b}yj(){return ei(this.C,this.request)}source(){return this.request.source}body(){return this.request.F}Hk(){return this.request.C===ri?this.C.Ke(this.request,ni,void 0):Promise.reject('Should only call `ack` on SEND requests')}Ke(a){return this.request.C===si?this.C.Ke(this.request,pi,a):Promise.reject('Should only call `reply` on GET requests')}Yr(a){return this.request.C===ti?this.C.Ke(this.request,qi,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}wg(a){return this.C.Ke(this.request,
783
- oi,{reason:a.message})}};olympe.H.ya.pb.ga.prototype.fail=olympe.H.ya.pb.ga.prototype.wg;olympe.H.ya.pb.ga.prototype.notifyOn=olympe.H.ya.pb.ga.prototype.Yr;olympe.H.ya.pb.ga.prototype.reply=olympe.H.ya.pb.ga.prototype.Ke;olympe.H.ya.pb.ga.prototype.ack=olympe.H.ya.pb.ga.prototype.Hk;olympe.H.ya.pb.ga.prototype.body=olympe.H.ya.pb.ga.prototype.body;olympe.H.ya.pb.ga.prototype.source=olympe.H.ya.pb.ga.prototype.source;olympe.H.ya.pb.ga.prototype.userTag=olympe.H.ya.pb.ga.prototype.yj;olympe.H.qa={};function ui(a,b,c,d){c.c=b;a.C.G(olympe.H.Jc.pf,c,d)}
784
- olympe.H.qa.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.N=a;this.C=b;this.F=h;this.bb=c;this.G=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.pk.C.GET))}),l.close())}R(a){this.C.th(a)}L(a){this.C.uh(a)}Ta(a){this.C.Of(olympe.H.Jc.pf,'logoutHandler');this.C.Ta(olympe.H.Jc.pf,b=>{const c=b.c;c===olympe.H.qa.Ua.C.Vt?(this.C.ud(),a(olympe.auth.va.F.zj,b)):c===olympe.H.qa.Ua.C.Gu&&a(olympe.auth.va.F.gp,
785
- b)},'logoutHandler')}Y(a,b){ui(this,olympe.H.qa.Ua.C.pf,{token:a.Jf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.Ua.C.rc:b(Error('Invalid token'));break;case olympe.H.qa.Ua.C.Oi:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.Cq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.fm(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}oa(a,b){ui(this,olympe.H.qa.Ua.C.pt,
786
- {I:a.Vd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.Ua.C.rc:b(Error(`Username '${a.Vd()}' invalid, or password does not match`));break;case olympe.H.qa.Ua.C.Ou:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Fa(a,b){ui(this,olympe.H.qa.Ua.C.ts,{A:a.get('a'),M:a.get('m1'),I:a.Vd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.qa.Ua.C.rc:this.N.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
787
- break;case olympe.H.qa.Ua.C.Oi:c=d.payload;this.N.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.tf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}ha(a){ui(this,olympe.H.qa.Ua.C.Re,{},(b,c)=>{null!==b?a(b):c.url&&c.request?a(null,c.url,c.request.replace(/\s/g,''),c.id):a(Error('Missing parameters from server response'))})}aa(a){const b=olympe.D.Ya(olympe.auth.Sc().C.Eb())||null;if(b instanceof
788
- olympe.auth.fm){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Jf();f.access_token=b.Yj().access_token||null;this.F.redirect(`${this.G}/logout`,f)};a=this.F.C();const d=new URL(a);if(0!==d.hash.length||0!==d.search.length){const e=this.storage.C('AUTH');d.hash='';d.search='';e&&e.set('redirectTo',a,()=>{e.close();c(d.toString())})}else c(a)}else this.C.G(olympe.H.Jc.pf,{c:olympe.H.qa.Ua.C.Wt},a)}ii(a){this.C.G(olympe.H.Jc.pf,{c:olympe.H.qa.Ua.C.nf},a)}oh(a,b,c){this.C.Qd(this.bb+
789
- '/'+a,olympe.H.Jc.pf,b,!1,null,(d,e)=>{c(d,e)})}Mr(){return this.G}};olympe.H.qa.Ua.C={pf:1,Wt:2,rc:3,nf:5,Oi:6,pt:10,Ou:11,ts:12,Re:13,Gu:14,Vt:20};olympe.H.qa.Ua.ma=[olympe.auth.Qu,olympe.auth.Hb.qa.Fi,olympe.auth.Hb.qa.Ee,olympe.auth.Hb.qa.Re];olympe.H.$={};olympe.H.$.Yc=function(){};olympe.H.$.Yc.prototype.ja=function(){};olympe.H.$.Ne=function(){};olympe.H.$.Ne.prototype.ja=function(){};olympe.H.$.ab=function(){};olympe.H.$.ab.prototype.ja=function(){};olympe.H.$.wf=function(){};olympe.H.$.wf.prototype.ja=function(){};olympe.H.$.hb=function(){this.X={};this.Db={};this.V={};this.na=Object.create(null);var a=new olympe.H.$.X.Sb;this.X[O(olympe.dc.X.Sb)]=a;a=new olympe.H.$.X.Be;this.X[O(olympe.dc.X.Be)]=a;a=new olympe.H.$.X.Dc;this.X[O(olympe.dc.X.Dc)]=a;this.X[O(olympe.dc.X.Od)]=new olympe.H.$.X.Od;this.X[O(olympe.dc.X.tc)]=new olympe.H.$.X.tc;this.X[O(olympe.dc.X.ce)]=new olympe.H.$.X.ce;this.X[O(olympe.dc.X.Gd)]=new olympe.H.$.X.Gd;a=new olympe.H.$.Db.Number;this.Db[O(olympe.dc.Db.Number)]=a;a=new olympe.H.$.Db.String;
790
- this.Db[O(olympe.dc.Db.String)]=a;a=new olympe.H.$.V.Ic;this.V[O(olympe.dc.V.Ic)]=a;this.V[O(olympe.dc.V.ye)]=new olympe.H.$.V.ye;this.V[O(olympe.dc.V.Fe)]=new olympe.H.$.V.Fe;a=new olympe.H.$.V.Uc;this.V[O(olympe.dc.V.Uc)]=a;a=new olympe.H.$.V.Ad;this.V[O(olympe.dc.V.Ad)]=a;this.V[O(olympe.dc.V.md)]=new olympe.H.$.V.md;a=new olympe.H.$.V.jf;this.V[O(olympe.dc.V.jf)]=a;a=new olympe.H.$.V.kf;this.V[O(olympe.dc.V.kf)]=a;this.na[O(olympe.dc.na.bd)]=new olympe.H.$.na.bd;a=new olympe.H.$.na.me;this.na[O(olympe.dc.na.me)]=
791
- a;a=new olympe.H.$.na.qe;this.na[O(olympe.dc.na.qe)]=a;a=new olympe.H.$.na.ve;this.na[O(olympe.dc.na.ve)]=a;a=new olympe.H.$.na.le;this.na[O(olympe.dc.na.le)]=a;this.na[O(olympe.dc.na.sf)]=new olympe.H.$.na.sf};olympe.H.$.hb.prototype.constructor=olympe.H.$.hb;function vi(a,b,c){var d=b.pa(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ja(b,c,a)}
792
- function wi(a,b,c){var d=b.pa(),e=a.na[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ja(b,c,a)}
793
- function xi(a,b){return a&&a.xf?'"$'+b.add(a)+'"':a instanceof olympe.D.ra||a instanceof olympe.D.ea?String(a):a instanceof olympe.D.Xa?'"'+a+'"':a instanceof olympe.D.kb?(a=a.ms(),String(`{"c":4,"y":${a.getUTCFullYear()},"M":${a.getUTCMonth()+1},"d":${a.getUTCDate()},"h":${a.getUTCHours()},"m":${a.getUTCMinutes()},"s":${a.getUTCSeconds()},"S":${a.getUTCMilliseconds()},"z":0}`)):a instanceof olympe.D.Color?'{"c":7,"r":'+a.Nf().valueOf()+',"g":'+a.Hf().valueOf()+',"b":'+a.Cf().valueOf()+',"a":'+a.Bf().valueOf()+
794
- '}':a instanceof olympe.dc.Ec?'{"c":8,"t":"'+a.T()+'"}':JSON.stringify(a)};olympe.H.$.Sj=class{ja(a){const b=Object.create(null);b.i=a.Z();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.Ol?Ye(a.ph):olympe.dc.Ub.NONE;b.q=of(a).map(this.C.bind(this));return b}C(a){const b=a.Td(),c=b.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li,d=Object.create(null);d.t=b.T();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.kh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.Gd=function(){};olympe.H.$.X.Gd.prototype.constructor=olympe.H.$.X.Gd;olympe.H.$.X.Gd.prototype.ja=function(){return'{"y":15}'};olympe.H.$.X.Gd.ma=[olympe.H.$.Yc];olympe.H.$.X.tc=function(){};olympe.H.$.X.tc.prototype.constructor=olympe.H.$.X.tc;olympe.H.$.X.tc.prototype.ja=function(a,b,c){return'{"y":21,"p":'+vi(c,a.G(),b)+'}'};olympe.H.$.X.tc.ma=[olympe.H.$.Yc];olympe.H.$.X.Be=function(){};olympe.H.$.X.Be.prototype.constructor=olympe.H.$.X.Be;olympe.H.$.X.Be.prototype.ja=function(a){var b=null!==a.Qa()?a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li:olympe.H.$.X.Sb.C.Qn;return'{"y":12,"t":'+JSON.stringify($g(a))+',"d":'+b+'}'};olympe.H.$.X.Be.ma=[olympe.H.$.Yc];olympe.H.$.X.Dc=function(){};olympe.H.$.X.Dc.prototype.constructor=olympe.H.$.X.Dc;olympe.H.$.X.Dc.prototype.ja=function(a){const b=null!==a.Qa()?a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li:olympe.H.$.X.Sb.C.Qn;return'{"y":11,"t":"'+a.T()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Dc.ma=[olympe.H.$.Yc];olympe.H.$.X.Sb=function(){};olympe.H.$.X.Sb.C={Qn:0,Di:1,Li:2};olympe.H.$.X.Sb.prototype.constructor=olympe.H.$.X.Sb;olympe.H.$.X.Sb.prototype.ja=function(a){const b=a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li;return'{"y":10,"t":"'+a.T()+'","d":'+b+'}'};olympe.H.$.X.Sb.ma=[olympe.H.$.Yc];olympe.H.$.X.Od=function(){};olympe.H.$.X.Od.prototype.constructor=olympe.H.$.X.Od;olympe.H.$.X.Od.prototype.ja=function(a,b,c){var d=a.Bd;const e=d.pa();var f=c.Db[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.ja(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.$.X.Od.ma=[olympe.H.$.Yc];olympe.H.$.X.ce=function(){};olympe.H.$.X.ce.prototype.constructor=olympe.H.$.X.ce;olympe.H.$.X.ce.prototype.ja=function(a,b){var c=a.start;c=c&&c.xf?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.xf?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.$.X.ce.ma=[olympe.H.$.Yc];olympe.H.$.Db={};olympe.H.$.Db.Number=class{constructor(){}ja(a,b,c){return`{"y":11,"v":${wi(c,a.C,b)}}`}};olympe.H.$.Db.Number.ma=[olympe.H.$.Ne];olympe.H.$.Db.String=class{constructor(){}ja(a,b,c){return`{"y":10,"v":${wi(c,a.C,b)}}`}};olympe.H.$.Db.String.ma=[olympe.H.$.Ne];olympe.H.$.V={};olympe.H.$.V.Uc=function(){};olympe.H.$.V.Uc.prototype.constructor=olympe.H.$.V.Uc;olympe.H.$.V.Uc.prototype.ja=function(a,b,c){const d=wi(c,a.source,b);c=wi(c,a.getValue(),b);a=xi(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.V.Uc.ma=[olympe.H.$.ab];olympe.H.$.V.Ic=function(){};olympe.H.$.V.Ic.prototype.constructor=olympe.H.$.V.Ic;olympe.H.$.V.Ic.prototype.ja=function(a,b,c){const d=wi(c,a.G,b);a=wi(c,a.L,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Ic.ma=[olympe.H.$.ab];olympe.H.$.V.ye=function(){};olympe.H.$.V.ye.prototype.constructor=olympe.H.$.V.ye;olympe.H.$.V.ye.prototype.ja=function(a,b,c){const d=wi(c,a.G,b);a=wi(c,a.L,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.ye.ma=[olympe.H.$.ab];olympe.H.$.V.jf=class{ja(a){const b=Ug(a).map(d=>'"'+d+'"'),c=Vg(a).map(d=>d===olympe.dc.Aa.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.V.jf.ma=[olympe.H.$.ab];olympe.H.$.V.kf=class{ja(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.V.kf.ma=[olympe.H.$.ab];olympe.H.$.V.md=class{ja(a,b,c){return'{"y":30,"p":'+vi(c,a.G(),b)+'}'}};olympe.H.$.V.md.ma=[olympe.H.$.ab];olympe.H.$.V.Ad=class{ja(a,b,c){c=wi(c,a.source,b);const d=a.L;a=xi(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.V.Ad.ma=[olympe.H.$.ab];olympe.H.$.V.Fe=function(){};olympe.H.$.V.Fe.prototype.constructor=olympe.H.$.V.Fe;olympe.H.$.V.Fe.prototype.ja=function(a,b,c){var d=wi(c,a.G,b);a=wi(c,a.L,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Fe.ma=[olympe.H.$.ab];olympe.H.$.na={};olympe.H.$.na.Nc=function(){};olympe.H.$.na.Nc.prototype.constructor=olympe.H.$.na.Nc;olympe.H.$.na.Nc.prototype.C=function(){};
795
- olympe.H.$.na.Nc.prototype.ja=function(a,b,c){var d=xi(a.$e,b),e=a.Rd();e=e?',"b":'+xi(e,b):'';if(a=a.Bg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.pa(),r=h.X[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.ja(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.$.na.Nc.ma=[olympe.H.$.wf];olympe.H.$.na.ve=function(){olympe.H.$.na.Nc.call(this)};olympe.H.$.na.ve.prototype=Object.create(olympe.H.$.na.Nc.prototype);olympe.H.$.na.ve.prototype.constructor=olympe.H.$.na.ve;olympe.H.$.na.ve.prototype.C=function(){return 13};olympe.H.$.na.bd=function(){};olympe.H.$.na.bd.prototype.constructor=olympe.H.$.na.bd;olympe.H.$.na.bd.prototype.ja=function(a,b){return'{"y":10,"v":'+xi(a.value,b)+'}'};olympe.H.$.na.bd.ma=[olympe.H.$.wf];olympe.H.$.na.le=function(){olympe.H.$.na.Nc.call(this)};olympe.H.$.na.le.prototype=Object.create(olympe.H.$.na.Nc.prototype);olympe.H.$.na.le.prototype.constructor=olympe.H.$.na.le;olympe.H.$.na.le.prototype.C=function(){return 14};olympe.H.$.na.me=function(){olympe.H.$.na.Nc.call(this)};olympe.H.$.na.me.prototype=Object.create(olympe.H.$.na.Nc.prototype);olympe.H.$.na.me.prototype.constructor=olympe.H.$.na.me;olympe.H.$.na.me.prototype.C=function(){return 11};olympe.H.$.na.qe=function(){olympe.H.$.na.Nc.call(this)};olympe.H.$.na.qe.prototype=Object.create(olympe.H.$.na.Nc.prototype);olympe.H.$.na.qe.prototype.constructor=olympe.H.$.na.qe;olympe.H.$.na.qe.prototype.C=function(){return 12};olympe.H.$.na.sf=class{ja(){return'{"y":19}'}};olympe.H.$.na.sf.ma=[olympe.H.$.wf];olympe.H.jd={};function yi(a,b){a.N.info('Initializing SERVER layer');if(a.N.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.N.debug(c.join('\n\t'))}a.Ta(olympe.H.Jc.rc,c=>{switch(c.c){case olympe.H.ka.av:a.N.error('Unknown message sent to the server:',olympe.H.va.F[c.s]);break;case olympe.H.ka.bt:a.N.error('Fatal error, the last message is probably too big according to the websocket config.'),a.R.forEach((d,e)=>{zi(a,e,c.i)})}});b.get('autoConnect')&&(a.N.debug('Connecting automatically'),
796
- a.connect());olympe.D.Tk(a.L.Eb(),()=>{for(const c of a.$k.values())c();Kb(a.Pf.bind(a),a.Vf,'checkTimeoutMessages')},()=>{for(const c of a.Wf.values())c();Lb('checkTimeoutMessages');a.Pf()});a.N.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
797
- function Ai(a,b){if(a.C!==b)switch(a.N.log('State change '+a.C+' --\x3e '+b),a.C=b,b){case olympe.H.va.C.CONNECTING:break;case olympe.H.va.C.yh:a.L.update(olympe.D.ra.F);olympe.D.Tk(a.cc.R().not(),a.uc.bind(a,!0));break;case olympe.H.va.C.rc:a.N.error('Connection to server',a.oa.C(),'aborted due to error');a.L.update(olympe.D.ra.C);break;case olympe.H.va.C.gf:a.L.update(olympe.D.ra.C);a.Oc&&(a.N.info('Disconnected, will try to auto reconnect in',a.$c,'ms'),Ib(()=>{a.connect()},a.$c));break;default:throw Error('State machine error in server manager. Should not get in state '+
798
- b);}}
799
- function Bi(a,b){const c=olympe.H.va.L.Oi,d=olympe.H.va.L.eu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.N.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.va.F[g]?`Status code = ${g} [${olympe.H.va.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);h=
800
- g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}
801
- function Ci(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Kr;const c=b.messageFamily,d=a(olympe.H.Jc,c),e=b.payload;b='';switch(c){case olympe.H.Jc.zh:b=a(olympe.dc.ga.ka,e.c);break;case olympe.H.Jc.rc:b=a(olympe.H.ka,e.c);break;case olympe.H.Jc.pf:b=a(olympe.H.qa.Ua.C,e.c);break;case olympe.H.Jc.Ai:2===e.c&&(b=a(olympe.H.va.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
802
- function zi(a,b,c){if(a.R.delete(b)){c={s:23,info:c};const d=a.Y.get(b);d&&d(c);a.Y.delete(b)}}function Di(a,b){a.N.error(b);Ai(a,olympe.H.va.C.rc)}function Ei(a,b,c){a.N.info('Connected to',a.oa.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');Ai(a,olympe.H.va.C.yh);null===c||a.Tb||Fi(a,c);a.Pb.forEach(d=>{const e=JSON.stringify(d);a.N.debug('>',Ci(d));a.F.send(e);d=d.seqId;a.Y.has(d)&&a.R.set(d,Date.now())});a.Pb.length=0}
803
- function Fi(a,b){Lb('keepAliveSubscription');const c=Kb(()=>{a.Fa()?a.G(olympe.H.Jc.zh,{c:olympe.H.ka.nf,subIds:Array.from(a.Ab)},(d,e)=>d&&a.N.error(e)):c.cancel()},1E3*b,'keepAliveSubscription')}
804
- olympe.H.jd.va=class{constructor(a,b,c,d){this.N=a;this.cc=b;this.oa=c;this.F=null;this.config=d;this.$c=this.config.get('reconnectionDelay');this.qy=this.$c/4;this.Oc=d.get('autoConnect');this.vy=d.get('retryHttpOverload');this.Vf=d.get('messageTimeout');this.aa=Ka(d.get('clientVersion'));this.cb=Ka(d.get('serverVersion'));this.C=olympe.H.va.C.INIT;this.Tb=d.get('getContextMode');this.bl=1;this.Y=new Map;this.bb=new Map;this.L=olympe.D.Mc(olympe.D.ra,'Server is online');this.$k=new Map;this.Wf=new Map;
805
- this.Pb=[];this.R=new Map;this.Ab=new Set;this.ha=0;this.Yx=new Map;yi(this,d)}Fa(){return this.C===olympe.H.va.C.yh}connect(){this.Oc=!0;this.N.log('Asking NET layer for a connection to',Mb(this.oa)+':'+this.oa.port,'...');this.F=this.cc.ha(this.oa);this.F.oa(this.ud.bind(this));this.F.ha(this.Ge.bind(this));this.F.aa(()=>{this.F=null;this.C===olympe.H.va.C.yh&&2>this.ha?(this.ha++,setTimeout(()=>{this.connect()},100)):this.C!==olympe.H.va.C.rc&&(this.ha=0,Ai(this,olympe.H.va.C.gf))});0===this.ha&&
806
- Ai(this,olympe.H.va.C.CONNECTING)}disconnect(){const a=olympe.H.va.C.CONNECTING;if(this.C===olympe.H.va.C.yh||this.C===a)this.Oc=!1,Ai(this,olympe.H.va.C.gf)}th(a){var b;void 0===b&&(b=olympe.W.hc());this.$k.set(b,a);olympe.D.Ya(this.L)===olympe.D.ra.F&&a()}uh(a){var b;void 0===b&&(b=olympe.W.hc());this.Wf.set(b,a);olympe.D.Ya(this.L)===olympe.D.ra.C&&a()}ud(){this.ha=0;this.N.debug('Websocket connected, sending handshake. Client version:',La(this.aa),'subscribeEverything:',this.Tb?'NO':'YES');this.G(olympe.H.Jc.Ai,
807
- {c:olympe.H.ka.Ai,cv:La(this.aa),m:this.Tb?0:1},this.Wx.bind(this))}G(a,b,c){const d=this.bl;this.bl++;b={seqId:d,messageFamily:a,payload:b};void 0!==c&&this.Y.set(d,Bi(this,c));this.Fa()||a===olympe.H.Jc.Ai&&this.C===olympe.H.va.C.CONNECTING?(a=JSON.stringify(b),this.N.debug('>',Ci(b)),this.F.send(a),void 0!==c&&this.R.set(d,Date.now())):this.Pb.push(b)}Qd(a,b,c,d,e,f){c&&''!==c||this.N.warn('Trying to send an http request with an invalid authorizationToken');const g=Pb(a);if(e){g.method=olympe.la.fb.de.hm;
808
- e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Qb(g,{'Content-Type':'application/json'});this.N.log('HTTP POST >',Ci(e))}else this.N.log('HTTP GET call to',a);g.F=olympe.la.fb.ResponseType.vk;Qb(g,{Authorization:c});const h=()=>{this.cc.C(g,k=>{switch(k.Ud()){case olympe.la.fb.rd.Kh:case olympe.la.fb.rd.vl:case olympe.la.fb.rd.zj:k=k.getData();if(b!==olympe.H.Jc.zh||d){f&&f(null,k);break}k=this.Ge(k);f&&f(k);k&&this.N.error(k.message);break;case olympe.la.fb.rd.Iu:Ib(h,
809
- this.vy);break;case olympe.la.fb.rd.Bs:this.N.debug(`HTTP request canceled (${a}).`);f&&f(null);break;default:k=Error(`Server is currently not available, http status: ${k.Ud()}`),f&&f(k)}})};h()}Ta(a,b,c){void 0===c&&(c=olympe.W.hc());let d=this.bb.get(a);void 0===d&&(d=new Map,this.bb.set(a,d));d.set(c,b)}Of(a,b){a=this.bb.get(a);void 0!==a&&a.delete(b)}Zr(a){this.Ab.add(a)}cs(a){this.Ab.delete(a)}Wx(a,b){if(a)Di(this,'Error in receiving handshake response: '+a.message);else{this.N.debug('Handshake response received');
810
- var c=olympe.H.va.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.vt:Di(this,`Framework version (${La(this.aa)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.Uu:Di(this,`Framework version (${La(this.aa)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.it:Di(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.cb.sb(olympe.W.Uh.C))this.N.warn('Handshake successful but received server version',
811
- a,'is invalid. Cannot check against it');else try{const e=Ka(a);if(e.vj(this.cb)){Di(this,`Framework v${La(this.aa)} is expecting Orchestrator to be at least in v${La(this.cb)}`);return}this.N.log('Handshake successful. Orchestrator version: ',e,'required:',La(this.cb))}catch(e){Di(this,e);return}if(b=b.identityProviders)for(const [e,f]of Object.entries(b))this.Yx.set(e,f);Ei(this,a,d)}}uc(a=!1){if(this.C===olympe.H.va.C.yh){var b=this.qy,c=olympe.D.Ia(),d='onConnectionLost'+olympe.W.hc();this.N.debug('Sending Ping');
812
- this.G(olympe.H.Jc.Hs,{c:1},()=>{Jb(d);a&&!c.zb()&&c.run(()=>{Ib(this.uc.bind(this),4*b,d)})});Ib(()=>{this.N.debug('Force close websocket after offline for',b);olympe.D.zg().run(()=>{this.C!==olympe.H.va.C.gf&&(this.F&&this.F.close(),Ai(this,olympe.H.va.C.gf))})},b,d)}}Ge(a){try{var b=JSON.parse(a)}catch(d){return this.N.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.N.debug('<',Ci(b));a=b.seqId;const c=b.messageFamily;b=b.payload;
813
- if(this.R.delete(a)){const d=this.Y.get(a);d&&d(b);this.Y.delete(a)}a=this.bb.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Pf(){const a=Date.now();let b=!1;for(const [c,d]of this.R)a-d>this.Vf&&(this.N.warn(`No response was received from the server for the seqId = ${c}`),zi(this,c,{error:{reason:'Message timeout: never receive acknowledge'}}),b=!0);b&&this.uc()}};olympe.H.jd.va.C='checkTimeoutMessages';olympe.H.va.L={Oi:0,eu:18,Tz:23};
814
- olympe.H.va.F={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',18:'Try to unsubscribe multiple times',
815
- 21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.H.jd.va.ma=[olympe.H.va];olympe.H.O={xa:'server.Manager',Un:'server.bus.Manager',Ea:'server.Logger',Nd:'server.Source',Qg:'server.FileSource',mp:'server.ImportFileSvcHttpRequest',Pn:'server.BackupSvcHttpRequest',Yp:'server.OpenIDSvcHttpRequest',Qo:'server.GetContextSvcPathRequest',ip:'server.ImplicitGDSvcPathRequest',Co:'server.ExplicitGDSvcPathRequest',Xq:'server.TransactionOverHttpPathRequest',hr:'server.UserTokenRequest',fr:'server.UserTagRequest',dr:'server.UserRolesRequest',zq:'server.RoleMembersRequest',Eh:'server.IOUrlsProvider',
816
- Io:'server.fileSvcUrl',fq:'communication.peerFileSvcUrl'};olympe.H.xd={mi:'server.connectors.Auth',zA:'server.connectors.Signaling'};
817
- olympe.H.Config={zd:'server.host',Ld:'server.port',pd:'server.ssl',Gn:'server.autoConnect',rq:'server.reconnectionDelay',sq:'server.reconnectionShortDelay',xm:'server.messageTimeout',xq:'server.retryHttpOnOverload',ao:'server.clientVersion',Fq:'server.serverVersion',Tn:'bus.host',Vn:'bus.path',Wn:'bus.port',Xn:'bus.vhost',nf:'bus.keepalive',Du:'bus.reschedulePings',Fs:'bus.clientId',Ds:'bus.clean',zu:'bus.reconnectPeriod',Is:'bus.connectTimeout',br:'bus.username',cq:'bus.password',vu:'bus.queueQoSZero'};
818
- olympe.H.qb={Fd:'server.basePath',lr:'server.wsPath',Go:'server.filePath',kp:'server.importFilePath',On:'server.backupSvcPath',Xp:'server.openIDSvcPath',Po:'server.GetContextSvcPath',jp:'server.ImplicitGraphdefSvcPath',Do:'server.ExplicitGraphdefSvcPath',Wq:'server.TransactionOverHttpPath',gr:'server.userTokenSvcPath',er:'server.userTagPath',cr:'server.userRolesPath',yq:'server.roleMembersPath',gm:'communication.peerFileSvcPath'};
819
- olympe.U.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;E(a,olympe.H.Config.zd,b);E(a,olympe.H.Config.Ld,c?8080:443);E(a,olympe.H.Config.pd,'localhost'!==b);E(a,olympe.H.qb.Fd,'OlympeServer');E(a,olympe.H.qb.lr,'websocket');E(a,olympe.H.qb.Go,'rest/filesvc');E(a,olympe.H.qb.kp,'rest/importsvc');E(a,olympe.H.qb.On,'rest/backupsvc');E(a,olympe.H.qb.Xp,'rest/openid');E(a,olympe.H.qb.Po,'rest/initialData');E(a,olympe.H.qb.jp,
820
- 'rest/querysvc/graphDefImplicit');E(a,olympe.H.qb.Do,'rest/querysvc/graphDefExplicit');E(a,olympe.H.qb.Wq,'rest/transaction');E(a,olympe.H.qb.gr,'rest/token');E(a,olympe.H.qb.er,'rest/authorization/getUserTag');E(a,olympe.H.qb.cr,'rest/authorization/getUserRoles');E(a,olympe.H.qb.yq,'rest/authorization/roleMembers');E(a,olympe.H.Config.Gn,!0);E(a,olympe.H.Config.rq,5E3);E(a,olympe.H.Config.sq,500);E(a,olympe.H.Config.xm,15E3);E(a,olympe.H.Config.xq,5E3);E(a,olympe.H.Config.Fq,'6.2.1');E(a,olympe.H.Config.Tn,
821
- '');E(a,olympe.H.Config.Vn,c?'':'/mqtt');E(a,olympe.H.Config.Wn,c?15675:443);E(a,olympe.H.Config.Xn,c?'/':'');E(a,olympe.H.Config.br,'guest');E(a,olympe.H.Config.cq,'guest');E(a,olympe.H.Config.nf,30);E(a,olympe.H.qb.gm,'nodes/files');b=a.getParameter(olympe.Eg.Config.Mo);if(void 0!==b)ua(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.O.Ea,[olympe.sa.O.xa],d=>d.Pc('communication'));C(a,'server.WebSocketRequest',[new olympe.U.fa(olympe.H.Config.zd),
822
- new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.lr)],(d,e,f,g,h)=>new olympe.la.Ck(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.la.Vj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.O.mp,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.kp)],
823
- b);C(a,olympe.H.O.Pn,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.On)],b);C(a,olympe.H.O.Yp,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Xp)],b);C(a,olympe.H.O.Qo,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),
824
- new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Po)],b);C(a,olympe.H.O.ip,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.jp)],b);C(a,olympe.H.O.Co,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Do)],b);C(a,olympe.H.O.Xq,[new olympe.U.fa(olympe.H.Config.zd),
825
- new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Wq)],b);C(a,olympe.H.O.hr,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.gr)],b);C(a,olympe.H.O.fr,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.er)],
826
- b);C(a,olympe.H.O.dr,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.cr)],b);C(a,olympe.H.O.zq,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.yq)],b);C(a,olympe.H.O.Io,[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.pd),
827
- new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Go)],b);C(a,olympe.H.O.fq,[new olympe.U.fa(olympe.la.Config.Jl),new olympe.U.fa(olympe.la.Config.Kl),new olympe.U.fa(olympe.H.Config.pd),new olympe.U.fa(olympe.H.qb.gm)],b);C(a,'server.ManagerConfig',[new olympe.U.fa(olympe.H.Config.Gn),new olympe.U.fa(olympe.H.Config.rq),new olympe.U.fa(olympe.H.Config.sq),new olympe.U.fa(olympe.H.Config.xm),new olympe.U.fa(olympe.H.Config.ao),new olympe.U.fa(olympe.H.Config.Fq),new olympe.U.fa(olympe.dc.Config.Yg),
828
- new olympe.U.fa(olympe.H.Config.xq)],(...d)=>{const e='autoConnect reconnectionDelay reconnectionShortDelay messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.U.fa(olympe.H.Config.zd),new olympe.U.fa(olympe.H.Config.Tn),new olympe.U.fa(olympe.H.Config.Vn),new olympe.U.fa(olympe.H.Config.Wn),new olympe.U.fa(olympe.H.Config.Xn),new olympe.U.fa(olympe.H.Config.br),new olympe.U.fa(olympe.H.Config.pd),
829
- new olympe.U.fa(olympe.H.Config.nf),new olympe.U.fa(olympe.H.Config.Du),new olympe.U.fa(olympe.H.Config.Fs),new olympe.U.fa(olympe.H.Config.Ds),new olympe.U.fa(olympe.H.Config.zu),new olympe.U.fa(olympe.H.Config.Is),new olympe.U.fa(olympe.H.Config.cq),new olympe.U.fa(olympe.H.Config.vu),new olympe.U.fa(olympe.H.Config.xm)],(d,e,f,g,h,k,l,...n)=>{e=`${l?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const p='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout password queueQoSZero messageTimeout'.split(' ');
830
- n=n.reduce((q,r,t)=>{q[p[t]]=r;return q},{});n.username=`${h||d.split('.')[0]}:${k}`;d=new Map;d.set('url',e);d.set('connectionOptions',n);return d});B(a,olympe.H.O.xa,olympe.H.jd.va,olympe.H.O.Ea,olympe.la.O.xa,'server.WebSocketRequest','server.ManagerConfig');B(a,olympe.H.xd.mi,olympe.H.qa.Ua,olympe.H.O.Ea,olympe.H.O.xa,olympe.H.O.hr,olympe.H.O.fr,olympe.H.O.dr,olympe.H.O.zq,olympe.H.O.Yp,olympe.auth.O.kk,olympe.ic.O.$j);B(a,olympe.H.O.Un,olympe.H.ya.va,olympe.H.O.Ea,olympe.la.O.xa,olympe.auth.O.xa,
831
- 'server.bus.ManagerConfig');sa(a,olympe.auth.xd.xa,olympe.H.xd.mi);sa(a,olympe.auth.xd.Bp,olympe.H.xd.mi);sa(a,olympe.auth.xd.Ee,olympe.H.xd.mi);sa(a,olympe.auth.xd.Re,olympe.H.xd.mi);B(a,olympe.H.O.Qg,olympe.H.Qj,olympe.H.O.Ea,olympe.la.O.xa,olympe.auth.O.xa,olympe.H.O.Io,olympe.H.O.fq);sa(a,olympe.$a.O.Qg,olympe.H.O.Qg);C(a,olympe.H.O.Nd,[olympe.sa.O.xa,olympe.H.O.xa,olympe.auth.O.xa,olympe.$a.O.Qg,olympe.H.O.Qo,olympe.H.O.ip,olympe.H.O.Co,olympe.H.O.Xq],(d,e,f,g,h,k,l,n)=>new olympe.H.$g(d.Pc('server.source'),
832
- e,f,g,[h,k,l,n]));B(a,olympe.H.O.Eh,olympe.H.Wj,olympe.H.O.mp,olympe.H.O.Pn);sa(a,olympe.dc.ba.O.Eh,olympe.H.O.Eh);sa(a,olympe.$a.O.sm,olympe.H.O.Nd)},'olympe.communication');olympe.U.run([olympe.H.O.Un],a=>{olympe.H.ya.Sc=()=>a});olympe.sc={};olympe.sc.O={Ea:'sc.Logger',qm:'sc.RootContext'};olympe.sc.Config={ef:'sc.app',dg:'sc.debug',Ss:'sc.disableTheme',PRODUCTION:'sc.production',Wp:'sc.onstartTimeout',wq:'sc.remoteActionTimeout',Up:'sc.offlineStart',bu:'google.apikey'};
833
- olympe.U.config(a=>{E(a,olympe.sc.Config.ef,'');E(a,olympe.sc.Config.Up,!1);E(a,olympe.sc.Config.dg,!1);E(a,olympe.sc.Config.Ss,!1);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Wp,2E4);E(a,olympe.sc.Config.bu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');E(a,olympe.sc.Config.wq,1E4);C(a,olympe.sc.O.Ea,[olympe.sa.O.xa],b=>b.Pc('sc'));C(a,olympe.sc.O.qm,[new olympe.U.fa(olympe.sc.Config.PRODUCTION),new olympe.U.fa(olympe.sc.Config.Wp)],b=>{const c=new olympe.sc.Va('root','root',null);olympe.sc.gs=
834
- c;c.set(olympe.sc.Va.jg.PRODUCTION,b);return c})},'olympe.sc');olympe.U.run([olympe.sc.O.qm],a=>{olympe.dj().ctx=a});olympe.sc.QC=(a,b,c)=>{a.Oa(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.OC=(a,b,c)=>{a.Oa(olympe.dc.CloudObject.containsRel,c,b);a.Oa(olympe.sc.Runnable.G,c,b);a.Oa(olympe.sc.Runnable.C,c,b)};olympe.sc.fD=(a,b,c)=>{a.Jb(olympe.dc.CloudObject.containsRel,c,b);a.Jb(olympe.sc.Runnable.G,c,b);a.Jb(olympe.sc.Runnable.C,c,b)};olympe.sc.kn=()=>null!==olympe.dc.Pa().nc(void 0,olympe.sc.Runnable.C.Rc());olympe.sc.hD=(a,b,c)=>{a.Jb(olympe.dc.CloudObject.containsRel,c,b)};
835
- olympe.sc.qx=(a,b,c)=>{a.Oa(olympe.sc.lb.F,c,b)};olympe.sc.xy=(a,b,c)=>{a.Jb(olympe.sc.lb.F,c,b)};olympe.sc.PC=(a,b,c)=>{olympe.sc.qx(a,b,c);a.Oa(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.gD=(a,b,c)=>{olympe.sc.xy(a,b,c);a.Jb(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.uC=(a,b,c,d)=>{c=a.create(olympe.sc.Cc).setProperty(olympe.sc.Cc.C,c||null).setProperty(olympe.sc.Cc.L,d||null);a.Oa(olympe.sc.Cc.F,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.T()};
836
- olympe.sc.hh=a=>{a=olympe.dc.W.Vb.hh(a);return a instanceof olympe.sc.Ce?a.C():a};olympe.sc.JC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.Ce?a.C():a};
837
- olympe.sc.GC=function(a){const b=olympe.dm.Rb.C.Rc(),c=olympe.dc.CloudObject.containsRel.Rc();var d=olympe.dc.wa(a);if(void 0===d)return[];a=olympe.dc.Pa();var e=a.model(d);const f=[],g=[];let h=[];if(a.Rf(e,olympe.dm.Rb))h.push(d);else{for(e=[];null===a.nc(d,b);){e.push(d);const k=a.nc(d,c);if(null===k)return olympe.sa.Za('sc').warn(`Object ${d} has no container`),[];k===a.nc(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.nc(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
838
- }g.push(d);h.push(a.nc(g[0],b))}h=h.concat(a.Mf(h[0],olympe.dm.Rb.Pb));h=h.concat(a.Mf(h[h.length-1],olympe.dm.od.ha.Rc()));h=h.concat(a.Mf(h[h.length-1],olympe.dm.od.R.Rc()));return[...f,...g,...h].reverse()};olympe.sc.HC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Xj:a.startsWith('video/')?olympe.sc.wm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.yd:olympe.dm.File};let Gi=0,Hi=0;function Ii(a,b){if(a.children)for(const c of a.children.values())b(c)}function Ji(a,b){if(a.re&&a.re.has(b)){var c=a.re.get(b);--c[0];0===c[0]&&(a.re.delete(b),0===a.re.size&&(a.re=null),Qc(olympe.dc.Dd(),null,c[1]))}}function Ki(a,b){a.children&&a.children.delete(b.Z())}function Li(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Hm&&c.kj()&&(a=Li(c.children,b)))return a;return null}
839
- function Mi(a,b){b=olympe.dc.wa(b);return a.sh&&(a.sh.get('O#'+b)||a.sh.get('IO#'+b))||b}function Ni(a,b,c,d){const e='$'+b;a.$h.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{(f=a.td&&a.td.get(f))&&f.forEach(g=>{g(d)})});Ii(a,f=>{!f.Nm&&f.$h.has(b)||f.data.has(e)||Ni(f,b,c,d)});a.$h.delete(b)}function Oi(a,b){b=olympe.dc.wa(b);return a.sh&&(a.sh.get('I#'+b)||a.sh.get('IO#'+b))||b}
840
- function Pi(a,b,c){a.$h.add(b);const d=a.td&&a.td.get('&'+b);if(d)for(const e of d.values())e(c);Ii(a,e=>{e.$h.has(b)||Pi(e,b,c)});a.$h.delete(b)}
841
- olympe.sc.Va=class{constructor(a,b,c=olympe.sc.gs){++Hi;this.id=a;this.gh=new Set;this.parent=c;this.Cd=b||null;this.vc=new olympe.D.Zb('SC Context');this.data=new Map;this.re=this.children=this.td=null;this.Om=new Map;this.uid=Hi;this.wr=null;this.Hm=!1;this.$h=new Set;this.Nm=!1;this.N=olympe.sa.Za('sc');this.sh=null;this.vc.xc(()=>{Ii(this,d=>d.destroy())});this.vc.onDestroy(()=>{this.re&&this.re.forEach(([d],e)=>{for(let f=0;f<d;f++)Ji(this,e)});c&&Ki(this.parent,this);this.gh.clear();this.parent=
842
- null;null!==this.get(olympe.sc.Va.jg.TRANSACTION)&&this.N.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)})}Z(){return this.id}gn(){return this.uid}getParent(){return this.parent}Nk(){return this.wr}Fc(){return this.vc}qn(a){this.wr=olympe.dc.wa(a);this.Hm=a.Sd().kn();a.aa().forEach(b=>{this.gh.add(b)});this.sh=a.Y()}Gk(){this.Nm=!0;Ii(this,a=>{a.Gk()})}jl(){this.Nm=!1;Ii(this,a=>{a.jl()})}set(a,b){if(this.vc.R()||
843
- this.vc.zb())return this;a=Mi(this,a);const c='$'+a;var d=this.data.get(c);d&&d.valueOf&&(d=d.valueOf());if(void 0===b||null===b)void 0!==d&&(this.data.delete(c),Ni(this,a,['*',this.id,...this.gh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.sb?b.sb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Ni(this,a,['*',this.id,...this.gh],b))}return this}li(a){return this.set(a,Date.now())}remove(a){this.vc.zb()||this.vc.R()||(a=Mi(this,a),this.data.delete('$'+a)&&Ni(this,a,['*',this.id,
844
- ...this.gh],null))}Eb(a,b,c=!1){const d=olympe.dc.wa(a),e=olympe.D.Mc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.id:void 0));return e.Eb()}get(a,b=!1){a=this.Ya(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Oi(this,a);let c=this.data.has(a),d=this.parent;if(b)for(;!c&&d;)c=d.data.has(a),d=d.parent;return c}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{if(this.zb())return d.error('Context is already destroyed'),()=>
845
- {};const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.id);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Oi(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Hg(a.unsubscribe.bind(a));return this}el(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${olympe.D.Ya(a.pa(),'')}`);a.run(b);return b}Dn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.set(olympe.sc.Va.jg.cg,
846
- a);return this}Ya(a,b=!0){a='$'+Oi(this,a);let c=this.data.get(a),d=this.parent;if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.parent;return c}on(a,b,c){if(this.vc.zb()||this.vc.R())return()=>{};const d=Oi(this,a),e=c?olympe.dc.wa(c):'*';a=this.Te('@'+e+'.'+d,b);c=c?(c=this.fi(e))?c.Ya(d,!1):void 0:this.Ya(d);void 0!==c&&b(c);olympe.D.Ia().onDestroy(a);return a}Yh(a){const b='_'+olympe.W.hc();null===this.children&&(this.children=new Map);const c=this.vc.run(()=>new olympe.sc.Va(b,a,this));this.children.set(b,
847
- c);return c}Qk(a,b){a=olympe.dc.wa(a);null===this.children&&(this.children=new Map);let c=this.children.get(a);if(!c){c=new olympe.sc.Va(a,b,this);this.children.set(a,c);for(b=c.parent;b&&b.Hm&&b.kj();)b=b.parent;b&&Pi(b,a,c)}return c}oj(a,b){const c=this.fi(a);if(c)return b(c),()=>{};const d=this.Te('&'+a,e=>{d&&d();b(e)});return d}fi(a){if(a===this.id||this.gh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.gh.has(a))return b;const c=Li(b.children,a);if(c)return c;b=b.parent}return null}kj(){return!this.id.startsWith('_')}Ik(a,
848
- b){this.re||(this.re=new Map);const c=this.re.get(a);c?c[0]+=1:(this.re.set(a,[1,b]),Qc(olympe.dc.Dd(),b))}destroy(){this.vc.R()||this.vc.zb()||this.vc.destroy()}Hg(a,b){return this.vc.zb()?b||'noId':(b=b||String(++Gi),this.Om.set(b,a),b)}cl(a){this.Om.delete(a)}onDestroy(a){return this.zb()?(a(),'noId'):this.vc.onDestroy(a)}Ie(a){this.zb()||this.vc.Ie(a)}clear(){this.vc.R()||this.vc.zb()||(this.Om.forEach(a=>a()),this.vc.aa())}Te(a,b){this.td||(this.td=new Map);let c=this.td.get(a);void 0===c&&(c=
849
- new Map,this.td.set(a,c));++Gi;const d=Gi;c.set(d,b);return()=>{const e=this.td.get(a);e&&(e.delete(d),0===e.size&&this.td.delete(a))}}zb(){return this.vc.zb()}mn(){const a=this.Ya(olympe.sc.Va.jg.EDITION);return a?a:!1}Wk(){const a=this.Ya(olympe.sc.Va.jg.PRODUCTION);return a?a:!1}};olympe.sc.Va.prototype.clear=olympe.sc.Va.prototype.clear;olympe.sc.Va.prototype.offDestroy=olympe.sc.Va.prototype.Ie;olympe.sc.Va.prototype.onDestroy=olympe.sc.Va.prototype.onDestroy;
850
- olympe.sc.Va.prototype.offClear=olympe.sc.Va.prototype.cl;olympe.sc.Va.prototype.onClear=olympe.sc.Va.prototype.Hg;olympe.sc.Va.prototype.destroy=olympe.sc.Va.prototype.destroy;olympe.sc.Va.prototype.getOtherContext=olympe.sc.Va.prototype.fi;olympe.sc.Va.prototype.onContext=olympe.sc.Va.prototype.oj;olympe.sc.Va.prototype.createChild=olympe.sc.Va.prototype.Yh;olympe.sc.Va.prototype.setParentElement=olympe.sc.Va.prototype.hl;olympe.sc.Va.prototype.waitFor=olympe.sc.Va.prototype.Dn;
730
+ olympe.dm.File.urlProp=olympe.dm.File.P.Da('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.Da('ff023000000000000054');olympe.dm.File.ma=[olympe.D.File];m=olympe.dm.File.prototype;m.en.K=olympe.D.J.F;m.Ok.K=new olympe.D.J(()=>{},[]);m.Zm.K=new olympe.D.J(()=>{},[]);m.Pk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Ql.K=olympe.D.J.F;m.xp.K=olympe.D.J.F;m.ow.K=new olympe.D.J(()=>olympe.D.kb,[]);
731
+ m.Jw.K=new olympe.D.J(()=>olympe.D.kb,[]);m.Wr.K=olympe.D.J.R;olympe.dm.Id=class extends olympe.dc.CloudObject{C(){return this.Fb(olympe.dm.Id.F)}G(){return this.He(olympe.dm.Id.L)}F(){return this.tb(olympe.dm.Id.C,olympe.dm.Module)}};olympe.dm.Id.P=olympe.dc.Ca.C('ff021000000000000041',olympe.dm.Id);olympe.dm.Id.F=olympe.dm.Id.P.Da('ff023000000000000047');olympe.dm.Id.L=olympe.dm.Id.P.Da('ff023000000000000048');olympe.dm.Id.C=olympe.dm.Module.C.Sc();olympe.dm.Id.prototype.C.K=olympe.D.J.F;olympe.dm.Id.prototype.G.K=olympe.D.J.G;
732
+ olympe.dm.Id.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Ob=class extends olympe.dm.od{F(){return this.tb(olympe.dm.Rb.F,olympe.dm.Rb)}L(){return this.Fb(olympe.dm.Ob.qa)}ea(){return this.Fb(olympe.dm.Ob.lc)}G(){return this.tb(olympe.dm.Ob.L,olympe.dm.Ob)}};olympe.dm.Ob.P=olympe.dc.Ca.C('0163d9594700fcf61e54',olympe.dm.Ob);olympe.dm.Ob.qa=olympe.dm.Ob.P.Da('017869c7d2833c9492c1');olympe.dm.Ob.lc=olympe.dm.Ob.P.Da('017869c80bb9929c76d0');olympe.dm.Ob.L=olympe.dm.Ob.P.Ra('ff02200000000000002b');olympe.dm.Ob.Pf=P(olympe.dm.Ob.P,olympe.dm.Ob.L);
733
+ olympe.dm.Ob.cc=olympe.dm.Ob.P.Ra('ff02200000000000002a');olympe.dm.Ob.Ge=olympe.dm.Ob.P.Ra('017e9c412e2b944bd590');olympe.dm.Ob.th=olympe.dm.Ob.P.Ra('017e9c416872a89d3415');olympe.dm.Ob.Wf=olympe.dm.Ob.P.Ra('017ebf8fe5c506662098');P(olympe.dc.CloudObject.P,olympe.dm.Ob.cc);olympe.dm.Ob.td=Fc('100000000000000000dd','PRIMORDIAL');olympe.dm.Ob.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Ob.prototype.L.K=olympe.D.J.F;olympe.dm.Ob.prototype.ea.K=olympe.D.J.F;
734
+ olympe.dm.Ob.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.ed(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.ed(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}kd(){return this.F().na().Dr(this.na())}};olympe.dm.Property.P=olympe.dc.Ca.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
735
+ olympe.dm.Property.typeRel=P(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Gw(){return olympe.D.Xa.EMPTY}jw(){return this.He(olympe.dm.Relation.Jm)}Qw(){return this.He(olympe.dm.Relation.wn)}Lr(){return this.tb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Rc()}Rr(){return this.tb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Rc()}kd(){return this.Rr().na().concat(['-',this.na(),'->',this.Lr().na()])}};olympe.dm.Relation.P=olympe.dc.Ca.C('ff021000000000000006',olympe.dm.Relation);
736
+ olympe.dm.Relation.wn=olympe.dm.Relation.P.Da('ff023000000000000030');olympe.dm.Relation.Jm=olympe.dm.Relation.P.Da('ff023000000000000034');olympe.dm.Relation.Tm=olympe.dm.Relation.P.Da('ff023000000000000037');olympe.dm.Relation.Sm=olympe.dm.Relation.P.Da('ff023000000000000137');olympe.dm.Relation.fl=olympe.dm.Relation.P.Da('ff023000000000000237');olympe.dm.Relation.ps=olympe.dm.Relation.P.Da('ff023000000000000337');olympe.dm.Relation.Av=olympe.dm.Relation.P.Da('ff023000000000000031');
737
+ olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.P,olympe.dc.CloudObject.Y);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Ub={NONE:null,dz:olympe.dm.Relation.Tm.T(),Hc:olympe.dm.Relation.Sm.T(),rf:olympe.dm.Relation.fl.T(),EA:olympe.dm.Relation.ps.T()};
738
+ olympe.dc.Ub.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ub))if(c===a)return b;return null};olympe.dm.Relation.C={kp:0,ql:5,xq:1,Ju:4,yk:2,mk:8,Do:10,Fu:6,Gu:9,rc:6,Iu:9};olympe.dm.Relation.F={mu:3,am:4,eu:5,Wl:6};olympe.dm.Relation.L=olympe.dm.Uc.bq+olympe.dm.Uc.wo;m=olympe.dm.Relation.prototype;m.Gw.K=olympe.D.J.F;m.jw.K=olympe.D.J.G;m.Qw.K=olympe.D.J.G;m.Lr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Rr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.qf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.qf.P=olympe.dc.Ca.C('ff021000000000000019',olympe.dm.qf);olympe.dm.String=class extends olympe.dm.qf{getValue(){return this.Fb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.P=olympe.dc.Ca.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.Da('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.qf{getValue(){return this.nh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.Ca.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.Da('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.R;olympe.dm.Color=class extends olympe.dm.qf{getValue(){return this.Sr()}};olympe.dm.Color.P=olympe.dc.Ca.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.Da('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.qf{getValue(){return this.gj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.Ca.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.Da('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.kb,[]);olympe.dm.Enum=class extends olympe.dm.String{na(){return olympe.D.Ga([super.na(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Xa)}he(){return this.He(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Pa();e=void 0!==e?e:f.Gb(b)&&f.ge(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
739
+ olympe.dm.Enum.P=olympe.dc.Ca.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.Da('017a7690c915975ea995');olympe.dm.Enum.prototype.he.K=olympe.D.J.G;olympe.dm.gg=class extends olympe.dm.BrickMetadata{hx(){return this.tb(olympe.dc.CloudObject.instancesRel,olympe.dm.Enum)}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.gg.create=olympe.dm.gg.create;olympe.dm.gg.prototype.getValues=olympe.dm.gg.prototype.hx;olympe.dm.gg.P=olympe.dc.Ca.C('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.qf{getValue(){return this.He(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.Ca.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.Da('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.ab={};olympe.ab.$g=class{constructor(a){this.N=a;this.Y=new olympe.D.Zb(`${this.Z()} source context`);this.R=this.C=null}Z(){}L(){}close(){this.R&&this.R(this.Z(),olympe.dc.tk.yt);this.Y.destroy()}};function eh(a){olympe.D.yc([lc(a.qa)],b=>{if(b.valueOf()){const c=a.G.keys();fh(a,d=>{if(d)a.N.error('An error occurred while auto synchronising:\n'+d.message);else if(a.N.debug('Auto synchronise transactions successfully'),a.ea)for(const e of c)bc(a.F,f=>{a.N.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
740
+ function gh(a){let b;olympe.D.yc([lc(a.qa)],c=>{c.valueOf()?(a.ea=!1,b&&(Lb(b),b=null)):(a.ea=!0,b=Kb(()=>{if(a.ka){a.ka=!1;for(const d of a.G.keys())$b(a.F,d,a.G.get(d),()=>{},e=>{a.N.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
741
+ function fh(a,b){const c=olympe.async.sk.create(),d=c.G;c.add((e,f)=>{a.F.storage.L(f)});c.add((e,f,g)=>{const h=olympe.dc.Ka.rb,k=g.get('files'),l=new olympe.async.ng(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Fa.Y(p);null!==q?(l.add(a.Ta.bind(a,n,q,k)),a.F.storage.C(void 0)):f(`The source: ${p} is not reachable.`)}});Xb(l,(n,p)=>{n?e():f(p||void 0)});l.start()});Xb(c,(e,f)=>{b(e?null:Error(f));e&&(a.ka=!1,a.G.clear())});c.start()}
742
+ function hh(a,b){const c=new olympe.async.sk(olympe.D.Ia());c.add((d,e)=>{ac(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Dd();a.G.forEach((f,g)=>{const h=Array.from(f.ge()).map(k=>k.tag());Kc(e,olympe.D.Ia(),f,h,[],g)(!0)});d()});Xb(c,(d,e)=>{b(e?Error(e):null)});c.start()}
743
+ olympe.ab.Ei=class extends olympe.ab.$g{constructor(a,b,c,d,e){super(a);this.G=new Map;this.qa=c;this.F=d;this.Fa=b;this.ka=this.ea=!1;e.get('syncTimeout');e.get('autoSync')&&eh(this);e.get('autoPersist')&&gh(this)}Ta(a,b,c,d,e){const f=olympe.dc.ga.ja.xk,g=olympe.dc.ga.ja.yl,h=new olympe.dc.db.zc,k=new olympe.async.ng(olympe.D.Ia()),l=(n,p,q)=>{const r=n.tag(),t=n.gb(olympe.dm.File.mimeTypeProp.T());dc(this.F,u=>{tc(olympe.dc.zw(),r,u,t,v=>{n.Da(olympe.dm.File.urlProp.T(),v);const w=new Map;w.set(olympe.dm.File.urlProp.T(),
744
+ v);h.qc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.If(n))&&c.te()&&k.add(l.bind(this,c));Xb(k,(n,p)=>{n?(n=M(new olympe.dc.ga(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.ge()).map(r=>r.tag()),olympe.dc.Dd().persist(q),d())}),b.L(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ka.rb}L(a){var b=olympe.dc.ga.ja.bh,c=olympe.dc.ga.ja.Og;const d=olympe.dc.ga.ja.xi,e=olympe.dc.ga.ja.wi,f=olympe.dc.ga.ja.Rg,g=olympe.dc.ga.ja.Hl,h=olympe.dc.ga.ja.Sh,
745
+ k=olympe.dc.ga.ja.ti,l=olympe.dc.ga.ja.Ah;var n=olympe.dc.ga.ja.Pj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F(void 0);hh(this,v=>{null!==v&&this.N.error(`Could not load transactions: ${v.message}`)});break;case b:case c:const q=a.content;a.C.forEach(v=>{let w=this.G.get(v);void 0===w&&(w=new olympe.dc.db.zc,this.G.set(v,w));q.$c(w);this.ea&&(this.ka=!0)});a.validate(null);a=olympe.dc.transaction.rg.C.Sp;this.C(olympe.dc.Ka.rb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=
746
+ a.C[0],t=a.content;a.validate(null);Zb(this.F,t.Z(),v=>{this.N.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.ph.toJSON());this.N.warn();this.C(r,g,new olympe.dc.query.zi(t.Z(),r,olympe.dc.Ka.rb,new olympe.dc.db.zc))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.Ze;c=n.ue;p===h?cc(this.F,b,n.content,n.mimeType,u,c):p===l?dc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.ab.Ei.C='context';const ih=olympe.dc.ga.ja.mm,jh=olympe.dc.ga.ja.om,kh=olympe.dc.ga.ja.QUERY_RESULT,lh=olympe.dc.ga.ja.nm,mh=olympe.dc.ga.ja.bh,nh=olympe.dc.ga.ja.xk,oh=olympe.dc.ga.ja.Pj,ph=olympe.dc.ga.ja.Og,qh=olympe.dc.ga.ja.Fj,rh=olympe.dc.ga.ja.Un,sh=olympe.dc.ga.ja.Sh,th=olympe.dc.ga.ja.Ah,uh=olympe.dc.ga.ja.ti,vh=olympe.dc.ga.ja.nf;
747
+ function wh(a,b,c,d,e){const f=c.Z();c={t:ih,q:c.ia()};olympe.H.ya.pb.Bb.get(b,c).then(g=>{g.t===kh?(d(null),a.C(b,e||kh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function xh(a,b,c,d,e){const f=c.Z();wh(a,b,c,g=>{if(g)e(g);else{yh(a,b,f);g={t:jh,q:c.ia()};var h=olympe.H.ya.pb.Bb.observe(b,d,g).subscribe(k=>{const l=k.t;l===lh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.xc(()=>h.unsubscribe())}},lh)}
748
+ function zh(a,b,c,d){const e=c.Gc;c=new olympe.dc.transaction.Md;e.$c(c);c={t:mh,i:e.Z(),p:be(c)};olympe.H.ya.pb.Bb.send(b,c).then(()=>{d(null);a.C(b,oh,{id:e.Z(),finalize:olympe.dc.transaction.rg.C.Rp})}).catch(f=>d(Error(f)))}function Ah(a,b,c,d,e){var f=c.Gc;c=f.Z();const g=new olympe.dc.transaction.Md;f.$c(g);f={t:ph,i:c,p:be(g)};olympe.H.ya.pb.Bb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Bh(a,c,b,d)}
749
+ function yh(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.ya.pb.Bb.send(h,{t:vh,s:Array.from(g)}).catch(k=>a.N.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.ea)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
750
+ function Bh(a,b,c,d){const e=new olympe.H.ya.pb.Bb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===qh){a.N.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.zc;a.C(c,qh,{id:b,rollback:g,error:f.r})}});d.xc(()=>e.stop())}
751
+ olympe.ab.xu=class extends olympe.ab.$g{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.ea=c}Z(){return olympe.dc.Ka.hq}L(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case ih:wh(this,b,e,d);break;case jh:xh(this,b,e,a,d);break;case mh:case nh:zh(this,b,e,d);break;case ph:Ah(this,b,e,a,d);break;case rh:e.t=c;olympe.H.ya.pb.Bb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case sh:case th:case uh:olympe.H.ya.pb.Bb.get(b,{t:c,f:e.file}).then(f=>{this.G.ka(e.file,
752
+ b,f);c===sh?this.G.Y(e.file,e.content,e.mimeType,e.Ze,e.ue):c===th?this.G.R(e.file,e.url,e.mimeType,e.Ze,e.ue):this.G.L(e.file,e.Ze,e.ue)}).catch(e.ue);break;default:this.N.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.ab.Buffer=class{constructor(){this.counter=0;this.Kb=new Map}buffer(a){const b=this.counter++;this.Kb.set(b,a);return this.clear.bind(this,b)}clear(a){this.Kb.delete(a)}};olympe.ab.pg=class a{constructor(b,c,d){this.N=b;this.ea=c;this.R=new olympe.ab.Buffer(this);this.L=new Map;this.G=this.Pb(d);new olympe.D.Zb('Data Router context');this.F=new Map;this.ka=new Map;this.cb()}cb(){this.N.info('Initializing DR layer');olympe.D.Tk(lc(this.ea),()=>{this.N.info('Router: ONLINE')},()=>{this.N.log('Router: OFFLINE (no auth layer not online)');for(const b of this.R.Kb.values())this.Fa(b)});this.N.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
753
+ this.R.buffer(b));this.Fa(b)}C(b,c){const d=olympe.W.fc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}qa(b){this.ka.set(olympe.W.xg(),b)}Ab(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Tb(b,c){this.L.set(b,c);c.C=this.Ab.bind(this);c.R=this.Ta.bind(this)}Y(b){return this.L.get(b)||this.L.get(olympe.dc.Ka.hq)}Ta(b,c){this.ka.forEach(d=>{d(b,c)})}Fa(b){this.N.debug('Processing message',b.toString());this.$a(b).forEach(c=>{(c=this.Y(c))&&c.L(b)})}$a(b){var c=olympe.dc.ga.ja.Rg,
754
+ d=olympe.dc.ga.ja.wi,e=olympe.dc.ga.ja.xi,f=olympe.dc.ga.ja.bh,g=olympe.dc.ga.ja.Og;const h=olympe.dc.ga.ja.Sh,k=olympe.dc.ga.ja.ti,l=olympe.dc.ga.ja.Ah;switch(b.type){case c:d=this.G.get(a.C.Rg)||[];break;case d:case e:d=this.G.get(a.C.lm)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.gt)||[];break;default:d=[]}c=b.content;e=olympe.auth.ta.C.Lg;f=olympe.auth.ta.C.Dh;g=kc(this.ea);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
755
+ g===a.F.$l&&e||g===a.F.ip&&d.get('id')===f||g===a.F.rc)return n=n.get('destinations'),this.N.debug('Message',b.toString(),'is redirect to',n),n;this.N.debug('Message',b.toString(),'not redirect');return b.C}Pb(b){const c=Object.values(olympe.ab.pg.C),d=Object.values(olympe.ab.pg.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
756
+ l).set('destinations',n),h.push(n),l===a.F.ip&&n.set('id',k.id)):this.N.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.N.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.N.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.N.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.ab.pg.C={Rg:'getContext',lm:'query',TRANSACTION:'transaction',gt:'file'};
757
+ olympe.ab.pg.F={rc:'default',$l:'offline',ip:'id'};olympe.ab.pg.ma=[olympe.dc.pg];olympe.ab.Qj=class{ka(){}Y(){}R(){}L(){}};olympe.ab.O={xa:'dr.Manager',Ea:'dr.Logger',oe:'dr.sources.Router',Dp:'dr.sources.Local',tm:'dr.sources.Server',jq:'dr.sources.Peer',Qg:'dr.sources.FileSource'};olympe.ab.Config={Vl:'dr.keepAliveTimeout',Mn:'dr.autoSync',Ln:'dr.autoPersist',Rq:'dr.syncTimeout',Dq:'dr.routing'};
758
+ olympe.U.config(function(a){E(a,olympe.ab.Config.Dq,{});E(a,olympe.ab.Config.Vl,3E5);E(a,olympe.ab.Config.Mn,!1);E(a,olympe.ab.Config.Ln,!1);E(a,olympe.ab.Config.Rq,3E4);C(a,olympe.ab.O.Ea,[olympe.sa.O.xa],b=>b.Qc('dr'));C(a,olympe.ab.O.Dp,[olympe.ab.O.Ea,olympe.ab.O.oe,olympe.auth.O.xa,olympe.ic.O.qo,new olympe.U.fa(olympe.ab.Config.Mn),new olympe.U.fa(olympe.ab.Config.Ln),new olympe.U.fa(olympe.ab.Config.Rq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
759
+ h);return new olympe.ab.Ei(b,c,d,e,f)});ta(a,olympe.ab.O.tm);B(a,olympe.ab.O.jq,olympe.ab.xu,olympe.ab.O.Ea,olympe.ab.O.Qg,new olympe.U.fa(olympe.ab.Config.Vl));ta(a,olympe.ab.O.Qg);B(a,olympe.ab.O.oe,olympe.ab.pg,olympe.ab.O.Ea,olympe.auth.O.xa,new olympe.U.fa(olympe.ab.Config.Dq));sa(a,olympe.dc.O.oe,olympe.ab.O.oe);C(a,olympe.dc.query.Nb.ak,[olympe.dc.query.Nb.ak],b=>new olympe.dc.km(b))},'olympe.dr');
760
+ olympe.U.run([olympe.ab.O.oe,olympe.ab.O.Dp,olympe.ab.O.tm,olympe.ab.O.jq],(a,...b)=>{b.forEach(c=>a.Tb(c.Z(),c))});olympe.H={};olympe.H.Jc={zh:1,dg:2,tc:3,pf:4,Ls:5,Ai:6,rA:7};olympe.H.ja={Ai:1,fv:2,ft:3,nf:5};olympe.H.ta=class{qa(){}connect(){}disconnect(){}th(){}uh(){}$k(){}G(){}td(){}Lc(){}Fa(){}Of(){}gs(){}ls(){}};olympe.H.ta.C={INIT:'initialize',CONNECTING:'connecting',gf:'disconnected',yh:'connected',pm:'reconnecting',tc:'error'};olympe.H.ta.G={Kh:1,mt:-1,zt:-2,Yu:-3};function Ch(a,b){const c=a.G.get(b)||a.Ta;a.G.delete(b);return`${c}/${b}`}
761
+ olympe.H.Qj=class{constructor(a,b,c,d,e){this.N=a;this.F=b;this.qa=c;this.Ta=d;this.cb=e;this.C=new Map;this.G=new Map;this.ea=new Map;this.Fa=new olympe.D.Zb('File manager context')}ka(a,b,c){b&&this.G.set(a,`${this.cb}/${b}`);c&&this.ea.set(a,c)}Y(a,b,c,d,e){const f=Pb(Ch(this,a),olympe.la.fb.ce.ik,b,olympe.la.fb.ResponseType.pl);Qb(f,{[olympe.la.fb.Headers.pi]:this.hd(a),[olympe.la.fb.Headers.Hj]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Td();g===olympe.la.fb.qd.Kh||g===olympe.la.fb.qd.vl?
762
+ (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.N.error(g),e(g))})}R(a,b,c,d,e){const f=olympe.D.Ia();d={Ze:f.C(d),ue:e&&f.C(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Pb(Ch(this,a));Qb(g,{[olympe.la.fb.Headers.pi]:this.hd(a)})}else g=Pb(b);g.F=olympe.la.fb.ResponseType.pl;Qb(g,{[olympe.la.fb.Headers.Hj]:c||'application/octet-stream'});this.Fa.run(()=>{this.F.C(g,h=>{const k=h.Td(),l=this.C.get(a);if(200<=k&&300>
763
+ k){const n=h.getData();l&&l.forEach(p=>{if(f.zb()){const q=f.Tb(),r=f.Z();this.N.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ze(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.ue&&p.ue(n)})}this.C.delete(a)})})}}L(a,b,c){const d=Pb(Ch(this,a),olympe.la.fb.ce.Hc);Qb(d,{[olympe.la.fb.Headers.pi]:this.hd(a)});this.F.C(d,e=>{e=e.Td();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.N.error(e),
764
+ c&&c(e))})}hd(a){const b=this.ea.get(a);b&&this.ea.delete(a);return b||olympe.D.Za(nc(this.qa))}};olympe.H.Qj.ma=[olympe.ab.Qj];const Dh=olympe.dc.ga.ja.Rg,Eh=olympe.dc.ga.ja.bh,Fh=olympe.dc.ga.ja.xk,Gh=olympe.dc.ga.ja.Og,Hh=olympe.dc.ga.ja.wi,Ih=olympe.dc.ga.ja.xi,Jh=olympe.dc.ga.ja.Vo,Kh=olympe.dc.ga.ja.Wo,Lh=olympe.dc.ga.ja.Hl,Mh=olympe.dc.ga.ja.ti,Nh=olympe.dc.ga.ja.Ah,Oh=olympe.dc.ga.ja.Sh,Ph=olympe.dc.ga.ja.Pj,Qh=olympe.dc.ga.ja.ev,Rh=olympe.dc.ga.ja.Eu,Sh=olympe.dc.ga.ja.nt,Th=olympe.dc.ga.ja.Un,Uh=olympe.dc.ga.ja.Is;
765
+ function Vh(a){a.F.Fa(olympe.H.Jc.zh,a.cb.bind(a));olympe.D.yc([lc(a.qa)],b=>{b=b.valueOf()?olympe.dc.tk.Yp:olympe.dc.tk.$l;a.R&&a.R(a.Z(),b)},'Server source is online')}function Wh(a,b,c){const d=b.Gc;b=new olympe.dc.transaction.Md(!0);d.$c(b);Xh(a,a.Ab,Eh,!0,be(b),e=>{c&&c(e);a.C(a.Z(),Ph,{id:d.Z(),finalize:olympe.dc.transaction.rg.C.Rp})})}
766
+ function Yh(a,b,c,d){const e=c.Z();a.N.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Ol?a.$a:a.Fa,g=(new olympe.H.$.Sj).ia(c);c=new olympe.async.ng(a.Y);b===Ih&&c.add((k,l)=>{a.G.set(e,{notification:null,Ux:a.Y.C(n=>n?l(n):k())});Zh(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ia();c.add((k,l)=>{h.run(()=>{Xh(a,f,Hh,!1,g,a.Y.C(n=>n?l(n.message):k()))})});Xb(c,(k,l)=>{const n=a.G.get(e);k&&n&&n.notification?a.C(a.Z(),Kh,n.notification):!k&&n&&$h(a,Jh,e,p=>p&&a.N.warn(p));
767
+ a.G.delete(e);k&&b===Ih&&a.F.gs(e);d(l?Error(l):null)});c.start()}function $h(a,b,c,d){a.N.log('Unsubscribe to: ',c);a.F.ls(c);Zh(a,b,{i:c},d)}function Zh(a,b,c,d){b={c:b};Object.assign(b,c);a.F.G(olympe.H.Jc.zh,b,d&&(e=>{d(e)}))}function Xh(a,b,c,d,e,f){if(a.F.qa()){const g=olympe.H.Jc.zh;!d&&e&&Object.assign(e,{c});c=olympe.D.Za(nc(a.qa)).valueOf();a.F.td(b,g,c,d,e,f)}else a.N.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
768
+ olympe.H.$g=class extends olympe.ab.$g{constructor(a,b,c,d,e){super(a);this.F=b;this.qa=c;new olympe.H.$.hb;this.ea=new olympe.dc.W.Hi(this.Z());this.ka=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Ta=e[0];this.$a=e[1];this.Fa=e[2];this.Ab=e[3];this.G=new Map;Vh(this)}Z(){return olympe.dc.Ka.Xc}L(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Dh:Xh(this,
769
+ this.Ta,olympe.dc.ga.ja.Rg,!1,null,c);break;case Gh:b=new olympe.dc.transaction.Md;var d=a.Gc;a=a.rh;d.$c(b);Zh(this,olympe.dc.ga.ja.Og,{i:d.Z(),r:a,p:be(b)});c(null);break;case Eh:b=new olympe.dc.transaction.Md;d=a.Gc;a=a.rh;d.$c(b);Zh(this,olympe.dc.ga.ja.bh,{i:d.Z(),r:a,p:be(b)},c);break;case Fh:Wh(this,a,c);break;case Hh:case Ih:Yh(this,b,a,c);break;case Jh:$h(this,b,a,c);break;case Qh:Zh(this,Qh,{},c);break;case Rh:Zh(this,Rh,{},c);break;case Sh:Zh(this,Sh,{},c);break;case Th:Zh(this,Th,a,c);
770
+ break;case Uh:Zh(this,Uh,{},c);break;case Nh:this.ka.R(a.file,a.url,a.mimeType,a.Ze,a.ue);break;case Mh:this.ka.L(a.file,a.Ze,a.ue);break;case Oh:this.ka.Y(a.file,a.content,a.mimeType,a.Ze,a.ue);break;default:this.N.info(`Message of type ${b} not supported yet`)}}cb(a){var b=olympe.dc.ga.ja.yl,c=olympe.dc.ga.ja.Fj;const d=olympe.dc.ga.ja.ek,e=olympe.dc.ga.ja.Qu,f=olympe.dc.ga.ja.Ap;var g=olympe.dc.ga.ja.ot;const h=a.c;h===b?(a=this.ea.C(a.p),this.C(this.Z(),b,a)):h===c?(g=a.error.reason,b=this.ea.C(a.p),
771
+ this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Lh?(g=olympe.dc.Ka.rb,c=olympe.dc.Ka.Xc,b=a.i,0<a.s?g=new olympe.dc.query.Xi.Uj(b,c,g,a.info.error.reason):(g=this.ea.R(b,g,a.p),this.N.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.N.log('< Graphdef Result (ID ',g.Z(),') with',g.Gc.G(),'operations')),this.C(this.Z(),Lh,g)):h===Kh?(g=a.i,a=this.ea.L(g,a.p),this.G.has(g)?(g=this.G.get(g),g.notification?jf(a,g.notification):g.notification=a):this.C(this.Z(),Kh,a)):h===f?(g=new olympe.dc.query.Hp(a.i),
772
+ a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.rg.C.ek,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),Ph,{id:a.i,finalize:g,error:c})):h===e?(g=this.G.get(a.i))&&g.Ux(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Z(),g,{OC:c,hD:b,cD:a}))}};olympe.H.$g.F={Xz:1,YA:2};olympe.H.$g.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.Wj=class{constructor(){}};olympe.H.Wj.ma=[olympe.dc.aa.Wj];olympe.H.ya={};function ai(a,b,c){Ub(a.C,b,d=>{d=new olympe.H.ya.Kb.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);return c(d)})}function bi(a,b,c){a.L.set(b,c)}function ci(a,b){return new Promise((c,d)=>{Vb(a.C,b,e=>e?d(e):c())})}function di(a,b){return new Promise((c,d)=>{a.R.oh(b.hd(),(e,f)=>e?d(e):c(f))})}
773
+ olympe.H.ya.ta=class{constructor(a,b,c,d){this.N=a;this.R=c;a=new olympe.W.ar(d.get('messageTimeout'));a.C=this.Y.bind(this);this.L=a;a=d.get('url');d=d.get('connectionOptions');this.C=new olympe.la.dk(a,d);this.G=1;this.F=olympe.W.fc()}connect(){return new Promise(a=>{Tb(this.C)?a():this.C.connect(()=>{Ub(this.C,this.F,b=>{b=new olympe.H.ya.Kb.Response(b.dest,b.src,b.seq,b.type,b.content);const c=this.L.get(b.G);c&&(this.L.delete(b.G),c(b))});a()})})}disconnect(){return new Promise(a=>this.C.end(!1,
774
+ ()=>a()))}Ke(a,b,c){return new Promise((d,e)=>{const f=a.source,g=new olympe.H.ya.Kb.Response(f,this.F,a.G,b,c);this.C.publish(f,g.ia(),void 0,h=>h?e(h):d())})}request(a,b,c){return new Promise((d,e)=>{const f=this.G;this.G++;var g=olympe.D.Za(nc(this.R));g=new olympe.H.ya.Kb.Request(a,this.F,g,f,b,c);this.C.publish(a,g.ia(),void 0,h=>h?e(h):d(f))})}notify(a,b,c){return new Promise((d,e)=>{var f=this.G;this.G++;f=new olympe.H.ya.Kb.Response(b,a,f,olympe.H.ya.Kb.Response.ja.wm,c);this.C.publish(b,
775
+ f.ia(),void 0,g=>g?e(g):d())})}Y(a,b){b(new olympe.H.ya.Kb.Response(this.F,this.F,a,olympe.H.ya.Kb.Response.ja.tc,{reason:'Timeout'}))}};olympe.H.ya.Kb={};olympe.H.ya.Kb.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.L=c;this.C=e;this.F=f||null}hd(){return this.L}ia(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.L,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.ya.Kb.Request.ja={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.ya.Kb.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}ia(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};olympe.H.ya.Kb.Response.ja={wm:0,Gn:1,Yq:2,tc:3};olympe.H.ya.pb={};const ei=olympe.H.ya.Kb.Response.ja.Gn,fi=olympe.H.ya.Kb.Response.ja.tc,gi=olympe.H.ya.Kb.Response.ja.wm,hi=olympe.H.ya.Kb.Response.ja.Yq,ii=olympe.H.ya.Kb.Request.ja.SEND,ji=olympe.H.ya.Kb.Request.ja.GET,ki=olympe.H.ya.Kb.Request.ja.PUBLISH,li=olympe.H.ya.Kb.Request.ja.SUBSCRIBE;
776
+ olympe.H.ya.pb.Bb=class{constructor(a,b){this.C=olympe.H.ya.Tc();this.F=a;this.G=new olympe.D.Zb(`Service ${a}`,'function'===typeof b.Fc?b.Fc():b);this.N=olympe.sa.Ya(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();ci(this.C,this.F).catch(c=>this.N.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{ai(this.C,this.F,c=>a.next(new olympe.H.ya.pb.ga(c,this.C)))}).catch(c=>this.N.error('Failed to connect to the bus: '+
777
+ c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.ya.Tc();return c.connect().then(()=>c.request(a,ki,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.ya.Tc();e.connect().then(()=>e.request(a,ii,b)).then(f=>{bi(e,f,g=>{switch(g.F){case ei:c();break;case fi:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.ya.Tc();e.connect().then(()=>
778
+ e.request(a,ji,b)).then(f=>{bi(e,f,g=>{switch(g.F){case gi:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case fi:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.Fc?b.Fc():b;return new rxjs.Observable(e=>{const f=olympe.H.ya.Tc();let g=null;const h=()=>{e.complete();g&&ci(f,g).catch(k=>olympe.sa.Ya('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.xc(h);f.connect().then(()=>
779
+ f.request(a,li,c)).then(k=>{bi(f,k,l=>{switch(l.F){case hi:g=l.C.topic;ai(f,g,n=>{switch(n.C){case ki:e.next(n.F);break;default:e.error('Unsupported notification message. It should be a publish'),h()}});break;case fi:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.ya.pb.Bb.observe=olympe.H.ya.pb.Bb.observe;olympe.H.ya.pb.Bb.get=olympe.H.ya.pb.Bb.get;olympe.H.ya.pb.Bb.send=olympe.H.ya.pb.Bb.send;
780
+ olympe.H.ya.pb.Bb.publish=olympe.H.ya.pb.Bb.publish;olympe.H.ya.pb.Bb.prototype.stop=olympe.H.ya.pb.Bb.prototype.stop;olympe.H.ya.pb.Bb.prototype.listen=olympe.H.ya.pb.Bb.prototype.listen;const mi=olympe.H.ya.Kb.Response.ja.Gn,ni=olympe.H.ya.Kb.Response.ja.tc,oi=olympe.H.ya.Kb.Response.ja.wm,pi=olympe.H.ya.Kb.Response.ja.Yq,qi=olympe.H.ya.Kb.Request.ja.SEND,ri=olympe.H.ya.Kb.Request.ja.GET,si=olympe.H.ya.Kb.Request.ja.SUBSCRIBE;
781
+ olympe.H.ya.pb.ga=class{constructor(a,b){this.request=a;this.C=b}yj(){return di(this.C,this.request)}source(){return this.request.source}body(){return this.request.F}Hk(){return this.request.C===qi?this.C.Ke(this.request,mi,void 0):Promise.reject('Should only call `ack` on SEND requests')}Ke(a){return this.request.C===ri?this.C.Ke(this.request,oi,a):Promise.reject('Should only call `reply` on GET requests')}$r(a){return this.request.C===si?this.C.Ke(this.request,pi,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}wg(a){return this.C.Ke(this.request,
782
+ ni,{reason:a.message})}};olympe.H.ya.pb.ga.prototype.fail=olympe.H.ya.pb.ga.prototype.wg;olympe.H.ya.pb.ga.prototype.notifyOn=olympe.H.ya.pb.ga.prototype.$r;olympe.H.ya.pb.ga.prototype.reply=olympe.H.ya.pb.ga.prototype.Ke;olympe.H.ya.pb.ga.prototype.ack=olympe.H.ya.pb.ga.prototype.Hk;olympe.H.ya.pb.ga.prototype.body=olympe.H.ya.pb.ga.prototype.body;olympe.H.ya.pb.ga.prototype.source=olympe.H.ya.pb.ga.prototype.source;olympe.H.ya.pb.ga.prototype.userTag=olympe.H.ya.pb.ga.prototype.yj;olympe.H.pa={};function ti(a,b,c,d){c.c=b;a.C.G(olympe.H.Jc.pf,c,d)}
783
+ olympe.H.pa.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.N=a;this.C=b;this.F=h;this.$a=c;this.G=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.pk.C.GET))}),l.close())}R(a){this.C.th(a)}L(a){this.C.uh(a)}Y(a){this.C.$k(a)}cb(a){this.C.Of(olympe.H.Jc.pf,'logoutHandler');this.C.Fa(olympe.H.Jc.pf,b=>{const c=b.c;c===olympe.H.pa.Ua.C.Zt?(this.C.Lc(),a(olympe.auth.ta.F.zj,b)):c===olympe.H.pa.Ua.C.Ku&&a(olympe.auth.ta.F.jp,
784
+ b)},'logoutHandler')}ea(a,b){ti(this,olympe.H.pa.Ua.C.pf,{token:a.Jf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.tc:b(Error('Invalid token'));break;case olympe.H.pa.Ua.C.Oi:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.Fq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.fm(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}Fa(a,b){ti(this,olympe.H.pa.Ua.C.tt,
785
+ {I:a.Ud()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.tc:b(Error(`Username '${a.Ud()}' invalid, or password does not match`));break;case olympe.H.pa.Ua.C.Su:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Ta(a,b){ti(this,olympe.H.pa.Ua.C.xs,{A:a.get('a'),M:a.get('m1'),I:a.Ud()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.tc:this.N.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
786
+ break;case olympe.H.pa.Ua.C.Oi:c=d.payload;this.N.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.tf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}qa(a){ti(this,olympe.H.pa.Ua.C.Re,{},(b,c)=>{null!==b?a(b):c.url&&c.request?a(null,c.url,c.request.replace(/\s/g,''),c.id):a(Error('Missing parameters from server response'))})}ka(a){const b=olympe.D.Za(olympe.auth.Tc().C.Eb())||null;if(b instanceof
787
+ olympe.auth.fm){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Jf();f.access_token=b.Yj().access_token||null;this.F.redirect(`${this.G}/logout`,f)};a=this.F.C();const d=new URL(a);if(0!==d.hash.length||0!==d.search.length){const e=this.storage.C('AUTH');d.hash='';d.search='';e&&e.set('redirectTo',a,()=>{e.close();c(d.toString())})}else c(a)}else this.C.G(olympe.H.Jc.pf,{c:olympe.H.pa.Ua.C.$t},a)}ii(a){this.C.G(olympe.H.Jc.pf,{c:olympe.H.pa.Ua.C.nf},a)}oh(a,b,c){this.C.td(this.$a+
788
+ '/'+a,olympe.H.Jc.pf,b,!1,null,(d,e)=>{c(d,e)})}Qr(){return this.G}};olympe.H.pa.Ua.C={pf:1,$t:2,tc:3,nf:5,Oi:6,tt:10,Su:11,xs:12,Re:13,Ku:14,Zt:20};olympe.H.pa.Ua.ma=[olympe.auth.Uu,olympe.auth.Hb.pa.Fi,olympe.auth.Hb.pa.Ee,olympe.auth.Hb.pa.Re];olympe.H.$={};olympe.H.$.Zc=function(){};olympe.H.$.Zc.prototype.ia=function(){};olympe.H.$.Ne=function(){};olympe.H.$.Ne.prototype.ia=function(){};olympe.H.$.bb=function(){};olympe.H.$.bb.prototype.ia=function(){};olympe.H.$.wf=function(){};olympe.H.$.wf.prototype.ia=function(){};olympe.H.$.hb=function(){this.X={};this.Db={};this.V={};this.oa=Object.create(null);var a=new olympe.H.$.X.Sb;this.X[O(olympe.dc.X.Sb)]=a;a=new olympe.H.$.X.Be;this.X[O(olympe.dc.X.Be)]=a;a=new olympe.H.$.X.Dc;this.X[O(olympe.dc.X.Dc)]=a;this.X[O(olympe.dc.X.Od)]=new olympe.H.$.X.Od;this.X[O(olympe.dc.X.uc)]=new olympe.H.$.X.uc;this.X[O(olympe.dc.X.be)]=new olympe.H.$.X.be;this.X[O(olympe.dc.X.Gd)]=new olympe.H.$.X.Gd;a=new olympe.H.$.Db.Number;this.Db[O(olympe.dc.Db.Number)]=a;a=new olympe.H.$.Db.String;
789
+ this.Db[O(olympe.dc.Db.String)]=a;a=new olympe.H.$.V.Ic;this.V[O(olympe.dc.V.Ic)]=a;this.V[O(olympe.dc.V.ye)]=new olympe.H.$.V.ye;this.V[O(olympe.dc.V.Fe)]=new olympe.H.$.V.Fe;a=new olympe.H.$.V.Vc;this.V[O(olympe.dc.V.Vc)]=a;a=new olympe.H.$.V.zd;this.V[O(olympe.dc.V.zd)]=a;this.V[O(olympe.dc.V.md)]=new olympe.H.$.V.md;a=new olympe.H.$.V.jf;this.V[O(olympe.dc.V.jf)]=a;a=new olympe.H.$.V.kf;this.V[O(olympe.dc.V.kf)]=a;this.oa[O(olympe.dc.oa.bd)]=new olympe.H.$.oa.bd;a=new olympe.H.$.oa.me;this.oa[O(olympe.dc.oa.me)]=
790
+ a;a=new olympe.H.$.oa.qe;this.oa[O(olympe.dc.oa.qe)]=a;a=new olympe.H.$.oa.ve;this.oa[O(olympe.dc.oa.ve)]=a;a=new olympe.H.$.oa.le;this.oa[O(olympe.dc.oa.le)]=a;this.oa[O(olympe.dc.oa.sf)]=new olympe.H.$.oa.sf};olympe.H.$.hb.prototype.constructor=olympe.H.$.hb;function ui(a,b,c){var d=b.na(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ia(b,c,a)}
791
+ function vi(a,b,c){var d=b.na(),e=a.oa[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ia(b,c,a)}
792
+ function wi(a,b){return a&&a.xf?'"$'+b.add(a)+'"':a instanceof olympe.D.ra||a instanceof olympe.D.da?String(a):a instanceof olympe.D.Xa?'"'+a+'"':a instanceof olympe.D.kb?(a=a.rs(),String(`{"c":4,"y":${a.getUTCFullYear()},"M":${a.getUTCMonth()+1},"d":${a.getUTCDate()},"h":${a.getUTCHours()},"m":${a.getUTCMinutes()},"s":${a.getUTCSeconds()},"S":${a.getUTCMilliseconds()},"z":0}`)):a instanceof olympe.D.Color?'{"c":7,"r":'+a.Nf().valueOf()+',"g":'+a.Hf().valueOf()+',"b":'+a.Cf().valueOf()+',"a":'+a.Bf().valueOf()+
793
+ '}':a instanceof olympe.dc.Ec?'{"c":8,"t":"'+a.T()+'"}':JSON.stringify(a)};olympe.H.$.Sj=class{ia(a){const b=Object.create(null);b.i=a.Z();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.Ol?We(a.ph):olympe.dc.Ub.NONE;b.q=nf(a).map(this.C.bind(this));return b}C(a){const b=a.Sd(),c=b.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li,d=Object.create(null);d.t=b.T();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.kh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.Gd=function(){};olympe.H.$.X.Gd.prototype.constructor=olympe.H.$.X.Gd;olympe.H.$.X.Gd.prototype.ia=function(){return'{"y":15}'};olympe.H.$.X.Gd.ma=[olympe.H.$.Zc];olympe.H.$.X.uc=function(){};olympe.H.$.X.uc.prototype.constructor=olympe.H.$.X.uc;olympe.H.$.X.uc.prototype.ia=function(a,b,c){return'{"y":21,"p":'+ui(c,a.C,b)+'}'};olympe.H.$.X.uc.ma=[olympe.H.$.Zc];olympe.H.$.X.Be=function(){};olympe.H.$.X.Be.prototype.constructor=olympe.H.$.X.Be;olympe.H.$.X.Be.prototype.ia=function(a){var b=null!==a.Qa()?a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li:olympe.H.$.X.Sb.C.Sn;return'{"y":12,"t":'+JSON.stringify(Zg(a))+',"d":'+b+'}'};olympe.H.$.X.Be.ma=[olympe.H.$.Zc];olympe.H.$.X.Dc=function(){};olympe.H.$.X.Dc.prototype.constructor=olympe.H.$.X.Dc;olympe.H.$.X.Dc.prototype.ia=function(a){const b=null!==a.Qa()?a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li:olympe.H.$.X.Sb.C.Sn;return'{"y":11,"t":"'+a.T()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Dc.ma=[olympe.H.$.Zc];olympe.H.$.X.Sb=function(){};olympe.H.$.X.Sb.C={Sn:0,Di:1,Li:2};olympe.H.$.X.Sb.prototype.constructor=olympe.H.$.X.Sb;olympe.H.$.X.Sb.prototype.ia=function(a){const b=a.Qa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Di:olympe.H.$.X.Sb.C.Li;return'{"y":10,"t":"'+a.T()+'","d":'+b+'}'};olympe.H.$.X.Sb.ma=[olympe.H.$.Zc];olympe.H.$.X.Od=function(){};olympe.H.$.X.Od.prototype.constructor=olympe.H.$.X.Od;olympe.H.$.X.Od.prototype.ia=function(a,b,c){var d=a.Bd;const e=d.na();var f=c.Db[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.ia(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.$.X.Od.ma=[olympe.H.$.Zc];olympe.H.$.X.be=function(){};olympe.H.$.X.be.prototype.constructor=olympe.H.$.X.be;olympe.H.$.X.be.prototype.ia=function(a,b){var c=a.start;c=c&&c.xf?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.xf?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.$.X.be.ma=[olympe.H.$.Zc];olympe.H.$.Db={};olympe.H.$.Db.Number=class{constructor(){}ia(a,b,c){return`{"y":11,"v":${vi(c,a.C,b)}}`}};olympe.H.$.Db.Number.ma=[olympe.H.$.Ne];olympe.H.$.Db.String=class{constructor(){}ia(a,b,c){return`{"y":10,"v":${vi(c,a.C,b)}}`}};olympe.H.$.Db.String.ma=[olympe.H.$.Ne];olympe.H.$.V={};olympe.H.$.V.Vc=function(){};olympe.H.$.V.Vc.prototype.constructor=olympe.H.$.V.Vc;olympe.H.$.V.Vc.prototype.ia=function(a,b,c){const d=vi(c,a.source,b);c=vi(c,a.getValue(),b);a=wi(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.V.Vc.ma=[olympe.H.$.bb];olympe.H.$.V.Ic=function(){};olympe.H.$.V.Ic.prototype.constructor=olympe.H.$.V.Ic;olympe.H.$.V.Ic.prototype.ia=function(a,b,c){const d=vi(c,a.G,b);a=vi(c,a.L,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Ic.ma=[olympe.H.$.bb];olympe.H.$.V.ye=function(){};olympe.H.$.V.ye.prototype.constructor=olympe.H.$.V.ye;olympe.H.$.V.ye.prototype.ia=function(a,b,c){const d=vi(c,a.G,b);a=vi(c,a.L,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.ye.ma=[olympe.H.$.bb];olympe.H.$.V.jf=class{ia(a){const b=Tg(a).map(d=>'"'+d+'"'),c=Ug(a).map(d=>d===olympe.dc.Aa.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.V.jf.ma=[olympe.H.$.bb];olympe.H.$.V.kf=class{ia(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.V.kf.ma=[olympe.H.$.bb];olympe.H.$.V.md=class{ia(a,b,c){return'{"y":30,"p":'+ui(c,a.G,b)+'}'}};olympe.H.$.V.md.ma=[olympe.H.$.bb];olympe.H.$.V.zd=class{ia(a,b,c){c=vi(c,a.source,b);const d=a.L;a=wi(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.V.zd.ma=[olympe.H.$.bb];olympe.H.$.V.Fe=function(){};olympe.H.$.V.Fe.prototype.constructor=olympe.H.$.V.Fe;olympe.H.$.V.Fe.prototype.ia=function(a,b,c){var d=vi(c,a.G,b);a=vi(c,a.L,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Fe.ma=[olympe.H.$.bb];olympe.H.$.oa={};olympe.H.$.oa.Oc=function(){};olympe.H.$.oa.Oc.prototype.constructor=olympe.H.$.oa.Oc;olympe.H.$.oa.Oc.prototype.C=function(){};
794
+ olympe.H.$.oa.Oc.prototype.ia=function(a,b,c){var d=wi(a.$e,b),e=a.Qd();e=e?',"b":'+wi(e,b):'';if(a=a.Bg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.na(),r=h.X[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.ia(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.$.oa.Oc.ma=[olympe.H.$.wf];olympe.H.$.oa.ve=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.ve.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.ve.prototype.constructor=olympe.H.$.oa.ve;olympe.H.$.oa.ve.prototype.C=function(){return 13};olympe.H.$.oa.bd=function(){};olympe.H.$.oa.bd.prototype.constructor=olympe.H.$.oa.bd;olympe.H.$.oa.bd.prototype.ia=function(a,b){return'{"y":10,"v":'+wi(a.value,b)+'}'};olympe.H.$.oa.bd.ma=[olympe.H.$.wf];olympe.H.$.oa.le=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.le.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.le.prototype.constructor=olympe.H.$.oa.le;olympe.H.$.oa.le.prototype.C=function(){return 14};olympe.H.$.oa.me=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.me.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.me.prototype.constructor=olympe.H.$.oa.me;olympe.H.$.oa.me.prototype.C=function(){return 11};olympe.H.$.oa.qe=function(){olympe.H.$.oa.Oc.call(this)};olympe.H.$.oa.qe.prototype=Object.create(olympe.H.$.oa.Oc.prototype);olympe.H.$.oa.qe.prototype.constructor=olympe.H.$.oa.qe;olympe.H.$.oa.qe.prototype.C=function(){return 12};olympe.H.$.oa.sf=class{ia(){return'{"y":19}'}};olympe.H.$.oa.sf.ma=[olympe.H.$.wf];olympe.H.jd={};function xi(a,b){a.N.info('Initializing SERVER layer');if(a.N.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.N.debug(c.join('\n\t'))}a.Fa(olympe.H.Jc.tc,c=>{switch(c.c){case olympe.H.ja.fv:a.N.error('Unknown message sent to the server:',olympe.H.ta.F[c.s]);break;case olympe.H.ja.ft:a.N.error('Fatal error, the last message is probably too big according to the websocket config.'),a.R.forEach((d,e)=>{yi(a,e,c.i)})}});b.get('autoConnect')&&(a.N.debug('Connecting automatically'),
795
+ a.connect());olympe.D.Tk(a.L.Eb(),()=>{for(const c of a.bl.values())c();Kb(a.Pf.bind(a),a.Vf,'checkTimeoutMessages')},()=>{for(const c of a.Wf.values())c();Lb('checkTimeoutMessages');a.Pf()});a.N.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
796
+ function zi(a,b){if(a.C!==b)switch(a.N.log('State change '+a.C+' --\x3e '+b),a.C=b,b){case olympe.H.ta.C.CONNECTING:break;case olympe.H.ta.C.yh:a.L.update(olympe.D.ra.F);olympe.D.Tk(a.cc.R(),a.Ta.bind(a,a.By),a.Ta.bind(a,5E3));break;case olympe.H.ta.C.pm:a.connect(!0);break;case olympe.H.ta.C.tc:a.N.error('Connection to server',a.ka.C(),'aborted due to error');a.L.update(olympe.D.ra.C);break;case olympe.H.ta.C.gf:a.L.update(olympe.D.ra.C);a.lc&&(a.N.info('Disconnected, will try to auto reconnect in',
797
+ a.Pc,'ms'),Ib(()=>{a.connect()},a.Pc));break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
798
+ function Ai(a,b){const c=olympe.H.ta.L.Oi,d=olympe.H.ta.L.iu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.N.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.ta.F[g]?`Status code = ${g} [${olympe.H.ta.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);
799
+ h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}
800
+ function Bi(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Nr;const c=b.messageFamily,d=a(olympe.H.Jc,c),e=b.payload;b='';switch(c){case olympe.H.Jc.zh:b=a(olympe.dc.ga.ja,e.c);break;case olympe.H.Jc.tc:b=a(olympe.H.ja,e.c);break;case olympe.H.Jc.pf:b=a(olympe.H.pa.Ua.C,e.c);break;case olympe.H.Jc.Ai:2===e.c&&(b=a(olympe.H.ta.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
801
+ function yi(a,b,c){if(a.R.delete(b)){c={s:23,info:c};const d=a.Y.get(b);d&&d(c);a.Y.delete(b)}}function Ci(a,b){a.N.error(b);zi(a,olympe.H.ta.C.tc)}function Di(a,b,c,d){a.N.info('Connected to',a.ka.C(),' | ',c?'server version:'+c:'',null!==d?`activity timeout: ${d}s`:'');zi(a,olympe.H.ta.C.yh);b&&a.bs.forEach(e=>e());null===d||a.Tb||Ei(a,d);a.Pb.forEach(e=>{const f=JSON.stringify(e);a.N.debug('>',Bi(e));a.F.send(f);e=e.seqId;a.Y.has(e)&&a.R.set(e,Date.now())});a.Pb.length=0}
802
+ function Ei(a,b){Lb('keepAliveSubscription');const c=Kb(()=>{a.qa()?a.G(olympe.H.Jc.zh,{c:olympe.H.ja.nf,subIds:Array.from(a.Ab)},(d,e)=>d&&a.N.error(e)):c.cancel()},1E3*b,'keepAliveSubscription')}
803
+ olympe.H.jd.ta=class{constructor(a,b,c,d){this.N=a;this.cc=b;this.ka=c;this.F=null;this.config=d;this.Pc=this.config.get('reconnectionDelay');this.By=this.config.get('pingInterval');this.Cy=this.Pc/4;this.lc=d.get('autoConnect');this.Dy=d.get('retryHttpOverload');this.Vf=d.get('messageTimeout');this.ea=Ka(d.get('clientVersion'));this.$a=Ka(d.get('serverVersion'));this.C=olympe.H.ta.C.INIT;this.Tb=d.get('getContextMode');this.es=1;this.ee=null;this.Y=new Map;this.cb=new Map;this.L=olympe.D.Nc(olympe.D.ra,
804
+ 'Server is online');this.bl=new Map;this.Wf=new Map;this.bs=new Map;this.Pb=[];this.R=new Map;this.Ab=new Set;this.xy=new Map;xi(this,d)}qa(){return this.C===olympe.H.ta.C.yh}connect(a=!1){this.lc=!0;this.N.log('Asking NET layer for a connection to',Mb(this.ka)+':'+this.ka.port,'...');this.F=this.cc.ka(this.ka);this.F.qa(this.Lc.bind(this,a));this.F.ka(this.Ge.bind(this));this.F.ea(()=>{this.F=null;this.C===olympe.H.ta.C.yh?zi(this,olympe.H.ta.C.pm):this.C!==olympe.H.ta.C.tc&&zi(this,olympe.H.ta.C.gf)});
805
+ a||zi(this,olympe.H.ta.C.CONNECTING)}disconnect(){const a=olympe.H.ta.C.CONNECTING;if(this.C===olympe.H.ta.C.yh||this.C===a)this.lc=!1,zi(this,olympe.H.ta.C.gf)}th(a){const b=olympe.W.fc();this.bl.set(b,a);olympe.D.Za(this.L)===olympe.D.ra.F&&a()}uh(a){var b;void 0===b&&(b=olympe.W.fc());this.Wf.set(b,a);olympe.D.Za(this.L)===olympe.D.ra.C&&a()}$k(a){var b;void 0===b&&(b=olympe.W.fc());this.bs.set(b,a)}Lc(a=!1){this.N.debug('Websocket connected, sending handshake. Client version:',La(this.ea),'subscribeEverything:',
806
+ this.Tb?'NO':'YES');this.G(olympe.H.Jc.Ai,{c:olympe.H.ja.Ai,cv:La(this.ea),m:this.Tb?0:1,s:this.ee},this.sy.bind(this,a))}G(a,b,c){const d=this.es;this.es++;b={seqId:d,messageFamily:a,payload:b};void 0!==c&&this.Y.set(d,Ai(this,c));const e=[olympe.H.ta.C.CONNECTING,olympe.H.ta.C.pm];this.qa()||a===olympe.H.Jc.Ai&&e.includes(this.C)?(a=JSON.stringify(b),this.N.debug('>',Bi(b)),this.F.send(a),void 0!==c&&this.R.set(d,Date.now())):this.Pb.push(b)}td(a,b,c,d,e,f){c&&''!==c||this.N.warn('Trying to send an http request with an invalid authorizationToken');
807
+ const g=Pb(a);if(e){g.method=olympe.la.fb.ce.hm;e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Qb(g,{'Content-Type':'application/json'});this.N.log('HTTP POST >',Bi(e))}else this.N.log('HTTP GET call to',a);g.F=olympe.la.fb.ResponseType.vk;Qb(g,{Authorization:c});const h=()=>{this.cc.C(g,k=>{switch(k.Td()){case olympe.la.fb.qd.Kh:case olympe.la.fb.qd.vl:case olympe.la.fb.qd.zj:k=k.getData();if(b!==olympe.H.Jc.zh||d){f&&f(null,k);break}k=this.Ge(k);f&&f(k);k&&this.N.error(k.message);
808
+ break;case olympe.la.fb.qd.Mu:Ib(h,this.Dy);break;case olympe.la.fb.qd.Fs:this.N.debug(`HTTP request canceled (${a}).`);f&&f(null);break;default:k=Error(`Server is currently not available, http status: ${k.Td()}`),f&&f(k)}})};h()}Fa(a,b,c){void 0===c&&(c=olympe.W.fc());let d=this.cb.get(a);void 0===d&&(d=new Map,this.cb.set(a,d));d.set(c,b)}Of(a,b){a=this.cb.get(a);void 0!==a&&a.delete(b)}gs(a){this.Ab.add(a)}ls(a){this.Ab.delete(a)}sy(a,b,c){if(b)Ci(this,'Error in receiving handshake response: '+
809
+ b.message);else{this.N.debug('Handshake response received');var d=olympe.H.ta.G;b=c.sv||'undefined';var e=c.activityTimeout?Math.max(c.activityTimeout-60,5):null;switch(c.status){case d.zt:Ci(this,`Framework version (${La(this.ea)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case d.Yu:Ci(this,`Framework version (${La(this.ea)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case d.mt:Ci(this,'Handshake failed. See orchestrator logs for more info.');
810
+ return}if(this.$a.sb(olympe.W.Uh.C))this.N.warn('Handshake successful but received server version',b,'is invalid. Cannot check against it');else try{var f=Ka(b);if(f.vj(this.$a)){Ci(this,`Framework v${La(this.ea)} is expecting Orchestrator to be at least in v${La(this.$a)}`);return}this.N.log('Handshake successful. Orchestrator version: ',f,'required:',La(this.$a))}catch(g){Ci(this,g);return}if(f=c.identityProviders)for(const [g,h]of Object.entries(f))this.xy.set(g,h);this.ee=c.sessionId||null;Di(this,
811
+ a,b,e)}}Ta(a=-1){if(this.C===olympe.H.ta.C.yh){var b=olympe.D.Ia(),c='onConnectionLost'+olympe.W.fc();this.N.debug('Sending Ping');this.G(olympe.H.Jc.Ls,{c:1},()=>{Jb(c);0<a&&!b.zb()&&b.run(()=>{Ib(this.Ta.bind(this,a),a,c)})});var d=this.Cy;Ib(()=>{this.N.debug('Force close websocket after offline for',d);olympe.D.zg().run(()=>{this.C!==olympe.H.ta.C.gf&&(this.F&&this.F.close(),zi(this,olympe.H.ta.C.gf))})},d,c)}}Ge(a){try{var b=JSON.parse(a)}catch(d){return this.N.error('Unable to parse response from server: '+
812
+ d.toString()),Error('Unable to parse response from server')}this.N.debug('<',Bi(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.R.delete(a)){const d=this.Y.get(a);d&&d(b);this.Y.delete(a)}a=this.cb.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}Pf(){const a=Date.now();let b=!1;for(const [c,d]of this.R)a-d>this.Vf&&(this.N.warn(`No response was received from the server for the seqId = ${c}`),yi(this,c,{error:{reason:'Message timeout: never receive acknowledge'}}),b=!0);b&&
813
+ this.Ta()}};olympe.H.jd.ta.C='checkTimeoutMessages';olympe.H.ta.L={Oi:0,iu:18,Yz:23};
814
+ olympe.H.ta.F={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',18:'Try to unsubscribe multiple times',
815
+ 21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.H.jd.ta.ma=[olympe.H.ta];olympe.H.O={xa:'server.Manager',Wn:'server.bus.Manager',Ea:'server.Logger',Nd:'server.Source',Qg:'server.FileSource',pp:'server.ImportFileSvcHttpRequest',Rn:'server.BackupSvcHttpRequest',aq:'server.OpenIDSvcHttpRequest',So:'server.GetContextSvcPathRequest',mp:'server.ImplicitGDSvcPathRequest',Eo:'server.ExplicitGDSvcPathRequest',$q:'server.TransactionOverHttpPathRequest',kr:'server.UserTokenRequest',ir:'server.UserTagRequest',gr:'server.UserRolesRequest',Cq:'server.RoleMembersRequest',Eh:'server.IOUrlsProvider',
816
+ Ko:'server.fileSvcUrl',iq:'communication.peerFileSvcUrl'};olympe.H.wd={mi:'server.connectors.Auth',DA:'server.connectors.Signaling'};
817
+ olympe.H.Config={yd:'server.host',Ld:'server.port',Ad:'server.ssl',In:'server.autoConnect',vq:'server.reconnectionDelay',mq:'server.pingInterval',ym:'server.messageTimeout',Aq:'server.retryHttpOnOverload',co:'server.clientVersion',Iq:'server.serverVersion',Vn:'bus.host',Xn:'bus.path',Yn:'bus.port',Zn:'bus.vhost',nf:'bus.keepalive',Hu:'bus.reschedulePings',Js:'bus.clientId',Hs:'bus.clean',Du:'bus.reconnectPeriod',Ms:'bus.connectTimeout',er:'bus.username',gq:'bus.password',zu:'bus.queueQoSZero'};
818
+ olympe.H.qb={Fd:'server.basePath',qr:'server.wsPath',Io:'server.filePath',op:'server.importFilePath',Qn:'server.backupSvcPath',$p:'server.openIDSvcPath',Ro:'server.GetContextSvcPath',np:'server.ImplicitGraphdefSvcPath',Fo:'server.ExplicitGraphdefSvcPath',Zq:'server.TransactionOverHttpPath',jr:'server.userTokenSvcPath',hr:'server.userTagPath',fr:'server.userRolesPath',Bq:'server.roleMembersPath',gm:'communication.peerFileSvcPath'};
819
+ olympe.U.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;E(a,olympe.H.Config.yd,b);E(a,olympe.H.Config.Ld,c?8080:443);E(a,olympe.H.Config.Ad,'localhost'!==b);E(a,olympe.H.qb.Fd,'OlympeServer');E(a,olympe.H.qb.qr,'websocket');E(a,olympe.H.qb.Io,'rest/filesvc');E(a,olympe.H.qb.op,'rest/importsvc');E(a,olympe.H.qb.Qn,'rest/backupsvc');E(a,olympe.H.qb.$p,'rest/openid');E(a,olympe.H.qb.Ro,'rest/initialData');E(a,olympe.H.qb.np,
820
+ 'rest/querysvc/graphDefImplicit');E(a,olympe.H.qb.Fo,'rest/querysvc/graphDefExplicit');E(a,olympe.H.qb.Zq,'rest/transaction');E(a,olympe.H.qb.jr,'rest/token');E(a,olympe.H.qb.hr,'rest/authorization/getUserTag');E(a,olympe.H.qb.fr,'rest/authorization/getUserRoles');E(a,olympe.H.qb.Bq,'rest/authorization/roleMembers');E(a,olympe.H.Config.In,!0);E(a,olympe.H.Config.vq,5E3);E(a,olympe.H.Config.mq,3E5);E(a,olympe.H.Config.ym,15E3);E(a,olympe.H.Config.Aq,5E3);E(a,olympe.H.Config.Iq,'6.2.2');E(a,olympe.H.Config.Vn,
821
+ '');E(a,olympe.H.Config.Xn,c?'':'/mqtt');E(a,olympe.H.Config.Yn,c?15675:443);E(a,olympe.H.Config.Zn,c?'/':'');E(a,olympe.H.Config.er,'guest');E(a,olympe.H.Config.gq,'guest');E(a,olympe.H.Config.nf,30);E(a,olympe.H.qb.gm,'nodes/files');b=a.getParameter(olympe.Eg.Config.Oo);if(void 0!==b)ua(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.O.Ea,[olympe.sa.O.xa],d=>d.Qc('communication'));C(a,'server.WebSocketRequest',[new olympe.U.fa(olympe.H.Config.yd),
822
+ new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.qr)],(d,e,f,g,h)=>new olympe.la.Ck(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.la.Vj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.O.pp,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.op)],
823
+ b);C(a,olympe.H.O.Rn,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Qn)],b);C(a,olympe.H.O.aq,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.$p)],b);C(a,olympe.H.O.So,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),
824
+ new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Ro)],b);C(a,olympe.H.O.mp,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.np)],b);C(a,olympe.H.O.Eo,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Fo)],b);C(a,olympe.H.O.$q,[new olympe.U.fa(olympe.H.Config.yd),
825
+ new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Zq)],b);C(a,olympe.H.O.kr,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.jr)],b);C(a,olympe.H.O.ir,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.hr)],
826
+ b);C(a,olympe.H.O.gr,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.fr)],b);C(a,olympe.H.O.Cq,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Bq)],b);C(a,olympe.H.O.Ko,[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Ld),new olympe.U.fa(olympe.H.Config.Ad),
827
+ new olympe.U.fa(olympe.H.qb.Fd),new olympe.U.fa(olympe.H.qb.Io)],b);C(a,olympe.H.O.iq,[new olympe.U.fa(olympe.la.Config.Jl),new olympe.U.fa(olympe.la.Config.Kl),new olympe.U.fa(olympe.la.Config.gp),new olympe.U.fa(olympe.H.qb.gm)],b);C(a,'server.ManagerConfig',[new olympe.U.fa(olympe.H.Config.In),new olympe.U.fa(olympe.H.Config.vq),new olympe.U.fa(olympe.H.Config.mq),new olympe.U.fa(olympe.H.Config.ym),new olympe.U.fa(olympe.H.Config.co),new olympe.U.fa(olympe.H.Config.Iq),new olympe.U.fa(olympe.dc.Config.Yg),
828
+ new olympe.U.fa(olympe.H.Config.Aq)],(...d)=>{const e='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.U.fa(olympe.H.Config.yd),new olympe.U.fa(olympe.H.Config.Vn),new olympe.U.fa(olympe.H.Config.Xn),new olympe.U.fa(olympe.H.Config.Yn),new olympe.U.fa(olympe.H.Config.Zn),new olympe.U.fa(olympe.H.Config.er),new olympe.U.fa(olympe.H.Config.Ad),
829
+ new olympe.U.fa(olympe.H.Config.nf),new olympe.U.fa(olympe.H.Config.Hu),new olympe.U.fa(olympe.H.Config.Js),new olympe.U.fa(olympe.H.Config.Hs),new olympe.U.fa(olympe.H.Config.Du),new olympe.U.fa(olympe.H.Config.Ms),new olympe.U.fa(olympe.H.Config.gq),new olympe.U.fa(olympe.H.Config.zu),new olympe.U.fa(olympe.H.Config.ym)],(d,e,f,g,h,k,l,...n)=>{e=`${l?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const p='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout password queueQoSZero messageTimeout'.split(' ');
830
+ n=n.reduce((q,r,t)=>{q[p[t]]=r;return q},{});n.username=`${h||d.split('.')[0]}:${k}`;d=new Map;d.set('url',e);d.set('connectionOptions',n);return d});B(a,olympe.H.O.xa,olympe.H.jd.ta,olympe.H.O.Ea,olympe.la.O.xa,'server.WebSocketRequest','server.ManagerConfig');B(a,olympe.H.wd.mi,olympe.H.pa.Ua,olympe.H.O.Ea,olympe.H.O.xa,olympe.H.O.kr,olympe.H.O.ir,olympe.H.O.gr,olympe.H.O.Cq,olympe.H.O.aq,olympe.auth.O.kk,olympe.ic.O.$j);B(a,olympe.H.O.Wn,olympe.H.ya.ta,olympe.H.O.Ea,olympe.la.O.xa,olympe.auth.O.xa,
831
+ 'server.bus.ManagerConfig');sa(a,olympe.auth.wd.xa,olympe.H.wd.mi);sa(a,olympe.auth.wd.Ep,olympe.H.wd.mi);sa(a,olympe.auth.wd.Ee,olympe.H.wd.mi);sa(a,olympe.auth.wd.Re,olympe.H.wd.mi);B(a,olympe.H.O.Qg,olympe.H.Qj,olympe.H.O.Ea,olympe.la.O.xa,olympe.auth.O.xa,olympe.H.O.Ko,olympe.H.O.iq);sa(a,olympe.ab.O.Qg,olympe.H.O.Qg);C(a,olympe.H.O.Nd,[olympe.sa.O.xa,olympe.H.O.xa,olympe.auth.O.xa,olympe.ab.O.Qg,olympe.H.O.So,olympe.H.O.mp,olympe.H.O.Eo,olympe.H.O.$q],(d,e,f,g,h,k,l,n)=>new olympe.H.$g(d.Qc('server.source'),
832
+ e,f,g,[h,k,l,n]));B(a,olympe.H.O.Eh,olympe.H.Wj,olympe.H.O.pp,olympe.H.O.Rn);sa(a,olympe.dc.aa.O.Eh,olympe.H.O.Eh);sa(a,olympe.ab.O.tm,olympe.H.O.Nd)},'olympe.communication');olympe.U.run([olympe.H.O.Wn],a=>{olympe.H.ya.Tc=()=>a});olympe.sc={};olympe.sc.O={Ea:'sc.Logger',rm:'sc.RootContext'};olympe.sc.Config={ef:'sc.app',dg:'sc.debug',Ws:'sc.disableTheme',PRODUCTION:'sc.production',Zp:'sc.onstartTimeout',zq:'sc.remoteActionTimeout',Xp:'sc.offlineStart',fu:'google.apikey'};
833
+ olympe.U.config(a=>{E(a,olympe.sc.Config.ef,'');E(a,olympe.sc.Config.Xp,!1);E(a,olympe.sc.Config.dg,!1);E(a,olympe.sc.Config.Ws,!1);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Zp,2E4);E(a,olympe.sc.Config.fu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');E(a,olympe.sc.Config.zq,1E4);C(a,olympe.sc.O.Ea,[olympe.sa.O.xa],b=>b.Qc('sc'));C(a,olympe.sc.O.rm,[new olympe.U.fa(olympe.sc.Config.PRODUCTION),new olympe.U.fa(olympe.sc.Config.Zp)],b=>{const c=new olympe.sc.Va('root','root',null);olympe.sc.ks=
834
+ c;c.set(olympe.sc.Va.jg.PRODUCTION,b);return c})},'olympe.sc');olympe.U.run([olympe.sc.O.rm],a=>{olympe.dj().ctx=a});olympe.sc.UC=(a,b,c)=>{a.Oa(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.SC=(a,b,c)=>{a.Oa(olympe.dc.CloudObject.containsRel,c,b);a.Oa(olympe.sc.Runnable.G,c,b);a.Oa(olympe.sc.Runnable.C,c,b)};olympe.sc.jD=(a,b,c)=>{a.Jb(olympe.dc.CloudObject.containsRel,c,b);a.Jb(olympe.sc.Runnable.G,c,b);a.Jb(olympe.sc.Runnable.C,c,b)};olympe.sc.ln=()=>null!==olympe.dc.Pa().oc(void 0,olympe.sc.Runnable.C.Sc());olympe.sc.lD=(a,b,c)=>{a.Jb(olympe.dc.CloudObject.containsRel,c,b)};
835
+ olympe.sc.ux=(a,b,c)=>{a.Oa(olympe.sc.lb.F,c,b)};olympe.sc.zy=(a,b,c)=>{a.Jb(olympe.sc.lb.F,c,b)};olympe.sc.TC=(a,b,c)=>{olympe.sc.ux(a,b,c);a.Oa(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.kD=(a,b,c)=>{olympe.sc.zy(a,b,c);a.Jb(olympe.dc.CloudObject.containsRel,c,b)};olympe.sc.yC=(a,b,c,d)=>{c=a.create(olympe.sc.Cc).setProperty(olympe.sc.Cc.C,c||null).setProperty(olympe.sc.Cc.L,d||null);a.Oa(olympe.sc.Cc.F,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.T()};
836
+ olympe.sc.hh=a=>{a=olympe.dc.W.Vb.hh(a);return a instanceof olympe.sc.Ce?a.C():a};olympe.sc.NC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.Ce?a.C():a};
837
+ olympe.sc.KC=function(a){const b=olympe.dm.Rb.C.Sc(),c=olympe.dc.CloudObject.containsRel.Sc();var d=olympe.dc.wa(a);if(void 0===d)return[];a=olympe.dc.Pa();var e=a.model(d);const f=[],g=[];let h=[];if(a.Rf(e,olympe.dm.Rb))h.push(d);else{for(e=[];null===a.oc(d,b);){e.push(d);const k=a.oc(d,c);if(null===k)return olympe.sa.Ya('sc').warn(`Object ${d} has no container`),[];k===a.oc(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.oc(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
838
+ }g.push(d);h.push(a.oc(g[0],b))}h=h.concat(a.Mf(h[0],olympe.dm.Rb.Pb));h=h.concat(a.Mf(h[h.length-1],olympe.dm.od.ka.Sc()));h=h.concat(a.Mf(h[h.length-1],olympe.dm.od.R.Sc()));return[...f,...g,...h].reverse()};olympe.sc.LC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Xj:a.startsWith('video/')?olympe.sc.xm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.xd:olympe.dm.File};let Fi=0,Gi=0;function Hi(a,b){if(a.children)for(const c of a.children.values())b(c)}function Ii(a,b){if(a.re&&a.re.has(b)){var c=a.re.get(b);--c[0];0===c[0]&&(a.re.delete(b),0===a.re.size&&(a.re=null),Pc(olympe.dc.Dd(),null,c[1]))}}function Ji(a,b){a.children&&a.children.delete(b.Z())}function Ki(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Im&&c.kj()&&(a=Ki(c.children,b)))return a;return null}
839
+ function Li(a,b){b=olympe.dc.wa(b);return a.sh&&(a.sh.get('O#'+b)||a.sh.get('IO#'+b))||b}function Mi(a,b,c,d){const e='$'+b;a.$h.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{(f=a.sd&&a.sd.get(f))&&f.forEach(g=>{g(d)})});Hi(a,f=>{!f.Om&&f.$h.has(b)||f.data.has(e)||Mi(f,b,c,d)});a.$h.delete(b)}function Ni(a,b){b=olympe.dc.wa(b);return a.sh&&(a.sh.get('I#'+b)||a.sh.get('IO#'+b))||b}
840
+ function Oi(a,b,c){a.$h.add(b);const d=a.sd&&a.sd.get('&'+b);if(d)for(const e of d.values())e(c);Hi(a,e=>{e.$h.has(b)||Oi(e,b,c)});a.$h.delete(b)}
841
+ olympe.sc.Va=class{constructor(a,b,c=olympe.sc.ks){++Gi;this.id=a;this.gh=new Set;this.parent=c;this.Cd=b||null;this.vc=new olympe.D.Zb('SC Context');this.data=new Map;this.re=this.children=this.sd=null;this.Pm=new Map;this.uid=Gi;this.zr=null;this.Im=!1;this.$h=new Set;this.Om=!1;this.N=olympe.sa.Ya('sc');this.sh=null;this.vc.xc(()=>{Hi(this,d=>d.destroy())});this.vc.onDestroy(()=>{this.re&&this.re.forEach(([d],e)=>{for(let f=0;f<d;f++)Ii(this,e)});c&&Ji(this.parent,this);this.gh.clear();this.parent=
842
+ null;null!==this.get(olympe.sc.Va.jg.TRANSACTION)&&this.N.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)})}Z(){return this.id}hn(){return this.uid}getParent(){return this.parent}Nk(){return this.zr}Fc(){return this.vc}rn(a){this.zr=olympe.dc.wa(a);this.Im=a.Rd().ln();a.ea().forEach(b=>{this.gh.add(b)});this.sh=a.Y()}Gk(){this.Om=!0;Hi(this,a=>{a.Gk()})}jl(){this.Om=!1;Hi(this,a=>{a.jl()})}set(a,b){if(this.vc.R()||
843
+ this.vc.zb())return this;a=Li(this,a);const c='$'+a;var d=this.data.get(c);d&&d.valueOf&&(d=d.valueOf());if(void 0===b||null===b)void 0!==d&&(this.data.delete(c),Mi(this,a,['*',this.id,...this.gh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.sb?b.sb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Mi(this,a,['*',this.id,...this.gh],b))}return this}li(a){return this.set(a,Date.now())}remove(a){this.vc.zb()||this.vc.R()||(a=Li(this,a),this.data.delete('$'+a)&&Mi(this,a,['*',this.id,
844
+ ...this.gh],null))}Eb(a,b,c=!1){const d=olympe.dc.wa(a),e=olympe.D.Nc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.id:void 0));return e.Eb()}get(a,b=!1){a=this.Za(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Ni(this,a);let c=this.data.has(a),d=this.parent;if(b)for(;!c&&d;)c=d.data.has(a),d=d.parent;return c}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{if(this.zb())return d.error('Context is already destroyed'),()=>
845
+ {};const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.id);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Ni(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Hg(a.unsubscribe.bind(a));return this}el(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${olympe.D.Za(a.na(),'')}`);a.run(b);return b}Fn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.set(olympe.sc.Va.jg.cg,
846
+ a);return this}Za(a,b=!0){a='$'+Ni(this,a);let c=this.data.get(a),d=this.parent;if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.parent;return c}on(a,b,c){if(this.vc.zb()||this.vc.R())return()=>{};const d=Ni(this,a),e=c?olympe.dc.wa(c):'*';a=this.Te('@'+e+'.'+d,b);c=c?(c=this.fi(e))?c.Za(d,!1):void 0:this.Za(d);void 0!==c&&b(c);olympe.D.Ia().onDestroy(a);return a}Yh(a){const b='_'+olympe.W.fc();null===this.children&&(this.children=new Map);const c=this.vc.run(()=>new olympe.sc.Va(b,a,this));this.children.set(b,
847
+ c);return c}Qk(a,b){a=olympe.dc.wa(a);null===this.children&&(this.children=new Map);let c=this.children.get(a);if(!c){c=new olympe.sc.Va(a,b,this);this.children.set(a,c);for(b=c.parent;b&&b.Im&&b.kj();)b=b.parent;b&&Oi(b,a,c)}return c}oj(a,b){const c=this.fi(a);if(c)return b(c),()=>{};const d=this.Te('&'+a,e=>{d&&d();b(e)});return d}fi(a){if(a===this.id||this.gh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.gh.has(a))return b;const c=Ki(b.children,a);if(c)return c;b=b.parent}return null}kj(){return!this.id.startsWith('_')}Ik(a,
848
+ b){this.re||(this.re=new Map);const c=this.re.get(a);c?c[0]+=1:(this.re.set(a,[1,b]),Pc(olympe.dc.Dd(),b))}destroy(){this.vc.R()||this.vc.zb()||this.vc.destroy()}Hg(a,b){return this.vc.zb()?b||'noId':(b=b||String(++Fi),this.Pm.set(b,a),b)}cl(a){this.Pm.delete(a)}onDestroy(a){return this.zb()?(a(),'noId'):this.vc.onDestroy(a)}Ie(a){this.zb()||this.vc.Ie(a)}clear(){this.vc.R()||this.vc.zb()||(this.Pm.forEach(a=>a()),this.vc.ea())}Te(a,b){this.sd||(this.sd=new Map);let c=this.sd.get(a);void 0===c&&(c=
849
+ new Map,this.sd.set(a,c));++Fi;const d=Fi;c.set(d,b);return()=>{const e=this.sd.get(a);e&&(e.delete(d),0===e.size&&this.sd.delete(a))}}zb(){return this.vc.zb()}nn(){const a=this.Za(olympe.sc.Va.jg.EDITION);return a?a:!1}Wk(){const a=this.Za(olympe.sc.Va.jg.PRODUCTION);return a?a:!1}};olympe.sc.Va.prototype.clear=olympe.sc.Va.prototype.clear;olympe.sc.Va.prototype.offDestroy=olympe.sc.Va.prototype.Ie;olympe.sc.Va.prototype.onDestroy=olympe.sc.Va.prototype.onDestroy;
850
+ olympe.sc.Va.prototype.offClear=olympe.sc.Va.prototype.cl;olympe.sc.Va.prototype.onClear=olympe.sc.Va.prototype.Hg;olympe.sc.Va.prototype.destroy=olympe.sc.Va.prototype.destroy;olympe.sc.Va.prototype.getOtherContext=olympe.sc.Va.prototype.fi;olympe.sc.Va.prototype.onContext=olympe.sc.Va.prototype.oj;olympe.sc.Va.prototype.createChild=olympe.sc.Va.prototype.Yh;olympe.sc.Va.prototype.setParentElement=olympe.sc.Va.prototype.hl;olympe.sc.Va.prototype.waitFor=olympe.sc.Va.prototype.Fn;
851
851
  olympe.sc.Va.prototype.runner=olympe.sc.Va.prototype.el;olympe.sc.Va.prototype.repeat=olympe.sc.Va.prototype.repeat;olympe.sc.Va.prototype.observe=olympe.sc.Va.prototype.observe;olympe.sc.Va.prototype.has=olympe.sc.Va.prototype.has;olympe.sc.Va.prototype.get=olympe.sc.Va.prototype.get;olympe.sc.Va.prototype.remove=olympe.sc.Va.prototype.remove;olympe.sc.Va.prototype.trigger=olympe.sc.Va.prototype.li;olympe.sc.Va.prototype.set=olympe.sc.Va.prototype.set;olympe.sc.Va.prototype.getParent=olympe.sc.Va.prototype.getParent;
852
- olympe.sc.Va.fc={tt:'I#',ou:'O#',Rz:'IO#'};olympe.sc.Va.jg={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',cg:'__htmlContainer',Yy:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}};olympe.sc.Metadata.P=olympe.dc.Ca.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.Cc=class extends olympe.dc.CloudObject{F(){return this.Fb(olympe.sc.Cc.L)}C(){return this.Fb(olympe.sc.Cc.C)}};olympe.sc.Cc.P=olympe.dc.Ca.C('01703376c4a81c0e9d90',olympe.sc.Cc);olympe.sc.Cc.L=olympe.sc.Cc.P.Da('01703376c4a81c0e9d91');olympe.sc.Cc.C=olympe.sc.Cc.P.Da('01703376c4a81c0e9d92');olympe.sc.Cc.F=olympe.sc.Cc.P.Ra('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.P,olympe.sc.Cc.F);olympe.sc.Cc.prototype.F.K=olympe.D.J.F;olympe.sc.Cc.prototype.C.K=olympe.D.J.F;olympe.sc.W={};function Qi(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
853
- olympe.sc.W.gt=class{constructor(a,b,c){const d=olympe.la.fb.de.GET,e=olympe.la.fb.de.Hc,f=olympe.la.fb.de.ik,g=olympe.la.fb.de.bm,h=olympe.la.fb.Headers.Hj,k=olympe.la.fb.Headers.pi;this.N=a;this.G=b.aa([d,e,f,g],[h,k]);this.L=c;this.C=new olympe.W.Yq(3E4);this.F=new olympe.D.Zb('FileService context')}start(a){const b=olympe.la.fb.de.bm,c=olympe.la.fb.rd.Kh,d=olympe.la.fb.rd.et,e=olympe.la.fb.rd.Eq,f=olympe.la.fb.Headers.pi,g=olympe.la.fb.Headers.us,h=`fileServer_${a}`;a=this.G.L(h,`/${this.L}/${a}/:${'fileTag'}`.replace(/\/+/g,
854
- '/').replace(/\/$/,''),[olympe.la.fb.de.GET,olympe.la.fb.de.Hc,olympe.la.fb.de.ik,b],(k,l)=>{if(k.method===b)return new olympe.la.Sg('',c,'',{[g]:'*'});const n=k.ej()[f],p=this.C.get(n);if(!p)return Promise.resolve(new olympe.la.Sg('Invalid token',d,'Access denied'));this.C.delete(n);return p(k.ej(),l.get('fileTag'),k.body).catch(q=>Promise.resolve(new olympe.la.Sg(`Internal server error: ${q}`,e,'Internal server error')))});this.F.onDestroy(()=>{this.G.Y(h).catch(k=>this.N.error(`An error occurred while stopping the file service: ${k}`))});
855
- return a}stop(){this.F.destroy()}};olympe.sc.Ye={};olympe.sc.Ye.dh={Py:null,Hu:'screenflow',Zu:'ui-design',Gq:'software-intelligence',xl:'data-management'};olympe.sc.pe=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ye.dh.Gq}F(){return this.tb(olympe.sc.pe.C,olympe.sc.logic.Ji)}G(){return this.tb(olympe.sc.pe.F,olympe.sc.logic.Oh)}};olympe.sc.pe.P=olympe.dc.Ca.C('011100000000000adef0',olympe.sc.pe);olympe.sc.pe.C=olympe.sc.pe.P.Ra('016ac4f59a2917fdef01');olympe.sc.pe.F=olympe.sc.pe.P.Ra('016ac4f59a2917fdef02');olympe.sc.pe.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.pe.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ba,[]);function Ri(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Si(a,b){const c=[];for(const d of b)b=a.db.gb(d,olympe.sc.logic.Kc.C,!0),c[b]=d;return c}
856
- olympe.sc.lb=class extends olympe.dm.BrickMetadata{Mt(a,b,c,d,e=!0){e||olympe.sa.Za('sc').error('parameter own= false ignored, investigate');return olympe.D.bf(L(this.Lf(a,olympe.dc.W.Vb.hh,c)),d)}Uw(){return this.tb(olympe.sc.lb.F,olympe.sc.Runnable)}iw(){return this.tb(olympe.sc.lb.ha,olympe.sc.Runnable)}pn(){return this.db.gb(this,olympe.sc.lb.Pb)}kn(){return null!==this.db.nc(this.tag,olympe.sc.Runnable.C.Rc())}Sl(){return this.tb(olympe.sc.lb.L,olympe.sc.logic.Mb)}Zj(){return this.tb(olympe.sc.lb.R,
857
- olympe.sc.logic.Yb)}};olympe.sc.lb.P=olympe.dc.Ca.C('0112000000000000def0',olympe.sc.lb);olympe.sc.lb.Pb=olympe.sc.lb.P.Da('01692aa71f3108454479');olympe.sc.lb.cc=olympe.sc.lb.P.Da('0166446c1f128ebc903a');olympe.sc.lb.F=olympe.sc.lb.P.Ra('01692a4af82e8984742c');olympe.sc.lb.ha=olympe.sc.lb.P.Ra('01692a4af82e8984742d');olympe.sc.lb.Fa=olympe.sc.lb.P.Ra('01692a4af82e8984742e');olympe.sc.lb.L=olympe.sc.lb.P.Ra('01621fb84e320000f00a');olympe.sc.lb.R=olympe.sc.lb.P.Ra('01621fb84e320000f00b');
858
- olympe.sc.lb.Ge=olympe.sc.lb.P.Ra('0171838bcfed0000e00e');olympe.sc.lb.ud=olympe.sc.lb.P.Ra('0171838bcfed0000a00a');m=olympe.sc.lb.prototype;m.Mt.K=olympe.D.J.C;m.Uw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.iw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.pn.K=olympe.D.J.C;m.kn.K=olympe.D.J.C;m.Sl.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Zj.K=new olympe.D.J(()=>olympe.dc.Ba,[]);function Ti(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).T();b.ib();olympe.D.Ia().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.ib()});return olympe.dc.CloudObject.get(c)}function Ui(a,b){b.qn(a);Ri(a.Sd(),b);const c=a.L(),d=Vi(b,c),e=[];c.forEach((f,g)=>{f===a.Fa?e[0]=g:f===a.oa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Wi(a,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
859
- function Xi(a,b){var c=a.Wb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>b.zb()||(b.clear(),null===h)?!1:(b.Fc().run(a.update.bind(a,new olympe.sc.eb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.N.debug(e):a.N.debug(f),a.bb.bind(a,b),()=>a.N.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
860
- function Yi(a,b,c,d){const e=d.Fc(),f=V(a.db,b,c,e.C((g,h)=>{const k=d.Qk(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.xc(a.db.C.bind(a.db,b,c,f,!0))}function Vi(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
861
- function Wi(a,b,c){const d=olympe.D.Ia(),e=zd(a.db,a.tag,d.C((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.hh(g)))}));d.onDestroy(()=>{var f=a.db;const g=U(f,a.tag);null!==g&&(g.R(ud,e),f.Ja.getState()===vd.bg&&f.Ja.aa(e))})}
862
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.N=c}run(a){const b=()=>{Ui(this,a);this.init(a);this.Sd().pn()?Xi(this,a):a.Fc().run(this.update.bind(this,new olympe.sc.eb(a),[],[]));a.li(olympe.sc.lb.cc);a.Hg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.Fc().run(b):b()}Sd(){return this.ei()}init(a){this.onInit(a)}update(a,b,c){const d=this.Sd();if(d.pn())this.onUpdate(a,b,c);else this.N.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.gn()}`),
863
- Yi(this,d,olympe.sc.lb.F,a),this.Ta()&&Yi(this,d,olympe.sc.lb.Fa,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.N.error(`Brick ${this.db.name(this.Wb())} (${this.Wb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Sd();return Si(a,a.db.tb(a.tag,olympe.sc.lb.L))}getOutputs(){var a=this.Sd();return Si(a,a.db.tb(a.tag,olympe.sc.lb.R))}aa(){return[]}Y(){return new Map}Ta(){return!1}G(a,
864
- b,c,d){a=b.Eb(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}Tb(a,b,c,d,e){olympe.D.vn([d],f=>{b.set(a,olympe.D.Ur(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.Fa,this.oa]}Fa(a,b){Wi(this,b,null)}oa(a,b){Wi(this,null,b)}cc(a,b){const c=this.db,d=olympe.sc.logic.xb.L.Rc(),e=olympe.sc.logic.xb.F,f=olympe.sc.logic.xb.C;this.Gr(d,g=>{var h=g.T();if(h=c.nc(h,e)||c.nc(h,f))g=Zi(g,a,b.bind(null,h)),olympe.D.Ia().onDestroy(g)})}bb(a,b){const c=this.Wb();let d=this.db.name(c);try{const e=[a.Nk()];
865
- let f=a.getParent();for(;null!==f&&f!==olympe.sc.gs;)e.unshift(f.Nk()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.N.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.N.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.P=Kc(olympe.dc.Ca.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.G=olympe.sc.Runnable.P.Ra('01692a4af82e8984742b');
866
- olympe.sc.Runnable.C=olympe.sc.Runnable.P.Ra('01756a18d4921c103111');olympe.sc.Runnable.R=P(olympe.sc.Runnable.P,olympe.sc.lb.F);olympe.sc.Runnable.Y=P(olympe.sc.Runnable.P,olympe.sc.lb.ha);olympe.sc.Runnable.aa=P(olympe.sc.Runnable.P,olympe.sc.lb.Fa);P(olympe.sc.lb.P,olympe.sc.Runnable.G);P(olympe.sc.lb.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.Sd.K=new olympe.D.J(()=>olympe.sc.lb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.Tb.K=olympe.D.J.C;function $i(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ce)return(a=a.F())?a.valueOf():null;if('function'===typeof a.T)return a.T()}return null}olympe.sc.Ce=class extends olympe.dc.CloudObject{F(){return this.db.tb(this,olympe.sc.Ce.C)[0]}C(){return olympe.dc.CloudObject.get($i(this))}toString(){const a=$i(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ce.P=olympe.dc.Ca.C('0163c9ae01f2d6e9ca49',olympe.sc.Ce);olympe.sc.Ce.C=olympe.sc.Ce.P.Ra('0169b5a8a33144fb0b49');
867
- P(olympe.dc.CloudObject.P,olympe.sc.Ce.C);olympe.sc.Ce.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.Ce.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.vo=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.vo.P=olympe.dc.Ca.C('0163a68ce44f3d1fa84c',olympe.sc.vo);olympe.sc.tl=class extends olympe.dm.BrickMetadata{};olympe.sc.tl.P=olympe.dc.Ca.C('016324fde11a836f76c2',olympe.sc.tl);let aj=null;
868
- function bj(a,b){aj=a;(new olympe.dc.hf(a,olympe.dc.Hd.Ii)).vb(olympe.sc.La.Me.C).vb(olympe.sc.ld.F.Rc()).ib((c,d)=>{if(c)olympe.sa.Za('sc').error('Error while loading business container:',c.message),b(olympe.sc.ld.C.rc);else{c=null;for(const [e,f]of d.Gc.gd())e===olympe.sc.ld.F.T()&&(c=f);null!==c?df(Ze(new olympe.dc.hf(c),olympe.dc.Ub.rf),(e,f)=>{const g=olympe.dc.jc.Vc,h=olympe.dc.jc.ui,k=f.T();f=f.Qa();return olympe.dc.Pa().qh(e,olympe.sc.tl)&&f===olympe.dc.Aa.ORIGIN&&(k===g||k===h)}).ib(()=>
869
- b(olympe.sc.ld.C.zp)):(olympe.sa.Za('sc').error('No container found for the application',a),b(olympe.sc.ld.C.Zl))}})}olympe.sc.ld=class extends olympe.dc.CloudObject{};olympe.sc.ld.C={zp:0,Zl:1,rc:2};olympe.sc.ld.P=olympe.dc.Ca.C('017b3aa8fae1e3d044dc',olympe.sc.ld);olympe.sc.ld.F=olympe.sc.ld.P.Ra('017b3aa8fd1659291b92');olympe.sc.ld.L=olympe.sc.ld.P.Ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.Ca.C('01631aacd5c1f9d61c5d',olympe.sc.Map);olympe.sc.Vg=class extends olympe.sc.Map{};olympe.sc.Vg.P=olympe.dc.Ca.C('01631aacd8276ea98490',olympe.sc.Vg);olympe.sc.Xj=class extends olympe.dm.File{L(){const a=olympe.D.Mc(olympe.D.Xa);this.Pk(b=>{a.update(olympe.D.Cb(b))});return a.Eb()}};olympe.sc.Xj.P=Fc('01644b6297305d62fca2',olympe.sc.Xj);olympe.sc.Xj.prototype.L.K=olympe.D.J.F;olympe.sc.yd=class extends olympe.dm.File{L(){return this.Fb(olympe.sc.yd.F)}R(){return this.Fb(olympe.sc.yd.L)}Y(){return this.He(olympe.sc.yd.R)}};olympe.sc.yd.P=Fc('01647e113043c637b541',olympe.sc.yd);olympe.sc.yd.F=olympe.sc.yd.P.Da('01647e35ecd24ef0b88d');olympe.sc.yd.L=olympe.sc.yd.P.Da('01647e677f5d1cfbdf42');olympe.sc.yd.R=olympe.sc.yd.P.Da('01647e6780999bf8bd25');olympe.sc.yd.prototype.L.K=olympe.D.J.F;olympe.sc.yd.prototype.R.K=olympe.D.J.F;olympe.sc.yd.prototype.Y.K=olympe.D.J.G;olympe.sc.wm=class extends olympe.dm.File{};olympe.sc.wm.P=Fc('0164643c432146a71d5c',olympe.sc.wm);olympe.sc.kr=class extends olympe.dc.CloudObject{};olympe.sc.kr.P=olympe.dc.Ca.C('016421bb3797e22d1c4e',olympe.sc.kr);olympe.sc.logic={};olympe.sc.logic.$o=(a,b)=>a===b?0:a>b?1:-1;
870
- olympe.sc.logic.Vz=(a,b,c,d,e,f,g)=>{const h=b.T();b=olympe.D.Ya(b.C().T());let k,l;if(b===olympe.dc.wa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Fb(h).toLowerCase();else if(b===olympe.dc.wa(olympe.dm.Number))k=c.valueOf(),l=p=>p.He(h);else if(b===olympe.dc.wa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Ga([p.gj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Pa().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
871
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.$o(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.$o(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.ug().filter(p=>olympe.D.Ga([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Bc(d.valueOf()?1===q:0<=q)},olympe.D.ra,'FilterList ListDefBuilder Filter TransformFlows')).mf())};
872
- olympe.sc.logic.rC=(a,b)=>{if(a instanceof olympe.D.ea)return a;if(a instanceof olympe.D.Xa)return a.ns();if(a instanceof olympe.D.ra)return a.Lr();if('string'===typeof a||'number'===typeof a)return olympe.D.za(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ea.Mp};olympe.sc.logic.ua={};olympe.sc.logic.ua.No=class{constructor(a,b,c){this.P=olympe.dc.Ca.C(a,b,...c)}T(){return this.P.T()}};olympe.sc.logic.ua.No.ma=[olympe.dc.ze];const cj=Object.create(null),dj=new Map;function ej(a){if(void 0===cj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Hc(a)}function fj(a,b,c=olympe.sc.logic.Function){if(dj.has(a))throw c=ej(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.Ca.C(a,b,...[]);dj.set(a,{P:d,DC:b,qC:c});return d}
873
- olympe.sc.logic.Ca=class{constructor(){}static C(a,b,...c){if(cj[a])throw c=ej(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.ua.No(a,b,[olympe.sc.O.Ea].concat(c));return cj[a]=b}};olympe.sc.logic.Uy=class{};olympe.sc.logic.Ij=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ij.P=olympe.dc.Ca.C('01621fb84e320000cf00',olympe.sc.logic.Ij);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.Xr=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Ew(){return this.Xr}gw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.gw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Ew;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
874
- olympe.sc.logic.Nj=class extends olympe.sc.logic.Ij{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Nj.P=olympe.dc.Ca.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Nj);olympe.sc.logic.ne=class extends olympe.dc.CloudObject{C(){return this.ed(olympe.sc.logic.ne.C,olympe.dc.CloudObject)}};olympe.sc.logic.ne.P=olympe.dc.Ca.C('016ac4f59ee8ea2081ba',olympe.sc.logic.ne);olympe.sc.logic.ne.L=olympe.sc.logic.ne.P.Da('017bc044aeacce7ffc8f');olympe.sc.logic.ne.C=olympe.sc.logic.ne.P.Ra('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.P,olympe.sc.logic.ne.C);olympe.sc.logic.ne.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ji=class extends olympe.sc.logic.ne{};olympe.sc.logic.Ji.P=olympe.dc.Ca.C('016ac4f59c592b862457',olympe.sc.logic.Ji);olympe.sc.logic.Ji.F=olympe.sc.pe.C.Rc();olympe.sc.logic.Oh=class extends olympe.sc.logic.ne{};olympe.sc.logic.Oh.P=olympe.dc.Ca.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Oh);olympe.sc.logic.Oh.F=P(olympe.sc.logic.Oh.P,olympe.sc.pe.F);olympe.sc.logic.Oe=class extends olympe.sc.lb{C(){return olympe.sc.Ye.dh.Gq}ha(){return this.Zm().ug().qh([olympe.sc.logic.Function]).and().not().qh([olympe.sc.logic.Zd,olympe.sc.logic.be]).mf()}xw(){return this.Sl().ug().hj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Ji.F]).mf()}yw(){return this.Zj().ug().hj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Oh.F]).mf()}Gf(a){const b=this.db.Wm(this,[olympe.sc.lb.L],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}mh(a){const b=
875
- this.db.Wm(this,[olympe.sc.lb.R],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}bx(){return this.Sl().ug().hj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Mb).mf()}cx(){return this.Zj().ug().hj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Yb).mf()}};fj('01621fb84e320000f000',olympe.sc.logic.Oe,olympe.sc.logic.Function);m=olympe.sc.logic.Oe.prototype;m.xw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.yw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);
876
- m.Gf.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.mh.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.bx.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.cx.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.logic.ag=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63229782039429f')}G(){return this.mh('016ac6322acf67eebfe7')}L(){return this.Zj().ug().vb(olympe.sc.logic.Kc.typeRel).Sk(olympe.sc.logic.Nj).mf().lf().ln(olympe.D.ea.ZERO)}};olympe.sc.logic.ag.C='016ac63229782039429f';olympe.sc.logic.ag.oa='016ac6322acf67eebfe7';olympe.sc.logic.ag.P=fj('01621fb84e320000a000',olympe.sc.logic.ag,olympe.sc.logic.Action);
877
- olympe.sc.logic.ag.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ag.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ag.prototype.L.K=olympe.D.J.R;olympe.sc.logic.jo=class extends olympe.sc.logic.Oe{};olympe.sc.logic.jo.P=fj('01621fb84e320000f011',olympe.sc.logic.jo);olympe.sc.logic.io=class extends olympe.sc.logic.ag{};olympe.sc.logic.io.P=fj('01621fb84e320000f012',olympe.sc.logic.io);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.cc]}Y(){const a=olympe.sc.Va.fc.tt,b=olympe.sc.Va.fc.ou,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}F(a){return this.getOutputs().map(b=>this.db.Xk(b,olympe.sc.logic.Kc.typeRel,olympe.sc.logic.Ij)?a.li.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
852
+ olympe.sc.Va.hc={xt:'I#',su:'O#',Wz:'IO#'};olympe.sc.Va.jg={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',cg:'__htmlContainer',cz:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}};olympe.sc.Metadata.P=olympe.dc.Ca.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.Cc=class extends olympe.dc.CloudObject{F(){return this.Fb(olympe.sc.Cc.L)}C(){return this.Fb(olympe.sc.Cc.C)}};olympe.sc.Cc.P=olympe.dc.Ca.C('01703376c4a81c0e9d90',olympe.sc.Cc);olympe.sc.Cc.L=olympe.sc.Cc.P.Da('01703376c4a81c0e9d91');olympe.sc.Cc.C=olympe.sc.Cc.P.Da('01703376c4a81c0e9d92');olympe.sc.Cc.F=olympe.sc.Cc.P.Ra('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.P,olympe.sc.Cc.F);olympe.sc.Cc.prototype.F.K=olympe.D.J.F;olympe.sc.Cc.prototype.C.K=olympe.D.J.F;olympe.sc.W={};function Pi(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
853
+ olympe.sc.W.kt=class{constructor(a,b,c){const d=olympe.la.fb.ce.GET,e=olympe.la.fb.ce.Hc,f=olympe.la.fb.ce.ik,g=olympe.la.fb.ce.bm,h=olympe.la.fb.Headers.Hj,k=olympe.la.fb.Headers.pi;this.N=a;this.G=b.ea([d,e,f,g],[h,k]);this.L=c;this.C=new olympe.W.ar(3E4);this.F=new olympe.D.Zb('FileService context')}start(a){var b=olympe.la.fb.ce.GET;const c=olympe.la.fb.ce.Hc,d=olympe.la.fb.ce.ik,e=olympe.la.fb.ce.bm,f=olympe.la.fb.qd.Kh,g=olympe.la.fb.qd.it,h=olympe.la.fb.qd.Hq,k=olympe.la.fb.Headers.pi,l=olympe.la.fb.Headers.ys,
854
+ n=`fileServer_${a}`;a=`/${this.L}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.N.debug(`Started file service with path : ${a}`);b=this.G.L(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.la.Sg('',f,'',{[l]:'*'}));const r=p.ej()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.la.Sg('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.ej(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.la.Sg(`Internal server error: ${u}`,
855
+ h,'Internal server error')))});this.F.onDestroy(()=>{this.G.Y(n).catch(p=>this.N.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Ye={};olympe.sc.Ye.dh={Uy:null,Lu:'screenflow',dv:'ui-design',Jq:'software-intelligence',xl:'data-management'};olympe.sc.pe=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ye.dh.Jq}F(){return this.tb(olympe.sc.pe.C,olympe.sc.logic.Ji)}G(){return this.tb(olympe.sc.pe.F,olympe.sc.logic.Oh)}};olympe.sc.pe.P=olympe.dc.Ca.C('011100000000000adef0',olympe.sc.pe);olympe.sc.pe.C=olympe.sc.pe.P.Ra('016ac4f59a2917fdef01');olympe.sc.pe.F=olympe.sc.pe.P.Ra('016ac4f59a2917fdef02');olympe.sc.pe.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.pe.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ba,[]);function Qi(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Ri(a,b){const c=[];for(const d of b)b=a.db.gb(d,olympe.sc.logic.Kc.C,!0),c[b]=d;return c}
856
+ olympe.sc.lb=class extends olympe.dm.BrickMetadata{Qt(a,b,c,d,e=!0){e||olympe.sa.Ya('sc').error('parameter own= false ignored, investigate');return olympe.D.bf(L(this.Lf(a,olympe.dc.W.Vb.hh,c)),d)}Yw(){return this.tb(olympe.sc.lb.F,olympe.sc.Runnable)}mw(){return this.tb(olympe.sc.lb.ka,olympe.sc.Runnable)}qn(){return this.db.gb(this,olympe.sc.lb.Pb)}ln(){return null!==this.db.oc(this.tag,olympe.sc.Runnable.C.Sc())}Sl(){return this.tb(olympe.sc.lb.L,olympe.sc.logic.Mb)}Zj(){return this.tb(olympe.sc.lb.R,
857
+ olympe.sc.logic.Yb)}};olympe.sc.lb.P=olympe.dc.Ca.C('0112000000000000def0',olympe.sc.lb);olympe.sc.lb.Pb=olympe.sc.lb.P.Da('01692aa71f3108454479');olympe.sc.lb.cc=olympe.sc.lb.P.Da('0166446c1f128ebc903a');olympe.sc.lb.F=olympe.sc.lb.P.Ra('01692a4af82e8984742c');olympe.sc.lb.ka=olympe.sc.lb.P.Ra('01692a4af82e8984742d');olympe.sc.lb.Fa=olympe.sc.lb.P.Ra('01692a4af82e8984742e');olympe.sc.lb.L=olympe.sc.lb.P.Ra('01621fb84e320000f00a');olympe.sc.lb.R=olympe.sc.lb.P.Ra('01621fb84e320000f00b');
858
+ olympe.sc.lb.Ge=olympe.sc.lb.P.Ra('0171838bcfed0000e00e');olympe.sc.lb.td=olympe.sc.lb.P.Ra('0171838bcfed0000a00a');m=olympe.sc.lb.prototype;m.Qt.K=olympe.D.J.C;m.Yw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.mw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.qn.K=olympe.D.J.C;m.ln.K=olympe.D.J.C;m.Sl.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Zj.K=new olympe.D.J(()=>olympe.dc.Ba,[]);function Si(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).T();b.ib();olympe.D.Ia().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.ib()});return olympe.dc.CloudObject.get(c)}function Ti(a,b){b.rn(a);Qi(a.Rd(),b);const c=a.L(),d=Ui(b,c),e=[];c.forEach((f,g)=>{f===a.Fa?e[0]=g:f===a.qa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Vi(a,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
859
+ function Wi(a,b){var c=a.Wb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>b.zb()||(b.clear(),null===h)?!1:(b.Fc().run(a.update.bind(a,new olympe.sc.eb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.N.debug(e):a.N.debug(f),a.cb.bind(a,b),()=>a.N.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
860
+ function Xi(a,b,c,d){const e=d.Fc(),f=V(a.db,b,c,e.C((g,h)=>{const k=d.Qk(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.xc(a.db.C.bind(a.db,b,c,f,!0))}function Ui(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
861
+ function Vi(a,b,c){const d=olympe.D.Ia(),e=yd(a.db,a.tag,d.C((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.hh(g)))}));d.onDestroy(()=>{var f=a.db;const g=U(f,a.tag);null!==g&&(g.R(td,e),f.Ja.getState()===ud.bg&&f.Ja.ea(e))})}
862
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.N=c}run(a){const b=()=>{Ti(this,a);this.init(a);this.Rd().qn()?Wi(this,a):a.Fc().run(this.update.bind(this,new olympe.sc.eb(a),[],[]));a.li(olympe.sc.lb.cc);a.Hg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.Fc().run(b):b()}Rd(){return this.ei()}init(a){this.onInit(a)}update(a,b,c){const d=this.Rd();if(d.qn())this.onUpdate(a,b,c);else this.N.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.hn()}`),
863
+ Xi(this,d,olympe.sc.lb.F,a),this.Ta()&&Xi(this,d,olympe.sc.lb.Fa,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.N.error(`Brick ${this.db.name(this.Wb())} (${this.Wb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Rd();return Ri(a,a.db.tb(a.tag,olympe.sc.lb.L))}getOutputs(){var a=this.Rd();return Ri(a,a.db.tb(a.tag,olympe.sc.lb.R))}ea(){return[]}Y(){return new Map}Ta(){return!1}G(a,
864
+ b,c,d){a=b.Eb(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}Tb(a,b,c,d,e){olympe.D.xn([d],f=>{b.set(a,olympe.D.Xr(f)?f.valueOf():f)});return this.G(a,b,c,e)}L(){return[this.Fa,this.qa]}Fa(a,b){Vi(this,b,null)}qa(a,b){Vi(this,null,b)}cc(a,b){const c=this.db,d=olympe.sc.logic.xb.L.Sc(),e=olympe.sc.logic.xb.F,f=olympe.sc.logic.xb.C;this.Jr(d,g=>{var h=g.T();if(h=c.oc(h,e)||c.oc(h,f))g=Yi(g,a,b.bind(null,h)),olympe.D.Ia().onDestroy(g)})}cb(a,b){const c=this.Wb();let d=this.db.name(c);try{const e=[a.Nk()];
865
+ let f=a.getParent();for(;null!==f&&f!==olympe.sc.ks;)e.unshift(f.Nk()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.N.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.N.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};olympe.sc.Runnable.P=Jc(olympe.dc.Ca.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.G=olympe.sc.Runnable.P.Ra('01692a4af82e8984742b');
866
+ olympe.sc.Runnable.C=olympe.sc.Runnable.P.Ra('01756a18d4921c103111');olympe.sc.Runnable.R=P(olympe.sc.Runnable.P,olympe.sc.lb.F);olympe.sc.Runnable.Y=P(olympe.sc.Runnable.P,olympe.sc.lb.ka);olympe.sc.Runnable.ea=P(olympe.sc.Runnable.P,olympe.sc.lb.Fa);P(olympe.sc.lb.P,olympe.sc.Runnable.G);P(olympe.sc.lb.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.Rd.K=new olympe.D.J(()=>olympe.sc.lb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.Tb.K=olympe.D.J.C;function Zi(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ce)return(a=a.F())?a.valueOf():null;if('function'===typeof a.T)return a.T()}return null}olympe.sc.Ce=class extends olympe.dc.CloudObject{F(){return this.db.tb(this,olympe.sc.Ce.C)[0]}C(){return olympe.dc.CloudObject.get(Zi(this))}toString(){const a=Zi(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ce.P=olympe.dc.Ca.C('0163c9ae01f2d6e9ca49',olympe.sc.Ce);olympe.sc.Ce.C=olympe.sc.Ce.P.Ra('0169b5a8a33144fb0b49');
867
+ P(olympe.dc.CloudObject.P,olympe.sc.Ce.C);olympe.sc.Ce.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.Ce.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.xo=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.xo.P=olympe.dc.Ca.C('0163a68ce44f3d1fa84c',olympe.sc.xo);olympe.sc.tl=class extends olympe.dm.BrickMetadata{};olympe.sc.tl.P=olympe.dc.Ca.C('016324fde11a836f76c2',olympe.sc.tl);let $i=null;
868
+ function aj(a,b){$i=a;(new olympe.dc.hf(a,olympe.dc.Hd.Ii)).vb(olympe.sc.La.Me.C).vb(olympe.sc.ld.F.Sc()).ib((c,d)=>{if(c)olympe.sa.Ya('sc').error('Error while loading business container:',c.message),b(olympe.sc.ld.C.tc);else{c=null;for(const [e,f]of d.Gc.gd())e===olympe.sc.ld.F.T()&&(c=f);null!==c?bf(Xe(new olympe.dc.hf(c),olympe.dc.Ub.rf),(e,f)=>{const g=olympe.dc.jc.Wc,h=olympe.dc.jc.ui,k=f.T();f=f.Qa();return olympe.dc.Pa().qh(e,olympe.sc.tl)&&f===olympe.dc.Aa.ORIGIN&&(k===g||k===h)}).ib(()=>
869
+ b(olympe.sc.ld.C.Cp)):(olympe.sa.Ya('sc').error('No container found for the application',a),b(olympe.sc.ld.C.Zl))}})}olympe.sc.ld=class extends olympe.dc.CloudObject{};olympe.sc.ld.C={Cp:0,Zl:1,tc:2};olympe.sc.ld.P=olympe.dc.Ca.C('017b3aa8fae1e3d044dc',olympe.sc.ld);olympe.sc.ld.F=olympe.sc.ld.P.Ra('017b3aa8fd1659291b92');olympe.sc.ld.L=olympe.sc.ld.P.Ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.Ca.C('01631aacd5c1f9d61c5d',olympe.sc.Map);olympe.sc.Vg=class extends olympe.sc.Map{};olympe.sc.Vg.P=olympe.dc.Ca.C('01631aacd8276ea98490',olympe.sc.Vg);olympe.sc.Xj=class extends olympe.dm.File{L(){const a=olympe.D.Nc(olympe.D.Xa);this.Pk(b=>{a.update(olympe.D.Cb(b))});return a.Eb()}};olympe.sc.Xj.P=Ec('01644b6297305d62fca2',olympe.sc.Xj);olympe.sc.Xj.prototype.L.K=olympe.D.J.F;olympe.sc.xd=class extends olympe.dm.File{L(){return this.Fb(olympe.sc.xd.F)}R(){return this.Fb(olympe.sc.xd.L)}Y(){return this.He(olympe.sc.xd.R)}};olympe.sc.xd.P=Ec('01647e113043c637b541',olympe.sc.xd);olympe.sc.xd.F=olympe.sc.xd.P.Da('01647e35ecd24ef0b88d');olympe.sc.xd.L=olympe.sc.xd.P.Da('01647e677f5d1cfbdf42');olympe.sc.xd.R=olympe.sc.xd.P.Da('01647e6780999bf8bd25');olympe.sc.xd.prototype.L.K=olympe.D.J.F;olympe.sc.xd.prototype.R.K=olympe.D.J.F;olympe.sc.xd.prototype.Y.K=olympe.D.J.G;olympe.sc.xm=class extends olympe.dm.File{};olympe.sc.xm.P=Ec('0164643c432146a71d5c',olympe.sc.xm);olympe.sc.nr=class extends olympe.dc.CloudObject{};olympe.sc.nr.P=olympe.dc.Ca.C('016421bb3797e22d1c4e',olympe.sc.nr);olympe.sc.logic={};olympe.sc.logic.bp=(a,b)=>a===b?0:a>b?1:-1;
870
+ olympe.sc.logic.$z=(a,b,c,d,e,f,g)=>{const h=b.T();b=olympe.D.Za(b.C().T());let k,l;if(b===olympe.dc.wa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Fb(h).toLowerCase();else if(b===olympe.dc.wa(olympe.dm.Number))k=c.valueOf(),l=p=>p.He(h);else if(b===olympe.dc.wa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Ga([p.gj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Pa().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
871
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.bp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.bp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.ug().filter(p=>olympe.D.Ga([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Bc(d.valueOf()?1===q:0<=q)},olympe.D.ra,'FilterList ListDefBuilder Filter TransformFlows')).mf())};
872
+ olympe.sc.logic.vC=(a,b)=>{if(a instanceof olympe.D.da)return a;if(a instanceof olympe.D.Xa)return a.ss();if(a instanceof olympe.D.ra)return a.Pr();if('string'===typeof a||'number'===typeof a)return olympe.D.za(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.da.Pp};olympe.sc.logic.va={};olympe.sc.logic.va.Po=class{constructor(a,b,c){this.P=olympe.dc.Ca.C(a,b,...c)}T(){return this.P.T()}};olympe.sc.logic.va.Po.ma=[olympe.dc.ze];const bj=Object.create(null),cj=new Map;function dj(a){if(void 0===bj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Gc(a)}function ej(a,b,c=olympe.sc.logic.Function){if(cj.has(a))throw c=dj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.Ca.C(a,b,...[]);cj.set(a,{P:d,HC:b,uC:c});return d}
873
+ olympe.sc.logic.Ca=class{constructor(){}static C(a,b,...c){if(bj[a])throw c=dj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.va.Po(a,b,[olympe.sc.O.Ea].concat(c));return bj[a]=b}};olympe.sc.logic.Zy=class{};olympe.sc.logic.Ij=class extends olympe.dc.CloudObject{};olympe.sc.logic.Ij.P=olympe.dc.Ca.C('01621fb84e320000cf00',olympe.sc.logic.Ij);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.Zr=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Iw(){return this.Zr}kw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.kw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Iw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
874
+ olympe.sc.logic.Nj=class extends olympe.sc.logic.Ij{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Nj.P=olympe.dc.Ca.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Nj);olympe.sc.logic.ne=class extends olympe.dc.CloudObject{C(){return this.ed(olympe.sc.logic.ne.C,olympe.dc.CloudObject)}};olympe.sc.logic.ne.P=olympe.dc.Ca.C('016ac4f59ee8ea2081ba',olympe.sc.logic.ne);olympe.sc.logic.ne.L=olympe.sc.logic.ne.P.Da('017bc044aeacce7ffc8f');olympe.sc.logic.ne.C=olympe.sc.logic.ne.P.Ra('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.P,olympe.sc.logic.ne.C);olympe.sc.logic.ne.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ji=class extends olympe.sc.logic.ne{};olympe.sc.logic.Ji.P=olympe.dc.Ca.C('016ac4f59c592b862457',olympe.sc.logic.Ji);olympe.sc.logic.Ji.F=olympe.sc.pe.C.Sc();olympe.sc.logic.Oh=class extends olympe.sc.logic.ne{};olympe.sc.logic.Oh.P=olympe.dc.Ca.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Oh);olympe.sc.logic.Oh.F=P(olympe.sc.logic.Oh.P,olympe.sc.pe.F);olympe.sc.logic.Oe=class extends olympe.sc.lb{C(){return olympe.sc.Ye.dh.Jq}ka(){return this.$m().ug().qh([olympe.sc.logic.Function]).and().not().qh([olympe.sc.logic.Yd,olympe.sc.logic.ae]).mf()}Bw(){return this.Sl().ug().hj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Ji.F]).mf()}Cw(){return this.Zj().ug().hj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Oh.F]).mf()}Gf(a){const b=this.db.Xm(this,[olympe.sc.lb.L],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}mh(a){const b=
875
+ this.db.Xm(this,[olympe.sc.lb.R],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}fx(){return this.Sl().ug().hj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Mb).mf()}gx(){return this.Zj().ug().hj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Yb).mf()}};ej('01621fb84e320000f000',olympe.sc.logic.Oe,olympe.sc.logic.Function);m=olympe.sc.logic.Oe.prototype;m.Bw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.Cw.K=new olympe.D.J(()=>olympe.dc.Ba,[]);
876
+ m.Gf.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.mh.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.fx.K=new olympe.D.J(()=>olympe.dc.Ba,[]);m.gx.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.logic.ag=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63229782039429f')}G(){return this.mh('016ac6322acf67eebfe7')}L(){return this.Zj().ug().vb(olympe.sc.logic.Kc.typeRel).Sk(olympe.sc.logic.Nj).mf().lf().mn(olympe.D.da.ZERO)}};olympe.sc.logic.ag.C='016ac63229782039429f';olympe.sc.logic.ag.qa='016ac6322acf67eebfe7';olympe.sc.logic.ag.P=ej('01621fb84e320000a000',olympe.sc.logic.ag,olympe.sc.logic.Action);
877
+ olympe.sc.logic.ag.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ag.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ag.prototype.L.K=olympe.D.J.R;olympe.sc.logic.lo=class extends olympe.sc.logic.Oe{};olympe.sc.logic.lo.P=ej('01621fb84e320000f011',olympe.sc.logic.lo);olympe.sc.logic.ko=class extends olympe.sc.logic.ag{};olympe.sc.logic.ko.P=ej('01621fb84e320000f012',olympe.sc.logic.ko);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.cc]}Y(){const a=olympe.sc.Va.hc.xt,b=olympe.sc.Va.hc.su,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}F(a){return this.getOutputs().map(b=>this.db.Xk(b,olympe.sc.logic.Kc.typeRel,olympe.sc.logic.Ij)?a.li.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
878
878
  c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.Ca.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.O.Ea);olympe.sc.logic.Kc=class extends olympe.dc.CloudObject{C(){return this.ed(olympe.sc.logic.Kc.typeRel,olympe.dc.CloudObject)}F(){return this.He(olympe.sc.logic.Kc.C)}};olympe.sc.logic.Kc.P=olympe.dc.Ca.C('0168a431d25001540000',olympe.sc.logic.Kc);olympe.sc.logic.Kc.C=olympe.sc.logic.Kc.P.Da('01740c5d4ae4b520dd01');olympe.sc.logic.Kc.typeRel=olympe.sc.logic.Kc.P.Ra('0168a431d3b9b7438424');P(olympe.dc.CloudObject.P,olympe.sc.logic.Kc.typeRel);
879
- olympe.sc.logic.Kc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Kc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Mb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Mb.P=olympe.dc.Ca.C('0168a431d25001540001',olympe.sc.logic.Mb);olympe.sc.logic.Mb.oa=olympe.sc.logic.Kc.P.Da('01740c5d4ae4b520dd02');olympe.sc.logic.Mb.ha=P(olympe.sc.logic.Mb.P,olympe.sc.lb.L);olympe.sc.logic.Mb.F=olympe.sc.logic.Mb.P.Ra('0168a431d91f2578000b',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Mb.L=olympe.sc.logic.Mb.P.Ra('01621fb84e32000000a1',olympe.dc.Aa.ORIGIN);
880
- olympe.sc.logic.Mb.R=olympe.sc.logic.Mb.P.Ra('01621fb84e32000000d1',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Yb.P=olympe.dc.Ca.C('0168a431d25001540002',olympe.sc.logic.Yb);olympe.sc.logic.Yb.ha=P(olympe.sc.logic.Yb.P,olympe.sc.lb.R);olympe.sc.logic.Yb.F=olympe.sc.logic.Yb.P.Ra('0168a431d91f25780003',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb.R=olympe.sc.logic.Yb.P.Ra('01621fb84e32000000a2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb.L=olympe.sc.logic.Yb.P.Ra('01621fb84e32000000d2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Sd().F().T();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.Ca.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.O.Ea);olympe.sc.logic.Zd=class extends olympe.sc.logic.Function{run(a){Ui(this,a);const b=a.getParent(),c=this.db.nc(this,olympe.sc.logic.Zd.F),d=this.db.nc(this,olympe.sc.logic.Zd.L);a.on(c,e=>b.set(d,e),this.tag)}R(){return this.ed(olympe.sc.logic.Zd.F,olympe.sc.logic.Mb)}cb(){return this.ed(olympe.sc.logic.Zd.L,olympe.sc.logic.Yb)}};olympe.sc.logic.Zd.P=olympe.dc.Ca.C('01621fb84e32000000a0',olympe.sc.logic.Zd,olympe.sc.O.Ea);olympe.sc.logic.Zd.F=P(olympe.sc.logic.Zd.P,olympe.sc.logic.Mb.L);
881
- olympe.sc.logic.Zd.L=P(olympe.sc.logic.Zd.P,olympe.sc.logic.Yb.R);olympe.sc.logic.Zd.prototype.R.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.Zd.prototype.cb.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.be=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.nc(this,olympe.sc.logic.be.L),d=this.db.nc(this,olympe.sc.logic.be.F);b.on(c,e=>a.set(d,e),b.Z())}cb(){return this.ed(olympe.sc.logic.be.L,olympe.sc.logic.Mb)}R(){return this.ed(olympe.sc.logic.be.F,olympe.sc.logic.Yb)}};olympe.sc.logic.be.P=olympe.dc.Ca.C('01621fb84e32000000d0',olympe.sc.logic.be,olympe.sc.O.Ea);olympe.sc.logic.be.L=P(olympe.sc.logic.be.P,olympe.sc.logic.Mb.R);
882
- olympe.sc.logic.be.F=P(olympe.sc.logic.be.P,olympe.sc.logic.Yb.L);olympe.sc.logic.be.prototype.cb.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.be.prototype.R.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);function Zi(a,b,c){const d=a.db.nc(a,olympe.sc.logic.xb.oa)||a.db.nc(a,olympe.sc.logic.xb.R),e=a.db.nc(a,olympe.sc.logic.xb.ha),f=a.db.Rf((()=>{let k=null,l=a.db.nc(a,olympe.sc.logic.xb.F);l?k=a.db.nc(l,olympe.dm.Property.typeRel):(l=a.db.nc(a,olympe.sc.logic.xb.C))&&(k=a.db.nc(l,olympe.sc.logic.Kc.typeRel));return k||olympe.dc.CloudObject.P.T()})(),olympe.dm.qf)?new olympe.D.Zb('Pipe Context'):null,g=a.F.bind(a,b,c,f);if(null!==d&&null!==e){let k;const l=b.oj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>
883
- {g(null);l();k&&k()}}const h=yd(a.db,a,olympe.sc.logic.xb.valueProp,g);return()=>{g(null);a.db.F(a,olympe.sc.logic.xb.valueProp,h)}}
884
- olympe.sc.logic.xb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.N=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.aa();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.hh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.T(),this.Ik(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>{olympe.D.yc([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Wa&&this.Ik(a,`qr-${f.hash}`,Be(f));b(f)}Ik(a,b,c){const d=a.getParent();
885
- d.Ik(b,c);a.set(this.C,()=>Ji(d,b))}getValue(a){return this.Lf(olympe.sc.logic.xb.valueProp,a||olympe.dc.W.Vb.hh,Object)}Nt(){const a=this.transform(olympe.sc.logic.xb.C,olympe.sc.logic.Kc.typeRel);a.Jd(olympe.dc.CloudObject);return a.Qc()}$w(){return this.ed(olympe.sc.logic.xb.ha,olympe.dc.CloudObject)}Yw(){return this.ed(olympe.sc.logic.xb.oa,olympe.sc.logic.Yb)}Zw(){return this.ed(olympe.sc.logic.xb.R,olympe.dm.Property)}pw(){return this.ed(olympe.sc.logic.xb.L,olympe.dc.CloudObject)}nw(){return this.ed(olympe.sc.logic.xb.C,
886
- olympe.sc.logic.Mb)}ow(){return this.ed(olympe.sc.logic.xb.F,olympe.dm.Property)}};olympe.sc.logic.xb.P=olympe.dc.Ca.C('0168a431d91f25780000',olympe.sc.logic.xb,olympe.sc.O.Ea);olympe.sc.logic.xb.valueProp=olympe.sc.logic.xb.P.Da('0168a431d91f25780001');olympe.sc.logic.xb.ha=olympe.sc.logic.xb.P.Ra('0168a431d91f25780002');olympe.sc.logic.xb.oa=P(olympe.sc.logic.xb.P,olympe.sc.logic.Yb.F);olympe.sc.logic.xb.R=olympe.sc.logic.xb.P.Ra('0168a431d91f25780004');olympe.sc.logic.xb.L=olympe.sc.logic.xb.P.Ra('0168a431d91f2578000a');
887
- olympe.sc.logic.xb.C=P(olympe.sc.logic.xb.P,olympe.sc.logic.Mb.F);olympe.sc.logic.xb.F=olympe.sc.logic.xb.P.Ra('0168a431d91f2578000c');P(olympe.dc.CloudObject.P,olympe.sc.logic.xb.ha);P(olympe.dm.Property.P,olympe.sc.logic.xb.R);P(olympe.dc.CloudObject.P,olympe.sc.logic.xb.L);P(olympe.dm.Property.P,olympe.sc.logic.xb.F);m=olympe.sc.logic.xb.prototype;m.Nt.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.$w.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
888
- m.Yw.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.Zw.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.pw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.nw.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.ow.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.ae=class extends olympe.sc.logic.Function{};olympe.sc.logic.ae.P=olympe.dc.Ca.C('017dc8c114aa61a0e27f',olympe.sc.logic.ae);olympe.sc.logic.ae.F=olympe.sc.logic.ae.P.Ra('017dc8d6d8ef9135f08a');olympe.sc.logic.ae.L=olympe.sc.logic.ae.P.Ra('017dc8d6d8ef9135f08b');P(olympe.dm.Ob.P,olympe.sc.logic.ae.L);function gj(a,b){const c=a.Sd(),d=c.Tl().T(),e=c.Ul().T(),f=c.an().T();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.qk.ja(g),olympe.H.ya.pb.Bb.get(a.Wb(),g).then(h=>{h=hj(h,a.R.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Nj.create(h.toString(),1))}))},b.Z())}
889
- function ij(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.qk.ja(p);f.Ke(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Wb()}: ${p.message}`),f.wg(n).finally(()=>b.destroy())}}},h=b.Z(),k=b.on(c,g,h),l=b.on(d,g,h)}
890
- olympe.sc.logic.Ph=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.cb=d;this.timeout=e}run(a){a.mn()||(this.db.gb(this,olympe.sc.logic.Ph.F)?this.uc(a):(Ui(this,a),gj(this,a)))}uc(a){const b=this.Wb(),c=this.Sd(),d=c.Rr().T(),e=c.Tl().T(),f=c.Ul().T(),g=c.an().T();(new olympe.H.ya.pb.Bb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=hj(h.body(),this.R.bind(this,k)),n=Ib(()=>{h.wg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
891
- k.destroy()},this.timeout);ij(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.yj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.wa(q)!==p&&(q=this.Wb(),this.N.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Wb();this.N.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}R(a,b){const c=Array.from(b.ge()).map(d=>d.tag());
892
- Lc(this.cb,a.Fc(),b,[],c)}};olympe.sc.logic.Ph.P=olympe.dc.Ca.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ph,olympe.sc.O.Ea,olympe.dc.db.O.xa,new olympe.U.fa(olympe.sc.Config.wq));olympe.sc.logic.Ph.F=olympe.sc.logic.Ph.P.Da('017a7b0c62a02a89444f');function hj(a,b){var c=(new olympe.dc.W.Hi(olympe.dc.Ka.Wc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,jj(olympe.sc.logic.qk,e,b));return c}function kj(a){a.Gc=new olympe.dc.db.zc;a.values=Object.create(null)}
893
- function jj(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return ve(b.v);case 6:return Ee(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,jj(a,e,c)]));default:return Array.isArray(b)?b.map(d=>jj(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=jj(a,f,c);return d},{}):b}}
894
- function lj(a,b){var c=a.db;a=a.Gc;if(c.Gb(b)){a.F(b,c.wd(b,!0),0);a.Oa(olympe.dc.jc.Vc,b,c.model(b),0);for(const [d,e,f]of Bd(c,b))(c=a.If(f))&&c.te()&&(e===olympe.dc.Aa.DESTINATION?a.Oa(d,b,f,0):a.Oa(d,f,b,0))}else olympe.sa.Za('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
895
- olympe.sc.logic.qk=class{constructor(){this.db=olympe.dc.Pa();kj(this)}static ja(a){const b=new olympe.sc.logic.qk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.Md;this.Gc.Zc(b);a.p=ce(b);a.v=this.values;kj(this);return a}C(a){switch(!0){case a instanceof olympe.D.kb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,
896
- r:a.Nf().valueOf(),g:a.Hf().valueOf(),b:a.Cf().valueOf(),a:a.Bf().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.Xr};case a&&'function'===typeof a.T:return a=a.T(),lj(this,a),{t:4,v:a};case a instanceof olympe.dc.hb:return{t:5,v:a.ja()};case a instanceof olympe.dc.Wa:return{t:6,v:a.ja()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
897
- a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Nl=class{constructor(a){this.db=olympe.dc.Pa();this.typeRel=a}};olympe.sc.logic.controllers.Nl.C={Vy:-1,Qz:1};olympe.sc.logic.controllers.uA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.ne.C)}};olympe.sc.logic.controllers.wA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.Kc.typeRel)}};olympe.sc.logic.Mk={};olympe.sc.logic.Mk.Ru=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.wa(b);e?ef(Ze(new olympe.dc.hf(e),olympe.dc.Ub.rf),c).ib(()=>{d(olympe.dc.CloudObject.get(e))}):this.N.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.Ca.C('0174bf4b7e006e4b788a',olympe.sc.logic.Mk.Ru);olympe.sc.logic.actions={};olympe.sc.logic.Mk.Yt=class extends olympe.sc.logic.Function{run(a){Ui(this,a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.N.warn('No list to iter upon'),this.N.info(a.Z())):f<e?(b(g.We(f)),f++,c((new Date).getTime())):(h.jl(),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.yg();f=0;h.Gk();k();break;case 2:k();break;default:this.N.error('Unhandled input')}},this.tag))}};
898
- olympe.sc.logic.Ca.C('0171889b060b6cd54300',olympe.sc.logic.Mk.Yt);olympe.sc.logic.ec={};olympe.sc.logic.ec.no=class extends olympe.sc.logic.Oe{F(){return this.Gf('017dc92292107fb98b21')}};fj('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.ec.no);olympe.sc.logic.ec.no.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.Pl=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63808535703691c')}};olympe.sc.logic.ec.Pl.P=fj('0169b6876a03f139d50a',olympe.sc.logic.ec.Pl);olympe.sc.logic.ec.Pl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.cm=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63809a9a8e6db96')}G(){return this.mh('016ac6380ab003363b3e')}};fj('01646ad602f933b8caaf',olympe.sc.logic.ec.cm);olympe.sc.logic.ec.cm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.cm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.hk=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac6380bd98f1d91a0')}L(){return this.mh('016ac63c589ae38ca3ae')}G(){return this.mh('016ac63c5a377fceabaa')}};fj('0168ec42fc01747a98b6',olympe.sc.logic.ec.hk);olympe.sc.logic.ec.hk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.hk.prototype.L.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.hk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.Xg=class extends olympe.sc.logic.Oe{Tl(){return this.Gf('017a7b07b09e3b22c8b4')}Rr(){return this.Gf('017a7b07ba05807a74b0')}Ul(){return this.mh('017a7b0818c12388d731')}an(){return this.mh('017a7b085146d5e69aec')}Ot(){return olympe.D.ra.F}};olympe.sc.logic.ec.Xg.oa='017a7b07b09e3b22c8b4';olympe.sc.logic.ec.Xg.$c='017a7b07ba05807a74b0';olympe.sc.logic.ec.Xg.uc='017a7b0818c12388d731';olympe.sc.logic.ec.Xg.C='017a7b085146d5e69aec';
899
- olympe.sc.logic.ec.Xg.P=fj('017a7b07a948e30508fa',olympe.sc.logic.ec.Xg,olympe.sc.logic.Ph);m=olympe.sc.logic.ec.Xg.prototype;m.Tl.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.Rr.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.Ul.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.an.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.Ot.K=olympe.D.J.R;olympe.sc.logic.ec.Qq=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63c5b3ed0562740')}};fj('016a9766c230916ea5ec',olympe.sc.logic.ec.Qq);olympe.sc.logic.ec.Qq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.query={};olympe.sc.query.Nn=class extends olympe.sc.Vg{};olympe.sc.query.Nn.P=olympe.dc.Ca.C('01631aacd8276ea98491',olympe.sc.query.Nn);olympe.sc.query.bq=class extends olympe.dm.Enum{};olympe.sc.query.bq.P=olympe.dc.Ca.C('01631aacd8276ea98495',olympe.sc.query.bq);olympe.sc.query.mq=class extends olympe.dm.Enum{};olympe.sc.query.mq.P=olympe.dc.Ca.C('01631aacd8276ea98494',olympe.sc.query.mq);olympe.sc.query.oq=class extends olympe.sc.Vg{};olympe.sc.query.oq.P=olympe.dc.Ca.C('01631aacd8276ea98492',olympe.sc.query.oq);olympe.sc.query.pq=class extends olympe.dc.CloudObject{};olympe.sc.query.pq.P=olympe.dc.Ca.C('01631aacd8276ea98493',olympe.sc.query.pq);olympe.sc.La={};olympe.sc.La.Me=class extends olympe.sc.lb{C(){return olympe.sc.Ye.dh.Hu}};olympe.sc.La.Me.P=Kc(olympe.dc.Ca.C('01120300000000adef00',olympe.sc.La.Me));olympe.sc.La.Me.C=olympe.sc.La.Me.P.Ra('0171bc1f15da96dfdb89');P(olympe.dm.od.P,olympe.sc.La.Me.C);olympe.sc.La.Cj=class extends olympe.sc.Runnable{aa(){return[this.Wb()]}R(){return olympe.dc.nd.from(this.Wb()).vb(olympe.sc.La.Me.C).vd()}};olympe.sc.La.Cj.P=Kc(olympe.dc.Ca.C('0113030000000aca1100',olympe.sc.La.Cj));olympe.sc.La.Cj.prototype.R.K=new olympe.D.J(()=>olympe.dm.Ob,[]);olympe.sc.La.ub=class extends olympe.dc.CloudObject{Qt(){return this.nh(olympe.sc.La.ub.F)}Cx(){return this.nh(olympe.sc.La.ub.Ab)}Ud(){return this.He(olympe.sc.La.ub.C)}rw(){return this.Fb(olympe.sc.La.ub.ha)}Pw(){return this.Fb(olympe.sc.La.ub.cb)}Ow(){return this.Fb(olympe.sc.La.ub.Ta)}Xm(){this.Fb(olympe.sc.La.ub.bb)}Dw(){return this.Fb(olympe.sc.La.ub.oa)}ew(){return this.Fb(olympe.sc.La.ub.L)}Nw(){return this.Fb(olympe.sc.La.ub.Fa)}Pt(){return this.Fb(olympe.sc.La.ub.R)}};
900
- olympe.sc.La.ub.P=olympe.dc.Ca.C('011203300000000adef5',olympe.sc.La.ub);olympe.sc.La.ub.F=olympe.sc.La.ub.P.Da('011203300000000adef6');olympe.sc.La.ub.Ab=olympe.sc.La.ub.P.Da('011203300000000adef7');olympe.sc.La.ub.C=olympe.sc.La.ub.P.Da('011203300000000adef8');olympe.sc.La.ub.ha=olympe.sc.La.ub.P.Da('011203300000000adef9');olympe.sc.La.ub.cb=olympe.sc.La.ub.P.Da('011203300000000adefa');olympe.sc.La.ub.Ta=olympe.sc.La.ub.P.Da('011203300000000adefb');olympe.sc.La.ub.L=olympe.sc.La.ub.P.Da('011203300000000adefc');
901
- olympe.sc.La.ub.bb=olympe.sc.La.ub.P.Da('011203300000000adefd');olympe.sc.La.ub.oa=olympe.sc.La.ub.P.Da('011203300000000adefe');olympe.sc.La.ub.Fa=olympe.sc.La.ub.P.Da('011203300000000adeff');olympe.sc.La.ub.R=olympe.sc.La.ub.P.Da('011203300000000adee0');olympe.sc.La.ub.Pb={INIT:0,My:1,Mi:2,tm:3,rk:4,SA:5,rc:9};m=olympe.sc.La.ub.prototype;m.Qt.K=olympe.D.J.R;m.Cx.K=olympe.D.J.R;m.Ud.K=olympe.D.J.G;m.rw.K=olympe.D.J.F;m.Pw.K=olympe.D.J.F;m.Ow.K=olympe.D.J.F;m.Xm.K=olympe.D.J.F;m.Dw.K=olympe.D.J.F;
902
- m.ew.K=olympe.D.J.F;m.Nw.K=olympe.D.J.F;m.Pt.K=olympe.D.J.F;olympe.sc.La.ep=class extends olympe.sc.La.Cj{Ta(){return!0}};olympe.sc.La.ep.P=olympe.dc.Ca.C('0113032000000aca1102',olympe.sc.La.ep,olympe.sc.O.Ea);olympe.sc.La.Zg=class extends olympe.sc.La.Me{F(){return(new olympe.dc.bk(this.T(),olympe.sc.La.ub)).vb(olympe.sc.La.Zg.oa).mf().Qc()}};olympe.sc.La.Zg.P=olympe.dc.Ca.C('011203300000000adef3',olympe.sc.La.Zg);olympe.sc.La.Zg.oa=olympe.sc.La.Zg.P.Ra('011203300000000adef4');P(olympe.sc.La.ub.P,olympe.sc.La.Zg.oa);olympe.sc.La.Zg.prototype.F.K=new olympe.D.J(()=>olympe.sc.La.ub,[]);olympe.sc.ah=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.ah.P=olympe.dc.Ca.C('011203300000000adf00',olympe.sc.ah);olympe.sc.ah.F=olympe.sc.ah.P.Da('011203300000000adf01');olympe.sc.ah.C=olympe.sc.ah.P.Da('011203300000000adf02');olympe.sc.ah.L='011203300000000adf0f';olympe.sc.Ty=class{};olympe.sc.eb=class{constructor(a){this.wb=a}Z(){return this.wb.Z()}gn(){return this.wb.gn()}getParent(){return this.wb.getParent()}Nk(){return this.wb.Nk()}Fc(){return this.wb.Fc()}qn(a){this.wb.qn(a)}Gk(){this.wb.Gk()}jl(){this.wb.jl()}set(a,b){this.wb.set(a,b);return this}li(a){this.wb.li(a);return this}remove(a){this.wb.remove(a)}Eb(a,b,c=!1){return this.wb.Eb(a,b,c)}get(a,b=!1){return this.wb.get(a,b)}has(a,b=!1){return this.wb.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=
903
- this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.Z());this.Hg(()=>{f();d.complete()});return f})}repeat(a,b){this.wb.repeat(a,b);return this}el(a){return this.wb.el(a)}Dn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.wb.hl(a);return this}Ya(a,b=!0){return this.wb.Ya(a,b)}on(a,b,c){return this.wb.on(a,b,c)}Yh(a){return this.wb.Yh(a)}Qk(a,b){return this.wb.Qk(a,b)}oj(a,b){return this.wb.oj(a,b)}fi(a){return this.wb.fi(a)}kj(){return this.wb.kj()}Hg(a,
904
- b){return this.wb.Hg(a,b)}cl(a){this.wb.cl(a)}onDestroy(a){return this.wb.onDestroy(a)}Ie(a){this.wb.Ie(a)}destroy(){this.wb.destroy()}clear(){this.wb.clear()}zb(){return this.wb.zb()}mn(){return this.wb.mn()}Wk(){return this.wb.Wk()}gb(a){if('function'!==typeof this.wb.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.wb.getProperty(a)}sw(a){if('function'!==typeof this.wb.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
905
- return this.wb.getEvent(a)}Lx(...a){if('function'!==typeof this.wb.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.wb.observeMany(a)}};olympe.sc.eb.prototype.observeMany=olympe.sc.eb.prototype.Lx;olympe.sc.eb.prototype.getEvent=olympe.sc.eb.prototype.sw;olympe.sc.eb.prototype.getProperty=olympe.sc.eb.prototype.gb;olympe.sc.eb.prototype.clear=olympe.sc.eb.prototype.clear;olympe.sc.eb.prototype.destroy=olympe.sc.eb.prototype.destroy;
879
+ olympe.sc.logic.Kc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Kc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Mb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Mb.P=olympe.dc.Ca.C('0168a431d25001540001',olympe.sc.logic.Mb);olympe.sc.logic.Mb.qa=olympe.sc.logic.Kc.P.Da('01740c5d4ae4b520dd02');olympe.sc.logic.Mb.ka=P(olympe.sc.logic.Mb.P,olympe.sc.lb.L);olympe.sc.logic.Mb.F=olympe.sc.logic.Mb.P.Ra('0168a431d91f2578000b',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Mb.L=olympe.sc.logic.Mb.P.Ra('01621fb84e32000000a1',olympe.dc.Aa.ORIGIN);
880
+ olympe.sc.logic.Mb.R=olympe.sc.logic.Mb.P.Ra('01621fb84e32000000d1',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Yb.P=olympe.dc.Ca.C('0168a431d25001540002',olympe.sc.logic.Yb);olympe.sc.logic.Yb.ka=P(olympe.sc.logic.Yb.P,olympe.sc.lb.R);olympe.sc.logic.Yb.F=olympe.sc.logic.Yb.P.Ra('0168a431d91f25780003',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb.R=olympe.sc.logic.Yb.P.Ra('01621fb84e32000000a2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Yb.L=olympe.sc.logic.Yb.P.Ra('01621fb84e32000000d2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Rd().F().T();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.Ca.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.O.Ea);olympe.sc.logic.Yd=class extends olympe.sc.logic.Function{run(a){Ti(this,a);const b=a.getParent(),c=this.db.oc(this,olympe.sc.logic.Yd.F),d=this.db.oc(this,olympe.sc.logic.Yd.L);a.on(c,e=>b.set(d,e),this.tag)}R(){return this.ed(olympe.sc.logic.Yd.F,olympe.sc.logic.Mb)}$a(){return this.ed(olympe.sc.logic.Yd.L,olympe.sc.logic.Yb)}};olympe.sc.logic.Yd.P=olympe.dc.Ca.C('01621fb84e32000000a0',olympe.sc.logic.Yd,olympe.sc.O.Ea);olympe.sc.logic.Yd.F=P(olympe.sc.logic.Yd.P,olympe.sc.logic.Mb.L);
881
+ olympe.sc.logic.Yd.L=P(olympe.sc.logic.Yd.P,olympe.sc.logic.Yb.R);olympe.sc.logic.Yd.prototype.R.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.Yd.prototype.$a.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ae=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.oc(this,olympe.sc.logic.ae.L),d=this.db.oc(this,olympe.sc.logic.ae.F);b.on(c,e=>a.set(d,e),b.Z())}$a(){return this.ed(olympe.sc.logic.ae.L,olympe.sc.logic.Mb)}R(){return this.ed(olympe.sc.logic.ae.F,olympe.sc.logic.Yb)}};olympe.sc.logic.ae.P=olympe.dc.Ca.C('01621fb84e32000000d0',olympe.sc.logic.ae,olympe.sc.O.Ea);olympe.sc.logic.ae.L=P(olympe.sc.logic.ae.P,olympe.sc.logic.Mb.R);
882
+ olympe.sc.logic.ae.F=P(olympe.sc.logic.ae.P,olympe.sc.logic.Yb.L);olympe.sc.logic.ae.prototype.$a.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ae.prototype.R.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);function Yi(a,b,c){const d=a.db.oc(a,olympe.sc.logic.xb.qa)||a.db.oc(a,olympe.sc.logic.xb.R),e=a.db.oc(a,olympe.sc.logic.xb.ka),f=a.db.Rf((()=>{let k=null,l=a.db.oc(a,olympe.sc.logic.xb.F);l?k=a.db.oc(l,olympe.dm.Property.typeRel):(l=a.db.oc(a,olympe.sc.logic.xb.C))&&(k=a.db.oc(l,olympe.sc.logic.Kc.typeRel));return k||olympe.dc.CloudObject.P.T()})(),olympe.dm.qf)?new olympe.D.Zb('Pipe Context'):null,g=a.F.bind(a,b,c,f);if(null!==d&&null!==e){let k;const l=b.oj(e,n=>{k&&k();k=n.on(d,g,e)});return()=>
883
+ {g(null);l();k&&k()}}const h=xd(a.db,a,olympe.sc.logic.xb.valueProp,g);return()=>{g(null);a.db.F(a,olympe.sc.logic.xb.valueProp,h)}}
884
+ olympe.sc.logic.xb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.N=c;this.C=`detachObject${this.tag}`}F(a,b,c,d){null!==c&&c.ea();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.hh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.T(),this.Ik(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>{olympe.D.yc([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Wa&&this.Ik(a,`qr-${f.hash}`,Ae(f));b(f)}Ik(a,b,c){const d=a.getParent();
885
+ d.Ik(b,c);a.set(this.C,()=>Ii(d,b))}getValue(a){return this.Lf(olympe.sc.logic.xb.valueProp,a||olympe.dc.W.Vb.hh,Object)}Rt(){const a=this.transform(olympe.sc.logic.xb.C,olympe.sc.logic.Kc.typeRel);a.Jd(olympe.dc.CloudObject);return a.Rc()}dx(){return this.ed(olympe.sc.logic.xb.ka,olympe.dc.CloudObject)}bx(){return this.ed(olympe.sc.logic.xb.qa,olympe.sc.logic.Yb)}cx(){return this.ed(olympe.sc.logic.xb.R,olympe.dm.Property)}tw(){return this.ed(olympe.sc.logic.xb.L,olympe.dc.CloudObject)}rw(){return this.ed(olympe.sc.logic.xb.C,
886
+ olympe.sc.logic.Mb)}sw(){return this.ed(olympe.sc.logic.xb.F,olympe.dm.Property)}};olympe.sc.logic.xb.P=olympe.dc.Ca.C('0168a431d91f25780000',olympe.sc.logic.xb,olympe.sc.O.Ea);olympe.sc.logic.xb.valueProp=olympe.sc.logic.xb.P.Da('0168a431d91f25780001');olympe.sc.logic.xb.ka=olympe.sc.logic.xb.P.Ra('0168a431d91f25780002');olympe.sc.logic.xb.qa=P(olympe.sc.logic.xb.P,olympe.sc.logic.Yb.F);olympe.sc.logic.xb.R=olympe.sc.logic.xb.P.Ra('0168a431d91f25780004');olympe.sc.logic.xb.L=olympe.sc.logic.xb.P.Ra('0168a431d91f2578000a');
887
+ olympe.sc.logic.xb.C=P(olympe.sc.logic.xb.P,olympe.sc.logic.Mb.F);olympe.sc.logic.xb.F=olympe.sc.logic.xb.P.Ra('0168a431d91f2578000c');P(olympe.dc.CloudObject.P,olympe.sc.logic.xb.ka);P(olympe.dm.Property.P,olympe.sc.logic.xb.R);P(olympe.dc.CloudObject.P,olympe.sc.logic.xb.L);P(olympe.dm.Property.P,olympe.sc.logic.xb.F);m=olympe.sc.logic.xb.prototype;m.Rt.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.dx.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
888
+ m.bx.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.cx.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.tw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.rw.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.sw.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.$d=class extends olympe.sc.logic.Function{};olympe.sc.logic.$d.P=olympe.dc.Ca.C('017dc8c114aa61a0e27f',olympe.sc.logic.$d);olympe.sc.logic.$d.F=olympe.sc.logic.$d.P.Ra('017dc8d6d8ef9135f08a');olympe.sc.logic.$d.L=olympe.sc.logic.$d.P.Ra('017dc8d6d8ef9135f08b');P(olympe.dm.Ob.P,olympe.sc.logic.$d.L);function fj(a,b){const c=a.Rd(),d=c.Tl().T(),e=c.Ul().T(),f=c.bn().T();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.qk.ia(g),olympe.H.ya.pb.Bb.get(a.Wb(),g).then(h=>{h=gj(h,a.R.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Nj.create(h.toString(),1))}))},b.Z())}
889
+ function hj(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.qk.ia(p);f.Ke(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Wb()}: ${p.message}`),f.wg(n).finally(()=>b.destroy())}}},h=b.Z(),k=b.on(c,g,h),l=b.on(d,g,h)}
890
+ olympe.sc.logic.Ph=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.$a=d;this.timeout=e}run(a){a.nn()||(this.db.gb(this,olympe.sc.logic.Ph.F)?this.lc(a):(Ti(this,a),fj(this,a)))}lc(a){const b=this.Wb(),c=this.Rd(),d=c.Ur().T(),e=c.Tl().T(),f=c.Ul().T(),g=c.bn().T();(new olympe.H.ya.pb.Bb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=gj(h.body(),this.R.bind(this,k)),n=Ib(()=>{h.wg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
891
+ k.destroy()},this.timeout);hj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.yj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.wa(q)!==p&&(q=this.Wb(),this.N.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Wb();this.N.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}R(a,b){const c=Array.from(b.ge()).map(d=>d.tag());
892
+ Kc(this.$a,a.Fc(),b,[],c)}};olympe.sc.logic.Ph.P=olympe.dc.Ca.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Ph,olympe.sc.O.Ea,olympe.dc.db.O.xa,new olympe.U.fa(olympe.sc.Config.zq));olympe.sc.logic.Ph.F=olympe.sc.logic.Ph.P.Da('017a7b0c62a02a89444f');function gj(a,b){var c=(new olympe.dc.W.Hi(olympe.dc.Ka.Xc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,ij(olympe.sc.logic.qk,e,b));return c}function jj(a){a.Gc=new olympe.dc.db.zc;a.values=Object.create(null)}
893
+ function ij(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return ue(b.v);case 6:return De(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,ij(a,e,c)]));default:return Array.isArray(b)?b.map(d=>ij(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=ij(a,f,c);return d},{}):b}}
894
+ function kj(a,b){var c=a.db;a=a.Gc;if(c.Gb(b)){a.F(b,c.vd(b,!0),0);a.Oa(olympe.dc.jc.Wc,b,c.model(b),0);for(const [d,e,f]of Ad(c,b))(c=a.If(f))&&c.te()&&(e===olympe.dc.Aa.DESTINATION?a.Oa(d,b,f,0):a.Oa(d,f,b,0))}else olympe.sa.Ya('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
895
+ olympe.sc.logic.qk=class{constructor(){this.db=olympe.dc.Pa();jj(this)}static ia(a){const b=new olympe.sc.logic.qk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.Md;this.Gc.$c(b);a.p=be(b);a.v=this.values;jj(this);return a}C(a){switch(!0){case a instanceof olympe.D.kb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,
896
+ r:a.Nf().valueOf(),g:a.Hf().valueOf(),b:a.Cf().valueOf(),a:a.Bf().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.Zr};case a&&'function'===typeof a.T:return a=a.T(),kj(this,a),{t:4,v:a};case a instanceof olympe.dc.hb:return{t:5,v:a.ia()};case a instanceof olympe.dc.Wa:return{t:6,v:a.ia()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
897
+ a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Nl=class{constructor(a){this.db=olympe.dc.Pa();this.typeRel=a}};olympe.sc.logic.controllers.Nl.C={$y:-1,Vz:1};olympe.sc.logic.controllers.yA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.ne.C)}};olympe.sc.logic.controllers.AA=class extends olympe.sc.logic.controllers.Nl{constructor(){super(olympe.sc.logic.Kc.typeRel)}};olympe.sc.logic.Mk={};olympe.sc.logic.Mk.Vu=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.wa(b);e?cf(Xe(new olympe.dc.hf(e),olympe.dc.Ub.rf),c).ib(()=>{d(olympe.dc.CloudObject.get(e))}):this.N.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.Ca.C('0174bf4b7e006e4b788a',olympe.sc.logic.Mk.Vu);olympe.sc.logic.actions={};olympe.sc.logic.Mk.bu=class extends olympe.sc.logic.Function{run(a){Ti(this,a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.N.warn('No list to iter upon'),this.N.info(a.Z())):f<e?(b(g.We(f)),f++,c((new Date).getTime())):(h.jl(),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.yg();f=0;h.Gk();k();break;case 2:k();break;default:this.N.error('Unhandled input')}},this.tag))}};
898
+ olympe.sc.logic.Ca.C('0171889b060b6cd54300',olympe.sc.logic.Mk.bu);olympe.sc.logic.ec={};olympe.sc.logic.ec.po=class extends olympe.sc.logic.Oe{F(){return this.Gf('017dc92292107fb98b21')}};ej('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.ec.po);olympe.sc.logic.ec.po.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.Pl=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63808535703691c')}};olympe.sc.logic.ec.Pl.P=ej('0169b6876a03f139d50a',olympe.sc.logic.ec.Pl);olympe.sc.logic.ec.Pl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.cm=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63809a9a8e6db96')}G(){return this.mh('016ac6380ab003363b3e')}};ej('01646ad602f933b8caaf',olympe.sc.logic.ec.cm);olympe.sc.logic.ec.cm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.cm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.hk=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac6380bd98f1d91a0')}L(){return this.mh('016ac63c589ae38ca3ae')}G(){return this.mh('016ac63c5a377fceabaa')}};ej('0168ec42fc01747a98b6',olympe.sc.logic.ec.hk);olympe.sc.logic.ec.hk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.logic.ec.hk.prototype.L.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.hk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);olympe.sc.logic.ec.Xg=class extends olympe.sc.logic.Oe{Tl(){return this.Gf('017a7b07b09e3b22c8b4')}Ur(){return this.Gf('017a7b07ba05807a74b0')}Ul(){return this.mh('017a7b0818c12388d731')}bn(){return this.mh('017a7b085146d5e69aec')}St(){return olympe.D.ra.F}};olympe.sc.logic.ec.Xg.qa='017a7b07b09e3b22c8b4';olympe.sc.logic.ec.Xg.Lc='017a7b07ba05807a74b0';olympe.sc.logic.ec.Xg.lc='017a7b0818c12388d731';olympe.sc.logic.ec.Xg.C='017a7b085146d5e69aec';
899
+ olympe.sc.logic.ec.Xg.P=ej('017a7b07a948e30508fa',olympe.sc.logic.ec.Xg,olympe.sc.logic.Ph);m=olympe.sc.logic.ec.Xg.prototype;m.Tl.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.Ur.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);m.Ul.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.bn.K=new olympe.D.J(()=>olympe.sc.logic.Yb,[]);m.St.K=olympe.D.J.R;olympe.sc.logic.ec.Tq=class extends olympe.sc.logic.Oe{F(){return this.Gf('016ac63c5b3ed0562740')}};ej('016a9766c230916ea5ec',olympe.sc.logic.ec.Tq);olympe.sc.logic.ec.Tq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Mb,[]);olympe.sc.query={};olympe.sc.query.Pn=class extends olympe.sc.Vg{};olympe.sc.query.Pn.P=olympe.dc.Ca.C('01631aacd8276ea98491',olympe.sc.query.Pn);olympe.sc.query.fq=class extends olympe.dm.Enum{};olympe.sc.query.fq.P=olympe.dc.Ca.C('01631aacd8276ea98495',olympe.sc.query.fq);olympe.sc.query.qq=class extends olympe.dm.Enum{};olympe.sc.query.qq.P=olympe.dc.Ca.C('01631aacd8276ea98494',olympe.sc.query.qq);olympe.sc.query.sq=class extends olympe.sc.Vg{};olympe.sc.query.sq.P=olympe.dc.Ca.C('01631aacd8276ea98492',olympe.sc.query.sq);olympe.sc.query.tq=class extends olympe.dc.CloudObject{};olympe.sc.query.tq.P=olympe.dc.Ca.C('01631aacd8276ea98493',olympe.sc.query.tq);olympe.sc.La={};olympe.sc.La.Me=class extends olympe.sc.lb{C(){return olympe.sc.Ye.dh.Lu}};olympe.sc.La.Me.P=Jc(olympe.dc.Ca.C('01120300000000adef00',olympe.sc.La.Me));olympe.sc.La.Me.C=olympe.sc.La.Me.P.Ra('0171bc1f15da96dfdb89');P(olympe.dm.od.P,olympe.sc.La.Me.C);olympe.sc.La.Cj=class extends olympe.sc.Runnable{ea(){return[this.Wb()]}R(){return olympe.dc.nd.from(this.Wb()).vb(olympe.sc.La.Me.C).ud()}};olympe.sc.La.Cj.P=Jc(olympe.dc.Ca.C('0113030000000aca1100',olympe.sc.La.Cj));olympe.sc.La.Cj.prototype.R.K=new olympe.D.J(()=>olympe.dm.Ob,[]);olympe.sc.La.ub=class extends olympe.dc.CloudObject{Ut(){return this.nh(olympe.sc.La.ub.F)}Gx(){return this.nh(olympe.sc.La.ub.Ab)}Td(){return this.He(olympe.sc.La.ub.C)}vw(){return this.Fb(olympe.sc.La.ub.ka)}Tw(){return this.Fb(olympe.sc.La.ub.$a)}Sw(){return this.Fb(olympe.sc.La.ub.Ta)}Ym(){this.Fb(olympe.sc.La.ub.cb)}Hw(){return this.Fb(olympe.sc.La.ub.qa)}iw(){return this.Fb(olympe.sc.La.ub.L)}Rw(){return this.Fb(olympe.sc.La.ub.Fa)}Tt(){return this.Fb(olympe.sc.La.ub.R)}};
900
+ olympe.sc.La.ub.P=olympe.dc.Ca.C('011203300000000adef5',olympe.sc.La.ub);olympe.sc.La.ub.F=olympe.sc.La.ub.P.Da('011203300000000adef6');olympe.sc.La.ub.Ab=olympe.sc.La.ub.P.Da('011203300000000adef7');olympe.sc.La.ub.C=olympe.sc.La.ub.P.Da('011203300000000adef8');olympe.sc.La.ub.ka=olympe.sc.La.ub.P.Da('011203300000000adef9');olympe.sc.La.ub.$a=olympe.sc.La.ub.P.Da('011203300000000adefa');olympe.sc.La.ub.Ta=olympe.sc.La.ub.P.Da('011203300000000adefb');olympe.sc.La.ub.L=olympe.sc.La.ub.P.Da('011203300000000adefc');
901
+ olympe.sc.La.ub.cb=olympe.sc.La.ub.P.Da('011203300000000adefd');olympe.sc.La.ub.qa=olympe.sc.La.ub.P.Da('011203300000000adefe');olympe.sc.La.ub.Fa=olympe.sc.La.ub.P.Da('011203300000000adeff');olympe.sc.La.ub.R=olympe.sc.La.ub.P.Da('011203300000000adee0');olympe.sc.La.ub.Pb={INIT:0,Ry:1,Mi:2,um:3,rk:4,WA:5,tc:9};m=olympe.sc.La.ub.prototype;m.Ut.K=olympe.D.J.R;m.Gx.K=olympe.D.J.R;m.Td.K=olympe.D.J.G;m.vw.K=olympe.D.J.F;m.Tw.K=olympe.D.J.F;m.Sw.K=olympe.D.J.F;m.Ym.K=olympe.D.J.F;m.Hw.K=olympe.D.J.F;
902
+ m.iw.K=olympe.D.J.F;m.Rw.K=olympe.D.J.F;m.Tt.K=olympe.D.J.F;olympe.sc.La.hp=class extends olympe.sc.La.Cj{Ta(){return!0}};olympe.sc.La.hp.P=olympe.dc.Ca.C('0113032000000aca1102',olympe.sc.La.hp,olympe.sc.O.Ea);olympe.sc.La.Zg=class extends olympe.sc.La.Me{F(){return(new olympe.dc.bk(this.T(),olympe.sc.La.ub)).vb(olympe.sc.La.Zg.qa).mf().Rc()}};olympe.sc.La.Zg.P=olympe.dc.Ca.C('011203300000000adef3',olympe.sc.La.Zg);olympe.sc.La.Zg.qa=olympe.sc.La.Zg.P.Ra('011203300000000adef4');P(olympe.sc.La.ub.P,olympe.sc.La.Zg.qa);olympe.sc.La.Zg.prototype.F.K=new olympe.D.J(()=>olympe.sc.La.ub,[]);olympe.sc.ah=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.ah.P=olympe.dc.Ca.C('011203300000000adf00',olympe.sc.ah);olympe.sc.ah.F=olympe.sc.ah.P.Da('011203300000000adf01');olympe.sc.ah.C=olympe.sc.ah.P.Da('011203300000000adf02');olympe.sc.ah.L='011203300000000adf0f';olympe.sc.Yy=class{};olympe.sc.eb=class{constructor(a){this.wb=a}Z(){return this.wb.Z()}hn(){return this.wb.hn()}getParent(){return this.wb.getParent()}Nk(){return this.wb.Nk()}Fc(){return this.wb.Fc()}rn(a){this.wb.rn(a)}Gk(){this.wb.Gk()}jl(){this.wb.jl()}set(a,b){this.wb.set(a,b);return this}li(a){this.wb.li(a);return this}remove(a){this.wb.remove(a)}Eb(a,b,c=!1){return this.wb.Eb(a,b,c)}get(a,b=!1){return this.wb.get(a,b)}has(a,b=!1){return this.wb.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=
903
+ this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.Z());this.Hg(()=>{f();d.complete()});return f})}repeat(a,b){this.wb.repeat(a,b);return this}el(a){return this.wb.el(a)}Fn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.wb.hl(a);return this}Za(a,b=!0){return this.wb.Za(a,b)}on(a,b,c){return this.wb.on(a,b,c)}Yh(a){return this.wb.Yh(a)}Qk(a,b){return this.wb.Qk(a,b)}oj(a,b){return this.wb.oj(a,b)}fi(a){return this.wb.fi(a)}kj(){return this.wb.kj()}Hg(a,
904
+ b){return this.wb.Hg(a,b)}cl(a){this.wb.cl(a)}onDestroy(a){return this.wb.onDestroy(a)}Ie(a){this.wb.Ie(a)}destroy(){this.wb.destroy()}clear(){this.wb.clear()}zb(){return this.wb.zb()}nn(){return this.wb.nn()}Wk(){return this.wb.Wk()}gb(a){if('function'!==typeof this.wb.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.wb.getProperty(a)}ww(a){if('function'!==typeof this.wb.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
905
+ return this.wb.getEvent(a)}Px(...a){if('function'!==typeof this.wb.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.wb.observeMany(a)}};olympe.sc.eb.prototype.observeMany=olympe.sc.eb.prototype.Px;olympe.sc.eb.prototype.getEvent=olympe.sc.eb.prototype.ww;olympe.sc.eb.prototype.getProperty=olympe.sc.eb.prototype.gb;olympe.sc.eb.prototype.clear=olympe.sc.eb.prototype.clear;olympe.sc.eb.prototype.destroy=olympe.sc.eb.prototype.destroy;
906
906
  olympe.sc.eb.prototype.offDestroy=olympe.sc.eb.prototype.Ie;olympe.sc.eb.prototype.onDestroy=olympe.sc.eb.prototype.onDestroy;olympe.sc.eb.prototype.offClear=olympe.sc.eb.prototype.cl;olympe.sc.eb.prototype.onClear=olympe.sc.eb.prototype.Hg;olympe.sc.eb.prototype.getOtherContext=olympe.sc.eb.prototype.fi;olympe.sc.eb.prototype.onContext=olympe.sc.eb.prototype.oj;olympe.sc.eb.prototype.createChild=olympe.sc.eb.prototype.Yh;olympe.sc.eb.prototype.setParentElement=olympe.sc.eb.prototype.hl;
907
- olympe.sc.eb.prototype.waitFor=olympe.sc.eb.prototype.Dn;olympe.sc.eb.prototype.runner=olympe.sc.eb.prototype.el;olympe.sc.eb.prototype.repeat=olympe.sc.eb.prototype.repeat;olympe.sc.eb.prototype.observe=olympe.sc.eb.prototype.observe;olympe.sc.eb.prototype.has=olympe.sc.eb.prototype.has;olympe.sc.eb.prototype.get=olympe.sc.eb.prototype.get;olympe.sc.eb.prototype.remove=olympe.sc.eb.prototype.remove;olympe.sc.eb.prototype.trigger=olympe.sc.eb.prototype.li;olympe.sc.eb.prototype.set=olympe.sc.eb.prototype.set;
908
- olympe.sc.eb.prototype.getParent=olympe.sc.eb.prototype.getParent;olympe.sc.Kj=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.Kj.P=olympe.dc.Ca.C('01645fe6873aeea59e64',olympe.sc.Kj);olympe.sc.Kj.C=olympe.sc.Kj.P.Ra('017ed8ac775f48d4d589');olympe.sc.we=class extends olympe.sc.Runnable{cb(){return this.tb(olympe.sc.we.L,olympe.sc.Runnable)}R(){return this.tb(olympe.sc.we.F,olympe.dm.Property)}};olympe.sc.we.P=Kc(olympe.dc.Ca.C('016c2d996d9ca27fa9d8',olympe.sc.we));olympe.sc.we.L=olympe.sc.we.P.Ra('016c3cb7742ec9309e0b');olympe.sc.we.F=olympe.sc.we.P.Ra('016c42d3454636f90533');olympe.sc.we.prototype.cb.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.we.prototype.R.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.Eo=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.Eo.P=olympe.dc.Ca.C('017a7a9ff057958e5678',olympe.sc.Eo);olympe.sc.Kp=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.Zu}};olympe.sc.Kp.P=olympe.dc.Ca.C('01644b6d4543b344b857',olympe.sc.Kp);olympe.sc.Lp=class extends olympe.dc.CloudObject{};olympe.sc.Lp.P=olympe.dc.Ca.C('0162f672366be5ca7a86',olympe.sc.Lp);olympe.sc.Rq=class extends olympe.sc.we{};olympe.sc.Rq.P=olympe.dc.Ca.C('016d3f37610ae4fc3962',olympe.sc.Rq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.Ca.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ka.qc}static from(a){const b=olympe.sc.Va.jg.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Va.jg.TRANSACTION,!0)?Promise.resolve(!1):b.ib().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).ki(c);this.F.set(d.T(),olympe.dc.wa(a));for(const [e,f]of b)d.setProperty(e,
909
- f);c===olympe.dc.Ka.Wc&&(b=olympe.dc.Pa(),b=null!==aj?b.fj(aj,[olympe.sc.La.Me.C,olympe.sc.ld.F.Rc()])[0]||null:null,null!==b?this.Oa(olympe.sc.ld.L,b,d):olympe.sa.Za('sc').warn('No business container for new instance of',olympe.dc.wa(a)));return d.T()}update(a,b,c){this.C.update(a,b,c);return this}Ax(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Oa(a,b,c){this.C.Oa(a,b,c);return this}Jb(a,b,c){this.C.Jb(a,b,c);return this}Qm(a,b){this.C.Qm(a,
910
- b);return this}persist(a=!0){this.C.persist(a);return this}qj(a,b=!0){this.C.qj(a,b);return this}ki(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.wa(a))||olympe.dc.Pa().model(a)}Wr(a){ee(this.C,a.C);return this}Gm(a){this.C.Gm(a);return this}ib(){return new Promise((a,b)=>{this.C.ib((c,d)=>{c?a():b(d)})})}Tm(){return new Promise((a,b)=>{this.C.Tm((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Tm;
911
- olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.ib;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Gm;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.Wr;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.ki;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.qj;
912
- olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Qm;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.Jb;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Oa;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Ax;
913
- olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Ye.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Ye.xe=olympe.dm.xe;olympe.ia.node.qa={};const Z={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ja:'database',schema:'schema',$r:'pollingFrequency',Av:'burstTransactionInterval'},mj=olympe.dc.ga.ka.mm,nj=olympe.dc.ga.ka.om,oj=olympe.dc.ga.ka.QUERY_RESULT,pj=olympe.dc.ga.ka.nm,qj=olympe.dc.ga.ka.nf,rj=olympe.dc.ga.ka.Sh,sj=olympe.dc.ga.ka.Ah,tj=olympe.dc.ga.ka.ti,uj=olympe.dc.ga.ka.Og,vj=olympe.dc.ga.ka.bh,wj=olympe.dc.ga.ka.Fj,xj=olympe.dc.ga.ka.uu;
914
- function yj(a,b,c,d,e){const f=new olympe.H.ya.pb.Bb(a.tag,b),g=new olympe.sc.W.gt(a.N,a.Oc,a.cb);g.start(a.tag).catch(h=>a.N.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();switch(k.t){case mj:var l=c.queryBuilder().withSchema(d);k=ve(k.q);a.R(b,l,k,(t,v)=>{(v?h.wg(Error(v)):h.Ke({t:oj,r:t})).then()});break;case nj:k=ve(k.q);zj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;case xj:Aj(b,k.i,h.source());h.Hk().then();break;
915
- case vj:k=(new olympe.dc.W.Hi(a.Wb())).C(k.p);Bj(a,b,c,d,k,t=>(t?h.wg(Error(t)):h.Hk()).then());break;case uj:l=k.i;k=(new olympe.dc.W.Hi(a.Wb())).C(k.p);Cj(a,b,l,k,c,d);break;case qj:const n=b.get('_subscription_cache');k=k.s.reduce((t,v)=>{n.has(v)?Dj(n.get(v),h.source()):t.push(v);return t},[]);(0<k.length?h.wg(Error(`These subscriptions was not kept alive: ${k}`)):h.Hk()).then();break;case rj:const p=k.f;k=Qi(g,(t,v,u)=>p!==v?Promise.reject('The file sent is not the same as the one initially requested'):
916
- u instanceof Uint8Array?Ej(a,b,c,d,p,u).then(()=>new olympe.la.Sg('',olympe.la.fb.rd.vl)):Promise.reject(`Try to upload content for file ${p} but body is not a Blob.`));h.Ke(k).then();break;case sj:const q=k.f;k=Qi(g,(t,v)=>q!==v?Promise.reject('The file to download is not the same as the one initially requested'):Fj(b,c.queryBuilder().withSchema(d),q).then(u=>new olympe.la.Sg(u,olympe.la.fb.rd.Kh)));h.Ke(k).then();break;case tj:const r=k.f;k=Qi(g,(t,v)=>r!==v?Promise.reject('The file to download is not the same as the one initially requested'):
917
- Promise.resolve(new olympe.la.Sg('',olympe.la.fb.rd.Kh)));h.Ke(k).then();break;default:h.wg(Error(`Unsupported message type: ${k.t}`)).then()}})}function zj(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.Yr(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Gj(f,d,c,b.get('_polling_frequency'),a.R.bind(a,b),a.uc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));Dj(k,e.source())}).catch(h=>e.wg(Error(h)).then())}
918
- function Aj(a,b,c){(a=a.get('_subscription_cache').get(b))&&(a.C.delete(c)||olympe.sa.Za('Subscription Cache').warn(`Try to unsubscribe to the subscription ${a.id} which is not registered.`))}function Bj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ia.node.qa.Ha.Jq(a.N,b);e.Zc(a);Hj(a,c,d).then(()=>f(null)).catch(g=>f(g))}
919
- function Cj(a,b,c,d,e,f){const g=`_burst.${c}`;let h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);Bj(a,b,e,f,k,l=>{l&&olympe.H.ya.pb.Bb.publish(c,{t:wj,r:l})})},b.get('_burst_interval'))):d.Zc(h)}function Ej(a,b,c,d,e,f){const g=olympe.ia.node.qa.Ha.ad.Oj,h=new olympe.dc.db.zc;h.F(e,(new Map).set(g,f),0);h.Oa(olympe.dc.jc.Vc,e,olympe.dc.wa(olympe.dm.File));return new Promise((k,l)=>{Bj(a,b,c,d,h,n=>n?l(n):k())})}
920
- function Fj(a,b,c){return x(function*(){const d=olympe.ia.node.qa.Ha.ad.Oj;var e=olympe.ia.node.qa.Ha.ad.Mh;const f=yield Ij(a.get('_data_model_observer').Xd,olympe.dc.wa(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return e[d].buffer;throw Error(`File ${c} not found in the database`);}())}
921
- olympe.ia.node.qa.Iq=class extends olympe.sc.logic.ae{constructor(a,b,c,d){super(a,b,c);this.Oc=d;this.cb=olympe.U.getParameter(olympe.H.qb.gm)}update(a,b){var [c]=b,d=l=>olympe.U.getParameter(`${'dbconnector'}.${c}.${l}`);const e=l=>olympe.U.getParameter(`${'dbconnector'}.${l}`);a.set('_burst_interval',d(Z.Av)||5E3);a.set('_polling_frequency',d(Z.$r)||e(Z.$r)||6E5);const f=d(Z.client)||e(Z.client)||'pg',g=d(Z.hostname)||e(Z.hostname)||'',h=d(Z.Ja)||e(Z.Ja);b=d(Z.schema)||e(Z.schema)||c;const k=knex({client:f,
922
- connection:{host:g,port:d(Z.port)||e(Z.port),user:d(Z.user)||e(Z.user),password:d(Z.password)||e(Z.password),database:h}});this.N.info(`SQLConnector ${c} started with host ${g}, database ${h} on schema ${b}`);a.Hg(()=>k.destroy().then());d=new olympe.ia.node.qa.Ha.Us(k,b,this);a.set('_data_model_observer',d);a.set('_subscription_cache',new Map);yj(this,a,k,b,c)}R(a,b,c,d){a=a.get('_data_model_observer');const e=a.Xd,f=new olympe.ia.node.qa.Ha.ru(c,e);Jj(a).then(()=>Kj(f)).then(g=>0===g.length?[[],
923
- g]:Lj(new olympe.ia.node.qa.Ha.Hq(f,b,g)).then(h=>[h,g])).then(g=>{var [h,k]=g;return Mj(c.Z(),h,k,e)}).then(g=>d(g,null)).catch(g=>d({},g))}uc(a,b,c){olympe.H.ya.pb.Bb.publish(a,{t:pj,i:b,r:c}).then().catch(d=>this.N.error('Error occurred while publishing query result update: '+d))}};olympe.ia.node.qa.Iq.P=olympe.dc.Ca.C('017dc8db8074471acb7a',olympe.ia.node.qa.Iq,olympe.sc.O.Ea,olympe.la.O.ym);function Dj(a,b){a.C.has(b)?(a=a.C,a.values.has(b)&&a.values.set(b,Date.now())):a.C.add(b)}
924
- class Gj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.Zq(olympe.U.getParameter(olympe.$a.Config.Vl)+6E4);a.C=g;this.C=a;this.start(c,e,f,d)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>{if(k)olympe.sa.Za('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.ob(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);
925
- f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ia.node.qa.Ha={};olympe.ia.node.qa.Ha.Ac={EQUAL:'equal',Mq:'substring',Lo:'filter',vp:'<=',wp:'<',Yo:'>=',Zo:'>',$f:'and',Lh:'or',Wg:'not',vq:'regex'};olympe.ia.node.qa.Ha.ad={Mh:'tagOlympe',gk:'tagOlympeOrig',Al:'tagOlympeDest',Oj:'fileContent'};const Nj=olympe.ia.node.qa.Ha.ad.gk,Oj=olympe.ia.node.qa.Ha.ad.Al,Pj=olympe.ia.node.qa.Ha.ad.Mh,Qj=olympe.ia.node.qa.Ha.ad.Oj;function Jj(a){return new Promise(b=>{0<a.C?a.L.add(()=>b()):b()})}
926
- function Rj(a){Sj(a,olympe.dc.wa(olympe.dm.File));const b=new Map;a.F.vb(olympe.sc.logic.ae.F).observe(a.G).subscribe(c=>{ze(c).forEach(d=>{const e=d.T();Tj(a,()=>{var g=Uj;const h=[{name:Pj,$e:Pj,Vk:!1}];e===olympe.dc.wa(olympe.dm.File)&&h.push({name:Qj,$e:Qj,Vk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Zb('Business model context',a.G);b.set(e,f);f.run(()=>Vj(a,f,e))});Ae(c).forEach(d=>{b.get(d).destroy();Tj(a,()=>Wj(a,d),`Delete Table for ${d}`)})})}
927
- function Xj(a){a.C++;1===a.C&&a.N.debug('Data model observer is busy')}function Yj(a){a.C--;if(0===a.C){a.N.debug('Data model observer is free');for(const b of a.L)b();a.L.clear()}}function Sj(a,b){if(!a.db.Xk(a.F,olympe.sc.logic.ae.F,b)){Xj(a);const c=new olympe.dc.Transaction;c.Oa(olympe.sc.logic.ae.F,a.F,b);c.ib((d,e)=>{d||a.N.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Yj(a)},!0)}}function Zj(a){return a.client.schema.withSchema(a.schema)}
928
- function Tj(a,b,c){if(!a.G.R()&&!a.G.zb()){a.N.debug(`Push operation:${c}`);Xj(a);var d=a.R,e=()=>{d.shift();Yj(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.N.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.N.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
929
- function Uj(a,b,c,d){return x(function*(){if(yield Zj(a).hasTable(b))return a.N.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.Xd;e.C.set(c,b);e.G.set(b,c)});a.N.debug('Create table for : '+c);return Zj(a).createTable(b,e=>{d.forEach(f=>{var {name:g,$e:h,zr:k,ls:l,Vk:n}=f;ak(a,e,g,h,n,l,k)})}).then(()=>{var e=a.Xd;e.C.set(c,b);e.G.set(b,c)})}())}
930
- function Vj(a,b,c){b.onDestroy(()=>{Tj(a,()=>Promise.all(Array.from(a.Ma.get(c)).map(d=>Wj(a,d))).then(()=>{a.Ma.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.Ma.get(c)}`)});bk(a,c,b);a.Ma.set(c,new Set);olympe.dc.hb.from(c).vb(olympe.dc.CloudObject.G).Ti().vb(olympe.dm.Relation.destinationModelRel).Ti().filter((new olympe.dc.da.V.De(a.F)).vb(olympe.sc.logic.ae.F.Rc())).observe(b).subscribe(d=>{0<ze(d).length&&(a.N.debug('Handle new relations : '+ze(d)),Tj(a,()=>Promise.all(ze(d).map(e=>
931
- {var [f,g]=e;a.Ma.get(c).add(f.T());a.Ma.get(g.T()).add(f.T());e=f.T();var h=Uj,k=g.T();return h(a,e,e,[{name:Nj,$e:Nj,ls:c,zr:Pj,Vk:!0},{name:Oj,$e:Oj,ls:k,zr:Pj,Vk:!0}])})).then(),`Add relation tables for business model ${c}: ${ze(d)}`));0<Ae(d).length&&(a.N.debug('Handle relations to remove : '+Ae(d)),Tj(a,()=>Promise.all(Ae(d).map(e=>{var [f,g]=e;a.Ma.get(c).delete(f);a.Ma.get(g).delete(f);return Wj(a,f)})).then(),`Delete relation tables for business model ${c}: ${Ae(d)}`))})}
932
- function Wj(a,b){return x(function*(){try{var c=yield Ij(a.Xd,b)}catch(d){a.N.warn(`Try to delete a table not registered: ${d}`);return}if(yield Zj(a).hasTable(c)){Zj(a).dropTable(c);c=a.Xd;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
933
- function bk(a,b,c){a.N.debug('Observe properties for '+b);olympe.dc.hb.from(b).vb(olympe.dc.CloudObject.propertyRel).observe(c).subscribe(d=>{a.N.debug('New properties for '+b+' '+ze(d));Tj(a,()=>ck(a,b,ze(d).map(e=>e.T()),Ae(d)),`Update columns of ${b}: added: ${ze(d)}, removed: ${Ae(d)}`)})}
934
- function ck(a,b,c,d){return x(function*(){const e=yield Ij(a.Xd,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return Zj(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&ak(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
935
- function ak(a,b,c,d,e,f,g){e=void 0===e?!1:e;f=void 0===f?'':f;g=void 0===g?'':g;if(c===Pj)b.string(c,21).primary();else if(c===Nj||c===Oj){if(e)b.string(c).notNullable().references(g).inTable(f).onDelete('CASCADE')}else c===Qj?b.binary(c):d&&(a=a.db,d=olympe.dc.nd.from(d).vb(olympe.dm.Property.typeRel).vd(),a.Rf(d,olympe.dm.String)?b.string(c,1E3):a.Rf(d,olympe.dm.Number)?b.double(c):a.Rf(d,olympe.dm.Boolean)?b.boolean(c):a.Rf(d,olympe.dm.DateTime)?b.string(c):a.Rf(d,olympe.dm.Color)&&b.string(c,
936
- 50))}olympe.ia.node.qa.Ha.Us=class{constructor(a,b,c){this.N=olympe.sa.Za('sql');this.client=a;this.schema=b;this.F=c;this.Xd=new olympe.ia.node.qa.Ha.Yu;this.G=new olympe.D.Zb(`Data Model Observer of ${c.T()}`);this.R=[];this.C=0;this.Ma=new Map;this.L=new Set;this.db=olympe.dc.Pa();Rj(this)}};const dk=olympe.ia.node.qa.Ha.Ac.EQUAL,ek=olympe.ia.node.qa.Ha.Ac.$f,fk=olympe.ia.node.qa.Ha.Ac.Lh,gk=olympe.ia.node.qa.Ha.Ac.Wg,hk=olympe.ia.node.qa.Ha.Ac.Lo,ik=olympe.ia.node.qa.Ha.Ac.Yo,jk=olympe.ia.node.qa.Ha.Ac.Zo,kk=olympe.ia.node.qa.Ha.Ac.vp,lk=olympe.ia.node.qa.Ha.Ac.wp,mk=olympe.ia.node.qa.Ha.Ac.vq,nk=olympe.ia.node.qa.Ha.Ac.Mq,ok=olympe.ia.node.qa.Ha.ad.Mh;
937
- function Kj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Pa().jj(b);!f&&e[0]instanceof olympe.dc.da.Lb.hg&&(f=e[0].Td().sb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Ij(a.Qe,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.Qe.Wb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',ek,g.map(l=>{var [n,p]=l;return[n,dk,pk(p)]})]):d.push([g[0][0],dk,pk(g[0][1])]);g=yield Ij(a.Qe,h)}h=qk(a,
938
- g);b=Array.from(a.query.F);b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=rk(a.Qe,l,c,ok);k=olympe.dc.hb.from(c).vb(olympe.dc.CloudObject.propertyRel).vd().map(q=>q.T());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>rk(a.Qe,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,ok])}a.C.limit=a.query.max;a.C.offset=a.query.offset;a.Pe.push({Ig:b,recursive:!1,filters:d,jh:'',ai:'',Xh:k,fh:h,name:g});d=0;for(const l of e)d=yield sk(a,l,d,f);return a.Pe}())}
939
- function qk(a,b){return`alias-${b.charAt(0)}${a.G++}`}function sk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.da.Lb.hg:case b instanceof olympe.dc.da.Lb.ig:e+=1;a=tk(a,b,e,d);break;case b instanceof olympe.dc.da.Lb.tc:a=uk(a,b);break;case b instanceof olympe.dc.da.Lb.Qh:a=vk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
940
- function tk(a,b,c,d){const e=b.Td().T(),f=b.Td().Qa()===olympe.dc.Aa.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.da.Lb.ig;const h=olympe.dm.Relation.F.Wl,k=olympe.dc.nd.from(e).vb(f).vd();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Ij(a.Qe,k.T()).then(q=>x(function*(){const r=qk(a,q),t=[];let v=Promise.resolve();h===olympe.dm.Relation.F.Wl&&(v=Ij(a.Qe,e).then(u=>{const w=qk(a,u),[y,A]=wk(b.Td().Qa());a.Pe.push({Ig:!1,
941
- fh:w,name:u,Xh:[],jh:y,ai:A,filters:[],recursive:g});g=!1}));return v.then(()=>x(function*(){let u=[];var w=Promise.resolve([]);let y=[];if(l){const A=a.query.Z(),D=rk(a.Qe,A,k.T(),ok);w=olympe.dc.hb.from(k.T()).vb(olympe.dc.CloudObject.propertyRel).Ti().vd().map(I=>I.T());u=w.map(I=>rk(a.Qe,A,k.T(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([rk(a.Qe,A,k.T(),ok),ok]);const T=yield w;y=u.map((I,aa)=>[I,T[aa]]);y.unshift([D,ok])}a.Pe.push({Ig:l,fh:r,name:q,Xh:y,jh:n,ai:p,filters:t,recursive:g})}()))}()))}
942
- function uk(a,b){return a.F(b.G()).then(c=>{a.Pe[a.Pe.length-1].filters.push(c)})}function vk(a,b){a.C.order=b.order;a.C.aliasSorting=a.Pe[a.Pe.length].fh;return Promise.resolve(b.gb().T()).then(c=>{a.C.columnSorting=c})}function wk(a){const b=olympe.ia.node.qa.Ha.ad.gk,c=olympe.ia.node.qa.Ha.ad.Al;return a===olympe.dc.Aa.ORIGIN?[c,b]:[b,c]}
943
- olympe.ia.node.qa.Ha.ru=class{constructor(a,b){this.query=a;this.G=0;this.Qe=b;this.Pe=[];this.C={}}F(a){switch(!0){case a instanceof olympe.dc.da.V.Ic:const c=a.C;return Promise.resolve(a.gb()).then(h=>[h,dk,pk(c)]);case a instanceof olympe.dc.da.V.Uc:const d=a.substring;return Promise.resolve(a.gb()).then(h=>[h,nk,d]);case a instanceof olympe.dc.da.V.Ad:var b=a.Y.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
944
- Promise.resolve(a.gb()).then(h=>[h,mk,a.Y]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.da.V.md:return this.F(a.G()).then(h=>['',gk,h]);case a instanceof olympe.dc.da.V.De:const e=a.L(),f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.gd().map((h,k)=>Promise.resolve(h.T()).then(l=>{const [n,p]=wk(h.Qa());let q=[];e&&k===a.gd().length-1&&(q=[[p,dk,pk(e)]]);return{name:l,
945
- recursive:f[k],Xh:[],jh:n,ai:p,filters:q,fh:qk(this,l),Ig:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.Pe[this.Pe.length-1];k={name:k.name,recursive:!1,Xh:[[ok,ok]],jh:'',ai:'',filters:[],fh:qk(this,k.name),Ig:!0};h.unshift(k);return g.then(l=>['',hk,{target:l,Ma:h}])});case a instanceof olympe.dc.da.V.Fh:return Promise.resolve(a.gb()).then(h=>('number'===typeof a.F?Promise.resolve(a.F):Promise.resolve(a.F.T())).then(k=>{var l=
946
- a.oa;return Promise.resolve([h,a.ha?l?lk:kk:l?jk:ik,k])}));case a instanceof olympe.dc.da.V.Yd:return b=a.R().flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',ek,h]);case a instanceof olympe.dc.da.V.ee:return b=a.R().flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',fk,h]);default:return Promise.reject('Failed to parse predicate')}}};olympe.ia.node.qa.Ha.rA;function Mj(a,b,c,d){const e=[],f=new olympe.dc.transaction.Md;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return xk(c,d).then(p=>{for(const r of b){const [t,v,u]=yk(a,r,p,d,c,n);for(const w of u){const [y,A,D]=w;f.Oa(y,A,D)}var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const w of t.entries()){const [y,A]=w;q=v.get(y);d.L.set(y,q);f.F(y,new Map(A),0);f.Oa(olympe.dc.CloudObject.modelRel.T(),y,q,0)}}d.F.delete(a);
947
- return{k:e,p:ce(f)}})}function xk(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Ig||1===g)&&a[g+1].Ig&&(d.push(b.ei(a[g-1].name)),e.push(b.ei(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].jh===olympe.ia.node.qa.Ha.ad.gk?olympe.dc.Aa.DESTINATION:olympe.dc.Aa.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(g=>{var [h,k,l]=g;return h.map((n,p)=>[n,k[p],l[p],f[p]])})}
948
- function yk(a,b,c,d,e,f){const g=olympe.ia.node.qa.Ha.ad.Mh;let h=0,k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const t of Object.entries(b)){const [v,u]=t;b=v.split(';');if(b[1]===g){h=parseInt(b[0],10);b=zk(d,a,h);if(n<c.length){const w=c[n][3],y=c[n][0];if(k===c[n][1]&&b===c[n][2])r.push(w===olympe.dc.Aa.DESTINATION?[y,l,u]:[y,u,l]),n++;else{let A;!k&&b===(null==(A=e[2])?void 0:A.name)&&f&&(r.push(w===olympe.dc.Aa.DESTINATION?[y,f,u]:[y,u,f]),n++)}}p.set(u,[]);q.set(u,b);d.L.set(u,b);k=b;
949
- l=u}else h===parseInt(b[0],10)&&(b=b[1],p.get(l).push([b,u]))}return[p,q,r]}olympe.ia.node.qa.Ha.vA=class{};function Lj(a){const b=a.C,{offset:c,limit:d,tC:e,order:f,oC:g}=a.R.C;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Ig:k,fh:l,name:n,filters:p,recursive:q,Xh:r,jh:t,ai:v}]of a.Y.entries())Ak(a,b,k,l,n,p,q,0===h,t,v,r);return b}
950
- function Ak(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&Bk(a,b,d,f,olympe.ia.node.qa.Ha.sd.NONE);h?(b.from(b.client.raw('?? as ??',[e,d])),a.G=d,a.F=l):(g&&(f=`cte${a.L++}`,Ck(a,b,f,d,e)),e=b.client.raw('?? as ??',[e,d]),b.join(e,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:
907
+ olympe.sc.eb.prototype.waitFor=olympe.sc.eb.prototype.Fn;olympe.sc.eb.prototype.runner=olympe.sc.eb.prototype.el;olympe.sc.eb.prototype.repeat=olympe.sc.eb.prototype.repeat;olympe.sc.eb.prototype.observe=olympe.sc.eb.prototype.observe;olympe.sc.eb.prototype.has=olympe.sc.eb.prototype.has;olympe.sc.eb.prototype.get=olympe.sc.eb.prototype.get;olympe.sc.eb.prototype.remove=olympe.sc.eb.prototype.remove;olympe.sc.eb.prototype.trigger=olympe.sc.eb.prototype.li;olympe.sc.eb.prototype.set=olympe.sc.eb.prototype.set;
908
+ olympe.sc.eb.prototype.getParent=olympe.sc.eb.prototype.getParent;olympe.sc.Kj=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.Kj.P=olympe.dc.Ca.C('01645fe6873aeea59e64',olympe.sc.Kj);olympe.sc.Kj.C=olympe.sc.Kj.P.Ra('017ed8ac775f48d4d589');olympe.sc.we=class extends olympe.sc.Runnable{$a(){return this.tb(olympe.sc.we.L,olympe.sc.Runnable)}R(){return this.tb(olympe.sc.we.F,olympe.dm.Property)}};olympe.sc.we.P=Jc(olympe.dc.Ca.C('016c2d996d9ca27fa9d8',olympe.sc.we));olympe.sc.we.L=olympe.sc.we.P.Ra('016c3cb7742ec9309e0b');olympe.sc.we.F=olympe.sc.we.P.Ra('016c42d3454636f90533');olympe.sc.we.prototype.$a.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.we.prototype.R.K=new olympe.D.J(()=>olympe.dc.Ba,[]);olympe.sc.Go=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.xl}};olympe.sc.Go.P=olympe.dc.Ca.C('017a7a9ff057958e5678',olympe.sc.Go);olympe.sc.Np=class extends olympe.dm.Rb{C(){return olympe.sc.Ye.dh.dv}};olympe.sc.Np.P=olympe.dc.Ca.C('01644b6d4543b344b857',olympe.sc.Np);olympe.sc.Op=class extends olympe.dc.CloudObject{};olympe.sc.Op.P=olympe.dc.Ca.C('0162f672366be5ca7a86',olympe.sc.Op);olympe.sc.Uq=class extends olympe.sc.we{};olympe.sc.Uq.P=olympe.dc.Ca.C('016d3f37610ae4fc3962',olympe.sc.Uq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.Ca.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ka.rc}static from(a){const b=olympe.sc.Va.jg.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Va.jg.TRANSACTION,!0)?Promise.resolve(!1):b.ib().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).ki(c);this.F.set(d.T(),olympe.dc.wa(a));for(const [e,f]of b)d.setProperty(e,
909
+ f);c===olympe.dc.Ka.Xc&&(b=olympe.dc.Pa(),b=null!==$i?b.fj($i,[olympe.sc.La.Me.C,olympe.sc.ld.F.Sc()])[0]||null:null,null!==b?this.Oa(olympe.sc.ld.L,b,d):olympe.sa.Ya('sc').warn('No business container for new instance of',olympe.dc.wa(a)));return d.T()}update(a,b,c){this.C.update(a,b,c);return this}Ex(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Oa(a,b,c){this.C.Oa(a,b,c);return this}Jb(a,b,c){this.C.Jb(a,b,c);return this}Rm(a,b){this.C.Rm(a,
910
+ b);return this}persist(a=!0){this.C.persist(a);return this}qj(a,b=!0){this.C.qj(a,b);return this}ki(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.wa(a))||olympe.dc.Pa().model(a)}un(a){de(this.C,a.C);return this}Hm(a){this.C.Hm(a);return this}ib(){return new Promise((a,b)=>{this.C.ib((c,d)=>{c?a():b(d)})})}Um(){return new Promise((a,b)=>{this.C.Um((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Um;
911
+ olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.ib;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Hm;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.un;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.ki;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.qj;
912
+ olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Rm;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.Jb;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Oa;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Ex;
913
+ olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Ye.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Ye.xe=olympe.dm.xe;olympe.ha.node.pa={};const Z={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ja:'database',schema:'schema',cs:'pollingFrequency',Ev:'burstTransactionInterval'},lj=olympe.dc.ga.ja.mm,mj=olympe.dc.ga.ja.om,nj=olympe.dc.ga.ja.QUERY_RESULT,oj=olympe.dc.ga.ja.nm,pj=olympe.dc.ga.ja.nf,qj=olympe.dc.ga.ja.Sh,rj=olympe.dc.ga.ja.Ah,sj=olympe.dc.ga.ja.ti,tj=olympe.dc.ga.ja.Og,uj=olympe.dc.ga.ja.bh,vj=olympe.dc.ga.ja.Fj,wj=olympe.dc.ga.ja.yu;
914
+ function xj(a,b,c,d,e){const f=new olympe.H.ya.pb.Bb(a.tag,b),g=new olympe.sc.W.kt(a.N,a.Lc,a.$a);g.start(a.tag).catch(h=>a.N.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.N.debug(`Serving a new message : ${k.t}`);switch(k.t){case lj:var l=c.queryBuilder().withSchema(d);k=ue(k.q);a.R(b,l,k,(t,u)=>{(u?h.wg(Error(u)):h.Ke({t:nj,r:t})).then()});break;case mj:k=ue(k.q);yj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
915
+ case wj:zj(b,k.i,h.source());h.Hk().then();break;case uj:k=(new olympe.dc.W.Hi(a.Wb())).C(k.p);Aj(a,b,c,d,k,t=>(t?h.wg(Error(t)):h.Hk()).then());break;case tj:l=k.i;k=(new olympe.dc.W.Hi(a.Wb())).C(k.p);Bj(a,b,l,k,c,d);break;case pj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?Cj(n.get(u),h.source()):t.push(u);return t},[]);(0<k.length?h.wg(Error(`These subscriptions was not kept alive: ${k}`)):h.Hk()).then();break;case qj:const p=k.f;a.N.debug(`Uploading a file: ${p}`);k=Pi(g,
916
+ (t,u,v)=>{a.N.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?Dj(a,b,c,d,p,v).then(()=>new olympe.la.Sg('',olympe.la.fb.qd.vl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.Ke(k).then();break;case rj:const q=k.f;a.N.debug(`Serving a file: ${q}`);k=Pi(g,(t,u)=>{a.N.debug(`File service received a download request for file : ${u}`);
917
+ return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):Ej(b,c.queryBuilder().withSchema(d),q).then(v=>{a.N.debug('File service download request, content is:',v);return new olympe.la.Sg(v,olympe.la.fb.qd.Kh)})});h.Ke(k).then();break;case sj:const r=k.f;a.N.debug(`Deleting a file: ${r}`);k=Pi(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.la.Sg('',olympe.la.fb.qd.Kh)));h.Ke(k).then();
918
+ break;default:h.wg(Error(`Unsupported message type: ${k.t}`)).then()}})}function yj(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.$r(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Fj(f,d,c,b.get('_polling_frequency'),a.R.bind(a,b),a.lc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));Cj(k,e.source())}).catch(h=>e.wg(Error(h)).then())}
919
+ function zj(a,b,c){(a=a.get('_subscription_cache').get(b))&&(a.C.delete(c)||olympe.sa.Ya('Subscription Cache').warn(`Try to unsubscribe to the subscription ${a.id} which is not registered.`))}function Aj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ha.node.pa.Ha.Mq(a.N,b);e.$c(a);Gj(a,c,d).then(()=>f(null)).catch(g=>f(g))}
920
+ function Bj(a,b,c,d,e,f){const g=`_burst.${c}`;let h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);Aj(a,b,e,f,k,l=>{l&&olympe.H.ya.pb.Bb.publish(c,{t:vj,r:l})})},b.get('_burst_interval'))):d.$c(h)}function Dj(a,b,c,d,e,f){const g=olympe.ha.node.pa.Ha.ad.Oj,h=new olympe.dc.db.zc;h.F(e,(new Map).set(g,f),0);h.Oa(olympe.dc.jc.Wc,e,olympe.dc.wa(olympe.dm.File));return new Promise((k,l)=>{Aj(a,b,c,d,h,n=>n?l(n):k())})}
921
+ function Ej(a,b,c){return x(function*(){var d=olympe.ha.node.pa.Ha.ad.Oj,e=olympe.ha.node.pa.Ha.ad.Mh;const f=yield Hj(a.get('_data_model_observer').Wd,olympe.dc.wa(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return d=e[d],d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength);throw Error(`File ${c} not found in the database`);}())}
922
+ olympe.ha.node.pa.Lq=class extends olympe.sc.logic.$d{constructor(a,b,c,d){super(a,b,c);this.Lc=d;this.$a=olympe.U.getParameter(olympe.H.qb.gm)}update(a,b){var [c]=b,d=l=>olympe.U.getParameter(`${'dbconnector'}.${c}.${l}`);const e=l=>olympe.U.getParameter(`${'dbconnector'}.${l}`);a.set('_burst_interval',d(Z.Ev)||5E3);a.set('_polling_frequency',d(Z.cs)||e(Z.cs)||6E5);const f=d(Z.client)||e(Z.client)||'pg',g=d(Z.hostname)||e(Z.hostname)||'',h=d(Z.Ja)||e(Z.Ja);b=d(Z.schema)||e(Z.schema)||c;const k=knex({client:f,
923
+ connection:{host:g,port:d(Z.port)||e(Z.port),user:d(Z.user)||e(Z.user),password:d(Z.password)||e(Z.password),database:h}});this.N.info(`SQLConnector ${c} started with host ${g}, database ${h} on schema ${b}`);this.Pc=olympe.sa.Ya('sql');a.Hg(()=>k.destroy().then());d=new olympe.ha.node.pa.Ha.Ys(k,b,this);a.set('_data_model_observer',d);a.set('_subscription_cache',new Map);xj(this,a,k,b,c)}R(a,b,c,d){a=a.get('_data_model_observer');const e=a.Wd,f=new olympe.ha.node.pa.Ha.vu(c,e);Ij(a).then(()=>Jj(f)).then(g=>
924
+ {if(0===g.length)return[[],g];const h=Kj(new olympe.ha.node.pa.Ha.Kq(f,b,g));this.Pc.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(g=>{var [h,k]=g;return Lj(c.Z(),h,k,e)}).then(g=>d(g,null)).catch(g=>d({},g))}lc(a,b,c){olympe.H.ya.pb.Bb.publish(a,{t:oj,i:b,r:c}).then().catch(d=>this.N.error('Error occurred while publishing query result update: '+d))}};
925
+ olympe.ha.node.pa.Lq.P=olympe.dc.Ca.C('017dc8db8074471acb7a',olympe.ha.node.pa.Lq,olympe.sc.O.Ea,olympe.la.O.zm);function Cj(a,b){a.C.has(b)?(a=a.C,a.values.has(b)&&a.values.set(b,Date.now())):a.C.add(b)}
926
+ class Fj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.br(olympe.U.getParameter(olympe.ab.Config.Vl)+6E4);a.C=g;this.C=a;this.start(c,e,f,d)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>{if(k)olympe.sa.Ya('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.ob(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);
927
+ f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ha.node.pa.Ha={};olympe.ha.node.pa.Ha.Ac={EQUAL:'equal',Pq:'substring',No:'filter',yp:'<=',zp:'<',$o:'>=',ap:'>',$f:'and',Lh:'or',Wg:'not',yq:'regex'};olympe.ha.node.pa.Ha.ad={Mh:'tagOlympe',gk:'tagOlympeOrig',Al:'tagOlympeDest',Oj:'fileContent'};const Mj=olympe.ha.node.pa.Ha.ad.gk,Nj=olympe.ha.node.pa.Ha.ad.Al,Oj=olympe.ha.node.pa.Ha.ad.Mh,Pj=olympe.ha.node.pa.Ha.ad.Oj;function Ij(a){return new Promise(b=>{0<a.C?a.L.add(()=>b()):b()})}
928
+ function Qj(a){Rj(a,olympe.dc.wa(olympe.dm.File));const b=new Map;a.F.vb(olympe.sc.logic.$d.F).observe(a.G).subscribe(c=>{ye(c).forEach(d=>{const e=d.T();Sj(a,()=>{var g=Tj;const h=[{name:Oj,$e:Oj,Vk:!1}];e===olympe.dc.wa(olympe.dm.File)&&h.push({name:Pj,$e:Pj,Vk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Zb('Business model context',a.G);b.set(e,f);f.run(()=>Uj(a,f,e))});ze(c).forEach(d=>{b.get(d).destroy();Sj(a,()=>Vj(a,d),`Delete Table for ${d}`)})})}
929
+ function Wj(a){a.C++;1===a.C&&a.N.debug('Data model observer is busy')}function Xj(a){a.C--;if(0===a.C){a.N.debug('Data model observer is free');for(const b of a.L)b();a.L.clear()}}function Rj(a,b){if(!a.db.Xk(a.F,olympe.sc.logic.$d.F,b)){Wj(a);const c=new olympe.dc.Transaction;c.Oa(olympe.sc.logic.$d.F,a.F,b);c.ib((d,e)=>{d||a.N.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Xj(a)},!0)}}function Yj(a){return a.client.schema.withSchema(a.schema)}
930
+ function Sj(a,b,c){if(!a.G.R()&&!a.G.zb()){a.N.debug(`Push operation:${c}`);Wj(a);var d=a.R,e=()=>{d.shift();Xj(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.N.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.N.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
931
+ function Tj(a,b,c,d){return x(function*(){if(yield Yj(a).hasTable(b))return a.N.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.Wd;e.C.set(c,b);e.G.set(b,c)});a.N.debug('Create table for : '+c);return Yj(a).createTable(b,e=>{d.forEach(f=>{var {name:g,$e:h,Cr:k,qs:l,Vk:n}=f;Zj(a,e,g,h,n,l,k)})}).then(()=>{var e=a.Wd;e.C.set(c,b);e.G.set(b,c)})}())}
932
+ function Uj(a,b,c){b.onDestroy(()=>{Sj(a,()=>Promise.all(Array.from(a.Ma.get(c)).map(d=>Vj(a,d))).then(()=>{a.Ma.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.Ma.get(c)}`)});ak(a,c,b);a.Ma.set(c,new Set);olympe.dc.hb.from(c).vb(olympe.dc.CloudObject.G).Ti().vb(olympe.dm.Relation.destinationModelRel).Ti().filter((new olympe.dc.ba.V.De(a.F)).vb(olympe.sc.logic.$d.F.Sc())).observe(b).subscribe(d=>{0<ye(d).length&&(a.N.debug('Handle new relations : '+ye(d)),Sj(a,()=>Promise.all(ye(d).map(e=>
933
+ {var [f,g]=e;a.Ma.get(c).add(f.T());a.Ma.get(g.T()).add(f.T());e=f.T();var h=Tj,k=g.T();return h(a,e,e,[{name:Mj,$e:Mj,qs:c,Cr:Oj,Vk:!0},{name:Nj,$e:Nj,qs:k,Cr:Oj,Vk:!0}])})).then(),`Add relation tables for business model ${c}: ${ye(d)}`));0<ze(d).length&&(a.N.debug('Handle relations to remove : '+ze(d)),Sj(a,()=>Promise.all(ze(d).map(e=>{var [f,g]=e;a.Ma.get(c).delete(f);a.Ma.get(g).delete(f);return Vj(a,f)})).then(),`Delete relation tables for business model ${c}: ${ze(d)}`))})}
934
+ function Vj(a,b){return x(function*(){try{var c=yield Hj(a.Wd,b)}catch(d){a.N.warn(`Try to delete a table not registered: ${d}`);return}if(yield Yj(a).hasTable(c)){Yj(a).dropTable(c);c=a.Wd;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
935
+ function ak(a,b,c){a.N.debug('Observe properties for '+b);olympe.dc.hb.from(b).vb(olympe.dc.CloudObject.propertyRel).observe(c).subscribe(d=>{a.N.debug('New properties for '+b+' '+ye(d));Sj(a,()=>bk(a,b,ye(d).map(e=>e.T()),ze(d)),`Update columns of ${b}: added: ${ye(d)}, removed: ${ze(d)}`)})}
936
+ function bk(a,b,c,d){return x(function*(){const e=yield Hj(a.Wd,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return Yj(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&Zj(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
937
+ function Zj(a,b,c,d,e,f,g){e=void 0===e?!1:e;f=void 0===f?'':f;g=void 0===g?'':g;if(c===Oj)b.string(c,21).primary();else if(c===Mj||c===Nj){if(e)b.string(c).notNullable().references(g).inTable(f).onDelete('CASCADE')}else c===Pj?b.binary(c):d&&(a=a.db,d=olympe.dc.nd.from(d).vb(olympe.dm.Property.typeRel).ud(),a.Rf(d,olympe.dm.String)?b.string(c,1E3):a.Rf(d,olympe.dm.Number)?b.double(c):a.Rf(d,olympe.dm.Boolean)?b.boolean(c):a.Rf(d,olympe.dm.DateTime)?b.string(c):a.Rf(d,olympe.dm.Color)&&b.string(c,
938
+ 50))}olympe.ha.node.pa.Ha.Ys=class{constructor(a,b,c){this.N=olympe.sa.Ya('sql');this.client=a;this.schema=b;this.F=c;this.Wd=new olympe.ha.node.pa.Ha.bv;this.G=new olympe.D.Zb(`Data Model Observer of ${c.T()}`);this.R=[];this.C=0;this.Ma=new Map;this.L=new Set;this.db=olympe.dc.Pa();Qj(this)}};const ck=olympe.ha.node.pa.Ha.Ac.EQUAL,dk=olympe.ha.node.pa.Ha.Ac.$f,ek=olympe.ha.node.pa.Ha.Ac.Lh,fk=olympe.ha.node.pa.Ha.Ac.Wg,gk=olympe.ha.node.pa.Ha.Ac.No,hk=olympe.ha.node.pa.Ha.Ac.$o,ik=olympe.ha.node.pa.Ha.Ac.ap,jk=olympe.ha.node.pa.Ha.Ac.yp,kk=olympe.ha.node.pa.Ha.Ac.zp,lk=olympe.ha.node.pa.Ha.Ac.yq,mk=olympe.ha.node.pa.Ha.Ac.Pq,nk=olympe.ha.node.pa.Ha.ad.Mh;
939
+ function Jj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Pa().jj(b);!f&&e[0]instanceof olympe.dc.ba.Lb.hg&&(f=e[0].Sd().sb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Hj(a.Qe,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.Qe.Wb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',dk,g.map(l=>{var [n,p]=l;return[n,ck,ok(p)]})]):d.push([g[0][0],ck,ok(g[0][1])]);g=yield Hj(a.Qe,h)}h=pk(a,
940
+ g);b=Array.from(a.query.F);b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=qk(a.Qe,l,c,nk);k=olympe.dc.hb.from(c).vb(olympe.dc.CloudObject.propertyRel).ud().map(q=>q.T());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>qk(a.Qe,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,nk])}a.C.limit=a.query.max;a.C.offset=a.query.offset;a.Pe.push({Ig:b,recursive:!1,filters:d,jh:'',ai:'',Xh:k,fh:h,name:g});d=0;for(const l of e)d=yield rk(a,l,d,f);return a.Pe}())}
941
+ function pk(a,b){return`alias-${b.charAt(0)}${a.G++}`}function rk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.ba.Lb.hg:case b instanceof olympe.dc.ba.Lb.ig:e+=1;a=sk(a,b,e,d);break;case b instanceof olympe.dc.ba.Lb.uc:a=tk(a,b);break;case b instanceof olympe.dc.ba.Lb.Qh:a=uk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
942
+ function sk(a,b,c,d){const e=b.Sd().T(),f=b.Sd().Qa()===olympe.dc.Aa.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.ba.Lb.ig;const h=olympe.dm.Relation.F.Wl,k=olympe.dc.nd.from(e).vb(f).ud();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Hj(a.Qe,k.T()).then(q=>x(function*(){const r=pk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.Wl&&(u=Hj(a.Qe,e).then(v=>{const w=pk(a,v),[y,A]=vk(b.Sd().Qa());a.Pe.push({Ig:!1,
943
+ fh:w,name:v,Xh:[],jh:y,ai:A,filters:[],recursive:g});g=!1}));return u.then(()=>x(function*(){let v=[];var w=Promise.resolve([]);let y=[];if(l){const A=a.query.Z(),D=qk(a.Qe,A,k.T(),nk);w=olympe.dc.hb.from(k.T()).vb(olympe.dc.CloudObject.propertyRel).Ti().ud().map(I=>I.T());v=w.map(I=>qk(a.Qe,A,k.T(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([qk(a.Qe,A,k.T(),nk),nk]);const T=yield w;y=v.map((I,aa)=>[I,T[aa]]);y.unshift([D,nk])}a.Pe.push({Ig:l,fh:r,name:q,Xh:y,jh:n,ai:p,filters:t,recursive:g})}()))}()))}
944
+ function tk(a,b){return a.F(b.C).then(c=>{a.Pe[a.Pe.length-1].filters.push(c)})}function uk(a,b){a.C.order=b.order;a.C.aliasSorting=a.Pe[a.Pe.length].fh;return Promise.resolve(b.gb().T()).then(c=>{a.C.columnSorting=c})}function vk(a){const b=olympe.ha.node.pa.Ha.ad.gk,c=olympe.ha.node.pa.Ha.ad.Al;return a===olympe.dc.Aa.ORIGIN?[c,b]:[b,c]}
945
+ olympe.ha.node.pa.Ha.vu=class{constructor(a,b){this.query=a;this.G=0;this.Qe=b;this.Pe=[];this.C={}}F(a){switch(!0){case a instanceof olympe.dc.ba.V.Ic:const c=a.C;return Promise.resolve(a.gb()).then(h=>[h,ck,ok(c)]);case a instanceof olympe.dc.ba.V.Vc:const d=a.substring;return Promise.resolve(a.gb()).then(h=>[h,mk,d]);case a instanceof olympe.dc.ba.V.zd:var b=a.C.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
946
+ Promise.resolve(a.gb()).then(h=>[h,lk,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.ba.V.md:return this.F(a.C).then(h=>['',fk,h]);case a instanceof olympe.dc.ba.V.De:const e=a.destination,f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.gd().map((h,k)=>Promise.resolve(h.T()).then(l=>{const [n,p]=vk(h.Qa());let q=[];e&&k===a.gd().length-1&&(q=[[p,ck,ok(e)]]);return{name:l,
947
+ recursive:f[k],Xh:[],jh:n,ai:p,filters:q,fh:pk(this,l),Ig:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.Pe[this.Pe.length-1];k={name:k.name,recursive:!1,Xh:[[nk,nk]],jh:'',ai:'',filters:[],fh:pk(this,k.name),Ig:!0};h.unshift(k);return g.then(l=>['',gk,{target:l,Ma:h}])});case a instanceof olympe.dc.ba.V.Fh:return Promise.resolve(a.gb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.T())).then(k=>{var l=
948
+ a.G;return Promise.resolve([h,a.F?l?kk:jk:l?ik:hk,k])}));case a instanceof olympe.dc.ba.V.Xd:return b=Array.from(a.V).flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',dk,h]);case a instanceof olympe.dc.ba.V.de:return b=Array.from(a.V).flatMap(this.F.bind(this)),Promise.all(b).then(h=>['',ek,h]);default:return Promise.reject('Failed to parse predicate')}}};function Lj(a,b,c,d){const e=[],f=new olympe.dc.transaction.Md;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return wk(c,d).then(p=>{for(const r of b){const [t,u,v]=xk(a,r,p,d,c,n);for(const w of v){const [y,A,D]=w;f.Oa(y,A,D)}var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const w of t.entries()){const [y,A]=w;q=u.get(y);d.L.set(y,q);f.F(y,new Map(A),0);f.Oa(olympe.dc.CloudObject.modelRel.T(),y,q,0)}}d.F.delete(a);
949
+ return{k:e,p:be(f)}})}function wk(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Ig||1===g)&&a[g+1].Ig&&(d.push(b.ei(a[g-1].name)),e.push(b.ei(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].jh===olympe.ha.node.pa.Ha.ad.gk?olympe.dc.Aa.DESTINATION:olympe.dc.Aa.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(g=>{var [h,k,l]=g;return h.map((n,p)=>[n,k[p],l[p],f[p]])})}
950
+ function xk(a,b,c,d,e,f){const g=olympe.ha.node.pa.Ha.ad.Mh;let h=0;let k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const u of Object.entries(b)){const [v,w]=u;b=w;var t=v.split(';');if(t[1]===g){h=parseInt(t[0],10);t=yk(d,a,h);if(n<c.length){const y=c[n][3],A=c[n][0];if(k===c[n][1]&&t===c[n][2])r.push(y===olympe.dc.Aa.DESTINATION?[A,l,b]:[A,b,l]),n++;else{let D;!k&&t===(null==(D=e[2])?void 0:D.name)&&f&&(r.push(y===olympe.dc.Aa.DESTINATION?[A,f,b]:[A,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.L.set(b,
951
+ t);k=t;l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ha.node.pa.Ha.zA=class{};function Kj(a){const b=a.C,{offset:c,limit:d,xC:e,order:f,sC:g}=a.R.C;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Ig:k,fh:l,name:n,filters:p,recursive:q,Xh:r,jh:t,ai:u}]of a.Y.entries())zk(a,b,k,l,n,p,q,0===h,t,u,r);return b}
952
+ function zk(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&Ak(a,b,d,f,olympe.ha.node.pa.Ha.rd.NONE);h?(b.from(b.client.raw('?? as ??',[e,d])),a.G=d,a.F=l):(g&&(f=`cte${a.L++}`,Bk(a,b,f,d,e)),e=b.client.raw('?? as ??',[e,d]),b.join(e,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:
951
953
  `${d}.${k}`);a.G=d;a.F=l}))}
952
- function Bk(a,b,c,d,e){const f=olympe.ia.node.qa.Ha.Ac.EQUAL,g=olympe.ia.node.qa.Ha.Ac.$f,h=olympe.ia.node.qa.Ha.Ac.Lh,k=olympe.ia.node.qa.Ha.Ac.Wg,l=olympe.ia.node.qa.Ha.Ac.Lo,n=olympe.ia.node.qa.Ha.Ac.Yo,p=olympe.ia.node.qa.Ha.Ac.Zo,q=olympe.ia.node.qa.Ha.Ac.vp,r=olympe.ia.node.qa.Ha.Ac.wp,t=olympe.ia.node.qa.Ha.Ac.vq,v=olympe.ia.node.qa.Ha.Ac.Mq;if(1<d.length)Dk(b,olympe.ia.node.qa.Ha.sd.$f,Ek(a,d,olympe.ia.node.qa.Ha.sd.$f,c));else{var [u,w,y]=d[0];d=`${c}.${u}`;switch(w){case f:Fk(b,e,d,'=',
953
- y.v,!1);break;case v:a=Gk('.*',b.client.dialect);Fk(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const A=y.relations,D=`cte${a.L++}`,T=new olympe.ia.node.qa.Ha.Hq(a.R,a.C,A),I=olympe.ia.node.qa.Ha.ad.Mh;a.C.with(D,aa=>{for(const [Tk,{Ig:Uk,fh:Vk,name:Wk,filters:Xk,recursive:Yk,Xh:Zk,jh:$k,ai:al}]of A.entries())Ak(T,aa,Uk,Vk,Wk,Xk,Yk,0===Tk,$k,al,Zk);return aa});a.C.whereIn(b.client.raw('??.??',[c,I]),function(aa){aa.select(b.client.raw('??.??',[D,I])).from(D)});break;case q:Fk(b,e,d,'<=',y,'string'===
954
- typeof y);break;case r:Fk(b,e,d,'<',y,'string'===typeof y);break;case n:Fk(b,e,d,'>=',y,'string'===typeof y);break;case p:Fk(b,e,d,'>',y,'string'===typeof y);break;case g:Dk(b,e,Ek(a,y,olympe.ia.node.qa.Ha.sd.$f,c));break;case h:Dk(b,e,Ek(a,y,olympe.ia.node.qa.Ha.sd.Lh,c));break;case k:Dk(b,olympe.ia.node.qa.Ha.sd.Wg,Ek(a,[y],olympe.ia.node.qa.Ha.sd.Wg,c));break;case t:e=Hk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
955
- function Ck(a,b,c,d,e){var f=['tagOlympe'];const g=Ik(f,d),h=Ik(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).eD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Ik(a,b){return a.map(c=>`${b}.${c}`)}
956
- function Dk(a,b,c){switch(b){case olympe.ia.node.qa.Ha.sd.NONE:a.where(c);break;case olympe.ia.node.qa.Ha.sd.$f:a.andWhere(c);break;case olympe.ia.node.qa.Ha.sd.Lh:a.orWhere(c);break;case olympe.ia.node.qa.Ha.sd.Wg:a.whereNot(c);break;default:olympe.sa.Za('storage').error(`Where operand ${b} not recognized`)}}function Ek(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)Bk(a,e,d,[b[f]],0===f?olympe.ia.node.qa.Ha.sd.NONE:c)}}
957
- function Fk(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ia.node.qa.Ha.sd.NONE:a.where(c,d,e);break;case olympe.ia.node.qa.Ha.sd.$f:a.andWhere(c,d,e);break;case olympe.ia.node.qa.Ha.sd.Lh:a.orWhere(c,d,e);break;case olympe.ia.node.qa.Ha.sd.Wg:a.whereNot(c,d,e);break;default:olympe.sa.Za('storage').error(`Where operand ${b} not recognized`)}}function Gk(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
958
- function Hk(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
959
- a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const u=g.exec(l);if(u)l=[`\\${u[0]}`,u[0].length];else if(p=p.exec(l))l=[Gk(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,v]=l;d+=t;a=a.substring(v,
960
- a.length)}return c+d+e}olympe.ia.node.qa.Ha.Hq=class{constructor(a,b,c){this.R=a;this.C=b;this.G=this.F='';this.L=0;this.Y=c}};olympe.ia.node.qa.Ha.sd={$f:'&',Lh:'|',Wg:'!',NONE:''};const Jk=olympe.ia.node.qa.Ha.ad.gk,Kk=olympe.ia.node.qa.Ha.ad.Al,Lk=olympe.ia.node.qa.Ha.ad.Mh,Mk=olympe.ia.node.qa.Ha.ad.Oj,Nk=olympe.dc.bc.VERSION,Ok=olympe.dc.bc.Nd;function Hj(a,b,c){return x(function*(){yield Jj(a.C);yield b.transaction(d=>x(function*(){const e=()=>d.withSchema(c);for(const f of a.ta)yield f(e);a.ta.length=0;a.jn.clear()}()))}())}
961
- olympe.ia.node.qa.Ha.Jq=class{constructor(a,b){this.N=a;this.C=b;this.Xd=b.Xd;this.jn=new Map;this.ta=[]}wj(a,b,c){a=void 0===c||c?{[Lk]:a}:{};for(const d of b){const [e,f]=d;b=pk(f);a[e]=b.v}return a}F(a,b){b.delete(Ok);b.delete(Nk);this.jn.set(a,b||new Map)}pc(a,b){this.ta.push(c=>{const d=this;return x(function*(){b.delete(Nk);const e=yield Ij(d.Xd,a);yield c().table(e).where(Lk,a).update(d.wj(a,b,!1))}())})}Lc(a){this.ta.push(b=>{const c=this;return x(function*(){var d=yield c.Xd.Wb(a,'');d=yield Ij(c.Xd,
962
- d);var e=olympe.dc.hb.from(d).vb(olympe.dc.CloudObject.G).vd();for(var f of e.keys())e=yield Promise.resolve(f),yield b().table(e).where(Jk,a).del();f=olympe.dc.hb.from(d).vb(olympe.dc.CloudObject.Y).vd();for(const g of f.keys())f=yield Promise.resolve(g),yield b().table(f).where(Kk,a).del();yield b().table(d).where(Lk,a).del()}())})}Oa(a,b,c){a===olympe.dc.jc.Vc?(Sj(this.C,c),this.ta.push(d=>{const e=this;return x(function*(){const f=e.jn.get(b),g=yield Ij(e.Xd,c);c!==olympe.dc.wa(olympe.dm.File)||
963
- f.has(Mk)?(e.Xd.L.set(b,c),yield d().table(g).insert(e.wj(b,f,!0))):yield d().table(g).where(Lk,b).update(e.wj(b,f,!1))}())})):this.ta.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).insert({[Jk]:b,[Kk]:c})}()))}Jb(a,b,c){this.ta.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).where({[Jk]:b,[Kk]:c}).del()}()))}};olympe.ia.node.qa.Ha.Jq.ma=[olympe.dc.eh];function Ij(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function rk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function zk(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
964
- olympe.ia.node.qa.Ha.Yu=class{constructor(){this.L=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static T(a,b,c){return c?b[0][1]:''}ei(a){return Promise.resolve(a)}gb(a){return Promise.resolve(a)}Wb(a){return(a=this.L.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function pk(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=a`${a.Nf().valueOf()}.${a.Hf().valueOf()}.${a.Cf().valueOf()}.${a.Bf().valueOf()}`}return{t:b,v:c}}olympe.ia.node.qa.Ha.lC=class{};olympe.ia.node.host={};olympe.ia.node.host.Kd=function(a,b){this.uid=a;this.N=b};olympe.ia.node.host.Kd.prototype.constructor=olympe.ia.node.host.Kd;olympe.ia.node.host.Kd.prototype.destroy=function(){};olympe.ia.node.host.Kd.prototype.destroy=olympe.ia.node.host.Kd.prototype.destroy;olympe.ia.node.host.Kd.prototype.Za=function(){return this.N};olympe.ia.node.host.Kd.ma=[olympe.host.da.Kd];olympe.ia.node.host.Sp=class{constructor(a){this.N=a}lj(){return!1}Yk(){this.N.error('No history manager implemented in Node')}C(){this.Yk();return Hb()}F(){this.Yk()}};olympe.ia.node.host.Sp.ma=[olympe.host.Bi];olympe.ia.node.host.Xc=class{constructor(){this.C={};this.L={}}destroy(){}R(a){clearTimeout(this.C[a]);delete this.C[a]}aa(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Y(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Rp.register(olympe.host.da.Qp.ir,olympe.ia.node.host.Xc);olympe.ia.node.host.Xc.ma=[olympe.host.da.Xc];olympe.ia.node.host.uk=class{constructor(a){this.N=a}};olympe.ia.node.host.uk.ma=[olympe.host.uk];olympe.U.config(function(a){ra(a,olympe.host.O.Il,olympe.ia.node.host.Sp,olympe.host.O.Ea);ra(a,olympe.host.O.Pq,olympe.ia.node.host.uk,olympe.host.O.Ea)},'olympe.native.node.host');olympe.la.jd={};olympe.la.jd.Ml=class{constructor(a){this.N=a;this.C=new Map}G(){}F(){}};olympe.la.jd.WebSocket=class{constructor(a,b){this.N=b;this.id=a;this.C=null;this.buffer=[];this.G=!1;this.F=this.L=this.R=null}Z(){return this.id}open(a){const b=this.Y(a);b.binaryType='arraybuffer';b.onopen=()=>{this.N.info('Websocket OPENED');this.G=!0;this.R?(this.N.debug('Notifying upper layer for WebSocket#'+this.id),this.R()):this.N.warn('Nothing to notify for WebSocket#'+this.id);this.buffer.forEach(b.send.bind(b));this.buffer.length=0};b.onmessage=c=>{c='string'===typeof c.data?String(c.data):
965
- Ea(c.data);this.N.debug('#'+this.id+' < '+c);this.F&&this.F(c)};b.onclose=()=>{this.G=!1;this.N.debug('WebSocket#'+this.id+' CLOSE');this.L&&this.L()};b.onerror=()=>{this.N.debug('WebSocket#'+this.id+' ERROR')};this.C=b}send(a){this.N.debug('#'+this.id+' > '+a);this.G?this.C.send(a):this.buffer.push(a)}close(){const a=this.C.constructor,b=this.C.readyState;b===a.OPEN||b===a.CONNECTING?(this.N.debug('Force closing native websocket'),this.C.close(1E3)):this.N.debug('Try to force close native websocket, but not open nor connecting')}oa(a){this.R=
966
- a||null}ha(a){this.F=a||null}aa(a){this.L=a||null}Y(){}};olympe.la.jd.WebSocket.ma=[olympe.la.WebSocket];olympe.ia.node.la={};olympe.ia.node.la.gu=class extends olympe.la.va{constructor(a,b){super(a,b);this.aa=new olympe.ia.node.la.Ml(a)}Y(){return'NodeJS'}R(){return olympe.D.ra.F}ha(a){var b=this.G++;a=a.C();this.N.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ia.node.la.hu(b,this.N);b.open(a);return b}C(a,b){this.N.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Sb(this,c,b);this.aa.G(c,{u:a.C(),s:Ob(a),h:Mb(a),p:a.port,z:Nb(a),q:Rb(a),m:a.method,v:a.ej(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
967
- b:a.body,r:a.F},b)}L(){this.N.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.aa}};const Pk=require('fs'),Qk=require('http'),Rk=require('https');
968
- olympe.ia.node.la.Ml=class extends olympe.la.jd.Ml{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,v=b.u,u=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,A)=>new Promise((D,T)=>{Pk.readFile(w,(I,aa)=>{I?T(I):(A[y]=aa,D(A))})});p=w=>{const y=D=>{D.setEncoding(u===olympe.la.fb.ResponseType.vk?'utf-8':'binary');let T='';D.on('data',I=>{T+=I});D.on('end',()=>{if(u!==olympe.la.fb.ResponseType.vk){var I=
969
- (new Uint8Array(Buffer.from(T,'binary'))).buffer;I=u===olympe.la.fb.ResponseType.pl?new Blob([I]):I}else I=T;c(this.F(D.statusCode,D.statusMessage,I,D.headers))})},A=d?new Rk.request(w,y):new Qk.request(w,y);this.C.set(a,()=>{A.destroy()});A.on('error',D=>{c(this.F(0,'Conection refused','Error connecting to '+v+' with method '+f+', code = '+D.code+', message = '+D.message,''))});!e||'POST'!==f&&'PUT'!==f?A.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(D=>{A.write(D instanceof ArrayBuffer?
970
- Buffer.from(D):D);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.N.log('Error loading self signed files:',w)})):this.N.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.N.debug('Received HTTP response',a,c);return new olympe.la.Sg(c,a,b,d)}};olympe.ia.node.la.hu=class extends olympe.la.jd.WebSocket{Y(a){return new (require('ws'))(a)}};olympe.ia.node.la.Config={LB:'native.html.net.useWorkers'};olympe.U.config(function(a){ra(a,olympe.la.O.xa,olympe.ia.node.la.gu,olympe.la.O.Ea,olympe.host.O.xa)},'olympe.native.node.net');olympe.ia.node.la.http={};const Sk=require('fastify'),bl=require('fastify-cors'),cl={Mi:0,tm:1,rk:2};
971
- function dl(a,b){a.F.route({url:b.path,method:b.methods,handler:(c,d)=>{a.N.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.la.Vj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.setHeader(k,l);b.ix(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.N.debug('> HTTP: reply with body:',l instanceof ArrayBuffer?
972
- 'binary':l);d.code(k.Ud()).headers(k.ej()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.N.debug('> HTTP: reply with internal server error:',k);d.code(olympe.la.fb.rd.Eq).header(olympe.la.fb.Headers.Hj,'text/plain').send({error:`Internal server error: ${k}`})})}})}
973
- olympe.ia.node.la.http.Bk=class extends olympe.la.Bk{constructor(a,b,c){super(a);this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.R=null;this.C=cl.Mi;this.Je=new Set}aa(a,b){this.R={origin:'*',methods:a,allowedHeaders:b};return this}L(a,b,c,d){this.G.set(a,{path:b,methods:c,ix:d});switch(this.C){case cl.Mi:return this.start();case cl.rk:return this.stop(),this.start();case cl.tm:return new Promise((e,f)=>{this.Je.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Y(a){this.G.delete(a);
974
- this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===cl.rk&&(this.F.close(),this.C=cl.Mi,this.F=this.createServer())}start(){return this.C===cl.Mi?new Promise((a,b)=>{this.F.register(bl,this.R);for(const c of this.G.values())dl(this,c);this.C=cl.tm;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=cl.rk;this.Je.forEach(e=>e(c));this.Je.clear();c?(this.stop(),b(c)):(this.N.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
975
- Sk({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.U.config(function(a){B(a,olympe.la.O.ym,olympe.ia.node.la.http.Bk,olympe.la.O.Ea,new olympe.U.fa(olympe.la.Config.Jl),new olympe.U.fa(olympe.la.Config.Kl))},'olympe.native.node.net.http');olympe.ia.node.W={};const el=new Map;olympe.ia.node.W.rl=class extends olympe.W.rl{R(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.Ia().C(b))}L(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;el.set(b,a);return b}F(a,b,c){el.has(a)?b(el.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Y(a){el.delete(a)}};olympe.U.config(function(a){ra(a,olympe.W.O.xh,olympe.ia.node.W.rl)},'olympe.native.node.utils');olympe.ia.node.auth={};olympe.ia.node.auth.Tp=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS')}};olympe.ia.node.auth.Tp.ma=[olympe.auth.pk];olympe.U.config(a=>{B(a,olympe.auth.O.kk,olympe.ia.node.auth.Tp)},'olympe.native.node.auth');olympe.ia.node.ic={};olympe.ia.node.ic.Ip=class{constructor(a){this.F={};this.N=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ia.node.ic.Jp(a,this.N));return this.F[a].open()}};olympe.ia.node.ic.Ip.ma=[olympe.ic.Rt];olympe.ia.node.ic.Jp=class{constructor(a,b){this.name=a;this.N=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
976
- b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ia.node.ic.Jp.ma=[olympe.ic.St];olympe.U.config(function(a){B(a,olympe.ic.O.$j,olympe.ia.node.ic.Ip,olympe.ic.O.Ea)},'olympe.native.node.localstorage');olympe.ia.node.storage={};olympe.ia.node.storage.Storage=class{constructor(a){this.N=a}F(a){a&&a('Not Implemented.')}R(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}L(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ia.node.storage.Storage.ma=[olympe.ic.Storage];olympe.U.config(function(a){ra(a,olympe.ic.O.Ni,olympe.ia.node.storage.Storage,olympe.host.O.Ea)},'olympe.native.html.storage');olympe.Eg={};olympe.Eg.Config={VERSION:'version.version',zs:'version.branch',bg:'version.commit',Tu:'version.tag',Mo:'version.olympe-framework',As:'version.build'};olympe.U.config(function(a){E(a,olympe.Eg.Config.VERSION,'');E(a,olympe.Eg.Config.zs,'');E(a,olympe.Eg.Config.bg,'');E(a,olympe.Eg.Config.Tu,'');E(a,olympe.Eg.Config.Mo,'');E(a,olympe.Eg.Config.As,'')},'olympe.main');const fl=require('fs');let wa,va;function gl(a,b){fl.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
977
- function hl(){if(void 0!==wa&&void 0!==va){0===Object.keys(va).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(wa).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.U.Ls(a);
978
- d=a.Za();d.debug('Registering configurations...');d.C++;for(let f=0,g=ka.length;f<g;f++)b=a,c=ka[f],qa(b.N,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);oa(d);d.debug('done registering');a=a.compile();c=a.Za();c.debug('Running run callbacks of container...');for(let f=0,g=la.length;f<g;f++)c.C++,d=la[f],b=a,e=na(b,d.bj()),b.N.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,e),oa(c);c.debug('done calling run callbacks. DI process completed!')}}
979
- olympe.W.Xm('oConfig.json',gl,function(a){va=a;hl()});gl('version.json',function(a){wa=a;hl()});olympe.wc={};olympe.wc.ws=class{run(){}};olympe.wc.va=class{constructor(a,b){this.C=a;this.N=b;this.F=null;this.G='';this.N.info('HC Manager will execute application registered as:',this.C)}rj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.N.log('Application',c,'designated to be launched'):this.N.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.N.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.N.info('Running application:',this.G),
980
- this.F.run()):this.N.error('No app registered under name: '+this.C)}};olympe.wc.rj=function(a,b,c){const d=a.Za();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.wc.Config.ef+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Sd(olympe.wc.O.xa).config([b],function(e,f){f.rj(e,c,b)},'olympe.hc.registerApp')};olympe.wc.O={xa:'hc.Manager',Ea:'hc.Logger'};olympe.wc.Config={ef:'hc.app',Gl:'hc.globalToken'};olympe.U.config(function(a){E(a,olympe.wc.Config.ef,'default');E(a,olympe.wc.Config.Gl,!1);C(a,olympe.wc.O.Ea,[olympe.sa.O.xa],b=>b.Pc('hc'));C(a,olympe.auth.O.Aj,[new olympe.U.fa(olympe.wc.Config.ef),new olympe.U.fa(olympe.wc.Config.Gl)],(b,c)=>new olympe.auth.nl(c?'':b));B(a,olympe.wc.O.xa,olympe.wc.va,new olympe.U.fa(olympe.wc.Config.ef),olympe.wc.O.Ea)},'olympe.hc');
981
- olympe.U.run([olympe.wc.O.xa],a=>a.run(),'olympe.hc');olympe.sc.Yf={};function il(a){a.N.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Pa();if(0<a.C.length){const d=vc(c,a.C,(e,f)=>{if(e){const g=Ti(f);g.run?(a.N.debug('application retrieved: running'),(new olympe.D.Zb('Application execution context',a.F.Fc())).run(()=>{b=!0;g.run(a.F.Qk(g.T()))})):a.N.error('application retrieved: not an Application with a run() method')}else jl(a)});olympe.D.Ia().onDestroy(()=>{wc(c,a.C,d)});Ib(()=>{b||a.N.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
954
+ function Ak(a,b,c,d,e){const f=olympe.ha.node.pa.Ha.Ac.EQUAL,g=olympe.ha.node.pa.Ha.Ac.$f,h=olympe.ha.node.pa.Ha.Ac.Lh,k=olympe.ha.node.pa.Ha.Ac.Wg,l=olympe.ha.node.pa.Ha.Ac.No,n=olympe.ha.node.pa.Ha.Ac.$o,p=olympe.ha.node.pa.Ha.Ac.ap,q=olympe.ha.node.pa.Ha.Ac.yp,r=olympe.ha.node.pa.Ha.Ac.zp,t=olympe.ha.node.pa.Ha.Ac.yq,u=olympe.ha.node.pa.Ha.Ac.Pq;if(1<d.length)Ck(b,olympe.ha.node.pa.Ha.rd.$f,Dk(a,d,olympe.ha.node.pa.Ha.rd.$f,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:Ek(b,e,d,'=',
955
+ y.v,!1);break;case u:a=Fk('.*',b.client.dialect);Ek(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const A=y.relations,D=`cte${a.L++}`,T=new olympe.ha.node.pa.Ha.Kq(a.R,a.C,A),I=olympe.ha.node.pa.Ha.ad.Mh;a.C.with(D,aa=>{for(const [Sk,{Ig:Tk,fh:Uk,name:Vk,filters:Wk,recursive:Xk,Xh:Yk,jh:Zk,ai:$k}]of A.entries())zk(T,aa,Tk,Uk,Vk,Wk,Xk,0===Sk,Zk,$k,Yk);return aa});a.C.whereIn(b.client.raw('??.??',[c,I]),function(aa){aa.select(b.client.raw('??.??',[D,I])).from(D)});break;case q:Ek(b,e,d,'<=',y,'string'===
956
+ typeof y);break;case r:Ek(b,e,d,'<',y,'string'===typeof y);break;case n:Ek(b,e,d,'>=',y,'string'===typeof y);break;case p:Ek(b,e,d,'>',y,'string'===typeof y);break;case g:Ck(b,e,Dk(a,y,olympe.ha.node.pa.Ha.rd.$f,c));break;case h:Ck(b,e,Dk(a,y,olympe.ha.node.pa.Ha.rd.Lh,c));break;case k:Ck(b,olympe.ha.node.pa.Ha.rd.Wg,Dk(a,[y],olympe.ha.node.pa.Ha.rd.Wg,c));break;case t:e=Gk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
957
+ function Bk(a,b,c,d,e){var f=['tagOlympe'];const g=Hk(f,d),h=Hk(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).iD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Hk(a,b){return a.map(c=>`${b}.${c}`)}
958
+ function Ck(a,b,c){switch(b){case olympe.ha.node.pa.Ha.rd.NONE:a.where(c);break;case olympe.ha.node.pa.Ha.rd.$f:a.andWhere(c);break;case olympe.ha.node.pa.Ha.rd.Lh:a.orWhere(c);break;case olympe.ha.node.pa.Ha.rd.Wg:a.whereNot(c);break;default:olympe.sa.Ya('storage').error(`Where operand ${b} not recognized`)}}function Dk(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)Ak(a,e,d,[b[f]],0===f?olympe.ha.node.pa.Ha.rd.NONE:c)}}
959
+ function Ek(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ha.node.pa.Ha.rd.NONE:a.where(c,d,e);break;case olympe.ha.node.pa.Ha.rd.$f:a.andWhere(c,d,e);break;case olympe.ha.node.pa.Ha.rd.Lh:a.orWhere(c,d,e);break;case olympe.ha.node.pa.Ha.rd.Wg:a.whereNot(c,d,e);break;default:olympe.sa.Ya('storage').error(`Where operand ${b} not recognized`)}}function Fk(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
960
+ function Gk(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
961
+ a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[Fk(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,u]=l;d+=t;a=a.substring(u,
962
+ a.length)}return c+d+e}olympe.ha.node.pa.Ha.Kq=class{constructor(a,b,c){this.R=a;this.C=b;this.G=this.F='';this.L=0;this.Y=c}};olympe.ha.node.pa.Ha.rd={$f:'&',Lh:'|',Wg:'!',NONE:''};const Ik=olympe.ha.node.pa.Ha.ad.gk,Jk=olympe.ha.node.pa.Ha.ad.Al,Kk=olympe.ha.node.pa.Ha.ad.Mh,Lk=olympe.ha.node.pa.Ha.ad.Oj,Mk=olympe.dc.bc.VERSION,Nk=olympe.dc.bc.Nd;function Gj(a,b,c){return x(function*(){yield Ij(a.C);yield b.transaction(d=>x(function*(){const e=()=>d.withSchema(c);for(const f of a.ua)yield f(e);a.N.debug(`Transaction after execute operations before commit : ${d.toString()}`);a.ua.length=0;a.kn.clear()}()))}())}
963
+ olympe.ha.node.pa.Ha.Mq=class{constructor(a,b){this.N=a;this.C=b;this.Wd=b.Wd;this.kn=new Map;this.ua=[]}wj(a,b,c){a=void 0===c||c?{[Kk]:a}:{};for(const d of b){const [e,f]=d;b=ok(f);a[e]=b.v}return a}F(a,b){b.delete(Nk);b.delete(Mk);this.kn.set(a,b||new Map)}qc(a,b){this.ua.push(c=>{const d=this;return x(function*(){b.delete(Mk);const e=yield Hj(d.Wd,a);yield c().table(e).where(Kk,a).update(d.wj(a,b,!1))}())})}Mc(a){this.ua.push(b=>{const c=this;return x(function*(){var d=yield c.Wd.Wb(a,'');d=yield Hj(c.Wd,
964
+ d);var e=olympe.dc.hb.from(d).vb(olympe.dc.CloudObject.G).ud();for(var f of e.keys())e=yield Promise.resolve(f),yield b().table(e).where(Ik,a).del();f=olympe.dc.hb.from(d).vb(olympe.dc.CloudObject.Y).ud();for(const g of f.keys())f=yield Promise.resolve(g),yield b().table(f).where(Jk,a).del();yield b().table(d).where(Kk,a).del()}())})}Oa(a,b,c){a===olympe.dc.jc.Wc?(Rj(this.C,c),this.ua.push(d=>{const e=this;return x(function*(){const f=e.kn.get(b),g=yield Hj(e.Wd,c);c!==olympe.dc.wa(olympe.dm.File)||
965
+ f.has(Lk)?(e.Wd.L.set(b,c),yield d().table(g).insert(e.wj(b,f,!0))):yield d().table(g).where(Kk,b).update(e.wj(b,f,!1))}())})):this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).insert({[Ik]:b,[Jk]:c})}()))}Jb(a,b,c){this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d().table(e).where({[Ik]:b,[Jk]:c}).del()}()))}};olympe.ha.node.pa.Ha.Mq.ma=[olympe.dc.eh];function Hj(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function qk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function yk(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
966
+ olympe.ha.node.pa.Ha.bv=class{constructor(){this.L=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static T(a,b,c){return c?b[0][1]:''}ei(a){return Promise.resolve(a)}gb(a){return Promise.resolve(a)}Wb(a){return(a=this.L.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function ok(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=a`${a.Nf().valueOf()}.${a.Hf().valueOf()}.${a.Cf().valueOf()}.${a.Bf().valueOf()}`}return{t:b,v:c}}olympe.ha.node.pa.Ha.pC=class{};olympe.ha.node.host={};olympe.ha.node.host.Kd=function(a,b){this.uid=a;this.N=b};olympe.ha.node.host.Kd.prototype.constructor=olympe.ha.node.host.Kd;olympe.ha.node.host.Kd.prototype.destroy=function(){};olympe.ha.node.host.Kd.prototype.destroy=olympe.ha.node.host.Kd.prototype.destroy;olympe.ha.node.host.Kd.prototype.Ya=function(){return this.N};olympe.ha.node.host.Kd.ma=[olympe.host.ba.Kd];olympe.ha.node.host.Vp=class{constructor(a){this.N=a}lj(){return!1}Yk(){this.N.error('No history manager implemented in Node')}C(){this.Yk();return Hb()}F(){this.Yk()}};olympe.ha.node.host.Vp.ma=[olympe.host.Bi];olympe.ha.node.host.Yc=class{constructor(){this.C={};this.L={}}destroy(){}R(a){clearTimeout(this.C[a]);delete this.C[a]}ea(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Y(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Up.register(olympe.host.ba.Tp.lr,olympe.ha.node.host.Yc);olympe.ha.node.host.Yc.ma=[olympe.host.ba.Yc];olympe.ha.node.host.uk=class{constructor(a){this.N=a}};olympe.ha.node.host.uk.ma=[olympe.host.uk];olympe.U.config(function(a){ra(a,olympe.host.O.Il,olympe.ha.node.host.Vp,olympe.host.O.Ea);ra(a,olympe.host.O.Sq,olympe.ha.node.host.uk,olympe.host.O.Ea)},'olympe.native.node.host');olympe.la.jd={};olympe.la.jd.Ml=class{constructor(a){this.N=a;this.C=new Map}G(){}F(){}};olympe.la.jd.WebSocket=class{constructor(a,b){this.N=b;this.id=a;this.C=null;this.buffer=[];this.G=!1;this.F=this.L=this.R=null}Z(){return this.id}open(a){const b=this.Y(a);b.binaryType='arraybuffer';b.onopen=()=>{this.N.info('Websocket OPENED');this.G=!0;this.R?(this.N.debug('Notifying upper layer for WebSocket#'+this.id),this.R()):this.N.warn('Nothing to notify for WebSocket#'+this.id);this.buffer.forEach(b.send.bind(b));this.buffer.length=0};b.onmessage=c=>{c='string'===typeof c.data?String(c.data):
967
+ Ea(c.data);this.N.debug('#'+this.id+' < '+c);this.F&&this.F(c)};b.onclose=()=>{this.G=!1;this.N.debug('WebSocket#'+this.id+' CLOSE');this.L&&this.L()};b.onerror=()=>{this.N.debug('WebSocket#'+this.id+' ERROR')};this.C=b}send(a){this.N.debug('#'+this.id+' > '+a);this.G?this.C.send(a):this.buffer.push(a)}close(){const a=this.C.constructor,b=this.C.readyState;b===a.OPEN||b===a.CONNECTING?(this.N.debug('Force closing native websocket'),this.C.close(1E3)):this.N.debug('Try to force close native websocket, but not open nor connecting')}qa(a){this.R=
968
+ a||null}ka(a){this.F=a||null}ea(a){this.L=a||null}Y(){}};olympe.la.jd.WebSocket.ma=[olympe.la.WebSocket];olympe.ha.node.la={};olympe.ha.node.la.ku=class extends olympe.la.ta{constructor(a,b){super(a,b);this.ea=new olympe.ha.node.la.Ml(a)}Y(){return'NodeJS'}R(){return olympe.D.ra.F}ka(a){var b=this.G++;a=a.C();this.N.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ha.node.la.lu(b,this.N);b.open(a);return b}C(a,b){this.N.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Sb(this,c,b);this.ea.G(c,{u:a.C(),s:Ob(a),h:Mb(a),p:a.port,z:Nb(a),q:Rb(a),m:a.method,v:a.ej(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
969
+ b:a.body,r:a.F},b)}L(){this.N.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.ea}};const Ok=require('fs'),Pk=require('http'),Qk=require('https');
970
+ olympe.ha.node.la.Ml=class extends olympe.la.jd.Ml{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,v=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,A)=>new Promise((D,T)=>{Ok.readFile(w,(I,aa)=>{I?T(I):(A[y]=aa,D(A))})});p=w=>{const y=D=>{D.setEncoding(v===olympe.la.fb.ResponseType.vk?'utf-8':'binary');let T='';D.on('data',I=>{T+=I});D.on('end',()=>{if(v!==olympe.la.fb.ResponseType.vk){var I=
971
+ (new Uint8Array(Buffer.from(T,'binary'))).buffer;I=v===olympe.la.fb.ResponseType.pl?new Blob([I]):I}else I=T;c(this.F(D.statusCode,D.statusMessage,I,D.headers))})},A=d?new Qk.request(w,y):new Pk.request(w,y);this.C.set(a,()=>{A.destroy()});A.on('error',D=>{c(this.F(0,'Conection refused','Error connecting to '+u+' with method '+f+', code = '+D.code+', message = '+D.message,''))});!e||'POST'!==f&&'PUT'!==f?A.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(D=>{A.write(D instanceof ArrayBuffer?
972
+ Buffer.from(D):D);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.N.log('Error loading self signed files:',w)})):this.N.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.N.debug('Received HTTP response',a,c);return new olympe.la.Sg(c,a,b,d)}};olympe.ha.node.la.lu=class extends olympe.la.jd.WebSocket{Y(a){return new (require('ws'))(a)}};olympe.ha.node.la.Config={PB:'native.html.net.useWorkers'};olympe.U.config(function(a){ra(a,olympe.la.O.xa,olympe.ha.node.la.ku,olympe.la.O.Ea,olympe.host.O.xa)},'olympe.native.node.net');olympe.ha.node.la.http={};const Rk=require('fastify'),al=require('fastify-cors'),bl={Mi:0,um:1,rk:2};
973
+ function cl(a,b){a.F.route({url:b.path,method:b.methods,handler:(c,d)=>{a.N.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.la.Vj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.setHeader(k,l);b.mx(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.N.debug('> HTTP: reply with body:',l instanceof ArrayBuffer?
974
+ 'binary':l);d.code(k.Td()).headers(k.ej()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.N.debug('> HTTP: reply with internal server error:',k);d.code(olympe.la.fb.qd.Hq).header(olympe.la.fb.Headers.Hj,'text/plain').send({error:`Internal server error: ${k}`})})}})}
975
+ olympe.ha.node.la.http.Bk=class extends olympe.la.Bk{constructor(a,b,c){super(a);this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.R=null;this.C=bl.Mi;this.Je=new Set}ea(a,b){this.R={origin:'*',methods:a,allowedHeaders:b};return this}L(a,b,c,d){this.G.set(a,{path:b,methods:c,mx:d});switch(this.C){case bl.Mi:return this.start();case bl.rk:return this.stop(),this.start();case bl.um:return new Promise((e,f)=>{this.Je.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Y(a){this.G.delete(a);
976
+ this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===bl.rk&&(this.F.close(),this.C=bl.Mi,this.F=this.createServer())}start(){return this.C===bl.Mi?new Promise((a,b)=>{this.F.register(al,this.R);for(const c of this.G.values())cl(this,c);this.C=bl.um;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=bl.rk;this.Je.forEach(e=>e(c));this.Je.clear();c?(this.stop(),b(c)):(this.N.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
977
+ Rk({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.U.config(function(a){B(a,olympe.la.O.zm,olympe.ha.node.la.http.Bk,olympe.la.O.Ea,new olympe.U.fa(olympe.la.Config.Jl),new olympe.U.fa(olympe.la.Config.Kl))},'olympe.native.node.net.http');olympe.ha.node.W={};const dl=new Map;olympe.ha.node.W.rl=class extends olympe.W.rl{R(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.Ia().C(b))}L(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;dl.set(b,a);return b}F(a,b,c){dl.has(a)?b(dl.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Y(a){dl.delete(a)}};olympe.U.config(function(a){ra(a,olympe.W.O.xh,olympe.ha.node.W.rl)},'olympe.native.node.utils');olympe.ha.node.auth={};olympe.ha.node.auth.Wp=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.ha.node.auth.Wp.ma=[olympe.auth.pk];olympe.U.config(a=>{B(a,olympe.auth.O.kk,olympe.ha.node.auth.Wp)},'olympe.native.node.auth');olympe.ha.node.ic={};olympe.ha.node.ic.Lp=class{constructor(a){this.F={};this.N=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ha.node.ic.Mp(a,this.N));return this.F[a].open()}};olympe.ha.node.ic.Lp.ma=[olympe.ic.Vt];olympe.ha.node.ic.Mp=class{constructor(a,b){this.name=a;this.N=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
978
+ b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ha.node.ic.Mp.ma=[olympe.ic.Wt];olympe.U.config(function(a){B(a,olympe.ic.O.$j,olympe.ha.node.ic.Lp,olympe.ic.O.Ea)},'olympe.native.node.localstorage');olympe.ha.node.storage={};olympe.ha.node.storage.Storage=class{constructor(a){this.N=a}F(a){a&&a('Not Implemented.')}R(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}L(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ha.node.storage.Storage.ma=[olympe.ic.Storage];olympe.U.config(function(a){ra(a,olympe.ic.O.Ni,olympe.ha.node.storage.Storage,olympe.host.O.Ea)},'olympe.native.html.storage');olympe.Eg={};olympe.Eg.Config={VERSION:'version.version',Ds:'version.branch',bg:'version.commit',Xu:'version.tag',Oo:'version.olympe-framework',Es:'version.build'};olympe.U.config(function(a){E(a,olympe.Eg.Config.VERSION,'');E(a,olympe.Eg.Config.Ds,'');E(a,olympe.Eg.Config.bg,'');E(a,olympe.Eg.Config.Xu,'');E(a,olympe.Eg.Config.Oo,'');E(a,olympe.Eg.Config.Es,'')},'olympe.main');const el=require('fs');let wa,va;function fl(a,b){el.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
979
+ function gl(){if(void 0!==wa&&void 0!==va){0===Object.keys(va).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(wa).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.U.Ps(a);
980
+ d=a.Ya();d.debug('Registering configurations...');d.C++;for(let f=0,g=ka.length;f<g;f++)b=a,c=ka[f],qa(b.N,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);oa(d);d.debug('done registering');a=a.compile();c=a.Ya();c.debug('Running run callbacks of container...');for(let f=0,g=la.length;f<g;f++)c.C++,d=la[f],b=a,e=na(b,d.bj()),b.N.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,e),oa(c);c.debug('done calling run callbacks. DI process completed!')}}
981
+ olympe.W.Ym('oConfig.json',fl,function(a){va=a;gl()});fl('version.json',function(a){wa=a;gl()});olympe.wc={};olympe.wc.As=class{run(){}};olympe.wc.ta=class{constructor(a,b){this.C=a;this.N=b;this.F=null;this.G='';this.N.info('HC Manager will execute application registered as:',this.C)}rj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.N.log('Application',c,'designated to be launched'):this.N.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.N.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.N.info('Running application:',this.G),
982
+ this.F.run()):this.N.error('No app registered under name: '+this.C)}};olympe.wc.rj=function(a,b,c){const d=a.Ya();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.wc.Config.ef+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Rd(olympe.wc.O.xa).config([b],function(e,f){f.rj(e,c,b)},'olympe.hc.registerApp')};olympe.wc.O={xa:'hc.Manager',Ea:'hc.Logger'};olympe.wc.Config={ef:'hc.app',Gl:'hc.globalToken'};olympe.U.config(function(a){E(a,olympe.wc.Config.ef,'default');E(a,olympe.wc.Config.Gl,!1);C(a,olympe.wc.O.Ea,[olympe.sa.O.xa],b=>b.Qc('hc'));C(a,olympe.auth.O.Aj,[new olympe.U.fa(olympe.wc.Config.ef),new olympe.U.fa(olympe.wc.Config.Gl)],(b,c)=>new olympe.auth.nl(c?'':b));B(a,olympe.wc.O.xa,olympe.wc.ta,new olympe.U.fa(olympe.wc.Config.ef),olympe.wc.O.Ea)},'olympe.hc');
983
+ olympe.U.run([olympe.wc.O.xa],a=>a.run(),'olympe.hc');olympe.sc.Yf={};function hl(a){a.N.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Pa();if(0<a.C.length){const d=uc(c,a.C,(e,f)=>{if(e){const g=Si(f);g.run?(a.N.debug('application retrieved: running'),(new olympe.D.Zb('Application execution context',a.F.Fc())).run(()=>{b=!0;g.run(a.F.Qk(g.T()))})):a.N.error('application retrieved: not an Application with a run() method')}else il(a)});olympe.D.Ia().onDestroy(()=>{vc(c,a.C,d)});Ib(()=>{b||a.N.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
982
984
  1E4)}}
983
- function kl(a,b){if(a.L)a.N.debug('Sending getContext request'),Tf(a.R,d=>{d?a.N.error('failed to synchronise (authenticated) with server: '+d.message):(a.N.debug('synchronisation request successful'),aj=a.C,b())});else{var c=olympe.dc.Hd.SUBSCRIBE;const d=olympe.dc.Hd.Ii,e=a.F.Wk()?d:c;a.N.debug((a.F.Wk()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ia();c=new olympe.async.sk(f);c.add((g,h)=>{Ze(new olympe.dc.hf(a.C,e),olympe.dc.Ub.rf).ib(k=>{var l=olympe.dc.Ka;var n=(n=olympe.dc.nd.from(a.C).vb(olympe.sc.La.Me.C).vb(olympe.sc.logic.ae.L.Rc()).vd())&&n.T()||
984
- olympe.dc.Ka.Wc;l.qc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.yc([a.G.Cg()],h=>{(new olympe.dc.Ba(h)).Je(f.C(g))})});c.add((g,h)=>{const k=olympe.sc.ld.C.zp,l=olympe.sc.ld.C.Zl;bj(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});Xb(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function jl(a){a.N.debug('Stop the application');a.F.Fc().aa()}
985
- olympe.sc.Yf.rm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.R=b;this.N=c;this.F=d;this.C=e;this.L=f;this.Y=g||!1}run(){const a=olympe.auth.va.C.Lg,b=olympe.auth.va.C.gf,c=olympe.auth.va.C.Dh,d=olympe.auth.va.C.ni;this.N.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(il(this),e=!0)};olympe.D.yc([this.G.getState()],g=>{switch(g){case a:case c:this.N.debug('Server session opened, calling once connected callback');kl(this,f);break;case b:this.N.debug('Disconnected, working offline.');
986
- this.Y&&!e&&kl(this,f);break;case d:this.N.debug('waiting for authentication');break;default:this.N.debug('No server session available, waiting for connection'),e=!1,jl(this)}},'Runtime initial auth state listener')}};olympe.sc.Yf.rm.C='app_instance';olympe.sc.Yf.rm.ma=[olympe.wc.ws];olympe.sc.Yf.Dj={rf:'sc.runtime.Main'};
987
- olympe.U.config(function(a){C(a,olympe.auth.O.Aj,[new olympe.U.fa(olympe.wc.Config.ef),new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.wc.Config.Gl)],(b,c,d)=>new olympe.auth.nl(d?'':b+(c?'-'+c:'')));B(a,olympe.sc.Yf.Dj.rf,olympe.sc.Yf.rm,olympe.auth.O.xa,olympe.dc.query.O.xa,olympe.sc.O.Ea,olympe.sc.O.qm,new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.dc.Config.Yg),new olympe.U.fa(olympe.sc.Config.Up));olympe.wc.rj(a,olympe.sc.Yf.Dj.rf,'sc.runtime');olympe.wc.rj(a,olympe.sc.Yf.Dj.rf,
988
- 'sc.headless');olympe.wc.rj(a,olympe.sc.Yf.Dj.rf)},'olympe.sc.runtime');olympe.public={};function ll(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{gc(olympe.public.Ua.get(),c,b,()=>{d()})})}
989
- olympe.public.Ua=class{static cw(a,b){return olympe.auth.Hb.Ee.$i(a,b)}static getState(){return lc(olympe.public.Ua.get())}static lw(){return olympe.D.Ya(olympe.public.Ua.get().Cg())}static Px(a){const b=new olympe.D.Zb('Observe user tag','function'===typeof a.Fc?a.Fc():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.yc([olympe.public.Ua.get().Cg()],d=>{c.next(d);olympe.D.Ia().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static hd(){return olympe.D.Ya(oc(olympe.public.Ua.get()))}static zw(){return olympe.D.Ya(olympe.public.Ua.get().ci())||
990
- void 0}static ii(){olympe.public.Ua.get().ii()}static oh(a){return new Promise((b,c)=>{olympe.public.Ua.get().oh(a,d=>d?c(d):b())})}static vx(a,b){return ll((new Map).set('username',a).set('password',b),'srp')}static ux(){return ll(new Map,'saml')}static wx(a,b){return ll((new Map).set('username',a).set('nonce',b),'localToken')}static tx(){return ll(new Map,'openID')}static sn(){return new Promise(a=>{nc(()=>{olympe.public.Ua.get().oa.delete('logoutCallback');a()});olympe.public.Ua.get().sn()})}static get(){return olympe.auth.Sc()}};
991
- olympe.public.Ua.logout=olympe.public.Ua.sn;olympe.public.Ua.loginOpenID=olympe.public.Ua.tx;olympe.public.Ua.loginToken=olympe.public.Ua.wx;olympe.public.Ua.loginSAML=olympe.public.Ua.ux;olympe.public.Ua.loginSRP=olympe.public.Ua.vx;olympe.public.Ua.getUserFromToken=olympe.public.Ua.oh;olympe.public.Ua.sendKeepAlive=olympe.public.Ua.ii;olympe.public.Ua.getIDPToken=olympe.public.Ua.zw;olympe.public.Ua.getToken=olympe.public.Ua.hd;olympe.public.Ua.observeUser=olympe.public.Ua.Px;
992
- olympe.public.Ua.getCurrentUser=olympe.public.Ua.lw;olympe.public.Ua.getState=olympe.public.Ua.getState;olympe.public.Ua.generateSRPData=olympe.public.Ua.cw;olympe.public.ab=class{static create(a){return new class extends olympe.dc.V.Mg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Mc(olympe.D.ra),e=b.subscribe(f=>d.update(olympe.D.Bc(f)));olympe.D.Ia().xc(()=>e.unsubscribe());return d.Eb()}}}};
993
- olympe.public.Ne=class{static create(a){return new class extends olympe.dc.Db.Mg{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.Mc(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.za(f)));olympe.D.Ia().xc(()=>e.unsubscribe());return d.Eb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.ua.Relation,Direction:olympe.dc.Aa,generateTag:olympe.W.aj,tagToString:olympe.dc.wa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.ih,defineInverseRelation:olympe.dc.Kv,BrickContext:olympe.sc.Va,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Va.jg,registerBrick:olympe.sc.logic.Ca.C,FunctionBrick:olympe.sc.logic.Function,
994
- Context:olympe.sc.Va,Entry:olympe.dc.ua.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.dm.File,User:olympe.dm.User,Enum:olympe.dm.gg,EnumValue:olympe.dm.Enum,Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.ri,QueryResult:olympe.dc.Wa,Query:olympe.dc.hb,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.da.ab,
995
- RelatedTo:olympe.dc.da.V.De,Order:olympe.dc.da.aq,Config:class{static getParameter(a){return olympe.U.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.ya.pb.ga,Service:olympe.H.ya.pb.Bb,RequestType:olympe.H.ya.Kb.Request.ka,Auth:olympe.public.Ua,AuthState:{INIT:olympe.auth.va.C.INIT,DISCONNECTED:olympe.auth.va.C.gf,GUEST:olympe.auth.va.C.Dh,AUTHENTICATING:olympe.auth.va.C.ni,ERROR:olympe.auth.va.C.rc,AUTHENTICATED:olympe.auth.va.C.Lg},Sync:olympe.dc.CloudObject,
985
+ function jl(a,b){if(a.L)a.N.debug('Sending getContext request'),Sf(a.R,d=>{d?a.N.error('failed to synchronise (authenticated) with server: '+d.message):(a.N.debug('synchronisation request successful'),$i=a.C,b())});else{var c=olympe.dc.Hd.SUBSCRIBE;const d=olympe.dc.Hd.Ii,e=a.F.Wk()?d:c;a.N.debug((a.F.Wk()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ia();c=new olympe.async.sk(f);c.add((g,h)=>{Xe(new olympe.dc.hf(a.C,e),olympe.dc.Ub.rf).ib(k=>{var l=olympe.dc.Ka;var n=(n=olympe.dc.nd.from(a.C).vb(olympe.sc.La.Me.C).vb(olympe.sc.logic.$d.L.Sc()).ud())&&n.T()||
986
+ olympe.dc.Ka.Xc;l.rc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.yc([a.G.Cg()],h=>{(new olympe.dc.Ba(h)).Je(f.C(g))})});c.add((g,h)=>{const k=olympe.sc.ld.C.Cp,l=olympe.sc.ld.C.Zl;aj(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});Xb(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function il(a){a.N.debug('Stop the application');a.F.Fc().ea()}
987
+ olympe.sc.Yf.sm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.R=b;this.N=c;this.F=d;this.C=e;this.L=f;this.Y=g||!1}run(){const a=olympe.auth.ta.C.Lg,b=olympe.auth.ta.C.gf,c=olympe.auth.ta.C.Dh,d=olympe.auth.ta.C.ni;this.N.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(hl(this),e=!0)};olympe.D.yc([this.G.getState()],g=>{switch(g){case a:case c:this.N.debug('Server session opened, calling once connected callback');jl(this,f);break;case b:this.N.debug('Disconnected, working offline.');
988
+ this.Y&&!e&&jl(this,f);break;case d:this.N.debug('waiting for authentication');break;default:this.N.debug('No server session available, waiting for connection'),e=!1,il(this)}},'Runtime initial auth state listener')}};olympe.sc.Yf.sm.C='app_instance';olympe.sc.Yf.sm.ma=[olympe.wc.As];olympe.sc.Yf.Dj={rf:'sc.runtime.Main'};
989
+ olympe.U.config(function(a){C(a,olympe.auth.O.Aj,[new olympe.U.fa(olympe.wc.Config.ef),new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.wc.Config.Gl)],(b,c,d)=>new olympe.auth.nl(d?'':b+(c?'-'+c:'')));B(a,olympe.sc.Yf.Dj.rf,olympe.sc.Yf.sm,olympe.auth.O.xa,olympe.dc.query.O.xa,olympe.sc.O.Ea,olympe.sc.O.rm,new olympe.U.fa(olympe.sc.Config.ef),new olympe.U.fa(olympe.dc.Config.Yg),new olympe.U.fa(olympe.sc.Config.Xp));olympe.wc.rj(a,olympe.sc.Yf.Dj.rf,'sc.runtime');olympe.wc.rj(a,olympe.sc.Yf.Dj.rf,
990
+ 'sc.headless');olympe.wc.rj(a,olympe.sc.Yf.Dj.rf)},'olympe.sc.runtime');olympe.public={};function kl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{gc(olympe.public.Ua.get(),c,b,()=>{d()})})}
991
+ olympe.public.Ua=class{static gw(a,b){return olympe.auth.Hb.Ee.$i(a,b)}static getState(){return kc(olympe.public.Ua.get())}static pw(){return olympe.D.Za(olympe.public.Ua.get().Cg())}static Tx(a){const b=new olympe.D.Zb('Observe user tag','function'===typeof a.Fc?a.Fc():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.yc([olympe.public.Ua.get().Cg()],d=>{c.next(d);olympe.D.Ia().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static hd(){return olympe.D.Za(nc(olympe.public.Ua.get()))}static Dw(){return olympe.D.Za(olympe.public.Ua.get().ci())||
992
+ void 0}static ii(){olympe.public.Ua.get().ii()}static oh(a){return new Promise((b,c)=>{olympe.public.Ua.get().oh(a,d=>d?c(d):b())})}static zx(a,b){return kl((new Map).set('username',a).set('password',b),'srp')}static yx(){return kl(new Map,'saml')}static Ax(a,b){return kl((new Map).set('username',a).set('nonce',b),'localToken')}static xx(){return kl(new Map,'openID')}static tn(){return new Promise(a=>{mc(()=>{olympe.public.Ua.get().qa.delete('logoutCallback');a()});olympe.public.Ua.get().tn()})}static get(){return olympe.auth.Tc()}};
993
+ olympe.public.Ua.logout=olympe.public.Ua.tn;olympe.public.Ua.loginOpenID=olympe.public.Ua.xx;olympe.public.Ua.loginToken=olympe.public.Ua.Ax;olympe.public.Ua.loginSAML=olympe.public.Ua.yx;olympe.public.Ua.loginSRP=olympe.public.Ua.zx;olympe.public.Ua.getUserFromToken=olympe.public.Ua.oh;olympe.public.Ua.sendKeepAlive=olympe.public.Ua.ii;olympe.public.Ua.getIDPToken=olympe.public.Ua.Dw;olympe.public.Ua.getToken=olympe.public.Ua.hd;olympe.public.Ua.observeUser=olympe.public.Ua.Tx;
994
+ olympe.public.Ua.getCurrentUser=olympe.public.Ua.pw;olympe.public.Ua.getState=olympe.public.Ua.getState;olympe.public.Ua.generateSRPData=olympe.public.Ua.gw;olympe.public.bb=class{static create(a){return new class extends olympe.dc.V.Mg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Nc(olympe.D.ra),e=b.subscribe(f=>d.update(olympe.D.Bc(f)));olympe.D.Ia().xc(()=>e.unsubscribe());return d.Eb()}}}};
995
+ olympe.public.Ne=class{static create(a){return new class extends olympe.dc.Db.Mg{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.Nc(olympe.D.da),e=b.subscribe(f=>d.update(olympe.D.za(f)));olympe.D.Ia().xc(()=>e.unsubscribe());return d.Eb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.va.Relation,Direction:olympe.dc.Aa,generateTag:olympe.W.aj,tagToString:olympe.dc.wa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.ih,defineInverseRelation:olympe.dc.Ov,BrickContext:olympe.sc.Va,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Va.jg,registerBrick:olympe.sc.logic.Ca.C,FunctionBrick:olympe.sc.logic.Function,
996
+ Context:olympe.sc.Va,Entry:olympe.dc.va.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.dm.File,User:olympe.dm.User,Enum:olympe.dm.gg,EnumValue:olympe.dm.Enum,Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.ri,QueryResult:olympe.dc.Wa,Query:olympe.dc.hb,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.ba.bb,
997
+ RelatedTo:olympe.dc.ba.V.De,Order:olympe.dc.ba.eq,Config:class{static getParameter(a){return olympe.U.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.ya.pb.ga,Service:olympe.H.ya.pb.Bb,RequestType:olympe.H.ya.Kb.Request.ja,Auth:olympe.public.Ua,AuthState:{INIT:olympe.auth.ta.C.INIT,DISCONNECTED:olympe.auth.ta.C.gf,GUEST:olympe.auth.ta.C.Dh,AUTHENTICATING:olympe.auth.ta.C.ni,ERROR:olympe.auth.ta.C.tc,AUTHENTICATED:olympe.auth.ta.C.Lg},Sync:olympe.dc.CloudObject,
996
998
  BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.jb{static get(){return olympe.dc.Pa()}},ListDef:olympe.dc.Ba,instanceToTag:olympe.dc.wa,registerSync:olympe.dc.Ca.C,getUniqueTag:olympe.W.aj,onDestroy:a=>olympe.D.Ia().onDestroy(a),offDestroy:a=>
997
- olympe.D.Ia().Ie(a),FollowRules:olympe.dc.Ub,transformers:{Related:olympe.dc.X.Sb,RecursiveRelated:olympe.dc.X.Dc,Distinct:olympe.dc.X.Gd,Filter:olympe.dc.X.tc,Limit:olympe.dc.X.ce,Sort:olympe.dc.X.Od,Union:olympe.dc.X.uf},ListDefPredicate:olympe.public.ab,predicates:{And:olympe.dc.V.Yd,Or:olympe.dc.V.ee,Not:olympe.dc.V.md,Equals:olympe.dc.V.Ic,Contains:olympe.dc.V.Uc,Greater:olympe.dc.V.ye,Smaller:olympe.dc.V.Fe,HasRelated:olympe.dc.V.jf,InstanceOf:olympe.dc.V.kf,Regex:olympe.dc.V.Ad},Comparator:olympe.public.Ne,
998
- comparators:{Number:olympe.dc.Db.Number,String:olympe.dc.Db.String,DateTime:olympe.dc.Db.DateTime},valuedefs:{BooleanProperty:olympe.dc.na.ve,StringProperty:olympe.dc.na.qe,NumberProperty:olympe.dc.na.me,DateTimeProperty:olympe.dc.na.le,Constant:olympe.dc.na.bd,Tag:olympe.dc.na.sf}});
999
+ olympe.D.Ia().Ie(a),FollowRules:olympe.dc.Ub,transformers:{Related:olympe.dc.X.Sb,RecursiveRelated:olympe.dc.X.Dc,Distinct:olympe.dc.X.Gd,Filter:olympe.dc.X.uc,Limit:olympe.dc.X.be,Sort:olympe.dc.X.Od,Union:olympe.dc.X.uf},ListDefPredicate:olympe.public.bb,predicates:{And:olympe.dc.V.Xd,Or:olympe.dc.V.de,Not:olympe.dc.V.md,Equals:olympe.dc.V.Ic,Contains:olympe.dc.V.Vc,Greater:olympe.dc.V.ye,Smaller:olympe.dc.V.Fe,HasRelated:olympe.dc.V.jf,InstanceOf:olympe.dc.V.kf,Regex:olympe.dc.V.zd},Comparator:olympe.public.Ne,
1000
+ comparators:{Number:olympe.dc.Db.Number,String:olympe.dc.Db.String,DateTime:olympe.dc.Db.DateTime},valuedefs:{BooleanProperty:olympe.dc.oa.ve,StringProperty:olympe.dc.oa.qe,NumberProperty:olympe.dc.oa.me,DateTimeProperty:olympe.dc.oa.le,Constant:olympe.dc.oa.bd,Tag:olympe.dc.oa.sf}});
999
1001
 
1000
1002
 
1001
1003
  }.bind(this))();